Case function, 4 f o rm ulas – HEIDENHAIN ND 2100G User Manual
Page 201

ND 2100G GAGE-CHEK
201
2.4 F
o
rm
ulas
Case function
The Case function performs logical sorting tests to assign values to
dimensions or perform operations based on the test result case, or
classification. The logical tests use test criteria and conditions
described earlier. Tests can be performed on channels, dimensions,
system dimensions, custom ND 2100G functions, parallel port input
pins, database contents, time, output relay state and variables.
To insert the Case function:
U
Press the OTHER... soft key
U
Press the CASE dimension key
Suppressing Case sort results
When the Case function is used to perform operations, any sort result
can be suppressed by inserting a numeric zero constant in the sort
result position. In the example shown below, no operation is
performed for the second sort result.
Case function.
Case function syntax
A = Case(Test 1, result 1, test 2, result 2, ...test n, result n)
Example 1: A value is assigned to a visible dimension
A = Case(C1<=1mm,0,C1<=2mm,1,C1>2mm,2)
A = 0 when C1<=1 mm
A = 1 when C1<=2 mm
A = 2 when C1>2 mm
Example 2: A Case function is appended to a dimension formula
using the semicolon function described earlier. This Case function
will perform an operation; it sends one of three messages
depending on the value of C1.
A = C4;Case(C1<=1mm,SendMsg”Case 1”,
C1<=2mm,SendMsg”Case 2”,C1>2mm,SendMsg”Case 3”)
A = C4 and when C1<=1 mm the message “Case 1” is sent to the
RS-232 port
A = C4 and when C1<=2 mm the message “Case 2” is sent to the
RS-232 port
A = C4 and when C1>2 mm the message “Case 3” is sent to the
RS-232 port
This Case function could also be assigned to a hidden dimension:
H1 = Case(C1<=1mm,SendMsg”Case
1”,C1<=2mm,SendMsg”Case 2”,C1>2mm,SendMsg”Case 3”)