Skip to main content

Coils

Each mapped coil is bound either to a signal or to an action in the printer. The mapping list gives, for each coil, its address, its access and the name of the signal or action.

Coils that are not mapped read as 0. A read may cover any range within 0–65535, mapped or not, so the PLC can read all the coils it needs in one request.

Signal coils​

Signals are the printer's booleans: digital inputs, status flags, user signals and user expressions. See Built-in signals for the signals the printer provides, such as:

SignalActive when
printer.<printerID>.readyThe printer is ready to print.
printer.<printerID>.printingThe printer is printing.
printer.<printerID>.label_selectedA print job is selected.
printer.<printerID>.redThe status light is red.
printer.<printerID>.ink_lowThe ink level is low.
  • A read-only coil (access R) reports the signal's current state.
  • A read/write coil (access RW) can also be set and cleared by the PLC. Only signals that can be written from outside, such as user signals, can be mapped as writable.

A write sets a level, not a pulse. Writing 1 turns the signal on, and it stays on until the PLC writes 0 or something else on the printer changes it.

A user signal written by the PLC can be used on the printer like any other signal: to drive an output pin, in an expression, or to run an action on its edge. See Using a PLC bit in the printer.

Action coils​

An action coil is a command bit held by the printer. Writing 1 to a coil that reads 0 runs the action once. Examples of actions:

ActionDoes
printer.<printerID>.abort_printAborts the current print.
printer.<printerID>.deselectDeselects the current print job.
printer.<printerID>.start_requestStarts the ink system (Marvin1 and Blade).
printer.<printerID>.stop_requestStops the ink system (Marvin1 and Blade).
printer.<printerID>.standby_requestPuts the ink system in standby (Marvin1 and Blade).
signal.<signal>.activateActivates a writable signal.
signal.<signal>.deactivateDeactivates a writable signal.

See Actions for more.

Writing 0 never runs anything, and writing 1 to a coil that already reads 1 does nothing. An action coil works in one of two ways:

  • Latching (access RW, the default). The coil keeps the written value and reads it back. To run the action again, the PLC must first write 0 and then 1, so a rising edge in the PLC program becomes a rising edge in the coil. Use the PLC's one-shot or pulse instruction for this.
  • Auto-clear (access W). The coil resets to 0 as soon as it is written, so it always reads 0 and every write of 1 runs the action. It is safe to include in a polled read.

The coil reports the command bit, not the state of the printer. To know whether the command took effect, read a signal that reflects the result, for example printer.<printerID>.ready.

All action coils read 0 after the printer restarts, and after the coil's mapping is changed.

If the action does not exist on the printer, for example because it belongs to a printer that has been removed, the write returns exception 04 and the error is logged on the printer.

Writing several coils​

Function 15 (Write Multiple Coils) is checked as a whole before anything is written. If the request includes any coil that is not writable, including unmapped coils, the whole request is rejected with exception 02 and nothing is written.

Example​

With the example mapping list:

RequestResult
Read coils 0–4 (function 01)Ready, printing, label selected, red and ink low.
Write coil 8 = 1 (function 05)Sets the user signal plc.line_running. Reading coil 8 returns 1.
Write coil 0 = 1Exception 02, coil 0 is read-only.
Write coil 16 = 1Starts the ink system. Coil 16 reads 1 until the PLC writes 0.
Write coil 16 = 1 againNothing, the coil already reads 1.
Write coil 18 = 1Aborts the print. Coil 18 reads 0 at once.
Write coils 0–8 (function 15)Exception 02, the range includes read-only and unmapped coils. Nothing is written.