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: 

Dynamically loaded VI in remote panel not working

I have a subpanel to which I load dynamically a VI with inputs. Dynamically loaded VI then does some computing with inputs and values user enter to dynamically loaded VI's front panel, and returns results. VI is loaded with an Open VI Reference, Start Asynchronous Call is used to pass input and Wait On Asynchronous call to collect outputs. On a development computer everything works fine. However, when I build the application to an executable, deploy it to a target computer and run it remotely in a web browser, two problems occur

1) VI inputs are not loaded

2) Dynamically loaded VI cant be exited (freeze to wait on asynchronous call and dynamically loaded VI is not responsive)

 

I have created a small (quick & dirty) example that can be used to reproduce incorrect behaviour. Now if someone could kindly explain what am I doing wrong in the example, that could probably point me in the right direction with my "real" application 🙂 See the enclosed VI's

 

- At first state is 0, and nothing happens.

- When "State"-control is changed to 1, an "add.vi" is loaded to tab 1 in subpanel. State-number (1) is used as an input. Add.vi returns the sum of state-number and integer selected with control.

- When "State"-control is changed to 2, everything works as in state 1, but the input will be 2 and the same VI is loaded to different tab (Add.vi is re-entrant). Now when controlling the application remotely with web browser the program freezes after loading first state. Input is not loaded and "Selected"-button to return value from VI is not functioning.

 

That was messy, hope you understand what I am talking about.. 🙂

I am using LabVIEW 2012

 

Any help & ideas would be greatly appreciated.

 

Br

 

Main.png

Main VI

Add.png

Dynamically loaded VI

Download All
0 Kudos
Message 1 of 6
(2,820 Views)

Hi

 

When you say VI Inputs are not loaded, does it mean that you can see the Add vi loaded onto the sub panel but the Input value is not updated?

 

Or, does it mean you do not see the Add vi loaded on the sub panel at all?

 

My bets are that the path: F:\Add.vi is the cause for it.

 

Do you have the Add vi on the target computer in the same path as above? If no, then either copy it there or use relative path for the Add vi and try it.

 

Let us know if it works.

 

I do not have LabVIEW on my PC currently so I can debug the code you sent when I get to office. Also, please post the code in LV 2010

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 2 of 6
(2,782 Views)

Hi, thanks a lot for helping.

I meant that the I can see the Add.vi loaded onto the sub panel but the Input value is not updated. I have also tried to use relative path "Add.vi" but the result is the same.

I saved the code to LabVIEW 2010 format. It seems that Start Asynchronous Call and Wait on Asynchronous Call were not available in LV 2010. It does have Call By Reference node though, which I tried but it had the same problems.

One interesting thing, I tried to run the executable remotely while monitoring the controlled executable. I can actually see the input value updating on executable but it does not update on browser (see attached image). On the right is the front panel in browser and on the left the actual executable at the same time.

 

Remote panel sample.png

Download All
0 Kudos
Message 3 of 6
(2,766 Views)

Hi Samuli!

 

Maybe I will not do it the way you do. In simpliest I will do it

 

This might work better. Maybe you could modify it.

 

- You will create a path to open the file. You run it and then when the program is close then it will close the path also and close the subVI that is dynamically loaded. Let's go step by step and I will help you to modify your code. Please just try this first and see if you could get the idea of how it works first. I will continue to modify the code so it could load as you wish with tab-control.

 

BR,

Make Nguyen

National Instrument Technical Support

0 Kudos
Message 4 of 6
(2,744 Views)

Hi Samuli!

 

I think this KB will offer you great help. It is similar to my example. http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/dynamic_loadcall_vis/

 

And you can load individual VI everytime you press "Load" button for example by putting the code inside event structure. I will make a few test later today and put the code for you to see.

 

BR,

Make

0 Kudos
Message 5 of 6
(2,737 Views)

Ok, it seems that I got it to work now. The trick was to use invoke node as Make suggested to run the VI and Ctrl Val.set and Ctrl Val.Get methods to pass inputs and collect outputs (see diagram snippet below). Thanks to everyone! 🙂

 

solution.PNG

0 Kudos
Message 6 of 6
(2,731 Views)