beautypg.com

Automatic data capture into arrays, Example - recording into an array – Yaskawa SMC–4000 User Manual

Page 339

background image

329

SMC–4000 User Manual

Automatic Data Capture into Arrays

The SMC–4000 provides a special feature for automatic capture of data such as position, position error,
inputs or torque. This is useful for teaching motion trajectories or observing system performance. Up to
eight types of data can be captured and stored in eight arrays. The capture rate or time interval may be
specified.

Commands used:

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

SMC–4000.

Example - Recording into An Array

During a position move, store the X and Y positions and position error every 2 msec.

RA n[ ],m[ ],o[ ],p[ ]

Selects up to four arrays for data capture. The arrays must be

defined with the DM command.

RD_TI,_TPX,_SCZ,_TSY

Selects the type of data to be recorded. See the table below for

the various types of data. The order of data type is important

and corresponds with the order of n,m,o,p arrays in the RA

command. In this example, the _TI input data is stored in the

first array selected by the RA command.

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