One example of LabVIEW serial communication-Serial "oscilloscope"

Source: Internet
Author: User

1. Program Interface:
<ignore_js_op>

Features: The upper left side of the serial reception area, below the serial character send area. The right is a waveform chart, in the program every time the serial port sent over the data, in f% format, displayed on the waveform chart.
Button Description: From left to right, send button, clear Count button, open/Close serial button, clear receiving area data, clear waveform chart, save waveform, exit program.


2. Main program block diagram:


Main program Block diagram: Main program diagram consists of 3 states: Program initialization, program event response, program exit.

State init: Program initialization, mainly put opencom button, serial port status, serial port receive string, waveform icon, Tx/rx count and other controls, set to false or zeroed. The initialization state executes only once and then enters the status event.

Status Event: Program event response, composed of an event structure, total response to 8 events: Open/closecom button event, string number or baud rate Change event, send button event, empty Count button event, empty Receive Area button event; Save Waveform button Event ; Menu selection event; Exit button event. If you press the Exit button in this state, enter the status exit, or the program will run in this state.

Status exit: Program exits. Close the open visa handle before exiting.


3. Serial receiver program block diagram:


Serial Receiver Program block description: When the serial port status is true, call the serial port attribute node "Bytes at Port", if the serial port buffer has x bytes of data to receive x bytes of data. Finally, a state machine is used to realize the judgment of the adjacent two strings. If the serial port receives more than 50ms between the adjacent two strings, it is judged to be two separate strings, and if it is less than 50ms, the front and back two strings are automatically spliced.

One example of LabVIEW serial communication-Serial "oscilloscope"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.