LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Restart the computer when using Visa Read function.

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.VISA Read error.jpg

0 Kudos
Message 1 of 14
(3,637 Views)

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.

Message 2 of 14
(3,610 Views)

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.

0 Kudos
Message 3 of 14
(3,597 Views)

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.


"Should be" isn't "Is" -Jay
Message 4 of 14
(3,595 Views)

I do not understand your mind , 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.

0 Kudos
Message 5 of 14
(3,586 Views)

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.

0 Kudos
Message 6 of 14
(3,580 Views)

 

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.

 

 

 

 

 

 

 

 

0 Kudos
Message 7 of 14
(3,574 Views)

 

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?

 

 

 

0 Kudos
Message 8 of 14
(3,571 Views)

@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.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 14
(3,568 Views)

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 ...

 

 

 

 

 

 

 

0 Kudos
Message 10 of 14
(3,567 Views)