Data Acquisition System Based on LabVIEW

Publisher:科技火箭Latest update time:2015-02-11 Source: eechinaKeywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 LabVIEW Partial Design

1.1 VISA Introduction

LabVIEW provides a powerful VISA library. VISA (Virtual Instrument Software Architecture) - Virtual Instrument Software Specification is a general term for standard I/O function libraries and related specifications used for instrument programming. The VISA library resides in the computer system, completes the connection between the computer and the instrument, and is used to realize program control of the instrument. Its essence is a standard API for virtual instrument systems. VISA itself does not have programming capabilities. It is a high-level API that realizes instrument programming by calling the underlying driver. Its hierarchy is shown in Figure 1. VISA is an I/O interface software that adopts the VPP standard. Its software structure consists of three parts, as shown in Figure 2.









Compared with other existing I/O interface software, VISA's I/O control function has the following characteristics: It is applicable to various instrument types (such as VXI instruments, GPIB instruments, RS-232 serial instruments, message-based devices, register devices, memory devices, etc.); It is applicable to various hardware interface types; It is applicable to single-processor and multi-processor structures or distributed network structures; It is applicable to a variety of network mechanisms.

The source code of VISA's I/O software library is unique. It has nothing to do with the operating system and programming language. It only provides a standard API file as the output of the system.

1.2 Serial communication functions in the VISA library

The main serial communication function call path used in this article is: Functions?Instrument I/O?VISA?VISA Advanced?Interface Specific?Serial.

(1) VISA Configure Serial Port node (as shown in Figure 3)

 



This node is mainly used to initialize the serial port. The main parameters are as follows:

VISA resource name: VISA resource name, which refers to the serial port number in this article. Baud rate: baud rate, the default is 9600.
Data bits: the number of bits in a frame of information, LabVIEW allows 5 to 8 bits of data, and the default value is 8 bits.
Stop bits: the number of stop bits in a frame of information, which can be 1 bit, 1.5 bits or 2 bits.
Parity: parity setting. It can be no parity, odd parity or even parity.
Flow control: The data type of this parameter is cluster, which is used for handshake mode in serial communication.

(2) VISA Read node (as shown in Figure 4)?

 



This node is the serial port reading subVI, which is the main node in this article. It reads the data in the serial port and then uses the powerful data processing function of LabVIEW to analyze and process it. The main parameters are as follows:

VISA resource name: Same as above.

Byte count: Used to set the number of characters to be read. Since the serial communication subVI of LabVIEW only allows the reading and writing of strings, the correct conversion between strings and numbers must be achieved when processing data in this article. In addition, if you want to read all the characters in the current serial port, you must execute the "VISA Bytes at Serial Port" subVI to determine the exact number of bytes to be read, and then use its output as the input of the VISA Read node. [page]

(3) VISA Close node (as shown in Figure 5)?

 







This node is used to close the open VISA resource. There is only one main parameter:

VISA resource name: Same as above.

The baud rate of the LabVIEW serial port communication program used in this article is 9600, no parity check, 8 data bits, 1 stop bit, and software and hardware handshakes are prohibited. 2.1 Hardware The

MCS -51 microcontroller has a powerful full-duplex serial port inside. The serial port has 4 working modes. The baud rate can be set by software and is generated by the timer/counter inside the chip. Both receiving and sending can trigger the interrupt system, which is very convenient to use. There are two physically independent receiving and sending buffers SBUF, and there are also two independent receiving and sending signal lines RXD (P3.0) and TXD (P3.1) to the outside. This article adopts the RS232 serial interface standard. In terms of electrical characteristics, RS?232 uses negative logic, requiring a large amplitude between the high and low signals. The standard is: logic "1" is between -5V and -15V, and logic "0" is between +5V and +15V. Usually, about -10V is used as logic 1 and about +10V is used as logic 0. Since the signal input and output of the MCS-51 system are TTL level, the logic 1 is about 3.8V, and the logic 0 is about 0.4V, therefore, an external circuit must be connected to realize the conversion from TTL level to RS-232 level. This article uses MAX232E to realize this conversion. The TLC0831 chip is used for data acquisition. The TLC0831 chip is an 8-bit successive approximation voltage type A/D converter, which supports single-channel input and serial port output, with fixed polarity settings and no addressing required. Its main features are: 8-bit resolution; 5V power supply provides an adjustable reference voltage of 0~5V; input and output are compatible with TTL and MOS. If you want to increase the sampling frequency of the signal, just choose an A/D chip with a faster conversion speed. The schematic diagram of the hardware part is shown in Figure 6. 2.2 Software part The main program of the microcontroller software part is given below. The baud rate is set to 9600, and the baud rate is generated by timer 1. The serial port works in mode 1 without parity check. Timer 0 sets the sampling time interval. TLC0831 is the A/D converter data sampling subroutine, and SEND is the microcontroller sending subroutine. 3 Conclusion This paper uses a microcontroller for front-end data acquisition, realizes data communication with LabVIEW through a serial port, and uses the powerful signal analysis and processing function of LabVIEW to develop a data acquisition and information analysis system with low investment and easy operation (its virtual panel is shown in Figure 7). Experiments have shown that the system works well.






























