LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW telnet interface

Hi 

 

 

I would like to communicate to my DUT via Telnet interface . 

As per my research I could see the LabVIEW support available for version 2012

Please let me know is there any library/method available for Telent protocol interface . 

 

Thanks 

siddesh 

0 Kudos
Message 1 of 12
(2,143 Views)

Assuming a very basic Telnet interface, you can just use simple TCP/IP messages.  Telnet only gets complicated if Option Codes are involved.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(2,101 Views)

Hi Siddesh,

 

Long ago a kind gentleman @danny_t shared this information with me about telnet:

 

 

1) Port number: 23 (I think it is standard do use this port number to establish a telnet communication)

XM43_1-1690811397691.png

 

 

2) Line termination for telnet commands: Carriage return and Line feed constant

add these two after each message being sent by you.

XM43_2-1690811505325.png

3) Reading: Example

 

XM43_3-1690811582245.png

 

4) Rest is all basic TCP IP.

 

You may have to customize read and send operations. You probably want to remove number of bytes to read, may need to edit/ remove match expression and change read mode.

0 Kudos
Message 3 of 12
(2,085 Views)

You should include the VI itself because it is impossible to reconstruct using the pictures you sent.  Also, (to the OP) firewalls may block port 23 because Telnet is not secure, so make sure it is not being blocked.  If I remember correctly, some reasons why Telnet support was dropped by LabVIEW because it was unsecure, and there were better ways of doing the same thing.

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 4 of 12
(2,071 Views)

@billko wrote:

If I remember correctly, some reasons why Telnet support was dropped by LabVIEW because it was unsecure, and there were better ways of doing the same thing.


Telnet is a plain text protocol.  Very insecure.  Yes, this is why NI stopped supporting Telnet and FTP.  Replacements should be SSH and SFTP or WebDAV respectively.  SSH is only barely supported in LabVIEW (cannot keep an open session, but simple transactions work).  I use an open sourced .NET library for SSH.  NI has done quite a bit of work on SFTP and WebDAV.

 

But Telnet is a very simple and long used protocol, so it just won't die (much like RS-232).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 12
(2,058 Views)

I do not think it is impossible but below is a snippet and VI of the same for OP to refer to:

Telnet protocol Basic.png

I have been handling my telnet communications on RT so ports never became a problem. Windows firewall may require a work around and yes, telnet is not secure but pretty easy to use.

 

Edit: I think when I was initially doing some testing I established telnet communication on Windows and accessing port 23  worked fine. So there might be no issues. This was about 2 years ago.

0 Kudos
Message 6 of 12
(2,054 Views)

I have used TCP interface configuring port number 23

 

labview TCP READ will return ÿýÿý ÿý#ÿý'  instead of login: or Password:

 

may I know what is the route cause for this issue?

Am i missing any setting ?

 

Thanks 

Siddesh 

0 Kudos
Message 7 of 12
(1,999 Views)

@Sidddesh wrote:

labview TCP READ will return ÿýÿý ÿý#ÿý'  instead of login: or Password: 


Likely option codes that need handled.  Change your indicator to Hex Display and post what the bytes are.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 12
(1,988 Views)
Response data : FFFD 18FF FD20 FFFD 23FF FD27 FFFD 24
0 Kudos
Message 9 of 12
(1,980 Views)

Those are Option Codes.  The device is telling you to "DO" something and it expects a response to those commands.  In this case, I would "WONT" (ie reject) those options. For more details, see here.

 

Try adding this to your read routine.  It will detect these Option Codes and respond accordingly with rejections.  I have not tested this code as it is here.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 10 of 12
(1,970 Views)