Example Code

Button Press Event Record to Data File using 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.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Use this VI to acquire a signal from a DAQ device, log signal in an ASCI file and detect and log if a button is pressed.

 

Description

This VI records a button press event to a log file (in this case, a simple text file) in line with the the data being captured. The data somewhat simulate what you get when using a Write To Measurement File Express VI in that it records the timestamps and other metadata in the process at the beginning of each iteration.

 

Requirements

  • LabVIEW 2012 (or compatible)
  • DAQ device

 
Steps to Implement or Execute Code

1. Run VI
2. Press Ok button
3. Stop the VI
4. Look at example.txt in the VI directory

 

Additional Information or References
Block Diagram

Button Press Event Write to LogFile LV2012 NI verified.png 

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

Jeff | LabVIEW Software Engineer

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

Comments
Todd S.
NI Employee (retired)
on

Great stuff!  Thanks for posting!

Todd S.
LabVIEW Community Manager
National Instruments