InfoPLC Net DRT1 232C2
InfoPLC Net DRT1 232C2
04000 10112 IOWR #00FE DM1000 #0019 25506 MOV(21) #0000 040 25506 MOV(21) #0001 040
Section 6-2
When IR 04000 turns ON, the CPU Unit will check that IR 10112 (Unit number 0 Master's Message Communications Execution Enabled Flag) is ON, and message transmission will start. 00FE: Master's node address 00, Master's unit address FE Hex DM 1000: Command data storage words 0019 Hex: Master's unit number 00, 19 command data words (BCD) If the Equals Flag is ON (writing to the Master has been completed normally), IR 04000 will be cleared (message transmission completed). If the Equals Flag is OFF (error in writing to the Master), IR 04000 will be turned ON, and the data will be transmitted again.
END(01)
Note When transmitting explicit messages from an OMRON Master Unit, specify 2 bytes each for the Class ID and the Instance ID. Response When data is written properly, the response will be stored as shown in the following table.
Words DM 0100 DM 0101 DM 0102 DM 0103 Contents (Hex) 28 01 00 00 00 02 07 9E Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex. Response code is 0000 Hex (normal completion). Number of bytes received (data length from word DM 0103 onwards) is 2 bytes. Slave node address is 07. BYTE DATA READ response service code is 9E Hex.
6-2
RS-232C Units
The RS-232C Unit is a Special I/O Unit that uses the DeviceNet Network to exchange I/O between the Master Unit and an RS-232C port. Explicit messages are used to set the Unit and perform I/O. There are two RS-232C ports which can be used separately with the RS-232C Unit.
6-2-1
6-2-2
260
RS-232C Units
Node address setting: Baud rate setting:
ON
Section 6-2
Pins 1 through 6 Pins 7 and 8
1 2 3 4 5 6 7 8 9 10
Reserved (Always OFF.) Node address setting Baud rate setting
Each Slaves node address is set with pins 1 through 6 of the Slaves DIP switch. Any node address within the setting range can be used as long as it isnt already set on another node.
Pin 6 0 0 0 DIP switch setting Pin 5 Pin 4 Pin 3 Pin 2 0 0 0 0 0 0 : : 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 61 62 63 0 0 0 0 0 1 Node address Pin 1 0 1 0 0 (default) 1 2 : :
Note
1. Refer to Appendix A Node Address Settings Table for a complete table of DIP switch settings. 2. The Slave wont be able to participate in communications if the same node address is used for the Master or another Slave node (node address duplication error).
Pins 7 and 8 are used to set the baud rate as shown in the following table. (These pins are factory-set to OFF.)
Pin settings Pin 7 OFF ON OFF ON OFF OFF ON ON Pin 8 125 kbps (factory setting) 250 kbps 500 kbps Not allowed. Baud rate
Note
1. Always turn OFF the Slaves power supply (including the communications power supply) before changing the baud rate setting. 2. Set the same baud rate on all of the nodes (Master and Slaves) in the Network. Any Slaves with baud rates different from the Masters rate wont be able to participate in communications, and may cause communications errors to occur between nodes with correct baud rate settings.
261
RS-232C Units
Section 6-2
6-2-3
Specifications
Item Models Input points DRT1-232C2 Specification
General Specifications
Inputs: 2 ports max. (One word is used in the IN Area to detect the communications status.) Communications power 11 to 25 V DC supply voltage (Supplied from the communications connector.) Internal power supply voltage Current consumption Noise immunity 20.4 to 26.4 V DC (24 V DC, 15 to +10%) Communications: 50 mA max. Internal circuits: 100 mA max. Internal power supply normal: 600 V Internal power supply common: 1.5 kV Pulse width: 0.1 to 1 s Pulse rise time: 1 ns (via noise simulator) 10 to 150 Hz, 1.0-mm double amplitude or 69 m/s2 200 m/s2 500 V AC, 50/60 Hz for 1 min, leakage current: 1 mA max. (between DC power supply and FG) 20 M min. at 100 V DC (between DC power supply and FG) 10 to 55C 25% to 85% (with no condensation) No corrosive gases 25 to 65C M4 screw mounting or DIN 35-mm track mounting 100 N Track direction: 10 N 100 N 250 g max.
Vibration resistance Shock resistance Dielectric strength Insulation resistance Ambient temperature Ambient humidity Operating atmosphere Storage temperature Mounting Mounting strength Terminal strength Weight
262
RS-232C Units
Item Flow control
Section 6-2
Specification Enable/Disable (RS/CS control only) Flow Control Enabled The RS (Request Send) signal is normally ON, but it turns OFF when the receive buffer reaches 75% of capacity. CS is always checked. Flow Control Disabled The RS (Request Send) signal is always ON. The Receive Buffer Overflow Flag turns ON if the receive buffer overflows. CS is always checked. Note: The CS signal is always checked. Data will not be output if CS is not connected. Short-circuit the RS-CS signals when they are not used. 15 m max.
Transmission distance
6-2-4
Components
RS-232C connector Indicators port 1 RS-232C connector port 2
Power supply DIP switch (Refer to page 260.) terminal Pins 1 to 6: Node address Communications connector Pins 7 and 8: Baud rate Pins 9 and 10: Reserved (Always OFF)
Indicators
The indicators display the status of the RS-232C Unit and the network.
Indicator Color MS Green (Module status) Red ON Flashing ON Flashing --OFF Status Normal Settings incomplete Fatal error Non-fatal error No power supply Meaning The Unit is operating normally. Settings are being read. A fatal error (hardware error) has occurred. A non-fatal error, such as a switch setting error, has occurred. Unit error, power is not being supplied, the Unit is being reset, or waiting for initial processing to start.
263
RS-232C Units
Indicator Color NS Green (Network status) Status Online/communications connection established Offline/communications connection not yet established Fatal communications error
Section 6-2
Meaning Normal Network status (Communications connection established.) The Network is normal, but the communications connection is not established.
ON
Flashing
Red
ON
Flashing
Non-fatal communications error Offline/ power OFF Unit error Normal Port 1 receiving Port 1 not receiving Port 1 transmitting Port 1 not transmitting
A fatal communications error has occurred. Network communications are not possible. Check for a node address duplication or Bus Off error. A communications error with the Master Unit has occurred. The power supply to the Master Unit is not ON, etc. Unit hardware error. Unit hardware is normal. Data is being received at RS-232C port 1. No data is being received at RS-232C port 1. Data is being transmitted from RS-232C port 1. No data is being transmitted from RS-232C port 1.
SD1
Orange
ON OFF
RD2
Orange
ON OFF
Port 2 receiv- Data is being received at ing RS-232C port 2. Port 2 not receiving Port 2 transmitting Port 2 not transmitting No data is being received at RS-232C port 2. Data is being transmitted from RS-232C port 2. No data is being transmitted from RS-232C port 2.
SD2
Orange
ON OFF
264
RS-232C Units
Section 6-2
6-2-5
Bits 0, 8: Transmission Ready Flag Bits 1, 9: System Parameter Setup Error Flag Bits 2, 10: Receiving Flag Bits 3, 11: Received Flag Bits 4, 12: Parity Error Flag Bits 5, 13: Overrun Error Flag Bits 6, 14: Framing Error Flag Bits 7, 15: Receive Buffer Overflow Flag
Bit 8
Function 0: Transmitting data 1: Transmission enabled (no data transmitted) When writing data to other ports (SEND command), check to make sure this bit is 1 (ON) before starting. 0: System parameter setup normal 1: System parameter setup error 0: No data is being received 1: Data is being received 0: No data in the reception buffer 1: Data in the reception buffer When reading data from other ports (RECEIVE READ DATA command), check to make sure this bit is 1 (ON) before starting.
1 2 3
9 10 11
12
13
14
15
0: No parity error 1: Parity error When a parity error occurs, make sure that the parity setting for the RS-232C Unit and the RS232C device are the same. Overrun Error Flag 0: No overrun error 1: Overrun error When an overrun error occurs, make sure that the baud rate setting for the RS-232C Unit and the RS-232C device are the same. Framing Error Flag 0: No framing error 1: Framing error When a framing error occurs, make sure that the character format setting (data length, parity, No. of stop bits) for the RS-232C Unit and the RS232C device are the same. Receive Buffer 0: No overflow in the reception buffer Overflow Flag 1: Reception buffer overflow (Not possible to read receive data) When the reception buffer overflows it is necessary to either reset or restart the RS-232C Unit, or reset (initialize) the RS-232C port at which the overflow occurred.
265
RS-232C Units
Section 6-2
6-2-6
The general operating procedure for the RS-232C Unit is as follows: 1. Turn ON the power to the Master Unit and all Slaves, including the RS232C Unit. 2. When necessary, explicit messages can be sent from the Master to set the parameters of the RS-232C ports 1 and 2 on the RS-232C Unit. Note a) Communications setting do not become effective even after the explicit message has been completed normally. For the settings to be effective, the RS-232C port must be reset using the PORT RESET command, or by restarting the RS-232C Unit. The previous settings will be in effect until the new settings are enabled. b) The communications settings are held internally by the RS-232C Unit, so once they have been set, they will not change when the Unit is turned OFF or reset, and once set, it is not necessary to set the parameters again, unless there are changes to be made. 3. Register the RS-232C Unit in the Masters scan list. There are two methods of registering on the scan list. Turn ON the Enable Scan List software switch on the Master Unit. Create a scan list and registering the Unit using a DeviceNet Configurator. For further details on Master Unit operations, refer to the DeviceNet Master Unit Operation Manual or the DeviceNet Configurator Operation Manual. 4. When necessary, explicit messages can be sent from the Master to control the flow of data through the RS-232C ports 1 and 2 on the RS-232C Unit. Note a) When sending or receiving data through ports 1 and 2, it is necessary to check the status word allocated to the RS-232C Unit for communications status in the Masters IN Area. b) Ports 1 and 2 can send and receive data independently but because the RS-232C Unit itself can only process one explicit message at a time, even if the SEND/RECV commands to be sent are for another port, always make sure that the previous explicit message has been processed before sending the next message.
The communications settings can be made using the OMRON DeviceNet Configurator (version 2.@ or later). When using a version earlier than 2.@, contact your local sales office before use. (Version information can be confirmed from the Help Menu.) 1. Connect a DeviceNet Configurator to the DeviceNet Network and go online. 2. Turn ON the power to the RS-232C Unit.
1,2,3...
266
RS-232C Units
Section 6-2
3. Locate the RS-232C Units icon in the Network Configuration window and double click the icon.
The Device Parameters Editing Window (Communications Settings parameter setting window) will be displayed. 4. Either double click on the Communications parameter that you want to change or select the desired parameter and press the Enter Key.
267
RS-232C Units
5. Set or change parameters. frame format
Section 6-2
Put check marks next to the items that you want to disable and press the Enter Key, or click another location in the window.
Data size Input the new value and press the Enter Key, or click another location in the window.
Settings other than frame format and Data size Select the desired parameter setting from the corresponding pull-down menu and press the Enter Key, or click another location in the window. (In this example, the character format is being set.)
268
RS-232C Units
Section 6-2
6. When the desired parameter changes and settings have been completed, click the Download Button. The edited parameters will be written to the RS-232C Unit.
7. Click the Reset Button to enable the edited parameters. A reset confirmation message will be displayed. Click the Yes button to confirm. Note 1. When exchanging data through ports 1 and 2, it is necessary to confirm the status of the data transfer (communications status) in the words allocated to the RS-232C Unit in the Master Units Input Area. 2. It is possible to operate ports 1 and 2 independently, but the RS-232C Unit can process only one explicit message at a time. Even if you are going execute a send command or receive command for the other port, confirm that the previous explicit message processing has been completed before executing the next explicit message.
6-2-7
RS-232C Unit
Response
269
RS-232C Units
RS-232C Unit Explicit Message List
Section 6-2
The explicit messages that can be processed by the RS-232C Unit are as listed in the following table. For the RS-232C Unit, the service code and the Instance ID determine the processing content and object. The Class ID is always 0094 Hex.
Explicit message PARAMETER SET PARAMETER READ INITIALIZE PARAMETERS RS-232C DATA SEND RS-232C RECEIVE DATA READ PORT RESET Error response Function Sets the parameters for an RS-232C port. Service code (See note) 10 Hex (90 Hex) Instance ID 01 Hex Page 272
Reads the parame- 0E Hex (8E Hex) 01 Hex ters set for an RS-232C port. Initializes the parameters for an RS-232C port. Transmits data from an RS-232C port. Reads data received by an RS-232C port. Resets an RS-232C port. When an error occurs in an explicit message (command), an error response is sent from the RS-232C Unit. 05 Hex (85 Hex) 01 Hex
275
276
276
0E Hex (8E Hex) Port 1: 02 Hex Port 2: 03 Hex 05 Hex (85 Hex) --- (94 Hex) Port 1: 02 Hex Port 2: 03 Hex ---
277
278 279
Note The parentheses indicate the response values. Explicit Message Format This section explains the common features of explicit commands and responses. Details and usage examples will only be provided however, for those explicit messages that the RS-232C Unit can process. For details on using explicit messages with a Master Unit, refer to the DeviceNet Operation Manual. The number of bytes designated for Class ID, Instance ID, and Attribute ID differ depending on the Master. When sent from an OMRON DeviceNet Master, Class ID and Instance ID are 2 bytes (4 digits), and Attribute ID is 1 byte (2 digits). For an example using this case, see 6-2-8 Using Explicit DeviceNet Messages. Command Block
00 94
151 bytes max.
Instance ID Attribute ID
Data
Destination Node Address The node address of the RS-232C Unit controlled by the explicit message (command) in single-byte (2-digit) hexadecimal.
270
RS-232C Units
Service Code, Class ID, Instance ID, Attribute ID
Section 6-2
The parameters for specifying command, processing object, and processing content. For the RS-232C Unit, however, Class ID is always 94 Hex. Attribute ID is not necessary for some commands. If the specified codes and ID area are outside the permitted range, an error response will be returned (08FF Hex), and the command will not be executed. Data Data set when necessary. A maximum of 151 bytes can be set. Some commands do not require this data. Response Block The normal response block is shown below.
1,024 bytes max. No. of received bytes Service code Data
The error response block is shown below. This response block is returned when an error occurs for an explicit message.
Error code No. of received Service code bytes (94 Hex: Fixed) Source node address
If an explicit message fails (timeout etc.), an explicit message response will not be returned. When the command has been sent using the FINS command EXPLICIT MESSAGE SEND, only an FINS error response is returned. No. of Received Bytes The number of bytes received from the source node address is returned in hexadecimal. When an error response is returned for an explicit message, the number of bytes is 0004 Hex. Source Node Address The node address of the node from which the command was sent is returned in hexadecimal. Service Code For normal completion, the value when leftmost bit of the service code specified by the command is ON is stored as shown in the table below.
Command service code 10 Hex 0E Hex 05 Hex 90 Hex 8E Hex 85 Hex Response service code
When an error response is returned for an explicit message, the value is 94 Hex.
271
RS-232C Units
Data
Section 6-2
Data read when the PARAMETER EAD or RS-232C RECEIVE DATA READ commands are used. The maximum number of bytes is 1,024. Only a maximum of 152 bytes can be read using an OMRON DeviceNet Master. Be sure not to exceed the maximum of 152 bytes. Error Code The explicit message error code. For details see Error Response on page 279. PARAMETER SET Sets the parameters for the specified RS-232C port. Command Block
10 00 94 00 01
6 bytes max. Set values
Instance ID Attribute ID
Response Block
272
RS-232C Units
Parameters Attribute ID, Set Values (Command)
Section 6-2
The parameters and set values are set as shown in the following table.
Port Port 1 Parameters Set all parameters Attribute ID 64 Hex Set values ALL PARAMETER SET (See below) Initial values Initial values for each parameter
Specify the appropriate set values from the Data bit length: parameters in the table, as single-byte (2-digit) 7 bits hexadecimal. (See note.) Parity: Even No. of stop bits: 2 bits
Header code 66 Hex enable/disable, delimiter code enable/disable, flow control enable/disable
Specify bit data in single-byte (2-digit) hexadecimal, as shown in the following diagram.
Bit
Always 0
Header code: 0: Enabled 1: Disabled Delimiter code: 0: Enabled 1: Disabled Flow control (RS/CS control) 0: Enabled 1: Disabled
Baud rate
67 Hex
Header code (only 68 Hex when header code is enabled) Delimiter code (only 69 Hex when delimiter code is enabled) No. of bytes 6A hex received after the delimiter (when the delimiter code is enabled) or the No. of bytes received per frame (when the delimiter code is disabled).
Specified in single-byte (2-digit) hexadecimal as follows: 00 Hex: 1,200 bps 01 Hex: 2,400 bps 02 Hex: 4,800 bps 03 Hex: 9,600 bps 04 Hex: 19,200 bps 05 to 07 Hex: Not allowed Specifies the header code in single-byte (2digit) hexadecimal. Specifies the delimiter code in single-byte (2digit) hexadecimal.
2,400 bps
273
RS-232C Units
Port Port 2 Parameters Set all parameters Attribute ID 6B Hex Set values ALL PARAMETER SET (See below) Specify the appropriate set values from the parameters in the table, as single-byte (2-digit) hexadecimal). (See note.)
Section 6-2
Initial values Initial values for each parameter Data bit length: 7 bits Parity: Even No. of stop bits: 2 bits Header code and delimiter code enabled, flow control disabled
Header code 6D Hex enable/disable, delimiter code enable/disable, flow control enable/disable
Specify bit data in single-byte (2-digit) hexadecimal, as shown in the following diagram.
Bit
Always 0
Header code: 0: Enabled 1: Disabled Delimiter code: 0: Enabled 1: Disabled Flow control (RS/CS control) 0: Enabled 1: Disabled
Baud rate
6E Hex
6F Hex
Specified in single-byte (2-digit) hexadecimal as follows: 00 Hex: 1,200 bps 01 Hex: 2,400 bps 02 Hex: 4,800 bps 03 Hex: 9,600 bps 04 Hex: 19,200 bps 05 to 07 Hex: Not allowed Specifies the header code in single-byte (2digit) hexadecimal. Specifies the delimiter code in single-byte (2digit) hexadecimal.
2,400 bps
Delimiter code (only 70 Hex when delimiter code is enabled) No. of bytes 71 hex received after the delimiter (when the delimiter code is enabled) or the No. of bytes received per frame (when the delimiter code is disabled).
Note Port 1 and 2 parameter settings for data bit length, parity, and No. of stop bits:
Set value 00 Hex 01 Hex 02 Hex 03 Hex 04 Hex 05 Hex 06 Hex 07 Hex 08 Hex 09 Hex 0A Hex to 0F Hex 7 7 7 7 7 7 8 8 8 8 7 Data bit length Even Odd None Even Odd None Even Odd None None Even Parity 1 1 1 2 2 2 1 1 1 2 2 No. of stop bits
274
RS-232C Units
ALL PARAMETER SET
Section 6-2
Writes all the Attribute ID set values to consecutive words, and transmits all the settings at the same time, as shown in the following diagram.
Bit First word First word +1 First word +2 Attribute code 64 Hex (6 B Hex) Header code enable/disable 66 Hex (6D Hex) Header code 68 Hex (6F Hex) No. of bytes received after the delimiter /per frame 6A Hex (71 Hex) Data bit length 65 Hex (6C Hex) Baud rate 67 Hex (6E Hex) Delimiter code 69 Hex (70 Hex) 00 Hex: Fixed
First word +3
Note The hexadecimal values displayed above are the set values for Attribute ID. The values in parentheses are the Attribute ID values for port 2
The new set values will become effective if the PORT RESET command is sent or the RS-232C Unit is restarted after the command is completely normally. PARAMETER READ Reads the parameters set for the RS-232C port. If the PARAMETER SET command has not been sent, or the RS-232C Unit has not been reset, this command will read the previously set parameters, not the new settings. (The RS-232C port will also operate according to the previous settings.) Command Block
0E 00 94 00 01
Instance ID Attribute ID
Response Block
6 bytes max. Service Set values No. of received code bytes Source node address
Parameters Attribute ID (Command) Specifies the Attribute ID for reading the set values. For details on what to specify, see PARAMETER SET on page 272. It is also possible to specify all parameters at once (Port 1: 64 Hex, Port 2: 6B Hex). Set Values (Response) Reads the values that are set in Attribute ID and stores them. For details on the meaning of the stored values, see PARAMETER SET on page 272.
275
RS-232C Units
INITIALIZE PARAMETERS Initializes the parameters for the RS-232C Unit. Command Block
05 00 94 00 01
Section 6-2
Instance ID
Response Block
Service code
Initializes all parameters set for the RS-232C Unit and returns the initial values. RS-232C DATA SEND Transmits data to the RS-232C Unit from the specified port. Command Block
10 00 94 00 64
151 bytes max. Send data
Instance ID Attribute ID
Response Block
Parameters Instance ID (Command) Specifies the port to which the data is being sent, in hexadecimal as follows: 02 Hex: Port 1 03 Hex: Port 2 Send Data (Command) Specifies the data to be sent from the specified port. Word data is sent from the leftmost bits to the rightmost bits as shown in the following diagram.
Bit First word First word +1 First word +2 (1) (3) (5) (2) (4) (6)
Note
1. When an odd number of bytes of data are sent, the last data will be set in the last word of the leftmost bits.
276
RS-232C Units
Section 6-2
2. The number of bytes of data to be sent is specified when the parameters for the CMND(194) instruction (CV-series PLCs) or the IOWR instruction (C200HX/HG/HE PLCs) are set (No. of bytes of command data). It is not necessary to set this parameter for explicit messages. 3. Before using this command, be sure that the communications status Transmission Ready Flag (Port 1: bit 00, Port 2: bit 08), allocated in the Masters IN Area is ON (transmission enabled). If the command is executed while the Flag is OFF (transmitting data), and error will occur (error code 02FF Hex).
Receives data from the specified RS-232C Unit port, and reads the data stored in the reception buffer. Depending on whether or not the header code and delimiter code are enabled or disabled, the data read is treated as shown in the following table. (When the delimiter header is disabled, the number of bytes set in No. of bytes per frame is read.)
Header code Disabled Delimiter code Disabled Data read
The "No. of bytes per frame" is read from the RS-232C Unit's reception buffer, starting with the first word. First Second Third
N bytes N bytes N bytes
Disabled
Enabled
Data from the RS-232C Unit's reception buffer is read, from the first word to the delimiter code. (There is no limit to the amount of data read.) First Second Third
Enabled
Disabled
Data from the RS-232C Unit's reception buffer is read, from the header code to the "No. of bytes per frame." In this case, the data before the header code is discarded First
N-1 bytes
Second
N-1 bytes
Third
N-1 bytes
Enabled
Enabled
Data from the RS-232C Unit's reception buffer is read, from the header code to the delimiter code. (There is no limit to the amount of data read.) In this case, the data before the header code is discarded. First Second Third
Note H: Header code, D: Delimiter code, N: No. of bytes per frame, Shaded area: trashed data. The above explanation is very brief, but if the number. of bytes received after the delimiter code is set, data after the delimiter code can also be read. Command Block
0E 00 94 00 64
Instance ID Attribute ID
277
RS-232C Units
Response Block
1,024 bytes max. No. of received bytes Service code Receive data
Section 6-2
Parameters Instance ID (Command) Specifies the port that reads the reception buffer data in hexadecimal as follows: 02 Hex: Port 1 03 Hex: Port 2 Receive Data (Response) Stores the data read from the specified ports reception buffer. The data is stored in words from the leftmost byte to the rightmost byte as shown in the following diagram.
Bit First word First word +1 First word +2 (1) (3) (5) (2) (4) (6)
Note
1. RS-232C ports 1 and 2 of the RS-232C Unit each have a reception buffer of 1,024 bytes, and up to a maximum of 1,024 bytes of data can be read from the Master at any given time. From an OMRON DeviceNet Master however, the maximum amount of data that can be read at one time is 152 bytes. Be sure to configure the data so that the 152-byte read data limit is not exceeded. 2. When data is read from an OMRON DeviceNet Master, the number of read bytes is stored as a CMND instruction (CV-series PLCs) or IOWR instruction (C200HX/HG/HE PLCs) parameter, so it will be requested. 3. When an odd number of bytes of data are sent, the last data will be set in the leftmost bits of the last word. 4. Before using this command, be sure that the communications status Received Flag (Port 1: bit 3, Port 2: bit 11) allocated in the Masters IN Area is ON (data in the reception buffer). If the command is executed while the Flag is OFF (no data in the reception buffer), and error will occur (error code 1800 Hex).
PORT RESET
Resets the RS-232C Units specified port. To change the parameter settings using the PARAMETER SET command, either reset the port using the PORT RESET command or restart the RS-232C Unit. Command Block
05 00 94 00
Instance ID
278
RS-232C Units
Response Block
Section 6-2
Parameters Instance ID (Command) Specifies the port to be reset, in hexadecimal as follows: 02 Hex: Port 1 03 Hex: Port 2 Note 1. When the port is reset, the transmission buffer and the reception buffers are cleared and the ports status is initialized. The parameter settings, however, are maintained. 2. When an error occurs at a port, find the cause of the error and then use this command to reset the port. Error Response If there is an error in the explicit command, the RS-232C Unit will return an error response as illustrated below. Response Block
Error code
Parameters No. of Received Bytes (Response) Always 0004 Hex. Source Node Address (Response) The node address of the node that sent the command is returned in hexadecimal. Error Code (Response) The error code is returned in double-byte (4-digit) hexadecimal, as shown in the following table.
Error code 02FF Hex 08FF Hex 09FF Hex 1800 Hex Error details The RS-232C port is transmitting data and therefore busy. The service code, Class ID, and Instance ID are not supported. Data formatting error. Appropriate command RS-232C DATA SEND All commands PARAMETER SET RS-232C DATA SEND
There is no receive data at the RS-232C RECEIVE DATA READ RS-232C port. There is a parameter setting error between RS-232C devices.
279
RS-232C Units
Error code 1801 Hex 19FF Hex Error details An error frame was received from a RS-232C device. Write not possible due to a hardware error etc.
Section 6-2
Appropriate command RS-232C RECEIVE DATA READ PARAMETER SET
6-2-8
Note If a CS-series PLC is being used, this example is applicable only when a CSseries Master Unit is mounted. Use the IOWR instruction when a C200HX/ HG/HE or C200HS Master Unit is mounted. In this case, refer to the DeviceNet Master Unit Operation Manual for details on using the IOWR instruction. For more detailed information on explicit messages, refer to the DeviceNet Master Unit Operation Manual. For information on the CMND instruction, refer to the PLCs Operation Manual or Programming Manual. Example Conditions Master node address: 27 Slave network address: 2 Slave node address: 14 Example: Using the CMND Instruction
D: Response Words (D: First Response Word) Results are stored as shown in the following table.
Word D D+1 Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion)
280
RS-232C Units
Word D+2 D+3
Section 6-2
Contents (Hex) Meaning 00 02 No. of received bytes (data length after D+3): 2 bytes 0E 90 Slave node address: 14 PARAMETER SET response service code: 90 Hex
The following example shows how to use the CMND instruction to read the RS-232C Units port 1 reception data from the Master Unit in a CS-series or CV-series PLC. An OMRON DeviceNet Master can read a maximum of 152 bytes of data at a time.
Note If a CS-series PLC is being used, this example is applicable only when a CSseries Master Unit is mounted. Use the IOWR instruction when a C200HX/ HG/HE or C200HS Master Unit is mounted. In this case, refer to the DeviceNet Master Unit Operation Manual for details on using the IOWR instruction. Before using the RS-232C RECEIVE DATA READ command, be sure that the communications status Received Flag (Port 1: bit 3, Port 2: bit 11), allocated in the Masters IN Area is ON. For more detailed information on explicit messages, refer to the DeviceNet Master Unit Operation Manual. For information on the CMND instruction, refer to the PLCs Operation Manual or Programming Manual. Example Conditions Master node address: 27 Slave network address: 2 Slave node address: 14 Example: Using the CMND Instruction
281
RS-232C Units
D: Response Words (D: First Response Word) Results are stored as shown in the following table.
Word D D+1 D+2 D+3
Section 6-2
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion) 00 xx 0E 8E No. of received bytes (data length after D+3) Slave node address: 14 RS-232C RECEIVE DATA READ response service code: 8E Hex The receive data read from RS-232C port 1 is stored in sequence from the leftmost bit to the rightmost bit.
D+4 to
HH LL to
The following example shows how to use the IOWR instruction to change all the parameters of port 1 of the RS-232C Unit at once from the Master Unit (C200HX/HG/HE PLC). For more detailed information on explicit messages, refer to the Master Units Operation Manual. For information on the IOWR instruction, refer to the SYSMAC C200HX/HG/HE PLCs Operation Manual. Example Conditions Master node address: 27 Masters Unit address: 5 Slave node address: 14 Example: Using IOWR
282
RS-232C Units
Word S+4 S+5
Section 6-2
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 0E 10 Slave node address: 14 PARAMETER SET response service code: 10 Hex Class ID: 0094 Hex Instance ID: For IR Area 1: 0001 Hex ALL PARAMETER SET Attribute ID: 64 Hex, (8 bits, even parity, 1 stop bit): 06 Hex. Header code, delimiter code, and flow control all enabled: 00 Hex, 1,200 bps: 00 Hex. Header code STX: 02 Hex, Delimiter code ETX: 03 Hex. No. of bytes after delimiter = 0 (00 Hex)
00 94 00 01 64 06 06 00 02 03 00 00
Response Storage Words Results are stored as shown in the following table.
Word DM2000 DM2001 DM2002 DM2003 Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion) 00 02 0E 90 No. of received bytes (data length after DM2003): 2 bytes Slave node address: 14 PARAMETER SET response service code: 90 Hex
The following example shows how to use the IOWR instruction to read the reception data of port 1 of the RS-232C Unit, from the Master Unit (C200HX/ HG/HE PLC). The maximum amount of data that can be read from an OMRON DeviceNet Master at one time is 152 bytes. Before using the RS-232C RECEIVE DATA READ command, be sure that the communications status Received Flag (Port 1: bit 03, Port 2: bit 11), allocated in the Masters IN Area is ON. For more detailed information on explicit messages, refer to the Master Units Operation Manual. For information on the IOWR instruction, refer to the SYSMAC C200HX/HG/HE PLCs Operation Manual. Example Conditions Master node address: 27 Masters Unit address: 5 Slave node address: 14 Example: Using IOWR
283
RS-232C Units
C: Control Words (C: First Control Word)
Word C Contents (Hex) Meaning 1B FE Masters node address: 27 Masters Unit address: FE Hex
Section 6-2
00 94 00 02 64 00
Response Storage Words Results are stored as shown in the following table.
Word DM2000 DM2001 DM2002 DM2003 Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion) 00 xx 0E 8E No. of received bytes (data length after D+3) Slave node address: 14 RS-232C RECEIVE DATA READ response service code: 8E Hex The receive data read from RS-232C port 1 is stored in sequence from the leftmost bit to the rightmost bit.
DM2004 on
HH LL...
284
RS-232C Units
Section 6-2
6-2-9
Dimensions
Unit: mm
285
RS-232C Units
Connecting End Plates
Section 6-2
Hook the bottom of the End Plate onto the DIN Track, as shown at (1) in the following diagram, then hook the top of the End Plate as shown at (2).
2
End Plate
Note Always attach End Plate to both ends of Slaves connected to DIN Track. Mounting Direction Unless specific restrictions are given for the Slave, it can be mounted in any direction. Any of the following directions are okay.
PORT1 DRT1-232C2
RS232C UNIT
MS NS
PORT2
Vertical
PORT2 PORT1
SD2 RD2
No.
DRT1-232C2
SD1
RS232C UNIT
ERR
MS
RD1
NS
6-2-11 Wiring
Internal Power Supply The recommended Power Supply Units are as follows: S82K-05024 (OMRON) or equivalent. S82J-@524 (OMRON) or equivalent.
Source 24 V DC + + Internal power supply
Note
1. Always use crimp terminals for wiring. 2. Do not connect wires directly to the terminals. 3. Tighten terminal screws to a torque of 0.3 to 0.5 N m. 4. Use the following M3 crimp terminals.
6.0 mm max. 6.0 mm max.
286
ERR
MS
RS232C UNIT
DRT1-232C2
RD1
NS
SD1
RD2
SD2
No.
No.
ERR
RD1
SD1
RD2
SD2
PORT1
MS NS
RS232C UNIT
DRT1-232C2
No.
SD2
RS-232C Units
RS-232C Connector
Pin Arrangement (Same for Ports 1 and 2)
Section 6-2
Pin No.
Symbol
Signal name
1 2 3 4 5 6 7 8 9
Not used Receive data Send data Not used Signal ground Not used Request send (See note.) Can send (See note.) Not used
Note The CS signal is always checked. Data will not be output if CS is not connected. Short-circuit the RS-CS signals when they are not used. A connection example using applicable connectors and recommended cables is provided below. Refer to the following explanation when creating cables. Applicable Connectors Plug: XM2D-0901 (OMRON, 9-pin female) or equivalent. Hood: XM2S-0913 (OMRON, 9-pin inch-pitch screws) or equivalent. Recommended Cables UL2464 AWG28 5P IFS-RVV-SB (UL product, Fujikura) AWG28 5P IFVV-SB (Non-UL products, Fujikura) UL2464-SB 5P AWG28 (UL product, Hitachi) CO-MA-VV-SB 5P AWG28 (Non-UL product, Hitachi) Connection Example The following diagram gives an connection example. Connection methods however, may differ depending on the connected devices, so refer to the connected devices instruction manual for further information.
Connecting an OMRON V500-R32@ Bar Code Reader RS-232C Unit end Bar Code Reader end Abbreviation Pin No. Pin No. Abbreviation -----
RS-232C interface
----------Hood metal
RS-232C interface
(9-pin)
287
RS-232C Units
Section 6-2
When IR 00000 (port 1 settings) or IR 00001 (port 2 settings) turns ON in the CPU Unit of the Master Unit, the RS-232C Units port parameters will be set. For details on Bar Code Reader settings, refer to the Bar Code Readers Operation Manual. Set the port parameters as follows: Port 1 Parameters Data length: Parity: Stop bits: Header code: Delimiter code: Flow control: Baud rate: Delimiter code CR code: Port 2 Parameters Data length: Parity: Stop bits: Header code: Delimiter code: Flow control: Baud rate: Header code STX code: 7 bits Even 2 Enabled Enabled Disabled 2,400 bps 02 Hex 8 bits None 1 Disabled Enabled Enabled 9,600 bps 0D Hex
288
RS-232C Units
Delimiter code ETX code: 03 Hex
Section 6-2
Number of bytes received after delimiter:0 If any of the port parameters are changed, the changed settings will become valid only when the port is reset or the RS-232C Unit is started up again. In the following programming example, the ports are reset after the parameters are set. Ladder Program
25315 BSET(71) #0000 DM0000 DM0999 25315 MOV(21) #8200 DM0000 MOV(21) #6400 DM0001
Clears the DM Area words being used when the program starts.
Response storage word: DM 0100 (82 Hex: DM; 0064 Hex: word 100; 00 Hex: Word data) Response monitoring time: 10 s
289
RS-232C Units
Section 6-2
25315 MOV(21) #8201 DM0400 MOV(21) #C200 DM0401 MOV(21) #0064 DM0402 MOV(21) #0008 DM0403 MOV(21) #2801 DM0404 MOV(21) #0805 DM0405
Response storage words: DM 0450 (82 Hex: DM; 01C2 Hex: word 450; 00 Hex: Word data)
Slave node address: 08 RS-232C PORT RESET command service code: 05 Hex
Port 1 parameter setting data ALL PARAMETER SET Attribute ID: 64 Hex 8-bit data length, no parity, 1 stop bit: 08 Hex Disabled header code, enabled delimiter code, enabled flow control: 01 Hex 9,600-bps baud rate: 03 Hex Delimiter code: CR code (0D Hex)
Port 2 parameter setting data ALL PARAMETER SET Attribute ID: 6B Hex 7-bit data length, even parity, 2 stop bits: 03 Hex Enabled header code, enabled delimiter code, disabled flow control: 04 Hex 2,400-bps baud rate: 01 Hex Header code: STX code (02 Hex) Delimiter code: ETX code (03 Hex)
290
RS-232C Units
00000 00001 XFER(70) #0004 DM0020 DM0008 MOV(21) #0002 DM0407 DIFU(13) 00002 00000 00001 XFER(70) #0004 DM0024 DM0008
Section 6-2
When IR 00000 turns ON, data held at port 1 will be written to the command data area.
IR 00002 turned ON for one cycle (as a differentiated bit). Writing data from port 2 to command data area
When IR 00001 turns ON, data held at port 2 will be written to the command data area.
MOV(21) #0003 DM0407 DIFU(13) 00003 00002 MOV(21) 00003 #0001 030 03001 IOWR #00FE DM0400 #0008 25506 MOV(21) #0002 030 25506 MOV(21) #0000 030 03000 10112 MOV(21) #0000 030 IOWR #00FE DM0000 #0012 25506 MOV(21) #0001 030 25506 MOV(21) #0002 030 END(01)
IR 00003 turned ON for one cycle (as a differentiated bit). When IR 00002 or IR 00003 turns ON, the sequential processing control bit IR 03000 will turn ON.
When IR 03001 turns ON, the port reset message will be transmitted. 00FE: Master's node address 00, Master's unit address FE Hex DM 0400: Command data storage words 0008 Hex: Master's unit number 00, 8 command data words (BCD) If the Equals Flag is OFF (error in writing to the Master), IR 03001 will be turned ON, and the data will be transmitted again. If the Equals Flag is ON (writing to the Master has been completed normally), IR 03001 will be cleared (message transmission completed). When IR 03000 turns ON, the CPU Unit will check that IR 10112 (unit no. 0 Master's Message Communications Enabled Flag) is ON, and the ALL PARAMETER SET message is transmitted. 00FE: Master's node address 00, Master's unit address FE Hex DM 0000: Command data storage words 0012 Hex: Master's unit number 00, 12 command data words (BCD) If the Equals Flag is OFF (error in writing to the Master), IR 03001 will be turned ON, and the data will be transmitted again. If the Equals Flag is ON (writing to the Master has been completed normally), IR 03001 will be turned ON (the port will be reset).
291
RS-232C Units
Note
Section 6-2
1. When transmitting explicit messages from an OMRON Master Unit, specify 2 bytes each for the Class ID and the Instance ID. Set 1 byte as the Attribute ID for the parameter setting command. 2. The parameters that are set are held internally. 3. To enable the parameters that have been set, the RS-232C PORT RESET command has been used in the program examples. The parameters can also be enabled, however, by turning OFF the power to the RS-232C Unit and then turning it ON again. Responses The following responses will be stored if the parameters are set properly. PARAMETER SET Response
Words DM 0100 DM 0101 DM 0102 DM 0103 Contents (Hex) 28 01 00 00 00 02 08 90 Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex. Response code is 0000 Hex (normal completion). Number of bytes received (data length from word DM 0103 onwards) is 2 bytes. Slave node address is 08. PARAMETER SET response service code is 90 Hex.
292
RS-232C Units
Ladder Program
25315 BSET(71) #0000 M0000 DM0999 25315 MOV(21) #8200 DM0050 MOV(21) #9600 DM0051 MOV(21) #0064 DM0052 MOV(21) #0009 DM0053 MOV(21) #2801 DM0054 MOV(21) #080E DM0055 MOV(21) #0094 DM0056 MOV(21) #0001 DM0057 00004 00005 MOV(21) #6400 DM0058 DIFU(13) 00006 00004 00005 MOV((21) #6B00 DM0058 DIFU(13) 00007 00006 MOV(21) #0001 031 00007
Section 6-2
Clears all DM Area words being used when the program starts.
Response storage words: DM 0150 (82 Hex: DM; 0096 Hex: word 150; 00 Hex: Word data)
When IR 00004 turns ON, the ALL PARAMETER READ command for port 1 and Attribute ID (64 Hex) are written as command data. IR 00006 is turned ON for one cycle (as a differentiated bit). When IR 00005 turns ON, the ALL PARAMETER READ command for port 2 and Attribute ID (6B Hex) are written as command data.
IR 00007 is turned ON for one cycle (as a differentiated bit). When IR 00006 or IR 00007 turns ON, the sequential processing control bit IR 03100 turns ON.
293
RS-232C Units
03100 10112 IOWR #00FE DM0050 #0009 25506 MOV(21) #0000 031 25506 MOV(21) #0001 031
Section 6-2
When IR 03100 turns ON, the CPU Unit will check that IR 10112 (unit no. 0 Master's Message Communications Enabled Flag) is ON, and message transmission will start.
00FE: Master's node address 00, Master's unit address FE Hex DM 0050: Command data storage words 0009 Hex: Master's unit number 00, 9 command data words (BCD) If the Equals Flag is ON (writing to the Master has been completed normally), IR 03101 will be cleared (message transmission completed). If the Equals Flag is OFF (error in writing to the Master), IR 03101 will be turned ON, and the data will be transmitted again.
END(01)
Note When transmitting explicit messages from an OMRON Master Unit, specify 2 bytes each for the Class ID and the Instance ID. Set 1 byte as the Attribute ID for the PARAMETER READ command. Response The following response will be stored if the parameters are read properly.
Words DM 0150 DM 0151 DM 0152 DM 0153 Contents (Hex) 28 01 00 00 00 08 08 8E Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex. Response code is 0000 Hex (normal completion). Number of bytes received (data length from word DM 0153 onwards) is 8 bytes. Slave node address is 08. PARAMETER READ response service code is 8E Hex. Leftmost byte: Setting for the data bit length Rightmost byte: Setting for the header code enable/disable Leftmost byte: Setting for the baud rate Rightmost byte: Setting for the header code Leftmost byte: Setting for the delimiter code Rightmost byte: Setting for the number of bytes/frames received after the delimiter
DM 0154
xx xx
DM 0155
xx xx
DM 0156
xx xx
294
RS-232C Units
Ladder Program
25315 BSET(71) #0000 DM0000 DM0999 25315 MOV(21) #8201 DM0200 MOV(21) #2C00 DM0201 MOV(21) #0064 DM0202 MOV(21) #0009 DM0203 MOV(21) #2801 DM0204 MOV(21) #080E DM0205 MOV(21) #0094 DM0206 MOV(21) #0002 DM0207 MOV(21) #6400 DM0208
Section 6-2
Clears all DM Area words being used when the program starts.
Setting data for executing the RECEIVE DATA READ command for port 1 Response storage word: DM 0300 (82 Hex: DM; 012C Hex: word 300; 00 Hex: Word data)
Slave node address: 08 RECEIVE DATA READ command service code: 0E Hex
295
RS-232C Units
25315 MOV(21) #8201 DM0250 MOV(21) #5E00 DM0251 MOV(21) #0064 DM0252 MOV(21) #0009 DM0253 MOV(21) #2801 DM0254 MOV(21) #080E DM0255 MOV(21) #0094 DM0256 MOV(21) #0003 DM0257 MOV(21) #6400 DM0258 35802 35803 MOV(21) #0001 032 03200 10112 MOV(21) #0000 032 IOWR #00FE DM0200 #0009 25506 MOV(21) #0001 032 25506 MOV(21) #0000 032 35810 35811 MOV(21) #0001 033
Section 6-2
Setting data for executing the RECEIVE DATA READ command for port 2 Response storage words: DM 0350 (82 Hex: DM; 015E Hex: word 350; 00 Hex: Word data)
Slave node address: 08 RECEIVE DATA READ command service code: 0E Hex
Reading Data Received at Port 1 If SR 35802 (Port 1 RS-232C Receiving Flag) is OFF and SR 35803 (Port 1 RS-232C Received Flag) is ON, the sequential processing control bit IR 03200 will be turned ON. When IR 03200 turns ON, the CPU Unit will check that IR 10112 (unit no. 0 Master's Message Communications Enabled Flag) is ON, and message transmission will start.
00FE: Master's node address 00, Master's unit address FE Hex DM 0200: Command data storage words 0009 Hex: Master's unit number 00, 9 command data words (BCD) If the Equals Flag is OFF (error in writing to the Master), IR 03200 will be turned ON, and the data will be transmitted again. If the Equals Flag is ON (writing to the Master has been completed normally), IR 03200 will be cleared (message transmission completed).
296
RS-232C Units
03300 10112 MOV(21) #0000 033 IOWR #00FE DM0250 #0009 25506 MOV(21) #0001 033 25506 MOV(21) #0000 033 END(01)
Section 6-2
Reading Data Received at Port 2 If SR 35810 (Port 2 RS-232C Receiving Flag) is OFF and SR 35811 (Port 2 RS-232C Received Flag) is ON, the sequential processing control bit IR 03300 will be turned ON. When IR 03300 turns ON, the Unit will check that IR 10112 (unit no. 0 Master's Message Communications Enabled Flag) is ON, and message transmission starts. 00FE: Master's node address 00, Master's unit address FE Hex DM 0250: Command data storage words 0009 Hex: Master's unit number 00, 9 command data words (BCD) If the Equals Flag is OFF (error in writing to the Master), IR 03300 will be turned ON, and the data will be transmitted again. If the Equals Flag is ON (writing to the Master has been completed normally), IR 03300 will be cleared (message transmission completed).
Note When transmitting explicit messages from an OMRON Master Unit, specify 2 bytes each for the Class ID and the Instance ID. Set 1 byte as the Attribute ID for the RECEIVE DATA READ command. Responses The following responses will be stored if the data is read properly. Port 1 Response
Words DM 0300 DM 0301 DM 0302 DM 0303 Contents (Hex) 28 01 00 00 xx xx 08 8E Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex. Response code is 0000 Hex (normal completion). Number of bytes received (data length from word DM 0203 onwards). Slave node address is 08. RECEIVE DATA READ response service code is 8E Hex. Data received from port 1 of the RS232C Unit and read is stored in order from the leftmost byte to the rightmost byte.
DM 0304 on
xx xx...
Port 2 Response
Words DM 0350 DM 0351 DM 0352 DM 0353 Contents (Hex) 28 01 00 00 xx xx 08 8E Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex. Response code is 0000 Hex (normal completion). Number of bytes received (data length from word DM 0353 onwards). Slave node address is 08. RECEIVE DATA READ response service code is 8E Hex. Data received from port 2 of the RS-232C Unit and read is stored in order from the leftmost byte to the rightmost byte.
DM 0354 on
xx xx...
297