IMS 17 Operating Instructions Manual page 41

Motion control
Table of Contents

Advertisement

MNEMONIC
BR
DESCRIPTION
The branch instruction can be used to perform a conditional or unconditional branch to a routine in an MDrive program. It can also
be used to perform loops and IF THEN logic within a program.
There are two parameters to a branch instruction. These are used to perform two types of branches:
Conditional Branch
This type of branch first specifies an address or process label where program execution should continue if the second parameter, the
condition, is true. The condition parameter may include flags as well as logical functions that are to be evaluated.
Unconditional Branch
In this type of branch the second parameter is not specified, then the execution will continue at the address specified by the first
parameter.
USAGE
BR <addr/label, cond>
EXAMPLE:
BR 256, I2
'Branch to program line 256 if Input 2 is TRUE
BR 120
'Unconditional Branch to program line 120
BR JC, I1=1
'Branch to process labeled JC if input 1 is True
RELATED COMMANDS: —
MNEMONIC
BY
DESCRIPTION
This read only status flag will indicate whether or not the axis is moving.
USAGE
PR BY
EXAMPLE:
PR BY
'read the state of the busy flag
RELATED COMMANDS: PR
MNEMONIC
C1
DESCRIPTION
This variable contains the raw count representation of the clock pulses sent to the motor drive.
USAGE
C1=<counts>
EXAMPLE:
C1=20000
'Set Counter 1 to 20000 motor counts
PR C1
'Print the value of C1 to the terminal screen
RELATED COMMANDS: C2, P
FUNCTION
Branch
FUNCTION
Busy Flag (Read Only)
UNITS
FUNCTION
Set Counter 1 (Motor Counts)
UNITS
Motor Counts
RANGE
0/1
RANGE
-2147483648 to 2147483647
TYPE
Program Instruction
TYPE
Motion Flag
DEFAULT
0
TYPE
Motion Variable
DEFAULT
0
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

Excellence in motion mdrive17

Table of Contents