Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Internet Toolkit Troubleshooting Wizard

FTP Basics

FTP (File Transfer Protocol) VIs are used to programmatically transfer files or data from your machine to a remote machine or vice-versa. The remote machine must be running an FTP server in order for these VIs to work! When connecting to an FTP server, you must invariably supply a username and a password in order to gain access; many machines will grant access to certain directories for any user who logs in as "anonymous" and supplies an e-mail address as the password.

Access the FTP VIs on the LabVIEW block diagram Functions palette by looking under User Libraries >> Internet Toolkit >> FTP VIs.

Use of the FTP VIs is fairly straightforward. The high-level VIs are arranged in two rows: one "Get" row to bring remote files to your machine and one "Put" row to send local files to a remote machine. One further wrinkle is that you the local source or destination for data can either be a file or a buffer. When you choose file, you must specify a local path to control where the remote data will be stored (Get) or from which file local data will be sent (Put). When you choose buffer, you will be storing the remote data in a LabVIEW string indicator (Get) or sending the contents of a string control to the remote machine (Put).

The image below illustrates the use of the high-level "FTP Get Buffer" VI to read the contents of a remote file into a LabVIEW string indicator:

Reading a remote file into a LV buffer

And here is an example of how to obtain the same information from the remote file, but instead copy that information into a local file:

Copying a remote file into a local file

HINT:  Do not actually overwrite your LabVIEW.exe file in this way, unless you have a good reason to be doing so!

Note that you must use UNIX-style filepaths when specifying the location of the remote file (i.e., forward slashes), but the filepath style for the local destination will depend upon your system. In the example above, a DOS-style path (backslashes) was used because the local machine was running Windows.



Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality?   Answered Your Question? 
  1 2 3 4 5
Please Provide Additional Feedback below
Please visit Request Support for product support inquiries. submit