07-31-2023 02:12 AM
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
07-31-2023 07:40 AM
Assuming a very basic Telnet interface, you can just use simple TCP/IP messages. Telnet only gets complicated if Option Codes are involved.
07-31-2023 08:58 AM
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)
2) Line termination for telnet commands: Carriage return and Line feed constant
add these two after each message being sent by you.
3) Reading: Example
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.
07-31-2023 11:03 AM - edited 07-31-2023 11:04 AM
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.
07-31-2023 12:03 PM
@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).
07-31-2023 12:31 PM - edited 07-31-2023 12:35 PM
I do not think it is impossible but below is a snippet and VI of the same for OP to refer to:
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.
08-01-2023 04:27 AM
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
08-01-2023 06:50 AM
@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.
08-01-2023 07:57 AM
08-01-2023 08:48 AM - edited 08-01-2023 08:49 AM
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.