LOGIX5000 Data Access
LOGIX5000 Data Access
LOGIX5000 Data Access
Identifies information about practices or circumstances that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.
IMPORTANT
Identifies information that is critical for successful application and understanding of the product.
ATTENTION
Identifies information about practices or circumstances that can lead to personal injury or death, property damage,
or economic loss. Attentions help you identify a hazard, avoid a hazard, and recognize the consequence
SHOCK HAZARD
Labels may be on or inside the equipment, for example, a drive or motor, to alert people that dangerous voltage may
be present.
BURN HAZARD
Labels may be on or inside the equipment, for example, a drive or motor, to alert people that surfaces may reach
dangerous temperatures.
Allen-Bradley, Rockwell Automation, Logix5000, RSLogix 5000, PLC-5, ControlLogix, PLC-2, SLC, and TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
Table of Contents
Preface
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Who Should Use This Manual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Chapter 1
CIP Services
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
CIP Services Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
CIP Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Logix5000 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Data Type Reporting Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Segment Encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
CIP Service Request/Response Format . . . . . . . . . . . . . . . . . . . . . 14
Services Supported by Logix5000 Controllers . . . . . . . . . . . . . . . . . . . 16
Read Tag Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Read Tag Fragmented Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Write Tag Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Write Tag Fragmented Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Read Modify Write Tag Service . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Multiple Service Packet Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Logix Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 2
CIP Addressing Examples
Chapter 3
CIP Over the Controller Serial Port Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Unconnected Messaging (UCMM) via PCCC. . . . . . . . . . . . . . . . . . . . 45
Connected Explicit Messages via PCCC . . . . . . . . . . . . . . . . . . . . . . . . 47
Fragmentation Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Chapter 4
PCCC Commands
Table of Contents
Preface
Purpose
This manual describes how to access data within a controller from another
product or application that connects to the controller through the
EtherNet/IP network or the serial port. The following methods of data access
from a Logix5000 controller are described in this manual:
Control and Information Protocol (CIP)
This native mode of communication for Logix5000 controllers is based
on the CIP common protocol of these networks:
EtherNet/IP
ControlNet
DeviceNet
These services are also supported over the DF1 serial port by using
Programmable Controller Communication Commands.
The EtherNet/IP network (CIP over standard Ethernet network) is the
preferred method of data access and therefore the focus of this manual.
The ControlNet network can also be used for data access, but generally
speaking, not the DeviceNet network.
Programmable Controller Communication Commands (PCCC), for
compatibility with PLC and SLC controllers:
CIP Over the Controller Serial Port on page 45
PLC-2 Communication Commands on page 51
PLC-5 Communication Commands on page 55
SLC Communication Commands on page 61
The DF1/PCCC method via the serial port is sometimes the most
convenient way to access the controller, typically because of physical
proximity, but it requires using multiple protocols and can require that
tags be mapped to data tables, which is an extra configuration step.
PCCC commands can also be encapsulated in CIP messages and sent
over a CIP network. The commands shown here are not described in
that context.
Visit http://www.rockwellautomation.com/enabled/guides.html for
more information.
Preface
This manual is one of a set of related manuals that show common procedures
for programming and operating Logix5000 controllers. For a complete list of
common procedures manuals, see the Logix5000 Controllers Common
Procedures Programming Manual, publication 1756-PM001.
The term Logix5000 controller refers to any controller that is based on the
Logix5000 operating system, such as:
CompactLogix controllers.
ControlLogix controllers.
DriveLogix controllers.
FlexLogix controllers.
SoftLogix5800 controllers.
Preface
Additional Resources
Some of the information in this manual is covered in more detail in the CIP
specification (listed below). In case of discrepancies, the specification is the
authoritative source of information.
For additional information, refer to the following manuals.
Resource
Author
Rockwell Automation
Rockwell Automation
Rockwell Automation
Rockwell Automation
ODVA
ODVA
ODVA
ODVA
(1)
To locate publications on the ODVA website, use the Search function and type 'pub ###', where ### is the
publication number.
Preface
Glossary
Definition
CIP
Data Type
Reporting Value
PCCC
PLC-2
PLC-5
SLC
STS/EXT STS
tag
UDT
Chapter
CIP Services
Introduction
Before you use CIP services, review the following introductory information.
Topic
Page
10
Logix5000 Data
11
12
Segment Encoding
13
14
Chapter 1
CIP Services
10
To store a
Bit
BOOL
Bit array
8-bit integer
SINT
16-bit integer
INT
32-bit integer
DINT
32-bit float
REAL
64-bit integer
LINT
CIP Services
Chapter 1
Logix5000 Data
The Logix5000 controller stores data in tags, in contrast to a PLC-5 or SLC
controller, which stores data in data files. Logix5000 tags have these properties:
Name that identifies the data:
up to 40 characters in length.
does not include a file number.
Scope:
Controller (global), which you can access directly.
Program (local), which cannot be directly accessed, but can be copied
to a controller scope tag.
Data type, which defines the organization of the data.
See CIP Data Types on page 10 for more information.
Public versus Private - Tags created as Private cannot be accessed by
using the methods described here.
For more information about tags and data types, see Chapter 3 of the
Logix5000 Controllers Design Considerations Reference Manual, publication
1756-RM094.
11
Chapter 1
CIP Services
Data
Reporting
Value
BOOL
0xc1
00
Value
SINT
0xc2
00
Value
INT
0xc3
00
Low
High
DINT
0xc4
00
Lowest
Low
High
Highest
REAL
0xca
00
Lowest
Low
High
Highest
DWORD 0xd3
00
Lowest
Low
High
Highest
LINT
00
Lowest
0xC5
Highest
Data Type Reporting Values for structured data types are described in Logix
Data Structures on page 31.
12
CIP Services
Chapter 1
Segment Encoding
The Request Path in a CIP explicit message contains addressing information
that indicates to which internal resource in the target node the service is
directed. This addressing information is organized by using segment encoding,
specifically Logical Segments and/or Symbolic Segments. Most of the services,
described later in this chapter, use Symbolic Segments, but several others use
Logical Segments. For more detailed information about segments, see the CIP
Networks Library, Volume 1, Appendix C. The following is a summary of the
segments important to the context of this manual.
Logical Segments
These tables explain the Logical Segments.
Element ID Logical Segment Encoding Used to Access Arrays and Structures in Logix Controllers
Segment Type
Value
n+1
8-bit Element ID
0x28
Value
N/a
N/a
N/a
N/a
16-bit Element ID
0x29
00
Low
High
N/a
N/a
32-bit Element ID
0x2A
00
Lowest
Low
High
Highest
Class ID Logical Segment Encoding Used to Address Object Classes in Logix Controllers
Segment Type
Value
n+1
8-bit Class ID
0x20
Value
N/a
N/a
N/a
N/a
16-bit Class ID
0x21
00
Low
High
N/a
N/a
32-bit Class ID
0x22
00
Lowest
Low
High
Highest
Instance ID Logical Segment Encoding Used to Address Instances of an Object in Logix Controllers
Segment Type
Value
n+1
8-bit Instance ID
0x24
Value
N/a
N/a
N/a
N/a
16-bit Instance ID
0x25
00
Low
High
N/a
N/a
32-bit Instance ID
0x26
00
Lowest
Low
High
Highest
Attribute ID Logical Segment Encoding Used to Address Object Attributes in Logix Controllers
Segment Type
Value
n+1
8-bit Attribute ID
0x30
Value
N/a
N/a
N/a
N/a
16-bit Attribute ID
0x31
00
Low
High
N/a
N/a
32-bit Attribute ID
0x32
00
Lowest
Low
High
Highest
13
Chapter 1
CIP Services
Symbolic Segments
CIP also defines a way to reference items by their symbolic name. The segment
used is the ANSI Extended Symbol Segment defined in the CIP Networks
Library, Volume 1, Appendix C.
The Read/Write tags services use these segments in the request path to
indicate which target tag to operate on. When addressing an arrayed tag, the
Logical Segment for Element ID is also used with the Symbolic Segment.
ANSI Extended Symbolic Segment Encoding Used to Address Tags in Logix Controllers
Segment Type
ANSI Extended
Symbolic
(1)
Value
0x91
N+1
Length
1st char
Nth Char
(1)
14
Message Field
Description
Request Service
Request Path
Request Data
CIP Services
Chapter 1
Message Field
Description
Reply Service
00
Reserved.
General Status
Extended Status
Size
An 8-bit value that indicates how many 16-bit values follow in the
additional status field. For status=0 (success) this will be 0.
Extended Status
The array of 16-bit values that further describe the general status
code. Only present when the size field is > 0.
Response Data
15
Chapter 1
CIP Services
Services Supported
by Logix5000 Controllers
The Multiple Service Packet Service (0x0a) may also be used to combine
multiple requests in one message frame.
Previous Names of Tag Services
Service
Read Tag
Fragmented Service
N/A
Write Tag
Fragmented Service
N/A
Multiple Service
Packet Service
N/A
Multi-Request Service
The Request Data and Response Data shown in the examples below is shown
in the required order. Any deviation from the order shown will likely result in
an error.
This document assumes the following:
The client application knows the name of the tag or tags with which it
wants to interact.
For atomic tags, RSLogix 5000 software is used to determine the data
type, which determines the Data Type Reporting Value used in the Tag
Services.
For UDTs, the data order and type of the members in the UDT
corresponds to the order and type shown in RSLogix 5000 Tag Monitor.
This limited subset of UDTs is explained in Logix Data Structures on
page 31.
It is beyond the scope of this document to describe how to search for tags that
exist in the controller, and to programmatically determine the structure and
byte ordering of any kind of structure in the controller.
16
CIP Services
Chapter 1
17
Chapter 1
CIP Services
Example
Read a single tag named 'rate'. The tag has a data type of DINT and a value
of 534.
Request Format
Message Request Field
Description
Request Service
4C
03
Request Path
91 04 72 61 74 65
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C4 00
16 02 00 00
Response Format
Description of Error
0x04
0x0000
0x05
0x0000
0x06
N/A
Insufficient Packet Space: Not enough room in the response buffer for all
the data.
0x13
N/A
0x26
N/A
The Request Path Size received was shorter or longer than expected.
0xFF
0x2105
18
CIP Services
Chapter 1
Example
Reading the tag 'TotalCount' that has 1750 SINTs would consist of the
following four service requests with service data as shown in the tables below.
First Fragment - Request Format
Message Request Field
Bytes
Description
Request Service
52
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
D6 06
00 00 00 00
Bytes
Description
Reply Service
D2
Reserved
00
General Status
06
00
No extended status
Response Data
C2 00
nn nn nnnn
Element 0489
19
Chapter 1
CIP Services
Bytes
Description
Request Service
52
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
D6 06
EA 01 00 00
Bytes
Description
Reply Service
D2
Reserved
00
General Status
06
00
No extended status
Response Data
C2 00
nn nn nnnn
Element 490979
Bytes
Description
Request Service
52
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
D6 06
D4 03 00 00
Bytes
Description
Reply Service
D2
Reserved
00
General Status
06
00
No extended status
Response Data
C2 00
nn nn nnnn
Element 9801469
20
CIP Services
Chapter 1
Bytes
Description
Request Service
52
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
D6 06
BE 05 00 00
Bytes
Description
Reply Service
D2
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C2 00
nn nn nnnn
Element 14701749
Each response except the last one carries the Status of 06, 'Reply Data Too
Large' to indicate that more data is present than is in this particular frame. The
last response carries the Status of 0 indicating that the data read did not exceed
the message size limit, which indicates that the entire sequence of bytes has
been read.
Description of Error
0x04
0x0000
0x05
0x0000
0x06
N/A
Insufficient Packet Space: Not enough room in the response buffer for all the
data.
0x13
N/A
0x26
N/A
The Request Path Size received was shorter or longer than expected.
0xFF
0x2104
0xFF
0x2105
General Error: Offset plus Number of Elements extends beyond the end of the
requested tag.
21
Chapter 1
CIP Services
Example
Write the value of 14 to a DINT tag named 'CartonSize'.
Request Format
Message Request Field
Description
Request Service
4D
06
Request Path
91 0A 43 61 72 74 6F 6E 53 69 7A 65
Request Data
C4 00
01 00
0E 00 00 00
Description
Reply Service
CD
Reserved
00
General Status
00
Success
00
No extended status
Response Format
22
CIP Services
Chapter 1
Description of Error
0x04
0x0000
0x05
0x0000
0x10
0x2101
0x10
0x2802
Device state conflict: Safety Status: The controller is in a state in which Safety
Memory cannot be modified.
0x13
N/A
0x26
N/A
The Request Path Size received was shorter or longer than expected.
0xFF
0x2105
General Error: Offset plus Number of Elements extends beyond the end of the
requested tag.
0xFF
0x2107
General Error: Data type used in request does not match target tags data type.
23
Chapter 1
CIP Services
Example
Writing 1750 SINTS to the tag 'TotalCount' would consist of the following
four service requests with service data as shown in the tables below.
First Fragment - Request Format
Message Request Field
Bytes
Description
Request Service
53
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
C2 00
D6 06
00 00 00 00
Offset
nn, nn, nn
Bytes
Description
Reply Service
D3
Reserved
00
General Status
00
Success
00
No extended status
24
CIP Services
Chapter 1
Bytes
Description
Request Service
53
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
C2 00
D6 06
DC 01 00 00
Offset
nn, nn, nn
Bytes
Description
Reply Service
D3
Reserved
00
General Status
00
Success
00
No extended status
Bytes
Description
Request Service
53
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
C2 00
D6 06
B8 03 00 00
Offset
nn, nn, nn
Bytes
Description
Reply Service
D3
Reserved
00
General Status
00
Success
00
No extended status
25
Chapter 1
CIP Services
Bytes
Description
Request Service
53
06
Request Path
91 0A 54 6F 74 61 6C 43 6F 75 6E 74
Request Data
C2 00
D6 06
94 05 00 00
Offset
nn, nn, nn
Bytes
Description
Reply Service
D3
Reserved
00
General Status
00
Success
00
No extended status
The response to each request carries a Status value of 00, 'Success' status
indication, to indicate that the write operation was successful. No other
Response Data is returned for this service.
Description of Error
0x04
0x0000
0x05
0x0000
0x10
0x2101
0x10
0x2802
Device state conflict: Safety Status: The controller is in a state in which Safety
Memory cannot be modified.
0x13
N/A
0x26
N/A
The Request Path Size received was shorter or longer than expected.
0xFF
0x2104
0xFF
0x2105
General Error: Offset plus Number of Elements extends beyond the end of the
requested tag.
0xFF
0x2107
General Error: Data type used in request does not match the target tags data type.
26
CIP Services
Chapter 1
Semantics of Values
Size of masks
OR masks
AND masks
The size of masks must be the same or smaller than the size of the data type
being accessed. For complete 'data integrity' (for example, to avoid the
possibility of a mix of old and new data when modifying dynamic data), the
size of the mask should match the size of the data type.
27
Chapter 1
CIP Services
Example
Set bit 2 and reset bit 5 of the DINT named 'ControlWord'.
Request Format
Message Request Field
Description
Request Service
4E
07
Request Path
Request Data
04 00
04 00 00 00
DF FF FF FF
Description
Reply Service
CE
Reserved
00
General Status
00
Success
00
No extended status
Response Format
Description of Error
0x03
N/A
0x04
0x0000
0x05
0x0000
0x10
0x2101
0x10
0x2802
0x13
N/A
0x26
N/A
The Request Path Size received was shorter or longer than expected.
28
CIP Services
Chapter 1
Example
Request Format
Message Request Field Bytes (in hex)
Description
Request Service
0A
02
Request Path
20 02 24 01
Request Data
02 00
06 00
10 00
Offsets for each Service; from the start of the Request Data
4C
03 91 04 72 61 74 65
01 00
4C
07 91 0B 43 6F 6E 74 72
6F 6C 57 6F 72 64 00
01 00
The Multiple Service Packet Request Path contains the Message Router object
(Class 2, Instance 1). The Request Data field contains the Number of Services
followed by byte offsets to the start of each service, followed by each of the
CIP requests, each following the standard Message Router Request format.
29
Chapter 1
CIP Services
Response Format
Message Reply Field
Description
Reply Service
8A
Reserved
00
General Status
00
Success
00
No extended status
Response Data
02 00
06 00
10 00
Offsets for each Service Reply; from the start of the Response Data
CC 00 00 00
C4 00
2A 00 00 00
CC 00 00 00
C4 00
DC 01 00 00
The Multiple Service Packet response follows the same Message Router
Response format as all CIP services; therefore, the General Status, Ext Status
Size fields are as described previously. The Response Data field contains the
number of service replies followed by the byte offset to the start of each reply
followed by each of the CIP responses, each following the standard Message
Router Response format.
30
CIP Services
Chapter 1
31
Chapter 1
CIP Services
To simplify the task of accessing structured tags via a network, create UDTs
with members of these types only: atomic tags, arrays of atomic tags, other
UDTs of atomic tags, and arrays of UDTs of atomic tags. To include data
from a tag based on a pre-defined or module-defined structure in a UDT, use
ladder logic to copy the data from the member of the pre-defined or
module-defined tag to an atomic tag and include the atomic tag in the UDT.
Structures begin and end on 32-bit boundaries. A Logix5000 controller aligns
every data type along an 8-bit boundary for SINTs, a 16-bit boundary for
INTs, or a 32-bit boundary for DINTs and REALs. BOOLs also align on 8-bit
boundaries, but if they are placed next to each other in a user-defined
structure, they are mapped so that they share the same byte. Pad bits or bytes
are added where necessary to achieve this alignment according to these rules.
For more details, see the Guidelines for User-defined Structures section in
Chapter 3 of the Logix5000 Controllers Design Considerations Reference
Manual, publication 1756-RM094.
It is also important for the client application to understand the byte order of
the data in the structure, as it will be transmitted on the wire. If UDTs are
restricted to only atomic members or structures of atomic members and do
not include any module-defined or pre-defined data types, then the size and
byte order will be as shown in the Data Monitor view of the structure
definition in RSLogix 5000 software. However, the Data Monitor does not
show the pad bits or bytes included for the data alignment mentioned in the
paragraph above.
Writing to UDTs requires knowing the Data Type Encoding Value. This is a
calculated field that varies with the members and ordering of members in a
structure. Information about calculating this value for UDTs, can be found at
http://www.rockwellautomation.com/enabled/guides.html, in the
supplemental material located with this manual.
32
CIP Services
Chapter 1
Structures in the Logix system use Data Type Reporting Values for
constructed data types. These structures are referred to as Abbreviated
Encoding for Structure Data Information, or simply Abbreviated Types.
First byte indicates that a structure type follows.
Second byte indicates the size of the structure handle, which identifies
the structure for communication purposes.
A0
02
xx
yy
33
Chapter 1
CIP Services
Notes:
34
Chapter
The following examples show Request Path strings for various data accesses
using native CIP service requests and addressing.
These examples show only a portion of a message frame for requests and
responses. References to atomic data types that are not dimensioned (not an
array) are fairly straightforward to construct. References to arrays, portions of
arrays or atomic members of structures are not as straightforward. This section
will use examples to show how various references are constructed.
Visit http://www.rockwellautomation.com/enabled/guides.html to download:
the traffic capture files that contain these services.
the controller project file used as the target in these examples.
35
Chapter 2
The following examples access tags that return atomic data types.
Example 1
Read a single integer tag named 'parts'. The tag has a data type of INT and a
value of 572.
Description
Request Service
4C
04
Request Path
91 05 70 61 72 74 73 00
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C3 00
3C 02
023C = 572
Example 2
Write the value of 14.5 to the 6th element of an array of REALs named
'setpoints' (setpoints[5]).
Message Request Field
Description
Request Service
4D
07
Request Path
91 09 73 65 74 70 6F 69 6E 74 73 00 28 05
Request Data
CA 00
01 00
00 00 68 41
Data 14.5
Description
Reply Service
CD
Reserved
00
General Status
00
Success
00
No extended status
36
Chapter 2
Example 3
Read element [0,1,257] of a three dimensional DINT array named 'profile'.
The value of the tag is 572.
Message Request Field
Description
Request Service
4C
09
Request Path
91 07 70 72 6f 66 69 6c 65 00
28 00
28 01
29 00 01 01
Request Data
02 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C3 00
F0 02 00 00
2C C7 00 00
Example 4
Read the accumulated value of a timer named 'dwell3' (dwell3.ACC).
Message Request Field
Description
Request Service
4C
07
Request Path
91 06 64 77 65 6C 6C 33
91 03 41 43 43 00
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C4 00
25 02 00 00
37
Chapter 2
Example 5
Write a preset value of 50 to the .PRE member of the counter 'ErrorLimit'
(ErrorLimit.PRE).
Message Request Field
Description
Request Service
4D
09
Request Path
91 0a 45 72
72 6F 72 4C 69 60
69 74
91 03 50 52 45 00
Request Data
C4 00
01 00
32 00 00 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
38
Access User-defined
Structures
Chapter 2
Member
Data Type
Member
Data Type
limit4
Bit
pilot_on
Bit
limit7
Bit
hourlyCount
INT[12]
travel
DINT
rate
REAL
errors
DINT
wear
REAL
Member
Data Type
Member
Data Type
hours_full
Bit
myint
INT
today
STRUCT_B
myfloat
REAL
sampleTime
DINT
myarray
STRUCT_C[8]
shipped
DINT
mypid
REAL
For the controller project file and EtherNet/IP traffic capture files for all the
examples in this book, go to
http://www.rockwellautomation.com/enabled/guides.html.
39
Chapter 2
Example 1
Read the tag 'struct1' that is a tag of type STRUCT_A. This reads the entire
structure.
Message Request Field
Description
Request Service
4C
05
Request Path
91 07 73 74 72 75 63 74 31 00
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
A0 02 2C 0A
03 00 00 00
55 00 00 00
AA 00 00 00
33 33 2B 41
Example 2
Read the tag 'struct1.wear'.
Message Request Field
Description
Request Service
4C
08
Request Path
91 07 73 74 72 75 63 74 31 00
91 04 77 65 61 72
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
CA 00
33 33 2b 41
0x412B3333=10.7 decimal
40
Chapter 2
Example 3
Read the tag 'str1Array[8].travel', which is a one dimensional array of struct_A.
Message Request Field
Description
Request Service
4C
0B
Request Path
91 09 73 74 72 31 41 72 72 61 79 00
28 08
91 06 74 72 61 76 65 6c
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C4 00
0F 27 00 00
0x0000270F=9999 decimal
Example 4
Read two elements of the tag 'struct2.hourlyCount[4]', which is a structure of
type struct_B.
Message Request Field
Description
Request Service
4C
0D
Request Path
91 07 73 74 72 75 63 74 32 00
91 0B 68 6f 75 72 6c 79 43 6F 75 6E 74 00
28 04
Request Data
02 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C3 00
05 00
06 00
0x0005=5 decimal
0x0006=6 decimal
41
Chapter 2
Example 5
Read the tag 'struct3.today.rate', which is a structure of type Struct_C.
Message Request Field
Description
Request Service
4C
0C
Request Path
91 07 73 74 72 75 63 74 33 00
91 05 74 6F 64 61 79 00
91 04 72 61 74 65
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
CA 00
00 00 80 41
0x41800000=16.0 decimal
42
Chapter 2
Example 6
Read the tag 'myDstruct4[0].myarray[1].today.hourlyCount[3]' in the controller,
which is a one dimensional array of type Struct_0.
Message Request Field
Description
Request Service
4C
19
Request Path
91 0A 6D 79 44 73 74 72 75 63 74 34
28 00
91 07 6D 79 61 72 72 61 79 00
28 01
91 05 74 6F 64 61 79 00
91 0B 68 6F 75 72 6C 79 43 6F 75 6E 74 00
28 03
Request Data
01 00
Description
Reply Service
CC
Reserved
00
General Status
00
Success
00
No extended status
Response Data
C3 00
D0 5C
0x5CD0=23760 decimal
43
Chapter 2
Notes:
44
Chapter
Introduction
Unconnected Messaging
(UCMM) via PCCC
45
Chapter 3
Type
CMD
USINT
Command = 0x0B
STS
USINT
Status (0 in request)
TNSW
UINT
FNC
USINT
Extra
USINT
Request Service
USINT
USINT
Request Path
EPATH
Semantics of Values
Type
CMD
USINT
STS
USINT
Status (0 == Success)
TNSW
UINT
FNC
USINT
Extra
USINT
Reply Service
USINT
Reserved
USINT
00
General Status
USINT
ss
nn
Extended Status
Service Response
Data
46
Semantics of Values
See the DF1 Protocol and Command Set Reference
Manual, publication 1770-6.5.16
Connected Explicit
Messages via PCCC
Chapter 3
We assume that you are familiar with CIP and the information
related to CIP that is discussed here. Therefore, the details of the
CIP portions of the frame will not be fully described here.
References to where more detailed information can be found are
provided below. If you are not familiar with CIP, a tutorial CD
ROM is available for purchase at
http://www.rockwellautomation.com/enabled/cipetraining.html.
The following table shows the fields used and where more
information can be found about specific fields of the command
structure.
PCCC Command 0A Structure
Name
Type
CMD
USINT
Command = 0x0A
STS(1)
USINT
Status (0 in request)
TNSW
UINT
FNC
USINT
Extra
USINT
CID(2)
UINT
Connection ID
Trans. Header **
UINT
Data
(1)
(2)
These appear only in the First_req., First_response, and Only messages, if fragmentation is used.
Semantics of Values
See the DF1 Protocol and Command Set
Reference Manual, publication 1770-6.5.16
47
Chapter 3
Type
DLE
USINT
STX
USINT
Start of message
DST
USINT
Address of destination
SRC
USINT
Address of source
CMD
USINT
Command = 0Ahex
STS
USINT
Status (0 in request)
TNSW
UINT
48
Semantics of Values
See the DF1 Protocol and Command Set
Reference Manual, publication
1770-6.5.16
Chapter 3
Type
Semantics of Values
FNC
USINT
Fragmentation Protocol
00hex ('Only' function)
Extra
USINT
Fragmentation Protocol
00hex ('Only' has no Extra)
CID
UINT
O-T Connection ID
Transport Header
UINT
Request Service
USINT
USINT
Request Path
EPATH
Service Data
Service data
DLE
USINT
ETX
USINT
End of message
BCC or CRC
USINT or UINT
Cyclic Redundancy
Check
Fragmentation Protocol
49
Chapter 3
Notes:
50
Chapter
PCCC Commands
PCCC commands are carried within DF1 packets to the serial port of the
Logix5000 controller. This option for accessing data table mappings inside the
Logix5000 controller is provided for backwards compatibility with our legacy
controllers that do not understand the native language of a Logix5000
controller, CIP. Other applications that worked with our legacy controllers
over serial port could, with proper mapping of Logix5000 tags to data tables,
be used to access information in the Logix5000 controller. For details on data
table mapping, see the Logix5000 Controllers Design Considerations
Reference Manual, publication 1756-RM094.
This is not the preferred method of interacting with Logix5000 controllers, but
is serviceable for many applications, especially where the legacy
communications product is not able to be modified, and where the Logix5000
customer is willing to do the extra configuration of data table mappings in the
Logix5000 controller. Likewise, remote applications that depend on serial
communication over a modem or serial radio link can also use this method.
For more information on PCCC commands, see the DF1 Protocol and
Command Set Reference Manual, publication 1770-6.5.16.
PLC-2 Communication
Commands
Use the PLC-2 commands to access one tag (only one tag) in a Logix5000
controller. In addition to sending the command, you must also map the
message to an INT (16 bit integer) tag in the Logix5000 controller.
Logix5000 controllers support the following PLC-2 commands:
Unprotected Read
Protected Write
Unprotected Write
Protected Bit Write
Unprotected Bit Write
Further details about these commands can be found in the DF1 Protocol and
Command Set Reference Manual, publication 1770-6.5.16.
These commands can arrive at the controller in the following ways:
Encapsulated inside a ControlNet message
Encapsulated inside a EtherNet/IP message
Via the RS-232 serial port
51Publication 1756-PM020A-EN-P - October 2009
51
Chapter 4
PCCC Commands
Unprotected Read
This command provides the read capability for the PLC-2 commands.
Request Format
CMD
STS
TNS
TNS
address
offset
size
Where:
CMD is an 8-bit command code.
STS is an 8-bit status code.
TNS is a 16-bit unique transaction identifier.
address offset is a 2-byte field that indicates byte offset from the start
of a file or tag.
size must be an even number of bytes.
See the DF1 Protocol and Command Set Reference Manual, publication
1770-6.5.16, for more information about these fields.
Reply Format
CMD
STS
TNS
TNS
data
Protected Write
This command provides a protected write capability for the PLC-2 commands.
Request Format
CMD
STS
TNS
TNS
address
offset
data
Reply Format
CMD
52
STS
TNS
TNS
PCCC Commands
Chapter 4
Unprotected Write
This command provides a basic write capability for the PLC-2 commands
Request Format
CMD
STS
TNS
TNS
address
offset
data
Reply Format
CMD
STS
TNS
TNS
Request Format
repeatable up to 61 times
CMD
02
STS
TNS
TNS
PLC-2
address
set mask
reset mask
Where:
PLC-2 address is the typical 2 byte offset.
set mask is 1 byte.
reset mask is 1 byte.
Reply Format
CMD
42
STS
TNS
TNS
53
Chapter 4
PCCC Commands
Request Format
repeatable up to 61 times
CMD
05
STS
TNS
TNS
PLC-2
address
set mask
reset mask
Where:
PLC-2 address is the typical 2 byte offset.
set mask is 1 byte.
reset mask is 1 byte.
Reply Format
CMD
45
54
STS
TNS
TNS
PCCC Commands
PLC-5 Communication
Commands
Chapter 4
Symbolic addresses
tag_name
tag_name[x]
tag_name[x,y,z]
tag_name[x][y][z]
55
Chapter 4
PCCC Commands
IMPORTANT
For the typed read and typed write commands, you can access
only the following data types:
SINT
INT
DINT
REAL
Request Format
CMD
0F
STS
TNS
TNS
FNC
26
PLC-5
system
address
AND
mask
OR
mask
Where:
AND mask specifies which bits in the word to reset (0).
OR mask specifies which bits in the word to set (1).
Reply Format
CMD
4F
56
STS
TNS
TNS
EXT
STS
PCCC Commands
Chapter 4
Request Format
Repeatable up to 243 bytes
CMD
0F
STS
TNS
TNS
FNC
79
no. of
sets
PLC-5
system
address
mask
length
AND
mask
OR
mask
Where:
AND mask specifies which bits in the word to reset (0).
OR mask specifies which bits in the word to set (1).
Reply Format
Repeatable for each set, high word if necessary
EXT
STS
Reply
57
Chapter 4
PCCC Commands
Typed Read
The typed read command reads a block of data from the controller starting at
the PLC-5 system address plus the packet offset.
Request Format
CMD
0F
STS
TNS
TNS
FNC
68
packet
offset
total
transaction
PLC-5
system
address
size
Reply Format
CMD
4F
STS
TNS
TNS
Where:
a indicates the type information or extended status if the command
errors.
b is the data bytes.
Typed Write
The typed write command writes a block of data to the controller starting at
the PLC-5 system address plus the packet offset.
Request Format
CMD
0F
STS
TNS
TNS
FNC
67
packet
offset
total
transaction
PLC-5
system
address
Where:
packet offset is in number of elements.
total transaction is in number of elements.
a indicates how many elements to write.
b is the data byte.
58
PCCC Commands
Chapter 4
Reply Format
Extended status exists only if there is an error.
CMD
4F
STS
TNS
TNS
EXT
STS
Request Format
CMD
0F
STS
TNS
TNS
FNC
01
packet
offset
total
transaction
PLC-5
system
address
size
Where:
packet offset is in numbers of 16 bit words.
total transaction is in numbers of 16 bit words.
size is in number of bytes and must be even in number.
Reply Format
CMD
0F
STS
TNS
TNS
data
59
Chapter 4
PCCC Commands
Request Format
CMD
0F
STS
TNS
TNS
FNC
00
packet
offset
total
trans-acti
on
PLC-5
system
address
data
Where:
packet offset is in numbers of 16 bit words.
total transaction is in numbers of 16 bit words.
Reply Format
CMD
4F
STS
TNS
TNS
EXT
STS
Bit Write
This command will set and reset bits in a single word specified by the PLC-5
logical address. It can change only a single word in any given command.
Request Format
CMD
0F
STS
TNS
TNS
FNC
02
PLC-5
system
address
set
mask
reset
mask
Reply Format
CMD
4F
60
STS
TNS
TNS
EXT
STS
PCCC Commands
SLC Communication
Commands
Chapter 4
One-dimension array
Two-dimensional array
Three-dimensional array
61
Chapter 4
PCCC Commands
Request Format
CMD
0F
STS
TNS
TNS
FNC
A2
byte
size
file
number
file
type
element
number
sub- element
number
Reply Format
CMD
4F
STS
TNS
TNS
EXT
STS
data
Request Format
CMD
0F
STS
TNS
TNS
FNC
AA
byte
size
file
num
file
type
elem
num
sub-elem
num
data
Reply Format
CMD
4F
STS
TNS
TNS
EXT
STS
Request Format
CMD
0F
STS
TNS
TNS
FNC
A1
byte size
file number
file type
element
number
Reply Format
CMD
4F
62
STS
TNS
TNS
EXT
STS
data
PCCC Commands
Chapter 4
Request Format
CMD
0F
STS
TNS
TNS
FNC
A9
byte size
file num
file type
elem num
data
Reply Format
CMD
4F
STS
TNS
TNS
EXT
STS
To access
PCCC symbolic
'parts'
PCCC ASCII
$F8:6
PCCC symbolic
'setpoints[6]'
PCCC ASCII
$N7:2:5:257
PCCC symbolic
'profile[2,5,257]'
PCCC ASCII
$T4:0:2
PCCC ASCII
$C5:5:0:1
63
Chapter 4
PCCC Commands
Notes:
64
Installation Assistance
If you experience an anomoly within the first 24 hours of installation, review the information that is contained in this manual.
You can contact Customer Support for initial help in getting your product up and running.
United States or Canada
1.440.646.3434
Contact your distributor. You must provide a Customer Support case number (call the phone number
above to obtain one) to your distributor to complete the return process.
Please contact your local Rockwell Automation representative for the return procedure.
Documentation Feedback
Your comments will help us serve your documentation needs better. If you have any suggestions on how to improve this
document, complete this form, publication RA-DU002, available at http://www.rockwellautomation.com/literature/.
Copyright 2009 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.