Dinbin, 4 f o rm ulas – HEIDENHAIN ND 2100G User Manual
Page 232

232
2 Installation and Specifications
2.4 F
o
rm
ulas
DinBin
Insert the DinBin function to read the logic levels of multiple parallel
port input pins simultaneously as a decimal equivalent. The decimal
value can be included directly in a dimension formula as a variable, or
can be tested in conditional if and case statements.
To insert the DinBin function:
U
Press the OTHER... soft key
U
Press the XTRA dimension key
U
Use the arrow cursor keys to highlight DinBin
U
Press the ENTER key
DinBin function.
DinBin function syntax
A = DinBin(Lines)
The logic levels at the Din pins are assigned to a dimension as a
decimal value. Lines is a decimal value of the binary mask that
specifies which input pins to read.
Example:
A = DinBin(19)
Includes a lines value of 19, which when converted to a binary mask
of 10011, reads Din(1), Din(2) and Din(5). All unread pins are given
a logical value of zero. The binary value of the input pins read at the
parallel port are then returned as a decimal equivalent.
A = DinBin(19)
A = 17
When:
When the input pin logic levels are 10101
The lines mask value is decimal 19 = 10011
The masked result is 10001 = decimal 17
Din
5
4
3
2
1
Din logic level
1
0
1
0
1
Lines mask
(dec 19)
1
0
0
1
1
Masked value
(dec 17)
1
0
0
0
1