07-16-2024 12:10 PM
What is the difference between the way VISA serial sends data and the way TeraTerm sends data over a serial port?
I am working with a device that when you send values in a list it is supposed to respond with the values that were set.
Using TeraTerm I send SetValues [location:value,location:value,location:value]
The UUT responds [location:value,location:value,location:value] as expected
But when I use VISA Serial to send the exact same command SetValues [location:value,location:value,location:value]
The UUT returns SetValues [location:value,location:value,location:value] the command SetValues was also sent back like there is some kind of local echo turned on.
What could be the difference?
Solved! Go to Solution.
07-16-2024 12:35 PM
@RTSLVU wrote:
But when I use VISA Serial to send the exact same command SetValues [location:value,location:value,location:value]
The UUT returns SetValues [location:value,location:value,location:value] the command SetValues was also sent back like there is some kind of local echo turned on.
What could be the difference?
Your device is echoing back the command you send it. This is actually a remote echo. Terminal applications such as Putty and Teraterm can automatically handle this as it is constantly reading and it will not display the echo. Your application just needs to perform 2 reads to read the echo and then read the response. Or if you want to mimic me, I constantly read the port and only send data back to the main loop that it requests (apply a filter on the read line and decide whether or not to pass it on). I also have the habit of logging everything that comes from the terminal. In this situation, the echo makes life easy as I don't have to worry about trying to log what I send out.
07-16-2024 12:56 PM
It does not appear to be sending back a remote echo and the requested data.
I tried two VISA Reads and the first one has the response with the command the second VISA Read just times out.
07-16-2024 01:06 PM
Ok, now I'm really confused on what the problem is. If the device is not sending the echo, then you just need to read once. Or are you confused about Teraterm showing what you sent?
07-16-2024 01:23 PM - edited 07-16-2024 01:24 PM
Using Teraterm I send the command "data?list=[{"3036":"I0"},{"3034":"F18000"},{"3035":"F1000"},{"3040":"I5"}]"
The UUT returns "[{"3036":"I0"},{"3034":"F18000"},{"3035":"F1000"},{"3040":"I5"}]"as expected
But using VISA Serial I send "data?list=[{"3036":"I0"},{"3034":"F18000"},{"3035":"F1000"},{"3040":"I5"}]"
The UUT returns "data?list=[{"3036":"I0"},{"3034":"F18000"},{"3035":"F1000"},{"3040":"I5"}]"
The "data?list=" is still there using visa and I don't understand why.
07-16-2024 02:30 PM
Yes, that looks like the device is echoing what you are sending. Are you also sending a Carriage Return and/or a Line Feed at the end of your command? It is likely the device is looking for that termination character before it processes the command.
07-17-2024 06:01 AM
@RTSLVU wrote:
What is the difference between the way VISA serial sends data and the way TeraTerm sends data over a serial port?
...
What could be the difference?
Have you tried displaying the received data in binary encoding?
My suspicion is that there might be some terminal control characters that TeraTerm handles and LabVIEW silently drops on regular string display.
07-17-2024 10:48 AM
@crossrulz wrote:
@RTSLVU wrote:
But when I use VISA Serial to send the exact same command SetValues [location:value,location:value,location:value]
The UUT returns SetValues [location:value,location:value,location:value] the command SetValues was also sent back like there is some kind of local echo turned on.
What could be the difference?
Your device is echoing back the command you send it. This is actually a remote echo. Terminal applications such as Putty and Teraterm can automatically handle this as it is constantly reading and it will not display the echo. Your application just needs to perform 2 reads to read the echo and then read the response. Or if you want to mimic me, I constantly read the port and only send data back to the main loop that it requests (apply a filter on the read line and decide whether or not to pass it on). I also have the habit of logging everything that comes from the terminal. In this situation, the echo makes life easy as I don't have to worry about trying to log what I send out.
I always though echo was a local thing. Is there a second type of echo handled from the remote side?
07-17-2024 12:25 PM - edited 07-17-2024 12:42 PM
What is the device?
NOTE: TeraTerm does actually open an Emulation Window where DOS VT, BS, etc..help navigate the response context in SOME OBSOLETE FW applications. In those cases (when the fw engineer says "well, we've been working this way since the 1950's") You have to mention that the transistor is 77 years old and 77baud is just as obsolete.
At times you may need to set a DOS Prompt size that is larger than the "boundaries" presented by the '|' and '_' sent to the cmd line area. The response location is read as well as the character sent. I've seen this exactly once this century on firmware created by SPX.
Is there a "border"
______
|xxxx|
|xx....|
______
on the TeraTerm IO? I think that I worked around that by sending the response char PREPENDED with the arrow key codes. But, don't quote me on that. (I tried to forget that pain)
07-17-2024 01:49 PM
@billko wrote:
I always though echo was a local thing. Is there a second type of echo handled from the remote side?
It completely depends on the device you are trying to talk with. For instance, an SSH connection to a Linux CLI will echo back what you wrote to it. SCPI devices generally do not. I know Putty has an option (on by default) for a terminal to detect the remote echo and will perform a local echo (ie display what you just typed) if it does not get it.