
The program examples below are similar to some of our most common applications. The examples are can be used as starting points for meeting the needs of your application.
These programs can be downloaded directly into the CRK with Built-in controller with the use of the CRK Motion Creator Graphical User Interface (GUI). To download the GUI, click here. Instructions for how to download these files with the GUI are available here. To download the GUI click here.
This program tells the motor to move three preset distances with a delay between each of the moves.

Sequence: 5 "SimpleIndex"
( 1) pc = 0 #Set PC to 0
( 2) VS 100 #Set starting velocity to 100pps
( 3) VR 5000 #Set running velocity to 5000pps
( 4) TA .2 #Set accel time to 0.2sec
( 5) TD .1 #Set decel time to 0.1sec
( 6) DIS 500 #Set distance to 500pulses
( 7) MI #Move incrementally
( 8) MEND #Wait until motion end
( 9) WAIT 1 #Wait 1sec
(10) DIS 1000 #Set distance to 1000pulses
(11) MI #Move incrementally
(12) MEND #Wait until motion end
(13) WAIT 1 #Wait 1sec
(14) DIS -500 #Set distance to 500pulses in opposite direction
(15) MI #Move incrementally
(16) MEND #Wait until motion end
(17) WAIT 1 #Wait 1sec
This program tells the motor to move three preset positions with a delay between each of the moves.

Sequence: 4 "SimpleAbsolute"
( 1) PC = 0 #Set PC=0
( 2) VS 100 #Set starting velocity to 100pps
( 3) VR 5000 #Set running velocity to 5000pps
( 4) TA .2 #Set accel time to 0.2sec
( 5) TD .1 #Set decel time to 0.1sec
( 6) MA 500 #Move to 500
( 7) MEND #Wait until motion end
( 8) WAIT 1 #Wait 1sec
( 9) MA 1500 #Move to 1500
(10) MEND #Wait until motion end
(11) WAIT 1 #Wait 1sec
(12) MA 1000 #Move to 1000
This program tells the motor to repeat an index move four times with a delay between each of the moves.

Sequence: 3 "LoopIndex"
( 1) VS 100 #Set starting velocity to 100pps
( 2) VR 5000 #Set running velocity to 5000pps
( 3) TA .2 #Set accel time to 0.2sec
( 4) TD .1 #Set decel time to 0.1sec
( 5) DIS 500 #Set distance 500 steps
( 6) LOOP 4 #Loop 4 times
( 7) MI #Move incrementally
( 8) MEND #Wait for motion end
( 9) WAIT 1 #Wait 1sec
(10) ENDL #End of loop
Continous Motion with Speed Changes (Velocity Change Scan)
This program tells the motor to move continuously in the CW direction and to change it's velocity on-the-fly after a specified period of time.
Sequence: 2 "VelocityChangeScan"
( 1) VS 100 #Set starting velocity to 100pps
( 2) VR 2000 #Set 1st running velocity to 2000pps
( 3) TA .2 #Set 1st accel time to 0.2sec
( 4) TD .2 #Set decel time to 0.2sec
( 5) MCP #Move continuously in the positive direction
( 6) WAIT 5 #Wait 5sec
( 7) TA .5 #Set 2nd accel time to 0.5sec
( 8) VR 5000 #Set 2nd running velocity to 5000pps
( 9) MCP #Move continuously in the positive direction at new velocity
(10) WAIT 10 #Wait 10sec
(11) ABORT #Abort sequence execution
This program tells the motor to move continuously in the CW direction and to begin a series of velocity changes when a specified input turns ON.
Sequence: 7 "VelocityChangeInput"
( 1) VS 100 #Set starting velocity to 100pps
( 2) VR 1000 #Set 1st running velocity to 1000pps
( 3) TA .2 #Set accel time to 0.2sec
( 4) TD .1 #Set decel time to 0.1sec
( 5) MCP #Move continuously in the positive direction
( 6) WHILE (IN1=0)
( 7) WEND #Wait until input #1 turns ON
( 8) LOOP 3 #Loop 3 times
( 9) VR=VR+1000 #Increase velocity by 1000pps
(10) MCP #Move continuously in the positive direction
(11) SAS SPEED CHANGE #Send characters "SPEED CHANGE" to terminal
(12) WAIT 4 #Wait 4sec
(13) ENDL #End loop
(14) ABORT #Abort sequence execution
This program changes the motor speed on-the-fly several times while moving a preset distance.

Sequence: 6 "VelocityChangeIndex"
( 1) pc =0 #Set PC to 0
( 2) VS 100 #Set starting velocity to 100pps
( 3) VR 1000 #Set running velocity to 1000pps
( 4) TA .2 #Set accel time to 0.2sec
( 5) TD .1 #Set decel time to 0.1sec
( 6) DIS 60000 #Set distance to 60000 steps
( 7) MI #Move incrementally
( 8) WAIT 3 #Wait 3sec
( 9) CV 3000 #Change running velocity to 3000pps
(10) WAIT 3 #Wait 3sec
(11) CV 5000 #Change running velocity to 5000pps
This program shows how to calls a subroutine after an index motion has been completed and a specified input is turned ON.

Sequence: 1 "CallSubroutine"
( 1) VS 100 #Set starting speed to 100pps
( 2) VR 1000 #Set running speed to 1000pps
( 3) TA .2 #Set accel time to 0.2sec
( 4) TD .1 #Set decel time to 0.1sec
( 5) DIS 2000 #Set distance to 2000 steps
( 6) MI #Move incrementally
( 7) MEND #Wait for motion end
( 8) WHILE (IN1=0)
( 9) WEND #Wait until input #1 turns ON
( 10) CALL 3 #Call subroutine 3