# 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 te contents of the specified attribute.
10 Hex | Set_Attribute_Single | Modifies the value of the specified attribute.

### Reset Service

The Reset Service resets and disables the acquisition triggering system in the Vision Object. The Reset Service also disables and clears 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 Sevice
--- | --- | ---
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.
37 Hex | Set User Data | Prompts the vision system to latch the User Data Holding Buffer into the User Data filed, giving the In-Sight vision system access to the user data.

### Acquire Service

The Acquire Service of the Vision Object causes an acquisition to be triggered if the acquisition system is ready to acquire an image. If the acquisition cannot be triggered, the Missed Acquisition bit of the AcqStatusRegister is set until the next successful acquisition.

If the command fails, the Acquire Service returns a vendor specific error code 1F.

### SendNativeCmd Service

The SendNativeCmd (0x34) service sends any documented Native Mode command string to the In-Sight vision system. The request data for the SendNativeCmd must include the Native Mode command string to be sent to the vision system. The response data contains the string result of the Native Mode command. For more information, see Native Mode Commands.

### 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 returns 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 | Specifies the first byte of the InspectionResults attribute to read.

### GetInspectionResults Response Data Format

Name | Type | Description
--- | --- | ---
InspectionResults | STRUCT of | The last inspection results.
InspectionID | UINT | Inspection counter.
InspectionResultCode | UINT | Inspection result code set in the WriteResultsBuffer function.
InspectionResults | ARRAY of BYTE | Results from the last inspection.

### 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 is latched to the User Data field when the Set User Data command is issued.

### Transfer User Data Command Request Format

Name | Type | Description
--- | --- | ---
Size | UINT | The number of bytes of the User Data field to write.
Offset | UINT | Specifies the first byte of the User Data field to write.
Data | ARRAY of BYTE | User Data to write into the User Data field.

### Set User Data Command

The PLC uses this command to prompt the vision system to latch the User Data Holding Buffer into the User Data field, giving the vision system access to the user data.

If this additional User Data handshake is not necessary, and the communications behavior is the same as with the assembly I/O, the Set User Data command can be bypassed using the following procedure:

1. Open the In-Sight Spreadsheet, and select your vision system.

2. Open the Industrial Ethernet utility.

3. In the Select Protocol dropdown, select EtherNet/IP.

4. Check the Enable User Data Bypass checkbox.

5. Click Restart to close the Industrial Ethernet Configuration dialog and reboot your vision system.

### EtherNet/IP Functions

The following Spreadsheet functions can send or receive data between the In-Sight Spreadsheet and the EtherNet/IP stack:

- ReadUserDataBuffer

- WriteResultsBuffer

- GetBufferData