Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66782

Creating Loadable Preset Settings

$
0
0

Hi,

 

I am trying to create loadable preset settings for my controls.  I wasn't sure of the best method so I started by allowing the user to save the preset as a text file.  The problem I am having is how to load the presets from the text file.  I was thinking that I could try Read from Spreadsheet, but a few problems/questions arise from that.

 

Problem #1: My text file has two columns.  For the sake of aesthetics I made it so the data of each column was perfectly aligned (Column 1 contains the name of the control and Column 2 contains the value of that control).  This leaves me with instances where different amounts of space exist between elements in the same row.  I am not sure how to parse the data in each row.  The easiest way I can see would be if i could have an offset per line since my control values are all the same length from the start of the line.  I can't figure out how to implement it, if it is even possible.

 

Problem #2: If I manage to parse the data in the rows properly, I would be left with an array of control values.  How would I go about loading those values into the controls of the VI.  I am not sure how I would do that from an array.

 

I have attached a text file with the formatting I described above to give some reference.  The file contains channel names with "inactive" next to them.  Those are supposed to correspond with 0's, which I figured I could convert to numbers before they were loaded into the proper boolean controls.

 

Thanks


Viewing all articles
Browse latest Browse all 66782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>