LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with executable file

Hello, 

 

I am working with the R.&S. power meter and I am using their driver to set it up. 

 

To be precise I am using the function "RSNRTZ Online Measuments" contained in the attached llb; if I want to use it in a normal VI I do not get any error, but when I try to create an .exe with the same function I always get this error "Error 7 occurred at Open VI Reference in Preload Instrument.vi". 

 

I do not know what to do. 

 

Best regards,

M.

0 Kudos
Message 1 of 4
(1,296 Views)

@Mario9121 wrote:

To be precise I am using the function "RSNRTZ Online Measuments" contained in the attached llb; if I want to use it in a normal VI I do not get any error, but when I try to create an .exe with the same function I always get this error "Error 7 occurred at Open VI Reference in Preload Instrument.vi". 


That VI is not in the library...

 

However, your code is trying to dynamically open a VI (in Preload Instrument.vi). This is done by it's path or it's name (string). If it's a string or a relative path, the exe won't find the VI there. Also, the VI might not contain compiled code, and the exe can't compile it.

 

The solution might be simple. Make sure the VI that is loaded is included in the executable.

 

+ include it in the build spec (always include)

+ or make a static VI reference, instead of dynamically opening it. If the VI is reentrant, use a static VI reference, use a property node to get it's name, use open VI reference with that name.

+ put the Vi somewhere, where it doesn't get removed. If you put it in a case with a constant wired to it, it will be removed (because it's 'dead code'). So, wire a (hidden) control to it.

 

Another option is to prevent dynamic loading of VIs altogether. But we'd need to see the code where it actually happens, and the reasoning behind it. 

0 Kudos
Message 2 of 4
(1,290 Views)

Thank you for repliyng me. 

 

I tried your solution but it does not work. 

 

Here, I attach the simply code to test the function. 

 

When you press the button "Avvia", if everything works you will get the error in the VISA Open in RSNRTZ Initialize.vi (when the instrument is not connected). 

 

Thank you in advance. 

 

0 Kudos
Message 3 of 4
(1,227 Views)

@Mario9121 wrote:

Thank you for repliyng me. 

 

I tried your solution but it does not work. 

 

Here, I attach the simply code to test the function. 

 

When you press the button "Avvia", if everything works you will get the error in the VISA Open in RSNRTZ Initialize.vi (when the instrument is not connected). 

 

Thank you in advance. 

 


RSNRTZ OnLine Measurement.vi loads RSNRTZ Initialize PopUp.vi and\or RSNRTZ Zeroing PopUp.vi by there paths.

 

Make sure those VIs are available in the exe.

0 Kudos
Message 4 of 4
(1,201 Views)