LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text file as a Control input.

Ok I have a program that requires some input values. So basically I have certain number of numeric controls on the front panel, right now I fill them in with the values I need and set them as the default values, but what I am looking for is to have all those values in a text file and them uploaded them programmatically to the numeric controls I have in the front panel.

Thanks

0 Kudos
Message 1 of 6
(2,963 Views)
Hi TripleJ,

there are very nice ConfigFile functions in the file palette to load/save values.
After loading values you can wire them to locals of the controls - that's the easy way Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,960 Views)
Can you show me an example???
0 Kudos
Message 3 of 6
(2,943 Views)

Not sure what version of LV you are using but the examples shipped with LV 8.2 are named Read Configuration Settings File.vi and Write Configuration Settings File.vi.

Seems like they might have been called Key Files in the past as well.



Message Edited by centerbolt on 11-09-2007 12:01 PM
0 Kudos
Message 4 of 6
(2,940 Views)
I am attaching what I am trying to accomplish...lets say that I have 3 numeric controls...and I have a text file called import.txt. I will use the VI read from a text file and wire the right path to the VI, now how do I pass the values to the numeric controls???. And I have LV 8.5

0 Kudos
Message 5 of 6
(2,931 Views)
Instead of trying to re-invent the wheel, you should really look at the examples Centerbolt mentioned. For something simple as a couple controls, it should do exactly what you want with a simple modification to the read VI. In the read VI, there are no controls - just indicators. To write to a control from a config file, create a local variable of the control and write to that.
0 Kudos
Message 6 of 6
(2,929 Views)