LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy file from cRIO using ftp

Solved!
Go to solution

Hello,

 

I tried to copy a file from cRIO to my computer using the FTP get file.vi but got error 56. The error 56 seems to be a time out error, but I am able to access the cRIO normally from PC using FTP. I just followed the link below

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8ZoSAK&l=en-US

 

I have attached the picture of the code with error

 

Regards

SJ

0 Kudos
Message 1 of 11
(12,438 Views)

Just a guess... Is the  file on the cRIO still open for writing?

 

If so, the FTP server may not be able to transfer the file because it is open by another application...

0 Kudos
Message 2 of 11
(12,434 Views)

SJ:  In my past use of that same setup I have "anonymous" wired to both the "user" and "password" inputs to "FTP Get File.vi".  Have you tried that?

 

GCentral
0 Kudos
Message 3 of 11
(12,425 Views)

Hello,

 

Thank you for your suggestions.

 

I immediately close the file once writing is over . I tried using windows to copy the file while the cRIO program is getting executed. I was able to copy.

 

I tried connecting "anonymous" to both user name and password but it didn't work.

 

Regards,

SJ 

 

0 Kudos
Message 4 of 11
(12,398 Views)

SJ:  I think one thing that needs to be clarified here is that you are trying to FTP from the cRIO to a PC on your network. The way the example is written it was meant to be used on your host PC to read and write files from and to the cRIO.  You will need to adjust the values you use for "user" and "password" as well as your local and remote paths accordingly (local will refer to the cRIO file system and remote to the PC file system).

In addition, if your PC is a Windows machine you will need to ensure a path is open through your firewall for FTP and that all necesary permissions are setup for the cRIO to access your PC.

 

I hope this helps you get this working.

GCentral
0 Kudos
Message 5 of 11
(12,384 Views)

Hello Bill,

 

The example available with LabVIEW "FTP Browser. VI" is working fine but if I try implementing the VI it is not working.

 

I am trying to implement from host to copy a file from RT to PC.

 

If I go inside the sub VI of "FTP Get file.VI" I can see that I am able to login and I get error only at "FTP [RETR].VI". One correction is that I have provided empty string for user and password and the remote path slash also changed.

 

I have attached the VI too. 

0 Kudos
Message 6 of 11
(12,383 Views)

Did you try to use passive FTP mode (i.e. setting the "active" flag to F)?

 

0 Kudos
Message 7 of 11
(12,378 Views)
Solution
Accepted by topic author SJ BSB

SJ:  Take a look at this snippet.  Besides setting "active" to False (as Dan_U noted), be sure your OK button mechanical operation is changed or you will get error 8.

NOTE:  for some reason the "snippet" process lost the error constant within the cluster going into the ftp read.vi. You can try this both ways, "" for user and pw or "anonymous".  Anonymous works for me.

 

ftp file read 2.png

 

GCentral
Message 8 of 11
(12,363 Views)

Hello Bill & Dan,

 

Thanks a lot, Can you tell me what was my mistake?

 

I should go in passive mode?

 

I tried using "anonymous" and empty string, both works for me.

 

Thank you once again.

 

Regards,

SJ

0 Kudos
Message 9 of 11
(12,359 Views)

In active mode the FTP server tries to open a data connection to the host PC for file transfer. This might be blocked by a firewall.

In passive mode the client opens a data connection to the FTP server. Usually this works fine since the FTP server has to allow incoming connections anyway.

 

 

Message 10 of 11
(12,355 Views)