Skip to content

Closing the Loop: Integrating Detections with Production Systems

Matroid Identifying a Torquing Sequence

Allen Cheung | November 7th, 2025

Matroid Identifying a Torquing Sequence

Introduction

At Matroid, we believe computer vision shouldn’t just analyze — it should act. Our Edge devices are deployed in high-throughput manufacturing environments to detect product defects in real time. But what happens next? 

Think of it like giving eyesight and reflexes to a production line. It’s not enough to spot the problem; the system also needs a “muscle” to react instantly, whether that’s diverting a defective product, stopping a machine, or simply turning on a warning light.

Image of an Allen Bradley PLC being integrated into a Matroid Edge Appliance

In this post, we dive into how Matroid’s computer vision detections can be tightly integrated with industrial Programmable Logic Controllers (PLCs) to close the loop, translating computer vision detections into immediate, physical responses on the production floor. 

Specifically, we’ll walk through a demo integration between a Matroid Edge appliance and an Allen-Bradley ControlLogix PLC via the EtherNet/IP protocol.

What are PLCs?

Programmable Logic Controllers (PLCs) are industrial computers designed for real-time control of machinery and manufacturing processes. Originally developed as a replacement for hard-wired relay logic, PLCs allow engineers to program flexible automation sequences using languages like Ladder Logic. 

Here are some of the key advantages of PLCs:

  • Reduced wiring complexity: Logic is now implemented in software rather than physical relays.
  • Modularity and scalability: I/O modules and communication cards can be easily added or replaced.
  • Real-time performance: PLCs are optimized for deterministic control cycles (typically 10–1000 ms).

PLCs continuously read inputs from sensors, execute control logic based on their program, and update outputs like motors, valves, actuators, and indicator lights — all in deterministic, repeatable cycles. Inputs might include limit switches, temperature sensors, or proximity detectors, while outputs could involve energizing a motor, activating a stack light, or adjusting a variable-frequency drive (VFD).

For a non-engineering analogy, you can picture a PLC as the “traffic controller” of the factory. It listens to all the signals (like cars at intersections), makes a decision based on its rules, and then directs what happens next (e.g., go, stop, reroute). This predictability makes them trusted workhorses in manufacturing.

Architecture

Below is the example architecture for integrating Matroid Edge devices with Allen-Bradley PLCs via EtherNet/IP:

Detailed graphic of how Matroid's Edge Pro integrates into a ControlLogix PLC
  1. The Matroid Edge Pro appliance, running Matroid On-Prem software, receives live video streams from connected industrial cameras via a Power-over-Ethernet (PoE) switch. These streams are analyzed in real time using trained computer vision detectors deployed on the Edge device. 

In a real-world setting, this might mean cameras watching thousands of soda bottles per minute as they fly down a conveyor belt. When one is missing a cap or has a crack, the computer vision detector flags it, and the PLC steps in to reroute or reject the defective item.

  1. The Matroid  watch_monitoring  API continuously monitors for defect detections. Once a new detection event is captured, the relevant metadata is transmitted over EtherNet/IP to the ControlLogix PLC.
  1. The PLC receives this data through pre-defined controller tags. These tags are then updated dynamically based on new Matroid detections. In response, the PLC executes Ladder Logic routines that control physical hardware on the line, such as illuminating a stack light, adjusting the VFD speed of a conveyor lane, or marking a product for rejection. 

Tag Structure and PLC Logic

To standardize communication, Matroid detection data can be sent to a custom PLC tag (i.e MATROID_DETECT configured as a DINT[4] array). Here’s how each index is used:

Showing PLC Programming and Matroid Integration

Additional tags (NewDetection, RedLightTimer, LastTriggerID) are used within the PLC to control outputs and prevent the same detection from triggering responses multiple times. Here is an example Ladder Logic routine created in RSLogix5000 that turns on a connected stacklight based on new Matroid detections:

Illustrating more PLC Programming and Matroid Integration for a Stack Light
  • Rung 0: If MATROID_DETECT[0] is not equal (NEQ)  to LastTriggerID (meaning that it is a unique new detection), then we energize the output tag  NewDetection, setting it to True. Otherwise, if MATROID_DETECT[0] is equal to LastTriggerID, then the NewDetection tag remains False.
  • Rung 1: If NewDetection is True (XIC), then we start the  RedLightTimer for 5  seconds.  
  • Rung 2: If RedLightTimer.TT is True  (XIC), meaning the Timer is actively counting, then we energize the DC output tag Local:4:O.Data.0, which turns on the red LED on the stacklight.
  • Rung 3: Once the timer is finished,  which is when  RedLightTimer.DN is True True (XIC),  then we store the detection ID in the LastTriggerID tag to avoid duplicate detections.

This “tagging” method is essentially a shared vocabulary between the vision system and the PLC. By standardizing the way data is passed, the system avoids confusion, like making sure everyone in a meeting is using the same terminology before making a decision.

Putting it All Together

Putting it All Together

First, Matroid surfaces a new defect detection.

Then, a watch-monitoring script running on the Edge box detects the new event and sends the data array to the PLC via the EtherNet/IP protocol.

    Immediately, we see that the respective tags are updated in RSLogix5000.

    Finally, the program is active and is running as expected. The Red LED on the stacklight lights up for 2 seconds as soon as there is a new defect detection!

       

    In practice, that tiny flash of light represents a huge leap. The computer vision system has not only spotted the defect but successfully triggered a real-world action within milliseconds. Scale this up across hundreds of production lines, and you can see how “closing the loop” helps factories reduce waste, maintain quality, and keep operations running smoothly without constant human intervention.

    About the Author

    Allen Cheung is a Deep Learning Field Engineer at Matroid. He studied Computer Science at UCLA and UC San Diego, and enjoys playing badminton, drawing cars, and playing the piano in his free time. 

    Download Our Free

    Step-By-Step Guide

    Building Custom Computer Vision Models with Matroid

    Dive into the world of personalized computer vision models with Matroid's comprehensive guide – click to download today