Keywords:LabVIEW Reference address:Data Acquisition System Based on LabVIEW

Previous article:Quick Methods and Experiences of Learning Virtual Instruments
Next article:Design of weak signal processing module test system based on virtual instrument

Recommended ReadingLatest update time:2024-11-16 04:20

How to Connect an Analog Discovery™ USB Oscilloscope to LabVIEW
Step 1: Materials hardware Simulation discovery: link Software (see next step for link) WaveForms 2.6.2 or higher LabVIEW (versions 2013 and 2014 have been tested to work fine so far) LabView Run-Time Engine 2103 (This is an optional LabVIEW Editor alternative, see the next step.) Note: Installing LabVIEW requires
[Test Measurement]
How to Connect an Analog Discovery™ USB Oscilloscope to LabVIEW
LabVIEW Data Line Types
  In order to distinguish different data types, LabVIEW sets fixed colors for different data types. The colors and lines of the data lines are different depending on the data type connected. Generally speaking, the data line corresponding to a single data is the thinnest line. The data line containing multiple data is
[Test Measurement]
LabVIEW Data Line Types
[]LabVIEW Application-Write Table To Excel use ActiveX
Use ActiveX to write a two-dimensional array into MS Excel In LabVIEW, you can write a table to MS Excel directly through the 'Programming' 'File I/O' 'Write to Spreadsheet File' tool or use the LabVIEW Report Generation Toolkit tool. Here we introduce how to use ActiveX to write a table to MS Excel in LabVIEW.
[Test Measurement]
[]LabVIEW Application-Write Table To Excel use ActiveX
In-depth exploration of labview -- several basic concepts of database connection
NI provides LABVIEW components for general databases and provides full support for databases through ADO. ADO opens the database through the connection string, so it is necessary to understand several basic concepts of database connection. 1. The relationship between ODBC, OLEDB, ADO, and ADOX:   ODBC: The former
[Test Measurement]
In-depth exploration of labview -- several basic concepts of database connection
Miscellaneous discussion on labview loop structure
While loops inside While loops can easily lead to infinite loops, and almost all problems have solutions that are not suitable for nesting. If there are parallel block diagram programs in a While loop (including For loops, etc.), the next loop can only be executed after all programs have completed one loop. If there ar
[Test Measurement]
LabVIEW realizes serial communication between PC and microcontroller
       Use Proteus to simulate the microcontroller and the hardware connection. Use Keil and Labview to write programs for the serial communication part to achieve:          PC sends numbers (00, 01, 02, 03..., FF, hexadecimal) to the microcontroller through the serial port. The microcontroller sends back the number a
[Test Measurement]
Labview simulation telephone implementation
           Labview is a powerful simulation software developed by National Instruments (NI) in the United States. It is used in many projects. Although this is my first time to use this software, I remember that when the National Undergraduate Innovation Project was concluded last month, many students (from the School
[Test Measurement]
Developing a Smarter Portable Flu Diagnosis System Using LabVIEW
Polymerase chain reaction (PCR) thermal cycling is the gold standard for molecular diagnostics. However, a major challenge facing the world in responding to the influenza pandemic is that only professionals can perform effective diagnostic tests. In addition, commercially available thermal cyclers are only for use in
[Test Measurement]
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号