DataReader
This simulation component enables reading of user-defined data from a 3D object like an RFID or QR-code reader.
When to use
Use this simulation component if you want to read user-defined data from a 3D object like an RFID or QR-code reader.
To write data to a 3D object, use the DataWriter simulation component.
How to use
Add this simulation component from the simulation component library. Define the 3D object, which acts as the data reader by selecting a 3D object either in the 3D View
window or in the Assembly Structure
window using the select button in the Object3D
property. Then, configure a light ray, which is used to detect 3D objects. How to configure a light ray in detail can be found at LightBarrier. If the Read
input gets triggered, the DataReader simulation component outputs the data of the nearest object. If no object is detected or there is no data available the component outputs a defined DefaultOutputValue
.
Note
The ray can only detect 3D objects, whose Rigid Body Behavior
is not equal to None
.
Parameters
DefaultOutputValue
Indicating a value the reader outputs when no data are available.
Id
A value indicating an Id which identifies reader and writer pairs. Readers can only read data which have been written by writers with the same Id.
ReadingBehavior
A value indicating the behavior of the reading process. Possible values are:
Value | Description |
---|---|
On Input Changed | The output is set if reading trigger gets enabled. |
Rising Edge | The output is set during rising reading trigger, otherwise the default output is set. |
Falling Edge | The output is set during falling reading trigger, otherwise the default output is set. |
GlobalDirection
Indicates the direction of the light ray in the global coordinate system.
GlobalOrigin
Indicates the origin of the light ray in the global coordinate system.
Length
Indicates the length of the light ray in m, which is used to detect 3D objects.
Object3D
Indicates the 3D object the light ray is attached to. If not set, the reference of the light ray is the world origin.
Inputs
Read
An input that executes the read command. Data will be read from the detected 3D object.
Outputs
Result
An output that indicates the data read from the detected 3D object. The data can be of any type.
Example
In this example, a data reader device reads QR-Codes from dynamic boxes which are moving along a conveyor.
The DataReader simulation component is triggered by a PLCConnector simulation component and outputs the data with Id
"0" on the rising edge of the input signal.
The output datatype is of the same type that has been written to the 3D object by the DataWriter simulation component before.