Showing results for 
Search instead for 
Did you mean: 

Close comport(visa) causes crash


...another suggestion:


Try running NI-Spy and configure it to log all VISA transactions before durring and after the crash. It just may shed some light on what you are seeing.


another idea,


Does it crash if your widget is not turned on?



Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 18

Hello all,


Ben mentioned that there were some crash issues related to COM ports in LV 7.1, perhaps you can help with something really strange I have run into. My application, written in LV 7.1 and compiled via Application Builder to an .exe., uses the serial port with standard commands, and runs just fine at many sites and on many different computers from PIII's to Core Duo's, 2000 to Vista. The users will either connect directly to the desktop COM1 or use a USB-serial adapter, and both work fine. At one particular location, two PC's both exhibited the same symptom - after seemingly random periods ranging from minutes to hours, the program crashes with a generic Windows error rather than any particular LV error message. The crash is clearly related to the serial port since a) it only occurs when communicating via the serial port and not when doing other things (e.g. ethernet communications, calculations, graphing, etc.), and b) the serial port is no longer available, so just restarting the software doesn't work, it complains that the port is not accessible and requires a full reboot. A completely fresh PC at that location works fine. Recently I heard of this occuring at another site that, as far as I know, did not experience the problem in the past. I believe all three crashing computers are PIV's running XP.


It seems that there is a software incompatibility somewhere, but none of the other packages on the offending computers seem to do anything with the serial port, and in any case are not running. Any ideas on what might be causing this, or how to track it down?



Dan Some

Wyatt technology Corp.

0 Kudos
Message 12 of 18



It would be helpful if you could obtain a screenshot and/or error log file from when Windows crashes. Have you tried updating your VISA driver? There may have been a fix in the latest version, and this is a good starting point. Are the two PC's that exhibit the crash the same configuration or different?



Mike W
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 13 of 18
Thanks for the reply, Mike.


I can't attached a (highly compressed) screen shot of the Windows error message because the forum does not allow over 10K characters. The error is of the generic "[Your program].exe has encountered a problem and needs to close." type. I do not have direct access to these PC's but the user was not able to find the Windows error report where it was supposed to be.


I also downloaded VISA 4.5 to upgrade my older one, I think it was 3.2. However, this does not seem to have updated the LV Runtime engine so the Application Builder is still installing a 2004 version of NiViAsrl.dll; i.e., the new file appears on the PC where I am running the development version, but an installation of the compiled version on another PC (previously wiped clean of any remnants of older versions) still shows the old version. Is there a way to convince App Builder to include the new version, or can I just overwrite the old dll file on the user PC?


Dan Some

Wyatt Technology Corp.
0 Kudos
Message 14 of 18
Whoops, I did in fact manage to attach the screen shot, so scratch the first phrase of the last post...
0 Kudos
Message 15 of 18

Should have checked this before asking - no, I cannot just overwrite the NiViAsrl.dll, the executable does not work with it properly.


- Dan

0 Kudos
Message 16 of 18

Alright, I've figured out how to use the new VISA version at the client site - have them install the NI-VISA Run Time Engine, in case anyone is interested. Will try this out and see if it fixes the problems.



0 Kudos
Message 17 of 18

For general edification - my problems of general protection fault crashes occurred almost exclusively on PCs configured with a particular corporate IT image, and became worse with a Quad core computer. Eventually I was able to get a hold of the offending PC and, based on other threads in the forum, found that I could eliminate these crashes by replacing almost all the timed loops with While loops.
My advice - avoid timed loops unless they are absolutely necessary.



0 Kudos
Message 18 of 18