B.6 inputs, B.6.1 maestroanaloginputs, B-24 – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 276

Advertising
background image

int Speed

g_iAxisNum = 1

TimeOut

=

5000000

Speed = -20000


if

(g_iAxisNum==1)

Homing

(a1,TimeOut,Speed)

else

if

(g_iAxisNum==2)

Homing

(a2,TimeOut,Speed)

else

TRACE("Error axis id: %", g_iAxisNum)

end

if


end function

function Homing (AXIS as,int TimeOut,int speed)

int

StartTime

int

delta

float

L_Current

float

Command

as.mo=0
as.um=5
as.rm=0
as.sd=1000000000
as.ac=1000000
as.dc=as.ac
as.sf=0
as.mo=1
as.jv=speed

L_Current=as.cl[1]*.95

//the machine is at a wall when a current is reached but there is no movement

as.hm[2]=-20
as.hm[3]=0
as.hm[4]=0
as.hm[5]=0
as.bg

StartTime = as.tm

Command

=

abs(as.dv[1])

while

(Command<=L_Current)

delta = abs(as.tm - StartTime)

if ( delta >= TimeOut)

as.st

return

end

Command

=

abs(as.dv[1])

end
as.hm[1]=1
as.pa=0
as.bg

end function

B.6 Inputs

B.6.1

MaestroAnalogInputs

// Main
int go
float k
// Entry point of the application.

function run()

Maestro

Software Manual

Appendix B: Sample Programs

MAN-MASSW (Ver. Q)

B-24

Advertising