05-17-2016 05:14 AM
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.
05-18-2016 01:30 AM
@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 🙂
05-18-2016 03:22 AM - edited 05-18-2016 03:23 AM
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.
05-19-2016 06:04 AM
Thanks.