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.
uint RegisterIntCallback(
INT_CB_FUNC^ int_CB_FUNC
);
Detailed description
■Parameter
Argument
int_CB_FUNC [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_EM340GF controller )
{
/* Register function to delegate */
MMC_Controller.INT_CB_FUNC callback = InterruptProc;
/* Register interrupt callback function */
uint retCode = controller.RegisterIntCallback( callback );
if( retCode != MMC_ConstLibrary.MMC_OK ){ /* Error processing */ }
}
/* Callback function */
void InterruptProc( MMST_InterruptData interruptData )
{
/* Processing at interrupt */
}
■Supported version
API version
1.30
Description
Reference to the delegate registered the callback function
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
3 API LIBRARY DETAILS (BASIC FUNCTIONS)
3.2 MMC_Controller Class
3
47

Advertisement

Table of Contents
loading

Table of Contents