Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative loop execution

 Hi

I need to move my motor  in two axis. I have four while loop inside the sequence structure, I have to execute each while loop  for 5 sec, After press running, 1st loop continuously execute unless I  stop manually.   How I can define the some condition to  stop the 1st loop after 5 sec, then 2nd loop start execute for 5 sec and so one. I don’t have voltage information to define  condition to  stop 1st loop.  Anyone help me to sort  loop execution problem.


Many Thanks

 

 

0 Kudos
Message 1 of 2
(5,107 Views)

Hi there,

 

In order to stop your while loop after 5 seconds, you can use an Elapsed time express vi inside your while loop and wire the "time has elapsed" output to the conditional terminal of the while loop. This will allow you to execute the while loop for the amount of time you specify in the Elapsed time express vi. I have attached a very simple vi that allows you to do that.

 

Hope this helps.

Shalini B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(5,095 Views)