SLMP (Mitsubishi MELSEC)

SLMP (Seamless Message Protocol, also known as MELSEC Communication Protocol / MC protocol) is used by Mitsubishi Electric MELSEC PLCs such as the iQ-R, iQ-F, Q and L series.

The driver communicates using binary 3E frames over TCP.

Both the Go and Java drivers address the word devices D, W and R only. This is the driver’s deliberate scope, not an unfinished port: the bit devices (M, X, Y, B) and the wider MELSEC command set are not implemented in either language.

Supported Operations

Name Value Description

read

write

subscribe (polling-emulated only - SLMP has no native push mechanism, so a subscription is really a periodic read under the hood)

Connection String

SLMP has the following connection string format:

slmp:{transport}://{ip-address}:{port}?{options}

An example connection string would look like:

slmp:tcp://192.168.0.10:5007

Note the transport, port and option fields are optional.

Connection String Options

Name

Type

Default Value

Required

Description

Name

SLMP (MELSEC) 3E

Code

slmp

Maven Dependency

<dependency>
  <groupId>org.apache.plc4x</groupId>
  <artifactId>plc4j-driver-slmp</artifactId>
  <version>1.0.0</version>
</dependency>

Default Transport

tcp

Supported Transports

  • tcp

Config options:

monitoring-timer

INT

0

SLMP monitoring timer written into each 3E request frame (0 = wait infinitely).

request-timeout-ms

INT

5000

Client-side timeout in milliseconds awaiting a response.

Transport config options:

tcp

tcp.connect-timeout-ms

INT

5000

Connection timeout in milliseconds.

tcp.read-timeout-ms

INT

0

Socket read timeout in milliseconds. 0 means no timeout.

tcp.write-timeout-ms

INT

0

Socket write timeout in milliseconds. 0 means no timeout.

tcp.no-delay

BOOLEAN

true

Enable TCP_NODELAY (disable Nagle’s algorithm).

tcp.keep-alive

BOOLEAN

false

Enable SO_KEEPALIVE.

tcp.send-buffer-size

INT

81920

Send buffer size in bytes. 0 uses system default.

tcp.receive-buffer-size

INT

81920

Receive buffer size in bytes. 0 uses system default.

tcp.local-address

STRING

Local address to bind to (optional). If not set, uses default.

tcp.local-port

INT

0

Local port to bind to (optional). 0 uses ephemeral port.

Tag Addresses

Addressing is implemented in Go and Java. Both address the word devices D, W and R only. See the protocol support matrix for what each implementation does.

General Format

Array selection uses the shared notation - a single index, an inclusive range, and optionally the array’s declared lower bound, placed before the type. See Addressing arrays.

In general all SLMP addresses have this format:

{device}{address}[selection]:{data-type}

If the data-type part is omitted, it defaults to WORD. If no selection is given, a single element is assumed.

Devices

The following word devices are supported:

  • D (data register, decimal address)

  • R (file register, decimal address)

  • W (link register, hexadecimal address; an optional 0x prefix is accepted)

The 0x prefix is only valid for hexadecimally addressed devices (W).

A single read or write request may cover at most 960 words (a conservative single-frame ceiling); larger requests are rejected instead of being split.

Data Types

The following data types are supported:

  • WORD (uint 16, default)

  • INT (int 16)

  • UINT (uint 16)

  • DINT (int 32)

  • UDINT (uint 32)

  • REAL (float 32)

Multi-word types (DINT, UDINT, REAL) are decoded from consecutive words in little-endian (low-word-first) order, as transmitted by the PLC.

Examples

  • D350 (one word from data register 350, default WORD type)

  • D350:DINT (one 32-bit integer, occupying two words, from data register 350)

  • R200[0..3]:REAL (four floats from file register 200)

  • W1A[0..9]:WORD (ten words from link register 0x1A)

  • W0x1A (link register 0x1A, using the explicit 0x prefix form)