LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fields resetting to default each time

Solved!
Go to solution

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.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 1 of 22
(3,272 Views)
Make sure the correct data is written to them at the end of each execution. Never have indicators inside a case structure where the case they are in might not be executed -- unless of course you don't mind the data being cleared.
The correct way to handle this is buffer the data -- like in an uninitialized SR.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 22
(3,254 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 22
(3,241 Views)
Yes, that would do it. But it also creates a time bomb waiting to go off.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 22
(3,228 Views)

Please see whether attached image solves ur problem.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
0 Kudos
Message 5 of 22
(3,214 Views)

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

 

0 Kudos
Message 6 of 22
(3,203 Views)

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. 

Message 7 of 22
(3,193 Views)

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.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 8 of 22
(3,152 Views)

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

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 9 of 22
(3,149 Views)

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.

0 Kudos
Message 10 of 22
(3,140 Views)