ASCII Command Protocol
MFR modules use the same ASCII command protocol over USB, RS-232, and Ethernet.
Connection Parameters
- Baud rate (USB/RS-232): 9600 baud
- Data format (USB/RS-232): 8N1 (8 data bits, no parity, 1 stop bit)
- Handshake: None
Command Structure
Communication generally follows a request-response pattern, but the module also sends asynchronous messages when an input or output changes. End every command with a carriage return (CR, 0x0D).
The spaces and square brackets in the syntax descriptions below separate placeholders for readability; do not transmit them. For example, O [DataHigh] [DataLow] [CR] is transmitted as O@O\r when DataHigh is @ and DataLow is O.
Data Encoding (Nibble-to-ASCII)
Split each 8-bit data byte into its high and low 4-bit nibbles. Add 0x40 to each nibble value (0–15) to encode it as an ASCII character from @ through O.
| Value | 0 | 1 | 2 | 3 | ... | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|
| Character | @ | A | B | C | ... | M | N | O |
Operational Commands
O - Set Outputs (Group)
Sets all 8 outputs simultaneously.
- Command:
O [DataHigh] [DataLow] ([MaskHigh] [MaskLow]) [CR] - Masking: (firmware V1.10 and later) Optionally append two mask characters to change only selected bits (
1= change,0= ignore). - Example:
O@Oswitches outputs 0–3 on and outputs 4–7 off.
o - Set Output (Single Bit)
(firmware V1.10 and later) Sets one output without affecting the others.
- Command:
o [Bit-Address] [Bit-Status] [CR] - Address:
@= channel 0 throughG= channel 7. - Status:
@= off;A= on.
I - Read Inputs / Simulation
Queries the inputs or simulates input signals.
- Read:
I [CR]returns the current physical input state. - Simulation:
I [DataHigh] [DataLow] [CR]performs a logical OR with the physical inputs. Use this only for testing to force inputs through software.
D - Watchdog (Dialog Monitoring)
(firmware V1.10 and later) Switches off all outputs if no communication occurs for time
- Command:
D [TimeHigh] [TimeLow] [CR] - Unit: 100 ms increments (for example, a value of 50 equals 5 seconds).
- Disable:
D@@(time = 0).
X - Reset
Performs a software reset.
- Response: The module sends its ID (e.g.,
XSP01R...).
Automatic Events
The module sends the following messages without a request when a state changes:
- Input change:
I [High] [Low] [CR] - Output change:
O [High] [Low] [CR]
Important for Programmers
Design the receiving routine to parse asynchronous messages and distinguish them from command responses. Do not assume that the next message always belongs to the most recently sent command.
System & Configuration Commands
These commands are used for management and identification of the module.
U - Module Identification
Queries the output type and communication interface.
- Command:
U [CR] - Response:
[Output][Interface] [CR] - Return Values:
- Output character:
L= solid-stateR= relay
- Interface character:
E= EthernetU= USBR= RS-232
- Output character:
- Example: The response
LRidentifies an L-series solid-state output module with an RS-232 interface.
V - Firmware Version
Reads the current firmware version of the microcontroller.
- Command:
V [CR] - Response:
[Version].[Compilation] [CR](e.g.,1.10)
S - Serial Number
Reads the unique serial number of the module.
- Command:
S [CR] - Response: Hexadecimal string containing the device type, number, and BCC checksum.
N / n - Module name
Reads or writes the user-defined name of the module.
- Read:
N [CR]Returns the name (maximum 20 characters). - Write:
n [Name] [CR]Sets the name (e.g., nMachine1).
Q - Read all information
Returns a combined list of all parameters mentioned above (Name, Version, Serial Number, ID) in one block.
- Command:
Q [CR]
Z / z - Logic Configuration
Reads (z) or writes (Z) the 16-byte parameter block for the MFR time functions of a channel.