Digital Inputs - Galil Motion Control DMC-1000 User Manual

Table of Contents

Advertisement

Instruction
SB6
CB4
CB9
The Output Bit (OB) instruction is useful for setting or clearing outputs depending on the value of a
variable, array, input or expression. Any non-zero value results in a set bit.
Instruction
OB1, POS
OB 2, @IN [1]
OB 3, @IN [1]&@IN [2]
OB 4, COUNT [1]
The output port can be set by specifying an 8-bit word using the instruction OP (Output Port). This
instruction allows a single command to define the state of the entire 8-bit output port, where 2 0 is
output 1, 2 1 is output 2 and so on. A 1 designates that the output is on.
Instruction
OP6
OP0
OP 255
Instruction
#OUTPUT
PR 2000
BG
AM
SB1
WT 1000
CB1
EN
The DMC-1000 has eight digital inputs for controlling motion by local switches. The @IN[n]
function returns the logic level of the specified input 1 through 8. For example, a Jump on Condition
instruction can be used to execute a sequence if a high condition is noted on an input 3. To halt
program execution, the After Input (AI) instruction waits until the specified input has occurred.
DMC-1000
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Example - Using Set Bit and Clear Bit Commands (SB, CB)
Interpretation
Sets bit 6 of output port
Clears bit 4 of output port
Clear bit 9 of output port on DMC-1080
Example - Using the output bit Command (OB)
Interpretation
Set Output 1 if the variable POS is non-zero. Clear Output 1 if POS equals 0.
Set Output 2 if Input 1 is high. If Input 1 is low, clear Output 2.
Set Output 3 only if Input 1 and Input 2 are high.
Set Output 4 if element 1 in the array COUNT is non-zero.
Example - Using the output PORT Command (op)
Interpretation
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 to zero
Sets all bits of output port to one.
(2 2 + 2 1 + 2 2 + 2 3 + 2 4 + 2 5 + 2 6 + 2 7 )
Example - Using OP to turn on output after move
Interpretation
Label
Position Command
Begin
After move
Set Output 1
Wait 1000 msec
Clear Output 1
End

Digital Inputs

Chapter 7 Application Programming • 115

Advertisement

Table of Contents
loading

Table of Contents