18
•
Chapter 7 Application Programming
CDS-3310
Program Format
A DMC program consists of CDS-3310 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 CDS-3310 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 CDS-3310 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.
Valid labels
#BEGIN
#SQUARE
#X1
#BEGIN1
Invalid labels
#1Square
#123
Example
Instruction Interpretation
#START
Beginning of the Program
PR 10000,20000
Specify relative distances on A and B axes
BG AB
Begin Motion
AM
Wait for motion complete
WT 2000
Wait 2 sec
JP #START
Jump to label START
EN
End of Program
The above program moves A and B 10000 and 20000 units. After the motion is complete, the motors
rest for 2 seconds. The cycle repeats indefinitely until the stop command is issued.
Special Labels
The CDS-3310 has some special labels, which are used to define input interrupt subroutines, limit
switch subroutines, error handling subroutines, and command error subroutines. See the section on
Auto-Start Routine.
The CDS-3310 has a special label for automatic program execution. A program which has been saved
into the controller’s non-volatile memory can be automatically executed upon power up or reset by
Summary of Contents for CDS-3310
Page 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...