Y_GP_VectorCompare

Y_GP_VectorCompare is used to compare the first six elements of a VECTOR with the first six elements of a second VECTOR . Machine position (in cartesian frame constitutes the first six elements of the VECTOR ) can be compared to a reference position (in cartesian frame) to generate a BOOLEAN output.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_INPUT | ||||
| B | EN | BOOL | The function will continue to execute every scan while EN is held high and there are no errors. | FALSE |
| V | Vector1 | VECTOR | Vector to be used for comparison. |
|
| V | Vector2 | VECTOR | Reference vector. |
|
| V | CartesianTol | LREAL | Tolerance to be used to compare the first three elements of the vectors. | LREAL#0.0 |
| V | RotationTol | LREAL | Tolerance to be used to compare elements 3 to 6 of the vectors. | LREAL#0.0 |
| VAR_OUTPUT | ||||
| B | ENO | BOOL | TRUE if EN is TRUE and the function is executing normally. ENO will become FALSE if an internal error occurs. If EN becomes FALSE, ENO becomes FALSE and the function output is maintained at the last state. | |
| B | OUT | BOOL | Output of the function. This will be TRUE only if the absolute delta values for all six elements of the vectors fall within the respective tolerances. | |
Notes
- Y_GP_VectorCompare can be used as an easy way to compare, for example, current machine position to a known location such as a Home position. Y_GP_VectorCompare output will be TRUE if the current machine position is within the CartesianTol for XYZ and RotationTol for RxRyRz.
- The output will be TRUE only if the absolute delta values for all six elements of the vectors fall within the respective tolerances.
- This function outputs a BOOL.
Example
If Vector1 has the following values (first 3 considered cartesian, next 3 considered rotational):
And Vector2 (considered the reference vector) has these other values:
Then, if the values for both tolerances are high enough for the values of the 2 input vectors, this function returns a bool with the value TRUE because all elements are within the respective tolerances:
Otherwise, the result will be a FALSE: