Example Code

Programmatically Register Events with DSC Module

Code and Documents

Attachment

This example demonstrates how to programmatically register events between multiple VIs.  Main.vi generates a user event whenever the value of Input String changes.  When the Input String fires, a dialog box pops up notifying the user that an event has been generated.  Once the value changes the DSC module VIs (Enable Value Change Notifications.vi and Request Value Change Notifications.vi) registers for an event in the Read Main.vi.  Once the event has been fired a second dialog boxes will be displayed that lets the user know the event in the Read Main.vi has occurred.

In addition, Main.vi incorporates VI Server to programmatically launch and close the Read Main.vi.  Once Main.vi is called it will launch Read Main.vi.  To stop the program press the Stop button in the Main.vi.

Main.vi Block Diagram

Main BD.JPG

Additional Notes

You will need the DSC Module installed for this example to work.

A_Ryan
AES
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors