PLC communication protocol [Mitsubishi] FX protocol message format and reading and writing examples

Through the programming port communication protocol, the specific operable soft components are: X/Y/M/S/T/C/D.
Communication settings
must be set to: baud rate 9600, even parity, 7 data bits, 1 stop bit. Otherwise communication is impossible.

1. Message structure

Note:
All characters in the communication protocol are represented by their hexadecimal ASCII codes. If there is decimal data, it must be converted into a hexadecimal number first, and then each character of the hexadecimal number is represented by its corresponding hexadecimal ASCII code

1. STX: ASCII code, the meaning is Start of Text, and the hexadecimal code is 02H;

The method of converting hexadecimal 0-9 to ASC II code is [Number+30H])

2. CMD: FX series PLC has 4 communication commands, which are read command, write command, set command and reset command.

When reading, it is 0, that is, the hexadecimal code 30H; when writing, it is 1, that is, the hexadecimal code is 31H;

 3. ADDR: The initial address of the soft component to be operated can be obtained by looking up the table, as follows. Note that it is the starting address, for example, to query the D0, D11 registers

Guess you like

Origin blog.csdn.net/qq_43445867/article/details/131271620