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

Save Data on a USB Flash Drive connected to a cRIO/sbRIO

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

    Driver

  • NI RIO

Code and Documents

Attachment

Overview

This VI demonstrates how to write a string into a textfile and save that file to a USB Flash drive connected to a cRIO.

 

Description

Some cRIOs/sbRIOs offer an USB port which can be used to connect a USB Flash drive or other storage devices to the cRIO. This example shows how to use the USB Flash drive in LabVIEW. Additional information are available in the KnowlegeBase Writing to an External USB Drive or SD Card from a LabVIEW Real-Time Device.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)
  • NI-RIO 12.0 (or compatible)

 Hardware

  • cRIO/sbRIO with USB port (cRIO-9012, 9014, 9024, 9076, ...)

 

Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open the [Main] ...VI and follow the instructions on the Front Panel

 

Additional Information or References

[Main] Save Text File to USB Flash Drive - Front Panel.png
[Main] Save Text File to USB Flash Drive - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
National Instruments
Applications Engineer

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

Comments
jennyzzz
Member
Member
on

very useful!

Thanks!

xaviar_nao
Member
Member
on

Thank you for your shearing.

 

If you are all right, could you tell me how to apply this VI for MyRIO?

 

Best regards,

Naoki

jackwang0420
NI Employee (retired)
on

Hi Sir,

 

May I ask how to read USB data in sbRIO RT mode?

Just change write text file to read?

and does USB data format have limit? (like: string , numeric etc....)

image.png

Thank you.

 

 

indie678
Member
Member
on

Hi all member forum labview. I wanna ask about saving data on flash disk via MyRio Hardware. I have 2 data, there are current sensor and voltage sensor. I have to measure 2 sensors and save data to flashdisk via MyRIo Hardware. Can u tell me how to create program in labview for this case. Thank a lot.