LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set device and channel variables

I need to set the values of my device, channels, and file path so that I do not have to enter those each time I open the VI. How do I do that? Thanks.
0 Kudos
Message 1 of 3
(2,566 Views)
There are several ways that you can do this. Since you apparently already have all of these as front panel controls (this may not be the best way to do this for your GUI), one very simple way is to put the desired values into the controls and then make this the default. You can programmatically set these defaults by using the invoke node for the vi.

A second way to do this, assuming that the values never need to be changed, would be to hard code them into your diagram instead of using front panel controls. While this method is rather easy to implement, it becomes a problem if you change the configuration of your computer.

A third way to do this is to store the data in an ini file. If you do a search on this forum you should find considerable discussion o
f the use of ini files in applications. This is the most useful method to do what you want to do and is usually very easy to implement.
0 Kudos
Message 2 of 3
(2,566 Views)
Jean-Pierre's save/restore functions will do this. Check out openG.

Start with Jim Kring's profile to find this site.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=261&HRedirected=True&HUserId=101_1512&RFORMNUMBER=6&UCATEGORY_0=_6&UCATEGORY_S=0

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(2,566 Views)