From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Writing to External USB Drive from RTOS Using RealTime for LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • CompactRIO|SingleBoardRIO

    Software

  • LabVIEW Real-Time Module
  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI writes a basic concatanated string to a text file on an external USB drive connected to the USB port of an NI cRIO controller, however, should be applicable to the majority (if not all) NI RTOS controllers    

 

Description

This VIS take a basic "Hello World" string, concatanates it with a Comma, and then writes it to the USB drive connected externally. The address is simply u:\ and then the name of the file.

IMPORTANT - The USB stick has been formatted to FAT32

 

Requirements

Software

LabVIEW 2013 (or compatible), LabVIEW Real-Time Module

Hardware

I used a cRIO 9025, however, any RTOS controller should work

USB Drive Formatted to FAT32

 

 

Steps to Implement or Execute Code

  1. Place VI under RT component of project
  2. Set fil name in file path
  3. Run

Additional Information or Reference

 1-371 BD.jpg

 

Knowledgebase 6MT7NJDH: Writing to an external usb drive or sd card from a labview real-time device

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Liam A.
National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.