User guide

Chapter 5. Custom Profiling
161
Executing the Path
A PRUN command will cause the controller to find the named path definition block and
execute the path described by those commands, if that pathname has already been compiled
(PCOMP).
The use of variables as parameters in the path definition statement is a method of allowing
segment parameters to take new values each time the path is compiled. When the path is
executing, the values of the variables do not affect the path parameters. If a change in a variable
value is intended to affect the path parameters, that path must be re-compiled. The PRUN
command performs the equivalent of a GOSUB to the named path definition block.
Possible Programming Errors
It is possible to create a situation in which the segment statements are interrupted. This could
occur if an enabled ON condition becomes true. If an enabled ON condition (ONCOND)
becomes true while running a compiled path, the branch to the ONP program will result.
Motion from the path that was being executed will continue at the last segment velocity until
it is stopped. Within the ONP program, a Stop command should be issued for all axes to stop
the path from executing. For more information on program interrupts (ON conditions), see
page 29.
Programming Examples
Figure A and Figure B show two simple paths that illustrate most of the controller segment
types. For both figures, axis 1 is X and axis 2 is Y. The C and P axes are not included.
Figure A specifies the end-points with absolute coordinates. The default Work coordinate
system with start point of (0,0) is used, so no PLØ statement is needed.
Figure B specifies the end-points with incremental coordinates. The state of the programmable
outputs needs to be different for Handles than for Knobs. No other controller actions take
place during these paths.
6000 Code
SCALE1 ; Enable scaling
PSCLA25000 ; Path acceleration scaler
PSCLV25000 ; Path velocity scaler
PSCLD25000 ; Path position scaler
DEF HANDLE ; Begin HANDLE path definition
PAXES1,2 ; Set X axis as axis 1, and
; set Y axis as axis 2
PAB1 ; Use absolute coordinates
POUT1100 ; Programmable pattern for
; next segments
PARCOM10,10,0,10 ; CCW quarter circle
PLIN10,20 ; Vertical LINE segment
PARCP20,10,-10 ; CW 3/4 circle
PARCM20,0,5 ; CCW half circle
END ; End of HANDLE path definition
DEF KNOB ; Begin KNOB path definition
PAXES1,2 ; Set X axis to be axis 1, and
; set Y axis to be axis 2
PAB0 ; Use incremental coordinates
POUT0011 ; Programmable pattern for next
; segments
PLIN30,0 ; Long LINE into circular knob
PARCOM0,0,0,10 ; CCW circle for the knob
PLIN10,0 ; Short LINE out of knob
END ; End of KNOB path definition
R = 10
R = 5
(10,20)
(10,10)
(0,0) (20,0)
(20,10)
Figure A (HANDLE Example)
R = 10
(30,0)
Figure B (KNOB Example)