07-11-2014 01:05 PM
I know there are a couple of ways to solve this issue, but I want the most efficient one. I have a subvi with a case in it for dumping informaiton into different clusters or strings. The indicator is in the case statement. Each case statement has an indicator and each indiciator is wired to the output of the subvi to the main vi.
Problem: Each time I call the subvi it clears the data that is in each of the cluster and string indicators. What is an efficient way to keep the the indicators that are not being changed from being cleared.
Solved! Go to Solution.
07-11-2014 03:34 PM
07-11-2014 07:50 PM
Make sure they are not being written to. Then there is a setting in the VI Properties->Execution for "Clear Indicators" when called. Make sure that is turned off.
07-11-2014 10:56 PM
07-12-2014 08:32 AM
Please see whether attached image solves ur problem.
07-12-2014 09:14 AM
This Sounds like a good use of a dynamic event case. The controls do no reside in the sub vi . Just pass an array of control references or dynamic event registrations refs to the sub vi. The event action (value change, mouse over, double click, ect..) can be determined. This will only change the control value in the event structure and all other controls values will stay unchanged and not pass the default value out. See Comminity:
https://decibel.ni.com/content/docs/DOC-5265
07-12-2014 09:41 AM
If you are not so good using references then you need to use shift registers. See example. You can put any data type on the shift registers. If you use this vi more than once you need to change the vi properties to Reentrant Execution so the values are not changed by each time the vi is called.
07-14-2014 09:35 AM
I tried changing the settings for the VI; Propeties -> Execution -> do not clear indicators when called
That didn't work, I was suprised because that was the method that I attempted first. I'll explore the other options put forward here, I may use the event case.
07-14-2014 09:37 AM
Miraz_Automation,
Your method will only accomlish resetting the value back to a single default value. Instead of clearing the box, it will be whatever the default is. I could set the default each time using a property node, so that when it calls the VI, it will reset it to the default that I have chosen (the last value prsented to the case) but I'm looking for a more elogant solution.
-JW
07-14-2014 09:59 AM
The example shows UN-initialized shift registers. This is a core LabView technique that must be understood to use LabView effectivly. All values will be the initial value when the vi is loaded. But once your code writes to the Control in each case statement the Control will retain that value until the vi is closed or the case is executed again. If you want to have the values be retentive you must initialize the values in your code when starting up the vi. This can be done by saving the values to a file when your vi closes and then when your vi is opened you restore each value from that file.