LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display VIs in subpanel

Solved!
Go to solution

Hi

I'm developing a user interface for a programmable telecom instrument. It is a highly versatile instrument as it can be loaded with 8 different kinds of subsystem.

 

I developed a vi for each kind of subsystem. As I can't know in advance the configuration of the instrument I'm trying to load one at a time the vi corresponding to an existent subsystem in a subpanel.

 

I get 2 issues:

First issue

When I use the method:run VI the vi is restarted. It works great for the first call but after I would like instead the vi to keep running in memory and display its front panel in the subsystem pragmatically without restartind it.

 

Second issue

I can't figure out how to get multiple instances of the same VI in memory with their dedicated set of data. For example the telecom instrument can have 8 independant subsystem of the same kind so I would need to load 8 copies of the same vi with 8 different set of data.

 

 

I enclose a simplied version of my program.

 

Thanks

Charly

It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 1 of 5
(4,320 Views)

CharlyStardust wrote:

Second issue

I can't figure out how to get multiple instances of the same VI in memory with their dedicated set of data. For example the telecom instrument can have 8 independant subsystem of the same kind so I would need to load 8 copies of the same vi with 8 different set of data.


Settng the subsystem to 'Reentrant' should do the trick. (in LabVIEW 8.5+ don't share clones).

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(4,318 Views)

Hi Ton,

I set my 2 subVIs to reentrant (preallocate clones between instances; maintains state for each instance)

How do you get a new instance? I get error 1000 "The VI is not in a state compatible with this operation." when I call a second instance of the same vi.

I may fix the first issue too.

Charly

 

It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 3 of 5
(4,309 Views)

Charly,

 

Here is a KnowledgeBase that gives a couple solutions to the error 1000 that you are receiving.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 4 of 5
(4,279 Views)
Solution
Accepted by topic author CharlyStardust
HelloI figured out the changes to fix my two issues:

 

First issue

The method:run VI needs to be used only once to load the VI in memory then use only method:insert VI to display the VI in your subpanel dynamically.The VI keeps running and updating the controls’ values. Great!

 

Second issueTo get multiple instances of the same VI in memory with a dedicated set of data you have to set the VI as reentrant. I chose VI properties->execution-> reentrant (preallocate clones between instances; maintains state for each instance)To get rid of the error 1000 you have to prepare the Open VI Reference Function to open a reentrant vi by setting the “option” input parameter as 0x08 That’s it!

Thank you Jon and Ton

Charly

It's always sunny in California! Certified LabVIEW Associate Developer!
Message 5 of 5
(4,265 Views)