Sie sind auf Seite 1von 4

Serial Communications Section 6-3

Note A setting can be made to delay the transmission of data after the execution of
TXD(236).

Delay time

Transmission
Time
Execution of TXD(236)

Refer to the SYSMAC CP Series CP1L CPU Unit Programming Manual


(W451) for more details on TXD(236) and RXD(235).

6-3-3 Modbus-RTU Easy Master Function


Overview If an RS-232C or RS-422A/485 Option Board is used, the CP1L CPU Unit can
function as a Modbus-RTU Master to send Modbus-RTU commands by
manipulating software switches. This enables easily controlling Modbus-com-
pliant slaves, such as Inverters, through serial communications.
The following OMRON Inverters support Modbus-RTU slave operation:
3G3JV, 3G3MV, and 3G3RV.
The communications mode in the PLC Setup must be set to the Gateway
Mode to enable this functionality.

371
Serial Communications Section 6-3

Modbus-RTU commands can be set simply by turning ON a software switch


after setting the Modbus slave address, function, and data in the DM fixed
allocation words for the Modbus-RTU Easy Master. The response when
received is also store in the DM fixed allocation words for the Modbus-RTU
Easy Master.
15 08 07 00

D32200 --- --- Slave address

D32201 --- --- Function code

D32202 Number of communications data bytes


Communications are easily achieved
by simply by turning ON A641.00 D32203 Communications data
:
after setting the Modbus-RTU :
command in the DM fixed allocation
words.

Slave address Function code Communications data

Slave address Function code Communications data


Modbus-RTU Master Modbus-RTU
Execution Bit for Port 1
A641.00
OMRON Inverters
3G3JV, 3G3MV, or
3G3RV

DM Fixed Allocation The Modbus-RTU command is stored in the following words in the DM Area.
Words for the M-type CPU Units
Modbus-RTU Easy Serial port 1: D32200 to D32249
Master Serial port 2: D32300 to D32349
L-type CPU Units
Serial port 1: D32300 to D32349
When a response is received after turning ON the Modbus-RTU Master Exe-
cution Bit, it is sotred in the following words in the DM Area.
M-type CPU Units
Serial port 1: D32250 to D32299
Serial port 2: D32350 to D32399
L-type CPU Units
Serial port 1: D32350 to D32399
Words Bits Contents
Serial port 1 Serial port 2
on M-type on M-type
CPU Unit CPU Unit
or
Serial port 1
on L-type
CPU Unit
D32200 D32300 00 to 07 Command Slave address (00 to F7 hex)
08 to 15 Reserved (Always 00.)
D32201 D32301 00 to 07 Function code
08 to 15 Reserved (Always 00.)
D32202 D32302 00 to 15 Number of communications
data bytes (0000 to 005E
hex)
D32203 to D32303 to 00 to 15 Communications data
D32249 D32349 (94 bytes maximum)

372
Serial Communications Section 6-3

Words Bits Contents


Serial port 1 Serial port 2
on M-type on M-type
CPU Unit CPU Unit
or
Serial port 1
on L-type
CPU Unit
D32250 D32350 00 to 07 Response Slave address (00 to F7 hex)
08 to 15 Reserved (Always 00.)
D32251 D32351 00 to 07 Function code
08 to 15 Reserved
D32252 D32352 00 to 07 Error code
08 to 15 Reserved (Always 00.)
D32253 D32353 00 to 15 Number of response bytes
(0000 to 03EA hex)
D32254 to D32354 to 00 to 15 Response data
D32299 D32399 (92 bytes maximum)

Error Codes The following error codes are stored in an allocated DM Area word when an
error occurs in Modbus-RTU Easy Master function execution.
Code Name Description
0x00 Normal end Not an error.
0x01 Illegal address The slave address specified in the parameter
is illegal (248 or higher).
0x02 Illegal function code The function code specified in the parameter is
illegal.
0x03 Data length overflow There are more than 94 data bytes.
0x04 Serial communica- The Modbus-RTU Easy Master function was
tions mode error executed when the serial communications
mode was not the Serial Gateway Mode.
0x80 Response timeout A response was not received from the Servo.
0x81 Parity error A parity error occurred.
0x82 Framing error A framing error occurred.
0x83 Overrun error An overrun error occurred.
0x84 CRC error A CRC error occurred.
0x85 Incorrect confirmation The slave address in the response is differ-
address ence from the one in the request.
0x86 Incorrect confirmation The function code in the response is difference
function code from the one in the request.
0x87 Response size over- The response frame is larger than the storage
flow area (92 bytes).
0x88 Exception response An exception response was received from the
slave.
0x89 Service being exe- A service is already being executed (reception
cuted traffic congestion).
0x8A Execution canceled Executing the service has been canceled.
0x8f Other error Other FINS response code was received.

373
Serial Communications Section 6-3

Auxiliary Area Flags The Modbus-RTU command set in the DM fixed allocation words for the Mod-
and Bits bus-RTU Easy Master is automatically sent when the Modbus-RTU Master
Execution Bit is turned ON. The results (normal or error) will be given in corre-
sponding flags.
Word Bit Port Contents
A640 00 M-type Modbus-RTU Master Execution Bit
CPU Turned ON: Execution started
Units:
Serial ON: Execution in progress.
port 2 OFF: Not executed or execution completed.
01 L-type Modbus-RTU Master Execution Normal Flag
CPU ON: Execution normal.
Units:
Serial OFF: Execution error or still in progress.
02 port 1 Modbus-RTU Master Execution Error Flag
ON: Execution error.
OFF: Execution normal or still in progress.
A641 00 M-type Modbus-RTU Master Execution Bit
CPU Turned ON: Execution started
Unit:
Serial ON: Execution in progress.
port 1 OFF: Not executed or execution completed.
01 Modbus-RTU Master Execution Normal Flag
ON: Execution normal.
OFF: Execution error or still in progress.
02 Modbus-RTU Master Execution Error Flag
ON: Execution error.
OFF: Execution normal or still in progress.

6-3-4 Communications: Smart Active Parts and Function Blocks


Overview OMRON components that support CompoWay/F communications or Modbus-
RTU slave functionality (such as Temperature Controllers) can be easily
accessed from a CP1L CPU Unit equipped with an RS-422A/485 or RS-232C
Option Board using Smart Active Parts (SAPs) on an NS-series PT or using
function blocks in the ladder program in the CP1L CPU Unit.
The communications mode in the PLC Setup must be set to the Gateway
Mode to enable this functionality.

374

Das könnte Ihnen auch gefallen