Example Code

LabVIEW as a Terminal Emulation (VT100) Program

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

  • Other

    Software

  • LabVIEW

    Driver

  • NI VISA

Code and Documents

Attachment

 

Overview
The following VI shows how to communicate with a device which uses the VT100 ASCII character set and control sequences (also known as escape sequences/characters). For more background on this VI and for more information on VT100 emulation please see Knowledgebase 4TMENICX: How to use LabVIEW as a Terminal Emulation (VT100) Program to Emulate an Ori.


Description 

This VI uses the VISA Serial functions which require the VISA driver to be installed. The code then reads and writes to the port asynchronously. The read loop awaits until the device has sent some data followed up by the escape character. To continue communicating with the device in a timely manner the device will require a reply to its escape character. If LabVIEW doesn't reply to the device, the device will have a pre-determined timeout before continuing its function.

Caveats and Additional Notes

A terminal implementation described as VT100 typically does not implement the full set of escape sequences. If you did require a full terminal emulator, then you could consider Hyper Access which includes an ActiveX interface. This can then be controlled from LabVIEW.

For other issues with Serial communication consult your connections, termination characters and LabVIEW VI timing. For more information please see KnowledgeBase 3VLAULIZ: Why Does My Serial Instrument Work in Hyperterminal But Not in LabVIEW or VI.

 

Requirements

  1. LabVIEW 2012 or later
  2. NI-VISA Driver

 

Steps to Implement or Execute Code

  1. Configure the Resource Name correctly.
  2. Set Inter Loop Delay and Read Timeout according to your need.
  3. Run the VI.

 

Additional Information or References

VI Snippet

1111.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉

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