LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using invoke node ctrl.val.get.all

I am using the invoke node ctrl.val.get.all to get the values of all controls within my software so the user can save the current state and load it back up at a future data. It returns an array of clusters. No problem so far. This cluster contains a string and a variant. Handling the string, again no problem. To get at the value of the controls though I need to process the variant so I can present the data nicely to a write spreadsheet.vi, the controls are of various data types (boolean and doubles mainly).  I have been unable to find useful examples and documents. If someone could point me towards some links that would be great

 

Thanks in advance

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 1 of 7
(3,477 Views)

Akiel,

 

I can't really help you out on a link, but maybe a different methodology. But this all depends on how you want to really USE these values. If you want the user to be able to use these values (saved control values), then maybe this won't be for you.

 

But if you simply use an invoke node to "set current as default" (after you enable edit mode) it should do what you need. But again, as far as specific values you want the user to be able to load dynamically, this might not be for you. If you use the invoke node "set current as default" with "reinitialize to default" then that gives you some user "play" within the application. But again, depends on how much "play" you want to give the user.

 

-chazzzmd

0 Kudos
Message 2 of 7
(3,458 Views)

The values are in turn saved to a csv file so when the user relaunches the test program they can load them an use them as a starting point for their next test run instead of having to set a number of values manually I have a work round using flatten to xml but a have a feeling there is a better approach, 

 

Thanks

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 7
(3,452 Views)

You can use the function File I/O -> XML -> LabVIEW Schema -> Flatten to XML

to convert a variant to an XML string for saving to a file, then use the Unflatten from XML function to reverse.

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 7
(3,443 Views)

I have used flatten to xml, then used the resultant xml to determine type and value. These are converted to string then saved to a spreadsheet

 

thanks

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 5 of 7
(3,440 Views)

Akiel,

 

When you say "............relaunches the test program they can load them and use them as a starting point............" So is this an option you are giving the user upon 1st iteration or something or do you want your program to automatically use that CSV file? If no user generated event, my solution should work just fine, no CSV file needed. If yes, the user will provide an event (i.e. "loading") then maybe your CSV is the path you should be on. Personally when I have programs that I allow dynamic loading of input parameters I usually use .ini files.

 

Good luck.

0 Kudos
Message 6 of 7
(3,435 Views)

The idea is they build a library of starting configurations then can select as appropriate. The loading part is a pre-existing section of code that works nicely from csv files. I can create the csv in the right format, its just finding a simple way of getting at the value(and type) from the variant

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 7 of 7
(3,432 Views)