Skip to Main Content
Cognex Support Hub
Logo

How to Communicate to Beckhoff PLC with OPC UA with an In-Sight

Steps for communicating between a In-Sight camera and a Beckhoff PLC using OPC UA

09/14/2024

Question

I want to have my In-Sight transfer data back and forth to a Beckhoff PLC using OPC UA communications, how can I do this?

Answer

For this example, we will be using the following hardware:

PLC: CX9020

Camera: In-Sight 7802

Placeholder

Create a Project.

  1. Double click on the TwinCAT software. 

    Placeholder
  2. Create a new TwinCAT Project and add new items under PLC.

    Placeholder
  3. Choose to create a standard PLC project.

  4. Search PLC and then to add device.
  5. Double click on “SYSTEM”, then go to “Choose → Search[Ethernet] → Broadcast Search”. 

  6. Click “OK” button.

  7. Click “Add Route” button.

    Placeholder
  8. Put Password and then Click “OK” button.

  9. Click “Close“ button.

    Placeholder
    Placeholder
  10. If the following error message popped up, please click ”OK” button. 

    Placeholder

Install OPC UA Client Driver.

  1. Beckhoff PLC acts as Client, In-Sight camera acts as Server. When communicating to CX9020 with OPC UA, the Driver is needed. 

    Placeholder

Set settings on In-Sight camera.

  1. Go to “Sensor -> Network Settings…” 

    Placeholder
  2. Enable OPC UA Server. 

    Placeholder
  3. Create a job.

    Placeholder
  4. Set OPC Tag through right clicking on the cell and go into “Edit Symbolic Tag..," 

    Placeholder
  5. Add Tags, give them names and check on “Use OPC”. 

    Placeholder
  6. Change In-Sight Camera to Online mode.

    Placeholder

Set OPC Settings on PLC.

  1. Change to Config Mode. 

    Placeholder
  2. Right clicking on Device and choose “Add new items” on Solution Explorer panel. 

    Placeholder
    Placeholder
  3. Right clicking on “Client” and choose “Add new items”. 

    Placeholder
  4. Click “Reload” button. Choose “OPC UA Client” and then click “OK” button. 

    Placeholder
  5. Set IP address and port of In-Sight camera as follows then click “Select” button. 

    Placeholder
    Placeholder
  6. Click “Add Notes” button check all of Tags you need. 

    Placeholder
    Placeholder
  7. Build Solution.

    Placeholder
  8. Active Configuration. 

    Placeholder
  9. Check the tags you added. 

    Placeholder
  10. Click “Login” button to login PLC. 

    Placeholder
  11. Check the values of the Tags. 

    Placeholder

Related Resources