ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ program

Solved!
Go to solution

I'm trying to write a program that runs in a loop and samples 11 different channels on a NI USB DAQ 6343 device continuously. The first 10 channels are simple DC measurements, the remaining channel is an AC voltage signal, whose frequency I want to record. All of this data I will be writing to a .csv file at the end. I have attached my code and I'm working with the DAQ.mx drivers. 

 

The question I have is, how do I measure and AC signal with the USB DAQ? I tried to configure analog input channel # 19 for "frequency, voltage" and then do a "read", howeever, it is telling me that the channel does not support that type of measurement. This AC signal is going through a BNC cable, and then to two banana adapters.

 

Attached is my code, written in LabVIEW 2013.   Here is a screen shot .

 

vxcvxcv.gif

 

0 Kudos
Message 1 of 10
(5,634 Views)
Solution
Accepted by topic author Snow_In_Tehran
You just include that channel in the ai voltage channel list that you already have. It's part of the same task. Change to n samples and specify a rate and number of samples to read. Since your dc channels would consist of multiple readings now, you could do something like take the mean of those.
Message 2 of 10
(5,627 Views)

Thanks for your reply. I see what you're saying in terms of including the channel in the original list, since its the same task. However, how do I record the freqnecy. Don't I need to designate that channel alone (using virtual channel) as a voltage-frequency measurement?

 

If I just do "N channel, N sample read" for all 11 channels, I will get the voltage levels for those channels, but how will I know the frequency of that last channel (the AC signal)?

 

Should I use some other vi's to look at that channel after its been read to calculate the freqnecy of that input? 

0 Kudos
Message 3 of 10
(5,619 Views)

Look for the Signal Processing->Waveform Measure->Extract Single Tone Information.vi.  It performs an FFT and gives you the main frequency of the waveform.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 10
(5,612 Views)

Ok thanks, this is a real help for getting the frequency data. However, the only problem is that by going from 1 sample read to N samples, the output data out of the 'read' vi is in waveform mode. This creates problems for my other processes becuase I wanted to scale the DC voltages by constants and then write the modified values to a .csv file. I can't do those operations when my data is in waveform form.

 

i tried to undundle the waveform data thinking that it is a cluster, but that doesn' work. Any suggestions?

 

vxcvxcv.gif

0 Kudos
Message 5 of 10
(5,604 Views)

@Snow_In_Tehran wrote:

 

i tried to undundle the waveform data thinking that it is a cluster, but that doesn' work. Any suggestions?

 


The function you're looking for is called Get Waveform Components.

 

 

Best Regards,

John Passiak
Message 6 of 10
(5,600 Views)
Please use single Index Array and I already told you what to do if you wanted a scalar for the dc readings.
Message 7 of 10
(5,587 Views)

Thanks, these were all great answers and have helped me to solve the problem.

0 Kudos
Message 8 of 10
(5,581 Views)

Ok this has worked great. My only problem is, as you mentioned, now I have many more samples and I end up with a csv file with a huge number of rows and columns.

 

originally it was just 11 columns corresponding to my 11 channels. What kind of averaging operation can I employ to make the output more readable like it was before? 

 

Thanks

 

0 Kudos
Message 9 of 10
(5,563 Views)

@Dennis_Knutson wrote:
Since your dc channels would consist of multiple readings now, you could do something like take the mean of those.

There is a Mean function that does exactly what Dennis suggested.

 

 

Best Regards,

John Passiak
Message 10 of 10
(5,560 Views)