GetCallback (FUN) ¶ FUNCTION GetCallback : ERROR This function gets the callback data structure of a registered callback InOut: Scope Name Type Comment Return GetCallback ERROR Description of the callback conditions and the callback function Input hHandle CAA.HANDLE handle of Callback pCallback POINTER TO CB_CALLBACK Adress of return value
GetHandleOfCallback (FUN) ¶ FUNCTION GetHandleOfCallback : CAA.HANDLE This function gets the handle of callback via the callback number (ctNumber); InOut: Scope Name Type Comment Return GetHandleOfCallback CAA.HANDLE Handle to the callback, CAA.gc_hINVALID if ctNumber is invalid Input ctNumber CAA.COUNT number of Callback (value between 1 and CB_GetNumberActiveCallbacks) peError POINTER TO ERROR Pointer to error ID
GetNumberActiveCallbacks (FUN) ¶ FUNCTION GetNumberActiveCallbacks : CAA.COUNT This function gets the number of registered callbacks InOut: Scope Name Type Comment Return GetNumberActiveCallbacks CAA.COUNT The number of registered callbacks. Input peError POINTER TO ERROR Pointer to an error ID
IsHandleValid (FUN) ¶ FUNCTION IsHandleValid : BOOL This function checks, whether a callback with handle hHandle is registered InOut: Scope Name Type Comment Return IsHandleValid BOOL TRUE if the handle is valid. FALSE otherwhise. Input hHandle CAA.HANDLE handle of Callback peError POINTER TO ERROR Pointer to error ID
Helper ¶ DecodeClass (Function) DecodeEvent (Function) EncodeSpec (Function)
DecodeClass (FUN) ¶ FUNCTION DecodeClass : EVENT_CLASS This function serves to extract the vaue eClass of type EVENT_CLASS from parameter dwSpec of the callback function. InOut: Scope Name Type Comment Return DecodeClass EVENT_CLASS The EVENT_CLASS of dwSpec. Input dwSpec DWORD A combination of EVENT and EVENT_CLASS
DecodeEvent (FUN) ¶ FUNCTION DecodeEvent : EVENT This function serves to extract value eEvent of type _Event from parameter dwSpec of the callback function. InOut: Scope Name Type Comment Return DecodeEvent EVENT The EVENT of dwSpec Input dwSpec DWORD A combination of EVENT and EVENT_CLASS
EncodeSpec (FUN) ¶ FUNCTION EncodeSpec : DWORD This function servers to create the parameter dwSpec of type DWORD, which is necessary for callback functions, out of two values of type EVENT and EVENT_SOURCE . InOut: Scope Name Type Comment Return EncodeSpec DWORD Input eEvent EVENT Event to be used eClass EVENT_CLASS Event class to be used
Indirect Functioncall ¶ CallFunctionByIndex (Function)
CallFunctionByIndex (FUN) ¶ FUNCTION CallFunctionByIndex : __XWORD This function calls a function specified by their POU index keep in mind, that the called function is subject to a number of limitations: its name must begin with “Callback” its output value must be a DWORD on 32 bit and a LWORD on 64 bit systems. This can be achieved by using __XWORD. it must have exactly 3 input values with a data size of 4 bytes each on 32 bit and 8 bytes each on 64 bit systems. This can be achieved by using __XWORD. InOut: Scope Name Type Comment Return CallFunctionByIndex __XWORD Return value of the called function. Input pPOUFunc CAA.PVOID Pointer to function to call dwParam1 __XWORD prameter 1 dwParam2 __XWORD prameter 2 dwParam3 __XWORD prameter 3 peError POINTER TO ERROR