LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Telnet using TCP

Hi all,

 

I need to do a test where I have to send AT commands via Telnet to my device.

The hardware that I'm using is a Digi ConnectPort X2 working like a gateway/coordinator.

 

I connect my device/DUT to this GW/coordinator and then I have to send all the AT commands. When sending the FR (Software Reset) command to the device, the BT parameter has to be set to 0.

 

Looking for using Telnet with LabVIEW, I found this thread.

 

It have been very helpfull, but I can't get the same response I get from the cmd.

I think that I'm not understanding how the TCP Read works (mode, bytes to read, etc.), I read the LabVIEW help but I'm still confused.

 

I get the response that I want but not in a single loop/operation (I attach the VI) and I think that it can be done so much easier or in another way.

 

Thanks in advance.

 

telnet.png

 

 

 

using LV 2017 on Win11
0 Kudos
Message 1 of 4
(147 Views)

I forgot to attach the VI

using LV 2017 on Win11
0 Kudos
Message 2 of 4
(123 Views)

Telnet is a little more complex than just text. Yes you should be able to just send text to most devices, although they may require specific telnet commands to setup their operation. They can however answer with command responses. Any Telnet command starts with the  IAC escape character, byte code 0xFF (255), which most likely is your ÿ character in the responses. Such command sequences should be at least discarded but can be also interpreted. So your receiver for sure gets a little more complex than just reading one line per command sent.

 

First, you need to analyze the returned data and discard all sequences that start with 0xFF <command code> and apparently another code in your data represented by the square. Then there is apparently the echo of the command you just send, then there is the answer. A simple TCP Read alone is NOT enough to read the entire response properly.

 

But others claimed it was just text!! Yes that all depends on the device and most likely you can send telnet commands to disable all kinds of features for your device too, including the echo of the command and such, but your device has them enabled by default. Your telnet terminal program knows about these telnet command sequences and interprets them rather than just printing them on the screen.

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 4
(114 Views)

You may install Internet Toolkit 2012. It has an embedded full Telnet library. 
This library is deprecated, but it was fully functional when I used it a few years ago.

 

Someone published this lib on Github :
GitHub - NEVSTOP-LAB/LabVIEW-Internet-Toolkit: National Instruments LabVIEW Internet Toolkit · GitHu...

 

 

0 Kudos
Message 4 of 4
(31 Views)