syntax – SQr,(var)
SQ | Square Root | |
| Value: | N/A |
| Units: | N/A |
| Range: | 0.0001 – 214748.3645 |
The SQ command calculates the square root of a number and returns the result in a user defined variable. The n parameter in the syntax can be a number or a variable parameter, however, the second parameter must be a previously defined variable for which the square root result is stored. If the second parameter is not a defined variable, you will get a Bad Variable Name error. Following mathematical convention, SQ will produce an Invalid Parameter error for negative “r” values. The return value is accurate to the 0.01 place. Example: This program calculates the square root of 27.96 and stores the value in the user defined variable (SQRESULT).
(SQRESULT)=0 SQ27.96,(SQRESULT) | The returned value in (SQRESULT) is 5.28. | |
| Stop Move on Input | syntax – STn (or ST#n) |
ST |
|
Value: N/A
Units: N/A
Range:
ST stops move execution upon activating the input specified by n. ST0 disables (turns off) the STn command.
ST#1 stops the move on axis #1. (Allows program command conditional program termination).
After ST is executed, the specified input is monitored during every “move profile”. If the input is activated, the current “move in progress” is terminated, stopping all motion until the input is deactivated or an ST0 is processed. LinStep+ will process and calculate commands, but will wait at the next GO command until the ST input changes.
The motor is stopped at the deceleration rate specified in the Stop Decel Rate parameter. Once issued, Stop on Input remains active until it is turned off by the ST0 command, a reset is issued, or power is cycled.
Example:
ST1 AC1 DE1 VE25 DA6 GO VE50 DA0 GO EN
Move to absolute position 6 units. If input 1 is activated while moving, Stop Motion. When the input is deactivated, immediately execute the next move profile which is to move to the absolute zero position. If input 1 is not activated while moving, the motor would complete its 6 unit move before executing the move back to absolute zero.
syntax – TDr
TD Time Delay
Value: N/A
Units: seconds
Range: r=0.01 – 99999.99
Delay r seconds before executing the next command.
Example:
VE50 DI4 GO OT11 TD.5 OT00
Move 4 units, turn outputs 1 and 2 on, delay .5 seconds, and turn outputs 1 and 2 off.
| MN1853 |