![Galil DMC-4040 User Manual Download Page 143](http://html1.mh-extra.com/html/galil/dmc-4040/dmc-4040_user-manual_3282915143.webp)
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-40x0 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.
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 the output UART. The UART buffer can store up to 512
characters of information. In normal operation, the controller places output into the FIFO buffer. When the trace
mode is enabled, the controller will send information to the UART buffer at a very high rate. In general, the UART
will become full because the hardware handshake line will halt serial data until the correct data is read. When the
UART 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.
Error Code Command
When there is a program error, the DMC-40x0 halts the program execution at the point where the error occurs. To
display the last line number of program execution, issue the command, MG _ED.
The user can obtain information about the type of error condition that occurred by using the command, TC1. This
command reports back a number and a text message which describes the error condition. The command, TC0 or
TC, will return the error code without the text message. For more information about the command, TC, see the
Command Reference.
Stop Code Command
The status of motion for each axis can be determined by using the stop code command, SC. This can be useful when
motion on an axis has stopped unexpectedly. The command SC will return a number representing the motion status.
See the command reference for further information.
RAM Memory Interrogation Commands
For debugging the status of the program memory, array memory, or variable memory, the DMC-40x0 has several
useful commands. The command, DM ?, will return the number of array elements currently available. The
command, DA ?, will return the number of arrays which can be currently defined. For example, a standard DMC-
14010 will have a maximum of 16000 array elements in up to 30 arrays. If an array of 100 elements is defined, the
command DM ? will return the value 15900 and the command DA ? will return 29.
To list the contents of the variable space, use the interrogation command LV (List Variables). To list the contents of
array space, use the interrogation command, LA (List Arrays). To list the contents of the Program space, use the
interrogation command, LS (List). To list the application program labels only, use the interrogation command, LL
(List Labels).
DMC-40x0 User Manual
Chapter 7 Application Programming
•
134
Summary of Contents for DMC-4040
Page 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Page 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Page 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Page 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Page 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Page 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Page 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Page 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...