Example; Program Flow Commands; Event Triggers & Trippoints - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

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 003. The user can then
query the controller using the command, TC1. The controller responds with the corresponding
explanation:

Program Flow Commands

The CDS-3310 provides instructions to control program flow. The CDS-3310 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 CDS-3310 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 CDS-3310 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 CDS-3310 can make decisions based on its own status or external events without
intervention from a host computer.
22 • Chapter 7 Application Programming
Instruction
:ED
000 #A
001 PR1000
002 BGA
003 PR5000
004 EN
<cntrl> Q
:XQ #A
?003 PR5000
:TC1
?7 Command not valid while running.
:ED 3
003 AMX;PR5000;BGA
<cntrl> Q
:XQ #A
Interpretation
Edit Mode
Program Label
Position Relative 1000
Begin
Position Relative 5000
End
Quit Edit Mode
Execute #A
Error on Line 3
Tell Error Code
Command not valid while running
Edit Line 3
Add After Motion Done
Quit Edit Mode
Execute #A
CDS-3310

Advertisement

Table of Contents
loading

Table of Contents