LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out the related Code Repository Files or visit the LabVIEW Wiki Development Environment Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Could VI tags replace INI file?
normandinf
post Aug 22 2008, 01:11 PM
Post #1


Extremely Active
****

Premium Member
Posts: 272
Joined: 18-January 08
From: Montréal, Canada
Member No.: 10515
Using LabVIEW Since:2000
LV:8.6 ,8.5 ,.
ca_quebec Canada Nothing Selected


Aside from tagging VIs for code maintenance purposes, I was wondering this morning if I shouldn't experiment with VI tags to replace INI settings that could be changed by the user, but only from the UI. I've seen comments that it would be more secure under certain circumstances.

Any thoughts as to how smart a move that would be in general?

I already hear that it's nice to see quickly from a text file what are the settings and I agree. But what about making sure ini keys are properly set? Changing them from inside the VI could enforce that. Besides, there is no way the file could be missing altogether... VI tags are easily found in Invoke node and can contain any data type. (I can foresee a nice OpenG set of VIs for that...)



Tags
VI Tag    
Go to the top of the page
+Quote Post
Ad
post Aug 22 2008, 01:11 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Aristos Queue
post Aug 22 2008, 01:51 PM
Post #2


LV R&D Envoy
*****

NI
Posts: 1226
Joined: 15-August 06
From: Austin, TX
Member No.: 5877
Using LabVIEW Since:2000
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected My Gallery


