06-15-2010 06:24 PM
Jason,
Could you perhaps post an example code? When I tried attaching same reentrant member VI to two subpanels, using two different objects, I got a run time error that VI is already in use. There is even NI KB post stating the same - http://digital.ni.com/public.nsf/allkb/60A749CF788726088625766200537F65?OpenDocument
06-16-2010 08:30 AM
Fedor,
I can't post all my code - this is a work project for an unreleased product. But I can show you some of the pieces.
My project uses the active object concept as described in this post:
http://forums.ni.com/ni/board/message?board.id=170&thread.id=462967&view=by_date_ascending&page=1
In my project, I'm monitoring anywhere from 1 to 6 chemical reactors called modules. For each module, I create an active object called a "Module Controller". Each module controller is responsible for handling a subset of 3 active objects called "Plugins". Plugins could be a sensor, a processing algorithm, etc. Plugins are also active objects.
The thing is, both module controllers and plugins must have front panels the user can manipulate. And because I'm running several module controllers, and each of which could need the same plugins, I have to create multiple, independent instances. So, first things first - I create the active objects:
Obviously, there are create functions for the Module Controller and Plugin subclasses, but they basically just set up some class properties. The top level create is what actually launches the subclasses and runs their VIs. It's nothing too special - looks just like Ben's code. Likewise, the module controller and plugins themselves are nothing unusual - just standard, reentrant VIs. After they are created, I put them in subpanels:
And that's really it. As I said, the module controller and plugin VIs themselves are set for reentrant execution where I'm preallocating clones for each instance. I agree looking at the knowledge base article it seems it shouldn't work - but it does, both in dev and as an exe. I'm not seeing any errors using this method. Not sure if it matters, but I'm running LabVIEW 2009 SP1 (32 bit) on a Windows 7 machine
I hope this post is helpful. If you are doing something different is triggering the error, please let me know. I may be standing in the middle of a minefield and just not know it!
Thanks,
JasonP - CLD
06-16-2010 08:33 AM
Ha! I just realized looking at my post that one of my subVIs in the Active Object:Create method still says "VIT path" - evidence of my first, somewhat faulty approach that must be eliminated!
JasonP - CLD
06-16-2010 08:54 AM
Thank you Jason!
Ben
06-16-2010 05:22 PM
10-24-2010 09:18 PM
Also look at the solution here: http://forums.ni.com/t5/LabVIEW/When-you-have-a-dynamic-VIT-in-a-LV-Class-what-happens-when-it/m-p/1...