From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-30-2017 02:49 PM
I'm trying to save & load all my front panel values. Load is not working. What am I doing wrong?
06-30-2017 03:54 PM
I see 2 things.
1. You are feeding the value of the This VI reference into the Value input. You are not putting in any of the values you saved to the file.
2. You create a file that is an array of clusters of Name and Variant Data. When you read the file and unflatten it, you wired in an array of clusters consisting of a string, integer array, and a string. Your Flattens and Unflattens just don't match.
06-30-2017 05:38 PM - edited 06-30-2017 05:41 PM
Still not working!
07-01-2017 02:13 AM
Here's a modified version following RavensFan's instructions.
In this case, I right clicked on the cluster wire coming out of the Ctrl Val.Get All node, and clicked Create > Constant. I then dragged the constant value to the second case structure, where I wired it to the type input of the Unflatten From String.
Now, you can see that the cluster array created has a Name and Variant Data, as you expect.
As a side note, rather than having a loop with a variety of different cases all being toggled on and off, I would suggest you take a look at the State Machine architecture.
07-01-2017 06:19 AM
OpenG has a VI that does this for you. It actually saves the data in a configuration file, making it so you can edit the data in a text editor if so desired.
07-01-2017 04:14 PM
Another suggestion for OpenG. It is called Save panel to INI and Load panel from INI and the functions are on the Variant Configuration palette. Super easy to use (just one VI each) and the output is a human readable text file. It can be slow for lots of very large complicated data types (clusters of arrays of clusters of arrays) but for the quick and dirty it functions great.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-07-2017 05:08 PM
I downloaded both OpenG & MCI but for the life of me I can't get it working! So I tried to modify my code. Save is working but Loadis not working! I'm LOST
07-07-2017 06:34 PM
Your datatype you are flattening on the save is a string and a variant. The datatype you wired for the unflatten in the load is a string, integer array, and another string. They don't match.
You are writing those values to a Control Value Set node that is deprecated. Pick that invoke node again for Ctr Val.Set. You'll see it becomes a string and variant. Now wire the correct datatype into the unflatten (create a constant from the wire that goes into the flatten above. Fix the unbundle by name and everything should now be wired correctly.
Then try again.
07-07-2017 06:51 PM
Do not reinvent the wheel: http://sine.ni.com/nips/cds/view/p/lang/en/nid/209753
07-07-2017 09:07 PM
@Canucks.canucks wrote:
I downloaded both OpenG & MCI but for the life of me I can't get it working!
Could you show us what you tried with those? For OpenG, all you need are the Read Panel From INI and the Write Panel To INI VIs. Those two will do everything for you.