Mapping a Variable to a fieldbus
A Variable can be exposed on a fieldbus so a PLC or another controller can read or write it. This is how a Flow exchanges data with the rest of the line without any of its logic changing: the Flow keeps reading and writing an ordinary Variable, and the mapping takes care of the wire.
Two protocols can be enabled per Variable, independently:
- Modbus/TCP — RobFlow acts as a client against a Modbus server you configure.
- Profinet — the Variable is placed in the Profinet data frame exchanged with the PLC.
Both are switched on per Variable in the Variables menu, and both can be active on the same Variable at once.
Modbus/TCP
Before you can map anything you need a Modbus/TCP connection — a host, port and unit ID — configured under Fieldbus and protocols.
For each Variable you then set:
| Setting | Meaning |
|---|---|
| Connection | Which configured Modbus/TCP connection to use |
| Data type | Which part of the Modbus address space the Variable lives in (below) |
| Register address / Bit address | Where in that space — a register address for register types, a bit address for bit types |
| Read-only (Modbus) | Skip all write operations for this Variable |
Address space
Modbus splits its address space four ways, and the choice determines both what the Variable can hold and whether RobFlow may write it:
| Data type | Holds | Writable |
|---|---|---|
| Coil | A single bit | Yes |
| Discrete input | A single bit | No — read-only by protocol |
| Holding register | A 16-bit word | Yes |
| Input register | A 16-bit word | No — read-only by protocol |
Coils and holding registers are the writable halves, so Read-only (Modbus) is only offered for those two. Discrete inputs and input registers are read-only in the protocol itself.
A Variable marked read-only skips all write operations — RobFlow will read its value from the server but never push a value back.
Refreshing values
Modbus values are polled. The Variables menu has a Refresh all Modbus Variable values action to force a read of every mapped Variable at once, which is the quickest way to check wiring during commissioning.
Profinet
Profinet mapping places the Variable inside the data frame that the Control Unit and the PLC exchange. Switching Profinet on for the Variable is all there is to it — RobFlow works out the position in the frame itself. The offset and the byte length follow from the Variable's type and from the Variables already mapped, so there is nothing to enter and no way to make two Variables overlap. Both values are shown in the Variables menu for reference, which is what you compare against when reading the frame on the PLC side. The length per type is listed under Profinet Variables.
Because the PLC side has to agree byte-for-byte with the Robot side, RobFlow can generate the PLC's type definition from the same assignment: the Variables menu offers Export Profinet UDT file, which produces a UDT you import into TIA Portal so both sides share one definition.
The mapped Variables must not exceed a total length of 256 bytes.
Profinet integration has its own manual, including the TIA Portal setup, the function block and the data field reference. See the Profinet documentation.
Which to use
- The PLC is the line master and already speaks Profinet to everything else → Profinet.
- You need to talk to a specific device (a gripper controller, a scanner, an HMI) that exposes Modbus registers → Modbus/TCP.
- A Flow needs to branch on a Modbus value directly → the Modbus/TCP Condition Node and Set Modbus/TCP Node work against a connection without going through a Variable at all.
Exporting a Variable set carries its Modbus connections with it, but the target Robot still needs those hosts to be reachable. After importing on another Control Unit, check the connections under Fieldbus and protocols before running a Flow.