Example Code

DAQmx: Checking if DAQmx is Installed and Which Version is Installed

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

    Driver

  • NI DAQmx

Code and Documents

Attachment

Download All

Overview

In this example, it shows you how to check to see if DAQmx is installed and which version is installed.

Description

When performing this check, it doesn't use MAX or the DAQmx driver to check if it is installed. Instead it checks for the nilvaiu.dll that is always installed for DAQmx. If this file exists, it then checks to see which version is installed which does use the DAQmx API to obtain this information.

When performing these checks, you have to assume that DAQmx isn't installed so you have to ensure that the main VI doesn't contain any DAQmx code. If it does contain DAQmx code, the VI or executable won't run but state that VIs/drivers are missing for DAQmx. Knowing this, the main VI (IsDAQmxinstalled.vi) in this example calls the DAQmx code dynamically so it will always compile and run.

Requirements

Software

LabVIEW 2009 or compatible

Hardware

N/A

Steps to Implement or Execute Code

IsDAQmxinstalled.vi

Checking if DAQmx is installed:

1.) Looks on the computer to see what the path is to the System folder containing Installed Libraries (System32)
2.) Adds the dll to look for (nilviu.dll) to the path.
3.) Checks to see if this file exists.

Checking the Version of DAQmx:
1.b) Building the path for the Check DAQmxversion.vi from the relative path of this vi.
2.b) Openning a reference to the VI
3.b1) Calls the CheckDAQmxVersion.vi dynamically which will provide a string which version is installed.
3.b2) Creates the message to the user that DAQmx isn't installed.
4.b) Closes the reference to the VI.

IsDAQmxinstalled.png

CheckDaqmxVersion.vi
1.) Retrieves the DAQmx version.
2.) Builds the Version numbers into an array.
3.) Builds a string containing "DAQmx [majorVesion].[MinorVersion].[UpdateVersion] "
4.) Adds the string "is installed."

CheckDAQmxversion.png

Assumptions:

1.) It assumes that the IsDAQmxinstalled.vi is saved in the same folder as the CheckDAQmxVersion.vi.

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


Jim St
National Instruments
RF Product Support Engineer

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

Contributors