LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loop, proceed on click

Replace the outer while loop with a for loop where the N is the number of pictures.

 

Remove the inner for loop.  Now each button click will execute the event case.  The event case will execute N times because of the outer For Loop.

0 Kudos
Message 11 of 18
(2,097 Views)

That worked as in the loop went through the iterations on the click of the boolean, but, it didn't call the counter Vi each time, and the the case structures did not go true to stop the motor? any ideas?

 

 LABVIEW3.jpg

0 Kudos
Message 12 of 18
(2,073 Views)

The motor off VI only runs when the counter is greater than Angular increments x 8.1.

 

Are you saying you do want to run the code inside the event structure over and over again?  In that case you will want a while loop inside the event case.

 

However,  I would recommend that you also look at state machine architectures.

0 Kudos
Message 13 of 18
(2,066 Views)
Yes the motor has to rotate, and has to continue until the counter is greater or equal to the Ang. increments X 8.1. Then the motor's should stop..... and when clicked the loop should start again. Then the counter needs to be called again (when the boolean is  clicked), to reset the counter  count up again ,and move on for the next picture... Machine Architecture... is that just multiple loops...
Message Edited by newbie09 on 02-15-2010 01:54 PM
Message Edited by newbie09 on 02-15-2010 01:55 PM
0 Kudos
Message 14 of 18
(2,061 Views)
Can anybody shed any light on the matter, or point me towards any help/ examples of the problem?
0 Kudos
Message 15 of 18
(2,006 Views)

Go to File  >>  New .... >>  Frameworks >> Standard State Machine.

 

Search the forums for "state machine".

0 Kudos
Message 16 of 18
(1,996 Views)

Alright went away and checked it out... it seems that the condition never goes true for the motor to turn off, hense it jst keeps rotating even when the different loops are called. It is iterating through the loops. The counter seems to be the problem, but i tried to insert a time delay to no avail...

 

Any help appreciated, as it is need for my Final Uni Project which is being demonstrated on Tuesday.....

 

Regards

Peter

0 Kudos
Message 17 of 18
(1,974 Views)

I am looking to reset a counter output, for each iteration of a for loop. I am controlling the angular position of a stepper motor, by counting the pulses that the motor receives. it is for use with a panoramic camera. It should move once, stop when the counter value equals the inputed angle * 10. Is that is fine for the first loop, but when the second loop starts, the counter has continued to count up ,and then the motor wont rotate because the counter value is too high... it thinks it has reached the desired positon. so i need to be able to reset the counter output... Any Ideas

 

Thanks in advance

Peter

0 Kudos
Message 18 of 18
(1,960 Views)