From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Lag in switching between VIs in subpanel and plugin architecture.

Hi All,

 

I am currently working on a application which has multiple sub application(Multiple front panels). After  going through the forum decided to use the Sub-Panel based architecture. But the issue is that i want to communicate between the sub vi's i.e when i am switching from sub vi1 to sub vi2 in sub-panel there is some data need to be sent to sub vi2 from sub vi1 and many more. 

To solve the above issue stated above decided to use Actor framework as suggested in the below link,

https://decibel.ni.com/content/groups/large-labview-application-development/blog/2011/05/08/an-appro...  

The Actor framework implementation go's in this way

Main Actor(Parent Actor)---This will launch N-Child actors and depending on user inputs state machine will switch between different front panels. 

My question is this the correct frame work for my application?

 

One more issue what i have is:

I have done the  Actor framework implementation of above, were i am currently having 2 sub application which are getting switched in main actor. But the issue is-

when i am switching from sub application 1 to sub application 2 it take around 500ms to 1s. Where as coming back to sub application 1 from sub application 2 it takes only 20ms.

Why is so much of lag in loading?

How can i solve the lag issue?

 

LabVIEW-2014,Windows 10

 

Regards

@sk

0 Kudos
Message 1 of 3
(2,917 Views)

Hi sk_a,

To pass data between sub VIs consider using a Notifier, a Queue or even a user-event.  The user-event is [also] handy for passing events between top-level VI to the sub-vi (like panel-close)  or vice-versa. I usually create a cluster typedef containing an enumerated "Event Type" and a variant, then wire an instance (constant) of that cluster to the "user event data type" of "Create user event". Pass the event ref to the sub-VIs and use "register for events" to associate your user-event with the SubVI event-structure cases.  PRESTO! - your GUI event structures not only handle GUI events, but can respond to your user-events. Of course this assumes you are using event-structures in your GUI VIs...

 

Re: plugins:

Will your  SubVI/GUIs stop running when switching to another GUI?  If all you want to do is share data between SubVIs, just pass the same Queue, Notifier, or User-event ref to each.

 

Re: long time to switch GUIs:

When this happens to me, it's usually because some process on the diagram is taking an unexpectedly long time to terminate. Check any processes that poll external equipment/apps. Use a break-point, in a strategic location, to pop-open the SubVI diagram when switching.  Hit the light-bullb to locate the code that's lagging. Don't forget to turn OFF the light-bulb or else the subVI will run REALLY slow.Smiley Wink

 

Cheers.

 

 

0 Kudos
Message 2 of 3
(2,848 Views)

Hi first and foremost thanks for the reply,

 

I am using Actor framework, so there framework it self gives me the event based queue from that i am able to communicate with different sub VI's. 

Re plugins:

I am not stopping the loops, its just switching the UI in the back end they are running. The subvi will remain in the same state. So there is no point of VI taking long time to close or polling.

 

I wanted to know how to develop multiple front panel application with sup-panel in Actor framework architecture without making to many change in the framework for add a new sub vi or new front panel as plugin. Currently i have developed a application were i am able to do above task but i have to do too many changes in frame work to add a new sub VI.

 

Regards,

@sk

0 Kudos
Message 3 of 3
(2,843 Views)