Example Code

Controlling DTR RTS Lines On A Serial Port

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

Code and Documents

Attachment

Overview

This example demonstrates manually changing states of the DTR and RTS lines on a serial port.

 

 

Description

Property nodes are used to set the states of the DTR and RTS lines. An event structure is used to detect changes to two buttons that correspond to the DTR and RTS lines.

  • Configure the Serial Port (optional). Make sure Flow Control is set to None.
  • Create an event structure to detect change of value for the DTR and RTS buttons
  • In the DTR Value Change state, create a property node with the VISA serial resource name. Click on the property node and select Serial Settings » Modem Line Settings » Line DTR State.
  • In the RTS Value Change state, create a property node with the VISA serial resource name. Click on the property node and select Serial Settings » Modem Line Settings » Line RTS State.
  • Close the VISA session

 

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

Hardware:

  • Device with serial interface

 

 

Steps to Implement or Execute Code

  1. Open the VI "DTR_ RTS Serial Control_LV2012_NI Verified"
  2. Choose the VISA Resource Name
  3. Run the VI
  4. Click to modify DTR and RTS status
  5. Stop Execution

 

 

Additional Information or References

BD.PNG

 

 

 

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

---

Peter Flores
Applications Engineer

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

Comments
cacalderon
Member
Member
on

Thank you!!!!

Very useful feature of the serial port.

____________________________________________
Carlos Calderón Córdova, Ing.
Universidad Técnica Particular de Loja
Grupo de Control, Automatización y Robótica
Escuela de Electrónica y Telecomunicaciones
Phone: (+593) 7-2570275 ext. 2650
Cell: 098663798
____________________________________________
e.g.lll
Member
Member
on

Thank you!!!!

Very useful feature of the serial port.