Function
Sets bank event callback function.
Format
Ret = SmcWBankEvent( Id , AxisNo , CallBack , EventMode , BankNo , Parameter )
Parameters
Id [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved by SmcWInit function.
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
Specify axis number.
CallBack [ C, C++: PSMC_BANK_CALLBACK ] [ Python: PSMC_BANK_CALLBACK ]
Specify the address of the
callback function.
If NULL is specified, the notification setting by callback is cleared.
EventMode [ C, C++: short ] [ Python: ctypes.c_short ]
Set the event to valid/invalid.
0 |
Invalidate the event. |
1 |
Validate the event |
BankNo [ C, C++: short ] [ Python: ctypes.c_short ]
Please set the bank number
in which the events occur.
If 0 is specified, each events occur to complete each bank.
Parameter [ C, C++: void * ] [ Python: ctypes.c_void_p ]
Specify the parameter address
to pass to the callback.
Specify NULL if no parameter is required.
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Remarks
It is effective only while the bank operation is executed. When other operating, the events not occur.
If the event generation
function is executed once, the event is generated every time the factor
is generated afterwards.
It is not necessary to execute it two or more times excluding the purpose
to stop the event.
When the set bank is completed,
notify the application through a callback.
After setting the callback, when the set bank is completed, the set callback
function is called.
It is not possible to use it with SMC-2/4/8DL series.
Example
The bank completion event when completing it by the third bank for axis number 1 is set.
C, C++
long Ret;
Ret = SmcWBankEvent( Id , 1 , CallBack , 1 , 3 , this );
Python
Ret = ctypes.c_long()
Ret.value = csmc.SmcWBankEvent( Id , 1 , CallBack , 1 , 3 , 0 )
See Also
Callback Function
Format
CallBack( Id , AxisNo , Message , Parameter )
Parameters
Id [ C, C++: short ] [ Python: ctypes.c_short ]
The ID retrieved by SmcWInit function is passed.
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
The axis number that the event occurred is passed from the driver.
Message [ C, C++: int ] [ Python: ctypes.c_int ]
The message ID that cause the callback function to be called is passed .
Parameter [ C, C++: void * ] [ Python: ctypes.c_void_p ]
The parameter specified by the SmcWBankEvent is passed.
Return Value
None [ void ]