01-31-2013 06:15 AM
Do you have any example, just a start up...
01-31-2013 06:17 AM - edited 01-31-2013 06:22 AM
look up "clones" in the example finder or even here on the forum and on LAVA forum as well. See this one.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
01-31-2013 06:23 AM
Just a quick one to get you started:
Also, check http://digital.ni.com/public.nsf/allkb/49334E1013800E4886257A6800782495
/Martin
01-31-2013 06:39 AM - edited 01-31-2013 06:39 AM
I still have to less knowledge on this subject, so i think i have to go with the more static solution, but i can have up to 107 different channels... oh boy!
01-31-2013 07:03 AM
No, take this opportunity to learn something and write better code!
To start with, I'm not sure I fully understood the problem. Do you want all you filters to be independent of each other? In that case you should set the "init/cont" to false, forcing it to reinitialise every time as opposed to continuing from the state it had the last time it ran.
If you really need the separate instances, just write a sub-vi that contains the filter you want to use with and wire the needed inputs to controls and the connector pane on the icon. Then got to File -> Save As and at the bottom choose Template VIs. Now you will get yout template vi (named something.vit).
In the snippet code i posted, right click the static vi reference and browse to something.vit. Now you can call your created vit with the Call By Reference node just the same way as you called your filter, but each time in the loop a new vi will be dynamically created from your template and in the end you'll have 107 of your own filter vi:s. Make sure you use Close vi reference afterwards on these.
01-31-2013 07:07 AM
M_Peeker is totally right, take the opportunity!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
01-31-2013 07:30 AM
Okay,
then i almost was there, one question though, the output of the static reference isn't connectable to the open VI reference, but i do can connect it straight to the "call by reference VI" but how should i suppose to close it?
Regards,
Thijs
01-31-2013 07:34 AM
Great, then you're on track.
To close the reference, use "Close Reference" under the Application Control palette and wire the "reference out" from the "Call by reference" to it.
02-01-2013 09:47 AM
02-04-2013 02:09 AM
Here is my solution!