![background image](http://html1.mh-extra.com/html/omron/fh-1-series/fh-1-series_user-manual_742686245.webp)
WWW.NNC.IR
Basic Knowledge For Macro Customize
Functions
243
5
Optimizing Scene
s (
M
ea
su
re
men
t Flo
w
s)
(M
acr
o
Custo
m
ize
Fu
ncti
ons)
Vision System FH/FZ5 Series
User’s Manual (Z340)
Stopping the Program When a Specific Condition is Met
The program can also be stopped when a specific condition is met. Setting an appropriate condition allows
the location of an error to be identified more efficiently than with the Stop function.
*MCRINIT
Debug 18
Rem Use the SetStop function to set the program stop condition so that the program stops when the Stop function
parameter is 0
SetStop Str$(0)
Return
*MEASUERPROC
Rem The actual measurement process is written from here
POS.X#=(POS0.X@ + POS1.X@) / 2
POS.Y#=(POS0.Y@ + POS1.Y@) / 2
Rem Execute the Stop function and stop the program on the line where the POS.X# variable is 0
Stop Str$(POS.X#)
Rem Execute the Stop function and stop the program on the line where the POS.Y# variable is 0
Stop Str$(POS.Y#)
Print POS.Y# / POS.X#
Return
A true/false relational expression (true: -1, false: 0) can also be set as the condition for the Stop function.
Example: Stopping the program when the CORRELATION& variable is less than 60
Set the SetStop function so that the program stops when the relational expression is true (-1).
SetStop Str$(-1)
The Stop function stops the program when the relational expression CORRELATION& < 60 is true.
Stop Str$(CORRELATION& < 60)
Note
Summary of Contents for fh-1 series
Page 8: ...WWW NNC IR 6 Vision System FH FZ5 Series User s Manual Z340...
Page 14: ...WWW NNC IR 12 Vision System FH FZ5 Series User s Manual Z340 MEMO...
Page 22: ...WWW NNC IR 20 Vision System FH FZ5 Series User s Manual Z340 MEMO...
Page 48: ...WWW NNC IR Initializing the Controller 46 Vision System FH FZ5 Series User s Manual Z340 MEMO...
Page 68: ...WWW NNC IR Editing Scene Groups 66 Vision System FH FZ5 Series User s Manual Z340 MEMO...
Page 881: ...WWW NNC IR...