Why Doesn't Excitation Voltage Stop With My Task?

Updated May 3, 2018

Reported In

Hardware

  • NI-9234
  • NI-9237

Driver

  • NI-DAQmx

Issue Details

I have NI hardware that provides excitation voltage to a sensor. When I stop my program, the device retains the last excitation voltage set by the software. How can I get it to return to a default value?

Solution

You can turn off the excitation voltage in a few ways:
  1. Unplug or remove power to your hardware and plug it back in.
  2. Reset your hardware, either using a switch on the hardware or programmatically through NI MAX.
  3. In LabVIEW, you can commit a value of zero to the Excitation Value property using a DAQmx Channel Property Node and the DAQmx Control Task VI (see code snippet below).

Additional Information

When a DAQmx task is stopped or cleared, the settings and properties held in your application's memory are cleared, but the values written onto your hardware's memory persist.

Therefore, if you have configured a channel to output excitation, it will continue to do so until you reset your hardware or until new values are written onto the hardware memory.

The example above shows how you can programmatically shut off excitation current in LabVIEW using a DAQmx Channel Property Node and a DAQmx Control Task VI. See below for a detailed explanation of the code:
  1. The excitation current source and value are set using the DAQmx Create Virtual Channel VI, but have not yet been written to the hardware.
  2. When the DAQmx Start Task VI is called, the configuration values set previously are committed and written to the hardware memory.
  3. The DAQmx Stop Task VI returns the task from the Running state to an idle state. However, the hardware will continue outputting excitation current.
  4. Once the task is idle, new channel property values, like the excitation value, can be configured using a DAQmx Channel Property Node.
  5. Using the DAQmx Control Task VI, these values can then be committed and written to the hardware memory. At this point, the excitation current will stop.
  6. The DAQmx Clear Task VI removes the task from memory and closes references to the hardware.

WAS THIS ARTICLE HELPFUL?

Not Helpful