I've been trying to create a set of VIs where I can repeatedly call a VI which has a wait function in it without having to wait for it to finish AND where I can pass a different value to each instance of that VI. Each instance is supposed to wait, and when it's finished doing its thing spit out its results to a LV2 global array.
From the searching I did I found the option of using a *.vit to create a new VI for each instance and using Set Control Value to pass the value.
I built a small demo to test this, where each instance replaces its corresponding element in the global array, and it seems my problem is two-fold:
1. The creation seems to take a lot of time (50-100 ms for each instance). I'm not sure this will be a problem, but I may have to do this creating quite a lot, so it might pose a problem.
2. Some of the instances in my demo don't seem to be receiving the value I'm passing, so the array has a 0 in its place.
This seems to happen at random, but it happens quite a lot - I only need to run the VI a few times in a row and it happens. If I set the array to have 20 or 30 elements it usually happens every time.
Stranger still, if I place a wait between opening the reference and passing the value none of the instances seem to get the value and if I place a wait before the Run method only a small number seem to get it.
In the demo I attached (backsaved to 6.1), the vit is reentant. I have noticed that when I set it to be non-reentant it seems to cause this problem less. Either way, I don't understand why it does it at all - the VIs are definitely being created and getting a unique reference each, so the Set method should work. As a side question, is there any meaning to a *.vit being reentrant?
So, finally, the question - is this a bug, or am I misunderstanding something about the way this is supposed to work?
And, if it is a bug, or if I can't use it, is there any other option for running concurrent versions of a VI, with each of them recieveing a seperate value?
Message Edited by tst on 05-18-2005 03:04 PM
___________________
Try to take over the world!