Example 1: Rotation
This condition returns true if the
Rotation
output from the
Shape0
tool is between 5 and
10 degrees.
Example 2: Decision
This condition returns true if the overall decision (for all tools) is 'Not found' or if the
number of blobs from the
Blob1
tool is not equal to 20.
Example 3: Calculate angle
This condition returns true if the angle from the
Plane1
tool in the XZ plane is less than
20 degrees.
Plane 1.Nx
returns the X component of the normal vector for the plane, while
Plane 1.Nz
returns the Z component. The atan() function returns the value of the angle from the Z
axis, in radians. The deg() function converts the value to degrees and returns a positive
value in the interval [0, 360].
Example 4: Condition inside condition
This condition returns true if the condition
NewCondition2
returns true or if the
Distance
output from the
Distance1
tool is less than 50 mm. When using conditions inside condi‐
tions, make sure not to create a circular dependency.
7.7.4.2
Handling arrays by conditions
In the examples below, conditions are used to create and handle arrays. Array handling
is useful for the Blob tool, which returns most results as arrays with one element for
each found blob.
Example 1: Maximum value
This condition returns true if the maximum value in the
Blob 0.area[]
array is smaller
than 50 mm
2
.
Example 2: Single element
This condition returns true if the fourth element (the element with index 3) in the
Blob0.blobAngle[]
array has a positive value.
The
element()
function accesses a specified element in the array. Note that the first ele‐
ment in the array has index 0.
OPERATION
7
8021808/12ID/2019-01 | SICK
O P E R A T I N G I N S T R U C T I O N S | TriSpector1000
45
Subject to change without notice