|Download Help (Windows Only)|
A callback VI contains the code you write to handle an ActiveX or .NET event you specify. You must create a callback VI to handle events from ActiveX controls or .NET objects when the controls or objects generate the registered events. The callback VI runs when the event occurs. When you create a callback VI, LabVIEW creates a reentrant VI that you can open and edit to handle an event. A callback VI contains the following elements:
|Note You can use an existing VI as a callback VI as long as the connector pane of the VI you intend to use matches the connector pane of the event data. The callback VI must be reentrant, and the reference to the callback VI must be strictly typed.|
To allow callback VIs to execute without interruption, LabVIEW delays the processing of operating system messages until any callback VIs stop execution or until you load a modal window. When LabVIEW delays the processing of operating system messages, you cannot interact with any LabVIEW front panels. A modal window is a type of window that remains active or remains on top of all other LabVIEW windows until you close the window or open another modal window. You cannot interact with other windows while a modal window is open. Most dialog boxes in LabVIEW are modal windows.
You cannot open a non-modal window from a LabVIEW callback VI nor a DLL while any other process is running. Refer to Calling Non-Modal Windows Programmatically for more information about calling a non-modal window from a callback VI or DLL.
|Note ActiveX objects call ActiveX callback VIs synchronously. This means that the object may not be able to run other code during the execution of the callback and may cause deadlocks. You should carefully consider the interactions between the callback diagram and other code. For example, calling a non-reentrant subroutine inside an ActiveX callback VI could hang if you call the callback while the subroutine is already executing.|