Get Data from an In-Sight Vision System
To get data from an In-Sight vision system to a ControlLogix PLC, the data must be pushed into the EtherNet/IP stack by using the
This function takes a buffer of data created by the
When multiple inspection results need to be sent to the PLC, the results can be buffered in the vision system and sent over individually by using the ResultsValid and InspectionResultsAck bits in the PLC. To enable the buffering of inspection results, set the BufferResultsEnable bit in the control block.
-
Insert these functions into the spreadsheet:
-
Count
-
Rand
-
EditInt
-
Sum
Set the parameters of the Sum function as a cell reference to the sum of the value returned by Rand and EditInt functions.
-
- Right-click an empty cell and insert the FormatOutputBuffer function into the spreadsheet.
- From the FormatOutputBuffer dialog, click the Add button. This initiates the cell selection mode. Select the cell with the Sum function.
- From the FormatOutputBuffer dialog, use the Data Type dropdown menu to change the Data Type to 32 bit floating point.
-
From the FormatOutputBuffer dialog, click on the Add button again. This initiates cell selection mode. Select the cell with the Count function.
- Close the FormatOutputBuffer property sheet by clicking the OK button.
-
Right-click an empty cell and insert the WriteResultsBuffer function into the spreadsheet. Set the Buffer parameter of the WriteResultsBuffer function as a cell reference to the recently created FormatOutputBuffer function.
- In RSLogix, go to Offline mode.
-
Within RSLogix, right-click on the Data Types > User-Defined folder and select New Data Type from the menu.
-
Give the new data type a descriptive name and add two floating point values to the Members list.
-
Next, add a new tag to the Controller Tags of the project, using the user-defined data type.
-
Add a COP instruction to the MainRoutine ladder logic program.
Note: The Length field is the number of the input structures that are copied to the Dest field in the COP. - Place the In-Sight vision system Online.
-
In RSLogix, click the dropdown arrow on the Offline button, and select Download.
-
After this program has been downloaded to the ControlLogix PLC, the data from the Random and Acquisition Counter spreadsheet cells now appears in the InSight_Top_Input tag in the floating point format.