![Galil Motion Control DMC-14 5 Series Скачать руководство пользователя страница 105](http://html1.mh-extra.com/html/galil-motion-control/dmc-14-5-series/dmc-14-5-series_manual_3258007105.webp)
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-14XX 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.
To route the trace to the controller’s serial port, use CFS. To route the trace to the Ethernet, use CFA.
TH shows which Ethernet handles are in use. CW1 or CW2 may need to be issued of no output is
seen.
Error Code Command
When there is a program error, the DMC-14XX 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.
Breakpoint Command
The BK command is used to set breakpoint in application programs, and the SL command is used to
single step from the breakpoint.
RAM Memory Interrogation Commands
For debugging the status of the program memory, array memory, or variable memory, the DMC-14XX
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-1415 will have a maximum of 2000 array elements in up to 14
arrays. If an array of 100 elements is defined, the command DM ? will return the value 1900 and the
command DA ? will return 13.
96
i
Chapter 7 Application Programming
DMC-14x5/6
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com