LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in reading binary files


@Bob_Schor wrote:

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").


That is because it is meant for using with relative paths.  So you do need to make sure your files keep the same relative path to your executable as your project when developing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 20
(2,044 Views)

Hi pincpanter,

 

When i try to upload a file from the list i have. I can able to upload only three files (5,6,7) from down. I can't upload the remaining files(1,2,3,4). All the files are in the same path.

Please find the attachment

0 Kudos
Message 12 of 20
(2,027 Views)

Guys,

Explaining in brief, I have 7 binary files to read the data from. When i am executing the VI i can able to read the data from all the 7 binary files.

when i am building the exe and trying to open the binary files, It throws the dialog in the error case i have given.

 

Thanks,

Chaitanya

0 Kudos
Message 13 of 20
(2,022 Views)

Hi Chaituc

 

It seems there may be problem with

1) File path : Build .exe with allow debug mode enable and run exe and highligh execution inside exe by clicking on Operate---> Debug application or shared library..

2) Binary file write function: problem may arise on how you write binary file. if you write binary file with array of elements and you specify only single element to read as a read data type reference then error occurs.

 

 

 

 

CLD
0 Kudos
Message 14 of 20
(2,016 Views)

Hi chaituc,

 

when i am building the exe and trying to open the binary files, It throws the dialog in the error case i have given.

You were asked to show more error information and you got examples on how to get them.

Did you follow our suggestions so far?

Again:

Which path does your EXE try to read?

Which error number did you get?

Best regards,
GerdW


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

When you have persistent and inexplicable problems in the middle of a large, complex LabVIEW routine that uses Classes and other Fancy Stuff, you can (probably) "figure out what's wrong" by writing a little test routine.

 

I recommend that you write a Stand-Alone program that does the following:

  • Asks the User to choose a File, using the same code that you are now using to find the .pcf files 1..7 you want to use.
  • Open the file and do enough "checking" to convince yourself that you successfully read it.
  • Verify that you and open and read all of the files.
  • Once this works, build an executable of this simple routine and repeat the test.  If it works, try to understand why, when you embed the same code in your larger program, it fails!  [It may have something to do with a "name clash" with a definition in a Class or Library somehow not properly being picked up -- this seems unlikely or maybe "impossible" to me, but who knows?].  If it works, try putting such code back in your Big Program.

In any case, you will now have a very simple routine that you can share with us, along with some data files (of course, if it works, you won't need to share it, but if it fails, we'll be eager to help and to figure out "Where's the Bug?").

 

Bob Schor

0 Kudos
Message 16 of 20
(1,997 Views)

@Gerd.  Look at the error ring  add the filename and error code, and source to the custom errors format e.g. Error %d occurred at %s trying to read file %s.

 

On a phone so no snippet.   Mr. Ko can earn a kudos for one.


"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 20
(1,987 Views)

Hi Jeff,

 

so basically what I suggested in message #4?

 

@OP:  It would have been so easy to get a full error description…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 20
(1,984 Views)

@JÞB wrote:

@Gerd.  Look at the error ring  add the filename and error code, and source to the custom errors format e.g. Error %d occurred at %s trying to read file %s.

 

On a phone so no snippet.   Mr. Ko can earn a kudos for one.


I'm kinda burned out today; only good for semi-witty remarks.  I think Gerd is on the right track, except you can use the error ring constant to translate it into "StandardLabVIEWError-ese" for ease of reading.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 19 of 20
(1,975 Views)

@GerdW wrote:

Hi Jeff,

 

so basically what I suggested in message #4?

 

@OP:  It would have been so easy to get a full error description…


Yes but much easier with an error ring, a Select wired to error, and a simple error handler.;D. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 20 of 20
(1,971 Views)