ElmoMC Multi-Axis Motion Controller-Maestro User Manual
Page 174
![background image](/manuals/558414/174/background.png)
a1.ipqp=100
//push position to IP queue
a1.ipa=1
//IP
mode
activation
for i=2:100
a1.ipqp = i*100
//push position to IP queue
end
a1.ipqp = (i - 1)*100
a1.awm
//wait for motion completed (bit 10 of SW is ON)
a1.mo=0
//motor off command
end function
• Motion organization with last point automatically sends:
#define ip_time 10
int g_nStatus, g_nPoint
function run()
global int g_nStatus, g_nPoint
//global variable definition
sync( 0,
ip_time
)
//work with DS402 motion object required sync mechanism
a1.opm=7
//select operation mode for axis a1
g_nStatus=0
//global variable initialization
g_nPoint=0
a1.amc=1
//motion callback mechanism ON
a1.prv=20000
//set profile velocity
a1.pac=10000000
//define acceleration
a1.pdc=10000000
//define deceleration
a1.qsdc=10000000
//define quick stop deceleration
a1.psw=100
//define position windows
a1.pswt=2
//define position windows time
a1.mo=1
//motor on command
a1.iptp=
ip_time
//interpolation period – must be equal to sync period
a1.ipqr=1
//IP queue reset with last point automatically sending
//in case of empty queue
a1.ipqp= g_nPoint
//push position to IP queue
a1.ipa=1
//IP
mode
activation
while (g_nStatus == 0 )
a1.ipqp = g_nPoint
//push position to IP queue
end while
a1.mo=0
//motor off command
end function
// motion completed callback
function @motioncompleted(int busId, int objId)
global int g_nStatus
g_nStatus = objId
//global variable value changing
end function
Maestro
Software Manual
DS402 Command Reference
MAN-MASSW (Ver. Q)
10-29