LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW analog acquisition returns 0 values – buffer issue?

Solved!
Go to solution

I have this block diagram to control and monitor a power supply test cabinet, allowing the detection of failures during operation. I’m using LabVIEW 2014 (I also have version 21.0 available).

The cabinet includes 6 sensor cards that measure the output power (voltage × current) of each unit under test. A total of 12 power supplies are tested, switching between groups 1–6 and 7–12 at defined time intervals.

I’m using a USB NI 6343 to measure 30 analog channels with 1 sample to read in continuous mode at a rate of 1 Hz. However, I’m having an issue: sometimes the acquired values fail and return a 0, which I’m completely sure is not correct.

My questions:

  • How can I avoid these wrong 0 readings?

  • Could this be related to a buffer overrun/overload problem?

  • I know it’s better to use two loops in a Producer–Consumer architecture, but since I need to both acquire values and control digital outputs in real time, I’m not sure how to structure that properly.

I’m still a beginner in LabVIEW, so any advice or examples would help a lot.

Main stages of my code:

  1. Signal Processing: Scales and filters the voltage and current signals, generating the final power value for each sensor card.

  2. Power Supply Signal Selector: Assigns the corresponding sensor card signal to the active unit, providing 12 outputs (one for each power supply).

  3. Failure Detection: The test timer enables power verification. If the measured power equals 700 W, a logical error signal is generated. The error activates the latch in the Output Logic module, deactivating the faulty unit, and turning on the corresponding error LED.

  4. Data Logging: Records the power values of all 12 power supplies into a file. These data are later used in another program to plot results and calculate additional parameters.

0 Kudos
Message 1 of 6
(306 Views)
Solution
Accepted by topic author Sabrokan97

Some points to consider:

  • Windows 10 goes "out of support" in October.
  • You may want to (or have to) move to Windows 11.
  • LabVIEW 2014 is probably not supported by Windows 11.  
  • The first LabVIEW version officially supported by Windows 11 is LabVIEW 2022 Q3.
  • LabVIEW 2021 will probably work (at least for a while) with Windows 11.

Question:  What is meant by the red "0" (with a line through it)?  Why are you sure this is not correct?

Another question:  If you are going to read 30 analog channels at one sample per second (and, I presume, do something immediately with each sample), wouldn't it make more sense to set your AI device to "On Demand" (and 1 sample) and place the Analog Read in a Timed Loop with a cycle time of 1 Hz?  Depending on what you wanted to do with each sample (such as display it on a Chart, save it to disk, etc.), you should probably be able to do this in the same Loop without needing a Producer/Consumer design.

 

I might be missing something here -- please don't hesitate to enlighten me!

 

Bob Schor

 

P.S. -- Thanks to ZYOng (on another Forum post), I just learned about the Wait for Next Sample Clock, introduced >15 years ago (but not noticed by me until now).

 

0 Kudos
Message 2 of 6
(287 Views)

Hi Bob,

I’m aware of Windows 10 going out of support. I’m currently using Windows 11 on all my devices. So far, LabVIEW 2014 works correctly on my laptop, and LabVIEW 21 in the test cabinet PC.

I had tested on both computers I still see these random 0.000 readings in the power values, in the realtime graphs and in the data log file.

I’m confident these values are not correct. The power supply units use inverters as loads. If the power is interrupted, the inverter hardware resets and then starts ramping up again to maximum power (~950 W) after about 30 seconds. So it should never be possible to see an exact 0 between two valid measurements of 950–750 W. Also, getting an exact 0.000 W is unrealistic, since the expected offset/error margin from the Hall sensors + the amp circuit I’m using is normally in the range of 5–8 W.

I’ll test changing the AI Device to On Demand mode as you suggested. The most important goal in this project is to verify that the power supply units can maintain maximum power for a certain period of time (typically between 6–24 hours).

0 Kudos
Message 3 of 6
(252 Views)

Get rid of the DAQ Assistants, they're never going to be helpful. Read this and give it a shot:

 

https://www.ni.com/en/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-handl...

 

You shouldn't have too much issue just reading a single on-demand sample over and over again.

0 Kudos
Message 4 of 6
(224 Views)

Hi 

It looks to me more like a glitch. Im' curious to know if this still happens when you change from continuous acquisition to one sample at a time. 

 

0 Kudos
Message 5 of 6
(177 Views)

It turned out to be a problem in my own code, in a module that filtered and enabled the signals. In any case, I stopped using continuous samples, and with N Samples it works much better.

0 Kudos
Message 6 of 6
(72 Views)