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 Project Providers

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a VI out of PPF in the VI's project context: VI hangs

Hi,

 

I found an issue with "Application Directory.vi" when its called from Project Provider Framework's context (PPF). (Probably it’s not the only issue, but I was able to reproduce only with this VI.)

 

The issue in detail:
I have a project (TestProviderProject) to illustrate the problem. In the project there is a VI called "getApplicationDirectory.vi" which contains the "Application Directory.vi" VI.
When I try to run "getApplicationDirectory.vi" from PPF (with a right-click menu) the VI just hangs and waits for "Application Directory.vi" to finish.

right-click-menu

 

application-directory

I need to run the VI in the project's context (not in PPF's context) because the execution is very slow when it’s run in the PPF’s context (the reason being that all dependent VIs need to be loaded into the PPF’s context, which takes long if the project is big). Note that if I run the VI in the PPF's context, the VI executes fine (no hang). Here is the corresponding code snippet in the plugin where I define the execution context:

application-reference

 

I used LabVIEW 2015 32 bit. The project and the PPF code is in the zip file.

(

  • Unzip "TestProvider.zip"
  • Merge "Providers" folder with "<LabVIEW>\resource\Framework\Providers"
  • Restart LabVIEW
  • Open the TestProviderProject and right click on "getApplicationDirectory.vi", then select TestProvider --> Run VI

)

 

What could be a possible solution to this problem?

 

Thanks,
Balazs

0 Kudos
Message 1 of 7
(5,092 Views)

Hi Balazs,

 

I did a bit of troubleshooting on this and it seems that the "Application Directory" VI contains a few Application property nodes which seem to hang in the provider context.  As a workaround, have you tried using mxLvGetProjectPath.vi in order to get the Project Path?  Is there a specific reason you need to use "Application DIrectory" VI and not the mxLv specific VI?

 

David

0 Kudos
Message 2 of 7
(5,008 Views)

Hi David_L,

 

The specific reason I have to use the "Application Directory" VI is that I cannot change the code which contains this VI so this was just a demonstration of the problem in a small project. Furthermore as I mentioned before there are other similar issues, but I can only reproduce this one.

 

Balazs

0 Kudos
Message 3 of 7
(4,998 Views)

I see.  In this case it seems that the only solution would be to call the code in a different context that doesn't hang or to change the code being called to not use Application property nodes.  I'll report this bug to R&D, but it's not highly likely to be fixed in the near future and when it does would only be fixed in newer versions of LabVIEW.  If you're creating an add-on that will be used in older versions of LabVIEW you'll have to workaround the issue.

 

Sorry I didn't have a better answer for you, but let me know if you have any further questions on this.

Message 4 of 7
(4,988 Views)

For reference, this was reported to R&D as CAR 654834.

0 Kudos
Message 5 of 7
(4,986 Views)

Hi David,

 

thanks a lot. I wonder how UTF is able to workaround the issue as UTF is also implemented as a plugin. I see though that UTF is not a regular plugin as it is implemented using "MXX" files. I couldn't find anything about this technology (MXX). Do you know any information about the usage of MXX files? My current hope is that we can workaround above problem in the manner of UTF/MXX. Does it make sense?

 

Balazs

0 Kudos
Message 6 of 7
(4,976 Views)

Hi,

it turned out that the root cause is a blocking call inside TestProvider_Item_OnCommand.vi (part of PPF). It may be the case the code inside this VI (e.g., calling getApplicationDirectory.vi) hangs due to some circular dependencies (across PPF and custom code).

A possible workaround is to asynchronously call an auxiliary VI with the 0x80 option flag (Prepare to call and forget), in which the custom code (e.g., getApplicationDirectory.vi) can be executed. As a result, the call to the PPF (TestProvider_Item_OnCommand.vi) can return (resources are released), and the custom code can run without blocking.

I used my original project and added this workaround. I attach the fixed project.

Best,
Balazs

0 Kudos
Message 7 of 7
(4,781 Views)