# Writing Data to the PLC

In order to send data from the Siemens PLC to the In-Sight spreadsheet, the data must be pulled from the PROFINET stack by using the ReadUserDataBuffer function. ReadUserDataBuffer function takes the data format created within the FormatInputBuffer function, reads the data from the data area of the PROFINET User Data module, and formats this data into the In-Sightspreadsheet. The PLC receives data at every update cycle.

## Workflow example

1. Open the AcquireImage cell and set the Trigger parameter to Continuous.
2. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click on the Input/Output category, then double-click the FormatInputBuffer function, from the right pane, to insert it into the spreadsheet.

3. From the FormatInputBuffer dialog, click on the Add button and add a 32-bit float and a 32-bit integer to the list.

4. Close the FormatInputBuffer dialog by clicking the OK button.
5. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click on the Input/Output category, then double-click the ReadUserDataBuffer function from the right pane, to insert it into the spreadsheet .
6. Set the ReadUserDataBuffer function's Protocol parameter to PROFINET, and the Buffer parameter as a cell reference to the recently created FormatInputBuffer function's Buffer data structure.
7. Add GetBufferData(cell,index) to the spreadsheet based on the fields you specified in the FormatInputBuffer function.
8. Set the In-Sight vision system Online.