ASCII Command Protocol
The MFR modules communicate via a standardized ASCII protocol. This applies to all interfaces (USB, RS232, Ethernet).
Connection Parameters
- Baud Rate: 9600 Baud
- Data Format: 8N1 (8 Data bits, No Parity, 1 Stop bit)
- Handshake: None
Command Structure
Communication follows the Request-Response scheme, although the module also sends automatically upon status changes. Every command ends with a Carriage Return (CR, 0x0D).
Data Encoding (Nibble-to-ASCII)
One byte (8 bits) is split into two 4-bit halves (Nibbles). 0x40 is added to each value (0..15) (@..O).
| Value | 0 | 1 | 2 | 3 | ... | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|
| Character | @ | A | B | C | ... | M | N | O |
Control Commands (Operational)
O - Set Outputs (Group)
Sets all 8 outputs simultaneously.
- Command:
O [DataHigh] [DataLow] ([MaskHigh] [MaskLow]) [CR] - Masking: (from Firmware V1.10) Optionally, two additional bytes can be sent to change only specific bits (
1=Change,0=Ignore). - Example:
O@O(Sets outputs 0-3 to ON, 4-7 to OFF).
o - Set Output (Single Bit)
(from Firmware V1.10) Sets exactly one output without affecting the others.
- Command:
o [Bit-Address] [Bit-Status] [CR] - Address:
@=Channel 0 ...G=Channel 7. - Status:
@=Off,A=On.
I - Read Inputs / Simulation
Queries the inputs or simulates input signals.
- Read:
I [CR]Responds with the actual status. - Simulation:
I [DataHigh] [DataLow] [CR]Performs a logical OR operation with the physical inputs. - Usage: Only for testing purposes to "force" inputs via software.
D - Watchdog (Dialog Monitoring)
(from Firmware V1.10) Safety function. Switches off all outputs if no communication occurs for time
- Command:
D [TimeHigh] [TimeLow] [CR] - Unit: 100ms steps (e.g., value 50 = 5 seconds).
- Deactivation:
D@@(Time = 0).
X - Reset
Performs a restart (Soft-Reset).
- Response: The module sends its ID (e.g.,
XSP01R...).
Automatic Events
The module sends data unsolicited when a state changes.
- On Input Change:
I [High] [Low] [CR] - On Output Change:
O [High] [Low] [CR]
Important for Programmers
Ensure that your reception routine can handle these asynchronous messages. If necessary, flush the input buffer before sending a command.
System & Configuration Commands
These commands are used for management and identification of the module.
U - Module Identification
Queries the hardware configuration (Output type and Interface).
- Command:
U [CR] - Response:
[Output][Interface] [CR] - Return Values:
- Character (Output):
L= Semiconductor (Logic / Low-Side)R= Relay
- Character (Interface):
E= EthernetU= USBR= RS-232
- Character (Output):
- Example: Response
LRmeans L-Series (Semiconductor) with 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 (Device Type, Number, Checksum BCC).
N / n - Module Name
Reads or writes the user-defined name of the module.
- Read:
N [CR]Returns the name (max. 20 characters). - Write:
n [Name] [CR]Sets the name (e.g., nMachine1).
Q - Read All Info
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.