Skip to content

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)

CommandDescription
RSETReset to Factory Defaults
SAVESave Active Configuration to Flash
STSTPerform Self-Test
ZEROCalibrate Zero Level

Data Requests (? Get Only)

CommandDescription
CNERCAN Error Counters
FWVRFirmware Version
HWVRHardware Version
NVCDNavicode
RSENInternal Sensor Values
SALLRead All Sensor Data
SNIDSensor Serial Number
STRSSelf-Test Results
TWIDTape Magnetic Width

Configuration Commands (! Set and ? Get)

CommandDescription
CMCFCommunication Mode
CNCFCAN Configuration
RSCFRS232 Configuration
SNCFSensor Configuration
TDTHTape 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

ParameterTypeRange
TxErrorUnsigned 8-bit0-255
RxErrorUnsigned 8-bit0-255

FWVR — Read Firmware Version

Reads the firmware revision, build date, and firmware hash.

Syntax: ?FWVR

Reply: ?FWVR,Revision,Date,FirmwareHash

ParameterTypeFormat
RevisionUnsigned 32-bit10203 = v1.2.3
DateUnsigned 32-bitYYYYMMDD
FirmwareHashUnsigned 32-bit

HWVR — Read Hardware Version

Reads the hardware version code.

Syntax: ?HWVR

Reply: ?HWVR,Version

ParameterType
VersionUnsigned 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

ParameterTypeRange
NaviCodeUnsigned 16-bit0-65535
CountUnsigned 8-bit0-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

ParameterTypeUnits
Front(n), Back(n)Signed 16-bituT

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

#FieldDescriptionTypeUnitsRange
1TDetTape detect and strengthUnsigned 8-bit0 = none, 1 = weak, 2 = medium, 3 = strong
2LTPosLeft track positionSigned 8-bitmm-128 to 127
3RTPosRight track positionSigned 8-bitmm-128 to 127
4LTAngLeft track angleSigned 8-bitdegrees-128 to 127
5RTAngRight track angleSigned 8-bitdegrees-128 to 127
6LMLeft marker detectedUnsigned 8-bit0 or 1
7RMRight marker detectedUnsigned 8-bit0 or 1
8ForkFork feature flagUnsigned 8-bit0 or 1
9MergeMerge feature flagUnsigned 8-bit0 or 1
10IntersectionIntersection feature flagUnsigned 8-bit0 or 1
11LMXLeft marker X positionSigned 16-bit0.1 mm
12LMYLeft marker Y positionSigned 16-bit0.1 mm
13RMXRight marker X positionSigned 16-bit0.1 mm
14RMYRight marker Y positionSigned 16-bit0.1 mm
15CountFrame counterUnsigned 8-bit0-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

ParameterType
SerialNumUnsigned 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

ParameterTypeUnitsRange
ResultUnsigned 8-bit1 = Pass, 0 = Fail
MinMagDeltaUnsigned 16-bituT0-65535
MaxMagDeltaUnsigned 16-bituT0-65535

TWID — Read Tape Magnetic Width

Reads the current tape magnetic width used by the tracking algorithm.

Syntax: ?TWID

Reply: ?TWID,Valid,MagneticWidth

ParameterTypeUnitsRange
ValidUnsigned 8-bit0 or 1
MagneticWidthUnsigned 16-bit0.1 mm0-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

ParameterOptionsDefault
Mode0: RS2320
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

ParameterTypeRange / OptionsDefault
NodeIdUnsigned 8-bit1-1271
BitrateUnsigned 32-bit125000, 250000, 500000, 1000000 bit/s250000
AutoRunUnsigned 8-bit0: Disabled, 1: Enabled0
TermResistorUnsigned 8-bit0: Disabled, 1: Enabled0
HeartbeatUnsigned 16-bit0-65535 ms1000
TPDO1onUnsigned 8-bit0: Disabled, 1: Enabled0
Period1Unsigned 16-bit0-65535 ms10
TPDO2onUnsigned 8-bit0: Disabled, 1: Enabled0
Period2Unsigned 16-bit0-65535 ms10
TPDO3onUnsigned 8-bit0: Disabled, 1: Enabled0
Period3Unsigned 16-bit0-65535 ms10

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

ParameterOptionsDefault
Baudrate9600, 19200, 38400, 57600, 115200 bit/s115200
Inverted0: Standard RS232 signaling0
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

ParameterTypeRange / OptionsDefault
PolarityUnsigned 8-bit0: Tape north on top, marker south on top0
1: Tape south on top, marker north on top
TapePulseThresholdUnsigned 8-bit0-100 % of detected tape peak50
MarkerThresholdUnsigned 16-bit0-65535 uT600
AutoWidthUnsigned 8-bit0: Disabled, 1: Enabled1
TapeMagneticWidthUnsigned 16-bit0.1 mm250

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

ParameterTypeUnitsDefault
WeakUnsigned 16-bituT400
MediumUnsigned 16-bituT800
StrongUnsigned 16-bituT1200

Use !SAVE after changing this value if the new thresholds should remain after power cycling.