Mmc_Controller::registerintcallback (C++) - Mitsubishi MR-EM340GF User Manual

Simple motion board
Table of Contents

Advertisement

MMC_Controller::RegisterIntCallback (C++)

Registers the interrupt callback function. The registered function is called back from the interrupt driver when an interrupt
occurs.
unsigned long RegisterIntCallback(
void *interruptProc
);
Detailed description
■Parameter
Argument
interruptProc [in]
■Return value
Value
MMC_OK
MMERR_ARGUMENT_0
=1 to 9: Argument location
MMERR_INT_ALREADY_REREGISTER_CALLBACK
■Point
• When using C++, write the __stdcall declaration.
• Clearing the interrupt by "[Cd.1101] Interrupt factor reset request" in the callback function is not required.
• The callback function is called back from the interrupt driver, therefore, write the least code as possible without the infinite
waiting processing.
• The callback function is called back before the interrupt factor occurrence waiting functions such as the WaitIntEvent
function.
• The value of the free-running timer at the time of when the API library received the Simple Motion board interrupt is stored
in the free-running timer of the MMST_InterruptData structure. The free-running timer increases by one every 250[μs].
• The interrupt callback function is also called when the following conditions occur. The axis where the condition occurs is
stored as bit data (b0 to b15: Axis 1 to 16) in "[Md.1102] Interrupt factor details" of the MMST_InterruptData structure.
Interrupt factor
Error detection ("[Md.31] Status": b13) ON edge
Axis warning detection ("[Md.31] Status": b9) ON edge
BUSY signal [X10 to X1F] OFF edge
"[Md.1190] Controller in-position flag" ON edge
■Example
void RegisterIntCallbackSample(MMC_Controller *controller)
{
/* Register interrupt callback function */
unsigned long returnCode = controller->RegisterIntCallback( InterruptProc );
if( returnCode != MMC_OK ){ /* Error processing */ }
}
/* Callback function */
void __stdcall InterruptProc(MMST_InterruptData *interruptData)
{
/* Processing at interrupt */
}
■Supported version
API version
1.00
■Reference
UnregisterIntCallback (Page 49 MMC_Controller::UnregisterIntCallback)
3 API LIBRARY DETAILS (BASIC FUNCTIONS)
46
3.2 MMC_Controller Class
Description
Callback function pointer
Description
Function succeeded
The argument is outside the set range.
The interrupt callback function has already been registered. To change the interrupt callback
function, call the UnregisterIntCallback method.
Interrupt factor No.
1
2
3
4
Software version
01

Advertisement

Table of Contents
loading

Table of Contents