Use LabVIEW to write a host computer and LabVIEW to write a host computer

Source: Internet
Author: User

Use LabVIEW to write a host computer and LabVIEW to write a host computer
Use LabVIEW to write a host computer

1. Download and install LabVIEW

Now, you can find a great tutorial on downloading, installing, and cracking LabVIEW on the Internet, so we will not detail it here. Please use Baidu ~~. In addition, we should remind you to try to download the kind of registration machine with LabVIEW during downloading, because if LabVIEW is not cracked, a lot of basic skills will not be used.
Here is a link to my cloud disk, which contains a registration machine:
Http://pan.baidu.com/s/1mgqqr1m

2. Download and install VISA
VISA (Virtual Instrument Software Architecture, referred to as "Visa"), is the Virtual Instrument Software structure. It is a general term for the I/O interface Software standards and their specifications developed by the VXI plug & play Alliance. VISA provides a standard I/O function library for Instrument Programming, known as the VISA Library. The VISA function library resides in the computer system and is a standard software communication interface between the computer and the instrument. The computer uses it to control the instrument.

VISA is essential for VISA installation when LabVIEW is used as the host computer.
VISA installation is relatively simple. You can directly install it after downloading it. After installation, you do not even need to open it.
Here is an official website (standard download is recommended, and NI downloader is not recommended ):
Http://www.ni.com/download/ni-visa-5.4/4230/en/
Write host computer:
First, the front panel of a host computer is provided:

Then the rear panel corresponding to the front panel is given:

The following describes the functions of each control in sequence:
The front panel consists of six parts. They are:
Serial Port name: the corresponding serial port number. After you plug in the USB, LabVIEW automatically identifies available serial numbers, so that you only need to click the down arrow to find out.

Read Buffer: Read data sent from the serial port. You can set the number of bytes to read each time.

Three direction values: the result of converting the readable data to an unsigned integer. Of course, the write data processing part depends on the individual's requirements. I just used this data method in the use process.

Stop display: stops the display of the image.

Disconnect Bluetooth: disconnect from the serial port.

Waveform chart: Real-time Data Display

Next we will introduce the rear panel controls:
The help document of LabVIEW provides a detailed explanation of the use and functions of these controls. I will not explain them one by one here, otherwise the entire book will not be complete. For the help of each control, place the cursor over the control, right-click it, and you will see the help. Just click it.

VISA configuration: This control contains the configuration of the serial port attribute. You can configure the following items: Serial Port name, baud rate, data bit, and parity bit.

VISA reading: Read data in the buffer zone. In VISA, in order to maintain synchronization, the data sent by the serial port is first stored in the buffer zone, and then the data you want is read from the buffer zone. Generally, you only need to set the number of bytes read each time.
String to byte array conversion: data read from the VISA buffer is read in the form of a string, and we want to obtain the data in it must first be converted to a character array, for search.

Array Index: Because I receive four data records each time, and to extract each data, I need to use the array index function.

Convert to single-byte shaping: Here is to convert the original unsigned char type data to signed, here is my data processing needs. Different controls may be used for different data processing.

Stop: Here I use a waveform chart to display data in real time, but sometimes I want the graphic interface to stay on a certain interface to facilitate careful observation, so this stop key will be added, used to pause an image.

VISA clears the IO Buffer: this is the data in the buffer, because after each read, I will clear the original data to prevent data mixing.

The above is a simple host computer program, and the functions that can be implemented are also relatively simple. The purpose of this blog is to share with you how to create a host computer. The complexity of the host computer depends on the programming.
In addition, the host computer is generally used for data transmission and processing. Therefore, you must clarify the logic and pay attention to the data flow. You must also learn how to use structured controls such as cyclic statements and condition structures.

Related Article

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.