2 module technique – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual
Page 478

2.1.2 Module technique
It is good practice to make the maintenance of the PLC programs easier by creating the program
with the most transparent structure possible. This can be best achieved by dividing the PLC program
into individual modules (structured programming).
Only the most important PLC functions should be programmed in the main routine.
Individual PLC functions such as spindle orientation and key simulation are programmed in their own
modules.
0
L M2719
1
SN M2719
;Activate the strobes for Word processing
2
L M2497
3
SN M2497
;Activate the edge evaluation
4
L M2496
5
SN M2496
;Activate transfer of decoded M codes
;(M1900 to M1999)
.
.
.
.
.
.
.
.
.
20
L M1919
;M Function M19
21
A M2045
;Change signal for M function
22
AN M12
;Spindle orientation already active?
23
CMT 180
;Spindle orientation
24
LM 2182
;Disabled key operated?
25
CMT 31
;Yes, then call key simulation
.
.
.
.
.
.
.
.
.
150
EM
;End main program
151
LBL 31
;Key simulation
.
.
.
.
.
.
.
.
.
200
EM
201
LBL 180
;Spindle orientation
.
.
.
.
.
.
.
.
.
259
EM
.
.
.
.
.
.
.
.
.
Error conditions in the machine should be interrogated in the PLC program and a plain language error
message should be displayed on the VDU screen. See chapter "Machine integration", section
"Display and operation" and chapter "PLC programming", section "Modules".