取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 11 条)
5,444 次查看
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 项奖励
2 条消息(共 11 条)
5,436 次查看
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 项奖励
3 条消息(共 11 条)
5,432 次查看
Just make sure it is outside your main while loop.
0 项奖励
4 条消息(共 11 条)
5,421 次查看
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.
5 条消息(共 11 条)
5,415 次查看
Thank you very much. That solved my problem 高兴表情
0 项奖励
6 条消息(共 11 条)
5,389 次查看
I do not have a while loop at all, just a case statement.
0 项奖励
7 条消息(共 11 条)
5,388 次查看
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.
8 条消息(共 11 条)
5,380 次查看
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 项奖励
9 条消息(共 11 条)
5,361 次查看
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 项奖励
10 条消息(共 11 条)
5,355 次查看