CDS-3310
Chapter
2 Getting Started
i
17
#LOOP
Label for loop
PA v1
Move A motor v1 counts
BG
Start A motion
AM
After A motion is complete
WT 500
Wait 500 ms
TP
Tell position A
v1=v1+1000
Increase the value of v1
JP #LOOP,v1<10001
Repeat if v1<10001
EN End
After the above program is entered, download to the controller. To start the motion, command:
XQ #A
Execute Program #A
Control Variables
Objective: To show how control variables may be utilized.
Instruction Interpretation
#A;DP0
Label; Define current position as zero
PR 4000
Initial position
SP 2000
Set speed
BG Move
A
AM
Wait until move is complete
WT 500
Wait 500 ms
#B
v1 = _TPA
Determine distance to zero
PR -v1/2
Command A move 1/2 the distance
BGA
Start A motion
AMA
After A moved
WT 500
Wait 500 ms
v1=
Report the value of V1
JP #C, v1=0
Exit if position=0
JP #B
Repeat otherwise
#C Label
#C
EN
End of Program
To start the program, command
XQ #A
Execute Program #A
This program moves A to an initial position of 1000 and returns it to zero on increments of half the
distance. Note, _TPA is an internal variable which returns the value of the A position. Internal
variables may be created by preceding a CDS-3310 instruction with an underscore, _.
Содержание 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...