# Send Data to an In-Sight Vision System

To send data from the ControlLogix PLC to the spreadsheet, the data must be pulled from the EtherNet/IP stack by using the ReadUserDataBuffer function. 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; the corresponding spreadsheet data is updated only when the spreadsheet executes.

1. Right-click an empty cell and 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 ReadUserDataBuffer function's Buffer parameter 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 GetBufferData function's ReadBuffer parameter as a cell reference to the recently created ReadUserDataBuffer function. The GetBufferData function's index parameter determines which data value in the FormatInputBuffer to reference. For example, if you set the index parameter to 0, the first floating-point data value in the FormatInputBuffer will be returned. If you set the index parameter to 1, the second floating-point data value in the FormatInputBuffer will be returned.

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 project's Controller Tags, using the user-defined data type, as shown in the example below.

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

11. Place the In-Sight vision system Online.

12. In RSLogix, click the drop-down 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 will be updated in the spreadsheet.