Example Code

[NI VeriStand] Enable/Disable Alarm Workspace Control

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Veristand

Code and Documents

Attachment

Download All

Description

Overview

This example shows how you can add a custom NI VeriStand Workspace Control for enabling/disabling an alarm.

 

 

Description

The attached .zip file includes the LabVIEW Project used to create the custom workspace control. It has the VI components for the custom workspace control and also the source distribution build specifications used to distributed the files to the correct location ( <Public>\Documents\National Instruments\NI VeriStand 20xx\Display Templates) on your development machine.

 

project.png

 

 

 

This control allows you to select an alarm to programmatically enable and disable it.  You can select a particular controller in your project to view the available alarms.

 

control use.png

It could be modified to display an entire table of alarms to be enabled or disabled.  To install, either build the source code or copy the Alarm - Enable.vi and AlarmEnableSupport.llb files to the <NI VeriStand>\Display Templates folder.

 

The source code for the Enable/Disable Alarm Workspace Control is broken down into three primary sections; Initialize, Update Interface, and Shutdown.

 

Initialize: Creates references for Dynamic Events, Workspace Manager, and Alarm Manager.

Update Interface: Handles the different events and cases produced while using the VeriStand Workspace. Whenever the Enable button is pressed it will load the Select Dialog.vi

Shutdown: Closes references for Dynamic Events, Workspace Manager and Alarm Manager.

 

bd.png

 

Steps to Implement or Execute Code

  1. Download, unzip, and open the corresponding project linked below.
  2. Build the source distribution.
  3. Open VeriStand, your corresponding project, and then your workspace. You should now have the ability to add the Enable/Disable Alarm workspace control (located in the "Alarm" folder of the Workspace Controls).

 

Requirements

Software

LabVIEW 20xx Development Environment - Needed to build the source distribution

NI VeriStand 20xx - Needed to run the VeriStand Project and configure the Workspace.

 

Hardware

N/A

 

Additional Information
You can find further related information at:

 

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**

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