06-12-2009 04:25 PM - edited 06-12-2009 04:26 PM
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
06-13-2009 10:59 PM
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.
06-15-2009 08:16 AM
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
06-15-2009 09:29 AM
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.
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.
06-15-2009 09:55 AM
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
06-15-2009 10:03 AM
06-15-2009 10:16 AM
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
06-15-2009 10:29 AM
If you create a VI with just the 4 channels being acquired, do you see the same thing?
06-15-2009 10:32 AM
06-15-2009 11:11 AM