DataWriter
This simulation component enables writing of user-defined data to a 3D object such as an RFID or QR-code writer.
When to use
Use this simulation component if you want to write user-defined data to a 3D object such as an RFID or QR-code writer.
To read data from a 3D object, use the DataReader simulation component.
How to use
Add this simulation component from the simulation component library.
Define the 3D object, which acts as the data writer 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 Writer
input gets triggered, the DataWriter simulation component writes the input Data
to the nearest object to a specific identifier Id
.
Note
The ray only detect 3D objects, which are part of the physical simulation.
That means, only 3D objects whose Rigid Body Behavior
is not equal to None
can interrupt the light ray.
Parameters
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.
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
Writer
An input that executes the write command. Data will be written to the detected 3D object.
Data
An input indicating the data which should be written on the detected 3D object. The datatype can be of any type.
Clear
An input that clears the data from a detected 3D object.
Example
In this example, a data writer device writes QR-Codes to dynamic boxes which are moving along a conveyor.
The DataWriter simulation component is triggered by a PLCConnector simulation component and writes the data with Id
"0".