VI User Manual.pdf - 第297页

Angle and distance calculation Vision 2007 4.10 User Manua l Rev 01 10 - 3 10.2 Macros definition 10.2.1 Macro to check the distance between 2 components DISTANCE_X: fun ction to calculat e the distan ce in X direction A…

100%1 / 412
Angle and distance calculation
10 - 2 Vision 2007 4.10 User Manual Rev 01
10.1 Text file definition: .mod file
The file used for the macro definition must
have the extension .mod.
The .mod file must have the same name as
the .tst file and must be in the same directory.
When opening a .tst file or starting production, the software looks for the .mod file and analyze it:
If some errors are detected in the .mod file, a .log file is created
and displayed with the list of the unknown lines.
If you change something in the .mod file, you must re-load the
.tst file to take the changes into account:
• In Debug mode: close and open again,
• In Production mode: exit and restart production.
The number of calculation for each function is not limited. The calculation will be executed only if the
involved components are tested.
Ctrl+E and Ctrl+B are not working on these functions.
If one component is in statistical monitoring, the function will be in statistic also (they are not
transfered to SPC LightHouse software).
If one component is missing the result of the function will be missing.
Angle and distance calculation
Vision 2007 4.10 User Manual Rev 01 10 - 3
10.2 Macros definition
10.2.1 Macro to check the distance between 2 components
DISTANCE_X: function to calculate the distance in X direction
ALIGNEMENT_X = X
TOPO1
-X
TOPO2
DISTANCE_Y: function to calculate the distance in Y direction
ALIGNEMENT_Y = Y
TOPO1
-Y
TOPO2
10.2.2 Macro to check the angle between 2 components
ANGLE_2_TOPO = T
TOPO1
-T
TOPO2
If <board number> = 0 we execute the function on all the boards of the panel.
The minimum and maximum tolerances can be asynchronous. (i.e.: - 0.100
and + 0.150).
DISTANCE_X <board number>
<result name> <TOPO1> <TOPO2> <expected value > <tolerance min> <tolerance max>
DISTANCE_Y <board number>
<result name> <TOPO1> <TOPO2> <expected value > <tolerance min> <tolerance max>
ANGLE_2_TOPO <board number>
<result name> <TOPO1> <TOPO2> <expected value > <tolerance min> <tolerance max>
To know the expected value to enter in the .mod file
<expected value > = T
TOPO1
-T
TOPO2
In the .tst file:
• Board 1 & 3: T1 = 315° T2 = 45°
T1-T2 = 270°
• Board 2 & 4: T1 = 135° T2 = 225°
T1-T2 = - 90°
In the .mod file:
• ANGLE_2_TOPO 0
• SENSOR-ANGLE T1 T2 270 0.1 0.1
Board 1
at 0°
Board 3
at 0°
Board 2
at 180°
Board 4
at 180°
Topo1
Topo2
Topo1
Topo2
Topo1
Topo2
Topo1
Topo2
Angle and distance calculation
10 - 4 Vision 2007 4.10 User Manual Rev 01
10.2.3 Macro to check the angle of 1 component and 1 line
Topo1 and Topo2 will determine the straight line, and the macro
ANGLE_STRAIGHTLINE_TOPO will return the angle between this line and Topo3.
ANGLE_STRAIGHTLINE_TOPO <board number>
<result name > <TOPO1> <TOPO2> <TOPO3> <expected value > <tolerance min>
<tolerance max>
ρ
T
Topo3
θ ?
Fid 1
Topo2
Topo1
Fid 2
Y1
Y2
X2
X1
Macros definition