LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use SubPanels to display and run multiple executables from the same GUI?

Solved!
Go to solution

 

I have two Labview executables that performs some A/D I/O, each using an independent USB-6008.  I would like to run both of these executables from a single UI.  Is this possible usin SubPanels?  Or some other method?

 

I found KB regarding exe's and VI Server but can't seem to get the suggested workarounds implemented.

http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C?OpenDocument

 

 

I am using Labview2009

 

 

Thanks


Dan

0 Kudos
Message 1 of 41
(4,964 Views)

Hi Dan

 

Do you have access to the applications source code? Do you just want to start the applications or also make changes to front panel settings? Normally a built exe cannot be externally controlled unless it has some built in access mechanism. This can be ActiveX or VI server for example. If you have access to the source code you could build a top level VI that controls the two subVIs (and uses subpanels) then build that into a single exe.

 

Best Regards

 

David

NISW

Message 2 of 41
(4,940 Views)

Yes, I have developed the source code and therefore have access to it.  I have been looking into a solution similar to what you are suggesting but I have some issues with reentrancy.  I need to load two Subvis (call them Main1 and Main 2) into two separate subpanels and run them simultaneously, but Main1 and Main2 each call multiple other subvis (the same subvis are called by Main1 and Main2).  Therefore the subvis all need to be reeentrant.  Only problem is that I have a few functional globals that I now need to rearchitect since FGs can;t be reentrant.


Dan

0 Kudos
Message 3 of 41
(4,912 Views)

DBerry wrote:

Yes, I have developed the source code and therefore have access to it.  I have been looking into a solution similar to what you are suggesting but I have some issues with reentrancy.  I need to load two Subvis (call them Main1 and Main 2) into two separate subpanels and run them simultaneously, but Main1 and Main2 each call multiple other subvis (the same subvis are called by Main1 and Main2).  Therefore the subvis all need to be reeentrant.  Only problem is that I have a few functional globals that I now need to rearchitect since FGs can;t be reentrant.


Dan


Are you sure that will be the only problem?

 

You aren't sharing common hardware or anything else?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 41
(4,908 Views)

No, of course I am not sure yet.  I have only begun testing this method. 

Not sharing common hardware (separate USM-6008s).

 

Here is the whole picture:

 

I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C

 

The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.

 

So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.

 

If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.

 

Thanks
Dan

0 Kudos
Message 5 of 41
(4,899 Views)

DBerry wrote:

No, of course I am not sure yet.  I have only begun testing this method. 

Not sharing common hardware (separate USM-6008s).

 

Here is the whole picture:

 

I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C

 

The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.

 

So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.

 

If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.

 

Thanks
Dan


When I am designing apps of the type you described I have kept the ned goal in mind from the begining since of the issue you are mentioning. I also don't want to tell you to throw it all away and start over. So with that in mind I have been looking at your posts and only offering the least destrutive ideas first. With that in mind I would like to invite yo uto look at the code i posted in this thread (reply #18 has a zip).

 

That code shows how to realize un-dockable GUI regions but it passes the ref of the top level VI to a reentrant VI it instanciate for each undockable region. It may have enough hints and technique to give you some ideas that will work for you.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 41
(4,894 Views)

Be,

 

I had a look at the link on the Dockin Example.  The use of a VI template might help me out in this case.  But does opening a reference to the VI template maintain spearate data space for all the SubVIs that are called by the template?  Or do I still need to make all SubVIs reentrant?

 

Secondly, I would like some advice from anyone on why I cannot seem to access the top-level VI (obtain a reference to) of a DLL.  I have exported the VI in the DLL build but the Open VI Reference returns an error.  I am using the absolute path to the DLL/top-level VI in the format C:\my directory\library.dll\top-level.vi

The link I posted above suggests that it is possible.

 

Thanks
Dan

0 Kudos
Message 7 of 41
(4,871 Views)
Solution
Accepted by topic author DBerry

No the sub-VIs still share data space. If you limited the number of instance to a single (this tricky and requires brain twisting) you can use a template in a template but again only one instance in each template. If you restruture your code such that the shared sub-VI do not use SR's or local storage (like a control not on the connector) you can keep all of the instance specific stuff in the template and apss it to the sub-VIs.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 41
(4,864 Views)

Hi Dan

 

Actually what hte KB you linked in the first post says is that you can no longer access a VI in a dll by opening a reference directly to it like it was in a llb. You need to call it as a dll. Please have a look at this KB on how to do that.

 

Best Regards

 

David

Message Edited by Davidek on 12-07-2009 03:45 AM
0 Kudos
Message 9 of 41
(4,829 Views)

David,

 

Thanks for the post.

I wasn't aware this wass the case and thsi is not clear from the KB workaround #1:

"If you were using this technique, you were basically treating the VIs contained within the EXE or DLL as exported VIs. Accordingly, one option is creating a DLL and exporting each VI you are using from the DLL build specification. This makes your calling code more modular and is probably the best design choice of these solutions"


Anyway, how can I obtain a reference to a VI within a DLL using the mehtod in the KB you linked?

 

Dan

0 Kudos
Message 10 of 41
(4,820 Views)