This email reply to you was provided to support for this thread:
The best way is to use the STEPMOVEABS and STEPCOUNTABS commands to change and measure position around a fixed point. What you would do is move your motor to a position you would like to call zero and run the STEPHOME command.
From there you can move forward or backward using STEPMOVEABS and return the count from your zero position using STEPCOUNTABS. If you want to define a "home" position as 1000, then you can use define variables to create constant or variable values with names relevant to you (anything allowed by the define table naming conventions), and then use these as parameters for the STEPMOVEABS command.
STEPMOVEABS 1, HOME_1000, 1
It will be even more accurate if you can provide position feedback from your stepper driver to the PLC HSC inputs. STEPCOUNTABS will account for the pulses sent out of the PLC outputs, but it can't know about the actual physical movement, which requires encoder feedback from the driver itself.
The only problem is when the PLC loses power and you don't know for sure what the position of the stepper motor is when it powers up. You can always store position and home values in permanent memory, but the motor could have physically moved after power is lost and the PLC obviously can't detect that, so your power up position will be different than expected (the same problem will exist with any additional stephome command to support your request.
To resolve the issue of position loss when the PLC is powered down, you can add limit switches to zero the motor on power up and then use my solution to create fixed or dynamic home positions.
Here is a description of the STEPMOVEABS command, which you can also view online:
http://www.triplc.com/TRiLOGI/Help/tbasic/stepmoveabs.htm------------------------------------------------------------------------------
STEPMOVEABS ch, position, r
Purpose
This new command allows you to move the stepper motor # ch to an absolute position indicated by the position parameter. At the end of the move the relay #r will be turned ON. position can be between -231 to +231 .(i.e. about ± 2 x 109) steps. The absolute position is calculated with respect to the last move from the "HOME" position. (The HOME position is set when the STEPHOME command is executed). The speed and acceleration profile are determined by the STEPSPEED command as in the original command set.
This command automatically computes the number of pulses and direction required to move the stepper motor to the new position with respect to the current location. The current location can be determined at any time by the STEPCOUNTABS( ) function.
Once STEPMOVEABS command is executed, re-execution of this command or the STEPMOVE command will have no effect until the entire motion is completed or aborted by the STEPSTOP command.
See Also
STEPMOVE, STEPCOUNT( ), STEPCOUNTABS( ), STEPSPEED, STEPSTOP, STEPHOME
------------------------------------------------------------------------------