10-09-2008 04:24 PM
Hey everyone:
I use the example VI downloaded from NI website (as attached) for boxcar SR245 comunication via RS232. The output to SR245 seems OK. However, the input from SR245 keeps changing when I run the program once after another. Anyone also use this example VI? What is your experience? Thanks!
10-10-2008 03:09 AM
Hi,
Instead of using Bytes at Port, I'd simply read a fixed number of bytes - with a timeout. If you know exactly how many bytes to expect, then read that many bytes. If you don't know how many bytes to expect, then wire a 'large' number - like 1024 - to byte count, and ignore timeout errors.
I've found Bytes at Port to be unreliable!
As a matter of good practice, don't expect local-variables to be updated "instantly". In your VI it would be better to wire the delay (following VISA Write) directly from the case to the "Wait ms" function.
By the way, I WAS going to warn you about the uninitialized shift-register in the while-loop, but realized it's always assigned -1 - and that works as start-offset for Match Pattern - very nice!