LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FTP From Keyence Controller

Solved!
Go to solution

Hey y'all,  I'm currently trying to FTP a couple of files off of a Keyence controller onto the local machine.  I'm able to use FileZilla to open the connection and even download the file, but when I try with LabVIEW (using the "FTP Get File.vi") it gets stuck at the transfer step and then errors due to a timeout.  After this happens I'm not able to FTP into the controller again (even with FileZilla) until I reboot the whole controller.  Looking through the VI it does looks as old as dino dirt so I wouldn't be surprised if the vi is depreciated, but I haven't seen any post or anything about it.  Any ideas on the LabVIEW side that I could try to make sure it's not LabVIEW and is, in fact, something to do with the Keyence controller? 

 

Edit: Been running through some of the sub VIs and it seems that the place it gets stuck at is the Open Data Connection, on the wait for listener.vi

Edit 2: I've just confirmed that a similar behavior is observed when using the command prompt, so I don't think it's labview.  If anyone knows anything about Keyence I'd greatly appreciate any help, but as I see it, this is not a LabVIEW issue.  Thanks

0 Kudos
Message 1 of 10
(5,763 Views)

Have you tried any of the configuration options?

 

Specifically in this case, the "Active" flag.  Try turning that off.  You also will almost certainly want binary mode to be on as well, though that's much less likely to cause an issue that looks like a connection issue.

Message 2 of 10
(5,735 Views)

I've tried and it still doesn't seem to work.  I think the fact that it doesn't even work from the Command Line makes me think it's more of a problem with Keyence.  It's been stuck at this "150 Here it comes..." for > 30 minutes

EthanHenry_0-1692206500745.png

 

0 Kudos
Message 3 of 10
(5,724 Views)

Well if FileZilla works then that would imply that the Keyence does function somewhat?  It could be that FileZilla is better at guessing or detecting the correct settings to use, or its defaults are what Keyence expects while LabVIEW and the command line use different defaults.

 

One "fun" thing about FTP is that it's so old encryption isn't a thing.  You could consider using Wireshark or something like that to snoop all of the message traffic between your PC and the Keyence controller, and see what FileZilla does differently, and hopefully use that to inform the settings used under LabVIEW.

0 Kudos
Message 4 of 10
(5,717 Views)

You know I was thinking about something like that but was hoping I wouldn't have to download extraneous software, though I think you're right this is probably the next step.  I'll let you know how it goes

0 Kudos
Message 5 of 10
(5,714 Views)

Alright I tried some sniffing and I'm just left with even more questions than answers.  When running through FileZilla, I see all the Packets nicely lined up in the LAN connection.  However, when I try to use LabVIEW, I don't see any TCP packets sent on LAN, Ethernet 1, Ethernet 2, or WiFi...  I'm not the most competent when it comes to network communications, but I'd think there'd be at least something.  I saw a single tcp packet from the controller to the computer, but I have a feeling that was left over from FileZilla's connection.  I think it did transfer for some reason though... At least I see an image there with the name I gave it, though I got this "error" and my computer is telling me it doesn't support the image format (I'm almost sure it does) or it's corrupted

EthanHenry_0-1692209612295.png

 

0 Kudos
Message 6 of 10
(5,697 Views)
Solution
Accepted by EthanHenry

Well, no idea what would cause that...

 

Maybe try a 3rd party FTP solution?

 

This one popped up after a search:

 

https://www.vipm.io/package/evalumation,_llc_lib_ftp_toolkit/

 

No idea if it's any good or if there are other options, never tried it, and I didn't look for other LabVIEW solutions beyond it.  For all I know it's just a wrapper for the built-in FTP functions and won't help at all...

Message 7 of 10
(5,690 Views)

Ok I think I dismissed the TCP too early... Looking at LAN (where FileZilla appeared as FTP) it seems like LabVIEW uses TCP?  The communications are all from the computer and the controller, so I guess LabVIEW's FTP function doesn't actually use FTP but instead TCP.  Still not getting the full uncorrupted photo, but it does seem like it's decided to play nice-ish for some reason (still takes an ungodly amount of time to transfer)

0 Kudos
Message 8 of 10
(5,685 Views)
Solution
Accepted by EthanHenry

Got it Babeyyyy! Had to set Active to False and Binary to True, as well as had to save the image at 1/8 resolution so it would go faster.  When Binary was False, I still got a picture but it seemed a little off.  Also, if you're going to sniff packets in the future, LabVIEW only sends and receives TCP and FTP-Data Packets, no FTP packets are actually sent/received

0 Kudos
Message 9 of 10
(5,660 Views)

@EthanHenry wrote:

Ok I think I dismissed the TCP too early... Looking at LAN (where FileZilla appeared as FTP) it seems like LabVIEW uses TCP?  The communications are all from the computer and the controller, so I guess LabVIEW's FTP function doesn't actually use FTP but instead TCP.  Still not getting the full uncorrupted photo, but it does seem like it's decided to play nice-ish for some reason (still takes an ungodly amount of time to transfer)


Well, FTP is build on top of TCP not matter what. So if it doesn't get recognized as FTP in Wireshark it may be because the Wireshark heuristics to guess what protocol may be used on top of TCP don't somehow apply. Usually Wireshark uses the well known port numbers to detect higher level protocols above TCP or UDP but there are also other heuristics that can get used.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(5,610 Views)