LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in reading binary files

Hi All,

I can able to read the data in the file using file dialog box in main vi but when i build the exe the data is flowing to 2nd case and giving the error message in that case.Capture1.JPG

 Please find the code snippet 

Download All
0 Kudos
Message 1 of 20
(4,331 Views)

Hi chaituc,

 

please attach VIs instead of (blurry) images - they are much better to debug using LabVIEW!

 

1. Use BuildPath instead of string functions to build a path!

2. Please output the file path used for reading the file in case of an error: you really need to check for valid file paths…

3. Please output the error number in case of an error: how will you know WHICH error occured?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 20
(4,324 Views)

Please find the VI attached

0 Kudos
Message 3 of 20
(4,308 Views)

Hi chaituc,

 

try something like this:

check.png

Now you should be able to detect problems more easily!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 20
(4,302 Views)

Hi,

When i am running the VI it can able to read the file without error and going to "No Error" case but after converting to EXE, it is going to "Error" case and displaying the load failed.

 

Best Regards,

Chaitanya.

0 Kudos
Message 5 of 20
(4,298 Views)

Hi chaituc,

 

it is going to "Error" case and displaying the load failed.

Which path?

Which error number?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 20
(4,290 Views)

This sounds like the classical error of VI vs exe-path. If your file is relative to your VI, it Changes 1 level when compiled as the .exe is considered a level. Do a Dialog box which shows your path and you'll see the difference from the VI to the exe.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 20
(4,284 Views)

I use these

 

"If you weren't supposed to push it, it wouldn't be a button."
Download All
Message 8 of 20
(4,274 Views)

@Yamaeda  ha scritto:

This sounds like the classical error of VI vs exe-path. If your file is relative to your VI, it Changes 1 level when compiled as the .exe is considered a level. Do a Dialog box which shows your path and you'll see the difference from the VI to the exe.

/Y


There is a File Dialog express vi to choose the file, in principle there is no room for a mistake, unless the user chooses an ill-formatted file.

Moreover, the Application Directory vi consistently returns either the disk directory where the executable file is located orr the directory of the .lvproj file when running from inside LabVIEW. The "classical" error I also had experience with many times should not be an issue anymore.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 9 of 20
(4,268 Views)

Look up the Help documentation for Application Directory.  Notice it is different for Applications (.exe) than for VIs in the Development Environment (and different for developing in a Project and "in the raw").  So if you have a different Path in one instance, you might expect an error ...

 

Bob Schor

0 Kudos
Message 10 of 20
(4,254 Views)