Using a PLC bit in the printer
Goal: tell the printer that the line is running, and use that in the printer's own logic.
Printer setup
- In Settings → I/O → Modbus, add a coil at address 8, bound to a signal.
Choose Create new signal…, name it
plc.line_running, and make it writable. - Use the signal on the printer like any other signal, for example:
- In Settings → I/O → Outputs, drive an output pin, such as a beacon.
- In Settings → I/O → Actions, run an action when the signal becomes
active or inactive, for example
printer.NoLabel.deselectwhen it becomes inactive, so the printer deselects its job when the line stops. - Combine it with other signals in a user expression.
PLC
Write the coil whenever the PLC's "line running" state changes, or cyclically: unlike an action coil, a signal coil sets a level, and writing the same value again has no effect. The signal keeps its last value until the PLC or something on the printer changes it.
Try it
from common import *
check(client.write_coil(8, True))
print(check(client.read_coils(8, count=1)).bits[0]) # True
check(client.write_coil(8, False))
The signal is also visible from the Aurora API, for example with getGpioSignal:
getGpioSignal {"name": "plc.line_running"}
OK {"state":false}