LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW ftp Problem

I am transferring files using Linux Labview from a linux computer to a windows2000 server using .
I use a std script which is run using "system exec.vi" in labview.

Program opens ftp connection each time it begins file transfer , and closes it properly after the transfer.
If the connection is lost before/after transfer, ftp vi takes care of it. (It either makes successful transfer or , says no "route to host")

PROBLEM:
When connection is lost during the execution of "system exec.vi", "system exec.vi" hangs up and never returns.
It neither times out nor returns any error.
This crashes complete program , and the whole application.

Moreover, if the same script is run on the linux command prompt under exactly same conditions, it times out/r
ecovers the connection.
(Moreover, If used with "wait for completion=false" of labview 'system exec.vi', it crashes and application quits after a few "system exec.vi" calls)



How to make labview exec.vi come out of hangup ?
Please help on this. This is crucial
0 Kudos
Message 1 of 9
(4,927 Views)
This is a pretty rough one. There is obviously no builtin timeout with the System Exec function. You could, however, add this in. It's merely using a CIN to implement the function. The "wait until completion" is also just a paramet sent to the CIN. My only suggestion would be to add your own timeout of sorts. Call the System Exec VI with "wait until completion" set to TRUE. Then, have a loop right after this which polls for a change in the return code (it's value is 0 if everything is okay, so give another default value). This runs for a certain amount of time (make sure you have a wait until next millisecond multiple VI in the loop) and then triggers an error if the variable has not changed in that time. I've attached a VI trying to describe this. I hope
this helps you out. I feel like it should solve the problem.
J.R. Allen
0 Kudos
Message 2 of 9
(4,928 Views)
Sandeep,

I can't help you with your problem using the "system exec.vi" but I may be
able to assist you in using an alternative method of performing FTP.

I just finished making a small library of VIs that can connect to a ftp
server and download a binary file. I tested it on some jpg files. Works
perfectly so far. Ultimately, I will have a whole library to duplicate
most of what the vanilla, linux ftp can do.

Are you trying to upload or download a file? I haven't done the upload
part yet... could be a bit tricky. For now this is just a hack that still
needs a lot of work but if you need downloading capability I can provide
you with near immediate assistance. Let me know.

-Kevin
0 Kudos
Message 3 of 9
(4,927 Views)
Hi Kevin,
Thanks.
I am uploading file from client to "ftp" server.
But wonder what you mean by "download".
Seems like your library might be helpful to my case.
If it works for me,that'll be great. How can you provide it?

Sandeep
Sandeepvd@hotmail.com
0 Kudos
Message 4 of 9
(4,927 Views)
Hi,


#1
In VI provided by you, did you mean to have "system exec.VI" inside the while loop also?


#2
In that case also,
My problem is Because "wait till completion=TRUE",
"it never comes out of systemexec.VI" when there is loss of ftp link in the middle of data transfer

#3 Polling a loop will work only whn it replies me , and I check for error on the loops timeout.

#4
If I set "wait till completion=FALSE", it crashes and quits labview after a few iterations, if it does not find ftp.


Sandeep
0 Kudos
Message 5 of 9
(4,927 Views)
Hi Sandeep,

As of this weekend, I am able to upload AND download binary files from an FTP server. Yeah, uploading to a server is much more difficult.

All I have to do is clean it up and put it all into a library. It hasn't been completely tested... but I'll let you do that 😉 The plan is to post it on OpenG.org. Eventually everything will get to SourceForge.net. I will work on getting an uploading example out to you say Wednesday-ish.
0 Kudos
Message 6 of 9
(4,927 Views)
Hi Kevin.
Thanks. I hope that'll be useful. I Look fwd to your 'test release'. 😉
Sandeep
0 Kudos
Message 7 of 9
(4,927 Views)
Here's my first try. Tell me how it goes. If anyone else is watching this thread, feel free to try it out. Now that I have the foundation VIs done, other options will be easy to add.

NOTE: Presently, the app defaults to uploading the file name you specify in the local file path. Also, if you leave 'Remote Directory Path' blank you will upload to whatever path you log into. Any value you put in the string control will be interpreted as a relative path.

Keep in mind that this library is just the start. Jim Kring and I are working on a whole suite (smtp, http, ftp, and pop) of libraries that will be published on OpenG.org and SourceForge.net.
Message 8 of 9
(4,927 Views)

hi kevin,

Can you provide the FTP download Vi.

Thanks

0 Kudos
Message 9 of 9
(4,568 Views)