MSR — Motion Set/Redefine Position

Description
Section titled “Description”MSR (Motion Set/Redefine Position) tells an axis where it is. On the false-to-true transition of its rung the axis position is set to the Position operand without any motion: ActualPos, CmdPos and Counts take the new value, RedefinePos records it, and DN and PC set. Any move in progress is cancelled. Use MSR at a home sensor to establish the machine zero, to re-home after a hand move, or to zero the counter at power-up. Do not use MSR to move an axis; nothing turns. Use MAM for that.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Axis | Axis | Axis name | Any stepper or servo axis with a driver | Yes | The axis to redefine. |
| Position | REAL | Literal or tag | Any value in axis units | Yes | The value the current position becomes. A tag is read on the edge. |
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”Nothing. The edge memory starts false, so a rung already true on the first scan redefines on that scan.
Rung-condition-in is false
Section titled “Rung-condition-in is false”Nothing. The edge memory is armed.
Rung-condition-in is true
Section titled “Rung-condition-in is true”On the rising edge only: the axis’s current position and its target are both set to Position, so no move results; Counts = Position × counts per unit; ActualPos = CmdPos = RedefinePos = Position; DN = PC = 1. A move that was running stops where it is. Further true scans do nothing.
Postscan
Section titled “Postscan”Nothing.
| Before | After the edge |
|---|---|
ActualPos = 174 (wherever the axis was) |
ActualPos = Position |
Counts = 13920 |
Counts = Position × counts per unit |
DN = 0 |
DN = 1, PC = 1 |
| Move in progress | Cancelled, axis at rest |
Axis Members
Section titled “Axis Members”Motion status lives on the axis, not on a per-instruction tag.
| Member | Data type | Set by | Cleared by | Description |
|---|---|---|---|---|
RedefinePos |
REAL | MSR | — | Value of the last MSR. This member exists for MSR. |
ActualPos |
REAL | MSR, axis service every scan | — | Position in axis units. |
CmdPos |
REAL | MSR, MAM, MAG | — | Commanded target in axis units. |
Counts |
DINT | MSR, axis service every scan | ResetCounts |
Raw step counts. |
DN |
BOOL | MSR, MAM reaching its target | Next MAM or MAJ | Instruction done. |
PC |
BOOL | Same as DN |
Same as DN |
Process complete. |
EN |
BOOL | MAM, MAJ, MAG while a command is active | Command complete, MAS, MSF | A motion command is engaged. Not set by MSR. |
IP |
BOOL | Axis service while steps are being produced | Motion stops | Motion in process. |
InMotion |
BOOL | Axis service | Axis service | Steps produced this scan. |
Dir |
BOOL | Axis service | Axis service | 1 = forward. |
DriverOn |
BOOL | MSO | MSF | The drive is enabled. MSR works with the drive on or off. |
Error |
BOOL | Watchdog mismatch, TMC2130 driver fault | MAFR | Axis fault. |
ResetCounts |
BOOL | Your logic (write 1) | Firmware, after zeroing | Zero the counts without an MSR; the same as MSR 0. |
Watchdog |
INT (ms) | Axis properties; your logic may overwrite | — | Mismatch tolerance before Error sets. |
Example
Section titled “Example”Scenario: A set-home pushbutton declares the Feed carriage’s current position to be 0 mm, after the operator has jogged it against the reference stop.
Tags:
Set_Home— Set home position, BOOLFeed— stepper axis, 80 counts per mm
Rung 1:
—|XIC Set_Home|———[MSR Feed Redefine 0]———Scan 1 — Set_Home = 0. The carriage sits at 174 mm after the jog on the MAJ page: Feed.ActualPos = 174.

Scan 2 — Set_Home = 1 (rising edge). Nothing moves. Feed.ActualPos = 0, Feed.Counts = 0, Feed.RedefinePos = 0, Feed.DN = 1.

Values before and after: Feed.ActualPos 174 → 0 with the motor standing still. Every absolute MAM from now on is measured from this spot.
See Also
Section titled “See Also”- MAM — Motion Axis Move (absolute moves need a home)
- MAJ — Motion Axis Jog (find the home sensor)
- MSF — Motion Servo Off (re-home after a hand move)
- Motion Instructions — Category index
Homing pattern. XIC Home_Sw → MSR Feed 0 on its own rung, with the jog toward the switch on another. The MSR fires on the scan the switch closes and cancels the jog’s pending target; release the jog button and the axis is homed.
ResetCounts is the short form. Writing 1 to <axis>.ResetCounts from an OTE zeroes the counts on the next scan and the bit clears itself. MSR does the same for any value and records it in RedefinePos.
Not a move. Redefining to 100 when the axis is at 0 does not send it anywhere. A following absolute MAM to 100 would then do nothing.
Geared followers. MSR on a master axis changes the master’s position, so a follower geared to it drives to the new master × Ratio.
Servo axis. MSR sets the reported angle without moving the horn; the physical servo stays where the last MAM put it.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-11 · Screenshots verified 2026-09-11