From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send\Receive Data on Telnet\SSH protocol

Hi,

If you want to send\receive data to distant target via Telnet,SSH,Rlogin,Raw protocols you can
use extrputty which free software.
This software allow TestStand or win32 application trhough DLL and Putty to exchange data on there protocols.

I hope this news can help some people.

extraputty.free.fr

Asebt.Smiley Happy


Message Edited by Support on 02-04-2008 08:58 AM
0 Kudos
Message 1 of 14
(9,351 Views)

Hello,

 

     I have created the attached basic package of ExtraPuTTY LabVIEW VI's in case anyone is interested.  It comes with an example ("ExtraPuTTY Example.vi") that will open an ExtraPuTTY session, send a list of commands that you the user can type in, receive the output, and then close the ExtraPuTTYsession.  I have made it standalone so that you don't have to install ExtraPuTTY separately.  However, due to the necessity of instantiating the required ExtraPuTTY environment variables, the very first time you run "ExtraPuTTY Example.vi" after installing (unzipping) the package, it will not work and you will need to restart your computer and then try again.  After that, you should be good.

 

Enjoy,

BB

 

PS: I have only implemented and tested support for the SSH protocol.  If anyone adds any of the other protocols, please share back.  🐵

Message 2 of 14
(8,809 Views)

Hi Billy,

 

I am trying to create a VI simular to yours, I am continually getting a 1097 error from the Connexion call. I downloaded your example and it is also giving me the same error.  If I code in a "clear error" right after the Call Library Function node for the Connexion function,  the code works fine.  I was wondering if you have seen this error before and have any idea how to correct it.  I am running the following on my machine:

Windows 7 Enterprise

Labview 2011

 

Brad. 

0 Kudos
Message 3 of 14
(8,102 Views)

Hi Brad,

 

     Indeed, I have run across this problem.  To see how I got around it, see my post at the end of this thread:

 

http://forums.ni.com/t5/LabVIEW/Error-Code-1097-Coming-in-DLL-Calling/m-p/2031742#M664789

 

Also, see the attached for the simple wrapper I created to get around the issue.  I have included the Visual C++ 6.0 source as well as a release built DLL.  I hope this helps.

     Finally, you might try contacting the authors of ExtraPuTTY (as I have) to see if they can incorporate the change I requested in a future release.  That way, we would not need the workaround provided by my wrapper.  The more people that request it, perhaps there is a better chance that it gets incorporated.

 

Thanks,

BB

0 Kudos
Message 4 of 14
(8,097 Views)

Hi Billy Barty,

 

Could you explain how to use the wrapper with your example (ExtraPuTTY Example.vi)?  I also get the error message (in Labview12).

 

Anybody knows if LabView will support SSH communication (send and receive)?

 

Thanks.

0 Kudos
Message 5 of 14
(7,935 Views)

Hi Billy Barty,

 

I have passed all zip content to the "bin" library and now the vi is running and provides error 1517 (instead of 1097) from the same location (call library "Connexion").

The putty connection is established, but without command execution.

The ExtraPuTTY.dll provides output: Error=1517 Success=0 and ConnextionID=1

 

I have attached the open session vi with all inputs.

Please advice.

 

Thanks a lot.

Ig

 

0 Kudos
Message 6 of 14
(7,927 Views)

Hi lg,

 

     I was able to duplicate your "Error=1517" with the VI you posted.  See the attached.  I have updated your "ExtraPuTTY Open Session.vi" to use my wrapper instead of calling directly into ExtraPuTTY.dll.  The updated VI is called "ExtraPuTTY Open Session_Using_Wrapper_DLL.vi".  Also included in the attached are the supporting VI's and binaries I am using.  I have confirmed that all this has worked on my machine in LabVIEW 2012.

 

Thanks,

BB

Message 7 of 14
(7,909 Views)

Hi BB,

 

Thanks a lot it is working.

I have few clarification questions, as I did not understand what you had changed:

1. Should I replace also in other vi's (send-receive) the call library to ExtraPuTTY_Wrapper.dll (instead of ExtraPuTTY.dll)?

2. I'm loading at remote machine some time non-deterministic function. However, the program continues running... How I can condition next  command execution on completion of previous stage? Just putting one command after another will not wotk in my case.

 

 

Again, Thanks a lot!

 

Ig

0 Kudos
Message 8 of 14
(7,894 Views)

Hi lg,

 

    Glad to hear it is working for you.

 

1) No, you do not need to change other VI's to point to ExtraPuTTY_Wrapper.dll (instead of ExtraPuTTY.dll).  I had to do that only for the open session VI because the corresponding ExtraPuTTY function required specifying a callbak function for one of its parameters.  Since specifying nothing or NULL for that parameter caused errors AND since I couldn't think of any other way to handle it, I created the wrapper to contain and specify a simple callback function in the call to the ExtraPuTTY Connexion function.  Thus, the corresponding wrapper function "wraps" the ExtraPuTTY Connexion function and handles specifying the callback function.

2) Assuming the remote machine is a Linux or unix machine, I would try periodically issuing a "ps -all" or some variation of the "ps" linux/unix command; and after each issuance of this command, parse the output of the command and look for an indication that the process you are waiting on is still running.  Once the process is no longer found in the "ps" command output, then you know you can issue your next command.  So, something like this:

 

Send-Receive <your time non-deterministic function>

Send-Receive ps -all, parse output: process running

Send-Receive ps -all, parse output: process running

Send-Receive ps -all, parse output: process running

Send-Receive ps -all, parse output: process running

Send-Receive ps -all, parse output: process not found

Send-Receive <your next command>

 

Hope this helps.

 

Thanks,

BB

 

Message 9 of 14
(7,870 Views)

Great, it is almost working.

 

In case I want to just to read the output from running program, How it can it be done?

For example, I run some program for undefined time and it gives different outputs. I'm interested toread spesific string from the putty terminal. 

 

Thanks,

Ig

0 Kudos
Message 10 of 14
(7,838 Views)