07-15-2015 10:18 AM
Hi Everyone,
New Labview user here. I am using an Agilent multimeter to measure the current of a device over time. I am communicating with the multimeter through the network. For the most part, my code runs fine until last night.
I set it up so that my program would measure and record the data every 60s with 7200 measurements (120 hours). When I came to check it this morning, Labview was closed, and I initially thought that maybe I closed Labview by accident. I checked where my data is saved, and the file was saved in the middle of the night (about 750 points of data or 12.5 hours). Therefore, I didn't close Labview by accident. The multimeter was still running but not being controlled by Labview.
My code is also set up to stop running if the device breaks. The device is not broken. I don't have any code that records error logs, unfortunately.
I don't think anyone will be able to give me a definite answer, but are there any ideas? This is the first time it has happened. I attached my code.
Thank you!
Solved! Go to Solution.
07-15-2015 10:38 AM
Here are a few points to consider:
- You have a lot of arrays on shift registers - these are never cleared and so the memory of your application will continue to grow (which can be the cause of LabVIEW crashes)
- You write the entire data set to the file each time the loop runs, why not just append the new data (using the file I/O functions)? This will save/reduce disk writing and reduce the amount of data in memory.
Have you tried looking on your windows event logs to see why LabVIEW crashed? If an error occurs, are you sure you want to exit - would you not want to retry? You should definitely think about putting some error logging in there - even if it's just to log the error as you exit.
07-16-2015 08:29 AM
Expanding on what Sam mentioned, here are some suggestions for not having "ever-growing" arrays ...
Removing ever-growing arrays from your loop with not only prevent "out of memory" problems, but will also prevent "time leaks" caused by having to stop and allocate more memory for the ever-growing arrays (this might not be a problem here, but why take the chance?).
Bob Schor
07-16-2015 04:57 PM
Thanks Sam and Bob!
I tried all of your suggestions. My code looks a lot simple now.
Natalie