Serial Commands
The MTS160 supports ASCII text commands over RS232 and USB. Command names are four characters long and are not case-sensitive.
All commands and replies are terminated by a carriage return character (0x0D, \r).
Command Prefixes
! Set
Commands beginning with ! are used to execute actions or update configuration parameters.
When a command is accepted, the sensor replies with the command name followed by ,OK. If a command is recognized but cannot be completed, the sensor replies with ,ERROR. Unknown or malformed commands may return no reply.
Most configuration commands update the active runtime configuration immediately, but do not write the new values to nonvolatile memory by themselves. Send !SAVE after configuration changes to keep them after power cycling. !ZERO and !RSET save their changes automatically.
Example:
Set Sensor Configuration: !SNCF,0,50,600,1,250
Reply: !SNCF,OK
Save Configuration: !SAVE
Reply: !SAVE,OK? Get
Commands beginning with ? are used to request live sensor data, fixed sensor information, or current configuration values.
The sensor replies with the command name followed by a comma and the requested data.
Examples:
Get Firmware Revision: ?FWVR
Reply: ?FWVR,106,20240325,2882400018
Get Sensor Configuration: ?SNCF
Reply: ?SNCF,0,50,600,1,250# Repeat / @ Stop Repeat
Commands starting with # are Get commands identical to those above, except that the sensor sends a reply repeatedly. The repeat period is added in milliseconds after a comma.
Use repeat mode only with Get commands. The repeat scheduler runs with a 5 ms internal resolution, so periods that are multiples of 5 ms are recommended. Sending the @ character stops all running repeat commands.
Example:
Get Sensor Values every 10ms: #SALL,10
Repeating reply: ?SALL,2,-12,15,3,-4,1,0,0,1,0,-240,55,0,0,250
Stop Repeating: @Commands Summary
The tables below summarize the user-facing commands supported for integration. Firmware-update, production-test, and factory-only commands are used by the Naviq utility and are not part of the public integration protocol.
Action Commands (! Set Only)
| Command | Description |
|---|---|
| RSET | Reset to Factory Defaults |
| SAVE | Save Active Configuration to Flash |
| STST | Perform Self-Test |
| ZERO | Calibrate Zero Level |
Data Requests (? Get Only)
| Command | Description |
|---|---|
| CNER | CAN Error Counters |
| FWVR | Firmware Version |
| HWVR | Hardware Version |
| NVCD | Navicode |
| RSEN | Internal Sensor Values |
| SALL | Read All Sensor Data |
| SNID | Sensor Serial Number |
| STRS | Self-Test Results |
| TWID | Tape Magnetic Width |
Configuration Commands (! Set and ? Get)
| Command | Description |
|---|---|
| CMCF | Communication Mode |
| CNCF | CAN Configuration |
| RSCF | RS232 Configuration |
| SNCF | Sensor Configuration |
| TDTH | Tape Detection Strength Thresholds |
Action Commands
RSET — Reset to Factory Defaults
Resets calibration, sensor configuration, and communication configuration to factory-default values, saves the defaults to nonvolatile memory, and reloads the active communication settings.
This command clears the zero calibration. The sensor must be zero-calibrated again before use.
Syntax: !RSET
Arguments: None
SAVE — Save Active Configuration
Writes the current active configuration to nonvolatile memory.
Use this command after changing communication settings or sensor configuration with !CMCF, !RSCF, !CNCF, !SNCF, or !TDTH if the changes should remain in effect after power cycling.
Syntax: !SAVE
Arguments: None
STST — Perform Self-Test
Starts the internal magnetic sensing self-test. Use ?STRS to read the test results after the test has completed.
Syntax: !STST
Arguments: None
ZERO — Calibrate Zero Level
Captures and stores the ambient magnetic field strength at each internal sensor when no track or markers are present. These values are subtracted from subsequent readings.
The zero calibration is saved to nonvolatile memory automatically.
Syntax: !ZERO
Arguments: None
Data Requests
CNER — Read CAN Error Counters
Reads the current CAN controller transmit and receive error counters.
Syntax: ?CNER
Reply: ?CNER,TxError,RxError
| Parameter | Type | Range |
|---|---|---|
| TxError | Unsigned 8-bit | 0-255 |
| RxError | Unsigned 8-bit | 0-255 |
FWVR — Read Firmware Version
Reads the firmware revision, build date, and firmware hash.
Syntax: ?FWVR
Reply: ?FWVR,Revision,Date,FirmwareHash
| Parameter | Type | Format |
|---|---|---|
| Revision | Unsigned 32-bit | 10203 = v1.2.3 |
| Date | Unsigned 32-bit | YYYYMMDD |
| FirmwareHash | Unsigned 32-bit | — |
HWVR — Read Hardware Version
Reads the hardware version code.
Syntax: ?HWVR
Reply: ?HWVR,Version
| Parameter | Type |
|---|---|
| Version | Unsigned 8-bit |
NVCD — Read Navicode Marker
Reads the last decoded Navicode value and the associated detection counter. The counter increments each time a valid Navicode is detected. Navicode decoding requires markers alongside a detected guide tape; standalone point-source markers without tape do not update this value.
Syntax: ?NVCD
Reply: ?NVCD,NaviCode,Count
| Parameter | Type | Range |
|---|---|---|
| NaviCode | Unsigned 16-bit | 0-65535 |
| Count | Unsigned 8-bit | 0-255 |
RSEN — Read Internal Sensor Values
Reads the values of all 32 internal magnetic sensors after zero-offset correction. The first 16 values are the front row and the next 16 values are the back row.
Syntax: ?RSEN
Arguments: None
Reply: ?RSEN,Front1,...,Front16,Back1,...,Back16
| Parameter | Type | Units |
|---|---|---|
| Front(n), Back(n) | Signed 16-bit | uT |
SALL — Read All Sensor Data
Reads the main sensor measurement set in a single comma-delimited reply. The values are defined by their fixed order in the message. An 8-bit frame counter is appended at the end of the reply and increments each time SALL is requested, either by a ? command or by a # repeat command.
Syntax: ?SALL
Arguments: None
Reply: ?SALL,TDet,LTPos,RTPos,LTAng,RTAng,LM,RM,Fork,Merge,Intersection,LMX,LMY,RMX,RMY,Count
| # | Field | Description | Type | Units | Range |
|---|---|---|---|---|---|
| 1 | TDet | Tape detect and strength | Unsigned 8-bit | — | 0 = none, 1 = weak, 2 = medium, 3 = strong |
| 2 | LTPos | Left track position | Signed 8-bit | mm | -128 to 127 |
| 3 | RTPos | Right track position | Signed 8-bit | mm | -128 to 127 |
| 4 | LTAng | Left track angle | Signed 8-bit | degrees | -128 to 127 |
| 5 | RTAng | Right track angle | Signed 8-bit | degrees | -128 to 127 |
| 6 | LM | Left marker detected | Unsigned 8-bit | — | 0 or 1 |
| 7 | RM | Right marker detected | Unsigned 8-bit | — | 0 or 1 |
| 8 | Fork | Fork feature flag | Unsigned 8-bit | — | 0 or 1 |
| 9 | Merge | Merge feature flag | Unsigned 8-bit | — | 0 or 1 |
| 10 | Intersection | Intersection feature flag | Unsigned 8-bit | — | 0 or 1 |
| 11 | LMX | Left marker X position | Signed 16-bit | 0.1 mm | — |
| 12 | LMY | Left marker Y position | Signed 16-bit | 0.1 mm | — |
| 13 | RMX | Right marker X position | Signed 16-bit | 0.1 mm | — |
| 14 | RMY | Right marker Y position | Signed 16-bit | 0.1 mm | — |
| 15 | Count | Frame counter | Unsigned 8-bit | — | 0-255 |
Fork, Merge, and Intersection are implemented feature flags in current firmware. They are advisory detection hints derived from the magnetic geometry and should be validated on the actual tape layout before being used for route decisions.
Marker X/Y fields are reported in tenths of a millimeter. For example, -235 means -23.5 mm. When a marker is not detected, its position fields report 0. When no guide tape is present, a standalone point-source magnet is commonly reported as both left and right marker detections at the same lateral position.
SNID — Read Sensor Serial Number
Reads the sensor's unique hardware identification number.
Syntax: ?SNID
Reply: ?SNID,SerialNum
| Parameter | Type |
|---|---|
| SerialNum | Unsigned 32-bit |
STRS — Read Self-Test Results
Reads the results of the most recent self-test, whether performed automatically at power-up or started by the user. Returns the pass/fail status followed by the minimum and maximum magnetic delta measured across the internal sensing ICs.
Syntax: ?STRS
Reply: ?STRS,Result,MinMagDelta,MaxMagDelta
| Parameter | Type | Units | Range |
|---|---|---|---|
| Result | Unsigned 8-bit | — | 1 = Pass, 0 = Fail |
| MinMagDelta | Unsigned 16-bit | uT | 0-65535 |
| MaxMagDelta | Unsigned 16-bit | uT | 0-65535 |
TWID — Read Tape Magnetic Width
Reads the current tape magnetic width used by the tracking algorithm.
Syntax: ?TWID
Reply: ?TWID,Valid,MagneticWidth
| Parameter | Type | Units | Range |
|---|---|---|---|
| Valid | Unsigned 8-bit | — | 0 or 1 |
| MagneticWidth | Unsigned 16-bit | 0.1 mm | 0-65535 |
Valid indicates whether automatic width detection has converged. MagneticWidth is reported in tenths of a millimeter.
Configuration Commands
CMCF — Communication Mode
Selects the sensor's active communication mode.
Set Syntax: !CMCF,Mode
Get Syntax: ?CMCF
Reply: ?CMCF,Mode
| Parameter | Options | Default |
|---|---|---|
| Mode | 0: RS232 | 0 |
| 1: CANopen |
Use !SAVE after changing this value if the new mode should remain active after power cycling.
CNCF — CAN Configuration
Defines the parameters necessary for CAN operation.
Set Syntax: !CNCF,NodeId,Bitrate,AutoRun,TermResistor,Heartbeat,TPDO1on,Period1,TPDO2on,Period2,TPDO3on,Period3
Get Syntax: ?CNCF
Reply: ?CNCF,NodeId,Bitrate,AutoRun,TermResistor,Heartbeat,TPDO1on,Period1,TPDO2on,Period2,TPDO3on,Period3
| Parameter | Type | Range / Options | Default |
|---|---|---|---|
| NodeId | Unsigned 8-bit | 1-127 | 1 |
| Bitrate | Unsigned 32-bit | 125000, 250000, 500000, 1000000 bit/s | 250000 |
| AutoRun | Unsigned 8-bit | 0: Disabled, 1: Enabled | 0 |
| TermResistor | Unsigned 8-bit | 0: Disabled, 1: Enabled | 0 |
| Heartbeat | Unsigned 16-bit | 0-65535 ms | 1000 |
| TPDO1on | Unsigned 8-bit | 0: Disabled, 1: Enabled | 0 |
| Period1 | Unsigned 16-bit | 0-65535 ms | 10 |
| TPDO2on | Unsigned 8-bit | 0: Disabled, 1: Enabled | 0 |
| Period2 | Unsigned 16-bit | 0-65535 ms | 10 |
| TPDO3on | Unsigned 8-bit | 0: Disabled, 1: Enabled | 0 |
| Period3 | Unsigned 16-bit | 0-65535 ms | 10 |
A TPDO is transmitted only when its enable field is 1 and its period is nonzero. Use !SAVE after changing CAN settings if they should remain after power cycling.
RSCF — RS232 Configuration
Defines the operating parameters for the RS232 interface.
Set Syntax: !RSCF,Baudrate,Inverted
Get Syntax: ?RSCF
Reply: ?RSCF,Baudrate,Inverted
| Parameter | Options | Default |
|---|---|---|
| Baudrate | 9600, 19200, 38400, 57600, 115200 bit/s | 115200 |
| Inverted | 0: Standard RS232 signaling | 0 |
| 1: Reserved |
Baud-rate changes are applied after the !RSCF,OK reply is sent. The Inverted field is retained for compatibility; use 0 for current firmware.
Use !SAVE after changing this value if the new setting should remain after power cycling.
SNCF — Sensor Configuration
Configures tape polarity, marker polarity, tape edge detection, marker threshold, and tape magnetic width handling.
Set Syntax: !SNCF,Polarity,TapePulseThreshold,MarkerThreshold,AutoWidth,TapeMagneticWidth
Get Syntax: ?SNCF
Reply: ?SNCF,Polarity,TapePulseThreshold,MarkerThreshold,AutoWidth,TapeMagneticWidth
| Parameter | Type | Range / Options | Default |
|---|---|---|---|
| Polarity | Unsigned 8-bit | 0: Tape north on top, marker south on top | 0 |
| 1: Tape south on top, marker north on top | |||
| TapePulseThreshold | Unsigned 8-bit | 0-100 % of detected tape peak | 50 |
| MarkerThreshold | Unsigned 16-bit | 0-65535 uT | 600 |
| AutoWidth | Unsigned 8-bit | 0: Disabled, 1: Enabled | 1 |
| TapeMagneticWidth | Unsigned 16-bit | 0.1 mm | 250 |
When AutoWidth is enabled, the sensor estimates the magnetic width from the detected tape. When AutoWidth is disabled, TapeMagneticWidth is used as the fixed magnetic width. The default value 250 means 25.0 mm.
Use !SAVE after changing this value if the new setting should remain after power cycling.
TDTH — Tape Detection Strength Thresholds
Configures the absolute magnetic field thresholds used to classify tape strength in the TDet field of ?SALL and the CAN TPDO status byte.
Set Syntax: !TDTH,Weak,Medium,Strong
Get Syntax: ?TDTH
Reply: ?TDTH,Weak,Medium,Strong
| Parameter | Type | Units | Default |
|---|---|---|---|
| Weak | Unsigned 16-bit | uT | 400 |
| Medium | Unsigned 16-bit | uT | 800 |
| Strong | Unsigned 16-bit | uT | 1200 |
Use !SAVE after changing this value if the new thresholds should remain after power cycling.