PLC Boolean Input Signal - Represents a boolean input signal from PLC to simulation. More...

Public Member Functions | |
override void | OnToggleHierarchy () |
Virtual for toogle in hierarhy view. | |
override void | SetStatusConnected (bool status) |
Sets the Status connected. | |
override bool | GetStatusConnected () |
Gets the status connected. | |
override void | SetValue (byte[] value) |
override byte[] | GetByteValue () |
override int | GetByteSize () |
override string | GetVisuText () |
Gets the text for displaying it in the hierarchy view. | |
override bool | IsInput () |
True if signal is input. | |
override void | SetValue (string value) |
Sets the Value as a string. | |
override void | SetValue (object value) |
Sets the value of the signal. | |
override object | GetValue () |
Gets the value of the signal. | |
void | SetValue (bool value) |
Sets the Value as a bool. | |
void | FixedUpdate () |
![]() | |
delegate void | OnSignalChangedDelegate (Signal obj) |
void | OnInspectValueChanged () |
bool | OnObjectDrop (Object reference) |
void | OnInspectedToggleChanged (bool arg0) |
string | GetSignalName () |
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 | |
StatusBool | Status |
Status struct of the bool. | |
bool | ChangedToTrue |
bool | ChangedToFalse |
![]() | |
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 | |
bool | Value [get, set] |
Sets and gets the value. | |
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 Boolean Input Signal - Represents a boolean input signal from PLC to simulation.
PLCInputBool is a fundamental signal type for receiving boolean (true/false) data from external PLC systems into the Unity simulation environment. This component serves as a digital input point that can be read and monitored by simulation components to react to PLC control logic.
Key Features:
- Receives boolean values from connected PLC systems via various industrial protocols
- Supports real-time value changes with event notification system
- Provides edge detection for rising (false to true) and falling (true to false) transitions
- Implements override capability for manual testing and debugging without PLC connection
- Maintains connection status to indicate communication health with PLC
Signal Direction: PLC → Simulation (Input from PLC perspective) The signal flows from the PLC controller into the Unity simulation, allowing PLC programs to control simulation behavior through boolean states such as start/stop commands, sensor states, or status flags.
Common Applications:
- Receiving start/stop commands from PLC programs
- Reading digital sensor states (proximity sensors, light barriers, limit switches)
- Monitoring PLC status flags and operation modes
- Triggering simulation events based on PLC conditions
- Implementing safety interlocks and emergency stop signals
Interface Integration: PLCInputBool seamlessly integrates with multiple industrial communication protocols including:
- OPC UA: Maps to OPC UA boolean nodes for standardized communication
- S7 TCP/IP: Direct integration with Siemens S7 PLCs via TCP/IP
- Modbus TCP/RTU: Maps to Modbus coil or discrete input registers
- TwinCAT ADS: Connects to Beckhoff TwinCAT boolean variables
- MQTT: Subscribes to MQTT topics for IoT integration
- Shared Memory: High-speed local communication for virtual commissioning
Update Mechanism: The signal value is updated in FixedUpdate() to ensure consistent timing with Unity's physics system. Value changes trigger the EventSignalChanged event, allowing other components to react immediately. Edge detection (ChangedToTrue/ChangedToFalse) provides single-frame flags for transition handling, essential for implementing one-shot logic and state machines in automation sequences.
Member Function Documentation
◆ GetByteSize()
|
virtual |
Reimplemented from realvirtual.Signal.
◆ GetByteValue()
|
virtual |
Reimplemented from realvirtual.Signal.
◆ GetStatusConnected()
|
virtual |
Gets the status connected.
Reimplemented from realvirtual.Signal.
◆ GetValue()
|
virtual |
Gets the value of the signal.
Reimplemented from realvirtual.Signal.
◆ GetVisuText()
|
virtual |
Gets the text for displaying it in the hierarchy view.
Reimplemented from realvirtual.Signal.
◆ IsInput()
|
virtual |
True if signal is input.
Reimplemented from realvirtual.Signal.
◆ OnToggleHierarchy()
|
virtual |
Virtual for toogle in hierarhy view.
Reimplemented from realvirtual.Signal.
◆ SetStatusConnected()
|
virtual |
Sets the Status connected.
Reimplemented from realvirtual.Signal.
◆ SetValue() [1/4]
void realvirtual.PLCInputBool.SetValue | ( | bool | value | ) |
Sets the Value as a bool.
◆ SetValue() [2/4]
|
virtual |
Reimplemented from realvirtual.Signal.
◆ SetValue() [3/4]
|
virtual |
Sets the value of the signal.
Reimplemented from realvirtual.Signal.
◆ SetValue() [4/4]
|
virtual |
Sets the Value as a string.
Reimplemented from realvirtual.Signal.
Member Data Documentation
◆ Status
StatusBool realvirtual.PLCInputBool.Status |
Status struct of the bool.
Property Documentation
◆ Value
|
getset |
Sets and gets the value.