AKD BASIC User Guide | 6 AKD BASIC Parameters, Operators, Statements
6.5.4 CAM.CREATE
General Information
Type Statement
Description CAM.CREATE (x, y) Initiates the creation of a cam table.
Units N/A
Range x = 1-8, y = 3-1000
Default
Value
N/A
Data Type Integers
Start Version M_01-06-00-000
Description
CAM.CREATE initiates the creation of a cam table. The actual points in the cam table are
inserted with a series of CAM.ADDPOINT statements. The CAM.CREATE block must ter-
minated by an End statement.
You can create a cam table as many times as you want. You must create a cam table before
you make it active. You cannot create a cam table if it is active. The master position for the first
entry must be 0. The master positions must keep increasing as you add points. EXTEN-
CODER.POSMODULO must equal the total master distance in you CAM. For a repeating
CAM, PL.MODP2 should be set equal to the distance that the slave travels in one CAM cycle.
Examples
Main
CAM.CREATE(1, 5) ‘allocate space for cam #1, 5
points
‘start the cam create block
CAM.ADDPOINT(0, 0)
CAM.ADDPOINT(200, 65536 / 10)
CAM.ADDPOINT(400, 65536 / 8)
‘add the points
CAM.ADDPOINT(600, 65536 * 3 / 4)
CAM.ADDPOINT(800, 65536)
End ‘end the cam create block
DRV.SWENABLE = 0 ‘Disable motor while setting
position
CAM.MASTER = 2 'Cam Master = External Encoder
EXTENCODER.POSMODULO = 800 'set master counts
per cycle
PL.MODPEN = 1 'enable slave modulo
PL.MODP2 = 65536 'set slave (AKDBASIC) counts
per cycle
EXTENCODER.POSITION = 0 'set Master position
to 0
MOVE.POSCOMMAND= 0 'set slave (AKDBASIC)
position to 0
DRV.SWENABLE = 1 'enable the motor
CAM.ACTIVATE = 1 'activate cam#1
Kollmorgenâ„¢ | March 30, 2012 158