From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

computer crashes to blue screen and restarts while reading from serial port using NI VISA Read function(VISA 15.0 ,Lab-view 2013, on WIN7 pc)

I am reading data from serial buffer in a loop  at intervals of 500 ms using Vis serial Read function, and afer some 3-4 minutes the computer crashes while reading data and Blue screen appears and restarts the PC .

After that i have included the VISA FLUSH I/O buffer function inside the loop, and it seems the problem is solved now.

But now i doubt whether any data will be lost when i flush buffer in each iterations ?

 

I am attaching a snapshot and vi . 

 

Thanks and regards.

Download All
0 Kudos
Message 1 of 4
(3,091 Views)

@roopesh689 wrote:

I am reading data from serial buffer in a loop  at intervals of 500 ms using Vis serial Read function, and afer some 3-4 minutes the computer crashes while reading data and Blue screen appears and restarts the PC .

After that i have included the VISA FLUSH I/O buffer function inside the loop, and it seems the problem is solved now.

But now i doubt whether any data will be lost when i flush buffer in each iterations ?

 

I am attaching a snapshot and vi . 

 

Thanks and regards.


Hi,

    First let me comment on your code. http://www.ni.com/example/27669/en/ see to the link for basic visa read write operation and be clear with it.

why have you added a error wait subvi to the code???? i dont know what you have made inside the subvi since it is not attached. It not necessary to use Data flush I/O buffer three times in you code. just remoce the vi in the begining and in the end.

    In your code you have placed the wait time of 500ms inside the error case structure. place it outside the case and let it be in while loop. 

 

Now whenever a particular data size is reached based on your need flush the I/O buffer. No need to Flush it for each and every iterations. also present your program in a neet manner.

 

Kudos Welcome 🙂

 

Certified-LabVIEW-Associate-Dev_rgb (2).jpg

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
0 Kudos
Message 2 of 4
(3,050 Views)

Blue screen of death is always caused by a crash in the kernel space of Windows. NI-VISA itself nor LabVIEW install any kernel space drivers for serial port communication. So the problem must be in the driver for your serial port. You don't happen to use a virtual COMM port through an USB converter? Try with a different make of such a USB converter (FTDI based ones are usually working good if you don't have the bad luck of getting a cheap counterfeit product) and I'm pretty sure the crash is gone.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(3,038 Views)