Example Code

NI VeriStand Add-On: Additional Workspace Controls & Indicators

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

  • LabVIEW
  • Veristand

Code and Documents

Attachment

Overview
The example demonstrates about the Add-On for additional workspace Controls and Indicators

Description:
Out of the box, NI VeriStand is supplied with a range of controls and indicators from booleans to graphs to model control. These have been created in LabVIEW before being coded to allow VeriStand to use them and to map their inputs/outputs into the system e.g. to models or data acquisition channels.Having seen the VeriStand Add-On of a library of Silver Workspace Controls, it occurred to me that it could be useful to have a wider range of controls and indicators for NI VeriStand at your fingerips, without having to create the "custom" controls and indicators yourself, so attached is a folder containing a series of 5 additional numeric controls/indicators; and 5 additional boolean controls/indicators.


Additional Numeric include:

  • Knob
  • Horizontal Slider
  • Vertical Slider
  • Thermometer
  • Tank


Additional Booleans include:

  • OK button
  • On/Off button
  • Larger button
  • Toggle switch
  • Square LED

 

Steps to implement or execute code
To implement this example:

  1. Select Screen»Edit Mode to display the Workspace Controls palette and alignment grid.
  2. Click the Workspace Controls palette to expand the palette and view the available control and indicator categories.
  3. Click the plus sign next to the type of workspace object that you would like to place in the NI VeriStand Workspace. This will expand the category and allow you to view the controls or indicators within that directory. An example of this is the Knob which is a type of numeric control and will therefore be listed as "Numeric Control - Knob".
  4. Select the name of a control or indicator and drag it to the alignment grid to add the control/indicator and display the Item Properties dialog box. Use this Item Properties dialog box to configure the control/indicator.


Requirements
Software
LabVIEW 2012 or compatible
NI VeriStand

Hardware
-

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Tori
Student

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

Comments
h_yong
Active Participant
Active Participant
on

Hello, is it possible to save the limits for each of these indicators or controls (e.g., thermometer, vertical slide, etc.) across workspace sessions? Thank you.

Tori.M
Member
Member
on

Hi hyog,

If I understand your question correctly, you can set the limits for the control through LabVIEW when first designing the control. Alternatively, you could set the limits through the control properties in the workspace.

Hope this answers your question!

Tori
Student
h_yong
Active Participant
Active Participant
on

Hi Tori,

Thanks for the response. I understand that I can set the limits in LabVIEW or VeriStand workspace. However, everytime I close the workspace and relaunch it, the limits are reset. How do I save the limts across workspace sessions? Thanks.

timtamslam
Active Participant
Active Participant
on

Hey hyog,

The behavior you're seeing, where changes to the workspace in VeriStand do not perpetuate when you reload the workspace, is a known issue. Our R&D team is aware of this problem and working to address it in later releases of VeriStand. For now, the proper workaround is to continue making changes to the workspace object in LabVIEW in order to change its range.

Sorry for the inconvenience!

Tim A.
mdwebster
Member
Member
on

Hi,

I've been trying to add some of these custom controls myself and can't get the Veristand workspace properties to change basic things like the display limits (e.g. 4-20 instead of 0-100).  After reading your documentation above, I tried out the Knob, and it works!  But the sliders, the tank, and the thermometer all don't work.  It seems like the internal reference is looking for a particular type and while "Knob" works, type "Slide" doesn't.  Unfortunately the handler is closed source so I don't know how to add a custom handler for the slide type.