Chapter 7 Application Programming
Overview
The DMC-42x0 provides a powerful programming language that allows users to customize the controller for their
particular application. Programs can be downloaded into the DMC-42x0 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-42x0 provides commands that allow the DMC-42x0 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-42x0 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 4000 lines.
Program Format
A DMC-42x0 program consists of DMC instructions combined to solve a machine control application. Action
instructions, such as starting and stopping motion, are combined with Program Flow instructions to form the
complete program. Program Flow instructions evaluate real-time conditions, such as elapsed time or motion
complete, and alter program flow accordingly.
Each DMC-42x0 instruction in a program must be separated by a delimiter. Valid delimiters are the semicolon (;) or
carriage return. The semicolon is used to separate multiple instructions on a single program line where the
maximum number of instructions on a line is limited by 80 characters. A carriage return enters the final command
on a program line.
Using Labels in Programs
All DMC-42x0 programs must begin with a label and end with an End (EN) statement. Labels start with the pound
(#) sign followed by a maximum of seven characters. The first character must be a letter; after that, numbers are
permitted. Spaces are not permitted in label.
The maximum number of labels which may be defined is 510.
Valid labels
#BEGIN
#SQUARE
Chapter 7 Application Programming ▫ 102
DMC-42x0 User Manual
Summary of Contents for DMC-42 0 Series
Page 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Page 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Page 206: ...Appendices 202 DMC 42x0 User Manual...
Page 207: ...Appendices 203 DMC 42x0 User Manual...
Page 208: ...Appendices 204 DMC 42x0 User Manual...
Page 209: ...Appendices 205 DMC 42x0 User Manual...
Page 210: ...Appendices 206 DMC 42x0 User Manual...
Page 211: ...Appendices 207 DMC 42x0 User Manual...
Page 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...