MicroLYNX – Motion commands used in a program
The most likely use of a stepper motor Controller is to interface inputs/outputs with some desired motion. The system operation would then be stored as a program in the Controllers non-volatile memory. This allows the Controller to operate in a program mode where no user interface is needed to enter the commands. It is essential to understand that when operating in program mode each command is read, executed and immediately the next command is read, executed in a sequential manner. Typically this format is desired, but when the program comes to a move command, most of the time you prefer for the motion to be completed before the next command is read and executed.
Let’s take a hypothetical situation. Say we decide that when an input is seen we want to turn on an output and move some distance. We want this output to stay on as long as the motor is turning and turn off when our desired motion is complete. Call it a moving output.
Since the program works sequentially and without delay between commands we need to somehow hold the program until motion is complete. IMS Schneider Electric Motion USA allows the user to do this by simply putting a wait command after any move in a program. This specific wait command waits until an internal flag changes states before allowing the program to continue. The following program would give the desired result:
MicroLYNX Controller Command Description LBL loop Create user label BR loop, IO21 Branch to LBL loop if IO 21 is true IO 22=1 Turn output 22 on MOVR 200 Move 200 steps HOLD 2 Hold program here until motion is complete IO 22=0 Turn output 22 off