05-09-2014 04:29 AM
My project recording signal via COM port using VISA Read function. I setup number count = 900. PC was "Restart" after the VI program operating for several minutes.
I need a solution to fix my program to not be restart computer.
Thanks.
05-09-2014 08:13 AM - edited 05-09-2014 08:13 AM
You need to read your stop button inside of the while loop.
With your current setup, the stop button gets read before you enter the while loop and then never gets read again.
This means that your while loop is now an infinite loop.
05-09-2014 10:59 AM
Thank Taki1999!
I understand your mind but that is not the issue that I want to exchange. The problem with my program are: data acquisition program real time continous were transmitted from the circuit to the computer through the COM port. I predict data can get so big that the computer could not handle and restart. What I want is to be able to release the receive buffer to the computer is not restarted again.
I setup "number byte read" the value of a few hundred(ex: 300,600,900,etc..).
Help me. Thanks.
05-09-2014 11:04 AM
Any computor that can run a VISA read is not going to restart with a COM port buffer overflow. You might get a VISA error but, your code (The VISA Caller) would be the only thing that recieves the error.
05-09-2014 11:17 AM
I do not understand your mind Jeff·Þ·Bohrer, Can you describe more clearly, please! My program runs fine, only thing is that sometimes computer was RESTART when VI is running. I've never known cause, I just predict that by the buffer is not release by receiving too many bytes from COM port.
Thanks.
05-09-2014 11:26 AM
What sort of "restart" are you getting? Is it a Windows BlueScreen?
Are you using a USB to Serial adapter? I've seen some devices which don't play well with VISA and can cause bluescreens.
05-09-2014 11:36 AM
IF the device is continuously spitting out data and you do not need all of it then resetting the buffer before each read might help.
You can reset the receive buffer on every iteration if you wish. There is a VISA function for that.
But, It sounde s like something else may be happening on the remote device and how it is putting out chars. (just a guess)
.
ALso, it may be to your advantage to allow some time after each read (say 100mS)
IF I missed the delay in your code, sorry. Looks like there is no delay before reading again.
EVen so that shouyld not cause a restart of computer.
It is possible this is not related to LabVIEW as LV would normally give you a message before croaking.
05-09-2014 11:40 AM
Sorry to be critical but stop will never work again if false entering loop. Loop will be run-away if started this way, else will execute only once.
IS that the inteneded behaviour?
05-09-2014 11:43 AM
@AKA_TG wrote:
ALso, it may be to your advantage to allow some time after each read (say 100mS)
IF I missed the delay in your code, sorry. Looks like there is no delay before reading again.
There's nothing wrong with not having a wait in there. The VISA Read will wait up to the timeout for the desired number of bytes to come in. That will essencially be your wait.
05-09-2014 11:45 AM
AGain I am just guessing.
ALso it looks like your loop simply writes to same file over and over.
Perhaps this is what you want to do, but without some kind a delay afterwards ...