Professional Documents
Culture Documents
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.