bbean Posted August 7, 2008 Report Share Posted August 7, 2008 Hi all is there a way to get a quick directory listing from an ftp path. Tried the FTP VIs in the Internet toolkit and it took around 2 - 3 seconds to return a directory. That seems a little slow. Using the windows command line, I can speed it up a bit (see attached LV8.5 example), but that is kind of a cheezy/non Native LabVIEW way to do it. Was wondering if there was a way with Datasocket or something else I'm missing. B Quote Link to comment
Neville D Posted August 7, 2008 Report Share Posted August 7, 2008 QUOTE (bbean @ Aug 6 2008, 10:06 AM) Hi all is there a way to get a quick directory listing from an ftp path. Tried the FTP VIs in the Internet toolkit and it took around 2 - 3 seconds to return a directory. That seems a little slow.B The FTP toolkit is really showing its age. Lack of documentation, disorganised pallets, lack of good examples etc. What you can do is make sure the Active? boolean is set to false (I think it tries to open a fresh TCP connection if its false). The dir listing VI also seems to be writing to property nodes and doing all sorts of parsing (though that shouldn't slow it down too much unless you have very complicated directory structures). You might try to use the FTP Command.vi (vi.lib\addons\internet\ftp\ftp2.llb\FTP Command.vi) to experiment sending the bare minimum commands to speed it up. I like your command line trick and it is indeed fast. Neville. Quote Link to comment
Neville D Posted August 8, 2008 Report Share Posted August 8, 2008 QUOTE (Neville D @ Aug 6 2008, 01:08 PM) What you can do is make sure the Active? boolean is set to false (I think it tries to open a fresh TCP connection if its false).I like your command line trick and it is indeed fast. Just tried it. http://lavag.org/old_files/post-2680-1218062985.vi'>Download File:post-2680-1218062985.vi Making the Active boolean to false =79ms (using Internet Toolkit); your command line VI=171ms. Neville. Quote Link to comment
Phillip Brooks Posted August 8, 2008 Report Share Posted August 8, 2008 QUOTE (Neville D @ Aug 6 2008, 06:50 PM) Making the Active boolean to false =79ms (using Internet Toolkit); your command line VI=171ms. I just went through a similar issue with using FTP to post test results to an off-site server. I found that Active = FALSE ( or Passive) was indeed much faster from the client for LIST and PUT, but the FTP server admin asked me to use Active for security and port range issues. I included a boolean in my higher level code (and ultimately my INI file) to set this based on the conditions of the deployed environment. Active FTP vs. Passive FTP, a Definitive Explanation UPDATE: Here is an example of what I use. I wanted to be able to test the ability to connect to the FTP server independent of LabVIEW, so I created a wrapper for the function "FTP Put Multiple Files and Buffers.vi" that parses an RFC-1738 FTP URL. I check for access to the server using the exact same string from IE or FireFox. If it doesn't work from those, then I might have a firewall or proxy problem. Download File:post-949-1218111686.vi (LV 7.0) Quote Link to comment
bbean Posted August 8, 2008 Author Report Share Posted August 8, 2008 QUOTE (Neville D @ Aug 6 2008, 06:50 PM) Just tried it. Download File:post-2680-1218062985.viMaking the Active boolean to false =79ms (using Internet Toolkit); your command line VI=171ms. Neville. Interesting. Thanks for the tip. I wonder what the command line uses. I guess I could check it out with wireshark. I'm getting a little over 300ms but thats much better than before and acceptable for a user interface. QUOTE (Phillip Brooks @ Aug 7 2008, 08:21 AM) I just went through a similar issue with using FTP to post test results to an off-site server. I found that Active = FALSE ( or Passive) was indeed much faster from the client for LIST and PUT, but the FTP server admin asked me to use Active for security and port range issues. I included a boolean in my higher level code (and ultimately my INI file) to set this based on the conditions of the deployed environment. Active FTP vs. Passive FTP, a Definitive Explanation Here is an example of what I use. I wanted to be able to test the ability to connect to the FTP server independent of LabVIEW, so I created a wrapper for the function "FTP Put Multiple Files and Buffers.vi" that parses an RFC-1738 FTP URL. I can check for access to the server using the exact same string from IE or FireFox. If it doesn't work from those, then I might have a firewall or proxy problem. Download File:post-949-1218111686.vi (LV 7.0) Interesting. I shouldn't have any security issues because its just a local machine going to cRIO. I'll check out your example. Thanks for the link Quote Link to comment
Phillip Brooks Posted August 8, 2008 Report Share Posted August 8, 2008 Ugh. I saved the file with the wrong name; it should be RFC 1738 Put Files.vi ... I think most FTP clients default to passive (for performance). Quote Link to comment
Neville D Posted August 13, 2008 Report Share Posted August 13, 2008 QUOTE (bbean @ Aug 7 2008, 05:30 AM) Interesting. Thanks for the tip. I wonder what the command line uses. I guess I could check it out with wireshark. I'm getting a little over 300ms but thats much better than before and acceptable for a user interface. I forgot to mention I was ftp'ing to a PXI 8187 controller and LV-RT frm a Windows machine, and 100MB/s connection. I have a Gig-E network, but the 8187 only accepts 100MB/s. And yes I have Filezilla that uses default passive, so I would guess command line uses passive too. Neville. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.