BASIC commands
PROGRAMMING MANUAL
170
R
e
vi
si
o
n
1
.0
3.2.240 REG_POSB
/i
Example
A paper cutting machine uses a CAM profile shape to quickly draw paper
through servo driven rollers, and stop the paper so it can be cut. The paper is
printed with a registration mark. This mark is detected and the length of the
next sheet is adjusted by scaling the CAM profile with the third parameter of
the CAM command:
' Example Registration Program using CAM stretching:
' Set window open and close:
length=200
OPEN_WIN=10
CLOSE_WIN=length-10
GOSUB Initial
Loop:
TICKS=0' Set millisecond counter to 0
IF MARK THEN
offset=REG_POS
' This next line makes offset -ve if at end of sheet:
IF ABS(offset-length)<offset THEN offset=offset-length
PRINT "Mark seen at:"offset[5.1]
ELSE
offset=0
PRINT "Mark not seen"
ENDIF
' Reset registration prior to each move:
DEFPOS(0)
REGIST(3+768)' Allow mark at first 10mm/last 10mm of sheet
CAM(0,50,(offset*0.5)*cf,1000)
WAIT UNTIL TICKS<-500
GOTO Loop
Note: variable
cf
is a constant that is calculated depending on the draw length
of the machine per encoder edge.
See also
AXIS
,
MARK
,
REGIST
.
Type
Axis parameter (read-only)
Syntax
REG_POSB
Description
The
REG_POSB
parameter stores the position in user units at which the sec-
ondary registration event occurred.
Arguments
N/A
Example
No example.
See also
AXIS
,
MARKB
,
REGIST
.