Find Docs

Galil Motion Control - programming (Page 7)

Wodocs >> Electronics : Motion Control >> Galil Motion Control programming Page 7
Galil Motion Control - programming
Technical Reference
Motion Programming
www.galilmc.com
/
Galil Motion Control, Inc.
11
Arrays
Arrays are ordered structures in memory where data can be
stored and retrieved.They are useful for storing sequences of
position points or output signals.
An array is characterized by a name and a size. Each element
in the array is identified by its index. For example, the array XPOS
may have a size of 100 units. As a consequence, each point is
identified as XPOS [N] where N varies between 0 and 99.
To store data in the array, we use an instruction such as
XPOS [5] = _TPX which reads the current position of the X axis
and stores the value in the array.The value of the position may
be later retrieved with instructions of the form X = XPOS [5]
which transfers the position value to the variable X.
The use of arrays is illustrated by the following example.
One of the main uses of the array is for recording motion as
described in the following section.
The controller is required to move an XY table to four positions characterized by their coordinates.The values of the required points are stored in the
arrays XPOS and YPOS. Once the controller reaches the specified point, it must wait a certain amount of time before resuming the motion.The waiting
time in milliseconds is stored in the array WAIT.
The program is described in two parts.The first part, RUN, performs the moves according to the requirements.The second part, #STORE, defines the arrays.
INSTRUCTION
INTERPRETATION
#RUN
Label
JS #STORE
AC 200000,200000
Accelerations
DC 200000,200000
Decelerations
SP 50000,50000
Speeds
N = 0
Initial count
#LOOP
PA XPOS [N], YPOS [N]
Specify final position
BGXY
Start motion
AMXY
Wait for completion
WT WAIT [N]
Wait specified time interval
N = N+1
Increment index
JP#LOOP, N<4
Repeat 4 times
EN
End program
INSTRUCTION
INTERPRETATION
#STORE
Label
DM XPOS [4], YPOS [4], WAIT [4] Define arrays
XPOS [0] = 100
Set values
XPOS [1] = 320
XPOS [2] = 450
XPOS [3] = 500
YPOS [0] = -100
YPOS [1] = 20
YPOS [2] = 153
YPOS [3] = 200
WAIT [0] = 50
WAIT [1] = 100
WAIT [2] = 60
WAIT [3] = 120
EN
End program
SET X-Y SPEED, ACCEL
AND DECEL
N=0
READ XPOS[N], YPOS[N]
COMMAND X-Y MOTION
WAIT FOR END OF MOTION
WAIT FOR REQUIRED TIME
N=N+1
LOOP
END
YES
NO
N<4
Flowchart for Array Program
Example--Array

<< Previous       1 2 3 4 5 6 7 8 9 10 11 12 13       Next >>



Other Documents:
softorder, system, utilities, wsdk, activelife, camalot, mojavaton, smmov, Filter Equiv, note 1410, note 1411, note 1412, eseries brochure, ethernet dmc 21x 2, ethernet emerge, ethernet flight, ethernet horizons, pr 03 30 00, pr 10 1 98, pr 10 20 99, pr 11 30 00, pr 1 13 00, pr 2 18 98, pr 3 11 98, pr 3 2 98, pr 6 15 99, pr 7 1 99, pr 8 29 00, pr 9 13 99, pr 9 9 98, db 28040 qsi, bestvalue, jacob video, icmworksheet, note 1220, note 1222, note 2311, note 2312, note 2319, note 2321, note 2326, note 3311a, note 3312, note 1419, note 1427a, note 2429, note 2438, note 4413, cadtodmc, dmcdos,


WODocs | |
All rights reserved. wodocs.com© 2009
WODocs


New Docs

Documents Category:
Arts (Design, Movies, Music, Radio, Television)
Automotive (Cars, Marine, Motorcycle, ATV, Snowmobiles)
Business (Biotechnology and Pharmaceuticals, Chemicals, Construction and Maintenance, Materials, Real Estate, Services)
Electronics (Computers, Motion Control, Power Supply)
Games (Board, Family, Party, Card, Construction, RC Toys)
Health (Animalm, Beauty, Healthcare, Medicine, Pharmacy, Surgery, Weight Loss)
Home (Accessories, Cooking, Decor and Design, Electrical, Family, Pets)
News (Newspapers, Sports, Television)
Recreation (Collecting, Hiking, Scouting, Survival, Travel)
Reference (Education, Libraries and Archives, Museums)
Science (Agriculture, Astronomy, Biology, Chemistry)
Shopping (Antiques and Collectibles, Clothing, Flowers, Food, Home and Garden)
Sports (Bicycle, Snowboard, Skiing, Other)