Arrays, Defining arrays, Assignment of array entries – Yaskawa SMC–4000 User Manual

Page 337

Advertising
background image

327

SMC–4000 User Manual

Arrays

For storing and collecting numerical data, the SMC–4000 provides array space for 15000 elements in up
to 30 arrays. Arrays can be used to capture real-time data, such as position, torque and analog input
values. In the contouring mode, arrays are convenient for learning a position trajectory and later playing
it back.

Defining Arrays

An array is defined by a name and number of entries using the DM command. The name can contain up
to eight characters, starting with an uppercase alphabetic character.

The number of entries in the defined array is enclosed in [ ].

Up to 30 different arrays may be defined. The arrays are one dimensional.

All array elements have the same structure as variables, 48 bit fixed decimal point.

Example:

Each array element has a numeric range of 4 bytes of integer (2

31

)followed by two bytes of fraction

(+/-2,147,483,647.9999).

Array space may be de-allocated using the DA command followed by the array name. DA*[0]
de-allocates all the arrays.

Assignment of Array Entries

Like variables, each array element can be assigned a value. Assigned values can be numbers or returned
values from instructions, functions and keywords.

Values are assigned to array entries using the equal sign. Assignments are made one element at a time by
specifying the element number with the associated array name.

*Note Remember to define arrays using the DM command before assigning entry values.

DM POSX[7]

Defines an array named POSX with seven entries

DM SPEED[100]

Defines an array named speed with 100 entries

DM POSX[0]

Frees array space

Advertising