Arrays; Defining Arrays; Assignment Of Array Entries - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

_DA
_DL
_DM
_HMn
_LFn
_LRn
_UL
TIME
*These keywords have corresponding commands while the keywords _LF, _LR, and TIME do not
have any associated commands. All keywords are listed in the Command Reference.

Arrays

For storing and collecting numerical data, the CDS-3310 provides array space for 8000 elements. The
arrays are one dimensional and up to 30 different arrays may be defined. Each array element has a
numeric range of 4 bytes of integer (2
Arrays can be used to capture real-time data, such as position and torque values. In the contouring
mode, arrays are convenient for holding the points of a position trajectory in a record and playback
application.

Defining Arrays

An array is defined with the command DM. The user must specify a name and the number of entries
to be held in the array. An array name can contain up to eight characters, starting with an uppercase
alphabetic character. The number of entries in the defined array is enclosed in [ ].

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.
Array elements are addressed starting at count 0. For example the first element in the posA array
(defined with the DM command, DM posA[7]) would be specified as posA[0].
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: Arrays must be defined using the command, DM, before assigning entry values.
CDS-3310
*Returns the number of arrays available
*Returns the number of available labels for programming
*Returns the available array memory
*Returns status of Home Switch of axis 'n' (equals 0 or 1)
Returns status of Forward Limit switch input of axis 'n' (equals 0 or 1)
Returns status of Reverse Limit switch input of axis 'n' (equals 0 or 1)
*Returns the number of available variables
Free-Running Real Time Clock (off by 2.4% - Resets with power-on).
NOTE: TIME does not use an underscore character (_) as other keywords.
v1=_LFA
v3=TIME
v4=_HMD
DM posA[7]
Defines an array names posA with seven entries
DM speed[100]
Defines an array named speed with 100 entries
DM posA[0]
Frees array space
Assign v1 the state of the Forward Limit Switch on the A-axis
Assign v3 the current value of the time clock
Assign v4 the logical state of the Home input on the D-axis
31
)followed by two bytes of fraction (+/-2,147,483,647.9999).
Chapter 7 Application Programming
i
39

Advertisement

Table of Contents
loading

Table of Contents