Elmomc Multi-Axis Motion Controller-Maestro Manual de usuario Pagina 267

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 313
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 266
B.4 Callbacks Functions
B.4.1 PerrorCallBack
int dev
// Entry point of the application.
function run()
global int dev //default value - 0
int n
TRACE( "Dev value %", dev )
n = 100 / dev
TRACE( "Program OK" )
end function
// Error handler calls then a runtime program
// error occur.
function @perror(int error)
global int dev
//send user message to desktop computer
messagex( 0, dev, error )
//set global var
dev = 2
//view error code
TRACE( "Program error value %", error )
//reset program
reset
end function
B.4.2 EmcyCallback
// This function is used to choose a response to specific CANopen emergency messages
function run()
a1.mo=0
wait(10)
a1.px=0
a1.um=5
a1.sp=10000
a1.mo=1
wait(10)
a1.pa=0
a1./jointfilesconvert/1588249/bg
a1.pa=10000
a1./jointfilesconvert/1588249/bg
end function
function @emcy(int busId, int nodeId, int first4bytes, int last4bytes)
TRACE (" Bus id is: % Node id is % ", busId, nodeId)
//if the first 4 bytes of an emergency message is " Can message lost"
if(first4bytes==0xff118110)
TRACE(" Can message lost") //then print an error message in the debug window
else if (first4bytes==0xff118200)
TRACE("Protocol error")
end if
end function
B.4.3 HeartbeatCallBack
int work
// Entry point of the application.
function run()
global int work
work = 0
hbperiod(0, 200)
sync(0, 20)
TRACE( "Start" )
until( work == -127 )
Maestro Software Manual Appendix B: Sample Programs
MAN-MASSW (Ver. Q)
B-15
Vista de pagina 266
1 2 ... 262 263 264 265 266 267 268 269 270 271 272 ... 312 313

Comentarios a estos manuales

Sin comentarios