EtherNet/IP Object Model and Input/Output Assembly Objects - In-Sight 4.x.x Firmware

This topic covers the In-Sight Object Model for In-Sight vision systems running In-Sight 4.x.x and earlier firmware. For a complete list of models and supported firmware versions, see Firmware Versions.

In-Sight Object Model

In EtherNet/IP networks, In-Sight vision systems act as servers, with support for both explicit and implicit I/O messaging. Data from inspections, for instance, can be transferred to clients via explicit messages or through implicit connections. Implicit connections can also be used to control acquisitions, triggers and spreadsheet events.

The Identity Object, Ethernet Link Object, TCP/IP Object and the Other Internal Objects are required by the EtherNet/IP specification. The different instances of the Assembly Object are used to exchange application data with EtherNet/IP clients. The Vision Object is defined by the In-Sight System to provide information specific to In-Sight vision systems. The details for how this occurs are provided in the Vision Object Attributes and Services section. The current object model provided by In-Sight vision systems is illustrated in the following figure:

  • Assembly Object: The Assembly Object binds attributes of multiple objects, which allows data to and from each object to be sent or received over a single connection. Assembly Objects can be used to bind input data or output data. The terms "input" and "output" are defined from the network's point of view. An "input" will produce data on the network and an "output" will consume data from the network.
  • Identity Object: This object provides identification of, and general information about, the device.
  • Ethernet Link Object: The Ethernet Link Object maintains link-specific counters and status information for an Ethernet 802.3 communications interface.
  • TCP/IP Object: The TCP/IP Object provides a mechanism to query and possibly configure a device's TCP/IP network interface configuration. Examples of items of interest include a device's IP Address, Network Mask and Gateway Address.
  • Vision Object: The Vision Object contains all of the services and attributes specific to In-Sight vision systems. This includes acquisition, inspection, job change-over and communications with the In-Sight Explorer spreadsheet.

Input and Output Assembly Objects

The I/O Assembly data attribute for the input and output data has the following formats:

Firmware Version Input Assembly Instance Output Assembly Instance
4.1.0 - 4.7.4 11 21
4.8.0 - 4.9.x 12 21
4.10.x 12 21
Note:
  • If using the Input Assembly Instance 12 that contains the Job Pass, Exposure Complete and Current Job ID (16-bit integer) blocks, the In-Sight Add-On Profile (AOP), with Major Revision 10 must be installed on the PC with RSLogix. For more information, see Establish the Connection Using the Add-On Profile
  • If using an EDS generated profile, although the maximum size of the Input Assembly is 500 bytes, the EDS generated profile will only allow a connection of up to 496 bytes.
  • When using Rockwell RSLogix Studio 5000, version 21 through 25, the In-Sight EDS generated profile’s default Input and Output Assembly sizes (496 bytes for each) cannot be edited and will default to the largest Input and Output Assembly sizes.
  • The Acquisition ID will increment at the end of acquisition and moves along with the image to inspection subsystem. It can be updated in the PLC depending on the RPI before the inspection is completed. The Inspection ID increments when the Inspection Completed bit toggles (at which time the Results Valid is set high and the Inspecting bit goes low).
  • For differences in the Input and Output Assembly tables when upgrading In-Sight firmware from In-Sight 4.9.x to 4.10.x, see Input/Output Assembly Changes

Mapping of I/O Assembly Data Attribute Components

The following table indicates the I/O Assembly Data attribute mapping for In-Sight vision systems:

Data Component Name Class Instance Number Attribute
Name Number Name Number
Set Offline Vision 78 Hex 1 ForceOffline 8
Trigger Enable Vision 78 Hex 1 AcqTriggerEnable 9
Trigger Vision 78 Hex 1 AcqTrigger 10
BufferResultsEnable Vision 78 Hex 1 BufferResultsEnable 13
Soft Event N Vision 78 Hex 1 SoftTrigger bit N 18
Online Vision 78 Hex 1 Online 6
OfflineReason Vision 78 Hex 1 OfflineReason 7

