LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the telnet command line in Labview

Hi, someone can help me, I need to use a Telnet session in Labview but without using the http protocol, in this application I can only access the Telnet session using command line, here is an example of how I can access:

  1. From my computer, click on Start, then Run and then type in CMD.
  2. In the command line enter “telnet 192.168.0.1 5454” (without the quote marks) to bring up a blank DOS screen with a blinking cursor.
  3. Type “AT” and press the ENTER key, you should receive an “OK” response.
  4. Type in capital letters “AT+CMAR=1234” (without the quote marks)
0 Kudos
Message 1 of 14
(20,183 Views)
You have to use the "System Exec.vi". Look at "examples/comm/Calling System Exec.vi" for examples how it can be used.
0 Kudos
Message 2 of 14
(20,170 Views)

Or if you have the Vi's concerned [I think they're in the internet toolkit - search for Telnet on your functions pallete to see if you have them installed],

 

establish your connection with Telnet open connection (on address 192.168.0.1, port 5454)

read and write as needed with Telnet Read / Telnet Write

when you're done use Telnet Close Connection

 

(or maybe use Telnet Play Script for your entire conversation, instead of the individual read and write)

 

Rod.

 

Message Edited by Rod on 16/06/2010 17:59.. 05:59 PM
Message Edited by Rod on 16/06/2010 18:01.. 06:01 PM
0 Kudos
Message 3 of 14
(20,158 Views)

(or maybe use Telnet Play Script for your entire conversation, instead of the individual read and write)

 

Hi Rod, can you give me a sample?

 

0 Kudos
Message 4 of 14
(20,138 Views)

I had a similar situation and here is what I did...

 

In MAX (Measurement and Automation eXplorer)

Select Devices and Interfaces

Select VISA TCP/IP Resources

Create a new resource

Select Manual Entry of Raw Socket

Enter the IP address and port (23 is the standard telnet port)

Give it a name. (VISA Ailas)

 

Now this "Device" will show up in the VISA drop down just like any other VISA device.

 

Use the VISA read and write just like you were communicating through a com port.

 

Since Telnet does not have a stop bit like serial, make sure you enable the termination character.

 

On your VISA reads set the number of characters to a big number, then VISA will read until it gets the termination character.

 

See my attached snippet of my Telnet read vi

Message Edited by RTSLVU on 06-16-2010 01:49 PM
Message Edited by RTSLVU on 06-16-2010 01:50 PM
========================
=== Engineer Ambiguously ===
========================
Download All
Message 5 of 14
(20,116 Views)
That's quite clever. Smiley Wink
0 Kudos
Message 6 of 14
(20,064 Views)

That's quite clever. :smileywink: ~

You have said!!  Smiley Wink

0 Kudos
Message 7 of 14
(20,041 Views)

I'm sure you could use the TCP/IP functions in the same manner except you would not need to do anything in MAX. After all, that is what the Telnet functions use when you dig down a bit.

 

 

 

 

0 Kudos
Message 8 of 14
(20,027 Views)

Dennis Knutson wrote:

I'm sure you could use the TCP/IP functions in the same manner except you would not need to do anything in MAX. After all, that is what the Telnet functions use when you dig down a bit.


 

 If you use plain TCP/IP, you need to do the telnet negotiations yourself. 🙂
 
0 Kudos
Message 9 of 14
(20,015 Views)

My first instinct was to use the TCP/IP functions but I abandoned them for the VISA route.

 

I can't remember exactly why bit I think altenbach is eluding to what I was thinking at the time.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 14
(20,010 Views)