Chapter 7 Application
Programming
Overview
The DMC-40x0 provides a powerful programming language that allows users to customize the controller for their
particular application. Programs can be downloaded into the DMC-40x0 memory freeing the host computer for
other tasks. However, the host computer can send commands to the controller at any time, even while a program is
being executed. Only ASCII commands can be used for application programming.
In addition to standard motion commands, the DMC-40x0 provides commands that allow the DMC-40x0 to make its
own decisions. These commands include conditional jumps, event triggers and subroutines. For example, the
command JP#LOOP, n<10 causes a jump to the label #LOOP if the variable n is less than 10.
For greater programming flexibility, the DMC-40x0 provides user-defined variables, arrays and arithmetic
functions. For example, with a cut-to-length operation, the length can be specified as a variable in a program which
the operator can change as necessary.
The following sections in this chapter discuss all aspects of creating applications programs. The program memory
size is 80 characters x 2000 lines.
Using the DMC-40x0 Editor to Enter Programs
The GalilTools software package provides an editor and utilities that allow the upload and download of DMC
programs to the motion controller.
Application programs for the DMC-40x0 may also be created and edited locally using the DMC-40x0.
The DMC-40x0 provides a line Editor for entering and modifying programs. The Edit mode is entered with the ED
instruction. (Note: The ED command can only be given when the controller is in the non-edit mode, which is
signified by a colon prompt).
In the Edit Mode, each program line is automatically numbered sequentially starting with 000. If no parameter
follows the ED command, the editor prompter will default to the last line of the last program in memory. If desired,
the user can edit a specific line number or label by specifying a line number or label following ED.
ED
Puts Editor at end of last program
:ED 5
Puts Editor at line 5
:ED #BEGIN
Puts Editor at label #BEGIN
Line numbers appear as 000,001,002 and so on. Program commands are entered following the line numbers.
Multiple commands may be given on a single line as long as the total number of characters doesn’t exceed 80
characters per line.
While in the Edit Mode, the programmer has access to special instructions for saving, inserting and deleting program
lines. These special instructions are listed below:
DMC-40x0 User Manual
Chapter 7 Application Programming
•
130
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...