LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical pointer slide - Reinitialize to default value

Hello!
 
I have a problem with a vertical pointer slide. The valid range of values that the pointer slide can have are from 0 to 2 with an increment of 1. Hence the values of 0, 1 and 2 are possible. I can easily change the values of the slide while running my VI. However, I would want the default value to be zero at all times when I start running the VI. The pointer slide is connected to a case structure that executes certain actions depending on if the value is 0 (Standby), 1(Operating) and 2(Non-operating). I always use the slide going from 0 to 2 with an increment of one (hence the sequence of 0, 1, 2). However, when i rerun the VI the default value of the vertical pointer slider does NOT change to 0 as I anticipated. I find this peculiar since it says (0,default) on my case structure. I noticed that there is Reinitialize to default value option when I am not running the VI. How would I go about to make my vertical pointer slide to always start with the default value 0 when I start running the VI? As of right now the VI always starts with the last value it had before I stopped running it.
 
Please help me with this.
Thanks
 
0 Kudos
Message 1 of 11
(5,378 Views)
Create a local variable of your slide and wire a zero to it, or create a property node and select the "Value" property and wire a zero to it. Right-click on the control and select Create->Local Variable or Create->Property->Value. The second method will allow you enforce dataflow so you can make sure that executes before the rest of the code.
0 Kudos
Message 2 of 11
(5,370 Views)
Thanks for the tip. I did pretty much as you said. However I am not able to change the slide now at all since it will go back to the default value (0) no matter what I choose (1 or 2).
Could you please attach a figure of how I should wire it?
Thanks
0 Kudos
Message 3 of 11
(5,366 Views)
Just make sure it is outside your main while loop.
0 Kudos
Message 4 of 11
(5,355 Views)
There's also a Reinitialize All to Default method for VIs that you can use as the VI is shutting down to reinitialize all the controls and indicators on the front panel. That way they will be at the right value the next time the VI starts.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 5 of 11
(5,349 Views)
Thank you very much. That solved my problem Smiley Happy
0 Kudos
Message 6 of 11
(5,323 Views)
I do not have a while loop at all, just a case statement.
0 Kudos
Message 7 of 11
(5,322 Views)
You have to have a while loop. Do not use the run continuous button on the toolbar. This is only for special debug use. It should never be used as the normal way to run your program. Put a while loop around your code and then add a small wait in the loop. The wait will will prevent the VI from using 100% of the cpu and allow other tasks to run.
Message 8 of 11
(5,314 Views)
The reason why I have been excluding a while loop has been that  I want to prevent the memory of the computer to run out. I want to send signals to a power supply and run a camera for video sequence acquisition in real time (30 FPS). The video acquisition obviously has a while loop however I presume that adding another while loop for the power supply would make my program run slower than it would without the while loop. Is this correct? Thank you kindly for your inputs.
0 Kudos
Message 9 of 11
(5,295 Views)
I understand your concerns about execution time, the trick is to only put inside the loop those things that need to be done every iteration. Can you post the code - or at a least a bit of it? I feel sort of like I'm shooting in the dark.

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 10 of 11
(5,289 Views)