Skip to main content

Sending the line speed

Goal: the line has no encoder for the printer, but the PLC knows the line speed. The PLC keeps the printer's speed up to date.

Printer setup​

  1. Set the printer's speed source to fixed speed, in the printer settings.

  2. Add a register mapping:

    FieldValue
    Address10
    MappingFixed speed
    Data typeUINT16
    PrinterNoLabel
    WritableOn

PLC​

Write the speed in millimetres per second, as a whole number, whenever it changes. For example, 15 m/min is 250 mm/s. The printer saves the setting, so avoid writing it many times a second when the speed has not changed.

Try it​

from common import *

metres_per_minute = 15
check(client.write_register(10, round(metres_per_minute * 1000 / 60)))
print(check(client.read_holding_registers(10, count=1)).registers[0]) # 250