1. Introduction
LabVIEWLabvie is short for lab Virtual Instrument Engineering workbench (LabVIEW virtual instruments engineering Workbench). It is a virtual instrument development platform software developed by National Instrument Corporation of America. It has powerful and flexible functions, it can be widely used in automatic measurement system, industrial process automation, laboratory simulation and other fields. LabVIEW is programmed in a graphical programming language, which is simple and intuitive, greatly saving program development time. At the same time, LabVIEW provides a wide range of library functions and function modules to complete a variety of complex programming tasks.
Two serial portsThe serial communication interface standards have been used and developed. Currently, there are several types of interfaces. But are in the RS-232 standard on the basis of improvement and formed. So, mainly to discuss RS-232C. RS-323C standards is the United States EIA (Electronic Industry Federation) and Bell and other companies developed together with the announcement of the 1969 communication agreement. It is suitable for the data transmission rate ranging from 0 ~ Communication within the range of 20000b/s. This standard clearly defines problems related to the serial communication interface, such as signal line functions and electrical properties. Because the manufacturers of devices are producing communication equipment compatible with the RS-232C standard, as a standard, it has been widely used in the microcomputer communication interface.
3. Communication Methods(1) Using VISA (2) Using ActiveX (using MSComm)
4. Use visa for Serial CommunicationVisa is a standard I/O application interface (API) used in Instrument Programming. Visa itself does not have the programming capability of the instrument. Visa is the high-level API that calls the Low-layer driver. Visa can call the corresponding device driver according to the instrument used, and the relevant methods of use can refer to the user manual of LabVIEW.
1 Description
2. Reading and Writing visa serial port in LabVIEW
For details, see the built-in routine serial write and read. VI of LabVIEW.
5. Use MSComm
Because LabVIEW has good support for ActiveX, we can easily use ActiveX technology to expand LabVIEW functions and enhance flexibility. In terms of serial communication, we use the MSComm control provided by Microsoft to achieve serial communication. Register the mscomm32.ocx file and import it to LabVIEW. In this way, Microsoft Communications Control. CTL is under user. Control. In this way, we can easily use this ActiveX component to achieve serial communication.
Note: This figure directly references the routine provided by the network. The following figure shows the interface (Nanjing Liu Ya, a serial communication program)
Summary
Through the above two methods, we can easily implement labveiw to achieve serial communication! You can select the implementation method as required and use visa to achieve convenience. After all, it is developed and implemented by Ni. At the same time, visa can easily achieve multi-serial communication to achieve data exchange between different serial ports. This method is practical and reliable after verification! Supplement: it is the implementation of multi-serial communication!
References"LabVIEW advanced programming" Yang leequality, Tsinghua University Press Zhong Shaojun Xu Suan Zhao Zikai "communication between programmable controller and LabVIEW" Zhong Shaojun Xu Suan Zhao Zikai "using serial port for communication in LabVIEW" Nanjing Liu Ya