LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Serial Port with Termination Char?

Solved!
Go to solution

The timeout on the VISA won't affect any other loops as long as there is nothing in your code that causes something not to run because it hasn't received data from the VISA read.

0 Kudos
Message 11 of 14
(2,657 Views)
Solution
Accepted by topic author QRP

I have to agree with Crossrulz.   Computers are fairly obedient.  By that I mean tell them to do something once and they do that thing or report an error.

 

Configure serial port. flushes the buffers...... you don't need to flush them again (Twice more in fact!) Its a serial port at 9600 Baud not a failing septic tank.  Heck, it even has mostly default parameters.  You only need to set the non-default ones!

 

Tim, I would argue that speed of error clearing might just be less important than using a defined function from the pallatte that was meant for this purpose!  Yup, Use the general error handler to handle errors (Generally, There may be reasons to use a novel approach in VERY rare cases)

 

Case structures driven by boolean comparisons should be avoided.  (Select is faster) but what the heck are you testing twice for?????  Is it Zero??? Is "Is it Zero" True???  drive the case with the integer.

 

1a.png


"Should be" isn't "Is" -Jay
Message 12 of 14
(2,655 Views)

You guys crack me up 😃 I think that's what I like most about Labview is, there is 1 million ways to accomplish the task. The hardest part is finding out which 1 out of the million ways to use 😃

 

Thanks again guys...

Message 13 of 14
(2,644 Views)

@QRP wrote:

there is 1 million ways to accomplish the task


Actually, that's just engineering in general.  But yes, finding the best way for your specific situation is often the challenge.


GCentral
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 14 of 14
(2,639 Views)