LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication using character echo

In version 7.0, I am using a VISA read with a termination char (enabled) but I can't see how to echo each character back to the source as it is received (before the term char). Any thoughts?
0 Kudos
Message 1 of 5
(4,332 Views)
Are you looking for an automated way to echo serial data? That is, write everything read? If so, that is something you'll need to do in your program.
0 Kudos
Message 2 of 5
(4,332 Views)
If you mean by "automated" something like a terminal emulator which has an LOCAL ECHO function just by setting a bit, then yes, I guess that would be an ideal solution (with the understanding that LOCAL above is inappropriate). But that is probably not available, so I would have to program this functionality into the code. Anyway, each character, as received, needs to be written back to the source. From NI, I get the impression that I can't get at the input buffer until the read operation is terminated by that termination character, by which time it is too late. In this case, my source is waiting for the echo of its last char sent to know that it was received ok and can send the next.
thanks
0 Kudos
Message 3 of 5
(4,332 Views)
There at least three ways to terminate a VISA read:

1) Termination character
2) Requested read quantity received
3) Timeout

I suggest that for your application that you disable the termination character and only request to read 1 byte at a time. This way the read completes immediately after the byte is received and you can write it back out the serial port.
0 Kudos
Message 4 of 5
(4,332 Views)
"read one byte"... great idea, why didn't I think of that.
Its working... thanks for the help
0 Kudos
Message 5 of 5
(4,332 Views)