PLC Reader¶
Class: PLCReaderBlockV1
Source: inference.enterprise.workflows.enterprise_blocks.sinks.plc.v1.PLCReaderBlockV1
The PLC Reader block reads tag values from a PLC and makes them available to the rest of the Workflow.
This block can reach the PLC three ways, selected by Connection mode in the advanced section:
- Roboflow PLC Relay (default): sends tags to the on-device PLC Relay service over HTTP. The relay owns the protocol (Allen-Bradley, Modbus, or Siemens S7), the device IP, and the tag schema, so the same Workflow runs unchanged across devices. Tags are sent in a single batch request per frame over a persistent keep-alive connection (high FPS).
- Direct (EtherNet/IP): connects straight to the PLC with
pylogix. Tags are addressed by name (e.g.Program:MainProgram.Tag1). - Direct (Modbus TCP): connects straight to the PLC with
pymodbus. Tags are addressed asarea:address(holding:100,coil:0,input:5,discrete:2); a bare number defaults to a holding register.
Address is the relay host in relay mode, or the PLC's IP address in either direct mode. The advanced section exposes the relevant extras per mode (relay port, processor slot, Modbus port / unit id).
On any failure the error is logged and that tag's entry in the output is set to
"ReadFailure" / "WriteFailure"; error_status is True if any tag failed.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/plc_reader@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
tags_to_read |
List[str] |
PLC tags to read, entered comma-separated (e.g. camera_msg, sku_number). Relay and Direct (EtherNet/IP) modes use tag names. Direct (Modbus TCP) mode uses area:address, where area is holding, input (read-only), coil, or discrete (read-only); a bare number means a holding register (100 = holding:100). Example for Modbus: holding:100, coil:0.. |
✅ |
ip_address |
str |
Address of the PLC Relay (relay mode) or of the PLC itself (direct modes). A bare host/IP is accepted; in relay mode a full URL may also be given.. | ✅ |
connection_mode |
str |
How to reach the PLC: through the on-device PLC Relay, or directly over EtherNet/IP or Modbus TCP.. | ❌ |
relay_port |
int |
Port of the PLC Relay service (relay mode).. | ✅ |
request_timeout |
int |
Read timeout in seconds for each request to the PLC Relay service (relay mode). This must cover the relay's synchronous PLC batch transaction, which can run for seconds against a slow or disconnected PLC (especially Modbus / S7); if it is exceeded the request is abandoned and every tag in the batch is reported as a failure. Raise it for slow or flaky PLCs. (Connecting to the relay itself uses a separate short timeout, so a down relay still fails fast.). | ✅ |
processor_slot |
int |
EtherNet/IP processor slot of the PLC (direct EtherNet/IP mode).. | ✅ |
modbus_port |
int |
Modbus TCP port of the PLC (direct Modbus mode).. | ✅ |
modbus_unit_id |
int |
Modbus unit / slave id of the PLC (direct Modbus mode).. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to PLC Reader in version v1.
- inputs:
Google Gemma API,MoonshotAI Kimi,Image Stack,Dimension Collapse,Anthropic Claude,Anthropic Claude,Google Gemini,Qwen 3.6 API,Clip Comparison,OpenAI,Google Gemini,PLC EthernetIP,Buffer,Clip Comparison,Florence-2 Model,Dynamic Zone,Qwen-VL,Detections List Roll-Up,Size Measurement,OpenAI,Google Gemini,Roboflow Visual Search,Google Gemma,Llama 3.2 Vision,Qwen 3.5 API,Anthropic Claude,Llama 3.2 Vision,Camera Focus,OpenRouter,OpenAI,PLC ModbusTCP,Florence-2 Model,MoonshotAI Kimi,Motion Detection - outputs:
Polygon Zone Visualization,Time in Zone,Trace Visualization,Line Counter Visualization,Image Stack,Multi-Label Classification Model,Camera Calibration,Per-Class Confidence Filter,Icon Visualization,SIFT Comparison,Color Visualization,Single-Label Classification Model,Perspective Correction,Microsoft SQL Server Sink,Corner Visualization,Roboflow Custom Metadata,Twilio SMS Notification,Halo Visualization,Dynamic Zone,Keypoint Detection Model,Email Notification,Roboflow Vision Events,Halo Visualization,PTZ Tracking (ONVIF),Stability AI Inpainting,Object Detection Model,Classification Label Visualization,Event Writer,Background Color Visualization,Mask Visualization,Ellipse Visualization,Email Notification,Reference Path Visualization,Twilio SMS/MMS Notification,Label Visualization,Text Display,OPC UA Writer Sink,Dot Visualization,Polygon Visualization,Crop Visualization,Circle Visualization,Template Matching,BoT-SORT Tracker,Model Monitoring Inference Aggregator,Gaze Detection,Segment Anything 2 Model,Motion Detection,Heatmap Visualization,Single-Label Classification Model,Blur Visualization,Object Detection Model,Instance Segmentation Model,SAM 3 Interactive,PLC EthernetIP,Detections Consensus,Keypoint Visualization,Webhook Sink,Bounding Box Visualization,Multi-Label Classification Model,Instance Segmentation Model,Google Gemini,Slack Notification,Triangle Visualization,Roboflow Dataset Upload,SAM 3,Time in Zone,Instance Segmentation Model,Pixelate Visualization,Keypoint Detection Model,Instance Segmentation Model,Roboflow Dataset Upload,PLC Writer,Multi-Label Classification Model,Object Detection Model,Time in Zone,MQTT Writer,Keypoint Detection Model,Polygon Visualization,SAM 3,Model Comparison Visualization,Single-Label Classification Model,Roboflow Asset Library Attributes
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
PLC Reader in version v1 has.
Bindings
-
input
tags_to_read(list_of_values): PLC tags to read, entered comma-separated (e.g.camera_msg, sku_number). Relay and Direct (EtherNet/IP) modes use tag names. Direct (Modbus TCP) mode usesarea:address, where area isholding,input(read-only),coil, ordiscrete(read-only); a bare number means a holding register (100=holding:100). Example for Modbus:holding:100, coil:0..ip_address(string): Address of the PLC Relay (relay mode) or of the PLC itself (direct modes). A bare host/IP is accepted; in relay mode a full URL may also be given..relay_port(integer): Port of the PLC Relay service (relay mode)..request_timeout(integer): Read timeout in seconds for each request to the PLC Relay service (relay mode). This must cover the relay's synchronous PLC batch transaction, which can run for seconds against a slow or disconnected PLC (especially Modbus / S7); if it is exceeded the request is abandoned and every tag in the batch is reported as a failure. Raise it for slow or flaky PLCs. (Connecting to the relay itself uses a separate short timeout, so a down relay still fails fast.).processor_slot(integer): EtherNet/IP processor slot of the PLC (direct EtherNet/IP mode)..modbus_port(integer): Modbus TCP port of the PLC (direct Modbus mode)..modbus_unit_id(integer): Modbus unit / slave id of the PLC (direct Modbus mode)..
-
output
tag_values(dictionary): Dictionary.error_status(boolean): Boolean flag.
Example JSON definition of step PLC Reader in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/plc_reader@v1",
"tags_to_read": [
"camera_msg",
"sku_number"
],
"ip_address": "127.0.0.1",
"connection_mode": "relay",
"relay_port": 8007,
"request_timeout": 10,
"processor_slot": 0,
"modbus_port": 502,
"modbus_unit_id": 1
}