30
6.2 Example of a PLC Program
Input lines:
I000 LIMY- Y:Y axis negative limit switch, normally closed
I001 LIMY+ Y:Y axis negative limit switch, normally closed
I002 -
I003 Emergency stop: status of the emergency circuitry, normally
closed
I004 LIMX- X:X axis negative limit switch, normally closed
I005 LIMZ- Z:Z axis negative limit switch, normally closed
I006 LIMX+ X:X axis negative limit switch, normally closed
I007 LIMZ+ Z:Z axis negative limit switch, normally closed
Output lines:
O000 M3/4: spindle direction, U000=M3, D000=M4
O001 spindle enable, U001=enabled, D001=disabled: M5
O002 coolant, U002=on (M08), D001=off (M09)
O003 -
O004 -
O005 -
O006 -
O007 LUB:lubrication U007=pump on, D007=pump off
Timers:
100 ms timers
H0 lubrication time: as long as the counter is counting the pump
is on.
H1 waiting the for turning the machine on. After the MACHINE ON
softkey was pressed, the PLC is waiting for such a long time
the emergency status to be off. If during this time the
emergency status will be OK PLC starts initialization. If
this time is over MACHINE ON output will be turned off.
Minute timers
M0 time between two lubrications.
PLC constants
CONST1 = time between two lubrications: nx1 minute
CONST2 = lubrication time: nx100ms
CONST3 =0 spindle drive input unipolar, otherwise bipolar