You are on page 1of 4

2009 International Conference on Networks Security, Wireless Communications and Trusted Computing

The Research of Bluetooth Wireless Communication Network in NC System


WANG kun-qi WANG peng WANG ya-nan
Machinery-Electronic Department
Xi’an Technological University
Xi’an, China
wangk550@126.com
wangpeng06070@sina.com
wangyanan1984@qq.com
Abstract—a new method that Bluetooth wireless communication C. A new method is proposed. Process data are obtained
network applied in all-software NC system is proposed to diagnose saved in PDA (personal digital assistant) in virtue of Bluetooth
the fault in NC system. NC system is connected with PDA by virtual technology. The fault of machine tool can be diagnosed by
serial port technology. Virtual serial port in PC is directly accessed complete information in PDA. The efficiency is raised in
with NT port software. The information of NC machine, including diagnosing fault in no alarm signal.
NC code, cutter location data and so on, is regularly accessed from
top-level application program by wireless communication module
with timer component in C++Builder6. Bluetooth wireless II. SYSTEM ANALYSIS
communication system is embedded in all-software NC system based Bluetooth technology is a kind complex wireless
on windows OS by above-mentioned method. Sending data module communication technology. The complicacy of Bluetooth
program in Bluetooth wireless communication system is designed in shows not only hardware but also protocol. The research of
C++Builder6. Receiving data module program is compiled by evb3.0
in PDA. The information of NC machine is saved as the Access file
technical route is very crucial link to data link of Bluetooth [2].
in PDA database by ActiveSync software. In the experiment based Three technical plans are proposed in this paper.
on the method above, PC is connected with PDA by virtual serial A. The exploitation of system is finished based on
port. Process information is successfully transferred to PDA While independently exploiting protocol stack blow HCI and
NC system is running.
Key words-Bluetooth; wireless network; all-software NC System;
upper communication protocol, including system control,
serial communication.  sending module and receiving module.

I. INTRODUCTION B. The communication system is exploitation by fully-


fledged Bluetooth platform, which is designed by third
The reliability of NC system directly effects on the natural
party.
running of machine. In normal situation, all NC system has the
function of self-diagnosis [1]. When fault appears, NC system C. The Bluetooth communication system is designed in
generates alarm signal. Alarm signal will be examined
virtue of full-fledged Bluetooth adapter and protocol stack.
according to instruction, some faults can be removed. But
some faults are removed according to instruction and At last, the third plan is adopted by compared and analysis.
parameters of machine. When the Performance of machine Figure 1 shows communication principle, as in [3].
brings down in practical manufacture, some other machine Application program Application program
faults appear, but no alarm signal. For example, when the
pressure of hydraulic pressure in NC drill machine decreases, RFCOMM RFCOMM
losing pressure doesn’t influence the process of drilling and L2CAP L2CAP
also doesn’t generate alarm signals. With time going by,
machine tool so locates in endangerment long time that it will HCI HCI
reduce the life of machine tool. If machine tool is suddenly Bluetooth hardware Bluetooth hardware
halt, it will be impossible to diagnose fault according to
existing alarm signal in NC system. Thus, NC system should
Figure 1. Communication schematic diagram
be checked and maintained on the industrial field while the
fault information is given by the way of parameter. Aiming at PDA (Personal Digital Assistant) is accepting terminal and
duly checking and maintaining in NC system, many plans are controlling terminal. Main functions include distinguishing
proposed in order to solve this problem. Plans as follow: network, data transmission, data display, saving database,
A. Many NC machine tools are connected by wire network. invoking data. Figure2 shows the structural diagram of
CAD, CAM, checking and maintaining are achieved in Bluetooth wireless communication system.
computer room. If above-mentioned options are carried out in
field, a networking computer will be added. It’s inconvenient. Bluetooth USB dongle NC PDA

B. Upper computer and lower computer are adopted. Lower


computer is used as NC system. Upper computer is used as NC machine
monitoring aids in field. An additional computer is added. Thus,
peripheral equipment is added around NC machine.

Figure 2. The structure of Bluetooth wireless communication system


Bureau of Science and Technology of Shaanxi Province for supporting of
Foundation (2002k06-G16)
Bureau of Education of Shaanxi Province for supporting of Foundation
(2002JC25)
Foundation of key subject construction of Shaanxi Province

