Omron TJ1-MC04 - PROGRAMMING 1 Programming Manual page 227

Hide thumbs Also See for TJ1-MC04 - PROGRAMMING 1:
Table of Contents

Advertisement

Examples and tips
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.
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
PROGRAMMING MANUAL
227

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tj1-mc16 - programming 1Tj1-mc04 1

Table of Contents