01-25-2018 02:37 AM
Hi. I am fairly new with Labview and I need help regarding my sequence. As you can see from the attachment, i was able to ramp up the voltage from an initial value to a target value using a predetermined step rate. What I am unable to do was to make this sequence run one time only. The program keeps repeating itself every time the ramp sequence is completed.
I know this is possible with a "while" or a "for" loop structure but i am not yet sure how to implement this in my VI.
Solved! Go to Solution.
01-25-2018 02:44 AM - edited 01-25-2018 02:45 AM
The program runs continuously, are you pressing the 'run continuously' button or the 'run' button to the left of it?
Its best to check the simple things first! The way the program is written I don't see how it would cycle unless you have a larger loop around the code in the snippet or are pressing run continuously.
01-25-2018 03:09 AM
Yes, you are correct about the run continuously button. Thanks!
01-25-2018 03:21 AM
Did you press continuous run (arrows in a circle)? That would run the VI until you stop it. Press the normal run (single arrow) and the VI will run once.
A while loop would actually implement this behaviour (loop until stopped). This would be a better way to do it (over continuous run), since stopping the while loop would be a controlled stop. Pressing stop will stop immediately, and might leave communication in an undefined state.
If you want to stop in the middle of the sequence, you need a slightly fancier solution, but I don't think that's what your asking (Occam's razor, the simplest solution is most likely right) .