Omron SYSMAC CS1W-SCB41-V1 Operation Manual page 271

Sysmac cs series; sysmac cj series. serial communications boards and serial communications units
Table of Contents

Advertisement

Communications Frames
Sending Modbus-RTU Commands
Example of Sending Modbus-RTU Command Using CMND(490) Instruction
242
Note Use either of the following methods to specify the serial port using
the CMND(490) instruction.
• Set 80/81 hex + 4
in the send destination unit address bits 00 to 07 of C+3. (With this
method, set the serial port number (physical port) to 0 hex (not used)
in bits 08 to 11 of C+2)
• Set the unit address of the Serial Communications Board/Unit itself
(Board: E1 hex; Unit: 10 hex + unit number) in the send destination unit
address bits 00 to 07 of C+3, and set the serial port numbers (Port
number 1: 1 hex; Port number 2: 2 hex) in the serial port number (phys-
ical port) bits 08 to 11 of C+2.
• Host Link FINS
Always set the unit address of the actual destination unit.
• Set the FINS command code 2804 hex indicating the Modbus-RTU con-
version in S.
• Set the slave address (1 byte) + FUNCTION code (1 byte) + communica-
tions data (n bytes) in order of leftmost byte to rightmost bytes (see note)
from S+1 onwards.
Note
For Modbus-RTU, set the Modbus-RTU slave address (1 byte) in the leftmost
byte of S+1, and the FUNCTION code (1 byte) in the rightmost byte of S+.
This example is for writing a frequency reference value from an OMRON
3G3MV Inverter connected through RS-485 to the Serial Communications
Unit via two networks, Ethernet-to-Controller Link.
Example: The CMND(490) instruction is executed in the PLC for Ethernet.
The Modbus-RTU command for writing frequency reference value data is sent
via Ethernet to the 3G3MV Inverter (Modbus-RTU slave address: 02) that is
connected to port 1 (Unit address: 80 hex + 4 hex
of the Serial Communications Unit (Unit number: 3), that is mounted to the
PLC on the Controller Link (Network address: 2; Node address: 5). The fre-
quency reference value 10.0 Hz (set as 100 decimal in units of 0.1 Hz) is writ-
ten.
The Modbus-RTU command is configured from the following elements.
Modbus-RTU slave address: 02
FUNCTION code: 10 hex (DATA WRITE)
Write start register No.: 0002 hex (frequency reference)
Write data: 0064 hex (100 decimal)
×
unit number directly as the serial port unit address
Section 6-8
×
unit number 3 = 8C hex)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents