LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6251 Input channel displaying incorrect waveform

Hey guys,

 

I'm using the USB-6251 to acquire data from an output that the device is generating.  The output is a chirp signal with starting and ending frequencies that the user can input and it has a fixed amplitude.  I am sampling this signal with 4 different input channels, all at the same rates, and creating an array of the 4 channels.  Channels 1,3, and 4 all display the same signal that the output is sending out (which is what I want).  However, channel 2's signal becomes smaller as the frequency gets larger.  

 

For instance, if I had the starting and ending frequencies of my chirp signal as 2kHz and 80kHz respectively, the wave sampled in at channel 2 would have the expected amplitude at first, but as the frequncies get larger, the amplitude gets smaller.  The opposite happens if I start at 80kHz and end at 2kHz (starts small, ends with the correct amplitude).

 

However, this problem isn't specific to channel 2, it's specific to the second element of the array I created.  If I switched the order of the array so that channel 1 is the second element and channel 2 is the first element, then channel 2 is fine and channel 1 shows the same properties of the error discussed earlier.   All 4 output waveforms are coded exactly the same way.

 

Finally, to test some more, I decided to just connect a function generator to all the inputs and saw that all 4 channels outputted the correct waveform produced by the function generator (this was at high frequencies also).  All this did was confuse me even more.

 

Does anyone have any clues or ideas what could possibly be the problem?

 

Thanks,

 

Jeremy 

Message Edited by jchsu on 06-12-2009 04:26 PM
0 Kudos
Message 1 of 17
(3,498 Views)

Can you please post you code?
Maybe you made a typo in your code.

Though a 'typo' refers to words, im not sure what a LabVIEW typo would be called.

 

 

Anyway, if your code is working for 3 out of 4 of your channels, I suspect you are overlooking some small detail.

Cory K
0 Kudos
Message 2 of 17
(3,478 Views)

Thanks Cory,

 

Sorry about forgetting to post my code.  Here is a stripped down version that still has the same problems.  Thanks for any help.

 

Jeremy 

0 Kudos
Message 3 of 17
(3,458 Views)

Your code is confusing. First, you have the front panel 'collect' terminal hidden. The array of channel names is not at all necessary. Just use Dev1/ai0:4 as an input to the DAQmx Create Channel. That flatten to string function can be eliminated. Your use of the Build Waveform functions serves no purpose that I can see and the Build Array function you have on the output is just silly.

 

Display Signals.PNG

 

For better performance, you don't want to be starting and stopping the task with each iteration. All of the initialization code should be outside the loop.

Message 4 of 17
(3,449 Views)

Thanks for your help Dennis.

 

Like I said earlier though, this is a stripped down version of the code in which the problem still exists.  The Build Waveform functions are used for later data collection.  I will try your other suggestions and see what happens.  Thanks.

 

Jeremy 

0 Kudos
Message 5 of 17
(3,443 Views)
Whether or not they are used later, the waveforms from the DAQmx Read have the dt and timestamp. It seems you are just doing something for no good reason.
Message 6 of 17
(3,439 Views)

Well I did every single one of your suggestions and saw no differences at all.  One thing I did notice with more testing though, was that whatever channel being sampled as the second element would only decrease in high frequencies whenever the sampling rate gets higher (close to the aggregate sampling rate/4).  Still confused as to why it would be only one channel though.

 

Jeremy 

0 Kudos
Message 7 of 17
(3,436 Views)

If you create a VI with just the 4 channels being acquired, do you see the same thing?

0 Kudos
Message 8 of 17
(3,431 Views)
Isn't that more or less what my code already does?  What parts should I remove from my existing code to do what you suggest?
0 Kudos
Message 9 of 17
(3,427 Views)
What I am suggesting is simplify down to just an analog input with 4 channels - none of the analog out, etc. You can also run one of the example programs that does nothing except an analog read.
0 Kudos
Message 10 of 17
(3,420 Views)