Computer vision answers · Manufacturing

How do I send computer vision results to a PLC or operator screen?

Without a custom bridge between the camera and the line.

Short answer

Train a model on your line images with Roboflow for free, then build a Workflow that turns each prediction into a value, such as a reject flag or a defect count, and writes it to a PLC tag. Your HMI or SCADA screen reads that tag like any other, so operators see results where they already look. Send one simple value per tag, such as a BOOL reject flag or a DINT count, so the PLC logic and HMI screens only need a new tag, not a rewrite.

Roboflow agent · free to start

Skip the setup. Describe your images.

Describe your images and what you need to find. The agent sets up labeling, training and deployment with you.

Key facts

What you need
A trained model, an edge device, and a PLC or HMI on the plant network
What you get
Reject flags, counts and pass or fail results as live PLC tags
Connects to
Allen-Bradley, Siemens S7, Modbus TCP, OPC UA and MQTT
Runs on
Your edge device on the plant network, on the Enterprise plan
An AI vision system inspects water bottles on a conveyor belt, showing five bottles labeled "cap ok" in green and one with a "missing cap" labeled in red.

How to send vision results to a PLC or HMI, step by step

Six steps from images of your line to results on the operator's screen.

  1. Connect Roboflow to your coding agent, ChatGPT or Codex

    Add the Roboflow MCP server to Claude, Cursor or Gemini CLI, or install the Roboflow plugin in ChatGPT or Codex. Your assistant can then upload and auto-label images, start training, build the Workflow and run the model from a prompt, at no extra cost beyond your Roboflow plan.

  2. Label images from the line camera

    Collect images from the camera that will run the check, in the lighting and line speed you run at. Draw a box around each part or defect and give each its own class. Roboflow Annotate can pre-label images with SAM 3, so you correct boxes instead of drawing each one.

  3. Train a detection model

    Train an object detection model such as RF-DETR on your labeled images with Roboflow Train, and test it on images it has not seen before you connect it to the line.

  4. Set up an edge device with PLC Relay

    Register a device on the PLC network in Deployment Manager and add the PLC Relay service. Choose Allen-Bradley (EtherNet/IP), Modbus TCP or Siemens S7, enter the PLC address, and define each tag as BOOL, INT, DINT or REAL. Simulation mode lets you test without a PLC.

  5. Write each result to a PLC tag from the Workflow

    In a Workflow, add a Property Definition block that counts the detections, then a PLC Writer block that sends the count to a tag through the relay. Add one PLC Writer per tag, and run the Workflow on your camera stream with Roboflow Deploy on the edge device.

    JSON
    [
      {
        "type": "roboflow_core/property_definition@v1",
        "name": "defect_count",
        "data": "$steps.model.predictions",
        "operations": [{ "type": "SequenceLength" }]
      },
      {
        "type": "roboflow_core/plc_writer@v1",
        "name": "write_count",
        "tag": "defect_count",
        "value": "$steps.defect_count.output",
        "connection_mode": "relay",
        "ip_address": "127.0.0.1",
        "relay_port": 8007
      }
    ]

    Rather not write code? Ask the Roboflow agent to set this up for you

  6. Show the results on the operator screen

    Bind the new tags to your HMI screens, such as FactoryTalk View or Ignition Perspective, so operators see pass or fail status and counts next to the rest of the line. For SCADA screens, the OPC UA Writer Sink writes the same values to an OPC UA server, and the MQTT Writer publishes them to a broker.

Why 2 million engineers build on Roboflow

  • Label faster

    Auto-label with SAM 3 or your own model, then fix the misses instead of drawing every box.

  • RF-DETR

    Roboflow’s open-source real-time detection model, built for accuracy (opens in a new tab) on small objects.

  • Logic built in

    Counting, zones, tracking and alerts are ready-made Workflow blocks, so there is less code to write.

  • Your model, your weights

    Use your trained weights on every plan, including free, through the open-source Inference package.

  • Run it anywhere

    Self-host on a workstation, Docker, an on-prem GPU or an edge device, or call the cloud API.