EasyManua.ls Logo

Galil Motion Control DMC-4123 - Executing Programs - Multitasking

Galil Motion Control DMC-4123
237 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
NOTE: The NO command is an actual controller command. Therefore, inclusion of the NO commands will require
process time by the controller.
Difference between NO and ' using the GDK software
The GDK software will treat an apostrophe (') commend different from an NO when the compression algorithm is
activated upon a program download (line > 80 characters or program memory > 4000 lines). In this case the
software will remove all (') comments as part of the compression and it will download all NO comments to the
controller.
Executing Programs - Multitasking
The DMC-41x3 can run up to 8 independent programs simultaneously. These programs are called threads and are
numbered 0 through 7, where 0 is the main thread. Multitasking is useful for executing independent operations
such as PLC functions that occur independently of motion.
The main thread differs from the others in the following ways:
1. When input interrupts are implemented for limit switches, position errors or command errors, the
subroutines are executed as thread 0.
To begin execution of the various programs, use the following instruction:
XQ #A, n
Where n indicates the thread number. To halt the execution of any thread, use the instruction
HX n
where n is the thread number.
Note that both the XQ and HX commands can be performed by an executing program.
The example below produces a waveform on Output 1 independent of a move.
#TASK1
Task1 label
AT0
Initialize reference time
CB1
Clear Output 1
#LOOP1
Loop1 label
AT 10
Wait 10 msec from reference time
SB1
Set Output 1
AT -40
Wait 40 msec from reference time, then initialize reference
CB1
Clear Output 1
JP #LOOP1
Repeat Loop1
#TASK2
Task2 label
XQ #TASK1,1
Execute Task1
#LOOP2
Loop2 label
PR 1000
Define relative distance
BGX
Begin motion
AMX
After motion done
WT 10
Wait 10 msec
JP #LOOP2,@IN[2]=1
Repeat motion unless Input 2 is low
HX
Halt all tasks
The program above is executed with the instruction XQ #TASK2,0 which designates TASK2 as the main thread (i.e.
Thread 0). #TASK1 is executed within TASK2.
Chapter 7 Application Programming ▫ 104 DMC-41x3 User Manual

Table of Contents

Related product manuals