An MC protocol (SLMP) reply with end code 0000 means completed; anything else is an error, and instead of values the reply carries «error information». This guide gives the order to check things in when that happens, and what to fix in the request for each of the C050–C061 codes PortDock PLC Simulator uses.
1. Did a reply arrive at all?
No reply is not an end code problem. Check the connection (address, port, firewall), whether the frame (3E/4E) and data code (binary/ASCII) match the receiver, and the monitoring timer and client timeout. PortDock PLC Simulator does not answer frames in another format; it only logs an «IGNORED» line.
2. Read the end code
| Format | End code position | C059 looks like |
|---|---|---|
| 3E binary | bytes 10–11 (low byte first) | 59 C0 |
| 4E binary | bytes 14–15 | 59 C0 |
| 3E ASCII | characters 19–22 | C059 |
| 4E ASCII | characters 27–30 | C059 |
In binary, «59 C0» reads backwards as C059. Look it up as «59C0» and you will not find it in the manual.
3. Use the error information to find the request
The 9 bytes (18 ASCII characters) after the end code are the request's network No., PC No., I/O No., station No., command and subcommand. «… 0B 00 59 C0 00 FF FF 03 00 01 01 00 00» says a request with command 0101 and subcommand 0000 was refused with C059. A program sending several requests matches replies with these fields (and the serial number in 4E).
4. What to check for each code
| Code | Meaning | Check in the request |
|---|---|---|
| C050 | ASCII conversion error | Non-hex characters in ASCII code, or A–F in the number of a decimal device (D, M …) |
| C051 | Points out of range (words) | Batch read/write word points are 0 or above 960 — split the read |
| C052 | Points out of range (bits) | Bit points are 0 or above 7168 (binary) / 3584 (ASCII) |
| C053 | Random points out of range (bits) | 1402 bit points are 0 or above 188 (94 for subcommand 0003) |
| C054 | Random points out of range (words) | 0403: word + double-word points are 0 or above 192 (96 for 0002); 1402: words×12 + double words×14 above 1920 (960 for 0002) |
| C056 | Address out of range | A number beyond the device size. Reading a bit device in word units takes 16 points per word, so the end number grows fast. Were X/Y numbers sent in hex? |
| C057 | Request length mismatch | Header request data length = bytes (characters in ASCII) from the monitoring timer to the end |
| C059 | Wrong command/subcommand | Command and subcommand values and byte order (binary 0401 is 01 04). Does the receiver support the command? |
| C05B | Device cannot be accessed | A typo in the device code, or a word device (D …) requested in bit units (subcommand 0001) |
| C05C | Request data error | In PortDock PLC Simulator: loopback data count outside 1–960 (from 0.6.0 also a wrong mode value in a remote operation) |
| C05D | Monitor not registered | Was Entry Monitor Device (0801) sent first? PortDock PLC Simulator from 0.6.0 |
| C05F | Wrong access destination | Station fields (network, PC, I/O, station). PortDock PLC Simulator only uses it with «Own station requests only» on |
| C060 | Bit request error | A bit write value other than 0/1 — in binary bit writes each point is 4 bits («11 00» = ON ON OFF OFF) |
| C061 | Data length mismatch | The number of write values does not match the point count, or bytes are left over after the command data |
Meanings are shortened from MELSEC iQ-R Ethernet User's Manual (Application) SH-081257ENG 3.5 «List of Error Codes»; «Check in the request» lists the conditions under which PortDock PLC Simulator returns each code. A real PLC or communication module may return a different code for the same mistake. For codes not in this table, see the error code list in that PLC's or module's manual.
5. Test your error handling in advance
- PortDock PLC Simulator's fault injection «Reply with end code» returns a code of your choice (from the list or typed in hex). Writes are not applied then.
- Narrow the target by command, device, every Nth request or probability to see what your program does when only one of several requests fails.
- Check that your program logs the end code and the command from the error information, and what it shows on screen.
Paste a reply into the web tool «MC Protocol (SLMP) Frame Decoder» to see the end code and error information field by field. Paste a request and it shows which end code PortDock PLC Simulator would return.
This guide is based on Mitsubishi Electric's public manuals (SLMP and MC protocol); it is not affiliated with Mitsubishi Electric.
Sources
- SLMP Reference Manual SH(NA)-080956ENG — chapter 4 message format (header, length, end code, error information), 5.2 device codes and 0401/1401/0403/1402, 5.9 loopback
- MELSEC Communication Protocol Reference Manual SH-080008 — chapter 5 Ethernet messages (3E and 4E frames)
- MELSEC iQ-R Ethernet User's Manual (Application) SH-081257ENG — 3.5 List of Error Codes — meanings of C050–C061
Published 2026-10-29