Jump to content
smarlow

Free LabVIEW WinSCP Library

Recommended Posts

Here is a library I created to wrap the WinSCP .NET library.  You can use it to connect to a remote server via SSH and transfer files, create remote directories,etc., with WinSCP from LabVIEW.  I know there is a commercial library for I think $500 a pop, but this is something that is missing from LabVIEW that really ought to be included with native functions in the file I/O palette.  The VI's in this packed library are built around the "WinSCPnet.dll" library that installs with WinSCP.  You will have to download and install WinSCP to get the DLL, as I do not want to distribute it without their permission:

Download WinSCP Here

After downloading and installing WinSCP, you will have to connect the VI's in the packed library to WinSCPnet.dll.  I make no warranties here, and no promises it will work, since I already have the stuff installed.   The use WinSCP with an SSH Key, you will have to generate a key and copy the public key to your server.  WinSCP uses the Putty format for SSH 2.  You will also have to obtain an SSH fingerprint from your server for input to the session.  Otherwise, you will have to provide user login credentials.  You can use the "C:\Program Files (x86)\WinSCP\PuTTY\puttygen.exe" utility to generate a key.  I use Git, so I used the SSH utilities included with that to generate and copy the key to my server.  If you do that, you will have to use puttygen to import your OpenSSH key and convert it to putty format for use with the WinSCP/LabVIEW library.  Sorry I don't have more time to do full docs and directions for use, but maybe someone else can comment with additional directions.  I will monitor this topic and try to answer any questions.   Good luck, and happy SFTPing!

PS: No I will not save it to an earlier version.  Maybe someone else can.

 

WinSCPnet.lvlibp

  • Like 2

Share this post


Link to post
Share on other sites

Here is a ZIP file if you want to change the code.  Please don't take this and try to sell it.

 

WinSCP.zip

Edited by smarlow
Recompiled ZIP file with fixes
  • Like 1

Share this post


Link to post
Share on other sites

Looks cool. I did something with the winscp dll a while back (just a simple powershell script) and it was pretty solid.

I was curious about licensing because I thought it was GPL -- turns out the exe is, but the .net library is not (in case anyone else is curious):

Quote

https://winscp.net/eng/docs/library#license:
The WinSCP .NET Assembly is a free library: you can use it, redistribute it and/or modify it under the terms of the Mozilla Public License Version 2.0.

Because WinSCP uses the GPL license it’s important to keep the GPL license file around.1 Your software doesn’t have to be licensed under GPL as the WinSCP .NET Assembly is using WinSCP as an executable, via its public scripting interface, and not as a library

That having been said, your code should specify and include a license: https://stackoverflow.com/questions/5521080/can-i-use-the-code-in-a-github-project-which-does-not-have-a-license-specified

Edited by smithd

Share this post


Link to post
Share on other sites

The .NET assembly used to be distributed separately from the WinSCP application, but the latest version has them wrapped up in one installer.  The LabVIEW code posted here is merely a wrapper that calls the library, and does not incorporate any of the source code from WinSCP or its .NET automation library.  You are probably right that a license might be a good idea, but I view this as merely example code that demonstrates how to call the WinSCP .NET assembly from LabVIEW.  Since I am not distributing their DLL, I feel no need to include their license, since anyone who uses this LabVIEW code will get a copy when they install WinSCP.

Share this post


Link to post
Share on other sites

Sorry, those were two separate points:

The first was just to say I thought the winscp library was gpl but it isn't, yay!

The second was to say that (as I understand it, not being a lawyer), even if you consider it an example, those of us who might wish distribute code/applications outside of their organization using this library cannot do so unless you specify a license.

Edited by smithd

Share this post


Link to post
Share on other sites

Hi, I am glad that I found your library but would you mind saving it for Labview 2014 please?

Share this post


Link to post
Share on other sites

Is there a way to use this as a virtual SSH terminal as well? I'm trying to communicate to a piece of hardware where it's only connection is via SSH terminal. Thanks for sharing what you have so far!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.