Operands
In general, all operands provide information which may be useful in debugging an application program. Below is a
list of operands which are particularly valuable for program debugging. To display the value of an operand, the
message command may be used. For example, since the operand, _ED contains the last line of program execution,
the command MG _ED will display this line number.
_ED contains the last line of program execution. Useful to determine where program stopped.
_DL contains the number of available labels.
_UL contains the number of available variables.
_DA contains the number of available arrays.
_DM contains the number of available array elements.
_AB contains the state of the Abort Input
_LFx contains the state of the forward limit switch for the ‘x’ axis
_LRx contains the state of the reverse limit switch for the ‘x’ axis
Debugging Example
:
The following program has an error. It attempts to specify a relative movement while the X-axis is already in
motion. When the program is executed, the controller stops at line 003. The user can then query the controller
using the command, TC1. The controller responds with the corresponding explanation:
:ED
Edit Mode
000 #A
Program Label
001 PR1000
Position Relative 1000
002 BGX
Begin
003 PR5000
Position Relative 5000
004 EN
End
<cntrl> Q
Quit Edit Mode
:XQ #A
Execute #A
?003 PR5000
Error on Line 3
:TC1
Tell Error Code
?7 Command not valid
while running.
Command not valid while running
:ED 3
Edit Line 3
003 AMX;PR5000;BGX
Add After Motion Done
<cntrl> Q
Quit Edit Mode
:XQ #A
Execute #A
Program Flow Commands
The DMC-40x0 provides instructions to control program flow. The controller program sequencer normally executes
program instructions sequentially. The program flow can be altered with the use of event triggers, trippoints, and
conditional jump statements.
Event Triggers & Trippoints
To function independently from the host computer, the DMC-40x0 can be programmed to make decisions based on
the occurrence of an event. Such events include waiting for motion to be complete, waiting for a specified amount
of time to elapse, or waiting for an input to change logic levels.
Chapter 7 Application Programming
•
135
DMC-40x0 User Manual
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...