2 plc example – HEIDENHAIN TNC 335 Technical Manual User Manual
Page 271
4-174
TNC 360
10 Electronic handwheel
8/95
Step switch S2
Step switch for axis selection
Switch setting
PLC input
1 (Left-most setting)
I168
2
I169
3
I170
4
I171
5
I172
6
I173
7
I174
8 (Right-most setting) I175
10.4.2 PLC Example
In the following example the settings of switch S1 are assigned for the selection of the interpolation
factor through evaluation of the inputs I160 to I167 from the smallest permissible interpolation
factor from MP7670 to the largest interpolation factor = 10. They are then transferred from the PLC
to the NC (MP7640 = 5 and MP7641 = 1).
In this PLC example the minimum interpolation factor is read and processed with the PLC module
9032 from MP7670.
LB
I160
Assign the inputs I160 to I167
=
B1
to Byte 1 (0V logic, negative logic)
==
K0
If all inputs are 0, then
JPT
103
error message
LN
B1
Invert Byte 1 (positive logic)
=
B2
==
K0
If all Bits are 0, then
JPT
103
error message
LBL
100
Loop for bit test of the "inverted inputs"
L
B2
I160 to I167 in Byte 2
BT
B3
JPT
101
Jump if Bit is set, i.e. input Ixxx = 0V
L
B3
prepare next Bit for interrogation, i.e.
+
K+1
read input, if input Ixxx was not 0V.
=
B3
JP
100
LBL
101
PS
K+7670
Read the smallest interpolation factor
PS
K+0
from MP7670 with PLC module 9032
CM
9032