LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Telnet

Has anyone created some code to access another machine using telnet? We
have some hardware that can only be tested through a telnet port, and I
haven't been able to figure this one out yet. I've been working with a
telnet OCX control by Catalyst, but I think I'm missing something, because I
can't get it to work. (The VB examples that came with the OCX control work,
so I know the OCX is functional).

Thanks,
David Dupont - Tools Development
Nortel Networks - Billerica System House
0 Kudos
Message 1 of 6
(8,242 Views)
David,

I know the Internet Toolkit has telnet vi's, but its an add-on package to
labview.

pat


"David Dupont" wrote:
>Has anyone created some code to access another machine using telnet? We>have
some hardware that can only be tested through a telnet port, and I>haven't
been able to figure this one out yet. I've been working with a>telnet OCX
control by Catalyst, but I think I'm missing something, because I>can't get
it to work. (The VB examples that came with the OCX control work,>so I know
the OCX is functional).>>Thanks,>David Dupont - Tools Development>Nortel
Networks - Billerica System House>>
0 Kudos
Message 2 of 6
(8,241 Views)
David,

Have you considered using the working VB code through a Code Interface Node? I
have never done such a thing with VB but it works quite well with C and I can't
imagine any reason that it wouldn't work.

Andrew B. Croll
Optical Verification
Nortel Networks, Ottawa, Canada
(613) 765-5063




David Dupont wrote:

> Has anyone created some code to access another machine using telnet? We
> have some hardware that can only be tested through a telnet port, and I
> haven't been able to figure this one out yet. I've been working with a
> telnet OCX control by Catalyst, but I think I'm missing something, because I
> can't get it to work. (The VB examples that came with the OCX control work,
> so I know the OCX is functional).
>
> Thanks,
> David Dup
ont - Tools Development
> Nortel Networks - Billerica System House
0 Kudos
Message 3 of 6
(8,241 Views)
Croll, Andrew [SKY:1V43:EXCH] wrote in message
news:392D40D5.4A297346@americasm01.nt.com...
> David,
>
> Have you considered using the working VB code through a Code Interface
Node? I
> have never done such a thing with VB but it works quite well with C and I
can't
> imagine any reason that it wouldn't work.


It'd only take an hour or so to cobble something together using the built-in
functions in Labview!

Look in the "TCP" sub-palette of the "Communications" palette. It's all
fairly easy to use- before I got to grips with VI server I was using it to
send binary DAQ data across an ethernet link to an analysis machine. Making
a simple driver that sends and receives strings from a remote piece of kit
is pretty trivial.
0 Kudos
Message 4 of 6
(8,241 Views)
David Dupont wrote:

> Has anyone created some code to access another machine using telnet? We
> have some hardware that can only be tested through a telnet port, and I
> haven't been able to figure this one out yet. I've been working with a
> telnet OCX control by Catalyst, but I think I'm missing something, because I
> can't get it to work. (The VB examples that came with the OCX control work,
> so I know the OCX is functional).

I second Craig Graham's comments about cobbling together your own solution using
the LabVIEW TCP/IP VIs. It's true that the Internet Toolkit has high-level VIs
for programmatic telnet sessions, but that might be overkill in your case. Do
consider the ITK if you plan to be doing a lot of programmatic FTP transfer or
e-mailing, and especial
ly if you want to use LabVIEW to implement CGIs.

Some details about the telnet approach:
When you say that the hardware "can only be tested through a telnet port," that
probably just means TCP/IP port 23. So, to initiate a test session to the
hardware, simply use TCP Open Connection and specify port 23 and the IP address
of the hardware.

If that VI returns without error, you've got a valid connection. The next thing
the hardware is likely to want is a username and a password to validate access.
Simply use TCP Write to send your username, wait for acknowledgement (maybe a
TCP Read looking for a character or two?), then use TCP Write again to send your
password. After this, sending commands and reading back results follows the
same pattern.

The trick is in the timing of writes and reads. Those details--and a full
implementation of the telnet protocol--is why it's easier in some cases to go
with the prewritten stuff in the ITK.

Regards,
John Lum
National Instruments
0 Kudos
Message 5 of 6
(8,241 Views)
The Internet Developers Package (LabVIEW addon) is helpful, but rather flakey. NI has repeatedly told our developers that they are aware of some of the issues, but aren't sure when (or if) they'll be addressed.

We found that by modifying the code to read and write 1 byte at a time significantly improves performance. It's still not perfect, but if your application doesn't require extremely robust connectivity this may help. Here's some example code you can use.
Download All
Message 6 of 6
(8,241 Views)