Testing the connection
Goal: confirm that the PLC can reach the printer, and that it uses the same addresses as the printer.
Printer setup
Enable the Modbus server. See Printer setup.
PLC
- Send Read Device Identification (function
43/14). The printer answers with
GSI,Auroraand its software version. This works even with no mappings. - Read one item whose value you can check in the printer's web UI, such as a counter. If the read fails with exception 02, or returns the wrong value, check the address notation your PLC tool expects.
Try it
from common import *
info = check(client.read_device_information(read_code=1, object_id=0))
print(info.information)
# {0: b'GSI', 1: b'Aurora', 2: b'5.4.1'}
# The counter Serial at 0-1
print(from_uint32(check(client.read_holding_registers(0, count=2)).registers))