32
•
Chapter 7 Application Programming
CDS-3310
Example - Input Interrupt
Instruction Interpretation
#A Label
II1
Input Interrupt on 1
JG 30000,,,60000
Jog
BGAD Begin
Motion
#LOOP;JP#LOOP;EN Loop
#ININT Input
Interrupt
STAD;AM Stop
Motion
#TEST;JP #TEST, @IN[1]=0
Test for Input 1 still low
JG 30000,,,6000
Restore Velocities
BGAD Begin
motion
RI0
Return from interrupt routine to Main Program and do not re-
enable trippoints
Example - Motion Complete Timeout
Instruction Interpretation
#BEGIN
Begin main program
TW 1000
Set the time out to 1000 ms
PA 10000
Position Absolute command
BGA Begin
motion
MCA
Motion Complete trip point
EN
End main program
#MCTIME
Motion Complete Subroutine
MG “A fell short”
Send out a message
EN End
subroutine
This simple program will issue the message “A fell short” if the A axis does not reach the commanded
position within 1 second of the end of the profiled move.
Example - Communication Interrupt
A CDS-3310 is used to move the A axis back and forth from 0 to 10000. This motion can be paused,
resumed and stopped via input from an auxiliary port terminal.
Instruction Interpretation
#BEGIN
Label for beginning of program
CI 2,1
Set up communication interrupt for serial port on CDS-
3310
MG "Type 0 to stop motion"
Message out of serial port
MG "Type 1 to pause motion"
Message out of serial port
MG "Type 2 to resume motion"
Message out of serial port
rate=2000
Variable to remember speed
SPA=rate
Set speed of A axis motion
#LOOP
Label for Loop
PAA=10000
Move to absolute position 10000
BGA
Begin Motion on A axis
Содержание CDS-3310
Страница 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...