LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with DVR (Data Value Reference) in Executable Run Time Application

Solved!
Go to solution

Hi,

 

I just discovered the existance of data value references and I can't make them work in an executable. See this example where I can dock/undock subpanels. It works when I run the vi but not when I run the EXE. It breaks in the initialization where subpanels are not even loaded. Before investigating further, I'd like to know if the utilization of DVR is appropriate for executable application.

 

Thanks!

Download All
0 Kudos
Message 1 of 5
(163 Views)

I would likely bet that in your exe, the symbolic folder constant causes the array of refnums to return an empty array. Hence, there is a 0 iteration For Loop where that array is the autoindexing input. Those are common enough mistakes that I have to suggest that you look there first! Maybe even create some temporary indicators to make sure that your build output has the expected files in the right folder.

 

As to the DVR use:  I'm not a fan of what you're doing here.  A LV2 Global holding a DVR to an array of scrnstate data buys nothing that you wouldn't have with a proper Action Engine (ideally in a lvlib with a private core and public API members like Update Screen States vi)


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(150 Views)
Solution
Accepted by topic author AlexDarsigny

DVRs are perfectly fine to use in an executable. You have to be careful with VI reference lifetimes, but that is not an issue in your project.

 

Your VIs are probably not at the expected location. Consider using static VI references. They will automatically include the VIs in the built application and you do not need to worry about paths.

 

snip.png

 

Message 3 of 5
(141 Views)

Static VI references works. In fact, I think this is my only solution because I was not able to figure out how the VI is found is an executable environment.

 

For now it's allright but in the case where I'd like to create multiple references of VIs "test1.vi", "test2.vi", ..., "testx.vi", is there an alternative to static VI references that would do the same without the obligation to browse the VI manually, a sort of programmatical browsing?

 

Thank you very much!

0 Kudos
Message 4 of 5
(105 Views)

@AlexDarsigny wrote:

Static VI references works. In fact, I think this is my only solution because I was not able to figure out how the VI is found is an executable environment.

 

For now it's allright but in the case where I'd like to create multiple references of VIs "test1.vi", "test2.vi", ..., "testx.vi", is there an alternative to static VI references that would do the same without the obligation to browse the VI manually, a sort of programmatical browsing?

 

Thank you very much!


Yes there is!  But, you do need to place the vis in the right folder!  It looks like you are using the application data folder.  This is not the same place in LabVIEW as it is in MyApplication!  You can cause the Build spec Output to add the source vis to the <application>/data folder from the Destinations configuration page in the build spec. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(102 Views)