Skip to content

Signals and Logic

PLC signals control a twin through the same inputs and outputs as a real controller. Choose how to set them:

  • a real PLC, connected through realvirtual CONNECT, or
  • logic steps in the model itself, acting as a virtual PLC that runs the twin without a controller, or
  • a Structured Text program in the browser. See Virtual PLC (ST).

A signal is a node with one of six signal components: PLC Input or PLC Output, each as Bool, Int or Float.

SignalDirection
PLCInput…The twin writes it; the PLC reads it. Examples include a sensor state and position feedback
PLCOutput…The PLC writes it; the twin reads it. Examples include a motor command and a lamp

Create signals with the Signals buttons in Quick Edit, and give them the name of the PLC tag. Comment appears in tooltips to help you match tags to slots.

See Signals & Alarms for signal display and colours. See Signal Binding to link a signal to a drive, sensor or lamp.

Logic steps form a sequence of simple actions: move a drive, wait for a sensor, set a signal, wait. They run the twin when no controller is connected. Use them for demos, tests of the mechanics, or as a virtual PLC for commissioning.

A container holds a sequence. Steps run in the order of the hierarchy.

One cycle of a top-level Serial Container Time runs left to right. The top-level Serial Container runs Wait Sensor, then Drive To until arrival. A Parallel Container starts two tracks together: track A runs Drive To, and track B runs Delay then Set Signal. Both tracks must finish before the join. Start Drive then finishes at once while its drive keeps moving. Set Signal runs next, followed by Wait Drives, which waits for that drive to reach its target. The top-level Serial Container loops back to its first step. Top-level Serial Container Hierarchy order; illustrative durations time Parallel Container AB WaitSensor Drive Tountil target Drive To Delay SetSignal join Start Drive finishes at once SetSignal WaitDrives drive keeps moving loop: return to the first step after Wait Drives finishes
Drive To waits for arrival; Start Drive lets the sequence continue while the drive moves. The Parallel Container joins both tracks before the next step starts.
StepWhat it does
Serial ContainerRuns its steps one after another. A top-level container starts again when it reaches its end
Parallel ContainerRuns its steps at the same time and ends when all have ended
Drive To / Start DriveMoves a drive to a Destination (mm or °), Relative to its current position if set. Drive To waits for the arrival, Start Drive does not
Set SignalSets a Bool signal to true or false
Wait SensorWaits until a sensor is occupied or free. WaitForStopped also waits until the part has stopped
Wait ZoneWaits until a zone is occupied or free
Wait SignalWaits for a signal value, or for a rising or falling Edge
Wait DrivesWaits until several drives have reached their targets
JumpJumps to a named step of the same container when a Bool signal has the value set in JumpOn. Use it for loops and branches
DelayWaits a number of seconds
PauseCurrently has no effect in realvirtual

Models exported from Unity can carry further step types, for example Set Drive Speed, Set Signal Float, Wait Signal Float, Enable and the Grip Pick / Grip Place steps. They run in realvirtual too, but you cannot add them in the Editor.

To build a sequence in the Editor:

  1. Select an empty node and click LogicSteps Container in Quick Edit.
  2. Keep the container selected and click a step to add it inside the container. The new step is then selected; clicking the next step inserts it right after.
  3. Double-click the step to choose its drive, sensor or signal in the property inspector.

See the Quick Edit Reference for details.

While the twin runs, the hierarchy shows each sequence with its state, for example Serial RUN.

The hierarchy filtered to Logic in the Laser Welding Assembly Station: the plant sequences Logic_Plant_Init, Logic_Plant_Safety and Logic_Plant_Camera_FG01 with the state RUN, their steps listed below, and an orange dot on the step that is currently waiting

A model with logic steps can run on that logic or on a real controller. The Connection Mode component on a node of the model sets how it starts: Simulation (the logic steps run) or PLC (a real controller is expected).

While an interface is connected, a SIM / PLC button next to the simulation controls changes the mode. A connected controller takes over automatically when it writes its first output.

Use each step’s Active setting to limit it to one mode. This lets plant behaviour, such as doors or an E-stop chain, keep running while the virtual PLC stops. Simulation or PLC describes the switch.

A Structured Text program follows the mode only if it reads the system variable RV_SimulationMode. See Simulation or PLC mode. If it writes the same outputs as logic steps, you must resolve the conflict in the model.