DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert the instance of cloneable module into subpanel of other Singleton module?

Solved!
Go to solution

hello,guys

this is an question,t have a cloneable module and a singleton module.the a singleton module have many subpanel,I want insert the instance of cloneable module into subpanel,but cloneable module only have module ID

i don't know how to get the VI Reference of the instance,so that I can  insert the instance's front panel into singleton module's subpanel.

or use other ways to complete this, please help me 

0 Kudos
Message 1 of 12
(2,808 Views)

屏幕截图 2021-12-26 112715.png

 With this method, I inserted the first instance, but I can't continue inserting

0 Kudos
Message 2 of 12
(2,803 Views)
Solution
Accepted by topic author SuperKevin

Create a request called "Insert into front panel", and make a subpanel reference an argument for the request. In Main.vi of the same module, simply call the Insert method.

 

The VI with the subpanel then simply calls the aforementioned request when it needs the front panel inserted.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 3 of 12
(2,767 Views)

thanks. through your method,I have solved.

my old solution is Modify the "start module"  (change Start Asynchronous Call to Call By Reference), maybe your method might be better。

respect !!!

 

0 Kudos
Message 4 of 12
(2,728 Views)

Hi Chris,

I wanted to start a new thread to ask my question but I think this is very close to what I am doing with some slight difference. In my case, I have a DQMH singleton clone manager module that launches and configures the cloneable modules. These launched clones are populated into a multicolumn list box for display.  I have now added a single subpanel to be able to view and interact with each clone. I can insert the clones using the method you described by having the cloneable insert itself into the subpanel by selecting a specific clone on the MCLB.

The issue I am having now is that I cannot easily switch back and forth between clones in the subpanel.  For example, if two clones namely, A and B are running and displayed on the MCLB, when I select A, it is inserted and displayed in the subpanel. Similarly, when I select B, it is inserted but when I go back and select A again nothing happens. Sometimes, it takes several seconds to insert A but most of the time it doesn't insert all. I've added screenshots of my code. Perhaps, there are more details that I'm missing here. Please advise. Thanks!

 

Clone BD

Clone BD.PNG

Insert into subpanel request

Device Manager BD.PNG

 

0 Kudos
Message 5 of 12
(953 Views)

You shouldn't need to close the FP before inserting it.

What I would do instead of closing FP, is call the "Remove VI" method.  This will remove the previous VI, and allow you to insert the new VI.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 6 of 12
(943 Views)

Hi Chris,

I removed FP Close and added Remove VI method as you suggested but It seems the FP will need to be closed otherwise it won't work. 

When I checked with the API tester, I got Error 1144 about an open front panel. I then disabled the front panel setting in the initialize case of the module and it started working albeit sluggishly. I could insert the modules into the subpanel and switch back and forth but it was a lot slower. 

When I exited the application, the launcher took about 40secs to shutdown while the project remained locked for almost a minute before stopping. It appears the DQMH framework setting in the initialize case is affecting this functionality. Any ideas how to get around this?

Thanks

 

API tester error

Error without disable2.PNG

Initialize settings disabled

Disable FP Open.PNG

0 Kudos
Message 7 of 12
(922 Views)

Hi Chris,

I was able to get the subpanel insertion and removal to work by disabling the front panel setting in the initialize case and as well as the Hide VI panel VI in the Handle Exit VI.  I also used the Remove VI method in place of the FP Open. This is how I'm currently getting around insertion and removal of the cloneable module from the subpanel. I don't know if this is the best solution but it works.

Thanks again Chris for your help!  

Disable Handle Exit.PNG

0 Kudos
Message 8 of 12
(914 Views)

Sorry...you need to do both:

 

 

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 9 of 12
(905 Views)

If front panel is already closed, do nothing.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 10 of 12
(903 Views)