SmcWIrqEvent


Function

Sets Extended events callback function.

 

Format

Ret = SmcWIrqEvent( Id , AxisNo , CallBack , EventMode , EventType , 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_IRQ_CALLBACK ] [ Python: PSMC_IRQ_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

 

EventType [ C, C++: short ] [ Python: ctypes.c_short ]

Sets the extension events raise an event.

0

When an event occurs by latching the count input LTC (input events LTC)

 

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

Events occur in the event of specified factors EventType.

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 factor specified in EventType occurs, notify the application through a callback.
After setting the callback, when the factor specified in EventType occurs, the set callback function is called.

 

Example

Input LTC event is set to axis number 1.

 

C, C++

long Ret;

Ret = SmcWIrqEvent( Id , 1 , CallBack , 1 , 0 , this );

 

Python

Ret = ctypes.c_long()

Ret.value = csmc.SmcWIrqEvent( Id , 1 , CallBack , 1 , 0 , 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 SmcWIrqEvent is passed.

 

Return Value

None [ void ]