Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 983

Table of Contents

Advertisement

Example Programming
In this example, EGATR(721) is used to read the general status of a DRT2 Slave (I/O Terminal).
Communications Port
Enabled Flag (Port 6)
A202.06
0.00
Explicit message command format
0E
95
Service Code
Destination node address
CS1W-DRM21 DeviceNet Unit
(CPU Bus Unit with unit number 2)
CPU
Unit
Unit address 12 hex (because
the unit number is 2)
Explicit
message
S:
D0
0
S+1: D1
0
S+2: D2
0
S+3: D3
0
C:
D200
0
C+1: D201
8
C+2: D202
0
C+3: D203
0
D:
D100
0
D+1: D101
0
7
D101
0
CS/CJ/NSJ Series Instructions Reference Manual (W474)
When CIO 0.00 and A202.06 (the Communications Port
Enabled Flag for port 06) are ON, EGATR(721) reads the
general status of the DRT2 Slave (I/O Terminal). In this case,
@EGATR
the Total ON Time or Number of Contact Operations for input
D0
S
3 are read.
D100
D
D200
C
Service Code = 0E hex, Class ID = 95 hex, Instance ID = 01
hex, and Attribute ID = 65 hex.
The general status is returned in 1 byte.
01
65
Attribute ID
Instance ID
Class ID
EGATR(721)
instruction
Slave (I/O Terminal)
with node address 10
0
0
A
Slave's node address = 10 = 0A hex
0
9
5
Class ID = 95 hex
Instance ID = 01 hex
0
0
1
Attribute ID = 65 hex
0
6
5
0
0
2
Set 2 words = 0002 hex since there are 2 words in D to D+1.
Byte order = 8 hex (from rightmost byte), communications port = 6 hex (port 6),
6
1
2
and the DeviceNet Unit's unit address = 12 hex
Response monitoring time = 0000 hex (2 s)
0
0
0
Explicit format type = 0000 hex (DeviceNet format)
0
0
0
D contains 0 hex for the 1 byte of data returned to the rightmost byte of D+1.
0
0
1
The Slave's general status is returned to bits 00 to 07.
0
4
8
(The data is stored in bits 00 to 07 because the byte order setting in C+1 bits
12 to 15 was set to 8 hex (from rightmost byte).
6
5
4
3
2
1
0
1
0
0
1
0
0
0
Basic Unit's I/O Power Status Flag
Expansion Unit's I/O Power Status Flag
Low Network Power Voltage Flag
Unit Maintenance Flag
Sensor Disconnected Flag
Sensor Power Shorted Flag
Operation Time Over Flag
Connected Device Maintenance Flag
3. Instructions
General
status
947
3

Advertisement

Table of Contents
loading

Table of Contents