Find Docs

Galil Motion Control - programming (Page 6)

Wodocs >> Electronics : Motion Control >> Galil Motion Control programming Page 6
Galil Motion Control - programming
Technical Reference
Motion Programming
10
www.galilmc.com / Galil Motion Control, Inc.
Data Input & Output
Many applications require data to be input from an operator or
controller messages to be displayed. For easy operator interface,
the DMC has commands that display messages and prompt the
operator for data.
Sending a message.
Messages can be sent to the host computer using the mes-
sage command MG.
MG "The final value is", RESULT {F5.2} sends the message "The
final value is 00000.00" to the host computer.The value for the
variable RESULT is displayed with a format of 5 digits to the left
of the decimal and 2 to the right.
Prompt for data.
Operators are prompted to input data with the input statement
IN which contains a text message.
IN "Input speed",SPX
The above statement sends the prompt "Input speed" to the
PC screen.The entered value is assigned to the variable SPX.
Multitasking
Complex applications often require several independent tasks be
executed at the same time.The DMC allows simultaneous execution
of up to eight independent application programs.This is an ideal fea-
ture for executing independent operations or PLC tasks in the back-
ground.
Each separate task is defined as task 0 through 7.Any task can be
executed or halted from another task.For example:XQ#POS1,0
begins Task 0; HX0 halts Task 0.All DMC commands, including event
triggers and conditionals, can be used in each task.However, input
interrupts and input prompts are available only in Task 0.
This program prompts the operator for the cut length.A position move is
then commanded.The encoder resolution is 4000 counts/inch.
INSTRUCTION
INTERPRETATION
#BEGIN
Label
AC 800000
Specify acceleration
DC 800000
Specify deceleration
SP 5000
Specify speed
LENGTH = 3.4
Initial length in inches
#CUT
Cut routine
IN "Enter length",LENGTH Prompt to enter length
PR LENGTH*4000
Convert position to counts
BG X
Begin motion
AM X
After motion complete
SB1
Set bit 1, turn on cutter
WT 100;CB1
Wait 100 msec, turn off cutter
JP #CUT
Repeat cut process
EN
End program
Example--Data Input & Output
The example below shows how four independent programs can be exe-
cuted simultaneously from the DMC memory.The main task #MAIN
starts all the other tasks,#PLC1, #PLC2, #MOVE, after Input 1 goes high.
It halts all tasks when Input 1 goes low. #PLC1 sets Output 2 only
when Input 2 and Input 3 are high.#PLC2 generates a waveform on
Output 1 which is high for 10 msec and low for 40 msec.#MOVE repeti-
tively moves the X axis 100 counts.
INSTRUCTION
INTERPRETATION
#MAIN
Main Program --Task 0
AI1
After Input 1 high
XQ#PLC1,1
Execute Task 1
XQ#PLC2,2
Execute Task 2
XQ#MOVE,3
Execute Task 3
AI-1
After Input 1 low
HX
Halt all tasks
EN
End program
#PLC1
#PCL1 -- Task 1
OB2,@IN[2]&@IN[3]
Set Output 2 if Input 2 and 3 high
JP#PLC1
Loop
EN
End Task 1
#PLC2
#PLC2 -- Task 2
AT0
Set reference time
#LOOP
Loop label
SB1;AT10
Set Output 1; wait 10 msec
CB1;AT-50
Clear Output 1; at 50 msec; reset timer
JP#LOOP
Loop
EN
End Task 2
#MOVE
#MOVE -- Task 3
PR100;BGX;AMX
Move 100 counts
WT20;JP#MOVE
Wait 20 msec and repeat
EN
End Task 3
Example--Multitasking, Background PLC

<< 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)