EasyManuals Logo

Galil Motion Control DMC-1000 User Manual

Galil Motion Control DMC-1000
206 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #125 background imageLoading...
Page #125 background image
106 • Chapter 7 Application Programming DMC-1000
Example - USING THE COMMAND, DM
Instruction Interpretation
DM POSX[7] Defines an array names POSX with seven entries
DM SPEED[100] Defines an array named speed with 100 entries
DM POSX[0] Frees array space
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 POSX array
(defined with the DM command, DM POSX[7]) would be specified as POSX[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.
Examples - assigning values to array entries
Instruction Interpretation
DM SPEED[10] Dimension Speed Array
SPEED[1]=7650.2 Assigns the first element of the array, SPEED the value 7650.2
SPEED[1]= Returns array element value
POSX[10]=_TPX Assigns the 10th element of the array POSX the returned value from the tell
position command.
CON[2]=@COS[POS]*2 Assigns the second element of the array CON the cosine of the variable POS
multiplied by 2.
TIMER[1]=TIME Assigns the first element of the array timer the returned value of the TIME
keyword.
Using a Variable to Address Array Elements
An array element number can also be a variable. This allows array entries to be assigned sequentially
using a counter. For example;
Instruction Interpretation
#A Begin Program
COUNT=0;DM POS[10] Initialize counter and define array
#LOOP Begin loop
WT 10 Wait 10 msec
POS[COUNT]=_TPX Record position into array element
POS[COUNT]= Report position
COUNT=COUNT+1 Increment counter
JP #LOOP,COUNT<10 Loop until 10 elements have been stored
EN End Program
The above example records 10 position values at a rate of one value per 10 msec. The values are
stored in an array named POS. The variable, COUNT, is used to increment the array element counter.
The above example can also be executed with the automatic data capture feature described below.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Galil Motion Control DMC-1000 and is the answer not in the manual?

Galil Motion Control DMC-1000 Specifications

General IconGeneral
BrandGalil Motion Control
ModelDMC-1000
CategoryController
LanguageEnglish

Related product manuals