Jump to content

LabVIEW and WinSCP


Recommended Posts

Dear collegues,

What is the right way to COMMUNICATE with winscp?

I'd like to open a winscp session, then "use" the session to transport files, rename them, whatever, and after finishing the job I'd like to close the session again.

Of course, there is the possibility to write a script and run it. But: As I want to transport "livedata" packed into simple ascii-files or something similar, the effort for opening a session should be as small as possible. Is it possible to communicate interactively to a command-line application?

With the built-in "Intermediate FTP"-VIs this is not a problem, but SCP/SFTP?

Thank you!

Martin

Link to comment
  • 4 weeks later...

As far as I can tell from the System Exec VI help, this isn't possible:

If wait until completion? is TRUE, standard input is available as input to the command and standard output and standard error are available when the command finishes running. If FALSE, the command runs in the background and its input and output are not available.

That said, it should be possible to redirect WinSCP's stdin and stdout with the use of a DLL wrapper. An article on Code Project titled "Redirecting an arbitrary Console's Input/Output" describes just this.

If SCP/SFTP is what you're after then an external FTP library such as libcurl might be of use. Again this requires DLL calls (and is probably more complex to implement).

Link to comment

As far as I can tell from the System Exec VI help, this isn't possible:

That said, it should be possible to redirect WinSCP's stdin and stdout with the use of a DLL wrapper. An article on Code Project titled "Redirecting an arbitrary Console's Input/Output" describes just this.

The OpenG Pipe Project does just that. It is a LabVIEW Library that replaces the System Exec function and returns pipe refnums for the three standard IO interfaces and functions to read and write to those refnums. The project hasn't been released yet as I consider it not entirely release quality but it does work for me and I have actually used in in several of my projects already.

Since there is no officially released package yet you can't just download it through VIPM from internet. But here is a copy of a package you can install using VIPM.

oglib_pipe-1.0-1.ogp

Link to comment

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.