Protocol description
Communication line configuration
Station configuration
I/O tag configuration
Literature
Changes and modifications
Document revisions
The Mitsubishi MELSEC protocol is used for communication with Mitsubishi PLCs (MELSEC L-series, MELSEC Q-series series, and MELSEC iFX-series) equipped with Ethernet communication modules. The UDP variant using the UDP protocol (on the TCP/IP-UDP line) and the TCP variant using the TCP protocol (on the TCP/IP-TCP line) are implemented. Read and write commands are supported.
The following rame formats are supported (see Frame type protocol parameter): 1E, 3E, 4E. Both binary and ASCII message encoding are supported (see the Code type protocol parameter). ASCII-encoded messages are approximately 2 times longer than binary-encoded messages.
Reading and writing various types of objects (device codes) is supported. These objects are bit-oriented or word-oriented, and the interpretation of several (16 or 32) consecutive bit objects as a signed/unsigned number or two consecutive word objects as a number (unsigned, signed, a real 32-bit number) is supported. Access to a specific bit of a word object is also supported.
Communication was tested against the Mitsubishi FX5UC-32MT/DSS-T model (frame 3E, binary encoding, TCP communication).
Configuration dialog box - tab Parameter.
They influence some optional parameters of the protocol. The following station protocol parameters can be set:
Table 1
Parameter | Meaning | Unit | Default value |
---|---|---|---|
General Parameters | |||
| Type of message encoding:
| - | Binary code |
| The type of frame (header) used. This type must be the same as the type configured on the Mitsubishi PLC side
| - | 3E |
1E/3E/4E Frames Common Parameters | |||
| Hexadecimal number (00-FF) specifying the station network module number (for remote stations). Keep the default value FF for directly connected PLCs. | - | FF |
| Specification of the time to wait for a response in 250 ms units, which is sent in the message header (a value of 0 means waiting without restriction). The default value of 16 means waiting for 4 seconds. | 250 ms | 16 |
| The maximum number of objects read in one message. The range is 1-960. Objects can be of bit or word type. A bit object is transmitted as 1 bit (2 bits in ASCII encoding), a word object is transmitted as 2 bytes (4 bytes in ASCII encoding). | - | 480 |
| Maximum response size - the size of the pure data. The range is 2-8192 bytes. | byte | 512 |
3E/4E Access Route Parameters | |||
| Destination network number (for multidrop systems/stations on remote networks). The value is entered in decimal and is in the range 0-255. When communicating with a directly connected station, the value 0 is entered. Other values (see documentation) are entered when communicating with stations located on other network segments (it can also be serial lines) located behind the directly connected station. See Literature for more information. | - | 0 |
| Target I / O module number (for multidrop/multiCPU/redundant systems). The value is entered in hexadecimal and is in the range 0000-FFFF. When communicating with a directly connected station, the value 03FF is entered. Other values (see documentation) are entered when communicating with stations located on other network segments (it can also be serial lines) located behind a directly connected station, in the case of multidrop connections, and in the case of working with redundant PLCs and PLCs with multiple CPUs. See Literature for more information. | - | 03FF |
| Destination station number (for multidrop/multiCPU/redundant systems). The value is entered in hexadecimal and is in the range 00-FF. When communicating with a directly connected station, the value 00 is entered. Other values (see documentation) are entered in the case of a multidrop connection. See Literature for more information. | - | 00 |
Other Parameters | |||
| Maximum count of request retries. If no response returns after a request has been sent, the station's status will change to a communication error. | - | 2 |
| Timeout before resending a request if no response has been received. | s | 0.1 |
| Timeout for receiving a response. The value of the parameter should be greater than the time corresponding to the value of the Monitoring Timer parameter. | s | 1.0 |
| Logging of detailed debug information about communication in the line log. | YES/NO | NO |
| Text reports of messages. If Code type=ASCII code, message listings will be in text form. | YES/NO | NO |
Possible types of I/O tag values: Ai, Ao, Di, Do, Ci, Co, TiR, ToR.
The address of the I/O tag is in the form <device code><device number>{ .bit} { ,<value type>} {, items}
Note: the I/O tag is ignored if its address starts with %IGNORE
Device code
In Mitsubishi protocol terminology, individual objects whose values are read and written are called devices. The protocol allows access to multiple types of devices. Working with the following types of devices is supported:
Device type | Device code | Data type |
---|---|---|
Special relay | SM | bit |
Special register | SD | word |
Input | X | bit |
Output | Y | bit |
Internal relay | M | bit |
Latch relay | L | bit |
Annunciator | F | bit |
Edge relay | V | bit |
Link relay | B | bit |
Data register | D | word |
Link register | W | word |
Timer Contact | TS | bit |
Timer Coil | TC | bit |
Timer Current value | TN | word |
Retentive Timer Contact | STS | bit |
Retentive Timer Coil | STC | bit |
Retentive Timer Current value | STN | word |
Counter Contact | CS | bit |
Counter Coil | CC | bit |
Counter Current value | CN | word |
Link special relay | SB | bit |
Link special register | SW | word |
Direct access input | DX | bit |
Direct access output | DY | bit |
Index register | Z | word |
File register | R | word |
Device number
For a specific type of device (device code), individual objects are identified by a number (device number). When using 3E and 4E frames, a 3-byte number is specified, when using a 1E frame, a 4-byte number is specified. Numbering starts from 0, the maximum number for a specific device type depends on the specific PLC.
Note 1: if the number starts with a hash sign (#), it is understood as hexadecimal, e.g. #A3 is 163 in decimal.
Note 2: if the number starts with "o", it is understood as octal, e.g. o17 is 15 in decimal. For several types of Mitsubishi PLCs, the octal system is used to number Inputs (X) and Outputs (Y).
Bit
Optional parameter - access to a specific bit. For device types (device code) that have word data, a specific bit (0-15) can be specified.
Note: writing is not yet implemented for the I/O tag with a specified bit, only reading.
Value type
Optional parameter - data interpretation.
For device types (device code) that have word data, the default interpretation is WORD (e.g. SD5 address).
For device types (device code) that have bit data, the BIT interpretation is preset (e.g. X5 address)
Value type | Interpretation |
---|---|
BIT | Interpretation of a bit-type device as a bit (e.g. X3, BIT) Interpretation of one bit of word-type device as a bit (e.g. D5.0) |
WORD | Interpretation of 16 consecutive bit-type devices as a 16-bit unsigned number (e.g. X10, WORD). Interpretation of one word-type device as an unsigned 16-bit number (e.g. SD10, WORD). |
INT | Interpretation of 16 consecutive bit-type devices as a 16-bit signed number (e.g. X10, INT). Interpretation of one word-type device as a signed 16-bit number (e.g. SD10, INT). |
DWORD | Interpretation of 32 consecutive bit-type devices as a 32-bit unsigned number (e.g. X10, DWORD). Interpretation of 2 consecutive word-type devices as a 32-bit unsigned number (e.g. SD10, DWORD). |
DINT | Interpretation of consecutive 32 bit-type devices as a 32-bit signed number (e.g. X10, DINT). Interpretation of 2 consecutive word-type devices as a 32-bit signed number (e.g. SD10, DINT). |
REAL | Interpretation of consecutive 32 bit-type devices as a 32-bit floating-point number (e.g. Y10, REAL). Interpretation of 2 consecutive word-type devices as a 32-bit floating-point number (e.g. SD10, REAL). |
Note: when interpreting 32-bit numbers, the data is interpreted as little-endian (a lower word at a lower address, higher at a higher address).
Items
The number of elements for structured I/O tags with configured Destination column. Every read element (1,2,3 .. items) will be written to one item of the destination column.
Note: All "items" elements are read at once. If e.g. 100 elements of device type (device code) which has data of word type (e.g. address D10, WORD, 100), are configured, it means reading of a block of 200 bytes. If the number of objects is greater than the value of the Max Points, parameter, or the data size is greater than the Max Data Bytes, the reading will not be performed and an error message Too many elements in point < I/O tag name> will be added to the line log.
-