Cell IO
Cell IO are the signals plem exchanges with a PLC. Press Cell IO in the section bar on the left of the Cell tab: connection cards open at the top and the signal table below. Programs wait for and write signals by name (Wait for Signal · Write Signal).
Saving applies at once, without restarting the robot stack. Only connections whose settings or signals changed are reopened; a connection that was only renamed is left alone. Saving is refused while a Job is running or paused, so the signals of a running program do not change under it.
Connections
Add connection creates a PLC connection. The protocol is Modbus TCP, and you pick one of two roles.
| Role | Who connects | Settings |
|---|---|---|
| plem connects (client) | plem connects to the PLC's Modbus TCP server and reads signals periodically | IP address · port (default 502) · unit ID (default 1) · poll period (default 50 ms, at least 20) · response timeout (default 1000 ms, at most 10000) |
| PLC connects to plem (server) | The PLC connects to plem and reads and writes plem's table | Listen address (default 0.0.0.0 = all interfaces) · port (default 5020) · unit ID (default 1) |
Both roles set the 32-bit word order: ABCD puts the high word first (default), CDAB the low word. Match the PLC's setting.
The server role's port must be 1024 or higher. The plem server runs as a normal user process and cannot open lower ports, so a PLC fixed to port 502 cannot use the server role. The unit ID must match the value the PLC puts in its requests.
Each connection card shows a state.
| State | Meaning |
|---|---|
| Connected | A client is reading the PLC; a server has at least one PLC connected and also shows the PLC's address |
| Waiting | The server role has opened its port and waits for a PLC |
| Disconnected | The connection was just opened and no state has arrived yet |
| Error | Shown with the cause (below) |
| Off | The connection is turned off. Its signals are Unknown |
What plem does on an error depends on the cause.
| Cause | What plem does |
|---|---|
| A client could not connect, lost the connection, got no answer, or could not process the answer | Reconnects to the PLC, starting at 0.25 s and doubling up to 2 s between tries. Meanwhile that connection's signals are Unknown |
| The PLC answered a read with a Modbus exception | Keeps the connection and reads again next period. Only the signals of the failed request are Unknown |
| A server could not open its port | Reopens the port at the same intervals |
Modbus TCP has no authentication. Any device that reaches the server connection's port can write input signals, and there is no allow list. Input signals wake Wait for Signal nodes, so a stray device can make a program move on at the wrong time.
- Narrow the listen address to the address of the cell-only network interface. 0.0.0.0 listens on every interface of the device.
- Keep only cell equipment on that network.
Signals
Add signal creates a signal. You need at least one connection first.
| Field | Value |
|---|---|
| Name | 1 to 40 characters. Programs find the signal by this name |
| Connection | The connection that carries the signal |
| Type | bool · int16 · uint16 · int32 · uint32 · float32. 32-bit types use two consecutive registers |
| Direction | Input (PLC → plem) · Output (plem → PLC) |
| Table | bool goes in a coil or discrete input, numbers in a holding register or input register |
| Address number | The protocol number, counted from 0 |
Addresses count from 0. If the PLC manual uses notation like "40001", subtract 1: 40001 is holding register 0, and 40011 is 10.
After you pick a connection, only the usable tables show.
- Output signals of a client connection go only in a coil or holding register, the tables plem can write.
- Input signals of a server connection also go only in a coil or holding register, the tables the PLC can write.
- Overlapping numbers in the same connection and table are not saved.
Before you rename or delete a signal, the saved programs that use it are listed. Deleting a connection first lists the signals deleted with it.
Current value
The Value column of the signal table updates live. A bool shows On or Off, a number shows its value.
Unknown means plem does not know the value right now. That happens when:
- the connection is lost or off;
- the request that read the signal came back with a Modbus exception;
- in the server role, the PLC has not written that input signal yet, or plem has not written that output signal yet (a PLC reading it then gets 0 or off);
- a
float32value is NaN or infinite.
An Unknown value satisfies no condition of a Wait for Signal node. A client connection reads its output signals every period too, so an output signal's value is what the PLC holds now.
Device signals
Below the signal table, each cell robot's gripper state shows as (Device) rows, with the robot id in front of the screen name (arm1 gripper holding). They have no connection or address and are read-only. A Wait for Signal node can wait on them like input signals, but you cannot write or force them. The server sets the screen names, in English on both screen languages.
| Screen name | API name | Type | Value |
|---|---|---|---|
| gripper holding | device. | bool | Whether it holds a part |
| gripper connected | device. | bool | Whether the gripper answers |
| gripper width | device. | float32 | Width (mm) |
| gripper dropped | device. | bool | Whether it dropped the part it held. Turns off at the next gripper command. Always off for a gripper that does not report drops (Gripper status) |
- If no gripper state comes for over a second, all device signals of that robot are Unknown. Other robots' signals are not affected.
- When the gripper connection is off, grip, width and dropped are Unknown.
- Programs store device signals by their API name. User signal names cannot start with
device.; that prefix is reserved for device signals.
Force output
To test wiring or a PLC program, you can switch an output signal on or off, or write a value, straight from the signal table. Press Force output on the output signal's row.
- A dialog warns "Equipment may move when the PLC reacts to this value."
- For a
boolsignal press On or Off; for a number enter the value and press Write. - The dialog closes when the write finishes. If it fails, the dialog stays with the reason.
When the write counts as finished depends on the role.
- Client connection: when the PLC confirms the write. The value then changes to what the next read from the PLC returns.
- Server connection: when the value is in plem's table. The PLC reads it on its own cycle. It fails if the connection is in error because the port could not be opened.
Forced output is blocked while a Job is running or paused, and a Job start waits until a write finishes. Writes and refusals are both logged in the device's audit file ~/..
plem never resets an output or drives it to 0. A value written by a Write Signal node or by forced output stays after the Job stops or ends, and the PLC keeps seeing it. If your equipment must not be left with an output on, turn it off in the PLC program or in the program's last node.
- A client connection's output is written into the PLC's table, so it survives a plem server restart.
- A server connection's output lives in plem's table. Restarting the plem server, turning the connection off or changing the word order makes it Unknown, and the PLC reads 0 or off.