Configure In-Sight Vision Systems for Modbus TCP Communications

This topic describes how to connect an In-Sight vision system running firmware version 5.3.0 or later to a PLC using Modbus TCP communications.

Note:
  • This topic covers Modbus TCP communications for the In-Sight vision systems/sensors running firmware version 5.3.0 or later. For a complete list of models and supported firmware versions, see Firmware Versions.
  • Refer to Modbus TCP Communications for available Modbus TCP implementations on different In-Sight firmware versions.
  • Modbus TCP Factory Interface (5.3.0 or later) contains the detailed information about mapping the In-Sight vision system's inputs and outputs into process memory.

Establish Modbus TCP Communications

Before Modbus TCP communications can be established with an In-Sight vision system, the vision system must be configured to enable Modbus TCP Server, using the Network Settings dialog of the vision system. Once enabled, the Modbus TCP Server Settings dialog is used to configure the connection to PLC.

  1. Open In-Sight Explorer and connect to the desired In-Sight vision system.
  2. From the Sensor menu, open the Network Settings dialog.
  3. In the Industrial Ethernet Protocols section of the dialog, select Modbus TCP Server and press the Settings button to launch the Modbus TCP Server Settings dialog.
  4. Configure the Max Connections and Idle Timeout controls.
  5. Restart the In-Sight vision system, and the Modbus TCP Server service will be enabled upon completion of the power cycle.

Configure the In-Sight Vision System to Receive Image Acquisition Triggers

It is possible to trigger the vision system to acquire images from the PLC. Setting the Trigger parameter in the AcquireImage function to Industrial Ethernet enables the PLC to trigger the vision system when Modbus TCP Server communication is enabled.

  1. Open the AcquireImage function's property sheet.
  2. Set the Trigger parameter to Industrial Ethernet.
  3. Place the In-Sight vision system Online.
  4. An In-Sight vision system can be triggered by directly manipulating the Trigger Enable and Trigger bits in the Vision Control Block, or by monitoring the Trigger Ready, Trigger Ack and Missed Acq bits in the Vision Status Block.

    Note: The Modbus TCP Factory Interface (5.3.0 or later) topic contains detailed information about mapping the In-Sight vision system's inputs and outputs into process memory.

Get Data From an In-Sight Vision System

In order to get data from the In-Sight Explorer spreadsheet to a PLC, the data must be pushed into the Modbus TCP stack by using the WriteResultsBuffer function. This function takes a buffer of data created by the FormatOutputBuffer function and writes the data to the configured Modbus TCP stack. The PLC can then read the data with Modbus TCP read commands.

  1. 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 FormatOutputBuffer function, from the right pane, to insert it into the spreadsheet.
  2. From the FormatOutputBuffer dialog, click on the Add button. From the Select Output Data dialog, select the data item to output.
  3. If there is additional data to be sent, again, from the FormatOutputBuffer dialog, click on the Add button. Select the additional data to transfer.
  4. Close the FormatOutputBuffer 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 WriteResultsBuffer function, from the right pane, to insert it into the spreadsheet.
  6. Set the WriteResultsBuffer function's Protocol parameter to 3 = Modbus TCP Server, and the Buffer parameter as a cell reference to the recently created FormatOutputBuffer function's Buffer data structure.
  7. Optionally, set the Result Code parameter as a cell reference to a cell in the spreadsheet to retrieve the result code with the inspection results.

Send Data to an In-Sight Vision System

In order to send data from the PLC to the In-Sight Explorer spreadsheet, the data must be pulled from the Modbus TCP stack by using the ReadUserDataBuffer function. This function takes the data format created within the FormatInputBuffer function, reads the data received from the PLC, and formats this data into the In-Sight Explorer spreadsheet.

Note: In order to trigger the In-Sight vision system to read the user data from the PLC, the Set User Data bit in the Vision Control Block must be triggered from the PLC.
  1. 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.
  2. From the FormatInputBuffer dialog, click on the Add button and add the data items desired to the list.
  3. Close the FormatInputBuffer dialog by clicking the OK button.
  4. 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 .
  5. Set the ReadUserDataBuffer function's Buffer parameter as a cell reference to the recently created FormatInputBuffer function's Buffer data structure.
  6. Set the ReadUserDataBuffer function's Protocol parameter to 3 = Modbus TCP Server.

  7. Once the functions have been implemented, place the In-Sight vision system Online to test the configuration.