/
PLC

PLC

The PLC (Programmable Logic Controller) is used as an interface between the computer and printhead systems. It is utlised as a robust and reliable means of suppling 24VDC power to each valve for precisely controlled times causing the valve to open.

The PLC communicates with the computer system via Modbus (connected through Ethernet). In Python, Modbus commands can be sent through the PyModBus package. Each output on the PLC has a unique Modbus address which can be triggered to change the state on or off. Modbus commands can also be used to change the value of data register variables (e.g. DS1).

In the spray system implementation to fire a valve, a signal is sent from the computer to the PLC to turn on the output corresponding to a specific valve. When the output activates, a timer begins in the PLC’s CPU for a predefined time, after which the output is closed. When the output is activate, 24VDC is supplied to the valve to open it and dispense liquid.

This timer loop is implemented on the PLC using ladder logic. An example snippet of the ladder logic code is shown below, where:

DS1 - Data register that controls the length of the timer (e.g. 10ms). This can be changed from the computer via a Modbus command to rewrite the register with the new value.

Y101 - Output corresponding to valve 1. All PLC outputs are denoted with a “Y”

T1 - Timer corresponding to valve 1. When timer completes Y101 is reset to turn off the valve.

To fire valve 1, Y101 is activated via Modbus command from the computer. When Y101 activates, timer T1 begins. When the timer has finished (for time DS1) Y101 is reset and the valve is closed. This logic is repeated for 32 outputs corresponding to the the 32 valves on the printhead.

 

Example ladder logic code to fire valve 1.

Note: to edit the ladder logic code for this specific PLC, you need the CLICK Programming Software.

The ladder logic is stored in the PLC and runs automatically as long as the PLC switch is in the “run” position.

Related content

Hardware BOM
More like this
Wiring
More like this
Hardware images
Read with this
Lee Co Valve
More like this
Accumulator system
Accumulator system
Read with this
Calibration
More like this