Modbus/RTU communication (Master)
Question
I would like to use the Modbus/RTU protocol to communicate with other companies’ products using a JTEKT Electronics (formerly Koyo Electronics) PLC as the master.
How should I create a ladder program?
Answer
Please refer to the diagram below for the ladder program.
For details, refer to 7-8 “MODBUS RTU Instruction” in the “S Series Programming Manual”.
*Only the D0-06 series/D2-260,263,265/SJ-ETHER series can be used as the master station.
Com Port Settings
Note
Select “Modbus” as the protocol to use.
Method 1
Select COM Port Setup from the PLC Setup in the PLC menu.
Set communication conditions such as the protocol, station number, and baud rate to be used.
(Please check only “Modbus” for protocol)
Method 2
You can do the same thing as method 1 by setting a value in a special register using a ladder program.
For the addresses of special registers, refer to the user’s manual of each PLC.
Precautions when using SJ-ETHER
If you want to use port 1 of SJ-ETHER as the master station, you need to set it to forced RUN mode (RUN/TERM SW to RUN).
Communication port settings are also executed at the same time as the forced RUN mode is entered. (See sample ladder)
Communication Flag of COM Port
For the communication flag address, refer to the user’s manual of each PLC.
Sample Ladder Program
When port 2 is not communicating and M100 is OFF, read 32 bits from address 1 of station number 0.
Set the read data to 32 bits from M1000.
When port 2 is not communicating and M100 is OFF, write R2000 data to address 40001 of station number 0.
Inquiry
Click here for inquiries by email