LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

importing data of a user defined type from a text file.

Hi there.

 

I have a set of 26 commands of a user defined type, and 26 associated floating point input values. I'd like to put these commands and input values into an array to be read later. I can plug in all of these values into an array from the front panel, but when I close the program they are cleared from memory. I was thinking of loading these commands and values in from a text file, but I don't know how to import text data and translate it to a mixture of user defined type data and float data, then store it in an array.

 

Can anyone help me with this problem? Does anyone know of an easier way to do it than trying to import from a text file?

 

Thanks for your help.

0 Kudos
Message 1 of 4
(2,720 Views)

Take a look at the VIs for working with configuration files (File I/O->Config File VIs). These will enable you to read/write from an ini style cofiguration file. OpenG also has a convient VI for reading/writing ini files.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(2,718 Views)

Here are a few examples of reading from a config file. Writing is simply the reverse action.

 

NOTE: All clusters used are typedefed clusters. For posting here I disconnected them from the typedefs).



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 4
(2,712 Views)

Thanks for the example files, I really appreciate your help.

0 Kudos
Message 4 of 4
(2,709 Views)