# Send Data to an In-Sight Vision System

To send data from the ControlLogix PLC A Programmable Logic Controller is a ruggedized computer that you can use for automating processes or even an entire production line. to the spreadsheet, the data must be pulled from the EtherNet/IP stack by using the ReadUserDataBuffer function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications.. This function takes the data format created within the FormatInputBuffer function and reads the data from the data area of the Ethernet/IP Output Assembly (output from the network), and formats this data into the spreadsheet. This data is received from the PLC every RPI cycle and the corresponding spreadsheet data is updated only when the spreadsheet executes.

1. Insert the FormatInputBuffer function into the spreadsheet.

2. From the FormatInputBuffer dialog, click on the Add button and add two 32 bit floating point to the list.

3. Close the FormatInputBuffer property sheet by clicking the OK button.

4. Right-click an empty cell and insert the ReadUserDataBuffer function into the spreadsheet. Set the Buffer parameter of the ReadUserDataBuffer function as a cell reference to the recently created FormatInputBuffer function.

5. Right-click an empty cell and insert the GetBufferData function into the spreadsheet. Set the ReadBuffer parameter of the GetBufferData function as a cell reference to the recently created ReadUserDataBuffer function. The index parameter of the GetBufferData function determines which data value in the FormatInputBuffer to reference, for example:

   - If you set the index parameter to 0, the FormatInputBuffer function returns the first floating-point data value.

   - If you set the index parameter to 1, the FormatinputBuffer function returns the second floating-point data value.

6. In RSLogix, go to Offline mode.

7. Within RSLogix, right-click on the User-Defined >Data Types folder and select New Data Type... from the menu.

8. Give the new data type a descriptive name and add two floating point values to the Members list.

9. Next, add a new tag to the Controller Tags of the project, using the user-defined data type.

10. Add a COP instruction to the MainRoutine ladder logic program.

11. Place the In-Sight vision system Online.

12. In RSLogix, click the dropdown arrow on the Offline button, and click Download.

13. Open the Controller Tags dialog and change the values of the InSight_Top_Output.Data1 and InSight_Top_Output.Data2. After changing the InSight_Top_Out.Data1 and InSight_Top_Out.Data2 values in the PLC, set the SetUserData bit in the PLC and wait for the SetUserDataAck bit to be set and then clear the SetUserData bit. Once the ReadUserDataBuffer cell runs in the spreadsheet, the values are updated in the spreadsheet.