CML Examples
Dynamic Position Mode Example
The following example uses the standard registers to continuously update the motor position. P2 could be adjusted to change the target position increment that gets updated every 10ms in L2. This could be run from a Control Room CML script, PC, PLC or microcontroller application using serial communication.
Dynamic Position Mode Example
K85=1 //start L1 on power up
K87=10 //run L1 at 10ms period
V1="mop" //assign V1 to set the mode of operation
a1=10 //set the filter gain to 10 (1-1024)
p1=0 //target position
p2=10 //amount to increment each iteration of the logic scan
N1=1100 //run motor at full torque
|2 //reset position to 0
L1.1 //Logic bank 1 to init all parameters
R1=0 //clear control word
V1=4 //set mode of operation to 4
|2 //set motor position to 0
P1=0 //set target position to 0
R1=1 //set control word to start running dynamic position
JL2.1 //jump to L2
END.1
L2.1 //L2 will continuously loop every #ms set in K87.
p1=p1+p2; //increment target position by P2
end.1