01-14-2016 08:33 AM - edited 01-14-2016 08:34 AM
Hi guys,
I'm trying to start multiple clones of a reentrant vi and display the front panel of each clone in a subpanel.
I'im using the "open vi reference function" with the options x80 (call and forget) and x40 (simultaneous call) to open the reference to my "Ac. Asyn." vi:
and then I start the vi with the asynchronous call fonction:
I do this twice. I then have two references to clones of the vi that I feed to the insert vi method of two subpanels:
I'm sure the vis are running because they respond to my commands and the front panel are correctly inserted in the subpanels but they do not update!
Is it possible to use subpanels with clones vi?
Thank you for your help,
peper
Solved! Go to Solution.
01-14-2016 01:08 PM - edited 01-14-2016 01:10 PM
Try to remove x40 option:
it allows you to duplicate VI without opening separate references for each instance.
Check AsynchronousCallAndCollectUsingOption0x40.vi from examples. They open single reference, but duplicate VI 10 times that run in parallel.
If you open reference, you manually create separate clone that is independent from other clones.
01-14-2016 02:39 PM - edited 01-14-2016 02:39 PM
I had a similar problem in the past and I fixed it by saving the VI as a "VI Template" (*.vit file) instead. Slightly different situation but you could give that a shot.
Also, if you could post a working sample of code that would help.
01-15-2016 03:46 AM
Thanks for your help, removing the x40 did the trick and the example "Asynchronous Call and Collect (Using Option 0x40).vi" made it clear as how to correclty use the x40 option.
Thanks again!
Regards,
Peper
01-15-2016 03:59 AM - edited 01-15-2016 04:14 AM
@Kyle97330 wrote:
I had a similar problem in the past and I fixed it by saving the VI as a "VI Template" (*.vit file) instead. Slightly different situation but you could give that a shot.
Also, if you could post a working sample of code that would help.
Using VI Templates for doing asynchronous / multiple calls to the same VI is an old way of doing it - the asynchronous call by reference is there to replace it and I believe it's the preferred/recommended way of doing multiple/asynchronous calls. The ACBR node takes a bit of getting used to the various options etc. so it's got a bit of a learning curve!
As for inserting the VI into the subpanel:
- Depending on the options flags, the VI reference coming out of the ACBR is not the same as the reference if you were to have 'this VI' inside. I don't think it matters if it's preallocated clones or shared clones - removing the 0x40 flag should mean that the reference coming out can be inserted into the subpanel.
- You can pass the subpanel reference into the called VI and have it insert itself into the subpanel with 'this vi'.
- You can pass the VI reference from inside the called VI to the callee (e.g. using a queue/notifier/event etc.) and then insert it from there that way. This is quite good as you can keep track of all the references for putting different VIs into the subpanels and also only insert the VI into the panel once it has finished initialising.
03-08-2016 11:44 AM - edited 03-08-2016 11:46 AM
I'm trying to do much the same thing, with little success. I can get the VI's started, but can't get them situated in the subpanels. I noticed that the first suggestion
"You can pass the subpanel reference into the called VI and have it insert itself into the subpanel with 'this vi'."
Doesn't seem to work because the child VI doesn't understand that the subpanel reference is in a different VI and not itself. Is this true?
and
"removing the 0x40 flag should mean that the reference coming out can be inserted into the subpanel." doesn't seem to be true.
03-08-2016 01:30 PM
@pblase wrote:"You can pass the subpanel reference into the called VI and have it insert itself into the subpanel with 'this vi'."
Doesn't seem to work because the child VI doesn't understand that the subpanel reference is in a different VI and not itself. Is this true?
It works. I do it. The child does not care where the reference came from. It just has a reference to a subpanel that is passed into it.
First make a reference to your subpanel and then make a control from that. Now you have a reference front panel control to put on your child VIs so that they can recieve the subpanel reference.
03-10-2016 10:02 AM
See also my problem at http://forums.ni.com/t5/LabVIEW/simultaneous-asynchronous-VI-s-with-Notifiers/td-p/3265192/highlight...
There seems to be something weird going on with subpanels and writing out to things outside of a sequence block.