Example Code

Serial Port Test

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 example is developed to test the serial port in simple way.

it has a very good UI.


Description
I have developed Utility which worked like Windows hyper terminal utility.

HyperTerminal is a program that you can use to connect to other computers, devices and host computers.

HyperTerminal  has capabilities beyond making connections to other computers and  devices. It can, for example, transfer large files from a computer onto  your portable computer using a serial port rather than requiring you to  set up your portable computer on a network. It can help debug source  code from a remote terminal. It can also communicate with many older,  character-based computers.

HyperTerminal records the messages  passed to and from the computer on the other end of your connection. It  can therefore serve as a valuable troubleshooting tool when setting up  and using your serial port. To make sure that your device is connected  properly or to view your device settings, you can send commands through  HyperTerminal and check the results. HyperTerminal also has scroll  functionality that enables you to view received text that has scrolled  off the screen.

  1. Connect / Disconnect: Clicking on this button, selected com port will connect or disconnect.
  2. Send File: Clicking on this button, file section window will open. User can select the file which supposed to send.
  3. Log file: Clicking on this button, User can log the data to the selected file.
  4. Clear Screen: Clicking on this button, the display screen will be cleared
  5. Autowrap: This will wrap the text
  6. Local Echo: This will generate an echo
  7. CR=> CR/LF: Send End character
  8. Auto scroll: Will scroll display automatically
  9. Display Style: Select the display style, like Normal, Hex code display
  10. Exit: Clicking on this button, application will exit.


Requirements

Software:

  1. LabVIEW 2012

 

Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the VI "Serial Port Test 2012 NIVerified.lvproj"
  3. Run the program

 

Additional Information or References
VI Snippet

1111.png

 

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

Regards
Prabhakant Patil

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

Comments
Prabhakant_Patil
Member
Member
on

Please click on like if you like it.

Your valuable suggestions are always welcome for the improvement.

Regards,

Prabhakant

Regards
Prabhakant Patil
mot4755
Member
Member
on

Do you have this VI for LV 8.5?

Having problems with Windows 7 and RS232 communication.

Raikar
Member
Member
on

Hello Sir.

i am doing simillar one,i need to communicate with my microcontroller through serial port,but i didn't get how to read the data from predicted loaction,i interface a eeprom with Microcontroller i did the eeprom interfacing with microcontroller,even i tested in hyperterminal it will working fine,Ex-when i want to read i will give RP 0x0020 then i can read the data of eeprom similar write also,same thing i want in labview without manual interaction the labview will read and write,i did by using VISA read and write i am getting error.even when i going to check your example Vi simillar thing happen,please help me how to do.

Raikar A G

jdwtamu
Member
Member
on

This VI is VERY close to what I need!  I am trying to read a Mettler Toledo balance.  I can use this code as written and see the read characters just like I want!  Now my problem is my lack of LabView skills to take the essentials of this interface and make it useful for my specific needs.  I need the read data to be saved to a text file.  I would prefer an independent VI that does not have so many generic selections.  I don't need the hard close of the window and all else.  My basic project is to read thermocouples via a DAQ and this scale in a single interface writing all data to a file.  I have this working easy enough for the thermocouples but I don't know how to make it happen for the scale readings.

Any help is appreciated.

Doug White

AndroidAnbu
Member
Member
on

Hi NI Guys,

I am very new to NI LabVIEW, now only am learning basic things.  Now I like to learn serial communication.

My scope is, Ill transmit ASCII data in terminal, LabVIEW should read and parse the data to indicators.

For eg. in serial port ill send temperature rated data should display in meter gauge.