LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Error(66) when sending files

I have a problem with FTP sending of files.

I have a compiled exe that is used to monitor a directory and send files found there to a ftp location and then delete the files.
It seems to work well but after it has been running for some time the ftp sending stops. When I logged the error messages then this is what is being reported:

Error Code: 66

TCP Read in NI_InternetTK_Common_VIs.lvlib:TCP Read xTP Reply.vi:3->NI_InternetTK_FTP_VIs.lvlib:FTP Get Command Reply.vi:2->NI_InternetTK_FTP_VIs.lvlib:FTP Command.vi:1->NI_InternetTK_FTP_VIs.lvlib:FTP [QUIT].vi->NI_InternetTK_FTP_VIs.lvlib:FTP Close Session.vi:1->NI_InternetTK_FTP_VIs.lvlib:FTP Put Multiple Files and Buffers.vi->NI_InternetTK_FTP_VIs.lvlib:FTP Put File.vi->ftp_data_transfer_move_ftp_files.vi->ftp_data_transfer.vi

 

I am using FTP Put File that is a part of the Internet addon.

 

This error occurs rarely after I start the program but it increases as time goes by until at the end it occurs for every file. Even though this error is occuring the files are still being sent to the FPT site. But after a while that stops and the FTP server gives the following error:
(007926) 16.4.2012 18:20:58 - (not logged in) (_)> USER X

(007926) 16.4.2012 18:20:58 - (not logged in) (_)> 331 Password required for X

(007926) 16.4.2012 18:20:58 - (not logged in) (_)> PASS Y

(007926) 16.4.2012 18:20:58 - X (_)> 230 Logged on

(007926) 16.4.2012 18:20:58 - X (_)> TYPE A (007926) 16.4.2012 18:20:58 - X (_)> 200 Type set to A

(007926) 16.4.2012 18:20:59 - X (_)> PASV (007926) 16.4.2012 18:20:59 - X (_)> 227 Entering Passive Mode (Z)

(007926) 16.4.2012 18:20:59 - X (_)> STOR data/file2012041613204694.csv

(007926) 16.4.2012 18:21:09 - X (_)> 425 Can't open data connection.

(007926) 16.4.2012 18:23:10 - X (_)> 421 Connection timed out.

(007926) 16.4.2012 18:23:10 - X (_)> disconnected.

 

To fix the problem I just need to restart the program and then everything works normally for a while.

I would appreciate any help on this matter. It seems to me that this could be related to the session not being closed properly and the program therfor is increasingly keeping open ftp sessions.

 

Best Regards,
Thorarinn Andresson

0 Kudos
Message 1 of 4
(4,547 Views)

Hi thorarinn,

 

You should be using the TCP Close Connection function to close the connection when you are finished communicating. How long are you doing the FTP communication before you see an error? There is the option to ignore errors using the Error to Warning.vi, but it sounds like the FTP server stops working eventually?

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 2 of 4
(4,526 Views)

Hello Zach and thank you for your reply.

 

The VI that I am using to send the files is the NI FTP Put File vi.
Untitled-1.png
This is the contents of the VI and then again of the subvi FTP Put Multiple Files and Buffers. As you can see the close session is built into the VI. I would have thought that this would be enough. But for some reason this vi keeps giving me the Error Code 66. Can I somewhere see what exactly is the cause for this error code? Is it reporting that the session is not being closed? Could this then result in a resource issue that could explain why just restarting the program fixes the problem (for a while)?

Best Regards.
Thorarinn Andresson.

0 Kudos
Message 3 of 4
(4,520 Views)

It looks like the error is coming from a timeout, but this is caused by a lack of data connection. The errors you posted were on the TCP server; is there a reason the data connection would be lost here after a certain amount of time? It does look like the timeout is set to a fair amount of time, so that's probably not an issue.

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 4 of 4
(4,504 Views)