Connect to Mitsubishi Electric MELSEC iQ-R, iQ-F, Q and L controllers (MC protocol / SLMP)
Migrated page, not yet verified against the current code. Treat values, paths and examples as indicative until this notice is removed.
Read and write the devices of a Mitsubishi Electric MELSEC iQ-R, iQ-F, Q or L controller from eaxScada over MC protocol / SLMP, through the controller’s Ethernet port, by device address (D100, M10, X1F). The protocol id in the configuration is MC_SLMP.
Supported controllers, as the Drivers catalogue names them (Mitsubishi Electric MELSEC iQ-R, iQ-F (FX5U, FX5UC, FX5UJ), Q, L (MC protocol / SLMP)):
- MELSEC iQ-R CPUs, on the built-in Ethernet port;
- MELSEC iQ-F: FX5U, FX5UC and FX5UJ, on the built-in Ethernet port;
- MELSEC Q CPUs with a built-in Ethernet port (QnUDE, QnUDEH);
- MELSEC L CPUs, on the built-in Ethernet port.
eaxScada speaks the binary code, with the 3E frame (the default) or the 4E frame, over TCP (the default) or UDP.
Before you start: set up the controller
Section titled “Before you start: set up the controller”In the controller’s engineering software, in the parameters of its built-in Ethernet port, then write them to the controller and reset it:
-
IP address of the port. Note it: it is the connection’s Controller IP address.
-
Communication data code: binary. ASCII is not supported.
-
Open a port for MC protocol / SLMP:
- iQ-R and iQ-F: in the external device configuration, add an SLMP connection with protocol TCP or UDP and a port number;
- Q and L: in the open settings, a connection with the open system MC protocol, protocol TCP or UDP, and a host station port number. These dialogs show the port in hexadecimal: enter its decimal value in eaxScada (1388 hex is 5000).
Note the port and the protocol. There is no fixed port: eaxScada uses the one you opened, and has no default.
-
Writing during RUN. If eaxScada is to write while the controller runs, allow online change (writing during RUN) over MC protocol / SLMP for that port. Without it, the controller refuses writes in RUN with an error end code.
-
Remote password: leave the port unlocked. A port locked by a remote password is not supported.
Then open the chosen TCP or UDP port between the eaxScada server and the controller.
Add the connection
Section titled “Add the connection”- In the Studio, Drivers → Add connection, and in Connects to choose Mitsubishi Electric MELSEC iQ-R, iQ-F (FX5U, FX5UC, FX5UJ), Q, L (MC protocol / SLMP).
- Fill in the settings:
| Field | Default | Range | What to enter |
|---|---|---|---|
| Controller IP address | empty | required | The IP address of the controller’s Ethernet port. |
| Port | empty | 1-65535, required | The port opened for MC protocol / SLMP on the controller, in decimal. |
| PLC series | none (Choose…) | iQ-R, iQ-F, Q, L, required | It decides how X and Y are numbered: hexadecimal on iQ-R, Q and L, octal on iQ-F. There is no default: X10 is a different input on an iQ-F than on a Q. |
| Transport | TCP | TCP, UDP | As opened on the controller. |
| Frame | 3E | 3E, 4E | 4E: each reply carries the request’s serial number, so a late reply is never taken for another. |
- Create connection, then Test connection. The test reads the CPU model: a success names it, with its model code and the frame. A controller that answers with an end code still proves it speaks MC protocol there; a connection that opens but gets no MC protocol answer says so (check the frame, the binary code and the port).
A connection without a PLC series, an IP address or a port, or with a setting out of range, is refused before anything is opened.
The route and the monitoring timer
Section titled “The route and the monitoring timer”The route says which controller a request is for, seen from the one the connection is open to. For a single controller, keep the defaults:
| Field | Default | Range | Means |
|---|---|---|---|
| Network No. | 0 | 0-239 | 0: the connected network. |
| PC No. | 255 | 1-120, 125, 126, 255 | 255: the connected station. |
| Module I/O No. (hex) | 03FF | 0000-03FF | 03FF: the controller itself; 03E0-03E3: CPU 1-4 of a multiple CPU system. |
| Station No. | 0 | 0-31 | |
| Monitoring timer (ms) | 1000 | 250-60000, in 250 ms steps | How long the controller may take before it answers with an error. It must be shorter than the connection’s request timeout, or the controller’s error answer would come after eaxScada stopped waiting: such a connection is refused. |
In the connection’s Communication Timing, Request Timeout is how long a request waits for its reply, and Retry Count (0-10) is how many times a read without a usable reply is sent again. A write is never sent again.
In the stored configuration the settings are host, port, transport (TCP, UDP), frame (3E, 4E), plc_series (iQ-R, iQ-F, Q, L), network_no, pc_no, module_io, station_no, monitoring_timer_ms and simulated.
Addresses
Section titled “Addresses”An address is the device name and its number, upper or lower case, no spaces. The number is decimal, hexadecimal or octal depending on the device:
| Device | Kind | Number | Example | Writable |
|---|---|---|---|---|
| X input | bit | hexadecimal; octal on iQ-F | X1F (iQ-R, Q, L), X17 (iQ-F) |
no |
| Y output | bit | hexadecimal; octal on iQ-F | Y20, Y17 (iQ-F) |
yes |
| M internal relay, L latch relay, F annunciator | bit | decimal | M100, L5, F0 |
yes |
| B link relay, SB link special relay | bit | hexadecimal | B1A, SB0 |
yes |
| SM special relay | bit | decimal | SM400 |
no |
| D data register, R file register | word | decimal | D100, R2000 |
yes |
| ZR file register (serial number access) | word | decimal | ZR10000 |
yes; not on iQ-F |
| W link register, SW link special register | word | hexadecimal | W1F, SW0 |
yes |
| SD special register | word | decimal | SD210 |
no |
| TN timer, STN retentive timer, CN counter: current value | word (16-bit) | decimal | TN10, CN3 |
yes |
| TS, TC, STS, STC, CS, CC: timer and counter contacts and coils | bit | decimal | TS10, CC3 |
no |
Two suffixes on a word device:
- One bit of a word:
D100.5, the bit as one hexadecimal digit0-F(D100.A). Read only (see Writes). - A string:
D100:20, the length in characters after the colon, 1-1920. A string of n characters takes (n + 1) / 2 words.
Device names that are refused with what to use instead: T, ST and C (use TN/TS/TC, STN/STS/STC, CN/CS/CC); long timers and counters (LT, LST, LC); index registers (Z, LZ); edge relays (V); direct inputs and outputs (DX, DY: use X and Y); module buffer memory (U\G); refresh data registers (RD); digit-specified devices (K4M0: map each bit, or a word device).
A device number must fit in a request: up to FFFFFF on iQ-F, Q and L, larger on iQ-R. A number the CPU does not have is answered with an error end code: that tag is BAD with the end code, and its neighbours are not affected.
The server checks the address and the data type against the connection’s PLC series when the mapping is saved, and the driver checks them again before every read and write. The Studio shows the same errors as you type.
Data types
Section titled “Data types”| Data type | Words | Notes |
|---|---|---|
| Bool | one bit | A bit device (M10, X1F), or one bit of a word (D100.5, read only). |
| Int16, UInt16 | 1 | Also INT, UINT, WORD. A timer or counter current value (TN, STN, CN) takes one of these. |
| Int32, UInt32, Float32 | 2 | Also DINT, UDINT, DWORD, REAL. From the address on, low word first. |
| Int64, Float64 | 4 | Also LINT, LREAL. Low word first. |
| String | (n + 1) / 2 | D100:20 holds 20 characters. |
A word device takes a word type; a bit device and a bit of a word take Bool; a String needs the :n length.
String tags: text read and write
Section titled “String tags: text read and write”A String mapping (D100:20, data type String) is read and written as text:
- Read: the string’s words are read in one batch read. Two characters per word, the first in the low byte, as the controller stores them; the text ends at the first NUL character or at its length. It is shown in the Tag Mappings grid’s value column, in quotes, with the read’s quality and time. A read that fails is BAD; the last text is never shown as GOOD. Screens and the tag engine hold numbers, so a screen does not display the text.
- Write: printable ASCII only (space to
~), at most the string’s length. The text is padded with NUL to the full length and written in one batch write, never split. A longer text or another character is refused before sending. - The tag’s write range applies first: Longest text (256 characters when empty) and Only these texts. Set Longest text to the string’s length so the operator sees the limit. See Limit tag writes.
- A number written to a String tag, or text to any other tag, is refused.
Scan rate and reads
Section titled “Scan rate and reads”Each device of the connection is polled at its own Device Scan Rate (ms) (scan_rate_ms, on the Polling & UNS tab): 250 ms for a connection created in the Studio, 100 ms when the setting is empty. See Scan rates.
Requests go one at a time over the connection. Within a poll, devices of one type whose numbers are consecutive (gaps of up to 16 words, or 64 bits) are read with one batch read, up to the device’s Max Block Read Size (in words; 16 bits per word for a bit device) and the protocol’s limit of 960 words or 7168 bits. A batch the controller refuses with an end code is read again tag by tag, so one bad address never makes its neighbours BAD. Strings are read alone. With block reads off on the device, every tag is read alone. The connection’s delay between requests (inter_request_delay_ms) follows a read that sent a request only, not a tag served from a batch already read.
With the 4E frame, a reply is matched to its request by its serial number; a reply that answers no request in flight, or cannot be read, is dropped and counted, and the connection is opened again. A connection that fails is opened again by the next read, at most once a second.
Writes
Section titled “Writes”A write goes through the same path as every other write: the server’s write policy and e-signature, the mapping’s read only flag and write range. Then the driver:
- refuses before sending an invalid address or type, a value the type cannot hold (out of range, not a whole number for an integer type), a Bool other than 0 or 1, and the read-only devices: inputs X, special relays and registers SM and SD, timer and counter contacts and coils (write the current value TN, STN or CN instead), and one bit of a word (
D100.5): the protocol has no command that writes one bit of a word, and a read-modify-write of the whole word could overwrite a change the controller makes in between. Write a bit device such as M, L or B, or the whole word; - writes exactly the mapped address in one command: a Bool on a bit device in bit units, so only that point is set or reset; a value of several words in one batch write;
- sends it once. A write succeeds only on the controller’s reply with end code 0. A reply with an end code is a refusal, reported with the code (for example writing during RUN not allowed). A write whose reply does not come, or cannot be read, is reported NOT CONFIRMED: the controller may or may not have applied it. The connection is closed and the write is never repeated; check the value and write again yourself if needed.
Link diagnostics
Section titled “Link diagnostics”The connection’s Controller link card (under its settings) and the driver diagnostics show:
| Row | Means |
|---|---|
| Connection | TCP or UDP, address and port, frame, binary, PLC series and the route (network, PC, module I/O, station) |
| Requests sent / answered | requests sent and replies matched to them |
| No answer in time | requests whose reply did not come within the request timeout |
| Error end codes answered | replies with an end code (device out of range, writing during RUN not allowed…) |
| Replies dropped (other serial number or route, wrong length) | replies that answered no request in flight, or could not be read |
| Reads sent again | reads repeated after no usable reply |
| Scan device | the device’s scan rate, set and measured; marked when the measured rate is well above the set one |
A link error stays shown until the controller answers again, plus a short hold, so the card does not flicker; the previous error is kept below the current one.
Not supported
Section titled “Not supported”- Browsing: the controller holds no tag names over MC protocol. Map each device address.
- ASCII code, the 1E frame, and serial (computer link) connections.
- Writing one bit of a word (
D100.5): write a bit device or the whole word. - Long timers and counters (LT, LST, LC), index registers (Z, LZ), module buffer memory (U\G), digit-specified devices (
K4M0). - A port locked by a remote password.
- Showing a String’s text on a screen: the text is read into the tag mapping, not into the tag engine (see String tags).
Test without hardware
Section titled “Test without hardware”A connection with Simulated on ("simulated": true) contacts nothing: an in-process controller answers the same requests in memory, so you can build screens and mappings before the controller is connected. The simulator tools/slmp-sim answers MC protocol on a test machine.