Expression Usage Examples

Perform Judgement by Combining Unit Judgement Results

Example 2: Perform judgement by combining the judgement results of unit 0 and unit 1
If a judgement of OK for both unit 0 and unit 1 is achieved, a judgement of OK for the calculation will be achieved.
Calculation example of using the judgement results of units 0 and 1
Step1: The sum of the judgement results (U0.JG, U1.JG) for unit 0 and unit 1 is set in the expression.
The sum of adding the judgement value (1: OK/-1: NG) based on the unit 0 judgement conditions and the judgement value (1: OK/-1: NG) based on the unit 1 judgement conditions is displayed in "Result".
Step2: The expression result of step 1 is judged based on judgement upper and lower limits.
When "2" is set for both the judgement upper and lower limits, the calculation judgement of OK is achieved when both units 0 and 1 are judged as OK.
Judgement results of unit 0
(Judgement value)
Judgement results of unit 1
(Judgement value)
Expression result
(Summation results of
judgement values for units 0 and 1)
Judgement result of expression
OK (1)
OK (1)
2
OK
NG (-1)
OK (1)
0
NG
OK (1)
NG (-1)
0
NG
NG (-1)
NG (-1)
-2
NG

Using Values of Other Expressions

Up to 8 expressions can be set in 1 expression unit.
The value of other expressions set within the same unit can also be used.
Since expression results obtained by the expression are displayed as D00 to D07 and judgement results of expression are displayed as J00 to J07, this is set to "U3.D00" (results of expression 0 set for processing item [Calculation] of unit number "3") using "unit number calculation results".
For the following scene settings:
Sample scene
Example 1: Calculate the reference position distance and measurement results distance for the edge position and output the difference between the two.
Illustration of measurement example using values from other expressions
Set expressions in the following manner.
  • Calculation 0: DIST (U1.SX, U1.SY, U2.SX, U2.SY)
    This expression is used to calculate the distance between the reference positions of unit 1 and unit 2.
    The function "DIST" calculates the distance between 2 points.
  • Calculation 1: DIST (U1.X,U1.Y,U2.X,U2.Y)
    This expression is used to calculate the distance between the measurement positions of unit 1 and unit 2.
    The function "DIST" calculates the distance between 2 points.
  • Calculation 2: U3.D01 - U3.D00
    (Unit 3: Calculation [Calculation 1] - Unit 3: Calculation [Calculation 0])
    This equation is used to calculate the difference between results of Calculation 1 and Calculation 0 in unit 3 (in this example, Operation).
Reference
Calculating order of expressions
  • Expressions that use the expression results of other expressions must be set with an expression number that is higher than that of the substituted expression. If it is set with a number smaller than the number of the substituted expression, previous expression results of the substituted expression will be inserted.
Calculating order of expressions
Illustration of calculating order of expressions

Counting Number of Measurements

Example of counting the measurement counts
The measurement count is counted by adding "1" to each calculation number 0.
Reference
  • When expression results are cleared or the power is turned off, U3.D00 will return to "0" and the measurement counts will also be reset.