Skip to content

Signal Bridges

A bridge moves signal values from one interface to another inside the gateway. No PLC program or script is needed. CONNECT offers two kinds:

MirrorMapping (1:1)
ScopeAll signals of an interface, or those matching a patternOne signal to one signal
TargetAn MQTT or shared memory (SHM) interface onlyAny other interface
NamesKept unchangedSource and destination names are chosen by you
Type handlingNone, the value is passed as it isStrict or Coerce, or a conversion: INT ↔ BOOL, bits from or into a word, scaling, inversion

Use a mirror to republish a whole controller to a broker or to a simulator that attaches through shared memory. Use a mapping to feed one value into another system, for example a robot status into a PLC input.

The quickest route is the interface card:

  1. Open the CONNECT panel.
  2. Open the ⋮ menu of the source interface.
  3. Choose Mirror to MQTT… (enter an optional topic prefix, then Mirror) or Mirror to SHM (shared memory).

CONNECT creates the target interface if needed and adds the rule.

For full control, use the Bridges section below the interface list:

  1. Click Mirror.
  2. Pick the Source… interface and the Target (MQTT/SHM)… interface.
  3. Optionally change the pattern (default *, all signals). * and ? work as wildcards, for example Axis*.
  4. Click Add.

MQTT publishes one topic per signal. A topic prefix such as rv/ is placed in front of the signal name. Shared memory exposes the mirrored signals in its header, fixed when the interface connects.

  1. In the interface’s signal list, click the bridge icon of the signal (tooltip: Bridge to another interface (1:1 signal mapping)). The Bridge Signal dialog opens with Source signal filled in. Alternatively click Mapping in the Bridges section and type the source yourself.
  2. Enter the Destination signal. It must be a signal that another interface already provides. Both fields suggest known signal names.
  3. Choose the Conversion (see below). The dialog shows only the options the chosen conversion uses.
  4. Click Add Bridge.

Every bridge appears in the Bridges (n) list with an enable switch, an edit button and a delete button. Mirrors are tagged mirror. Mappings are tagged with their conversion: 1:1, 1:1 coerce, the mode name, or for bit mappings the mode and bit, for example BitToWord bit 3. The edit button opens the same dialog with the mapping filled in; Save Bridge replaces it. A rule the gateway considers invalid is refused and the reason is shown in the section.

The conversion 1:1 (coercion) copies the value as before:

  • Strict (default) requires source and destination to have the same value type.
  • Allow coercion (Coerce) additionally allows bool ↔ int and int → float.
  • Conversions with no clear meaning are rejected: bool ↔ float, float → bool and anything to or from text.

Mappings saved before conversions existed keep exactly this behaviour.

The other conversions need a CONNECT version that supports them; with an older CONNECT the dialog offers only 1:1 (coercion). They are the modes of the Signal Connector component. A mapping and a connector with the same mode and options compute the same value, because both use one shared conversion core.

ConversionModeSource → destinationOptions
CopyCopyBOOL → BOOL, INT → INT, REAL → REAL, INT → REALInvert negates a BOOL
INT → BOOLIntToBoolINT → BOOLCondition: NotZero (default, negative values count as true), Equals or GreaterOrEqual with Compare value; Invert
BOOL → INTBoolToIntBOOL → INTTRUE value (default 1), FALSE value (default 0)
Bit from wordBitFromWordINT → BOOLBit, Width, Invert
Bit to wordBitToWordBOOL → INTBit, Width, Signed, Invert
ScaleScaleINT or REAL → INT or REALFactor (default 1), Offset (default 0), Rounding (Round or Truncate), Width, Signed

Width is Byte (8 bit), Word (16 bit, default) or DWord (32 bit). It sets the range of Bit (0–7, 0–15 or 0–31), how Scale reads an INT source and the range an INT destination is limited to. Signed (default on) decides whether that INT is read and written as signed. An option you leave out takes its default.

The number rules are those of the Signal Connector: INT values are 32-bit signed, REAL values are 32-bit floats (16777217 arrives as 16777216), Round rounds halves away from zero, and Scale into an INT is limited to the range of Width and Signed. A result that is not a finite number, such as a value beyond the float range, is not written; the destination keeps its last value and the log shows a warning.

A mapping handles one bit. To read eight bits of a status byte, add eight Bit from word mappings with the same source and different Bit values. To build a word from eight BOOLs, add eight Bit to word mappings with the same destination.

The Bit to word mappings of one destination build the whole word together:

  • The word holds exactly the bits of these mappings. Bits that no mapping writes are 0. The gateway never reads the word back.
  • If the mappings of one word use different settings, the widest Width applies, and the word is signed only when all of them are Signed.
  • When you disable or delete one of them, its bit becomes 0. When the last one goes, the word is set to 0 once.

