84
•
Chapter 7 Application Programming
DMC-1500
Multitasking Example: Producing Waveform on Output 1 Independent of
a Move.
Instruction Interpretation
#TASK1 Task1
label
AT0
Initialize reference time
CB1
Clear Output 1
#LOOP1 Loop1
label
AT 10
Wait 10 msec from reference time
SB1
Set Output 1
AT -40
Wait 40 msec from reference time, then initialize reference
CB1
Clear Output 1
JP #LOOP1
Repeat Loop1
#TASK2 Task2
label
XQ #TASK1,1
Execute Task1
#LOOP2 Loop2
label
PR 1000
Define relative distance
BGX Begin
motion
AMX
After motion done
WT 10
Wait 10 msec
JP #LOOP2,@IN[2]=1
Repeat motion unless Input 2 is low
HX
Halt all tasks
The program above is executed with the instruction XQ #TASK2,0 which designates TASK2 as the
main thread (i.e. Thread 0). #TASK1 is executed within TASK2.
Debugging Programs
The DMC-1500 provides commands and operands which are useful in debugging application
programs. These commands include interrogation commands to monitor program execution,
determine the state of the controller and the contents of the controllers program, array, and variable
space. Operands also contain important status information which can help to debug a program.
Trace Commands
The trace command causes the controller to send each line in a program to the host computer
immediately prior to execution. Tracing is enabled with the command, TR1. TR0 turns the trace
function off. Note: When the trace function is enabled, the line numbers as well as the command line
will be displayed as each command line is executed.
Data which is output from the controller is stored in an output FIFO buffer. The output FIFO buffer
can store up to 512 characters of information. In normal operation, the controller places output into
the FIFO buffer. The software on the host computer monitors this buffer and reads information as
needed. When the trace mode is enabled, the controller will send information to the FIFO buffer at a
very high rate. In general, the FIFO will become full since the software is unable to read the
information fast enough. When the FIFO becomes full, program execution will be delayed until it is
cleared. If the user wants to avoid this delay, the command CW,1 can be given. This command
causes the controller to throw away the data which can not be placed into the FIFO. In this case, the
controller does not delay program execution.
Содержание DMC-1510
Страница 6: ......
Страница 18: ...6 Chapter 1 Overview DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 88: ...76 Chapter 6 Programming Motion DMC 1500 Figure 6 7 Motion intervals in the Home sequence...
Страница 90: ...78 Chapter 6 Programming Motion DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 137: ...DMC 1500 Chapter 7 Application Programming 125 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 157: ...DMC 1500 Chapter 10 Theory of Operation 145 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 160: ...148 Appendices DMC 1500 Card Level Layout...
Страница 178: ...166 Appendices DMC 1500 ICM 1100 Drawing 1 3 4 0 0 4 4 0 2 4 0 7 0 0 4 5 3 7 0 5 7 0 2 8 5 1 0 0 1 0 1 0 7 0 1 0 0...
Страница 180: ...168 Appendices DMC 1500...
Страница 198: ...186 Appendices DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...