Examples for Expression
When you use the accumulated judgement result in the expression
Obtain the overall judgement result for all the units lying ahead of Unit No. in which an expression has been set up. Use when you need to perform branch to the measurement based on the measurement results.
For example, perform condition branching based on the overall judgement result by Unit 0 to 4.
- Set up the [Conditional Branch] in Unit 5. Set up the following expressions in Expression A and B respectively.
- Expression A:TJG
Get the overall judgement result of Unit0 to Unit4. Output the following overall result based on the judgement result of Unit0 to Unit4.
Table:
TJG Result List
|
|
All the unit's judgement result are OK
|
|
The judgement result of one or more unit are NG
|
|
- Expression B: 1
Set up the value that will be compared with the value of A (TJG value).
- Set the condition of the expression to "A = B".
Take A = B, namely TJG = 1, as the condition, as a sequence, if all the judgement result of Unit 0 to 4 are OK, then the condition judgement result will be YES
- Set up the Branch target respectively.
If "Yes", continue to Unit 6; If "No", continue to Unit 8.
When you use the unit judgement result (JG) in expression
The following 2-step procedure should be performed when you use the unit judgement result in expression.
Step 1: make Judge based on the Judgement conditions defined for each unit.
The result "1" (OK) or "-1" (NG) will be output in Result.
Step 2:The output expression result from Step 1 is judged based on the upper limit and the lower limit for judgement.
Example 1: use the judgement result of Unit 1
Step 1: The judgement result (U1.JG) of Unit 1 are used in expression.
According to the Judgement condition of unit 1, "Result" will display "1: OK" or "-1: NG".
Step2: Based on the upper limit and the lower limit for judgement, the Expression result (U1.JG) of Step 1 will be judged.
To specify the setting to decide that expression is OK only when the result of Step 1 is OK, you must specify "1" to both the upper limit and the lower limit for judgement.
Example 2: use the judgement result of Unit 0 and Unit 1 together
When both Unit 0 and Unit 1 are OK, the Expression Judge will be OK.
Step 1: The result by adding the judgement result (U0.JG, U1.JG) of Unit 0 and Unit 1 is used in the expression.
The result that is produced by adding the Judge value (1: OK/-1: NG) based on the judgement conditions of unit 0 and the Judge value (1: OK/-1: NG) based on the judgement conditions of unit 1 is displayed in "Result".
Step2: The Expression result of Step 1 is judged based on the upper limit and the lower limit for judgement.
When "2" is specified for both the upper limit and the lower limit for judgement, the expression judgement is OK when both units 0 and 1 are judged as OK.
Table:
Judgement result of the expression when the judgement result of both Unit 0 and 1 are used
Judge of Unit 0 (Judge value)
|
Judge of Unit 1 (Judge value)
|
Expression result (Sum of the judgement result of Unit 0 and of Unit 1)
|
Judgement result of expression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using Judgement of other expressions
Up to 8 expressions can be set up in one single unit.
The value of other expressions in the same unit can also be used.
Since Expression results obtained by the expression are displayed as DO0 to DO7 and Judgement result of expression are displayed as J00 to J07, the setup by Unit No/Expression Result should be performed for "U3. DO0" (Expression result of Expression 1 that is set up in Processing Item "Expression" of Unit3).
Value Available in Expression
Example1: In the edge area, calculate the distance of the reference and that of the measurement results, and output the difference between these two distances.
Set up expressions according to the following requirements.
- Expression 0.DIST(U1.SX,U1.SY,U2.SX,U2.SY)
The equation that is used to the calculate the distance between the reference positions of Unit1 and Unit2.
You can use the function DIST to calculate the distance between these two points.
Setting up Function
- Expression 1: DIST(U1.X,U1.Y,U2.X,U2.Y)
The equation that is used to the calculate the distance between the measurement position of unit 1 and that of unit 2.
You can use the function DIST to calculate the distance between these two points.
Setting up Function
- Expression 2: U3.DO1-U3.DO0
(Unit 3: Expression "Expression 1" - Unit 3: Expression "Expression 0"
The equation that is used to calculate the difference between the operational result of Operation 1 and that of Operation 0 of unit 3 (in this case, Operation).
Note
Calculating Order of Expressions
- If you want to use the equation which is used for the Expression of other operational results, please substitute a higher Expression No. for the former No.. Otherwise, the operational result obtained by instituting the former Expression No. will be used for the substitution.
Example 2: Calculate the number of measurement
The number of measurement can be obtained by adding "1" to the operation code NO..
Note - When calculation results are cleared or the power is turned off, U3.DO0 will be initialized to be "0", and the number of measurement will also be reset.