Connect Method (FTP)
10.2, PLBCMP GUI Only
The Connect method establishes a connection and logs the user into a FTP Server. This method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A FTP that has been declared.
return
Optional. A Numeric Variable that returns the pass or failure values for the execution of the method.
host
Required. A Character String Variable or string literal that specifies the host name or IP address with an optional port number used to make a socket connection to the FTP server running at the host. If the port number is not specified, the default port is 21.
user
Required. A Character String Variable or string literal that specifies the user name.
password
Required. A Character String Variable or string literal that specifies the user password.
flags
Optional. A Numeric Variable or decimal number that specifies a bit mask value that can control the behaviors of this method.
Flags Affected: OVER, ZERO
Note the following:
The ZERO flag is set if the {return} value is zero which indicates that the method executed successfully.
The OVER flag is set if the {return} Numeric variable is too small to receive the pass or fail value without being truncated.
The {host} string can be formatted as follows:
or
Example:
'ftp.myserver.com' or '12.345.678.90'
In this case, the default port number of '21' is used.
'ftp.myserver.com:21'" or '12.345.678.90:21'
In this case, the port number of '21' is specified.
The {flags} value defines a set of bit-mask values that control the behavior of this function. They are as follows:
|
Values |
Description |
|
0x0 |
The default behavior is to create a normal socket connection to a FTP server. |
|
0x1 |
If this bit is turned on, an explicit SSL socket connection to a FTP server is made. |
|
0x2 |
This bit only takes affect when it is used with either the 0x01 (explicit SSL) or the 0x04 (implicit SSL) bit values. This 0x02 bit value invokes SSL reuse to maximize the security and performance. |
|
0x4 |
If this bit is turned on, an implicit SSL socket connection to a FTP server is made. |
The {return} values are defined as follows:
|
Values |
Description |
|
0 |
Method executed successfully with no errors. |
|
3 |
Unable to connect to FTP server. |
|
4 |
Unable to login to FTP server using the USER and PASSWORD settings. |
|
5 |
SSL connection failure. |
See Also: FTP Control Methods, Method Syntax
![]() |