Example Code

Using the NI VeriStand .NET API in LabVIEW to Control a VeriStand System

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

This example combines multiple shipping examples, as well as some custom code, to perform various actions on a VeriStand system using the VeriStand .NET API in LabVIEW.

Description

This example is intended to give a full picture view of a typical implementation of the VeriStand API. This code demonstrates the following:

  • Deploy a System Definition File
  • Get a list of model parameters
  • Read & Modify model parameters
  • Monitor model state and model time
  • Read multiple channel values
  • Un-deploy the System Definition File

Requirements

Software

  • LabVIEW 2013 or compatible
  • VeriStand 2013 or compatible

Hardware

  • None


Steps to Implement or Execute Code

  1. Open the attached VI
  2. Using the file path control, browse to the Sinewave Delay.nivssdf example
  3. Specify the IP Address of your Gateway
  4. Run the VI
  5. Modify different model parameters and observe the affects of the changes on the channel outputs

Additional Information or References


fp.pngbd.png

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

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

Comments
Nico_EMC
Member
Member
on

I think you've forget to let the "attached VI"

But it's easy to recreate it with the diagram picture, so thanks for this exemple

Ryan_S
Active Participant
Active Participant
on

Hey Nico,

I'm not sure what happened, I think the file used to be there. I re-made it real quick so the file won't look identical to the pictures but it should work properly. Enjoy!

Nico_EMC
Member
Member
on

Thank you, it works well

beavercreek
Member
Member
on

I created a 2012 version of the vi.  Any reason it should not work?

Ryan_S
Active Participant
Active Participant
on

It should work. The API calls made in the example would be the same for 2012 as in 2013+. However, if you "created" the VI by doing a "save for previous" you may need to re-link the .NET assemblies to the function calls. If it's not working, I'd recommend contacting support.

meBaga
Member
Member
on

Hi Ryan,

How can I use the same if my veristand project is running in RT. I have posted the problem statement Here. Can you please look into that once?

Contributors