LabVIEW Serial Communication Detailed Explanation

Publisher:恬淡如云Latest update time:2015-08-07 Source: vihomeKeywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I have wanted to make something similar for a long time. I happened to learn LabVIEW this semester, and I handed in this as my homework, a "serial oscilloscope" host computer based on LabVIEW.

1. Program interface:

Function introduction: The upper left is the serial port receiving area, and the lower part is the serial port character sending area. The right side is a waveform chart. Each time the data sent from the serial port is formatted with f% inside the program, it is displayed on the waveform chart.
Button introduction: From left to right, send button; clear count button; open/close serial port button; clear receiving area data; clear waveform chart; save waveform; exit program.

 

2. Main program flowchart:

Introduction to the main program flowchart: The main program flowchart mainly consists of three states: program initialization, response to program events, and program exit.

State Init: Program initialization, mainly set the OpenCom button, serial port status, serial port receive string, waveform icon, TX/RX count and other controls to False or clear. The initialization state is executed only once, and then enter the Event state.

State Event: Program event response, consisting of an event structure, a total of 8 events need to be responded: Open/CloseCom button event; serial port number or baud rate change event; send button event; clear count button event; clear receiving area button event; clear waveform area button event; save waveform button event; menu selection event; exit button event. If you press the exit button in this state, you will enter the state Exit, otherwise the program will always run in this state.

Status Exit: The program exits. The opened VISA handle must be closed before exiting.

 

3. Serial port receiving program block diagram:

Serial port receiving program flowchart introduction: When the serial port status is true, call the serial port property node "Bytes at Port". If there are X bytes of data in the serial port buffer, receive X bytes of data. Finally, use a state machine to implement the judgment of two adjacent strings. If the serial port receives the time between two adjacent strings for more than 50ms, it is judged as two independent strings; if it is less than 50ms, the two strings are automatically spliced.

Keywords:LabVIEW Reference address:LabVIEW Serial Communication Detailed Explanation

Previous article:The basic framework of LabVIEW graphical programming
Next article:LabVIEW VI Properties

Recommended ReadingLatest update time:2024-11-17 10:45

Labview---Strings are automatically output in sequence
Application scenarios:               When the serial port needs to send data automatically,    if there are several different instructions to be sent, here is the solution to send different instructions in sequence.   Use the conditional structure to select the string corresponding to the condition.  
[Test Measurement]
Labview---Strings are automatically output in sequence
Ethernet Remote Temperature Monitoring Based on LabVIEW Programming
Introduction In industrial production, real-time temperature monitoring is often required. Although short-distance monitoring can be achieved using serial communication standards such as RS232 and RS485, it is difficult to achieve remote, real-time monitoring in high-temperature, high-noise, or narrow space environme
[Test Measurement]
Ethernet Remote Temperature Monitoring Based on LabVIEW Programming
Rapid development of medical electronic equipment based on NI LabVIEW platform
Investment in the medical device industry has been on the rise in recent years. In the past two years, venture capital for medical devices has almost doubled, reaching $4 billion in 2007. From a global perspective or in the Chinese market, small, unlisted medical device manufacturers are gradually becoming th
[Test Measurement]
LabVIEW releases EXE containing shared variables and solves related problems
RT, the following error is reported during generation. Solution:
[Test Measurement]
Realization of Arbitrary Function Signal Generator by Labview
  Homework for the class, for beginners. It took me some time to finish it, and I hope it can be a reference and help for those who are learning. Title: Design an arbitrary signal generator that can generate sine waves, triangle waves, square waves, sawtooth waves and other waveforms with adjustable frequency and phas
[Test Measurement]
Development of Mechanical Vibration Signal Analysis System Based on LabVIEW
With the continuous development of modern industrial production, the structure of mechanical equipment has become more and more complex, and it often runs under high speed, heavy load and harsh environment. Due to the interference and influence of various factors, mechanical equipment will fail, which may reduce pro
[Test Measurement]
Development of Mechanical Vibration Signal Analysis System Based on LabVIEW
LABVIEW in-depth exploration of the MDB database writing speed issue.
Recently in the LABVIEW group, I saw several discussions about using queues to write collected data into the database. The discussions were very lively, but they overlooked an important issue, which is the maximum write speed of the database. Once the number of samples per second exceeds a certain limit, no matter wha
[Test Measurement]
LABVIEW in-depth exploration of the MDB database writing speed issue.
Using LabVIEW and NI Single-Board RIO to Build a Smart Grid Monitoring System
The smart grid unit we developed using NI Single-Board RIO is a reliable and cost-effective solution that is uniquely flexible and ideal for building automation systems. Using NI hardware and software platforms gives us a technical advantage, and NI also provides excellent local technical support during the system dev
[Test Measurement]
Using LabVIEW and NI Single-Board RIO to Build a Smart Grid Monitoring System
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号