11-25-2016 06:20 PM
I am communicating with a Vitesse VSC7423 Ethernet switch using a COM port. I am writing automated code in LabVIEW and I use PuTTy to try out the commands. I noticed while working on one of the commands, "platform debug allow" (the specific command isn't important) , that while PuTTY will simply return the typed in command when reading back from the device (the echo is off) that the LabVIEW VI using NI VISA Read will instead return:
pl\b\b\s\s\b\bplatf\b\b\b\b\b\s\s\s\s\s\b\b\b\b\bplatform\sdebug\sallow\r\n\r\n
where the first two letters of the command are followed by two backspace characters (\b), two spaces (\s) and again two backspaces,
then the pattern is repeated with the first five letters of the command, followed by five backspaces, five spaces and again five backspaces
then the full command finally shows up. I also see this behavior using NI MAX.
The HEX representation is (\b = 0x08)
706C 0808 2020 0808 706C 6174 6608 0808 0808 2020 2020 2008 0808 0808 706C 6174 666F 726D 2064 6562 7567 2061 6C6C 6F77 0D0A 0D0A
Can anyone give me any insight to why this is happening?
Thanks
11-25-2016 06:38 PM - edited 11-25-2016 06:39 PM
Maybe I am misunderstanding something.
11-25-2016 06:41 PM - edited 11-25-2016 06:42 PM
You sure that PuTTY isn't dong the same thing? You'd never see it because all those characters would overwrite themselves. Try turning on PuTTY logging to see what is really being received.
11-28-2016 08:48 AM
Thanks for the response.
I did try the Session Logging to the putty.log file but it showed exactly the same thing as what the PuTTY display was showing. I tried using Hercules as well which allows special characters to be displayed and it also does not show any of the backspace characters.
11-28-2016 08:55 AM
I think you need to take this up with Vitesse. It is very odd that a device would ever sent a backspace character as part of an ASCII string.
If VISA is seeing those spaces and backspaces in the data string, then I'm sure they are there. I'm not familiar with Putty or your other terminal program to know what it would show on its display or in it's log file. What program are you using to open and inspect the log file?
11-28-2016 09:03 AM
Hi Mike,
once I had to deal with a device sending also (kind of) ASCII data with lots of formatting codes in between: this device acted like a "terminal" trying to "redraw" it's data on a "standard screen" of 40×25 chars. It used a lot of backspace, cursor keys, and so on… (In the end I filtered the received string and removed all of those formatting codes!)
Maybe your "Vitesse" is doing something similar?
Did you check the programming manual of your device? What did the customer support tell you about this "feature"?
11-28-2016 12:27 PM
Thanks for the response.
I was just using MS Notepad to view the log file. But I also just tried using Notepad ++ and see the same result (no backspaces).
11-28-2016 12:49 PM
Spaces and backspaces do all show up in a text log file opened in Notepad. (Back spaces have a funny looking character.)
If Putty is the one creating the log file, then it is probably doing the same thing it is showing on the screen. It isn't actually logging the bytes you are receiving, but logging the results of the bytes coming in (where backspace deletes the character before it.)
Check your settings in putty to see how it handles backspaces. I found a link http://serverfault.com/questions/173418/pressing-backspace-with-root-gives-weired-character-in-putty that talks abou this.
At the end of the day, do these spaces and backspaces cause you problems? Have you talked to Vitesse yet to ask them why there device is doing this?
There would be ways in LabVIEW to handle this, but until we know that you are having a problem and that Vitesse won't fix the problem in their end, it would be difficult to suggest.
11-28-2016 12:59 PM
Thanks for the response.
I haven't yet tried to contact the manufacturer but I plan to. I'm sure I can do a work around but the mystery is what bugs me. I thought maybe it was remembering backspaces I inadvertently typed in if I didn't type the command in perfectly the first time but that doesn't seem to be the case either.
11-28-2016 01:07 PM
Thanks for the response.
I did look into PuTTy settings and I found settings where if the user types a backspace on the keyboard in PuTTY you can configure it to mean different commands when it is sent to the remote device. But these backspaces are coming from the device to the PC.