09-01-2011 09:39 AM
I have a program using a case structure with 3 cases, in each case I have a TONE EXTRACTION VI reading frequencies from different inputs. This works fine but if I disconnect one of the inputs to my USB 6211 the frequency from the associated TONE EXTRACTION VI doesn't read 0 it comes back with the frequency reading of the previous TONE EXTRACTION VI giving the impression there is a frequency present when there isn't. Is there some way of clearing the previous result?
09-03-2011 04:00 PM
Post your VI. Are you reading through a shift register?
09-05-2011 10:46 AM
If you could post your VI it may help us to solve your issue.
As you say it is showing the previous result once your device is disconnected, it suggests that your input data is being fed back in e.g. through a shift register or a while loop.
It may be benefitial to know a little more about your application too please e.g. on your USB device are you using analog inputs or analog outputs etc?
09-08-2011 03:15 AM
I am using a USB-6211 and am feeding 3 analogue inputs into it (just sine waves) from a PCB I'm testing, I want to measure the frequency and amplitude of each input. I have each input in a separate case. I am finding that if for example I disconnect the input for case 2, instead of reading 0 for the frequency it will just show whatever the result for the tone measurement in case 1 read but if I connect the input back in it reads the correct frequency. It does however always read the correct amplitude if its connected or not. I hope this explains the problem a bit more clearly.
09-08-2011 09:28 AM
Why not have a single call to the daq which returns all three channels at the same time negating the need for the three seperate case structures, you can then split the signal in to its three channels to extract the data you need all within a single loop - Mike
09-09-2011 02:57 AM
I am using a USB-6211 and wanted to have as high a sample rate as possible for each input and as I only have 3 inputs I thought measuring each separately would free up the sampling rate.
09-13-2011 11:21 AM
A quick tip for the future, if you could just attach your VIs rather than screenshots of them, sometimes it's easier to debug.
Firstly I'd recommend putting timing into your while loop so that you don't take up too much of the CPU. e.g. place a "Wait" time constant, with a constant of 10 connected.
Your shift register is feeding back numeric data from your previous loop but this shouldn't be displaying the previous frequency.
I'd recommend going with Mike's suggestion - just give it a go and see if it's what you were after!