Function
Sets motor motion stop event callback function.
Format
Ret = SmcWStopEvent( Id , AxisNo , CallBack , EventMode , 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_STOP_CALLBACK ] [ Python: PSMC_STOP_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 |
Invalidates the event |
1 |
Validates the event |
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
When the motor stops, the events occur. (The stop factor can be acquired with SmcWGetStopStatus. )
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 motor stops, notify
the application through a callback.
After setting the callback, when the motor stops, the set callback function
is called.
Example
The motor operation stop event is set to axis number 1.
C, C++
long Ret;
Ret = SmcWStopEvent( Id , 1 , CallBack , 1, this );
Python
Ret = ctypes.c_long()
Ret.value = csmc.SmcWStopEvent( Id , 1 , CallBack , 1, 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 SmcWStopEvent is passed.
Return Value
None [ void ]