Example Code

Programmatically Determine the Channels Configured for an Embedded Data Logger Log

Code and Documents

Attachment

Overview

Developers of NI VeriStand custom workspace objects or UIs may find the need to display the number of channels configured in an embedded data logger log instance of the names of those channels. To do this, the developer will need to use the NI VeriStand .NET System Definition API. This example shows how to use this API to navigate the system definition tree and return desired information.

Steps to Implement

  1. Download and extract the files from the attached .zip file.
  2. Open the Embedded Data Logger Channel Count.lvproj in the LabVIEW Code folder.
  3. Open the Demo - Channel Count.vi.
  4. Set the System Definition Path to the path of the system definition which contains the Embedded Data Logger instance you would like to acquire this information from.
  5. Set the Embedded Data Logger Name to the name of the Embedded Data Logger instance in the system definition hierarchy you would like to extract this information from.
  6. Set the Log File Name to the name of the Log File instance in the system definition heirarchy you would like to extract this information from.
  7. Set the Channel Group Name to the name of the Channel Group instance in the system definition hierarchy you would like to extract this information from.
  8. Run the VI.
  9. Log Channel Names will display the names of the channels configured for this instance of the Embedded Data Logger, Log File, and Channel Group selected.
  10. Log Channel Count will display the number of channels configured for this instance of the Embedded Data Logger, Log File, and Channel Group selected.

2014-04-30_1316.png

Note: A sample VeriStand project has been included in the attached .zip in the Channel Count folder for demonstration purposes.


Implementation Details

This example uses the NI VeriStand .NET System Definition API to parse the system definition hiearchy and extract keys pieces of information.

Get Embedded Data Logger Ref.vi

This VI is responsible for returning a reference to an Embedded Data Logger with a given name.

2014-04-30_1319.png

Get Log File Ref.vi

This VI is responsible for returning a reference to the Log File instance with a given name.

2014-04-30_1321.png

Get Channel Group Ref.vi

This VI is responsible for returning a reference to the Channel Group instance with a given name.

2014-04-30_1323.png

Get Log Channel Names.vi

This VI is responsible for returning the channel names configured for a certain Channel Group.

2014-04-30_1326.png

Requirements

These examples were developed in LabVIEW 2012 for VeriStand 2012. Users in new versions of LabVIEW will be required to upgrade the VI and relink the .NET library to their version of VeriStand.

National Instruments
Senior Systems Engineer

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

Contributors