ElmoMC Multi-Axis Motion Controller-Maestro User Manual
Page 162
10.2.2.3
Features of Profile Position Operating Mode Using for
Group (Vector)
Profile position motion for the DS402 Group (Vector) can be implemented by the
following command sequence:
function run()
int val
sync( 0, 10 )
//work with DS402 motion object required sync mechanism
g1.opm=1
//select operation mode for group g1
g1.gto=10000
//statusword waiting timeout
g1.prv=2000
//set profile velocity
g1.pac=10000000
//define acceleration
g1.pdc=10000000
//define deceleration
g1.qsdc=10000000
//define quick stop deceleration
g1.psw=200
//define position windows
g1.pswt=2
//define position windows time
g1.mo=1
//motor on command
g1.pa=0
//set absolute target position value
g1.bg
//start
motion
val=g1.gwm
//wait for motion completed
if( (val&1024) == 1024)
//bit 10 of SW is ON for target reached
a1.sp=5000
//set profile velocity for axis a1 (member of g1)
a1.ptp=2000
//set target position for axis a1 (member of g1)
a1.snp
//apply new position for axis a1 (member of g1)
a2.prv=5000
//set profile velocity for axis a2 (member of g1)
a2.ptp=2000
//set target position for axis a2 (member of g1)
a2.snp=2000
//apply new position for axis a2 (member of g1)
g1.bg
//synchronically
motion
start for all members of g1
g1.gwm
//wait for motion complete for all members of g1
end if
g1.mo=0
//motor off command
end function
Vector (Group) must be synchronized when working with the following commands: bg
(start motion), st (stop motion), pcwd (controlword) and gv, ip, hm – commands for other
operating modes. Synchronization is achieved via sync messages on a CAN bus.
Command sync( busID, syncPeriod) operates sync mechanisms.
Maestro
Software Manual
DS402 Command Reference
MAN-MASSW (Ver. Q)
10-17