Repository navigation
Device DataReader
This page is generated from the Unity twin. Published from
_docs/context/devices/datareader.md— edit it there, not here. Changes made in the wiki are overwritten on the next sync.
A code reader or camera: on command, reads a number carried by the part in front of it and hands it to the PLC.
Twin device type · twin FB FB_Camera · 3 instances in FG_01, FG_02, FG_05 · Unity component Preliy.Demo.DataReader
The station that answers "which part is this?". In the real cell it is a camera or a barcode scanner; the part carries an identity, and the reader turns it into a number the control program can act on. This machine has three of them — one identifies, one inspects, one checks a cap.
Open Commissioning ships a data reader of its own; this project uses a variant of it that adds the PLC handshake below.
| Symbol | Meaning |
|---|---|
Control.0 |
Enable |
Control.1 |
Trigger — read now |
Status.0 |
Enabled, echoed back |
Status.1 |
Triggered, echoed back |
StatusData |
The value read, as a 64-bit number |
The Unity component drives exactly these. The result-valid and result-OK bits a control program waits on are added by the reader's function block in the simulation project, on top of this — so the full protocol a PLC sees is the one written on the device's own page and in the FG_01 behaviour contract.
The reader is a volume in the scene, like a sensor. A part carries named data with it, and the reader is configured with the name of the field to read. On a trigger it looks up that field on whatever part is currently in front of it; dropping the trigger clears the result. If nothing is there, or the part carries no such field, the read fails and is logged — it does not invent a value.
A result is only meaningful while the part is still there. The value is cleared when the trigger drops or the part leaves, so a program that triggers and reads the answer three steps later may find it gone.
Signal — Enable, then trigger; reads back Ready, Busy, ResultValid and ResultOK. The twin echoes the two control bits and hands over the datum; the verdict is synthesised in OC_SIM FB_Camera.
There are 3 of them, in FG_01, FG_02, FG_05:
| Device | Twin PLC path | Group |
|---|---|---|
P_Camera |
MAIN.FG_01.P_Camera |
FG_01 |
P_Camera |
MAIN.FG_02.P_Camera |
FG_02 |
P_Camera |
MAIN.FG_05.P_Camera |
FG_05 |
The twin is master for structure, and that is all this page states. Which control function block each instance becomes, its process-image members and its published HMI struct is the control platform's own knowledge base:
- Beckhoff
- Siemens — no knowledge base published yet
Generated from DT_PSA_OPCV by _workflow/tools/build_wiki.py — 39 pages. Edit the source there; changes made here are overwritten.
Getting started
- Home
- Setup
- Using-The-Application
- How-It-Works
- PLC-Connectivity
- Engineering-Workflow
- Machine-Description
- Glossary
The machine
- Machine
- Machine-PLC-Symbols
- Machine-Provenance
- Machine-FG_01
- Machine-FG_02
- Machine-FG_03
- Machine-FG_04
- Machine-FG_05
- Machine-FG_System
- Machine-FG_Transport
Behaviour
- Behaviour-FG_01
- Behaviour-FG_02
- Behaviour-FG_03
- Behaviour-FG_04
- Behaviour-FG_05
- Behaviour-FG_System-Safety
- Behaviour-Gripper-Station-Reset
- Behaviour-State-Lamp
- Behaviour-Transport
Device types
- Device-Button
- Device-ControlBunker
- Device-Cylinder
- Device-DataReader
- Device-DrivePosition
- Device-DriveSimple
- Device-Lamp
- Device-LinkByte
- Device-Lock
- Device-PanelSampler
- Device-SensorBinary
- Device-SignalBinary
Control platforms
- Beckhoff TwinCAT 3
- Siemens TIA Portal — no wiki yet