Design of Instrument Control System Based On LabVI
Design of Instrument Control System Based On LabVI
3427 ~ 3432
e-ISSN: 2087-278X
3427
Abstract
In order to solve the problems such as poor expansion, long development cycle of instrument
control system developed by traditional programming language, using VISA module based on LabVIEW
platform was introduced. This paper presented a simplicity, intuitive instrument control system of
pneumatic measuring instrument, which was accomplished with graphical language LabVIEW. The system
could also complete the text data output. It was improved that the system based on LabVIEW achieved
instrument control efficiently, openly, with operating conveniently and good human-machine interface.
1. Introduction
Instrument control technology plays a more and more important role in the field of auto
measurement, with the development of computer technology and requirements of the
electronics industry. Instrument control is the process that instruments are controlled by
computer directly through the exchange of commands and data between them. This process is
achieved frequently by textual programming languages in traditional way. But graphical
language LabVIEW bases on dataflow programming. Compared with traditional way, system
developed by LabVIEW more emphasises data processing procedure, and it makes it easier to
write the program, shortens development time, and reduces the difficulty of program design [1].
With a digital sampling and processing system designed with LabVIEW, in this paper, the basal
platform is constituted, and pneumatic measuring instrument is controlled by computer.
Start
N
Advanced functions IVI
Template-based
Direct I/O driver
N
Received January 20, 2013; Revised April 20, 2013; Accepted April 29, 2013
3428 e-ISSN: 2087-278X
Instrument driver is used to control the system hardwares, and then computer
communicates with them. The crucial part of choosing the right method is to see whether the
driver is given. Pneumatic measuring instrument described in this paper does not support any
API (application programming interface) and manufacturer identification code, so VISA is called
by LabVIEW. VISA, the acronym of virtual instrument software architecture, is the standard I/O
API of programmable instrument, and it can control GPIB, PXI, VXI, USB, RS232 and RS485
instruments. Compared with other I/O APIs, VISA is not limited by platform bus or development
environment, and in the system whether developed on Windows based on LabVIEW or written
on Mac with C programming languages, we could use the same VI (virtual instrument) [2, 3];
VISA can also call corresponding driver on the basis of instrument automatically, so the users
do not have to learn various of communication protocols, and then the process programming
efficiency is improved. The method has reference value for design of instrument control system.
4. Software Design
4.1. Physical Connection between Computer and Instrument
There are two main ways to connect instrument with computer: parallel communication
and serial communication. Serial communication has many common ways (RS232, IEEE1394,
etc.). In industrial production, we just need a few signal lines of RS232 to realize duplex
communication between instrument and computer. Considering the data size and the distance
of control, we choose RS232 as our physical connection [5, 6].
RS232, the signal voltage of which referenced to a system ground, operates in full-
duplex mode, and it can transmit and receive data at the same time. In this paper, pin2 (RXD),
pin3 (TXD) and pin5 (GND) are used (Table 2). The pin2, 3 of instrument are cross-linked to the
pin3, 2 of computer, and the pin5 of both are linked directly. With this connection mode, the two
communication sides can be regarded as data terminal equipments, and then both of them can
transmit and receive data.
Star
Address check
N
Address correct? Alarm indication
The finish of configuring the serial port just proves the establishment of the channel, but
the conduction of the channel bases on whether the address is confirmed successfully or not.
The main part of the program is illustrated in Figure 3.
The commands received and transmitted in this paper are all shown in hexadecimal
directly, which is the simplest way to write in a hexadecimal string in LabVIEW [7]. There is a
gap in time between the write command and the read, the length of which depends on the
instrument’s ability of data processing and always lies from several ten milliseconds to several
seconds. As LabVIEW supports multithreaded application design and executes code in an
inherently parallel rather than sequential manner, we can put the time delay (200ms) or create a
sub-VI into a flat sequence structure to solve this problem (Figure 3).
Figure 3.
3 LabVIEW Program
Two pneu umatic meassuring instrum ment’s comm mends, 08H (receive-mea asured value e) and
0FH (receive-maxximum tolera ance), are sh hown in Figu ure 3, and th he process o of transmitting and
receivving data is the key part of the whole e program, during
d which exists rigoro ous order between
the two
t comman nds, that is to say, the e second re ead-in comm mand must ffollow behin nd the
comp pletion of gettting the retu
urned value from buffer cache in the e first comma and [8]. Fac ctually,
theree are two ma ain methods to realize se equential exe ecution in La abVIEW: erro or cluster lin
ne and
seque ence structu ure. the preco ondition of method
m of se
equencel stru ucture is tha at all codes should
s
be written
w in the
e same bran nch, which exists
e an lim
mitation due to some m more sophisticated
progrrams, howevver, the meth hod that sele ecting error cluster
c line to
o connect an nd guide data flow
helpss to change the order of o execution sequence more m simply. As to the iinstrument controlc
needing address check, transsmitting the second
s commmand directlyy without add dress check is not
allow
wed, which means the verrification is needed betwe een any two commands.
The result data return ned from the e channel is a 4-byte he exadecimal sstring. We ha ave to
conve ert it to a byte
b array fiirst, and the
en we separate the datta by “indexx array.VI” [9]. [ In
LabV VIEW, a inde ex starts witth 0, rather than1, so th he indexs of o 0-3, represent four de ecimal
nume erals transformed by low w byte, midd dle byte , hig gh byte and d 0FFH from m the hexade ecimal
string
g, and finally the result daata is calcula
ated through the formula which is givven in the pre evious
chaptter.
Display and
a save daata in real-tim
me is benefiicial to analyyse the resu ult, and it is more
conve enient to be achieved with LabVIEW W, compared with other te extual progra amming langu uages
(Fig.44). To displayy the data,we bundlen it from differen nt structures by name an nd then send it into
a wavveform chartt, which can n turn the da ata into wave eforms And display
d themm without any yother
opera ation; In the process of thhe data stora age, we need pay attention to that w we must build d a 1D
arrayy before we connect it to o “write to spreads file.v vi”; In order to make the e system ope erates
autommatically, we e use a while e loop [10], but the false e branch of the case strructure in the e loop
also outputs
o useless defaults, which we do d not want to t save in ou ur final file, sso we use an nother
csae structure to display the useless defa aults in the false
f branch,, and hide th he waveform m chart
which h used to dissplay them inn front panel.
5. Coonclusion
A system m has been n developed by graphic cal languagee, which bre eaks throug gh the
limita
ation of textu
ual programiing language
e, such as poor
p extensibility, complexity in rela
ations,
structtural redunddancy and managemen nt difficulty. By controllling a pneu umatic meas suring
Desiign of Instrum
ment Controll System Bassed on LabV
VIEW (Jiang Chao)
3432 e-ISSN: 2087-278X
instrument in reality, we can find that the instrument control system based on LabVIEW is with
good scalability, and can be transplanted into other industrial control systems easily.
Acknowledgements
This work was financially supported by the Guangxi Science Research and Technology
Development Program (No. 12118015-7B, 10100026), and the Advanced Design and
Manufacturing Technology of Vehicle Components Foundation of Guangxi Province, China (No.
2012KFMS08, 2012KFZD02).
References
[1] Hu Zhao-hui. Research of Multipoint Pressure Measurement Method in Wind Tunnel System Based
on LabVIEW. Popular Science & Technology. 2012; 149(5): 50-51.
[2] Luo Guang-kun, Yang Hao, Huang Wei-gong. DAQ System Based on LabVIEW and Microcontroller
Serial Port. Instrumentation Technology. 2002; 5(1): 14-16.
[3] Ying Liu, Yan Tao-zhu, Yu Rong-li, Chao Ni. The Embedded Information Acquisition System of
Forest Resource. TELKOMNIKA Indonesian Journal of Electrical Engineering. 2012; 10(7): 1843-
1848.
[4] Xue Feng-liu, Jing Zhu, Jian Hua-mao, Xiao Ming-shao, Long Long-lu. Design of Real-time
Communication Adapter for Different Protocol Sensors in Sensor Web. TELKOMNIKA Indonesian
Journal of Electrical Engineering. 2012; 10(5): 1101-1105.
[5] Xu Xiao-dong, Zheng Dui-yuan, Xiao Wu. Analysis of Common Frequently-used Functions and
Programing Instances Based on LabVIEW 8.5. First Edition. Bei Jing: Publishing House of
Electronics Industry. 2009: 332-338.
[6] Gao Fu-xing, Cao Jie, Cui Xiu-li. Design and Implementation of An Embedded RS232/internet
Gateway. Chinese Journal of Scientific Instrument. 2006; 27(z3): 28-32.
[7] Chen Xue-shu, Liu Xuan. A Valuable Book of LabVIEW. Fourth Edition. Bei Jing: Publishing House of
Electronics Industry. 2012: 139-144.
[8] zhang Hong-xian, Xu Wu-bin, Chen Qi-bing. Experimental Design of the Hydrodynamic Bearing-rotor
System Based on LabVIEW. Journal of Guangxi University of Technology. 2011; 22(2): 28-32.
[9] Xu Jian. Design of Multi-channel Data Acquisition System Based on LabVIEW. Master Thesis.
Jiangsu: Jiangsu University of Science and Technology; 2008.
[10] Dr Cor J. Kalkman, MD,PhD. LabVIEW: A Software System for Data Acquisition, Data Analysis, And
Instrument Control. Journal of Clinical Monitoring. 1995; 11(5): 51-58.