beautypg.com

2 plc program example – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 329

background image


4-204

TNC 407/TNC 415/TNC 425

10 Electronic handwheel

01.98

10.5.2 PLC program example

In the following example the positions of switch S1 for selecting the interpolation factor are
assigned by evaluating inputs I160 to I167 from the lowest permissible interpolation factor from
MP7670 to the maximum interpolation factor = 10 and transferred from the PLC to the NC (MP7640
= 5 and MP7641 = 1).

In this PLC example the minimum interpolation factor is read from MP7670 and processed with PLC
module 9032.

LB

I160

Assignment of inputs I160 to I167

=

B1

to byte (0V logic, negative logic)

==

K0

if all inputs are 0, then

JPT

103

error message

LN

B1

Inversion byte 1 (positive logic)

=

B2

==

K0

if all bits are 0, then

JPT

103

error message

LBL

100

Loop for bit test of "inverted inputs"

L

B2

I160 to I167 in byte 2

BT

B3

JPT

101

Jump when bit set, i.e. input Ixxx = 0V

L

B3

prepare next bit for polling, i.e.

+

K+1

read input if input Ixxx was not 0V.

=

B3

JP

100

LBL

101

PS

K+7670

Read lowest interpolation factor from

PS

K+0

MP7670 with PLC module 9032

CM

9032

PL

B4

Result is in byte 4

L

B3

Current switch position (0 to 7) plus

+

B4

minimum interpolation factor from MP7670

=

B5

is new interpolation factor

<=

K+10

if this is greater than 10, then

JPT

102

L

K+10

the new interpolation factor is set

=

B5

equal to 10.

LBL

102

PS

K+4

Transfer new interpolation factor

PS

B5

to all axis subdivision