Conditional Jumps - Galil Motion Control DMC-18 2 Series User Manual

Table of Contents

Advertisement

EN
Define Output Waveform Using AT
The following program causes Output 1 to be high for 10 msec and low for 40 msec. The cycle repeats
every 40 msec.
#OUTPUT
AT0
SB1
#LOOP
AT 10
CB1
AT –40
SB1
JP #LOOP
EN

Conditional Jumps

The DMC-18x2 provides Conditional Jump (JP) and Conditional Jump to Subroutine (JS) instructions
for branching to a new program location based on a specified condition. The conditional jump
determines if a condition is satisfied and then branches to a new location or subroutine. Unlike event
triggers, the conditional jump instruction does not halt the program sequence. Conditional jumps are
useful for testing events in real-time. They allow the DMC-18x2 to make decisions without a host
computer. For example, the DMC-18x2 can decide between two motion profiles based on the state of
an input line.
Command Format - JP and JS
FORMAT:
JS destination, logical condition
JP destination, logical condition
The destination is a program line number or label where the program sequencer will jump if the
specified condition is satisfied. Note that the line number of the first line of program memory is 0.
The comma designates "IF". The logical condition tests two operands with logical operators.
Logical operators:
OPERATOR
<
>
=
<=
>=
<>
Conditional Statements
The conditional statement is satisfied if it evaluates to any value other than zero. The conditional
statement can be any valid DMC-18x2 numeric operand, including variables, array elements, numeric
120 ● Chapter 7 Application Programming
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
End
Program label
Initialize time reference
Set Output 1
Loop
After 10 msec from reference,
Clear Output 1
Wait 40 msec from reference and reset reference
Set Output 1
Loop
DESCRIPTION
Jump to subroutine if logical condition is satisfied
Jump to location if logical condition is satisfied
DESCRIPTION
less than
greater than
equal to
less than or equal to
greater than or equal to
not equal
DMC-18x2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dmc-1812Dmc-1822Dmc-1832Dmc-1842

Table of Contents