Using WebDAV to Transfer Files to Real-Time Target

Updated Jun 8, 2018

Reported In

Hardware

  • CompactRIO Controller
  • PXI Controller
  • CompactDAQ Controller

Software

  • LabVIEW

Operating System

  • NI Linux Real-Time
  • VxWorks
  • Windows
  • PharLap

Issue Details

How do I configure a Web Distributed Authoring and Versioning (WebDAV) server and use it to transfer files to and from my real-time target?

Solution

  1. Install WebDAV and SSL Support on Your Target

NI Linux Real-Time
You do not need to complete any steps to install WebDAV and SSL support. These components are enabled by default on NI Linux Real-Time targets.

ETS and VxWorks
Complete the following steps to install WebDAV and SSL support on ETS and VxWorks targets. 
  1. Open NI Measurement and Automation Explorer (NI MAX).
  2. Expand Remote Systems in the configuration tree. Expand your RT target.
  3. Right-click Software and select Add/Remove Software to launch the LabVIEW Real-Time Software Wizard.
  4. Use the wizard to install the following components on your target:
  • SSL Support for LabVIEW RT
  • WebDAV Server
  1. Configure permanent WebDAV mappings for your OS

Windows 10, 8.1, 8, and 7
Complete the following steps to map a target as a network drive and configure the Microsoft WebDAV client on Windows 10, 8.1, 8, and 7.
  1. Select Start >> File Explorer and then select This PC on the left pane.
  2. Select Computer from the top toolbar, then select Map Network Drive to open the dialog box.
 
 
  1. In the Drive pull-down menu, select a drive letter to assign to your target.
  2. In the Folder text box, enter one of the following:
  • http://hostname/files/
as shown in the preceding image, where hostname is the hostname or IP address of your target. 
 

Tip: You can use NI MAX to identify the hostname and IP address assigned to your target.
 
  1. Enable Connect using different credentials to use NI-Auth credentials instead of Windows credentials.
  2. (Optional) Disable Reconnect at logon if you do not want Windows to search for this network drive each time the current user logs on to Windows.
  3. Click Finish.
Note: If you have connected to the target using the Web-Based Monitoring and Configuration tool, you will be unable to map the target drive. Please close the Web-Based Monitoring and Configuration window before attempting to map the Real-Time target's drive.
  1. When prompted, enter your user name and password and click OK. The default user name for your Real-Time target is admin and the default password is a blank password.
Note: National Instruments recommends setting a password for improved security.
  1. You can now explore and transfer files on your target as shown:
 


Tip: If you want to navigate to your target by manually entering the target path in a browser or Explorer address bar, do not use the notation \\hostname\DavWWWRoot shown when you connect to your target.

Use the notation \\hostname\files instead, where hostname is the hostname or IP address of your target. An example filepath will look like the following: \\NI-cRIO9082-2F6137CB\files
 
Windows XP
Complete the following steps to map a target as a network drive and configure the Microsoft WebDAV client on Windows XP. 
  1. If it isn't already, install Windows XP Service Pack 3 on the computer for WebDAV to function properly. 
  2. Select Start >> My Network Places.
  3. Select Add a network place from the Network Tasks pane.
  4. In the Add Network Place Wizard, click Next.
  5. Select Choose another network location and click Next.
  6. The wizard prompts you for the address of the network place, as shown in the following image:
     
 
  1. In the Internet or network address text box, enter one of the following:
  • http://hostname/files/ 
as shown in the preceding image, where hostname is the hostname or IP address of your target. 
 
Tip: You can use NI MAX to identify the hostname and IP address assigned to your target​
  1. Click Next.
  2. Click Yes if a Security Alert dialog box appears.
  3. When prompted, enter your user name and password and click OK. The default user name for your Real-Time target is admin and the default password is a blank password.
Note: National Instruments recommends setting a password for improved security.
  1. When prompted, enter a name for your target and click Next.
  2. Review your choices and click Finish to exit the wizard.
  3. You can now explore and transfer files on your target as needed.
Note: You may have to enter your login credentials a second time to access your target.


OS X
Refer to the following steps to connect to the WebDAV server on OS X machines. 
  1. Select Go >> Connect to Server from the Finder menu to open the Connect to Server dialog box.
 

 
  1. In the Server Address text box, enter one of the following:
  • http://hostname/files/ 
as shown in the preceding image, where hostname is the hostname or IP address of your target. 
  1. ​Click Connect.
  2. When prompted, enter your user name and password in the Name and Password fields. The default user name for your Real-Time target is admin and the default password is a blank password.
