Examples and tips
PROGRAMMING MANUAL
227
Revi
si
on 3.0
Example
'================================================
'THE FIRST PART OF THE PROGRAM IS GENERATED
'AUTOMATICALLY BY THE INTELLIGENT AXIS WINDOW IN
'TRAJEXIA TOOLS. IT CONSISTS OF A CHECK SEQUENCE TO
'VERIFY THAT THE DETECTED AXIS CONFIGURATION IS THE
'EXPECTED ONE.
'IF YES, THE PROGRAM FINISHES AND STARTS "SHELL".
'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 devices
' Unit 0
IF NOT MECHATROLINK(0,3,0) THEN
PRINT "Error getting device count for unit 0"
STOP
ELSE
IF VR(0) <> 3 THEN
PRINT "Incorrect device count for unit 0"
STOP
ENDIF
ENDIF
IF NOT MECHATROLINK(0,4,0,0) THEN
PRINT "Error getting address for unit 0, station 0"
STOP
Note
OMRON recommends that the statement
RUN
“your_program”
is used at the end of the Startup pro-
gram to start your application program. The application
program starts when the startup program is executed
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
MECHATROLINK-II bus.
I52E-EN-03.book Seite 227 Freitag, 29. Juni 2007 11:55 11