Data types for recording, Example - recording into an array – Yaskawa LEGEND-MC User Manual
Page 318
308
LEGEND-MC User’s Manual
Data Types for Recording
NOTE: X may be replaced by Y,Z or W for capturing data on other axes, or A,B,C,D,E,F,G,H for LEG-
END-MC.
Example - Recording into An Array
During a position move, store the X and Y positions and position error every 2 msec.
RC n,m
The RC command begins data collection. Sets data capture
time interval where n is an integer between 1 and 8 and
designates 2n msec between data. m is optional and specifies
the number of elements to be captured. If m is not defined, the
number of elements defaults to the smallest array defined by
DM. n=0 stops recording.
RC? or V=_RC
Returns a 0 or 1 where, 0 denotes not recording, 1 specifies
recording in progress
_DEX
2nd encoder position (dual encoder)
_TPX
Encoder position
_TEX
Position error
_RPX
Commanded position
_RLX
Latched position
_TI
Inputs
_OP
Output
_TSX
Switches (only bit 0-4 valid)
_SCX
Stop code
_TBX
Status bits
_TTX
Torque (reports digital value +/-32703)
#RECORD
Begin program
DM XPOS[300],YPOS[300]
Define X,Y position arrays
DM XERR[300],YERR[300]
Define X,Y error arrays
RA XPOS[],XERR[],YPOS[],YERR[]
Select arrays for capture
RD _TPX,_TEX,_TPY,_TEY
Select data types
PR 10000,20000
Specify move distance
RC1
Start recording now, at rate of 2 msec
BG XY
Begin motion
#A;JP #A,RC=1
Loop until done
MG "DONE"
Print message
EN
End program
#PLAY
Play back