Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa read characters out of sequence

I'm doing a VISA read from an RS-232 instrument that is supposed to return St3E. What I read is always t3ES, which is correct but out of sequence. What am I doing wrong? In the attached vi, I'm looking at the indicator STxE.
0 Kudos
Message 1 of 5
(3,669 Views)
Hi wb2nvy,
When I look at the code in your VI it looks like your vi is sending the string St01E.  What if you try sending the string, 123, or ABC.  Also try the string 123456, or ABCDEF.  To see what pattern develops.


Regards,
John E.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(3,649 Views)
Thanks John. The letter group St01E is a command that tells the LED analyzer to return a value of x, nested in the characters STxE. I"m sure sending nonsense characters as a command would yield nothing in return. However, after this kind of behavior many times it strangely started returning the correct sequence long after I posted the question. Thanks again John.
0 Kudos
Message 3 of 5
(3,634 Views)
What you read as 't3ES' is probably a combination of two replies from your instrument.  't3E' from the end of one response and 'S' from the beginning of the next response.  If it did it once, it will do it again.  You could alter your vi to flush the buffer when this happens and retry.
0 Kudos
Message 4 of 5
(3,623 Views)
Thank you. I'll try that.
0 Kudos
Message 5 of 5
(3,618 Views)