You are on page 1of 6

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

Slave address D32201 --.Serial Communications Section 6-3 Modbus-RTU commands can be set simply by turning ON a software switch after setting the Modbus slave address. --. 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.00 D32203 Communications data : after setting the Modbus-RTU : command in the DM fixed allocation words. • 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.00 OMRON Inverters 3G3JV.) D32201 D32301 00 to 07 Function code 08 to 15 Reserved (Always 00. it is sotred in the following words in the DM Area. and data in the DM fixed allocation words for the Modbus-RTU Easy Master. --. 3G3MV. function. The response when received is also store in the DM fixed allocation words for the Modbus-RTU Easy Master. Slave address Function code Communications data Slave address Function code Communications data Modbus-RTU Master Modbus-RTU Execution Bit for Port 1 A641. 15 08 07 00 D32200 --.) 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 . Function code D32202 Number of communications data bytes Communications are easily achieved by simply by turning ON A641. or 3G3RV DM Fixed Allocation The Modbus-RTU command is stored in the following words in the DM Area.

Code Name Description 0x00 Normal end Not an error.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. 0x85 Incorrect confirmation The slave address in the response is differ- address ence from the one in the request. 0x8f Other error Other FINS response code was received. 0x02 Illegal function code The function code specified in the parameter is illegal. 0x04 Serial communica. 0x86 Incorrect confirmation The function code in the response is difference function code from the one in the request. 0x03 Data length overflow There are more than 94 data bytes. A service is already being executed (reception cuted traffic congestion). 0x84 CRC error A CRC error occurred. 0x88 Exception response An exception response was received from the slave. 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. The response frame is larger than the storage flow area (92 bytes). 0x01 Illegal address The slave address specified in the parameter is illegal (248 or higher). 0x82 Framing error A framing error occurred. 0x8A Execution canceled Executing the service has been canceled. 373 . 0x87 Response size over. 0x81 Parity error A parity error occurred.) D32251 D32351 00 to 07 Function code 08 to 15 Reserved D32252 D32352 00 to 07 Error code 08 to 15 Reserved (Always 00. 0x89 Service being exe.) 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. 0x83 Overrun error An overrun error occurred.

01 Modbus-RTU Master Execution Normal Flag ON: Execution normal. OFF: Execution normal or still in progress. 01 L-type Modbus-RTU Master Execution Normal Flag CPU ON: Execution normal. 02 Modbus-RTU Master Execution Error Flag ON: Execution error. 374 . OFF: Execution error or still in progress. port 1 OFF: Not executed or execution completed. Word Bit Port Contents A640 00 M-type Modbus-RTU Master Execution Bit CPU Turned ON: Execution started Units: Serial ON: Execution in progress. The communications mode in the PLC Setup must be set to the Gateway Mode to enable this functionality. The results (normal or error) will be given in corre- sponding flags. OFF: Execution normal or still in progress.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. Serial 02 port 1 Modbus-RTU Master Execution Error Flag ON: Execution error. port 2 OFF: Not executed or execution completed. 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. A641 00 M-type Modbus-RTU Master Execution Bit CPU Turned ON: Execution started Unit: Serial ON: Execution in progress. Units: OFF: Execution error or still in progress.

Serial Communications Section 6-3 System Configuration Using SAPs from an NS-series PT Using Function Blocks in CPU Unit NS-series PT Smart Active Parts RS-232C CP1L CPU Unit XW2Z-200T/500T Cable RS-422A/485 Option Board RS-232C Option Board RS-422A/485 (CompoWay/F or Modbus-RTU) CPU Unit functions as a gateway OMRON components that support CompoWay/F or Modbus-RTU slave functionality Note Refer to OMRON’s Smart Library website for the most recent information on using SAPs and function blocks. Note Serial ports 1 and 2 on the CP1L CPU Unit can be used to convert to the fol- lowing protocols. Serial Gateway Function When a FINS command is received. Responses are also converted in the same way. • CompoWay/F • Modbus-RTU This functionality is enabled when the serial communications mode is set to Serial Gateway. it is automatically converted to the proto- col corresponding to the message and sent on the serial communications path. 375 .

The com- munications mode in the PLC Setup must be set to the Serial PLC Link Mode to enable this functionality. Host Link FINS.1 to 25.Serial Gateway Mode nications mode Response timeout The time from when a message converted to a different pro- tocol is set until a response is received is monitored by the serial gateway function. messages can also be converted to Modbus-ASCII or Host Link FINS. or CPU bus) Conversion functions FINS commands addressed to serial port 1 or 2 on the CPU Unit are converted to CompoWay/F commands (after removing the header) if the FINS command code is 2803 hex and to Modbus-RTU commands (after removing the header) if the FINS command code is 2804 hex. (See note. Post-conversion data CompoWay/F command or Modbus-RTU command Serial communications 1:N half-duplex method Maximum number of 31 nodes Enabling serial commu. Refer to the SYSMAC CS/CJ Series Serial Communications Boards/Units Opera- tion Manual (W336) for details. User setting: 0. 376 . • Either serial port 1 or 2 can be used. Default: 5 s. A PLC Setup error will occur if an attempt is made to set both ports for Serial PLC Links. 6-3-5 Serial PLC Links Overview Serial PLC Links can be used to allow data to be exchanged among CP1L and CJ1M CPU Units via the RS-422A/485 or RS-232C Option Boards mounted to the CPU Units without requiring special programming.) Note Serial PLC Links cannot be used on serial ports 1 and 2 at the same time. (The size must be the same for all CP1L CPU Units. If one port is set as a Serial PLC Link slave or master.5 s Note A FINS response code of 0205 hex (response time- out) is sent to the source of the FINS command if a timeout occurs. toolbus. NT Link. but the number of linked words can be set to fewer words.Serial Communications Section 6-3 CPU Unit Serial Gateway Function Specifications Item Specification Pre-conversion data FINS (via FINS network. it will not be possible to set the other port for a Serial PLC Link.) • Words are allocated in memory in the Serial PLC Link Words (CIO 3100 to CIO 3199). Send delay function None Note If a CJ-series Serial Communications Unit is connected via a CJ Unit Adapter. • A maximum of 10 words can be transferred by each CP1L CPU Unit.