PostDeferredCall
- Updated2023-02-21
- 3 minute(s) read
PostDeferredCall
int PostDeferredCall (DeferredCallbackPtr deferredFunction, void *callbackData);
Purpose
Schedules LabWindows/CVI to call a specific function in the main thread at the next occurrence of GetUserEvent, RunUserInterface, or ProcessSystemEvents.
(RT) PostDeferredCall posts the deferred call to the main thread, which is the thread running RTmainRTmain. If you are debugging on RT via LabVIEW and you do not have an RTmain function, the thread that connected to the debugger last—usually the DLL entry point that you called last—is the main thread.
You typically use PostDeferredCall in a function you install as an asynchronous interrupt handler. In an asynchronous interrupt handler, the types of operations you can perform are limited. For example, you cannot freely access global variables or make a call to the User Interface Library. The deferredFunction parameter names the function that contains the code you cannot include in the asynchronous interrupt handler.
This function is useful when external devices generate interrupts during source program execution.
![]() |
Note To schedule LabWindows/CVI to call a function in a thread other than the main thread, use PostDeferredCallToThread. |
Parameters
Input | ||
Name | Type | Description |
deferredFunction | DeferredCallbackPtr | Pointer to the function that LabWindows/CVI invokes the next time it
processes events in the main thread. The event function of type DeferredCallbackPtr takes the following form: void CVICALLBACK DeferredCallbackFunction (void *callbackData); |
callbackData | void * | Points to data that you define. The callback function receives the pointer. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later