LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent FTP Server Help

Solved!
Go to solution

I know that labview FTP tools have the ability to take a file from the FTP server and put it locally and vice versa. My question is, is there a way in Labview to simply Move Files from one folder to another folder on the FTP server?? Some context, images from a camera on the assembly line are being save to a file called CAM3 on the FTP server, I tap into that file to pull the image file down and display it on the UI. That's fine, works great. But when that CAM3 file gets full I believe its image file index 9999 it loops and creates index 0001.5, 0001.7, 0002.3 ect. So ideally when that file gets close to full maybe 9500 index we'd Move all those files into a folder called Archive where I don't care what it does from there, maybe set it to delete files after a certain length of time. We can obviously manually go into the FTP server and move the files but it needs to be automatic while the assy line is running. Let me know your thoughts/questions.

0 Kudos
Message 1 of 5
(3,042 Views)

The LabVIEW FTP tools are just some premade VIs that use the standard LabVIEW "TCP" reference to do FTP operations.  There's no "built in" command to move files around in the LabVIEW FTP tools, but all of the FTP VIs they build in are openable, so you can look and see how they do everything.

 

So, just use those as templates, and make your own FTP command VI that sends the RNFR and RNTO commands (see here for some reference), "rename from" and "rename to", and just specify different paths with the command.  Or, if your server doesn't like those commands, you can try a "SITE mv" command which attempts to run the "mv" command ("move") to do so.

0 Kudos
Message 2 of 5
(3,001 Views)

I haven't used it before in LabVIEW, but the only way to do what you want with the FTP protocol is rename.  There's an FTP rename file.vi under the "Intermediate" group of the FTP tools in the palette.

 

Sorry, didn't see other reply before I posted this.  It is rnfr and rnto, but there is still a labview VI for ftp rename as I said.

0 Kudos
Message 3 of 5
(2,994 Views)

The rename moves the file correctly, but does delete the old file. I've been trying to play around with the FTP [DELE].vi but I keep getting the message of file not found. This is the file path for the file im trying to delete. 

ftp://mke01wks0506111/CAM3/Archieved/Test.bmp

 

I've tried changing the direction of the / to \. Ive tried taking out the ftp://. No matter what i've tried its says file not found. Has anyone used this VI?

0 Kudos
Message 4 of 5
(2,949 Views)
Solution
Accepted by topic author breezy45

Solution. I delete the files in the Archived folder. Rename the files to the Archived folder. Delete files from the old file. Its pretty slow, but for now I've added prompts to the user when this happens. 

0 Kudos
Message 5 of 5
(2,924 Views)