Examples and tips
PROGRAMMING MANUAL
246
R
e
vi
si
o
n
1
.0
Example
'================================================
'THE FIRST PART OF THE PROGRAM
'CONSISTS OF A CHECK SEQUENCE TO
'VERIFY THAT THE DETECTED AXIS CONFIGURATION IS THE
'EXPECTED ONE.
'IF YES, THE PROGRAM FINISHES AND STARTS "APPLICATION".
'IF NOT, THE PROGRAM STOPS AND NO OTHER PROGRAM STARTS.
'THIS PROGRAM MUST BE SET TO RUN AT POWER UP IN 'A LOW
'PRIORITY TASK (1 IN THIS EXAMPLE)
'================================================
'Start MECHATROLINK Section
' Check detected slaves
' Unit 0
IF NOT MECHATROLINK(0,3,0) THEN
PRINT "Error getting slave count for unit 0"
STOP
ELSE
IF VR(0) <> 3 THEN
PRINT "Incorrect slave count for unit 0"
STOP
ENDIF
ENDIF
Note
The SHELL program by default runs at startup at priority 0.
Note
OMRON recommends that the statement
RUN “APPLICATION”
is used in the Startup program to start your application program.
The application program starts when the startup program is exe-
cuted successfully and without errors.
If you set an application program to “Run at startup” there is a risk
that the machine starts if there is an error on the MECHATRO-
LINK-II bus.