FTP Options with LabVIEW Real-Time

Publish Date: Mar 03, 2012 | 10 Ratings | 2.80 out of 5 |  PDF

Overview

The LabVIEW Real-Time Engine that runs on the CompactRIO, PXI, FieldPoint, and Compact FieldPoint LabVIEW Real-Time controllers has a File Transfer Protocol (FTP) server. You can access the FTP server using any standard FTP utility for transferring files to and from the hard drive or compact flash. The following sections demonstrate how to download files from and upload files to your LabVIEW Real-Time target using various FTP clients.

Note: For LabVIEW Real-Time 6.1 and earlier, the file name must be in the DOS 8.3 format. Using this format, names cannot be longer than 8 characters. For example, the regular LabVIEW file path would be c:\Progra~1\nation~1\LabVIEW. You also must provide the correct password when opening a connection to the PXI controller if the configuration is locked in MAX or FieldPoint Explorer.

Table of Contents

  1. LabVIEW Real-Time Graphical File Transfer Utility
  2. Third Party File Transfer Utility
  3. LabVIEW
  4. DOS Command Prompt
  5. Web Browsers

1. LabVIEW Real-Time Graphical File Transfer Utility

LabVIEW Real-Time Module versions 7.0 and later include a File Transfer Utility that can be used to access your RT Target. This method helps you avoid the caching problem encountered when using web browsers. On Windows computers, you can find this utility in the Measurement and Automation Explorer (MAX). To open the utility, right-click on the desired RT Target under the Remote Systems list and choose File Transfer. Refer to related link below.

Back to Top

2. Third Party File Transfer Utility


You could also use an third party FTP client utility. An example is FileZilla which is open source. Refer to the related link listed below.

See Also:
FileZilla

Back to Top

3. LabVIEW


There are also ways in LabVIEW to programmatically access the FTP server of a LabVIEW Real-Time target.

The DataSocket Read function has the ability to read raw text, tabbed text, and .wav files from a FTP server. For more information on this, please refer to LabVIEW help manuals listed in the links below.
The LabVIEW Internet Developers Toolkit gives you the ability to send files or raw data to an FTP server as well as sending emails and adding security to your web-based applications. The example program linked below which is titled “Sending and Retrieving Files Programmatically through FTP” shows how to use the FTP VIs included in the toolkit. You can also perform windows system FTP transfers with system exec VI. Refer to the related link “Using the Windows system FTP utility from LabVIEW with the System Exec VI”.

See Also:
Using the Windows system FTP utility from LabVIEW with the System Exec VI.
Sending and Retrieving Files Programmatically through FTP
LabVIEW 8 Help

Back to Top

4. DOS Command Prompt


You can run a native FTP client from the DOS command prompt on a Windows PC with the following commands:
To open the FTP client, navigate to start » run and type command. The following sequence illustrates how you can use the commands to access the FTP server of your RT target.

(Note: "w.x.y.z" represents the IP address of the RT target in this document.)


Command Result
ftp Open a connection to the FTP server.
open w.x.y.z
(username) Enter your username and password here or hit <enter> twice if these security settings have not been applied.
(password)
help View a list of commands
cd ni-rt/system/www Change to the desired directory.
dir View the files present.
get index.htm c:/index.htm Copy the file.
cd / Change directories back to the root (c:/).
cd d: Change directories to the external compact flash.
put c:/index.htm index.htm Copy the file from the FTP client machine to the target
dir Verify the newly copied file
cd c: Change directories back to the internal compact flash or hard drive.
quit Disconnect from the FTP server.

Back to Top

5. Web Browsers

Although it is possible to use most web broswers to access FTP sites, it is not recommend since it they often do file caching.

If w.x.y.z is the IP address of your RT target,

  • To access the hard drive or internal compact flash, open Internet Explorer and type the following in the address field

ftp://w.x.y.z/

  • If a username and password are required, then use the following format:

ftp://username:password@w.x.y.z/

  • To access the external compact flash, open Internet Explorer and type the following in the address field:

ftp://w.x.y.z/d:/

  • To enter a directory, double-click on its icon.
  • Right-click on a file or folder and choose cut, copy, paste or delete to perform those actions.

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit