07-18-2011 07:32 AM
Hi,
currently writing on a program and I've got (as always, cause I'm noob) problems with it.
My Program helps me with some measurements I am currently doing, so it does control several motors and evaluates the data from pictures from a camera.
The program always runs fine during my first measurement, however when I hit the button to start a second measurement, LabView crashes. Crashing meaning, that LabView closes itself completly, I am back to Windows and trhere is no error report. Same thing used to happen, when I close my program, restart it and then do the 2nd measurement. In order for it not to crash, I had to close LabView completly and the restart, however now, without changing anything, the program will crash as well when I try to stop it.
I've been trying to find my error for ages, but just can't work out what is happening.
I used to have some trouble with an internal memory overflow of LabView. Could it be, that something similar crashes my program?
Or are there any other main reasons for such crashes?
Notable is, that the program only ever crashes, when I just hit a button/conrol-element.
I'm glad for any Ideas, thanks already!
Greetings
I didn't post the code, as it is quite hughe. If it is essantial let me know and I'll post it.
07-18-2011 07:45 AM
A crash like this indicates that the process is shut down by the OS. Most often, access vialotations are the reason.
Therefore, my first suspects would be calls to DLLs or other software interfaces (ActiveX, .NET). The next thing to look at would be reference handling: Handles to files/resources (DAQ devices, cameras, motion axis)/objects/....
I would start removing certain parts of the application until the crash disappears. After this, "re-add" functionality until it starts to crash again. This is often a good way to identify the faulty part. Then, start to build a simple example showing this functionality or strip the existing example as such, that the crash still occurs but the code looks clean and easy.
Using this example, you will have a much easier time to identify the real source of the problem and you should be able to get a solution or at least a workaround.
hope this helps,
Norbert
07-18-2011 08:45 AM
Hi,
thanks for your quick reply.
The program uses several .dll, several motors and a camera, so this could be a solution.
However I then don't understand why it initially works fine? Plus the moment it crashes, nothing changes on the .dll or other devices.
Still I will try the removing and readding thing.
I'd be glad for any idea someone might have what else could cause such a crash?
Thx again
Greetings
07-18-2011 08:57 AM
@kper wrote:
I'd be glad for any idea someone might have what else could cause such a crash?
Possible causes
07-20-2011 03:02 AM
Hi,
thanks a lot for your answer.
I indeed found another bug in the program. It happens, when I press a different button, again only at the second time.
Here however I get an error massage, saying that the internal LabView memory is full.
Last time I had such an error, I accidentially initialised an infinitly large array. However such mistakes would crash the program at the first time pressing the button, I guess.
Sadly my knowledge about LabView isn't very good, so I ask: Is there any way, that a program could just about overfill the LabView memory? Or is the LabView memory way too large for that to happen and I probably did something else wrong?
And if it could be, how can I assign more memory to LabView/the program?
Thanks again!
07-20-2011 09:35 AM
You don't really allocate memory to LabVIEW. LabVIEW makes requests for memory to the operating system, and if the operating system can't fulfill it, then your program doesn't work. Typically the issue isn't the amount of memory available, but the amount of contiguous memory available. Arrays need to be contiguous in memory. If your system memory is fragmented (due to general use or opening/closing lots of applications, or frequent allocation/deallocation), then you may not have a large enough block of memory available for your array. In this case you have to use other alternatives. You may wish to read this article: Managing Large Data Sets in LabVIEW
07-21-2011 02:54 AM
Hi,
thanks, that article about the functional globals helps a lot. It'll be quite a lot of work to apply it to my program, however it looks, as if it is going to solve the issues.
If I understood it correctly, the problem is, that my program does too much buffering of data? Sure enough when I checked, my program was flashing with black dots indicating new buffers all over.
So I'll try to hunt down these black dots, then I'll post wether it worked or not.
Thanks a lot to everyone who helped!
Greetings