A destination that is written by a Bit to word mapping belongs to the bit mappings of that word. The gateway refuses a configuration in which

  • the same bit of a word is written twice,
  • one source feeds two bits of the same word, or
  • another mapping (any other conversion) also writes that word.

Two ordinary mappings onto the same destination are allowed, as before, and listed as a fan-in warning: the last change wins. The gateway checks all of this when a mapping is saved, through the dialog, MCP, REST or a configuration change. A mode that does not fit the two signal types, such as BOOL → INT onto a REAL signal, or a Bit outside its Width is refused the same way. The type check needs both signals in the interface configuration; for a signal an interface only provides while it runs, a mismatch shows up as a warning in the log instead, and nothing is written.

A value written by a mapping is tagged with its origin, and mappings ignore tagged changes. Two opposing mappings (A → B and B → A) therefore cannot ping-pong. The same tag means that mappings do not chain: when A → B and B → C exist, a change of A reaches B but not C.

Renaming a signal in CONNECT updates every mapping that uses it, as source or as destination, and keeps its conversion and all options.

The same conversions exist in two places. Pick by where the coupling belongs:

Signal Connector (in the model)Mapping (in CONNECT)
Lives inThe model file, saved with the machineThe CONNECT configuration of this gateway
RunsIn the browser simulation, also without CONNECT (virtual PLC, robot simulation), and with CONNECTIn the gateway, also without any model or open browser
ChainsA → B → C passes onDoes not pass on (see loop protection)
Shows problems inThe Problems panel of the modelThe Bridges section, bridge_list and the gateway log
  • Use a Signal Connector when the coupling is part of the machine: it travels with the model, works in the pure simulation, and is commissioned together with the model.
  • Use a mapping when the coupling is part of the plant wiring between real controllers, and it has to work while no model or browser is running.
  • Do not use both for the same destination signal. While the browser is connected to CONNECT, the model reports a connector and a mapping that write the same signal as signal-connector-fan-in.

A mapping that targets a signal of a real PLC or robot controller is a write from the gateway to the machine. It only reaches the controller if the destination interface has Allow Web → PLC writes switched on (interface dialog, off by default). See write access to the controller.

A robot interface provides Robot1.TCP_Z (float). The PLC expects a float input PLC_RobotHeight.

  1. Check that the PLC interface has Allow Web → PLC writes enabled.
  2. In the signal list of the robot interface, click the bridge icon of Robot1.TCP_Z.
  3. Enter PLC_RobotHeight as Destination signal, keep 1:1 (coercion) without coercion (both are float) and click Add Bridge.

Every change of Robot1.TCP_Z is now written to the PLC.

Example: robot status bits into a PLC word

Section titled “Example: robot status bits into a PLC word”

The robot reports RobotReady and RobotFault as BOOL outputs. The PLC expects both in one status word Rob_Status (INT): bit 0 ready, bit 1 fault.

  1. Click the bridge icon of RobotReady, enter Rob_Status, choose Bit to word, leave Width at Word and set Bit to 0. Click Add Bridge.
  2. Do the same for RobotFault with Bit 1.

Rob_Status is now 1 while the robot is ready, 2 on a fault, 3 for both, and 0 otherwise.

MCP. AI clients connected to CONNECT use bridge_list to read all rules plus the current config revision, and bridges_apply to change them in one all-or-nothing batch. The operations are mirror.upsert, mirror.remove, mapping.upsert and mapping.remove. A mapping is identified by its pair of sourceSignal and destSignal. Its conversion is given as mode (Copy, IntToBool, BoolToInt, BitFromWord, BitToWord, Scale) plus the options condition, compareValue, trueValue, falseValue, bit, width, signed, factor, offset, rounding and invert. bridge_list lists a mapping in exactly this form and only with the options that are set, so a listed mapping can be sent back unchanged. bridges_apply needs MCP write access and the expectedRevision from bridge_list; a stale revision is refused.

{ "op": "mapping.upsert",
"mapping": { "sourceSignal": "RobotFault", "destSignal": "Rob_Status", "mode": "BitToWord", "bit": 1 } }

REST. GET and PUT on /config/mirrors and /config/mappings, and the same operations as MCP on POST /config/ops. Invalid rules are answered with 400 and are not saved.

Config file. In connect-config.json, options are written only when they are set:

"Mirrors": [
{ "SourceInterfaceId": "plc", "TargetInterfaceId": "mqtt", "SignalPattern": "*", "TopicPrefix": "rv/" }
],
"Mappings": [
{ "Enabled": true, "SourceSignal": "Robot1.TCP_Z", "DestSignal": "PLC_RobotHeight", "Coercion": "Strict" },
{ "Enabled": true, "SourceSignal": "RobotFault", "DestSignal": "Rob_Status", "Coercion": "Strict", "Mode": "BitToWord", "Bit": 1 }
]
  • Mirror targets are MQTT and shared memory only.
  • The destination signal must already exist on another interface.
  • Byte or word swapping, edges, delays and filters are not available.