From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying front panel of clones vi in subpanel

Solved!
Go to solution

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:

 

Open VI reference.png

 

and then I start the vi with the asynchronous call fonction:

 

Start vi.png

 

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:

 

Insert vi in subpanelpng.png

 

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

 

0 Kudos
Message 1 of 8
(5,354 Views)
Solution
Accepted by topic author peper2001

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.

Message 2 of 8
(5,314 Views)

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.

0 Kudos
Message 3 of 8
(5,294 Views)

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

0 Kudos
Message 4 of 8
(5,255 Views)

@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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 8
(5,244 Views)

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.

0 Kudos
Message 6 of 8
(5,028 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(5,005 Views)

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.

0 Kudos
Message 8 of 8
(4,968 Views)