PLC Float Input Signal - Represents a floating-point input signal from PLC to simulation. More...

Public Member Functions | |
override void | SetStatusConnected (bool status) |
Virtual for setting the Status to connected. | |
override bool | GetStatusConnected () |
Virtual for getting the connected Status. | |
override byte[] | GetByteValue () |
override int | GetByteSize () |
override string | GetVisuText () |
Virtual for getting the text for the Hierarchy View. | |
override bool | IsInput () |
Virtual for getting information if the signal is an Input. | |
override void | SetValue (string value) |
Virtual for setting the value. | |
override void | SetValue (byte[] value) |
void | SetValue (int value) |
Sets the value as an int. | |
override void | SetValue (object value) |
Sets the value of the signal. | |
override object | GetValue () |
Gets the value of the signal. | |
void | SetValue (float value) |
Sets the value as a float. | |
void | Update () |
![]() | |
delegate void | OnSignalChangedDelegate (Signal obj) |
void | OnInspectValueChanged () |
bool | OnObjectDrop (Object reference) |
void | OnInspectedToggleChanged (bool arg0) |
string | GetSignalName () |
virtual void | OnToggleHierarchy () |
Virtual for toogle in hierarhy view. | |
void | Unforce () |
Unforces the signal. | |
void | DeleteSignalConnectionInfos () |
void | AddSignalConnectionInfo (GameObject behavior, string connectionname) |
bool | IsConnectedToBehavior () |
Returns true if InterfaceSignal is connected to any Behavior Script. | |
string | GetTypeString () |
Returns the type of the Signal as a String. | |
InterfaceSignal | GetInterfaceSignal () |
Returns an InterfaceSignal Object based on the Signal Component. | |
![]() | |
void | PreStartSim () |
Is called by the realvirtualController before the component is started. | |
void | StartSim () |
Is called by the realvirtualController to start or stop the component. | |
void | StopSim () |
Vector3 | DirectionToVector (DIRECTION direction) |
Transfers the direction enumeration to a vector. | |
DIRECTION | VectorToDirection (bool torotatoin, Vector3 vector) |
Transfers a vector to the direction enumeration. | |
float | GetLocalScale (Transform thetransform, DIRECTION direction) |
List< BehaviorInterfaceConnection > | UpdateConnectionInfo () |
List< Signal > | GetConnectedSignals () |
void | SetVisibility (bool visibility) |
Sets the visibility of this object including all subobjects. | |
List< BehaviorInterfaceConnection > | GetConnections () |
List< Signal > | GetSignals () |
GameObject | GetChildByName (string name) |
Gets a child by name. | |
List< GameObject > | GetChildsByName (string name) |
Gets all child by name. | |
GameObject | GetChildByNameAlsoHidden (string name) |
List< GameObject > | GetAllMeshesWithGroup (string group) |
List< GameObject > | GetAllWithGroup (string group) |
List< GameObject > | GetAllWithGroups (List< string > groups) |
List< GameObject > | GetAllMeshesWithGroups (List< string > groups) |
List< string > | GetMyGroups () |
List< GameObject > | GetMeshesWithSameGroups () |
List< GameObject > | GetAllWithSameGroups () |
MeshRenderer | GetMeshRenderer () |
Gets the mesh renderers in the childrens. | |
void | SetCollider (bool enabled) |
sets the collider in all child objects | |
void | ErrorMessage (string message) |
Displays an error message. | |
void | ChangeConnectionMode (bool isconnected) |
void | Log (string message) |
Logs a message. | |
void | Log (string message, object obj) |
Logs a message with a relation to an object. | |
void | Warning (string message, object obj) |
Logs a warinng with a relation to an object. | |
void | Error (string message, object obj) |
Logs an error with a relation to an object. | |
void | Error (string message) |
Logs an error. | |
GameObject | DebugPosition (string debugname, Vector3 position, Quaternion quaternation, float scale) |
Displays a gizmo for debugging positions. | |
void | SetFreezePosition (bool enabled) |
Freezes all child components to the current poosition. | |
void | SetRbConstraints (RigidbodyConstraints constraints) |
virtual void | AwakeAlsoDeactivated () |
Public Attributes | |
StatusFloat | Status |
![]() | |
string | Comment |
string | OriginDataType |
SettingsSignal | Settings |
SignalEvent | EventSignalChanged |
bool | Autoconnected |
bool | UpdateEnable |
List< Connection > | ConnectionInfo |
InterfaceSignal | interfacesignal |
![]() | |
string | Name |
The name of the component if it should be different from the GameObject name. | |
ActiveOnly | Active |
GameObject | FromTemplate |
realvirtualController | realvirtualController |
bool | HideNonG44Components |
bool | SceneIsAdditive |
bool | ForceStop |
Properties | |
float | Value [get, set] |
Additional Inherited Members | |
![]() | |
enum | ActiveOnly { Always , Connected , Disconnected , Never , DontChange } |
![]() | |
static bool | DirectionIsLinear (DIRECTION direction) |
Gets back if the direction is linear or a rotation. | |
![]() | |
void | SignalChangedEvent (Signal signal) |
new bool | hidename () |
![]() | |
bool | hidename () |
bool | hideactiveonly () |
virtual void | OnStopSim () |
virtual void | OnPreStartSim () |
virtual void | OnStartSim () |
MU | GetTopOfMu (GameObject obj) |
Gets the top of an MU component (the first MU script going up in the hierarchy) | |
void | InitGame4Automation () |
Initialiates the components and gets the reference to the realvirtualController in the scene. | |
virtual void | AfterAwake () |
void | Awake () |
![]() | |
string | Visutext |
![]() | |
OnSignalChangedDelegate | SignalChanged |
Detailed Description
PLC Float Input Signal - Represents a floating-point input signal from PLC to simulation.
PLCInputFloat is an essential signal type for receiving analog and continuous numerical data from external PLC systems into the Unity simulation. This component handles 32-bit floating-point values, enabling precise communication of analog measurements, setpoints, and control parameters.
Key Features:
- Receives 32-bit IEEE 754 floating-point values from PLC systems
- Supports real-time value monitoring with change detection
- Provides high precision for analog signal representation
- Includes override capability for testing without PLC connection
- Maintains connection status for communication health monitoring
- Automatic byte-order conversion for cross-platform compatibility
Signal Direction: PLC → Simulation (Input from PLC perspective) The signal transfers analog values from PLC controllers to Unity simulation, allowing PLC programs to control continuous parameters like speeds, positions, temperatures, and pressures.
Common Applications:
- Receiving speed setpoints for motors and drives (rpm, m/s)
- Reading analog sensor values (pressure, temperature, flow rate)
- Transferring position commands for servo axes
- Implementing PID controller outputs and control values
- Receiving scaling factors and calibration parameters
- Transmitting measurement data from PLC calculations
Interface Integration: PLCInputFloat seamlessly integrates with industrial protocols:
- OPC UA: Maps to OPC UA Float/Double nodes with engineering units
- S7 TCP/IP: Direct reading from Siemens S7 REAL data types
- Modbus TCP/RTU: Maps to holding registers (2 registers for 32-bit float)
- TwinCAT ADS: Connects to Beckhoff REAL variables
- MQTT: Subscribes to JSON payloads with float values
- Shared Memory: High-speed float array exchange
Data Precision and Range: Uses standard 32-bit float representation providing:
- Range: ±3.4 × 10^38
- Precision: ~7 significant digits
- Special values: NaN, Infinity support for error states
Update Mechanism: Values are monitored in Update() for smooth animation compatibility. Changes trigger EventSignalChanged events for reactive component behavior. The system automatically handles byte-order conversion when receiving data from different PLC architectures, ensuring consistent value interpretation across platforms.
Member Function Documentation
◆ GetByteSize()
|
virtual |
Reimplemented from realvirtual.Signal.
◆ GetByteValue()
|
virtual |
Reimplemented from realvirtual.Signal.
◆ GetStatusConnected()
|
virtual |
Virtual for getting the connected Status.
Reimplemented from realvirtual.Signal.
◆ GetValue()
|
virtual |
Gets the value of the signal.
Reimplemented from realvirtual.Signal.
◆ GetVisuText()
|
virtual |
Virtual for getting the text for the Hierarchy View.
Reimplemented from realvirtual.Signal.
◆ IsInput()
|
virtual |
Virtual for getting information if the signal is an Input.
Reimplemented from realvirtual.Signal.
◆ SetStatusConnected()
|
virtual |
Virtual for setting the Status to connected.
Reimplemented from realvirtual.Signal.
◆ SetValue() [1/5]
|
virtual |
Reimplemented from realvirtual.Signal.
◆ SetValue() [2/5]
void realvirtual.PLCInputFloat.SetValue | ( | float | value | ) |
Sets the value as a float.
◆ SetValue() [3/5]
void realvirtual.PLCInputFloat.SetValue | ( | int | value | ) |
Sets the value as an int.
◆ SetValue() [4/5]
|
virtual |
Sets the value of the signal.
Reimplemented from realvirtual.Signal.
◆ SetValue() [5/5]
|
virtual |
Virtual for setting the value.
Reimplemented from realvirtual.Signal.