This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Using WebDAV to Transfer Files to Real-Time Target

Updated Aug 3, 2023

Environment

Hardware

  • CompactRIO Controller
  • PXI Controller
  • CompactDAQ Controller

Software

  • LabVIEW

Operating System

  • VxWorks
  • Windows

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?

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
 

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.

3. In the Drive dropdown menu, select a drive letter to assign to your target.
4. In the Folder text box, enter one of the following:
  • http://hostname/files/
  • http://hostIPAddress/files/
​as shown in the preceding image, using either the name or IP address of your target. 
NB: You can use NI MAX to identify the host name and IP address assigned to your target.

5. Enable Connect using different credentials to use NI-Auth credentials instead of Windows credentials.
6. (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.
7. Click Finish.
NB: If you have connected to the target using the Web-Based Monitoring and Configuration tool, you will be unable to map the target drive. Close the Web-Based Monitoring and Configuration window before attempting to map the Real-Time target's drive.

8. 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.
NB: NI recommends setting a password for improved security. As we do not store these passwords, NI cannot reset a password if it is forgotten. Resetting a forgotten password requires reformatting the RIO.

9. You can now explore and transfer files on your target as shown:

NB: 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. Instead, use the notation \\hostname\files, where hostname is the name or IP address of the target. An example file path will look like the following: \\NI-cRIO9082-2F6137CB\files

If you have any external drives attached to your Real-Time target, they will show up as folders in the http://hostname/files/ or http://hostIPAddress/files/ directory. For example, an SD card or USB hard drive with the volume letter U will be accessible at http://hostname/files/U/ or http://hostIPAddress/files/U/. 

Windows XP

Complete the following steps to map a target as a network drive and configure the Microsoft WebDAV client on Windows XP. 

1. Ensure Windows XP Service Pack 3 is installed 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:
7. In the Internet or network address dropdown menu, enter one of the following:
  • http://hostname/files/
  • http://hostIPAddress/files/
​as shown in the preceding image, using either the name or IP address of your target. 
NB: You can use NI MAX to identify the host name and IP address assigned to your target.

8. Click Next.
9. Click Yes if a Security Alert dialog box appears.
10. 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.
NB: NI recommends setting a password for improved security. As we do not store these passwords, NI cannot reset a password if it is forgotten. Resetting a forgotten password requires reformatting the RIO.

11. When prompted, enter a name for your target and click Next.
12. Review your choices and click Finish to exit the wizard.
13. You can now explore and transfer files on your target as needed.
NB: You may have to enter your login credentials a second time to access your target.
 

OS X

The following steps detail how 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.

2. In the Connect to Server dialog box, enter one of the following in the Server Address field:
  • http://hostname/files/
  • http://hostIPAddress/files/
​as shown in the preceding image, using either the name or IP address of your target. 
NB: You can use NI MAX to identify the host name and IP address assigned to your target.

​3. Click Connect.
4. 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.
NB: NI recommends setting a password for improved security. As we do not store these passwords, NI cannot reset a password if it is forgotten. Resetting a forgotten password requires reformatting the RIO.

5. Enable Registered User.
6. Click Connect.
7. You can now explore and transfer files on your target as needed.
 

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
NB: 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 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, as described in Unable to Transfer Large Files Using WebDAV.
 

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. 

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. Set a password for your target
  2. 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

NI 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, NI 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. 
NB: NI does not test third-party WebDAV clients, and cannot guarantee the intended user experience when using these clients to connect to your target.