Trigger Ready

Trigger Ack

Exposure Complete

Missed Acquisition

Vision 78 Hex 1 AcqStatusRegister 11
User Data Vision 78 Hex 1 User Data 12

System Busy

Inspection Completed

Results Buffer Overrun

Results Valid

Vision 78 Hex 1 InspectionStatusRegister 14

Inspection ID

Inspection Data

Vision 78 Hex 1 InspectionResults 16

Vision Object Attributes

This section describes the various attributes and services that exist in the EtherNet/IP Vision Object.

Note: Class Code: 78 Hex - This object models all operations available to the In-Sight vision system running In-Sight 4.x.x and earlier firmware.

Instance Attributes

Attribute ID Access Rule Name Data Type Description of Attribute
6 Get Online BOOL

0 = Offline

1 = Online

7 Get OfflineReason BYTE

0 = Online

1 = Programming

2 = Discrete Offline

3 = Comm. Offline

4-255 = Reserved

8 Set ForceOffline BOOL 1 = Force the In-Sight vision system Offline.
9 Set AcqTriggerEnable BOOL

0 = Acquisition Trigger is disabled. Trigger Ack is reset to 0.

1 = Acquisition Trigger is enabled.

10 Set AcqTrigger BOOL When AcqTriggerEnable is True, the In-Sight vision system will acquire an image when AcqTrigger changes from 0 to 1.
11 Get AcqStatusRegister BYTE

Bit 0: Trigger Ready

Bit 1: Trigger Ack

Bit 2: Acquiring

Bit 3: Missed Acquisition

Bit 4-7: Reserved

12 Set

UserData

ARRAY of BYTE

User defined data that may be used as an input to the inspection.

Note: For In-Sight vision systems running In-Sight firmware 4.x.x, data written to the UserData attribute appears when written.
13 Set

BufferResultsEnable

BOOL When BufferResultsEnable is True, it enables buffering of inspection results until the ResultsAck attribute is set to True.
14 Get

InspectionStatusRegister

BYTE

Bit 0: Inspecting

Bit 1: Inspection Completed

Bit 2: Results Buffer Overrun

Bit 3: Results Valid

Bit 4: Job Loading

Bit 5: Job Load Completed

Bit 6: Job Load Failed

Bit 7: Reserved

15 Set InspectionResultsAck BOOL Acknowledges that the client received the inspection results.
16 Get InspectionResults STRUCT of The last inspection results.
InspectionID UINT Inspection counter.
Reserved UINT Reserved field.
InspectionResults ARRAY of BYTE Results from the last inspection.
18 Set SoftTrigger BYTE

Bit 0: Soft Trigger 0

Bit 1: Soft Trigger 1

Bit 2: Soft Trigger 2

Bit 3: Soft Trigger 3

Bit 4: Soft Trigger 4

Bit 5: Soft Trigger 5

Bit 6: Soft Trigger 6

Bit 7: Soft Trigger 7

19 Set JobID INT

The ID number of the currently loaded job, or -1 if the current job does not have an ID.

 

Setting this value (between 0 and 999) will load the job with that associated ID.

20 Set JobName STRING

The file name of the currently loaded job, or an empty string if the file name is unknown.

 

Setting this value will load the job with that associated file name.

Online Attributes

The Online Attributes indicate whether or not an In-Sight vision system is in an Online or Offline state. When the In-Sight vision system is Offline, the OfflineReason attribute can be used to determine the reason as to why the In-Sight vision system is Offline.

OfflineReason Attribute Values

Offline Reason Name Description

0

Online

The vision system is Online.

1

Programming

The vision system's job is being modified.

2

Discrete Offline

A discrete signal is holding the vision system Offline.

3

Comm. Offline

A communications protocol is holding the vision system Offline.

