The text of a manual · part 31 of 39
C200HW-DRT21, CQM1-DRT21, DRT1 Series DeviceNet Slaves Operation Manual: W347-E1-06.pdf, pages 301 to 310
Pages 301 to 310 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 301
Section 6-2
RS-232C Units Connecting End Plates
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
1
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
Vertical
PORT2
DRT1-232C2 RS232C UNIT
SD2
No.
No.
RD2
SD2
PORT2
SD1
NS
RD1 ERR
PORT1
MS
SD1
SD2
RD2
PORT1
PORT1
SD2 NS
RS232C UNIT
RD2
RD1
RS232C UNIT
MS
DRT1-232C2
ERR
DRT1-232C2
SD1
PORT2
No.
RD1
No.
NS
RD2
RS232C UNIT
SD1
DRT1-232C2
RD1
ERR
NS
ERR
MS
MS
PORT2
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.
286
6.0 mm max.
Page 302
Section 6-2
RS-232C Units RS-232C Connector Pin Arrangement (Same for Ports 1 and 2)
Pin No.
Symbol
Signal name
Signal direction RS-232C Unit ↔ External devices
1 2
--RD
Not used Receive data
--←
3 4
SD ---
Send data Not used
→ ---
5 6
SG ---
Signal ground Not used
-----
7 8
RS CS
Request send (See note.) Can send (See note.)
→ ←
9
---
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 device’s 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
RS-232C interface
----------Hood metal
(9-pin)
(9-pin, male) Shield
287
Page 303
Section 6-2
RS-232C Units
6-2-12 RS-232C Unit Application Examples This section explains the procedure for using explicit messages with an RS232C Unit. The following system configuration example is used in this example. When explicit messages are used with an RS-232C Unit, the communications conditions for ports 1 and 2 on the RS-232C Unit can be set individually, and data can be read or written to the RS-232C Unit. C200HW-DRM21-V1 Master Unit (node address 00, unit number 0)
24-V DC power supply
C200HX PLC T-branch Tap Terminating Resistor T-branch Tap
Terminating Resistor T-branch Tap Port 1 Port 2 DRT1-232C2 RS-232C Unit (node address 08)
Bar Code Bar Code Reader 1 Reader 2
Setting Port Parameters
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 Unit’s port parameters will be set. For details on Bar Code Reader settings, refer to the Bar Code Reader’s Operation Manual. Set the port parameters as follows: • Port 1 Parameters Data length:
8 bits
Parity:
None
Stop bits:
1
Header code:
Disabled
Delimiter code:
Enabled
Flow control:
Enabled
Baud rate:
9,600 bps
Delimiter code CR code:
0D Hex
Number of bytes received after delimiter:0 • Port 2 Parameters
288
Data length:
7 bits
Parity:
Even
Stop bits:
2
Header code:
Enabled
Delimiter code:
Enabled
Flow control:
Disabled
Baud rate:
2,400 bps
Header code STX code:
02 Hex
Page 304
Section 6-2
RS-232C Units Delimiter code ETX code:
03 Hex
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
Clears the DM Area words being used when the program starts.
BSET(71) #0000 DM0000 DM0999
Port 1 and 2 parameter setting common data
25315 MOV(21) #8200 DM0000 MOV(21)
Response storage word: DM 0100 (82 Hex: DM; 0064 Hex: word 100; 00 Hex: Word data)
#6400 DM0001
Response monitoring time: 10 s MOV(21) #0064 DM0002
Number of command data bytes: 15 bytes MOV(21) #000F DM0003
EXPLICIT MESSAGE SEND command code (FINS): 2801 Hex
MOV(21) #2801 DM0004
Slave node address: 08 PARAMETER SET command service code: 10 Hex
MOV(21) #0810 DM0005
Class ID: 94 Hex MOV(21) #0094 DM0006
Instance ID: 01 Hex MOV(21) #0001 DM0007
289
Page 305
Section 6-2
RS-232C Units
25315
Port 1 and 2 resetting common data
MOV(21) #8201 DM0400 MOV(21)
Response storage words: DM 0450 (82 Hex: DM; 01C2 Hex: word 450; 00 Hex: Word data)
#C200 DM0401
Response monitoring time: 10 s
MOV(21) #0064 DM0402
Number of command data bytes: 8 bytes
MOV(21) #0008 DM0403 MOV(21)
EXPLICIT MESSAGE SEND command code (FINS): 2801 Hex
#2801 DM0404 MOV(21)
Slave node address: 08 RS-232C PORT RESET command service code: 05 Hex
#0805 DM0405
Class ID: 94 Hex MOV(21) #0094 DM0406 25315 MOV(21) #6408
Port 1 parameter setting data ALL PARAMETER SET Attribute ID: 64 Hex 8-bit data length, no parity, 1 stop bit: 08 Hex
DM0020 MOV(21) #0103
Disabled header code, enabled delimiter code, enabled flow control: 01 Hex 9,600-bps baud rate: 03 Hex
DM0021 MOV(21)
Delimiter code: CR code (0D Hex) #000D DM0022
MOV(21)
Number of transmission bytes after delimiter: 0 #0000 DM0023
Port 2 parameter setting data
MOV(21) #6B03 DM0024 MOV((21) #0401 DM0025 MOV(21) #0203
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)
DM0026
Number of transmission bytes after delimiter: 0
MOV(21) #0000 DM0027
290
Page 306
Section 6-2
RS-232C Units 00000
00001
Writing data from port 1 to command data area
XFER(70) #0004 DM0020 DM0008
When IR 00000 turns ON, data held at port 1 will be written to the command data area.
MOV(21) #0002 DM0407 DIFU(13) 00002 00000
IR 00002 turned ON for one cycle (as a differentiated bit). Writing data from port 2 to command data area
00001 XFER(70) #0004 DM0024 DM0008
When IR 00001 turns ON, data held at port 2 will be written to the command data area.
MOV(21) #0003 DM0407
IR 00003 turned ON for one cycle (as a differentiated bit).
DIFU(13) 00003 00002 MOV(21) #0001
00003
When IR 00002 or IR 00003 turns ON, the sequential processing control bit IR 03000 will turn ON.
030 03001 IOWR #00FE DM0400 #0008 25506 MOV(21) #0002
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.
030 25506 MOV(21) #0000 030 03000
10112 MOV(21) #0000 030 IOWR
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
#00FE DM0000 #0012 25506 MOV(21) #0001 030 25506
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).
MOV(21) #0002 030 END(01)
291
Page 307
Section 6-2
RS-232C Units Note
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
Contents (Hex) 28 01
DM 0101
00 00
DM 0102
00 02
DM 0103
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.
PORT RESET Response Words
Contents (Hex)
DM 0450
28 01
DM 0451
00 00
DM 0452
00 02
DM 0453
08 85
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 0453 onwards) is 2 bytes. Slave node address is 08. PORT RESET response service code is 85 Hex.
6-2-13 Reading RS-232C Unit Parameters With the following example, the port parameters that are set for the RS-232C Unit are all read for the port when IR 00004 (port 1) or IR 00005 (port 2) turns ON in the CPU Unit of the Master Unit. When the RS-232C Unit’s PARAMETER READ command is used, the parameters that are valid at that time will be read. After setting the parameters, the RS-232C Unit must be turned OFF and then ON again, or the ports must be reset for the new parameters to be enabled.
292
Page 308
Section 6-2
RS-232C Units Ladder Program 25315 BSET(71) #0000
Clears all DM Area words being used when the program starts.
M0000 DM0999 25315 MOV(21) #8200 DM0050 MOV(21)
Response storage words: DM 0150 (82 Hex: DM; 0096 Hex: word 150; 00 Hex: Word data)
#9600 DM0051 MOV(21)
Response monitoring time: 10 s #0064 DM0052
MOV(21)
Number of command data bytes: 9 bytes #0009 DM0053
MOV(21) #2801
EXPLICIT MESSAGE SEND command code (FINS): 2801 Hex
DM0054 MOV(21) #080E
Slave node address: 08 PARAMETER READ command service code: 0E Hex
DM0055
Class ID: 94 Hex
MOV(21) #0094 DM0056 MOV(21)
Instance ID: 01 Hex #0001 DM0057
00004
00005 MOV(21) #6400
When IR 00004 turns ON, the ALL PARAMETER READ command for port 1 and Attribute ID (64 Hex) are written as command data.
DM0058
00006
IR 00006 is turned ON for one cycle (as a differentiated bit).
#6B00
When IR 00005 turns ON, the ALL PARAMETER READ command for port 2 and Attribute ID (6B Hex) are written as command data.
DIFU(13)
00004
00005 MOV((21)
DM0058 DIFU(13) 00007
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.
00006 MOV(21) #0001 031 00007
293
Page 309
Section 6-2
RS-232C Units 03100
10112 IOWR #00FE DM0050
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.
#0009 25506
00FE: Master's node address 00, Master's unit address FE Hex
MOV(21) #0000 031 25506 MOV(21) #0001 031
END(01)
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.
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
Contents (Hex) 28 01
Meaning EXPLICIT MESSAGE SEND command code is 28 01 Hex.
DM 0151
00 00
Response code is 0000 Hex (normal completion).
DM 0152
00 08
Number of bytes received (data length from word DM 0153 onwards) is 8 bytes.
DM 0153
08 8E
Slave node address is 08. PARAMETER READ response service code is 8E Hex.
DM 0154 xx xx
DM 0155 xx xx
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
DM 0156 xx xx
Leftmost byte: Setting for the delimiter code Rightmost byte: Setting for the number of bytes/frames received after the delimiter
6-2-14 Reading Data Received by RS-232C Unit Ports In the following example, the data received by the Bar Code Reader is stored in the receive buffer of the RS-232C Unit and read to the Master Unit. If there is data already in the receive buffer of the RS-232C Unit, it will be read to the Master Unit. Response data from port 1 is stored in DM 0300 onwards, and response data from port 2 is stored in DM 0350 onwards. In the following program example, however, the data received is no more than 50 words (100 bytes).
294
Page 310
Section 6-2
RS-232C Units Ladder Program 25315 BSET(71) #0000
Clears all DM Area words being used when the program starts.
DM0000 DM0999 25315 MOV(21) #8201 DM0200
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)
MOV(21) #2C00 DM0201
Response monitoring time: 10 s
MOV(21) #0064 DM0202
Number of command data bytes: 9 bytes
MOV(21) #0009 DM0203 MOV(21) #2801
EXPLICIT MESSAGE SEND command code (FINS): 2801 Hex
DM0204 MOV(21) #080E
Slave node address: 08 RECEIVE DATA READ command service code: 0E Hex
DM0205
Class ID: 94 Hex
MOV(21) #0094 DM0206
Port 1 RECEIVE DATA READ Instance ID: 02 Hex
MOV(21) #0002 DM0207
Attribute ID: 64 Hex
MOV(21) #6400 DM0208
295