01-28-2011 08:46 AM
Need to get several devices connected to one Data collection System. Each Window will poll its assigned device and get a data packet which needs to go into a histograph. All the devices then need to pass their data back into the main window to be calculate the overall state of the system.
Now I am trying to create a single VI that will be reentrant and can be repeatedly called, handed a device, and go on it's way. I can't seem to get this idea to work though. I have included my testbed VIs I am trying to just get the reentrant code to open several FPs but with no luck so far.
and clues what is wrong with it or is this not possible on 7.1?
01-28-2011 10:43 AM
Hi BCharlton44,
rename your subvi to *.vit. It becomes a VI template and you'll get an instance with every call.
Mike
01-28-2011 11:02 AM
Follow Mike's advise.
LV 7.1 could not show multiple FPs of re-entrant VIs.
Ben
01-28-2011 11:02 AM
@MikeS81 wrote:
Hi BCharlton44,
rename your subvi to *.vit. It becomes a VI template and you'll get an instance with every call.
Mike
Wow, I didn't know you could do that. See, you learn something new everyday!
01-28-2011 11:10 AM
Is there anything about a VI "template" that really seperates it from a normal VI?
also my secondary doesn't seem to run when I call it. It just sits there....how do I make it run without manually hitting the run button?
01-28-2011 12:28 PM
@BCharlton44 wrote:
Is there anything about a VI "template" that really seperates it from a normal VI?
also my secondary doesn't seem to run when I call it. It just sits there....how do I make it run without manually hitting the run button?
Yes, everytime you open a new ref for it, a new instance is created with a new name.
Invoke node >>> Run
To run the VI
Search on "Ben Nugget occurence" for an example that loads and runs many.
Ben
01-31-2011 09:00 AM
I am still having problems making the opened VIT "run". It opens but then it doesn't actually do anything. I am looking through that "nugget" but since everything is a rentrant and you can't debug reentrant VIs it is hard to really compare at times.
01-31-2011 09:40 AM
Drop some break-points and reduce the number of templates until you figure it out.
The gang realy beat-up the idea re-entrancy it that thread, if you have nort reviewed the replies I suggest a quick read of them.
Ben
01-31-2011 01:16 PM
I just can not figure out how to make my template "run" when I open it. It just sits there and doesn't do anything.
02-01-2011 01:07 PM
Your VI worked fine on my computer. It can run multiple instances, and they all run and produce data.
You may want to start troubleshooting at the main VI before you go to the effort of using breakpoints to narrow down your .vit file. Since it's not re-entrant, you can troubleshoot it a bit more easily.
My first suggestion: add an error wire from your "Run" method. If there's an error there, it's not going to be seen, since it's not hooked up to anything (there's an error in, but no error out).