Note: It is possible to have multiple devices holding the In-Sight vision system Offline. In this scenario, this field will return the channel with the lowest reason code.

The ForceOffline attribute can be used to force the In-Sight vision system into an Offline state. When the ForceOffline attribute is set to True, the OfflineReason attribute will be set to Comm. Offline, if the In-Sight vision system is being held Offline for no other reason.

Acquisition Attributes

Note: If the In-Sight vision system will be configured to accept an acquisition trigger from a PLC/Motion Controller via a Native Mode command, Cognex recommends that the SetEvent and Wait function be utilized, with the Event code set to 8 (SW8). This will ensure that vision system waits for both the acquisition and inspection to be completed before sending a "complete" response back to the PLC/Motion Controller, and that previous inspection results are not being sent to the PLC/Motion Controller. The "complete" response from the vision system can also then be used to create conditional PLC logic that sends a read request for the inspection results. For more information, see Set Event and Wait.

The Vision Object can be triggered to acquire images by using the Acquisition Attributes. In order to reset the Acquisition Attributes in the Vision Object, the AcqTriggerEnable attribute must be set to False, until the AcqStatusRegister is 0. Then, the AcqTriggerEnable attribute can be set to True to enable acquisition via the Vision Object. When the Acquisition Trigger is ready to accept triggers, the Trigger Ready bit in the AcqStatusRegister will be set.

While the AcqTriggerEnable attribute is set to True, each time the Vision Object sees the AcqTrigger attribute change from 0 to 1, it will initiate an image acquisition. When setting this via implicit messaging, to guarantee that the change is seen by the Vision Object, the attribute should be held in the changed state until that same value is seen by the Trigger Ack bit of the AcqStatusRegister.

Note: This is not necessary when using explicit messaging, because the change will always be seen.

During an acquisition, the Trigger Ready bit in the AcqStatusRegister will be cleared and the Acquiring bit will be set. When the acquisition is completed, the Acquiring bit will be cleared; and once the acquisition system is ready to begin a new image acquisition, the Trigger Ready bit will again be set.

If other methods of acquisition triggering are employed, the Exposure Complete and Missed Acquisition bits of the AcqStatusRegister will still be active.

Inspection Results Attributes

When an image is acquired as a result of an acquisition trigger, it is placed in a queue for inspection. As the inspection is running on the image, the Inspecting bit of the InspectionStatusRegister is set. Once the inspection is completed, the Inspecting bit is cleared and the Inspection Completed bit is toggled.

The BufferResultsEnable attribute determines how inspection results are handled in the Vision Object. If the BufferResultsEnable attribute is set to False, then the inspection results are immediately placed into the InspectionResults attribute.

If the BufferResultsEnable attribute is set to True, then the previous inspection results remain in the InspectionResults attribute until they are acknowledged by setting the InspectionResultsAck attribute to True. Once the Results Valid bit is cleared, the InspectionResultsAck attribute should be set to False to allow new results to be placed in to the InspectionResults attribute. This can be used to establish a handshake to obtain results between the Vision Object and the client.

Behavior of InspectionStatusRegister

Inspection Status Register Bit Bit Name Results If Buffering Is Disabled Results If Buffering Is Enabled
0 Inspecting Set when inspecting an image. Set when inspecting an image.
1 Inspection Completed Toggled on completion of an inspection. Toggled on completion of an inspection.
2 Results Buffer Overrun Always cleared. Set when inspection results could not be queued because the client has failed to acknowledge a previous result. Cleared when the inspection result is successfully queued.
3 Results Valid Cleared when an inspection begins; set when an inspection is completed. Set when new results are placed in the InspectionResults attribute. Stays set until the results are acknowledged by setting the InspectionResultsAck attribute to True.
4 Job Pass* Set when an inspection is completed and the Job Pass/Fail cell indicates pass; otherwise it remains cleared.
Note: The Job Pass bit will be valid prior to toggling the Inspection Completed bit.

