Request path
What Is a Request Path?
In CIP message communication, a Request Path is used to specify the target you want to read or write.
A request path is made by concatenating multiple segments and can specify PLC variables, structure members, array elements, CIP objects and more.
For example, whether specifying the variable testInt, the structure member testStruct.int16 or the array element aryInt[1], it is ultimately converted into a byte sequence as a request path and sent.
Basic Structure of a Request Path
A Request Path is information that expresses "which object" and "which member" to access.
Each segment consists of Type, Format and Data, and multiple segments are concatenated depending on the target.
Writing a request path to specify a variable name
A request path is written by concatenating multiple segments
| Request Path Length | Segment1 | Segment2 | Segment3 | ... | |||||||||||||||||||||||||
| Type | Format | Data | Type | Format | Data | Type | Format | Data | |||||||||||||||||||||
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||||||
| Type | Description | ||
|---|---|---|---|
| 7 | 6 | 5 | |
| 0 | 0 | 0 | Port Segment |
| 0 | 0 | 1 | Logical Segment |
| 0 | 1 | 0 | Network Segment |
| 0 | 1 | 1 | Symbolic Segment |
| 1 | 0 | 0 | Data Segment |
| 1 | 0 | 1 | Data Type |
| 1 | 1 | 0 | Data Type |
| 1 | 1 | 1 | Reserved |
What Is a Data Segment?
A Data Segment specifies a PLC variable name. The NJ/NX series generally uses the "ANSI Extended Symbol Segment (0x91)".
By specifying the length of the variable name and the name itself, you can access global variables and structure members in the PLC.
Here, variables are accessed using a Data Segment (access to variables) and a Logical Segment (access to CIP objects)
| Type | Sub Type | Hex notation | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0x80 | Simple Data Segment |
| 1 | 0 | 0 | 0 | 1 | 0x91 | ANSI Extended Symbol Segment | |||
What Is a Logical Segment?
A Logical Segment specifies a CIP object. CIP objects are accessed by specifying the Class ID, Instance ID, Attribute ID and so on.
Used to access standard CIP objects such as the Identity object and the TCP/IP Interface object.
| Type | Logical Type | Logical Format | Hex notation | Description | |||||
|---|---|---|---|---|---|---|---|---|---|
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0x20 | Class ID |
| 0 | 0 | 1 | 0 | 0 | 0x24 | Instance ID | |||
| 0 | 1 | 0 | 0 | 0 | 0x28 | Member ID | |||
| 0 | 1 | 1 | 0 | 0 | 0x2C | Connection Point | |||
| 1 | 0 | 0 | 0 | 0 | 0x30 | Attribute ID | |||
| Logical Format | Description | |
|---|---|---|
| 1 | 0 | |
| 0 | 0 | 8bit logical address |
| 0 | 1 | 16bit logical address |
| 1 | 0 | 32bit logical address |
How to Specify Variables
Specifying a simple variable
| Target variable name | testInt |
|---|
For a simple variable, the variable name can be specified as-is using the ANSI Extended Symbol Segment.
| Request Path Length(word) | Segment | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Sub Type | Data | |||||||||
| Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | (pad) | |||||||
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | ||||
| 0x05 | 0x91 | 0x07 | "testInt" | 0x00 | |||||||
Specifying a structure member
| Target variable name | testStruct.int16 |
|---|
A structure member can be specified either by splitting it into segments or as a single string in dot notation.
| Request Path Length (word) | Segment1 | Segment2 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Sub Type | Data | Type | Sub Type | Data | ||||||||||||||||
| Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | (pad) | |||||||||||||
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | ||||||
| 0x0a | 0x91 | 0x0a | "testStruct" | 0x91 | 0x05 | "int16" | 0x00 | ||||||||||||||
| Request Path Length (word) | Segment1 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Type | Sub Type | Data | ||||||||
| Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | |||||||
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | |||
| 0x09 | 0x91 | 0x10 | "testStruct.int16" | |||||||
Specifying an array element
| Target variable name | aryInt[1] |
|---|
An array element can be specified either with a Member ID segment or as a string that includes the subscript.
| Request Path Length (word) | Segment1 | Segment2 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Sub Type | Data | Type | Logical Type | Logical Format | Data | |||||||||||||||
| Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | Logical Segment | Member ID | 8bit address | Index | ||||||||||||||
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | ||||||
| 0x0a | 0x91 | 0x06 | "aryInt" | 0x28 | 0x01 | ||||||||||||||||
| Request Path Length (word) | Segment1 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Sub Type | Data | |||||||||
| Data Segment | ANSI Extended Symbol Segment | Variable Length | Variable Name | ||||||||
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | pad | |||
| 0x06 | 0x91 | 0x09 | "aryInt[1]" | 0x00 | |||||||
