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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically Save Control Values only works with Ctrl Val.Get All (deprecated)

Solved!
Go to solution

Hi,

 

I have just downloaded "Programmatically Save Control Values 86.vi from https://decibel.ni.com/content/docs/DOC-3551

 

It works.  But in the save event structure it has an invoke node with Ctrl Val.Get All (deprectated).  I thought I would get rid of the deprecated by reselecting the Control Get All method.  Sure enough there was no longer a (deprecated) at the end and the top bit changed from pink to yellow.  However when I run it and load a file that is saved I get:  Error 116 occured at Unflatten From String .... Possible reasons:

LabVIEW: Unflatten or byte stream read operation ailed due to corrupt, unexpected or truncated data.

 

Some questions:

If I were to write this thing without downloading the example it wouldn't work.  Any ideas how I would make it work in LabVIEW 2011?

The example is quite old, would people use a different method of storing/loading settings in a VI these days?

This VI locks up after a while.  Is that because it has two Event Structures in one loop or because it doesn't have timeout cases or what? (I'm not really concerned about why it locks up but if someone knows the answer without spending time running it I would appreciate it)

 

Thanks for any tips, things I can learn from this

0 Kudos
Message 1 of 2
(2,324 Views)
Solution
Accepted by topic author pgaastra

The old methods worked with a data type which was {name, type descriptor, flattened data}. The new methods use {name, variant}, so you need to adapt the code to work with that data type. Also, you can't use old data files with the new code.

 

I'm assuming the VI does get locked because you have two event structures in a single loop (it would make sense, since each structure needs to wait for an event it is registered for to occur), but I didn't look at the code itself, so I can't be sure.

 

As for other options, I usually don't save all the controls on a front panel, but when I do want to save a bunch of controls, I usually use something like this, which can also work if you collect all the controls from the FP. There are also links to other similar things in the "more like this" section that the page has.


___________________
Try to take over the world!
Message 2 of 2
(2,313 Views)