You cannot set tags in the runtime engine because you cannot change the VI (there's no ability to Save).

--------------------
"A VI outside a class is a gun without a safety. Data outside a class is a target."
--- A message from LabVOOP R&D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
normandinf
post Aug 22 2008, 02:09 PM
Post #3


Extremely Active
****

Premium Member
Posts: 272
Joined: 18-January 08
From: Montréal, Canada
Member No.: 10515
Using LabVIEW Since:2000
LV:8.6 ,8.5 ,.
ca_quebec Canada Nothing Selected


QUOTE (Aristos Queue @ Aug 22 2008, 09:51 AM) *
You cannot set tags in the runtime engine because you cannot change the VI (there's no ability to Save).


It works on library though. Will there be any way to save them for VIs in the future?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Darren
post Aug 22 2008, 03:13 PM
Post #4


Very Active
***

NI
Posts: 213
Joined: 14-March 06
From: Austin, TX
Member No.: 4441
Using LabVIEW Since:1999
LV:8.6 ,8.5 ,8.0
us_texas United States Nothing Selected


QUOTE (normandinf @ Aug 22 2008, 08:11 AM) *
VI tags are easily found in Invoke node and can contain any data type. (I can foresee a nice OpenG set of VIs for that...)

In LabVIEW 8.6 there is a small set of VIs that deal with VI and object tags. They are located at [LabVIEW 8.6]\vi.lib\UserTags. Let me know if you have any feedback on them.

-D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jlokanis
post Aug 22 2008, 05:20 PM
Post #5


Very Active
***

Member
Posts: 163
Joined: 14-June 05
From: Seattle, WA
Member No.: 2411
Using LabVIEW Since:1993
LV:8.5.1 ,8.20 ,7.1.1
United States Nothing Selected Nothing Selected


If you are worried about the user editing an INI file and putting in bad values, my solution is to use a small XML file and an .XSD (schema) file. When the app boots, it reads the xml file for its 'ini' settings. I first validate the XML against the schema to verify it has no errors. If they messed up the XML, then the app will report the error and what line is invalid, then exit.
This is not that hard to do if you have used any .NET functions before in your LabVIEW code. I can post some examples if that would help.

-John


--------------------
---------
You mean you still use a keyboard to write your code? How quaint...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Neville D
post Aug 22 2008, 05:55 PM
Post #6


Extremely Active
****

Member
Posts: 508
Joined: 2-August 05
Member No.: 2680
Using LabVIEW Since:1996
LV:8.5.1 ,8.6 ,.
Canada Nothing Selected Nothing Selected


QUOTE (jlokanis @ Aug 22 2008, 10:20 AM) *
If you are worried about the user editing an INI file and putting in bad values, my solution is to use a small XML file and an .XSD (schema) file. When the app boots, it reads the xml file for its 'ini' settings. I first validate the XML against the schema to verify it has no errors. If they messed up the XML, then the app will report the error and what line is invalid, then exit.
This is not that hard to do if you have used any .NET functions before in your LabVIEW code. I can post some examples if that would help.

-John


Can you post an example. It would be helpful, though I may not be able to use for RT apps where I read ini settings from xml.

Thanks,

N.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
normandinf
post Aug 22 2008, 06:04 PM
Post #7


Extremely Active
****

Premium Member
Posts: 272
Joined: 18-January 08
From: Montréal, Canada
Member No.: 10515
Using LabVIEW Since:2000
LV:8.6 ,8.5 ,.
ca_quebec Canada Nothing Selected


QUOTE (jlokanis @ Aug 22 2008, 01:20 PM) *
If you are worried about the user editing an INI file and putting in bad values, my solution is to use a small XML file and an .XSD (schema) file. When the app boots, it reads the xml file for its 'ini' settings. I first validate the XML against the schema to verify it has no errors. If they messed up the XML, then the app will report the error and what line is invalid, then exit.
This is not that hard to do if you have used any .NET functions before in your LabVIEW code. I can post some examples if that would help.

-John


Honestly, it was more a thought experiment kind of question. I recently used lvclass tags when I was playing with cloning classes programmatically. I was wondering if VI tags would be an efficient way to go. Based on AQ's answer, it is not practical at the moment, since it cannot self-modify its own tags, so I'll let that go.
I admit that XML has some appeal, especially since it supports LabVIEW classes in 8.6. I'd welcome your example VIs. thanks


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jlokanis
post Aug 25 2008, 11:10 PM
Post #8


Very Active
***

Member
Posts: 163
Joined: 14-June 05
From: Seattle, WA
Member No.: 2411
Using LabVIEW Since:1993
LV:8.5.1 ,8.20 ,7.1.1
United States Nothing Selected Nothing Selected


QUOTE (Neville D @ Aug 22 2008, 10:55 AM) *
Can you post an example.


Sorry it took so long. I had to make a generic version and add some comments. I posted it in the code repository in development section. Here is a link:

XML File Reader in CRID

--------------------
---------
You mean you still use a keyboard to write your code? How quaint...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons
post Aug 28 2008, 11:31 AM
Post #9


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


QUOTE (normandinf @ Aug 22 2008, 08:04 PM) *
Honestly, it was more a thought experiment kind of question. I recently used lvclass tags when I was playing with cloning classes programmatically. I was wondering if VI tags would be an efficient way to go. Based on AQ's answer, it is not practical at the moment, since it cannot self-modify its own tags, so I'll let that go.


Well... It's not too bad, the fact that the tags can't be modified is a security, no ?
I mean.. you can store the default settings into tags and in case the INI has been removed / screwed by someone, then load the default settings from the VI tags, no ?

--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Aug 28 2008, 02:52 PM
Post #10


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3748
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (Antoine Châlons @ Aug 28 2008, 07:31 AM) *
Well... It's not too bad, the fact that the tags can't be modified is a security, no ?

No - it's because you can't edit a VI in the RTE. For example, you can open a VI, edit it's diagram or front panel, then save it - tags are part of the VI, so editing the would be like trying to edit the diagram.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons
post Aug 28 2008, 03:44 PM
Post #11


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


QUOTE (crelf @ Aug 28 2008, 04:52 PM) *
No - it's because you can't edit a VI in the RTE. For example, you can open a VI, edit it's diagram or front panel, then save it - tags are part of the VI, so editing the would be like trying to edit the diagram.


Yes. I assume it's for the same reason that you cannot change the default value of a control at run time.

What I was meaning by "the fact that the tags can't be modified is a security, no ?" is that, in a way, being sure that it will not be modified whatever happens can be interesting for storing default values.
Often default/last used values are stored into an INI file, what if the operator deletes or moves the INI file ? Well load the default value fron the VI tag you are sure no one will screw the VI tags wink.gif .
This is what I meant by "security".


Is there a transparent-babel fish-like animal we could stick into our eye to understand anything written in any form of language ?
And what if I stick 42 babel fish into my ears, would it work ? biggrin.gif


--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
crelf
post Aug 28 2008, 04:10 PM
Post #12


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3748
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (Antoine Châlons @ Aug 28 2008, 11:44 AM) *
I assume it's for the same reason that you cannot change the default value of a control at run time.

That's right.

QUOTE (Antoine Châlons @ Aug 28 2008, 11:44 AM) *
What I was meaning ... is that, in a way, being sure that it will not be modified whatever happens can be interesting for storing default values.

Ahhh - I get your menaing now. Yes, you could store constants as tags, but what benefit would that have? Why not just make them constants on the diagram? Unless you're trying to hide the constants?

QUOTE (Antoine Châlons @ Aug 28 2008, 11:44 AM) *
Is there a transparent-babel fish-like animal we could stick into our eye to understand anything written in any form of language ? And what if I stick 42 babel fish into my ears, would it work ? biggrin.gif

biggrin.gif sounds like a pretty intense game of Chinese Whispers where language is involved too ohmy.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Antoine Châlons
post Aug 28 2008, 04:35 PM
Post #13


Extremely Active
****

Premium Member
Posts: 323
Joined: 8-January 07
From: Geneva
Member No.: 7452
Using LabVIEW Since:1999
LV:8.5.1 ,7.1.1 ,5.1
France Switzerland Spain My Gallery


QUOTE (crelf @ Aug 28 2008, 06:10 PM) *
Ahhh - I get your menaing now. Yes, you could store constants as tags, but what benefit would that have? Why not just make them constants on the diagram? Unless you're trying to hide the constants?


Right, no point... other than hiding the constants, so no real point.
Just thinking out loud oops.gif


QUOTE (crelf @ Aug 28 2008, 06:10 PM) *
biggrin.gif sounds like a pretty intense game of Chinese Whispers where language is involved too ohmy.gif


wacko.gif

--------------------
____________________________________________________________________________________

It's better to stay out of the rat race because if you win, you're still a rat


_____________________________________________________________________________________


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post