02-23-2009 03:47 PM
Hi,
I want to read contents of a file in a FTP server. I don't know if I do things correctly, because I didn't find any example.
The only thing I do is use the FTP Get Buffer.vi and the inputs are:
-User: there's none
-Password: there's none
-Remote Port: 21
-Host: XXX.XXX.XXX.XXX (it's not my IP, the host is on another computer)
-Remote Path: FR:\product01\product01.txt
When I run the VI, I get 2 types of error; error 66 and error 0.
"Error 0 occurred at FTP Validate Data Connection: Invalid Data Connection
Possible reason(s):
FieldPoint: Success
=========================
LabVIEW: Error connecting to GPIB driver or device. This is usually due to a required driver not being installed on the system.
=========================
Motion: No Error.
=========================
Motion: No error.
=========================
NI-488: Error connecting to driver or device.
=========================
VISA: (Hex 0x0) Operation completed successfully."
"Error 66 occurred at TCP Read in NI_InternetTK_Common_VIs.lvlib:TCP Read xTP Reply.vi:19->NI_InternetTK_FTP_VIs.lvlib:FTP Get Command Reply.vi:18->NI_InternetTK_FTP_VIs.lvlib:FTP Open Session.vi->NI_InternetTK_FTP_VIs.lvlib:FTP Get Multiple Files and Buffers.vi->NI_InternetTK_FTP_VIs.lvlib:FTP Get Buffer.vi->LoadJobFile.vi->Interface.lvlib:ManualInterface.lvlib:Interface.vi->Interface.lvlib:StartInterface.vi->Platform.vi
Possible reason(s):
LabVIEW: The network connection was closed by the peer. If you are using the Open VI Reference function on a remote VI Server connection, verify that the machine is allowed access by selecting Tools>>Options>>VI Server:Machine Access on the server side."
Sometimes it works well, but usually I get those errors. Do I need to Open and Close a FTP session each time I use FTPGetBuffer? I've tried that but it didn't work. I don't understand why sometimes it works and sometimes not because I don't modify the code...
Anyone has an example or had the same errors and solve it?
Thank you
Stephanie
02-26-2009 02:22 PM
Any examples with the FTPGetBuffer.vi?
Nobody has?
Stephanie
02-26-2009 02:33 PM
02-26-2009 02:42 PM
02-26-2009 03:05 PM
Hi Stephanie,
The Error 66 message that you are getting is network issue. It can be caused from the TCP read timing out.
There is a good example that uses the Itermediate FTP VIs, FTP Browser.vi . I know that this doesn't show you how to use the FTP Get Buffer.vi, but the FTP Get Buffer.vi is made from these intermediate VIs.
It is interesting that you only get this error some of the time. This makes me think that it could be a problem with you network connection. Could you run the FTP Browser.vi example to see if you get the same Error 66 message.
03-10-2009 02:26 PM
Hi again,
I didn't find out how to use the FTPBrowser.vi example and I didn't spend time on it because I already use VIs of the Intermediate FTP "folder" (in the functions palettes) and it works well.
One of my coworker showed me the command line "netstat -n". It shows all the active connections.
When GetBuffer.vi works well, there's no active connection for the port 21.
When GetBuffer.vi doesn't work well, I get an ESTABLISHED connection and some CLOSE_WAIT connections (for port 21).
When this happens and I close LabVIEW, I get a TIME_WAIT connection (for port 21) and after 2 minutes this connection disappear.
Any idea of what's happenning? It looks like sometimes the connection doesn't want to close or something like that...
Thank you
Stephanie
03-11-2009 03:48 PM
Hi Stephanie,
When I run code that use the FTP VIs, my port 21 show that the connection is ESTABLISHED. When ever my code gets to the FTP Close Session the port goes to TIME_WAIT. Since the FTP Close Session doesn't set the status to CLOSE_WAIT, I am thinking that the FTP server is closing the connection. Could you try this on another FTP server? Could you post your code so that I could test to see if I can reproduce it?
03-12-2009 07:37 AM
Hi Justin,
My FTP server is a Fanuc (robot) simulator. I've change computer for the simulator twice and it did the same. The final system will be with the real robot not with the simulator, so I hope the behavior won't be the same.
Here's my code. I'll try to find out where the error occurs (in the GetBuffer.vi).
Thank you for helping me
Stephanie
P.S. For the moment it's working and I get a CLOSE_WAIT and a TIME_WAIT state (don't understant these states too much...)