Overview
In many applications it may be necessary to communicate variable values or trigger LabVIEW events as a dynamic link library called by LabVIEW is still running. One such way we can pass this information is by using event registration and a LabVIEW event reference to send data or triggers to the top level application from the called library.
Description
This example show cases the PostLVUserEvent function. This function (defined by extcode.h) is responsible for posting an event with data that has been registered to a LabVIEW event structure. The function TriggerLVEvents simply calls the PostLVUserEvent function 10 times and posts an integer that counts from 0-9. The LabVIEW VI calls this function when the user select the 'Execute DLL Event' button on the front panel.
Requirements
- LabVIEW 2013 (or compatible)
- Basic text editor to view code; LabWindows/CVI or other C IDE to build dll.
- LabWindows/CVI Run Time 2013
Steps to Implement or Execute Code
- Open the LabVIEW VI titled 'Trigger LabVIEW Event From DLL 2013 NIVerified.vi'
- Run this VI
- Select the 'Execute DLL Event' button to call the dynamic link library
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Cole R.
National Instruments
Software Engineer