12-26-2008 02:48 PM - edited 12-26-2008 02:51 PM
Solved! Go to Solution.
12-26-2008 04:10 PM
Hello bassinbc,
i think there is a problem because you index data array and filter array on for loop:
if i anderstood you want to apply ech type of filter on data array with differents option accordind to each filter
so un active indexation on both array and put unbundle off your for loop and cable 4 on N input loop
delete "off" case
keep us informed
@+
Tinnitus
12-26-2008 04:18 PM
I can't run vi i miss a dll, daqmx and toolkit or driver !!!
sorry i didn't see well,
in fact you have an 2d array containing 4 channels
and want to apply one filter to each chan ?
Tell me if i am correct this time
how 2d array is organised : one chan/ columns ?
Best regards
12-26-2008 04:37 PM
12-29-2008 07:42 AM
Thanks but I still don't get it. I changed the vi to use queues. This will give me one element to pass to the subVI. Also, changed to the decrement function. Anyway, now I have the elements going to the subVI but still don't understand how to assure that the proper filter is applied to the proper data point.
12-29-2008 08:55 AM
Why are you bringing queues into this? ![]()
All you needed to do was to change the IIR Filter Specifications control on the Filter VI from an array to a single cluster. In the main VI you just needed to use Index Array to index out the selected filter cluster based on the Filter control that you had. That's it.
12-29-2008 09:30 AM
I've got a couple of recommendations for you.
First, you don't need that many while loops. As you have it set up right now, when you hit the stop button, all four while loops stop immediately. Thus, your main while loop never iterates, and thus is not needed. You can eliminate the main while loop and the while loop with the event structure (you don't need the event structure either). Place your stop button in the DAQmx while loop and a local variable to the stop button in the filter loop. This will allow you to stop both loops and will replicate the behavior of your current loop, while using fewer resources.
Also, you should either eliminate the "Convert To Dynamic Data" express VIs after your Split Signals function, or change them to "Convert From Dynamic Data" express VIs. As it is configured now, you are converting dynamic data to dynamic data.
As far as the filter is concerned, the filter will be applied to whatever array is fed in. As you currently have it configured, the for loop will iterate once for each channel in your array and apply the filter to the data that is currently available for that channel. Then it will rebuild the 2D array and feed that out of the sub VI. Are you seeing erroneous results with this method?
12-29-2008 01:36 PM
12-30-2008 08:59 AM
hello,
I propose you this sub vi modification , i make some supposition ie: 2d array is 4 columns * X data points
if note it needs some ajustements.
also i noticed that you have inverted Fl and Fh so it can hangs filters if Fc > Fe;
make somme tries
Best regards
Tinnitus
12-30-2008 11:00 AM
Thanks tinnitus,
I changed the Fl adn Fh and that did fix the hanging up problem. Also, changed the vi to match your suggestions and it works but I still have some interaction. The interaction may be some other problem with the data, but I don't think so. Instead of using the constant of 4, I put an array size on the data and wired to the N terminal of the for Loop.