Hardware I/O - Galil Motion Control DMC-21 5 Series User Manual

Table of Contents

Advertisement

acc=0;
#acc;
WT
20
JP
#acc,(acc=0);
AC
acc*cts/(2*3.14);
SH
A;
BG
A;
AM
A;
MO
A;
EN;

Hardware I/O

Digital Outputs
The DMC-21x5 has an 8-bit uncommitted output port, the DMC-2155 through DMC-2185 has an additional 8
outputs. Each bit on the output port may be set and cleared with the commands
OB
(define output bit).
SB
6;
CB
4;
The
command is useful for setting or clearing outputs depending on the value of a variable, array, input or
OB
expression. Any non-zero value results in a set bit. Any zero results in a clear bit.
OB
1,(pos);
OB
2,(@IN[1]);
OB
3,(@IN[1]&@IN[2]);
OB
4,(count[1]);
The outputs can be set by specifying an 16-bit word using the
command to define the state of the entire 16-bit output port, where bit 0 is Output 1, bit 1 is Output 2 and so on. A
1 designates that the output is on.
OP
6;
OP
0;
OP
255;
Example - Turn on output after move
The output port is useful for setting relays or controlling external switches and events during a motion sequence.
#main;
PR
2000;
SH
A;
BG
A;
AM
A;
SB
1;
WT
1000;
CB
1;
MO
A;
EN;
Chapter 7 Application Programming ▫ 109
'initialize acc variable
'label for loop
'jump back to acc label if variable is unchanged
'convert to counts/sec
'enable A axis
'begin motion
'wait for motion to finish
'disable A axis
'end program
'set Output 6
'clear Output 4
'set Output 1 if the variable POS is non-zero
'set Output 2 if @IN[1]=1
'set Output 3 if @IN[1] and @IN[2] equal 1
'set Output 4 if count array element 1 is not zero
OP
'sets outputs 2 and 3 of output port to high, all
other bits are 0 (2 1 + 2 2 = 6)
'clears all bits of output port
'sets all bits of output port
(2 0 + 2 1 + 2 2 + 2 3 + 2 4 + 2 5 + 2 6 + 2 7 )
'main program label
'specify position relative command
'enable A axis
'begin motion
'after motion is finished
'set Output 1
'wait 1000 msec
'clear Output 1
'end program
2
SB
(Set Bit) and
command. This command allows a single
CB
(Clear Bit), or
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents