04-25-2012 09:21 AM
Dear all,
As you can see from the pic. , I need to put "stop.vi" in a while loop but i dont want the motor to stop every iteration of the loop(i want it to stop only once) Is there any option in a while loop that do "stop.vi" only once and go on?
Thank you,
Kind regards,
04-25-2012 09:44 AM
Something like this.
04-26-2012 01:38 AM
Thanks for your precious reply Steve Chandler, i will try it on weekend. I will post my feedback then.
Kind Regards.
04-26-2012 02:53 AM
Dear Steve Chandler,
As you see from my attachment , in the program condition; "stop.vi" is already in a false case structure. According to your reply, should i put the "stop.vi" in true case structure which will be inserted in the false case structure too ??
Best regards.
04-26-2012 07:52 AM
04-26-2012 09:14 AM - edited 04-26-2012 09:16 AM
So here is what I was talking about above. Replace your stop vi with the while loop containing the case structure which contains your stop VI. Better yet create an Action Engine.
04-26-2012 01:30 PM
Ok Steve Chandler,
Thank you so much, i will try it as soon as possible. I will also try to learn the action engine .
May the force be with you.
Best Regards.
04-28-2012 07:39 AM
Dear Steve Chandler,
i also added the "set velocity.vi" into the " stop.vi's case" because this vi is also needed to occur once during the whole program not evey iteration.
As you can see from the attachment, I did what you had said(, but this time everything is stopped (both the daqmx and motor) , i suppose that i cant get out of the while loop wtih this solution , because it only stop and i cant go on to the other vi (move absolute.vi).
Please help me again. I just want to use "stop.vi" only once and then go on other vi.
The three wires and the TF boolean goes through in the false case.
stop.vi" only once
04-28-2012 09:50 AM
My bad. The boolean constant connected to the while loop stop terminal needs to be set to true. The while loop only iterates one time and exists only so you can create the shift register.
There is an easier way. If you have a vi that needs to only execute once before your main application loop, then just put that code outside of the while loop.
04-28-2012 10:51 AM
Dear Steve Chandler,
I corrected and tried it but now the "stop.vi" executes every iteration. So this is not working either. Sorry I can't place these vi.s outside of the sub while loop, because they need to be inside of the while loop and work same time with DAQmx vi.
I did not understand what you mean from this sentence : "The while loop only iterates one time and exists only so you can create the shift register." Crate shift register where?