Note: National Instruments recommends setting a password for improved security.
  1. Enable Registered User.
  2. Click Connect.
  3. You can now explore and transfer files on your target as needed.
 
  1. Transferring Files Using WebDAV

    Once you have connected to your target using WebDAV, you can transfer files between your target and development computer. Refer to the following information to learn about access permissions and the file and directory structure of your target:
 
Read Access
Your target provides read access to all its folders and files, so you can view files and copy them to your development computer.

Write Access
ETS, VxWorks 
Your target provides write access to all its folders and files. 
 
NI Linux Real-Time 
If you want to edit or create new folders and files on your target, you can do so only in the following directories:
  • /home/webserv
  • /home/lvuser
  • /tmp
Note: Your target deletes the content in the temporary folder /tmp on target restart.

Drag and Drop
You can drag and drop files with appropriate read and write access permissions between your development computer and your target.

File and Directory Structure
To learn about the file and directory structure of your target, see Working with File Paths on Real-Time Targets.

Maximum File Size Limitation 
The default maximum file size that you can transfer to Windows 7 is 50MB. If you try to transfer a file larger than this, you may see: Error 0x800700DF: The file size exceeds the limit allowed and cannot be saved. 

You can transfer files larger than this by editing the registry key in Windows.
 

Using WebDAV via NI MAX

The following procedure works with most targets. Complete the steps to open a WebDAV session to your targets:

  1. Open NI Measurement and Automation Explorer (NI MAX).
  2. Expand Remote Systems in the configuration tree. Find your target.
  3. Right-click it and select File Transfer to launch a WebDAV window.

 

Using the WebDAV VIs

LabVIEW 2013 and later include the WebDAV VIs to help you transfer files securely to and from a WebDAV server. You can use the WebDAV VIs to access advanced functionality such as the following:
  • Programmatically store, edit, and manage documents and files on your target.
  • Obtain directory and path information.
  • View the progress of an upload or download request.
  • Start file transfer requests in parallel.
  • Process file transfer requests in response to a user interface event.
     

Consult the detailed context help to learn more about specific WebDAV VIs in LabVIEW, and look at the example below to see how the WebDAV VIs can work together to access files.


Using WebDAV over USB

It is possible to transfer files using WebDAV to and from a USB drive on the Real-Time Target; however, the settings will be dependent on what Real-Time OS your controller is running.
 
ETS
Create a new mapped network drive to http://hostname/drives/u

VxWorks 
Create a new mapped network drive to http://hostname/files/u

NI Linux Real-Time
There will be a folder named U in your mapped network drive that will give you access to the USB drive on your Real-Time Target.

Note: Sometimes Linux will not transfer the files to the host PC until the references to the files are closed. If this happens, you will need to programmatically close the references to the files you are trying to transfer using the Close Reference Function.

If you are still unable to access the USB drive verify that a USB drive is connected and compatible with your Real-Time Target. 

 

Additional Information

WebDAV Security

One of the principal benefits of WebDAV is improved security over the FTP server. The WebDAV server integrates with NI-Auth, the authentication service used by your target to validate login credentials. To take full advantage of WebDAV security, complete the following steps:
  1. Enable SSL on your target and specify an HTTPS connection during WebDAV configuration. If you do not enable SSL or specify an HTTPS connection, the WebDAV client transfers files without encryption.


Secure Alternatives to WebDAV

National Instruments recommends you use WebDAV with SSL enabled instead of using the FTP server. In addition to WebDAV, you also can use the following secure options to access files on your target:


Disabling Automatic Configuration in Internet Explorer to Improve WebDAV Performance

​After configuring the Microsoft WebDAV client on Windows 7, you may notice slow WebDAV performance. To fix this issue, complete the following steps to disable automatic configuration:
  1. Open Internet Explorer.
  2. Select Tools >> Internet options.
  3. Select LAN settings from the Connections tab to open the Local Area Network (LAN) Settings dialog box.
 

 
  1. Disable Automatically detect settings.
  2. Click OK to apply the changes and exit the dialog box.
 
After disabling automatic configuration, WebDAV performance improves immediately. However, with automatic configuration disabled, you may receive error messages related to file transfer failures. If you encounter this type of message, select Try Again to re-attempt the file transfer. Alternatively, you can leave automatic configuration enabled.

 

Configuring WebDAV on Linux Machines

Due to the large number of Linux distributions, National Instruments cannot provide a general set of instructions for configuring WebDAV on Linux machines. However, you can find instructions specific to your distribution on the internet. 
 

Using Third-Party WebDAV Clients

Depending on your use case, you may find that third-party WebDAV clients offer better functionality and additional features when compared to the native client on your operating system. You can find third-party WebDAV clients on the internet. 

Note: National Instruments does not test third-party WebDAV clients, and cannot guarantee the intended user experience when using these clients to connect to your target.

WAS THIS ARTICLE HELPFUL?

Not Helpful