LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

minimum value of waveform dt

Solved!
Go to solution
Highlighted

LabVIEW 2015

Windows XP, Windows 7, Windows 10

NI DAQ USB-6212 (W/ SCB-68)

 

I have a long-in-the tooth application (which is why it is still in LabVIEW 2015) and the user is (mostly) happy with it.

 

Background info:

I capture analog input from 8 different sources, and capture quadrature data using a counter, display it, save it to disk, etc.

I output a complex waveform (not a Sine wave), and allow the user to adjust the amplitude (max and min current) and the period (in cycles per minute, roughly in the range of 1 or 2 cycles per second).  This complex waveform comes from a purpose-written C-code DLL that the LabVIEW VI calls.  I take the array of DBL that the DLL produces and use the 'Build Waveform (analog waveform)' function to create the waveform, and send it down to the analog out on the DAQ.  I currently create the waveform with a dT of 1 mSec.

 

The change:

The user wants more flexibility of the waveform, and wants to create various waveforms and save them in a CSV file.

I can import that CSV file, and use that data in place of the DLL.  No problem.

 

However, the user still wants to be able to change the period (i.e. playback rate) using the controls they already have on the screen.

Okay, I can take the number of items they import (samples/cycle) multiply it by the period (adjusted to be cycles/sec) and I'll get the samples/second.  I can take the inverse of that and get seconds/sample (or waveform dT).  Okay, straight-forward.

 

Question:

Since I don't know how many samples they will import (they are still trying to decide on the 'new' resolution), if I blindly do the math, I can end up with a smaller dT than I'm currently using or expect.

I'd like to write the code I need to catch this, and prevent unexpected results.

What is the smallest value I can send to the 'Build Waveform (analog waveform)' function and get the output I want?

 

Thoughts?

 

Thanks,

Jeff

 

 

 

0 Kudos
Message 1 of 4
(151 Views)
Highlighted
Solution
Accepted by topic author DMJeff

Hi Jeff,

 


@DMJeff wrote:

What is the smallest value I can send to the 'Build Waveform (analog waveform)' function and get the output I want?


dT is a DBL value, so the smallest positive value greater zero is "min of normal DBL", about 2e-308.

 

The point is: which range for dT does your DAQ hardware support?

According to the datasheet the NI6212 supports upto 250kS/s (for AO), so dT should be >=4µ…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(147 Views)
Highlighted

Hi Gerd,

 

Thanks for the reply.

 

I had assumed that the 'Build Waveform' function would have a limit on it, other than the incredibly small number allowed in a DBL.

Of course, with an available dT value so small, the limit of the hardware will control.

 

Thank you for the clarity,

Jeff

 

0 Kudos
Message 3 of 4
(124 Views)
Highlighted

There's a DAQmx Timing property node you could query to retrieve your device's maximum sample rate programmatically.  Then your same limits-checking code could work seamlessly across a variety of DAQ devices.

 

 Kevin_Price_1-1603758451478.png

 

-Kevin P      

 

0 Kudos
Message 4 of 4
(103 Views)