Using Mass Storage on LabVIEW Real-Time Systems

Overview

This technical document discusses various methods for adding or expanding mass storage on LabVIEW Real-Time systems in addition to covering special considerations for industrial use, techniques for accessing data remotely, and best practices for storing and retrieving data.

Contents

Increasing Available Mass Storage 

Adding mass storage can be done by upgrading the on-board drive, by adding additional non-volatile memory, or by connecting to a network or cloud service.  Not all methods are available for every system or application, and there are advantages and disadvantages with each.  

Hard Drives vs. Solid State Drives

Traditional hard disk drives (HDD) utilize rotating magnetic storage plates with a mechanical arm that skims the surface to read and write data.  Solid State Drives (SSD) on the other hand have no moving parts, and instead store data onto flash.  HDDs have a higher density per cost than SSDs, but HDDs are generally larger, slower, and less rugged due to moving components. CompactRIO controllers are only available with SSD storage, whereas PXI and PXI Express controllers include both HDD and SSD options.  

Flash Technology

Not all SSDs are created equal, as there are different types and grades of flash technology available.  Picking the type of flash for your application is a tradeoff between price and endurance, where the consequences of picking the wrong flash may be the loss of critical data.  Single-level Cell (SLC)-based drives are the most robust (but also most expensive) solution, but some applications may be tolerant of other less robust options such as Multi-level Cell (MLC) flash.  For more information about flash technology and considerations for use of flash in industrial and embedded applications see Understanding Life Expectancy of Flash Storage

Local vs. Network Storage 

Local storage is accessible via controller peripherals that do not require a network connection.  Local storage includes SATA, USB, and SD media, and is either integrated into the controller itself or located nearby via a USB connection. Network storage is accessible via network protocols and can include shared network drives and cloud services.   

Upgrading On-board Local Storage 

LabVIEW Real-Time controllers include non-volatile storage which is used to contain device firmware, operating system files, hardware drivers, system application files, and user application files.  

While CompactRIO Controllers have fixed storage which cannot be upgraded, PXI and PXIe Controllers have storage drives that can be replaced.  This upgrade can either be performed as an option at the time of purchase, or by the installer and/or user at a later time.  For more information about the types of drives that can be used in PXI and PXI Express controllers, refer to What Type of Hard Drive Can I Use in a PXI Controller?.

Installing Additional Local Storage 

Non-volatile storage can be added locally to LabVIEW Real-Time systems through a variety of methods covering a range of performance, ruggedness, and accessibility.  

  • Off-the-shelf USB Drive – A USB thumb drive or other external USB drive may be used in LabVIEW Real-Time systems.  However, these devices will typically lack industrial specifications and care must be taken to select a drive that meets your application’s requirements.
  • SD Card – Some CompactRIO controllers, such as the cRIO-903x and cRIO-904x, offer a SD Card or MicroSD Card slot.  While performance is typically slower than SuperSpeed USB drives, these slots do offer a fully-integrated and compact option for expanding mass storage.  See Controller product documentation for more information about using SD cards, including the types supported.

Cloud Storage Services 

Applications that don’t require local storage and have access to network resources can utilize cloud storage services for data storage.  The LabVIEW Cloud Toolkit for AWS provides interfaces to Amazon Web Services.  For more information and to download the toolkit see the LabVIEW Cloud Toolkit for AWS by NI

Selecting a File System 

Local storage and shared network drives must use a file system supported by the LabVIEW Real-Time operation system of their controller.  

Selecting the appropriate file system will depend on a variety of factors:

  • What file systems are supported with your Real-Time controller
  • What level of portability between different devices (e.g. Windows) is required by your application
    National Instruments recommends ext4 for applications running on Linux-based Real-Time controllers and fat32 for Phar Lap ETS and VxWorks-based controllers.  For a list of Real-Time controllers and corresponding operating systems see Real-Time Controllers and Real-Time Operating System Compatibility.   

In some cases options exist that trade off robustness for portability.  For more information about selecting and setting up file systems, refer to Selecting and Setting Up an ext4 File System on LabVIEW Linux Real-Time Targets.

Accessing Local Storage 

From within a LabVIEW Real-Time Application 

You can access files from local storage from within your LabVIEW Real-Time application through the file I/O palette. Refer to Monitor and Log Data With LabVIEW Real-Time to learn how to set up data logging using the file I/O palette.

Care should be taken when setting up file I/O due to the nature of Real-Time applications and the non-deterministic nature of file access.  Disk operations may introduce jitter and/or produce bottlenecks in your application.  For information on Best Practices for file I/O in LabVIEW Real-Time see this White Paper

Over the Network 

Methods for remotely accessing local storage depends on the operating system used by your LabVIEW Real-Time controller.  For a list of Real-Time controllers and corresponding operating systems see this document on Real-Time Controllers and Real-Time Operating System Compatibility

For Linux-based LabVIEW Real-Time controllers, see Knowledge Base: Tools Available for File Transfer/Access on NI Linux Real-Time Targets for details on tools available for file transfer and access.  

For Pharlap-based or VxWorks-based LabVIEW Real-Time controllers see Knowledge Base: Using WebDAV to Transfer Files to Real-Time Target for details on how to transfer files to and from the controller. 

Move Media to Another System 

If the storage media can be physically removed from the LabVIEW Real-Time controller (USB, SD, or removable hard drive) then data can be accessed by connecting this media to a controller or host that can access the file system type that was used.  For example, Windows can natively access FAT32 drives, and Linux can natively access FAT32 and ext4 drives.

If a file system is not natively supported, it may still be possible to access data using a utility and/or system driver.  For example, Windows systems can access ext4 using a 3rd party driver.