Skip to main content

Input/output

tip

Output pins cannot be set directly. Instead, signals are tied to actual output pins using the printer settings, and the API sets the signals.

note

Before v5.4, signals were called conditions, and the methods had names such as setGpioConditions. The old method names still work, but are deprecated.

GPIO signals you define from the API come in two kinds v5.0:

Use listGpioSignals2 for the current state of every signal and expression, and listWritableGpioSignals for the signals whose state can be set via the API.

Built-in signals​

Besides the signals and expressions you define, the system maintains built-in signals that reflect printer status. Each printer exposes its own signals named printer.<printerID>.<name> (for example printer.Colorize.printing), and matching aggregate signals named printers.<name> combine that signal across all printers (for example printers.printing). Use listGpioSignals2 to see which signals are available.

Built-in signals are read-only, with one exception: each printer's printer.<printerID>.maintenance_mode signal is writable v5.4. It is active while the printer is in maintenance mode, and setting it enables or disables maintenance mode. printers.maintenance_mode is active while every printer is in maintenance mode, and setting it enables or disables maintenance mode on all of them v6.1.

The constant signals always_active and never_active are always and never active v5.4. Before v5.4 they were called always and never. The old names still work wherever a signal name is accepted, including in expressions, but are not listed by listGpioSignals2, and cannot be used as names of user signals or expressions.

Input pins are exposed as read-only signals named device.<device>.<input>. Photocell triggers are exposed the same way, as signals named device.<device>.TRIGGER<n> that are true while the trigger is active, so they can drive output pins and expressions just like input pins v5.2. Encoder triggers are not exposed as signals.

Notifications, such as those raised by extensions, drive their own signals v6.0. Exactly one of notification.green, notification.amber and notification.red is active, for the worst severity among the raised notifications, with notification.green active when none is raised. notification.<owner>.<key> is active while that one notification is raised. Notifications don't affect a printer's ragStatus. They are also returned by getPrinterStatus.

Marking stations​

Each marking station has signals named station.<stationID>.<name> that combine the signals of its printers, the same way printers.<name> combines those of all printers v6.1:

SignalActive when
readyevery printer of the station is
label_readyevery printer of the station is
label_selectedevery printer of the station is
greenevery printer of the station is
maintenance_modeevery printer of the station is
ink_lowany printer of the station is
ink_emptyany printer of the station is
printingany printer of the station is
amberany printer of the station is
redany printer of the station is

station.<stationID>.maintenance_mode is writable, and setting it enables or disables maintenance mode on every printer of the station.

Each station also has the actions station.<stationID>.abort_print and station.<stationID>.deselect, which act on every printer of the station, and, if a printer of the station has an ink system, station.<stationID>.start_request, station.<stationID>.standby_request and station.<stationID>.stop_request, which act on every printer that has one. An action acts on the printers that are in the station when it runs.

The signals and actions follow the stations as they are changed. As with printer signals, expressions and I/O settings that name a station's signals are not updated when the station's ID changes.

Actions​

An action is something the printer does, such as aborting a print. In the I/O settings, the rising or falling edge of a signal can be mapped to an action. Use listGpioActions to see which actions are available v5.4. Use listGpioSignalEdgeMappings, addGpioSignalEdgeMappings and removeGpioSignalEdgeMappings to change single mappings without replacing the I/O settings v6.0.

Each printer has actions named printer.<printerID>.<name>, for example printer.Colorize.abort_print and printer.Colorize.deselect.

Every writable signal also has two actions that set and clear it, named signal.<signal>.activate and signal.<signal>.deactivate v5.4. Mapping one signal's edge to the activate action and another's to the deactivate action makes a latch: the signal stays active until the second signal clears it. They replace the printer actions printer.<printerID>.enable_maintenance and printer.<printerID>.disable_maintenance, which are now signal.printer.<printerID>.maintenance_mode.activate and signal.printer.<printerID>.maintenance_mode.deactivate. The old names are still accepted in the settings, but are not listed.