Set when new results are placed in the InspectionResults attribute and the Job Pass/Fail cell indicated pass for that result set; otherwise it remains cleared. The state will not change until the results are acknowledged by setting the InspectionResultsAck attribute to True, at which time the bit will be cleared.

Note: The Job Pass bit will be valid prior to the Results Valid bit being set.
*Job Pass bit is only included in Major Revision 10 and later.

Job Attributes

The Vision Object can load jobs stored in the non-volatile flash memory of an In-Sight vision system by setting the JobID and JobName attributes. If the load fails, the set operation will also fail.

Vision Object Services

Common Services

The Vision Object provides the following Common Services:

Service Code Service Name Description of Service
05 Hex Reset Resets the Vision Object
0E Hex Get_Attribute_Single Returns the contents of the specified attribute.
10 Hex Set_Attribute_Single Modifies an attribute value.

Reset Service

The Reset Service will reset and disable the acquisition triggering system in the Vision Object. It will also disable and clear the inspection results buffering system in the Vision Object.

Object Specific Services

The Vision Object provides the following Object Specific Services:

Service Code Service Name Description of Service
32 Hex Acquire Triggers a single acquisition.
33 Hex Reserved Deprecated.
34 Hex SendNativeCmd Sends a Native Mode command to the In-Sight vision system.
35 Hex GetInspectionResults Gets the InspectionResults attribute.
36 Hex Transfer User Data Transfers data into a portion of the User Data Holding Buffer. For more information, see User Data Holding Buffer.
37 Hex Set User Data Indicates to the vision system that it should latch the User Data Holding Buffer into the User Data field to give the In-Sight access to the user data.

Acquire Service

The Acquire Service of the Vision Object will cause an acquisition to be triggered, 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.

If the command fails, the Acquire Service will return the vendor specific error code 1F.

SendNativeCmd Service

The SendNativeCmd Service sends any documented Native Mode command string to the In-Sight vision system. The request data for the SendNativeCmd should include the Native Mode command string that is to be sent to the In-Sight vision system; the reply data will contain the string result of the Native Mode command. For more information, see Native Mode Communications.

SendNativeCmd Request Data Format

Name Type Description
Command STRING The Native Mode command to process.

SendNativeCmd Response Data Format

Name Type Description
Result STRING The string result of the Native Mode command.

If the command fails, the service will return one of the following vendor specific error codes:

Error Code Description Native Mode Return Code
1 Bad Command -
4 No Answer - The system is too busy.  
100 Command Failed 0
101 Command Cannot Be Executed -1
102 -2
103 -3
104 -4
105 -5
106 -6

GetInspectionResults Service

The GetInspectionResults Service (code 0x35) reads data from the InspectionResults attribute of the Vision Object.

GetInspectionResults Request Data Format

Name Type Description
Size UINT The number of bytes of the InspectionResults attribute to read.
Offset UINT The offset into the InspectionResults attribute. This specifies the first byte of the InspectionResults attribute to read.

GetInspectionResults Response Data Format

Name Type Description
Data Array of BYTE The InspectionResults attribute data.

Transfer User Data Command

This command is used to transfer data into a portion of the User Data Holding Buffer. The User Data Holding Buffer will be latched to the User Data field when the Set User Data command is issued.

Request Format

Name Type Description
Size UINT The number of bytes of the User Data field to write.
Offset UINT The offset into the User Data field.
Data Array of BYTE User Data to write into the User Data field.

Set User Data Command

This command is used by the PLC to indicate to the vision system that it should latch the User Data Holding Buffer into the User Data field to give the In-Sight access to the user data.

EtherNet/IP Functions

These functions are used to send and receive data between the In-Sight Explorer spreadsheet and the EtherNet/IP stack for In-Sight vision systems running In-Sight 4.x.x and earlier firmware:

EtherNet/IP Communications

These topics provide information and steps for configuring and utilizing EtherNet/IP and In-Sight vision systems: