Table Of Contents

Automating Responses to User Actions with Action VIs

Last Modified: June 10, 2021

Use action VI templates with the custom device XML file to automate responses to user actions.

Before you begin, you should understand the action VI templates and the custom device XML file. Action VIs are dynamically called VIs that execute when a user performs a specific action in a custom device. For example, you can use an action VI to notify a user of the implications of removing a specific custom device item before they delete it.

  1. Create a new VI from an action VI template.
    1. From the custom device LabVIEW project, navigate to Custom Device API.lvlib»Templates»Action VI.
    2. Right-click the action VI you want to customize and select New from Template.
    3. Save the new action VI to the same directory as the custom device project.
  2. Declare the action VI in the Custom Device XML. You declare the action VI within the declaration for a specific page. The action VI executes when a user performs the triggering action on that page.
    1. From the custom device LabVIEW project, open the custom device XML file.
    2. Locate the <Page> tags for the custom device item from which you want to call the action VI.
    3. Declare the action VI anywhere beneath the <Item2Launch> tag. The following image gives an example of how to declare the action VI.
  3. Customize the action VI to meet your needs.
  4. Add the action VI to the Configuration build specification of the custom device.
    1. From the custom device LabVIEW project, double-click Build Specifications»Configuration.
    2. Select Source Files from the Category menu.
    3. Under the Project Files menu, locate the action VI and move it to the Always Included list.
    4. In the Category menu, select Source File Settings.
    5. In the Project Files menu, select the action VI.
    6. From the Destination pull-down menu, select the Configuration .llb file.
    7. Click OK to save the new settings.

Recently Viewed Topics