978-0-7695-3610-1/09 $25.00 © 2009 IEEE 766


DOI 10.1109/NSWCTC.2009.343

Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on May 19, 2009 at 04:08 from IEEE Xplore. Restrictions apply.
III. RECEIVEING NC PROCESS DATA IN MAIN THREAD B. The design of communication software in NC system
The work manner of foreground and background is adopted The communication of virtual serial port is achieved by
in all-software NC system. Receiving external interruption two manners: (1) API (Windows Application Program
signal, controlling output of servo impulse and interpolation Interface) function call. (2) Using Mscomm components of
are designed in background program by WDM (Windows Microsoft Visual Studio 6.0. It is difficult to declare and call
Device Model) [4].The interface program is designed in top- many API function in first method. The former is inconvenient.
level application program. The later is adopted. Code as follows:
Because accepting and sending are set up before data link. void __fastcall TForm4::Button1Click(TObject *Sender) //the
Thus, the setting up Wireless communication need more time. initialization of serial port
Two times delay generate in a concrete link. First, The { MSComm1->CommPort=9; //choosing port
running program in PDA searches NC machine tool to number
construct Piconet. Second, NC system accepts requirement MSComm1->PortOpen=true; //confirming port
and feedbacks link report to user. Wireless communication open
module is implemented in NC system. The sending data has MSComm1->Settings="9600,N,8,1"; // setting port}
not only ample link time but also not influencing NC system The data struck of SAFEARRAY is used in this paper.
normally running. Two methods are proposed in this paper. __fastcall BT::BT() //creating SafeArray
{PAddress=0;
A. Process data is gained Real-time. FrameSize=152;
B. Process data is gained by timing. pb=NULL;
SafeArrayBOUND rgsabound[1];
By experiment, if data is Real-time collected, NC system rgsabound[0].lLbound=0;
will fall into endless loop. Thus, the first method leads to rgsabound[0].cElements=FrameSize;
system halted. The second method is adopted. pSA=SafeArrayCreate(VT_UI1,1,rgsabound);
If feed speed in NC system is 0.01mm/s, process data is }
obtained at interval 10s. Table1 shows experimental data. The data is saved in SAFE ARRAY, before data is send.
TABLE I. READING PROCESS DATA FROM MAIN THREAD Then, the data format is transformed as VARIANT variable by
OleVariant() function which is constructed. At last, data is
Data gathered NC Processing position data send by setting the property of Output. Code as follows:
point Group 1 Group 2 Group 3 bool BT::BTSend()
The first point 0.523mm 0.452mm 0.321mm { m_vt.vt=VT_ARRAY|VT_UI1//transmitting data to variable
The second m_vt.parray=pSA;
0.623mm 0.552mm 0.421mm
point
The third point 0.723mm 0.652mm 0.521mm Form1->MSComm1->Output=(OleVariant(m_vt)); //
The fourth point 0.823mm 0.752mm 0.621mm Struck of SafeArray in m_vt variable to VARIANT variable
The fifth point 0.923mm 0.852mm 0.721mm return true;}
Process speed 0.01mm/s 0.01mm/s 0.01mm/s The sending program of NC process data is achieved by
Interval time 10s 10s 10s above-mentioned method.
IV. THE DESIGN OF COMMUNICATION SYSTEM PROGRAM C. The design of communication software in PDA
Figure 4 shows the communication flow chart in PDA.
A. The flow chart of software
Fig 3 shows the communication flow chart in PC. Start

Search machine
Start
N
Link
Y
Open virtual Receive
serial port
Data backup

N Display data
Search
PDA Y N
Exist fault
N
Y Another
Fault analysis N
Send data program Another
Y
Y
End
End

Figure 3. The communication flow chart in NC based on PC Figure 4. The communication flow chart in PDA

767

Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on May 19, 2009 at 04:08 from IEEE Xplore. Restrictions apply.
The data accepted software is designed in PC by Bluetooth adapter is inserted PC by USB interface.
embedded Visual Basic which is exploited by Microsoft COM10 in PC is successfully connected with PDA after
Company. Then, the software is installed in PDA database by Bluetooth drive program is installed, as in figure 7 and figure
ActiveSync software. Code as follows: 8.
ĂĂĂĂĂĂĂĂ
rStr = Comm1.Input
Select Case pos
Case 1
lbx.Caption = rStr ĂĂĂĂ
Case 15
lbpr.Caption = rStr
End Select Figure 7. Bluetooth drive program interface
pos = pos + 1
If pos = 16 Then
ĂĂĂĂĂĂĂĂĂĂ
The data is saved in database after the data is accepted.
Figure 8. Two virtual serial ports are successfully connected
First, a database is set up in Access. Second, the database
is saved as (*.mdb).the Access file is copied in PDA to The information of NC machine is regularly accessed
transform to (*.mdb) by ActiveSync software [4]. from top-level application program by wireless communication
An array database is supplied in Embedded Visual BasiF, module with timer component in C++Builder6. Fig 9 shows
including Connection object, Record set object, Field object machine tool data are accessed from display module.
and Error object. The options of database become convenient
by these objects, addition, delete, requiring and so on included.
Code as follows:
Open database file
ĂĂĂĂĂĂ
connOpen = TrueIf conn Is Nothing Then
Set conn = CreateObject("ADOCE.Connection.4.0")
conn.Open DBFilename
If conn.Errors.Count > 0 Then
MsgBox "errors in connOpen", vbOKOnly Figure 9. Receiving machine tool data from display module
connOpen = False
Figure 5 shows virtual serial port connection. Process data are transmitted from PC to PDA after
connecting them in virtue of virtual serial port and NT port software.
V. EXPERIMENT
Fig 10 shows Process data are transmitted.
According to the method above, a Bluetooth wireless
communication network is created in NC system.
Receiving data module program is installed in PDA database
by ActiveSync software. Fig 5 shows receiving data module
software is installed in PDA. Fig 6 shows choosing virtual
serial port number.
Figure 10. Interface of application software experiment

VI. CONCLUSION
In this paper, a new method that the technology of
Bluetooth wireless communication network applied NC
Figure 5. Receiving data module setup system is proposed to diagnose the fault in NC system.
The Bluetooth piconet between NC system and PDA is
set up based on virtual serial port technology, NT port
software technology and USB dangle. Designing and
programming to wireless communication module, the
information of NC machine, including NC code, cutter
location data and so on, is regularly accessed from top-level
application program by wireless communication network
embedded in all-software NC system based on windows OS.
Figure 6. Choosing virtual serial port numbers

768

Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on May 19, 2009 at 04:08 from IEEE Xplore. Restrictions apply.
Receiving data module program which is designed in PC
by evb3.0 is installed in PDA by ActiveSync software. In the
experiment, PC is successfully connected with PDA after
Bluetooth adapter drive program is installed in PC in virtue of
virtual serial port technology. The process information is
accessed from display module in NC system with timer
component in C++Builder6. Process data are transmitted from
PC to PDA to increase maintainable efficiency while NC
system is running. The method is feasible as showing in the
experiment.
ACKNOWLEDGMENT
It is a great pleasure to thank Bureau of Science and
Technology of Shaanxi Province for supporting of Foundation
(2002k06-G16) and Bureau of Education of Shaanxi Province
for supporting of Foundation (2002JC25).
Authors also acknowledge the support of the foundation
of key subject construction of Shaanxi Province.

REFERENCES
[1] LEI xu-sheng, ZHANG luo-ping, LI ji-shun. “The format and
achievement of system of NC machine remotely fault diagnosed”.
Machinery-Electronic, PP. 49–51,vol 18, June 2001.
[2] YAN zi-jian, LIU yuan-an. “Bluetooth technology”.Beijing, the
publisher of Beijing University of Posts and Telecommunications.2001,
pp. 25–28.
[3] MA jian-cang, LUO ya-jun. “The application of Bluetooth technology ”.
Beijing, Science publisher, 2003
[4] LI yong-long, “Program design in PDA”.Beijing,the piblisher Qing Hua
University. 2002, pp. 17–19.

769

Authorized licensed use limited to: VELLORE INSTITUTE OF TECHNOLOGY. Downloaded on May 19, 2009 at 04:08 from IEEE Xplore. Restrictions apply.

You might also like