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
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.
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]
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 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]
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]
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]
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
Latest Test Measurement Articles
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- Buy an oscilloscope and get the essential analysis software 5-PWR for power engineers
- Why is there no output on PC14 of GD32F107VCT6 as IO port?
- Live broadcast at 2 pm today [TI Sitara product multi-protocol industrial communication application solution]
- Virtual Maker Faire event has begun
- Qorvo's 2020 Innovations Seamlessly Integrate Wi-Fi 6 and IoT Solutions
- [Atria Development Board AT32F421 Review] - 01. Unboxing and lighting
- Deployment of Tina system on MaixSense R329 development board
- 5G wireless access network becomes the biggest challenge facing communication service providers
- How to delete a specified length from any position of a line (autocad)
- Three ways to power the Raspberry Pi