LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ftp delete

Solved!
Go to solution

Good morning!

 

I have chosen to use ftp to transfer files between a compact RIO and a Windows 7 Pro client.  The Windows client software is being developed in LabVIEW 2012.  The "built-in" ftp VI's perform open, login, put, get, and list.  I understand that there are currently no ftp VI's for deleting files or creating new folders on the compact RIO.  I also see that the Internet Toolkit is available for download. 

 

From the NI knowledgebase regarding the Internet Toolkit, "These deprecated APIs are available on ni.com/drivers (Windows, Mac OS, Linux) for existing applications upgrading to LabVIEW 2012 or later. National Instruments recommends against beginning any new development with these APIs."

 

As there are numerous options available (some of which I am sure I am not yet aware) I would like to know what is NI's recommendation for an application that needs to not only put and get, but also delete and create.  The methods that come to mind are:

 

1)  Windows 7 ftp command

2)  FileZilla ftp client

3)  Pass signals to the compact RIO using shared variables and have the compact RIO delete and create based on these signals (I think this would be clunky)

4)  Develop a .NET DLL that interfaces to the compact RIO using ftp

5)  Purchase a license for EvaluMation's FTP Toolkit

6)  Download the NI Internet Toolkit (even though NI states that it should not be used for "any new development")  By the way, is there any cost for the NI Internet Toolkit?

 

Can anyone suggest what NI would recommend from these, or other, options?  I want the files to be deleted and the folders created without operator action (using NI MAX, for instance).

 

Thanks,

Hamilton Woods

0 Kudos
Message 1 of 10
(7,153 Views)
Solution
Accepted by topic author Hamilton_Woods

You don't need the Internet Toolkit for the FTP VIs, these are now included in the standard LabVIEW palettes (Data Communication > Protocols > FTP).

The FTP toolkit does not have a "prebuilt" VI for deleting files, but you can just use the "FTP Command.vi" (used inside many FTP VIs) directly and send the "DELE path\to\file.ext" command through that.

 

Message 2 of 10
(7,150 Views)

Dan_U,

 

Thanks for your prompt reply.  I will definitely try this on for size.  There are a few .llb files in the FTP folder.

ftp1.llb even includes FTP [DELE].vi.  It looks like FTP Command.vi, in ftp2.llb, will be needed to create a 

folder.

 

For those who need to know where this ftp library is located (and based on posts to the forum there are

several):

 

C:\Program Files\National Instruments\LabVIEW 2012\vi.lib\FTP\*.llb

 

Now all I have to do is include Dan_U's response in the LabVIEW documentation and I'm all set.

 

Thanks,

Hamilton Woods

Message 3 of 10
(7,142 Views)

Hamilton,

 

Yes, I used "MKD foldername" with the FTP Command.vi to create a folder.

I didn't even check the llb's so I didn't know there's a DELE vi, I just used what's on the palette and created what is missing (only DELE and MKD in my case).

 

Daniel

 

0 Kudos
Message 4 of 10
(7,135 Views)

Maybe I jumped the gun.  I am able to create folders and delete files on the remote machine.  Now I want to eat the cake and have it also.

 

I have a few ftp questions.

 

When I use Windows 7 ftp client, I can type 'HELP' and get a list of commands.  I can do the same using the FTP Command.vi from LabVIEW.  The command set is different, even when connecting to the same ftp server.  Is the ftp command set provided by the ftp client or by the server?  It appears to me that it is provided by the client.

 

When I use FTP Command.vi with a command of 'HELP', the response is:

 

214-The following commands are recognized:
   USER   PASS   QUIT   CWD    PWD    PORT   PASV   TYPE
   LIST   REST   CDUP   RETR   STOR   SIZE   DELE   RMD
   MKD    RNFR   RNTO   ABOR   SYST   NOOP   APPE   NLST
   MDTM   XPWD   XCUP   XMKD   XRMD   NOP    EPSV   EPRT
   AUTH   ADAT   PBSZ   PROT   FEAT   MODE   OPTS   HELP
   ALLO   MLST   MLSD   SITE   P@SW   STRU   CLNT   MFMT
   HASH
214 Have a nice day.

I do not see LCD in this list.  I do not see LS in this list.  I do not see

GET, PUT, MGET, or MPUT in this list.  What is LIST?  What is

RNFR?  I think it is ReName File Remote, but I'm not sure.

 

The big, burning question is, where is the documentation for these

commands?  They are not the ftp commands that I learned in

grammar school.  The Internet Toolkit documentation only discusses 

the ftp VI's that are on the function palatte.

 

Thanks for any help,

Hamilton Woods

0 Kudos
Message 5 of 10
(7,093 Views)

RNFR is rename from, RNTO is rename to. I think these are used in the rename VI (don't have LV here).

 

Regarding the command set, when you type 'help' in Windows FTP you get the commands supported by the FTP client. You don't need a connection to get the command list which means it can't be a server response. 'remotehelp' would probably list the commands supported by the server.

 

The LV function FTP command on the other side will send the command to the server, so sending 'help' will return the command set supported by the server. You can also see that by the 214 response generated by the server.

 

The client implementation should use only the command set supported by the server (obviously).

 

The list of FTP commands can be found e.g. here: http://en.wikipedia.org/wiki/List_of_FTP_commands

Or, together with the syntax, e.g. here: http://www.nsftools.com/tips/RawFTP.htm

 

What other commands do you need which are not in the LV FTP llbs?

 

0 Kudos
Message 6 of 10
(7,086 Views)

Daniel,

 

Once again you impress me.  I guess the grammar school ftp commands that I learned

were ftp client commands, including mget, mput and lcd (which are the ones that I want to

use).  If I could use these, I could wildcard the filenames that I want to put or get. 

Otherwise, I am stuck with those provided on the ftp function palette which do not allow

wildcards.  When I use the function FTP Get Multiple Files.vi, I have to pass in a list of

files on the remote machine.  Therefore, I have to go get the list of files from the remote

machine.  I was hoping not to have to go get the list of files to transfer, but retrieving the

list is definitely not a show-stopper.  I just like the wildcard approach.

 

Thanks again for your help,

Hamilton Woods

0 Kudos
Message 7 of 10
(7,082 Views)

Hamilton,

 

Yes, I think that's the path I would go as well.

The wildcard approach would be nice, but if the server does not support the corresponding commands I guess there's no way.

 

Daniel

 

0 Kudos
Message 8 of 10
(7,074 Views)

Where can you find this vi?

0 Kudos
Message 9 of 10
(6,603 Views)

Which VI, FTP delete? Hamilton wrote it in his post.

0 Kudos
Message 10 of 10
(6,579 Views)