beautypg.com

4 f o rm ulas – HEIDENHAIN ND 2100G User Manual

Page 239

background image

ND 2100G GAGE-CHEK

239

2.4 F

o

rm

ulas

Example:

A custom function is defined to change the logic state of parallel port
output pins Dout(3) and Dout(4) to indicate four ranges of
displacement of the channel 1 probe. The value ranges of C1 and the
corresponding logic states of Dout(3) and Dout(4) are shown in this
truth table.

This custom function is defined in a hidden dimension and uses 2
parameters to set the logic states of Dout(3) and Dout(4).

H1 = DefFn1(Dout(4,Param1),Dout(3,Param2))

Later, the function is called in a Case operation and the 2 parameters
are passed in the calling statement that correspond to the logic states
of Dout(3) and Dout(4) shown in the truth table above.

H2 = Case((C1<0mm),Fn1(0,0),

((C1>=0mm)&&(C1<0.5mm)),Fn1(0,1),
((C1>=0.5mm)&&(C1<1.0mm)),Fn1(1,0),
((C1>=1.0mm)&&(C1<1.5mm)),Fn1(1,1))

C1 value range

Dout(4)

Dout(3)

<0 mm

0

0

>=0 mm AND <0.5 mm

0

1

>=0.5 mm AND <1.0 mm

1

0

>=1.0 mm AND <1.5 mm

1

1