08-07-2017 06:00 PM - edited 08-07-2017 06:13 PM
I am having issues with a VI that crashes every few hours and I don't know how to approach the issue in order to solve it. The code is attached (the main vi is called DTHZ Modbus Tool 4X Customer), but since it's made to interface with specific PLC software I'm not sure how useful it will be for anyone trying to help. I've also included the most recent crash report that LabVIEW autosaved. The crash corresponding with this particular report happened when I clicked "export data log" on the front panel, but it also crashes every few hours if I leave it running in the "connected" state and don't touch it. I've had the same issue on 3 different computers. All of the features on the VI usually work properly -- it doesn't crash every time I export data log.
If any other information would be useful, please let me know. I know it's not realistic for me to expect anyone to dig through this code and figure it out, but I'm hoping for maybe a step in the right direction on how to approach it. Thanks!
08-07-2017 06:52 PM
General debugging advice - divide and conquer to isolate where in the code the problem lies. Remove sections of code until the problem goes away, then you have the guilty party.
I'd start by removing all the tracker code (those tracker decoder VIs and draw tracker position are kinda scary looking and ignore the error cluster [Q:are they continuously creating new objects, that would be bad, eventually run out of resources]) on the bottom, see if the crash happens just from the modbus code.
It is great that it always crashes, much easier to narrow down, as opposed to infrequent crashes.
Good luck,
08-08-2017 05:28 AM
Unfortunately I don't have LV2016 installed, could you save your project to 2015 (http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/saving_for_the_previous_ve/) ?
Do you have any other lvlog.txt files? Sometimes they contain more information, like call chains which are helpfull to narrow down the problem.
08-08-2017 09:30 AM
Hey PiDi,
I'd try out Crash Logger to narrow down where the trouble code is.
Once you narrow down what code is causing the crash it will be easier to determine why it's crashing and fixing it.
-Bear
08-08-2017 10:29 AM - edited 08-08-2017 10:32 AM
Hi Chris,
This is a very good idea. It looks like I am continuously creating new objects -- I haven't used objects before so I don't know what I'm doing here. Maybe a solution would be to create the objects outside of any while loops and pass them to the subVIs. I wonder if this could be a reason it's crashing. I am using very similar code for modbus polling in a different VI that I have no issues with so I don't suspect it's that. I will definitely try it without the tracker decoder VIs first. Thank you for taking a look at it!
PiDi,
See if this attachment works for you.
Bear,
Thank you! This is exactly the kind of thing I'm looking for.
Amanda