LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 0xc0000005

Ref: Labview 2024 32 bit

Ref: Windows 11

I have some code that reads and writes a text file to the local drive. This simple task works well within the Labview environment. However when it is compiled to an exe, I am able to read the file but the program crashes when trying to write to the file, giving the error shown below. I assume it is a write access error, however I am in admin mode and have also launched the executable by selecting admin mode. The problem wont go away.

Is this a compatibility issue with Windows 11 / Labview 32 bit, or is there a setting in the app builder that needs to be set, or something else?

 

 

 

NI access error.jpg

 

0 Kudos
Message 1 of 4
(233 Views)

That's a memory access violation.  The app tried to use memory that it does not own.

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 2 of 4
(198 Views)

That error number is common enough to recognize on sight.  It's an "access violation" error, but it doesn't mean you lack admin access to something.  It means something in LabVIEW is trying to access a location in RAM that it's not allowed to access.  Sometimes this is a null pointer, other times it's a reference that points to memory that was allocated but later freed and is now outside of the application's memory space.

 

For the most part LabVIEW's core code, such as file writing, has been tested and debugged extensively so it is very rare for LabVIEW all on its own to generate this error, which is why if you look at other posts with the same error code they often direct you to look at 3rd party code using DLLs or ActiveX as the most likely cause.

 

Since you're convinced that writing to the file causes it, here's a few important checks to do that could help with troubleshooting:

 

First, in your current code, have you checked to see which exact subVI or node causes the crash? You could do this in many ways, but since you seem pretty sure writing files is causing the problem I'd suggest adding delays and some code to put status updates on a visible front panel somewhere so that it slows down the operation and really lets you be sure of the exact node that crashes everything.

 

Second, can you create a very small EXE that runs by itself that replicates the problem but doesn't do anything else?  Meaning something that just runs the file saving routine with a set of dummy data, or an even smaller example.  If you can do that and post the VIs that make up that EXE here, other people can attempt to build it and see if it works for them or not.

 

Third, have you tried this on any other PC or OS?  If you could see if another W11 PC, or a W10 PC, could run it with no crash, that could help check to see if it's a problem specific to your W11 PC or to W11 in general.

0 Kudos
Message 3 of 4
(197 Views)

Thanks for your advice;

On further investigation, the Labview application works fine in its own environment. When built into an exe I am able to read the file but the application crashes (0xc0000005) when writing to the file.

I tried building the exe on another Windows 11 pc and it worked fine, no problem, so my thought is that there must be something wrong with the Windows 11 pc software.

Maybe there is a setting in Windows 11 that I am not aware of. Or maybe there is a method of checking/resetting Windows 11 in particular for file access?

0 Kudos
Message 4 of 4
(152 Views)