02-12-2020 02:42 AM
Hi everyone,
I’m unable to write into a binary file from an executable application. It works if I run from the Labview NXG (4.0) development environment. File generation works in both.
Any suggestions?
02-12-2020 02:56 AM
02-12-2020 03:35 AM
No error messages.
The program generates the file in the expected path, just not write into it, so the file path seems to be correct.
And it works if I run form the development environment: the file generation, reading from file and writing to file works, so it’s wired for me…
Here is the general idea from what I’m trying to do:
Read from / write into binary file
02-12-2020 06:56 AM
How are you confirming the data is not being written? Are you looking at the file after your application is done? Or are you using the code you just showed which contains a race condition (the read and write will attempt to run in parallel). And how do you know you did not have an error? I ask because I don't see any error handling.
02-12-2020 07:39 AM
Ok sorry, I corrected the race condition. This example was just to clarify which functions I use and the wiring; maybe it wasn’t then …
The file which was produced by the application is empty (0 KB), in contrast to the file from the development environment.
In the application I wait a few seconds after finishing my program to see there popup any error, but it didn’t.
02-12-2020 10:07 AM
I unfortunately don't have NXG so I can only guess, but does it work if you write to a different folder location? You may have file access issues. LabVIEW may have write access but your executable might not.
02-13-2020 01:18 AM
Yes I thought in the same direction, but enabling read/write access from windows option as well as start as admin also didn’t work.