Skip to main content

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.

RoleWho connectsSettings
plem connects (client)plem connects to the PLC's Modbus TCP server and reads signals periodicallyIP 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 tableListen 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.

StateMeaning
ConnectedA client is reading the PLC; a server has at least one PLC connected and also shows the PLC's address
WaitingThe server role has opened its port and waits for a PLC
DisconnectedThe connection was just opened and no state has arrived yet
ErrorShown with the cause (below)
OffThe connection is turned off. Its signals are Unknown

What plem does on an error depends on the cause.

CauseWhat plem does
A client could not connect, lost the connection, got no answer, or could not process the answerReconnects 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 exceptionKeeps the connection and reads again next period. Only the signals of the failed request are Unknown
A server could not open its portReopens the port at the same intervals
In the server role anyone on the network can write input signals

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.

FieldValue
Name1 to 40 characters. Programs find the signal by this name
ConnectionThe connection that carries the signal
Typebool · int16 · uint16 · int32 · uint32 · float32. 32-bit types use two consecutive registers
DirectionInput (PLC → plem) · Output (plem → PLC)
Tablebool goes in a coil or discrete input, numbers in a holding register or input register
Address numberThe 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 float32 value 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 nameAPI nameTypeValue
gripper holdingdevice.<robot id>.gripper.gripboolWhether it holds a part
gripper connecteddevice.<robot id>.gripper.connectedboolWhether the gripper answers
gripper widthdevice.<robot id>.gripper.width_mmfloat32Width (mm)
gripper droppeddevice.<robot id>.gripper.droppedboolWhether 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.

  1. A dialog warns "Equipment may move when the PLC reacts to this value."
  2. For a bool signal press On or Off; for a number enter the value and press Write.
  3. 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/audit/cell-io.jsonl.

Outputs keep their value on stop or exit

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.