Program Flow Commands - Galil Motion Control DMC-21 5 Series User Manual

Table of Contents

Advertisement

Debugging Example
The following program has an error. It attempts to specify a relative movement while the A axis is already in
motion. When the program is executed, the controller stops at line 3. The user can then query the controller using
the command, TC1. The controller responds with the corresponding explanation:
#a
SH
A;
PR
1000;
BG
A;
PR
5000;
EN;
From Terminal
:XQ #a
:?4 PR 5000
TC1
7 Command not valid while
running
:XQ #a

Program Flow Commands

The DMC-21x5 provides instructions to control program flow. The controller program sequencer normally executes
program instructions sequentially. The program flow can be altered with the use of event triggers, trippoints, and
conditional jump statements.
Event Triggers & Trippoints
To function independently from the host computer, the DMC-21x5 can be programmed to make decisions based
on the occurrence of an event. Such events include waiting for motion to be complete, waiting for a specified
amount of time to elapse, or waiting for an input to change logic levels.
The DMC-21x5 provides several event triggers that cause the program sequencer to halt until the specified event
occurs. Normally, a program is automatically executed sequentially one line at a time. When an event trigger
instruction is decoded, however, the actual program sequence is halted. The program sequence does not continue
until the event trigger is "tripped". For example, the motion complete trigger can be used to separate two move
sequences in a program. The commands for the second move sequence will not be executed until the motion is
complete on the first motion sequence. In this way, the controller can make decisions based on its own status or
external events without intervention from a host computer.
Chapter 7 Application Programming ▫ 82
OPERAND
_ED0
Contains the last line of program execution
_DL
Contains the number of available labels
_UL
Contains the number of available variables
_DA
Contains the number of available arrays
_DM
Contains the number of available array elements
Table 7.2: List of operands related to memory on the DMC-21x5
:
'program Label
'enable A axis
'position relative move of 1000 counts
'begin motion
'position relative move of 5000 counts
'end program
Change line 4 to
DESCRIPTION
BGA;AMA
and re-download the program.
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents