Example Code

Writing Special Characters to a 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

This simple example demonstrates how to write a special character (ie. symbols, special letters, shapes, etc.) to a standard text file using LabVIEW.

 

Description

This example uses the underlining fact that all characters have a Unicode format as representation.

The idea of this example is to use "reverse engineering" in order to determine the Unicode format of the particular character you are trying to acquire. Once the Unicode representation is obtained, use this newly obtained code to write the corresponding character to a file.

 

Requirements

  • LabVIEW 2013 (or compatible)

 

Steps to Implement or Execute Code

  1. Insert a character a new text file. Save the file
  2. Create a blank text file and save it. This will be the file that you will be writing to
  3. Change file names on the Block Diagram that you want to read/write from
  4. Run the VI
  5. Copy Unicode Representation obtained in the "Character read from text file" block, into the "Writing to text file" block
  6. Run the VI again
  7. Open the text file that the character is being written to

 

Additional Information or References

VI Snippet of Block Diagram

sni.png

 

 

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

 

Rob W.

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