116
•
Chapter 7 Application Programming
DMC-1500
Example - Using Set Bit and Clear Bit Commands (SB, CB)
Instruction Interpretation
SB6
Sets bit 6 of output port
CB4
Clears bit 4 of output port
CB9
Clear bit 9 of output port on DMC-1580
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.
Example - Using the Output Bit Command (OB)
Instruction Interpretation
OB1, POS
Set Output 1 if the variable POS is non-zero. Clear Output 1 if POS equals 0.
OB 2, @IN [1]
Set Output 2 if Input 1 is high. If Input 1 is low, clear Output 2.
OB 3, @IN [1]&@IN [2]
Set Output 3 only if Input 1 and Input 2 are high.
OB 4, COUNT [1]
Set Output 4 if element 1 in the array COUNT is non-zero.
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 20 is
output 1, 21 is output 2 and so on. A 1 designates that the output is on.
Example - Using the Output Port Command (OP)
Instruction Interpretation
OP6
Sets outputs 2 and 3 of output port to high. All other bits are 0. (21 + 22 = 6)
OP0
Clears all bits of output port to zero
OP 255
Sets all bits of output port to one.
(22 + 21 + 22 + 23 + 24 + 25 + 26 + 27)
Example - Using OP to Turn on Output After Move
Instruction Interpretation
#OUTPUT Label
PR 2000
Position Command
BG Begin
AM After
move
SB1
Set Output 1
WT 1000
Wait 1000 msec
CB1
Clear Output 1
EN End
Digital Inputs
The DMC-1500 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.
Summary of Contents for DMC-1510
Page 6: ......
Page 18: ...6 Chapter 1 Overview DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Page 88: ...76 Chapter 6 Programming Motion DMC 1500 Figure 6 7 Motion intervals in the Home sequence...
Page 90: ...78 Chapter 6 Programming Motion DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Page 137: ...DMC 1500 Chapter 7 Application Programming 125 THIS PAGE LEFT BLANK INTENTIONALLY...
Page 157: ...DMC 1500 Chapter 10 Theory of Operation 145 THIS PAGE LEFT BLANK INTENTIONALLY...
Page 160: ...148 Appendices DMC 1500 Card Level Layout...
Page 180: ...168 Appendices DMC 1500...
Page 198: ...186 Appendices DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...