EtherNet/IP Object Model
The ID Reader Object is a vendor specific object class. This means that it is not part of the CIP common (public) architecture but an extension. It is a custom object that Cognex has added to the EtherNet/IP architecture on the DataMan reader. All the data and functionality of this object model are available in the reader. This includes triggering, status, events, errors, and result data.
The ID Reader Object is identified by its vendor specific class code.
Reader ID Reader Object Class Code: 0x79
Objects are made up of attributes (data) and services (functionality). These can be defined at the class level (common to all instances of the class) or the instance level (unique to an individual instance). The CIP specification defines common attributes and services that apply to all objects (often these are optional). Vendors may also define their own attributes and services for their vendor specific classes.
The ID Reader Object attributes and services can be individually accessed via explicit messaging. In addition, a number of the ID Reader Object attributes are exposed in the DataMan assembly objects which allow them to be accessed as a group via implicit messaging.
Attributes
The DataMan ID Reader Object (Class Code: 0x79) has the following attributes:
| Attribute ID | Access Rule | Name | Data Type | Description |
|---|---|---|---|---|
| 0x9 | Set | AcqTriggerEnable | BOOL |
0 = EtherNet/IP triggering is disabled 1 = EtherNet/IP triggering is enabled |
| 0xA | Set | AcqTrigger | BOOL | Acquire an image when this attribute changes from 0 to 1. |
| 0xB | Get | AcqStatusRegister | BYTE |
Bit0: Trigger Ready Bit1: Trigger Ack Bit2: Reserved Bit3: Missed Acquisition Bit4-7: Reserved |
| 0xC | Set | UserData | ARRAY of BYTE | User defined data that can be used as an input to the acquisition/decode. |
| 0xD | Set | BufferResultsEnable | BOOL | When true, it enables buffering of the decode results. The reader can buffer up to 50 and the Base Station can buffer up to 500 sets of read results. |
| 0xE | Get | DecodeStatusRegister | BYTE |
Bit0: Decoding Bit1: Decode completed (toggle) Bit2: Results buffer overrun Bit3: Results available Bit4: Reserved Bit5: Reserved Bit6: Reserved Bit7: General fault indicator |
| 0xF | Set | ResultsAck | BOOL | Acknowledges that the client received the decode results. |
| 0x10 | Get | DecodeResults | STRUCT of | The last decode results. |
| ResultsID | UINT |
Decode results identifier. Corresponds to the TriggerID of the decoded image. |
||
| ResultCode | UINT |
Decode result summary code value. Bit0: 1=Read, 0=No read Bit1: 1=Validated, 0=Not Validated Bit2: 1=Verified, 0=Not Verified Bit3: 1=Acquisition trigger overrun Bit4: 1=Acquisition buffer overrun Bit 5: Reserved Bit 6: 1=result is a DMCC response, 0=result is a read result. For more information, see DMCC Result Feedback from PLC. Bit 7-15: Reserved (future use) |
||
| ResultExtended | UINT | Extended result information. | ||
| ResultLength | UINT | Current number of result data bytes. | ||
| ResultData | ARRAY of BYTE | Result data from last decode. | ||
| 0x12 | Set | SoftEvents | BYTE |
SoftEvents act as virtual inputs (execute action on 0 to 1 transition) Bit0: Train code Bit1: Train match string Bit2: Train focus Bit3: Train brightness Bit4: Un-Train Bit5: Reserved (future use) Bit6: Execute DMCC command Bit7: Set match string |
| 0x15 | Get | TriggerID | UNIT | Trigger identifier. ID of the next trigger to be issued. |
| 0x16 | Set | UserDataOption | UINT |
Optional user data information. Currently only used by “Set Match String” SoftEvent. Specifies which code target to assign the string (16-bit Integer). Bit0: Assign string to all targets Bit1: Assign string to 2D codes Bit2: Assign string to QR codes Bit3: Assign string to 1D/stacked/postal codes |
| 0x17 | Set | UserDataLength | UINT | Current number of user data bytes. |
| 0x18 | Get | SoftEventAck | BYTE |
Acknowledgment of SoftEvents. Bit0: Train code ack Bit1: Train match string ack Bit2: Train focus ack Bit3: Train brightness ack Bit4: Un-Train ack Bit5: Reserved (future use) Bit6: Execute DMCC command ack Bit7: Set match string ack |
SoftEvents
SoftEvents act as “virtual” inputs. When the value of a SoftEvent changes from 0 to 1, the action associated with the event is executed. When it is done, the corresponding SoftEventAck bit changes from 1 to 0 to mark completion.
The SoftEvent and SoftEventAck form a logical handshake. After SoftEventAck changes to 1 the original SoftEvent is set back to 0. When that occurs, SoftEventAck is automatically set back to 0.
The “ExecuteDMCC” and “SetMatchString” SoftEvent actions require user supplied data. This data must be written to the UserData and UserDataLength area of the Input Assembly prior to invoking the SoftEvent. Since both of these SoftEvents depend on the UserData, only one can be invoked at a time.
General Fault Indicator
When a communication related fault occurs, the “GeneralFault” bit changes from 0 to 1. The only fault conditions supported are SoftEvent operations. If a SoftEvent operation fails, the fault bit will be set. The fault bit remains set until either the next successful SoftEvent operation or until TriggerEnable is set to 0 and then back to 1.
|
Services
The ID Reader Object supports the following Common CIP services:
| Service Code | Service Name | Description |
|---|---|---|
| 0x05 | Reset | Resets the ID Reader object. |
| 0x0E | Get_Attribute_Single | Returns the contents of the specified attribute. |
| 0x10 | Set_Attribute_Single | Modifies the specified attribute. |
The ID Reader Object supports the following vendor specific services:
| Service Code | Service Name | Description |
|---|---|---|
| 0x32 | Acquire | Triggers a single acquisition. |
| 0x34 | SendDMCC | Sends a DMCC command to the reader. |
| 0x35 | GetDecodeResults | Gets the content of the DecodeResults attribute. |
Acquire Service
The Acquire Service triggers an acquisition (if the acquisition system is ready to acquire an image). If the acquisition could not be triggered, then the Missed Acquisition bit of the AcqStatusRegister will be set until the next successful acquisition.
SendDMCC Service
The SendDMCC Service sends a DMCC command string to the reader. The request data consists of the DMCC command string that is to be sent to the reader. The reply data contains the string result of the DMCC command. Additionally, the service provides a numeric result status for the call. Most of these result codes relate to the basic success/failure of the service execution. However, the service also maps the actual DMCC status codes. This allows the PLC to interpret the service request without having to parse the actual DMCC return string.
DMCC commands transferred through the Industrial Ethernet protocols are automatically routed to the Wi-Fi reader. The commands cannot be executed while the Wi-Fi reader is powered off, hibernating, or out-of-range.
| Service Return Code |
Description | DMCC Return Code |
|---|---|---|
| 0 | Success – No error | 0 |
| 1 | Bad Command | - |
| 4 | No Answer – System too busy | - |
| 100 | Unidentified error | 100 |
| 101 | Command invalid | 101 |
| 102 | Parameter invalid | 102 |
| 103 | Checksum incorrect | 103 |
| 104 | Parameter rejected/altered due to reader state |
104 |
GetDecodeResults Service
The GetDecodeResults service reads data from the DecodeResults attribute of the ID Reader Object. This service takes parameters indicating the “size” (number of bytes to read) and the “offset” (offset into the DecodeResults attribute to begin reading). This gives the service the flexibility to be used with PLCs that have different restrictions on the amount of data allowed in an explicit message. It also allows you to access very large codes that cannot be completely transferred with implicit messaging (assembly object).
GetDecodeResults Request Data Format:
| Name | Type | Description |
|---|---|---|
| Size | UINT | The number of bytes of the DecodeResults attribute to read. |
| Offset | UINT | The offset into the DecodeResults attribute. This specifies the first byte of the DecodeResults attribute to begin reading (0 based offset). |
Assembly Object
Assemblies are combinations of selected attributes (data items) from CIP objects within a device. The device vendor defines assemblies according to their needs and combine data together in useful groupings according to the requirements of the application.
DataMan is an I/O adapter class device. The convention for adapters is that Input Assemblies produce (transmit) data for another device (that is, DataMan to PLC) and Output Assemblies consume (receive) data from another device (that is, PLC to DataMan). DataMan acts as an I/O module for another device such as a PLC.
Assembly objects use implicit messaging. They are blocks of data which are transmitted as the raw payload of implicit messaging packets. These implicit messaging packets are produced (transmitted) repeatedly at a predefined chosen rate (for example, 100ms or 200ms).
DataMan reader have a single input assembly and single output assembly. These assemblies combine selected attributes (data) of the DataMan ID Reader Object into groupings that minimize network bandwidth, and still allow for efficient control and processing. The data in these assemblies can also be accessed individually from the ID Reader Object. However, using the assembly objects is much more efficient, thus they are the primary means of runtime communication between a DataMan reader and a PLC.
Input Assembly
The Input assembly provides status information, process state, and decode results.
| Instance | Byte | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
|---|---|---|---|---|---|---|---|---|---|
| 11 | 0 | Reserved | Missed Acq |
Acquiring |
Trigger Ack |
Trigger Ready |
|||
| 1 |
General Fault |
Reserved |
Results Available |
Results Buffer Overrun |
Decode Complete Toggle |
Decoding1 | |||
| 2 |
SoftEvent Ack 7 |
SoftEvent Ack 6 |
SoftEvent Ack 5 |
SoftEvent Ack 4 |
SoftEvent Ack 3 |
SoftEvent Ack 2 |
SoftEvent Ack 1 |
SoftEvent Ack 0 |
|
| 3-5 | Reserved | ||||||||
| 6 | Trigger ID (16-bit integer) | ||||||||
| 7 | |||||||||
| 8 | Result ID (16-bit integer) | ||||||||
| 9 | |||||||||
| 10 | Result Code (16-bit integer) | ||||||||
| 11 | |||||||||
| 12 | Result Extended (16-bit integer) | ||||||||
| 13 | |||||||||
| 14 | Result Data Length (16-bit integer) | ||||||||
| 15 | |||||||||
| 16 | Result Data 0 | ||||||||
| ... | |||||||||
| 499 | Result Data 483 | ||||||||
Output Assembly
The Output assembly contains control signals, software event signals, and any user data required for the trigger and decode.
| Instance | Byte | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
|---|---|---|---|---|---|---|---|---|---|
| 21 | 0 | Reserved |
Results Ack |
Buffer Results Enable |
Trigger |
Trigger Enable |
|||
| 1 |
SoftEvent 7 |
SoftEvent 6 |
SoftEvent 5 |
SoftEvent 4 |
SoftEvent 3 |
SoftEvent 2 |
SoftEvent 1 |
SoftEvent 0 |
|
| 2 | Reserved | ||||||||
| 3 | |||||||||
| 4 | User Data Option (16-bit integer) | ||||||||
| 5 | |||||||||
| 6 | User Data Length (16-bit integer) | ||||||||
| 7 | |||||||||
| 8 | User Data 0 | ||||||||
| ... | |||||||||
| 499 | User Data 491 | ||||||||