The text of a manual · part 30 of 39
C200HW-DRT21, CQM1-DRT21, DRT1 Series DeviceNet Slaves Operation Manual: W347-E1-06.pdf, pages 291 to 300
Pages 291 to 300 of 381, from C200HW-DRT21, CQM1-DRT21, DRT1 Series DeviceNet Slaves Operation Manual
The original document is the PDF (7.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Omron DRT1-ID16
Page 291
Section 6-2
RS-232C Units INITIALIZE PARAMETERS
Initializes the parameters for the RS-232C Unit. Command Block 05
00
94
Class ID Service Code Destination node address
00
01
Instance ID
Response Block
No. of received bytes
Service code
Source node address
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
Class ID Service Code Destination node address
00
××
64
151 bytes max.
Instance ID Attribute ID
Send data
Response Block
No. of received Service code bytes Source node address
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
Note
276
(1) (3) (5)
(2) (4) (6)
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.
Page 292
Section 6-2
RS-232C Units
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 Master’s 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). RS-232C RECEIVE DATA READ
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
Disabled
Enabled
Enabled
Disabled
Enabled
N bytes
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
Enabled
N bytes
Second
Third
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
Second
Third
N-1 bytes
N-1 bytes
N-1 bytes
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
Class ID Service Code Destination node address
00
××
64
Instance ID Attribute ID
277
Page 293
Section 6-2
RS-232C Units Response Block 1,024 bytes max. No. of received bytes
Service code
Receive data
Source node address
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 port’s reception buffer. The data is stored in words from the leftmost byte to the rightmost byte as shown in the following diagram. Bit (1) (3) (5)
First word First word +1 First word +2
Note
(2) (4) (6)
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 Master’s 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 Unit’s 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
Class ID Service Code Destination node address
278
00
××
Instance ID
Page 294
Section 6-2
RS-232C Units Response Block
No. of received Service code bytes Source node address
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 port’s 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
No. of received bytes
Error code
Service code (94 Hex: fixed)
Source node address
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
Error details The RS-232C port is transmitting data and therefore busy.
Appropriate command RS-232C DATA SEND
08FF Hex
The service code, Class ID, and Instance ID are not supported.
All commands
09FF Hex
Data formatting error.
PARAMETER SET RS-232C DATA SEND
1800 Hex
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
Page 295
Section 6-2
RS-232C Units
6-2-8
Error code 1801 Hex
Error details An error frame was received from a RS-232C device.
Appropriate command RS-232C RECEIVE DATA READ
19FF Hex
Write not possible due to a hardware error etc.
PARAMETER SET
Using Explicit DeviceNet Messages
Using CMND to Change Settings (CS-series and CV-series)
The following example shows how to use the CMND instruction to change all the parameters of port 1 of the RS-232C Unit at once from the Master Unit in a CS-series or CV-series PLC.
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 PLC’s Operation Manual or Programming Manual. Example Conditions Master node address: 27 Slave network address: 2 Slave node address: 14 Example: Using the CMND Instruction
Command Words (S: First Command Word) Word
S+2
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 0E 10 Slave node address: 14 PARAMETER SET command service code: 10 Hex 00 94 Class ID: 0094 Hex
S+3 S+4
00 01 64 06
S+5
00 00
S+6
02 03
S+7
00 00
S S+1
Instance ID: 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)
D: Response Words (D: First Response Word) Results are stored as shown in the following table. Word D D+1
280
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion)
Page 296
Section 6-2
RS-232C Units
D+2
Word
Contents (Hex) Meaning 00 02 No. of received bytes (data length after D+3): 2 bytes
D+3
0E 90
Slave node address: 14 PARAMETER SET response service code: 90 Hex
Control Words (C: First Control Word) Word C C+1
Using CMND to Read Data (CS-series and CV-series)
Contents (Hex) Meaning 00 0F No. of bytes of command data: S (15 bytes of command data) 00 08 No. of bytes of response data: D (8 bytes of response data)
C+2 C+3
00 02 1B FE
C+4
00 00
C+5
00 64
Destination node network address: 2 Master’s node address: 27 Master’s Unit address: FE Hex Response returned, communications port No.: 0, No. of retries: 0 Response monitoring time: 10 s
The following example shows how to use the CMND instruction to read the RS-232C Unit’s 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 Master’s 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 PLC’s Operation Manual or Programming Manual. Example Conditions Master node address: 27 Slave network address: 2 Slave node address: 14 Example: Using the CMND Instruction
Command Words (S: First Command Word) Word
S+2
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 0E 0E Slave node address: 14 RS-232C RECEIVE DATA READ command service code: 0E Hex 00 94 Class ID: 0094 Hex
S+3 S+4
00 02 64 00
S S+1
Instance ID: Port 1 = 0002 Hex Attribute ID: 64 Hex
281
Page 297
Section 6-2
RS-232C Units D: Response Words (D: First Response Word) Results are stored as shown in the following table. Word
D+1
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion)
D+2 D+3
00 xx 0E 8E
D+4
HH LL to to
D
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.
Control Words (C: First Control Word) Word
C+1
Contents (Hex) Meaning 00 09 No. of bytes of command data: S (9 bytes of command data) 00 xx No. of bytes of response data: D
C+2 C+3
00 02 1B FE
Destination node network address: 2 Master’s node address: 27 Master’s Unit address: FE Hex
C+4
00 00
Response returned, communications port No.: 0, No. of retries: 0
C+5
00 64
Response monitoring time: 10 s
C
Using IOWR to Write Data (C200HX/HG/HE PLCs)
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 Unit’s Operation Manual. For information on the IOWR instruction, refer to the SYSMAC C200HX/HG/HE PLCs Operation Manual. Example Conditions Master node address: 27 Master’s Unit address: 5 Slave node address: 14 Example: Using IOWR
C: Control Words (C: First Control Word) Word C
Contents (Hex) Meaning 1B FE Master’s node address: 27 Master’s Unit address: FE Hex
Source Words (S: First Source Word) Word S S+1
282
Contents (Hex) Meaning 82 07 Response storage words: DM2000 82 Hex: DM Area, 07D0 Hex: 2000 words (For more detail, refer to the PLC Operation D0 00 Manual.)
S+2
00 64
Response monitoring time: 10 s
S+3
00 0F
No. of bytes of command data: 15 bytes (No. of bytes from S+4 onwards.)
Page 298
Section 6-2
RS-232C Units
S+4
Word
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex
S+5
0E 10
Slave node address: 14 PARAMETER SET response service code: 10 Hex Class ID: 0094 Hex
S+6
00 94
S+7 S+8
00 01 64 06
Instance ID: For IR Area 1: 0001 Hex ALL PARAMETER SET Attribute ID: 64 Hex, (8 bits, even parity, 1 stop bit): 06 Hex.
S+9
06 00
Header code, delimiter code, and flow control all enabled: 00 Hex, 1,200 bps: 00 Hex.
S+10
02 03
Header code STX: 02 Hex, Delimiter code ETX: 03 Hex.
S+11
00 00
No. of bytes after delimiter = 0 (00 Hex)
D: Transmission Information (Destination Unit and Number of Words). Word D
Contents (Hex) Meaning 05 12 Master’s Unit address: 5, No. of words of command data: 12 words (specified in BCD) (No. of words from S onwards)
Response Storage Words Results are stored as shown in the following table. Word DM2000
Using IOWR to Read Data (C200HX/HG/HE PLCs)
DM2001
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion)
DM2002
00 02
No. of received bytes (data length after DM2003): 2 bytes
DM2003
0E 90
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 Master’s IN Area is ON. For more detailed information on explicit messages, refer to the Master Unit’s Operation Manual. For information on the IOWR instruction, refer to the SYSMAC C200HX/HG/HE PLCs Operation Manual. Example Conditions Master node address: 27 Master’s Unit address: 5 Slave node address: 14 Example: Using IOWR
283
Page 299
Section 6-2
RS-232C Units C: Control Words (C: First Control Word) Word C
Contents (Hex) Meaning 1B FE Master’s node address: 27 Master’s Unit address: FE Hex
Source Words (S: First Source Word) Word S S+1
Contents (Hex) Meaning 82 07 Response storage words: DM2000 82 Hex: DM Area, 07D0 Hex: 2000 words (For more detail, refer to the PLC Operation D0 00 Manual.)
S+2
00 64
Response monitoring time: 10 s
S+3
00 09
No. of bytes of command data: 9 bytes (No. of bytes from S+4 onwards.)
S+4
28 01
EXPLICIT MESSAGE SEND command code: 28 01 Hex
S+5
0E 0E
Slave node address: 14 RS-232C RECEIVE DATA READ response service code: 0E Hex
S+6 S+7
00 94 00 02
Class ID: 0094 Hex Instance ID: For port 1: 0002 Hex
S+8
64 00
Attribute ID: 64 Hex
D: Transmission Information (Destination Unit and Number of Words). Word D
Contents (Hex) Meaning 05 09 Master’s Unit address: 5, No. of words of command data: 9 words (specified in BCD) (No. of words from S onwards)
Response Storage Words Results are stored as shown in the following table. Word DM2000
284
DM2001
Contents (Hex) Meaning 28 01 EXPLICIT MESSAGE SEND command code: 28 01 Hex 00 00 Response code (0000 Hex: Normal completion)
DM2002 DM2003
00 xx 0E 8E
DM2004 on
HH LL...
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.
Page 300
Section 6-2
RS-232C Units
6-2-9
Dimensions
Mounting holes Two, 4.2 dia. or M4
Unit: mm
6-2-10 Mounting in Control Panels Either of the following methods can be used to mount an RS-232C Unit in a control panel. Using Screws
Drill mounting holes in the control panel according to the dimensions provided for mounting holes in the dimensions diagrams and then secure the RS-232C Unit with M4 screws. The appropriate tightening torque is 0.6 to 0.98 N⋅m.
Using DIN Track
Mount the back of the RS-232C Unit to a 35-mm DIN Track. To mount the Unit, pull down on the mounting hook on the back of the Unit with a screwdriver, insert the DIN Track on the back of the Unit, and then secure the Unit to the DIN Track. When finished, secure all Slaves on both ends of the DIN Track with End Plates.
285