9-6 Programming Examples
Example Programs
Trio Motion Technology
The above example shows only the simplest form of the main loop. It allows
for a fixed offset value of 20, but there is no provision for error handling etc.
An example where the code might be expanded to check for registration errors
would be:
loop:
DEFPOS(0)
REGIST(3)
MOVE(card_pitch)
WAIT UNTIL MARK OR MTYPE=0
IF MTYPE=0 THEN
‘ Indicate error to user
PRINT #3,”Registration Error!”
errors=errors+1
if errors>max_errors then GOTO reg_failed
OP(error_lamp,ON)
ELSE
OP(error_lamp,OFF)
MOVEMODIFY(reg_pos+20)
WAIT IDLE
ENDIF
‘ Rest of loop as before
GOTO loop
reg_failed:
PRINT #3,CURSOR(00);”Too many reg errors!”
PRINT #3,CURSOR(20);”Press any key... ”
GET #3,k
GOTO start
Example 4 - 2 Axis Pick & Place System
Overview
A square palette has sides 1200mm long.
It must be divided into a grid, each of these positions on the palette contains a
box into which a widget must be placed: