LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper control with labview

Hello again,
Im developing a project with a lazer pointer attached to a stepper motor, my program allows me enter a value and make the stepper  "step" a certain amount of times .This works ok but I have to stop the program running and start again in order to make the stepper step again.Is there a way that I can enter a value to make the motor rotate then enter another value to make it rotate again without stopping and starting the program. Ive attached my vi
 
any input is much appreciatedSmiley Wink
0 Kudos
Message 1 of 11
(3,471 Views)

You could use the auto-indexing feature, to work through an array of step-indices. See the attached example.

The auto-index feature will step through all elements you put into the array-control automatically inside the for-loop.

 

Hope this helps!

0 Kudos
Message 2 of 11
(3,454 Views)

The vi you sent me wont open..????

not sure if aoto-indexing will work because my program already allows me to control the number of steps,ive tested it my motor and its fine, the problem im having is if I get it to step say 24 times and I then want it to step 48 times I must stop the program enter the new value and start it again. I want to be able to do this without stopping and starting the program.

Thanks for help, could you post jonystepper2 again if its not to much bother

cheersSmiley Happy

0 Kudos
Message 3 of 11
(3,452 Views)
Auto-Indexing will solve that, in my opinion. What version of LabView do you use? I used 8.0, so if you have an older version, you will not be able to open tis VI. Tell me what version you are using, then I can convert the VI for you to this version.
0 Kudos
Message 4 of 11
(3,447 Views)

I went to another lab that has version 8 and tested the program. If I have say 24 elements in the array on the outside of the loop, the iterates 24 times, this allows 24 steps of the motor, but when the last iteration occurs the program stops. If you loop the for loop in a while loop the motor just spins continuously....this is the same as my program just a slightly different method.....what i need is the motor to step and stop then step and stop "without " the program terminating

 

I would appreciate your continued inputSmiley Wink

0 Kudos
Message 5 of 11
(3,442 Views)
im using version 7.1 bye the way......
0 Kudos
Message 6 of 11
(3,442 Views)
To be honest, it is hard for me to understand what exactly you need. The array defines positions, right? With autoindexing, the motor will follow this profile until the end of the array, then the vi stops. You say, you don´t want that the program stops, but that it follows another profile, right? Who should this second profile be started? By a button on the user interface? How will the second profile be defined? by changing the values inside the array before pressing a button? Please describe how you would like that your program works, and I hope I can help you better then...
 
Message 7 of 11
(3,433 Views)

Thanks!!

Right here goes, the array in the while loop defines the sequence for half step mode, this array contains 48 values and therefore if all the elements are read this gives 48 (half) steps which corrosponds to 90 degrees of rotation (the motor gives 3.75 degrees per full step). The for loop part of the vi allows me to enter a value in to the control named index 2, the array in this part of the vi contains values that corrospond to a particular number of half steps.So if I have 48 in the first element and 24 in the second element this allows 90 and 45 degrees respectively, if 0 (first element) is entered into index 2 the for loop iterates 48 times and therefore I get 90 dgrees of rotation,if 1 (second element) is entered into index 2 then the for loop iterates 24 times and I get 45 degrees of rotation. What i would like to achieve is .......enter 0 into index 2 then start the program, when the motor has finished rotating  I would like to change the value in index 2 to1 and see the motor spin again without having to start and stop the program.

Apologies for explanation........I hope you can understand the jist...please feel free to tell me if you think my method is incorrect or contrived

with freunlichen Grüss

 

0 Kudos
Message 8 of 11
(3,422 Views)
ultimately I want to control the motor many times , moving 90 ,then 45 then 60...etc allowing the motor to stop in between each rotation, with the user decidng when to rotate the motor
 
 
0 Kudos
Message 9 of 11
(3,419 Views)

I hope I understood you right now. See the attached VI, written in 7.1

When you start the VI, nothing happens until you press the "Go!" Button. The the Array-Element with the Index entered in the Numeric Control will be passed to the for loop, and the for-loop will execute x times, where x is the number in the Array-Element with the index set in the control.

When the for loop is done, it will wait for the next press on the "Go!" button to execute the next movement.

Hope this is what you wanted to have!

 

 

Message 10 of 11
(3,410 Views)