LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VISA Read returns ASCII backspaces (0x08) that do not appear in PuTTy

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

0 Kudos
Message 1 of 21
(3,801 Views)

Maybe I am misunderstanding something.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 21
(3,793 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 21
(3,791 Views)

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. 

0 Kudos
Message 4 of 21
(3,693 Views)

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?

0 Kudos
Message 5 of 21
(3,691 Views)

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"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 21
(3,689 Views)

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).

0 Kudos
Message 7 of 21
(3,671 Views)

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.

0 Kudos
Message 8 of 21
(3,663 Views)

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.

0 Kudos
Message 9 of 21
(3,650 Views)

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.

0 Kudos
Message 10 of 21
(3,644 Views)