02-15-2017 06:14 PM
I'm unable to open an FTP connection in LabVIEW, I can in a browser. I drilled down and found TCP Read xTP Reply.vi is the issue.
It's using ^[0-9][0-9][0-9] [^\r\n]*\r\n as the pattern on a match pattern.
My FTP's reply is:
220-FTP Server
220-*** Files stored here are not backed up ***
220-*** Please move any important files to ***
220 *** alternate storage. ***
The dash is the problem. I'm trying to find out if the dash is actually violating the FTP protocol on replys so I can tell IT they messed up! 😛 I mean, ask them nicely to change it. Or if the VI should be modified because there mite not always be a space.
02-16-2017 05:10 PM
Hey ,
I'm not really sure what your question is with regards to LabVIEW.
It seems you are talking about FTP protocol with references to syntax and using a hyphen? "-"?
In the following link, it talks about using a hyphen in the reply of FTP protocol:
https://www.w3.org/Protocols/rfc959/4_FileTransfer.html
Specifically,
"
the format for multi-line replies is that the first line will begin with the exact required reply code, followed immediately by a Hyphen, "-" (also known as Minus), followed by text. The last line will begin with the same code, followed immediately by Space <SP>, optionally some text, and the Telnet end-of-line code. For example: 123-First line Second line 234 A line beginning with numbers 123 The last line"
Let me know if this addresses the issue you were having.
02-16-2017 09:34 PM
LabVIEW won't open an FTP site that replies with multiple lines then. The pattern anchors the 3 digit reply code to the start of the string and there is no space.
02-17-2017
10:22 AM
- last edited on
11-06-2024
01:13 PM
by
Content Cleaner
Hey,
To get a better idea of what you're working with. Are you using the FTP functions built into LabVIEW?
FTP VIs
Also would you be able to make a snippit of your code so that I could determine what the issue is?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2PkCAI&l=en-US
02-17-2017 03:00 PM
Built in FTP VI's. It is getting stuck in the FTP open.
02-20-2017 04:31 PM
I have a couple ideas about that.
Firstly, your syntax should probably look something like the following:
Also, I suggest testing your VI with constants to make sure that your syntax is correct. Try finding a simple example that works and then building on that.
02-21-2017 03:08 PM
You have a reset from somewhere in front, but the only input that matters is the IP. The IP is right because I'm getting a reply. I never get out of the FTP open. I'm pretty sure if you aim your VI at any FTP server with a multi-line response it will fail.
02-22-2017 04:52 PM
How are you getting a reply back if you hang in the FTP open?
Have you tested this reading back a single line? Is that working exactly as expected?
What does a "fail" mean for multi-line responses?
It appears that the standard FTP protocol uses "-" (minus) when doing multi-line responses, so I'm still a bit confused on what behavior you are seeing.
Spencer R | NI
02-23-2017 04:35 PM
I have now also put a filezilla FTP server up locally. I can open it in my browser. (ftp://192.168.44.53/)
My code also opens that FTP site and gets a directory list, as designed.
When I change the IP to point at the company FTP that responds with multiple lines it gets error 56
Open the FTP Open Session.vi
Drill down to: FTP Get Command Reply.vi -> TCP Read xTP Reply.vi (Snippet attached)
You can see a match pattern with ^[0-9][0-9][0-9] [^\r\n]*\r\n It's looking at a shift register with the reply string. I probed it:
220-FTP Server
220-*** Files stored here are not backed up ***
220-*** Please move any important files to ***
220 *** alternate storage. ***
As I said in the first post, that pattern will NEVER find the reply because it must be ###<SPACE> and a multi line replies ###<DASH> and it's anchored to the start of the offset 0.
Also attached a match pattern wired up to show it.
02-24-2017 04:36 PM
Hi,
Is it possible to receive the multiple line response and convert it to a single line so that FTP Open will not hang?