外文文献翻译-VB知识讲解

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

communication method of computer and total-station

instruments of data at VB environment [Summary]

this text mainly inquiry in to carried out communication between computer and the total-station instrument data under VisualBasic6.0(call VB as follows) environments. Two kinds of communication methods: the usage mscomm control and the function of windows API. The application that also combined a solid example to carry out their string to go communication Procedure and step. Finally carried on comparison and summary to two kinds of methods.

[Keyword]

Visual Basic 6.0 data communication the mscomm control

All of the electronics total-station instrument because its function is strong and operate convenience and consumedly raised an open country homework efficiency. Therefore it just and gradually replace traditional diagraph instrument and it is expanded for an application. Although making use of the system menu function of total-station instruments can immediately complete normal regulations diagraph, monitor in the big dam safety, side the ascent transform a monitor etc. this kind of data is a little bit greatly and need solid the applied situation of processing data, it is will not satisfy demands only by function and amount of memory of instrument. The data at this time can be output a computer by the instrumental data exportation port, and the data can be processed and saved by software. Along with the extensive usage of calculator, many local open country digatial measure diagram method also need to carry out real-time transport. VB is released by the Microsoft company of according to visual programming language, its adoption faces to the program design method that object, affairs drives and operate simple, therefore doubly be subjected to program design personnel's favor.Underneath with Leica Tc 2002 whole station instrument for example, introduce how to carry out the communication between computer and total-station in the VB 6. 0 environment by making use of mscomm and the function of Windows API

One,usage MSComm control a piece VB 6.0

provided an ActiveX to control Communication of a Microsoft Control, brief name MS Common controlled a piece, customer can at own of imbed MSComm to control a piece in the applied procedure, should control a piece to deliver and receive a data through a string of line port, for applied the procedure provide a string of line communication function. Choose VB 6.0"engineering" menus, open "parts" dialog

box, pick out Microsoft Comm Control 6.0, can immediately control the piece to the mscomm and add a box of controlling of person VB. The mscomm that may use controls the attribute of piece to have several followings:

The CommPort: the constitution string go slogan;

Settings: constitution string the line communication parameter;

Portpopen: constitution or return to a string of communication appearance of;

InputMode: the constitution put off to a later time blunt area to read numeral format;

Input: from receive buffer area to read data;

Output: Write a number toward the buffer area according to:

In Buffer Size: receive the size of buffer area;

Out Buffer Size: send out the size of buffer area;

Out Buffer Count: send out the word stanza of buffer area number;

Input Len: constitution or return to Input to read the word stanza of each time number;

MS Comm controls the way that the piece provided two kinds of processings string communication: search method and affairs drive I/O method. Searching a way is direct and be easy to comprehension, but take up for a great deal of CPU time;The affairs drives a way from Windows 98 notice applied the procedure some affairs when take place, then according to the matter taken place The feeling comes to carries on an operation to the string. These two kinds of methods each beneficial fraud and oneself apply of realm, so in the different correspondence system, can according to the dissimilarity's requesting adoption different technique. In the middle of monitoring system, because of the contingency and request transmission data of affairs of solid sex, the calculator often adopts affairs to drive I/O method to carry on the spot monitor. It uses a step for:

1, open the port that needs to carry on communication, accept for communication and send out a data brigade the row assign memory area.

2, carry on a beginning to start to turn to the communication port, lead especially such as the wave, strange accidentally the school check, data, stop etc..

3, carry on reading and writing an operation to the communication port.

4, such as the be over string go communication, the close beats to rise of communication port.

For example, control Leica with the calculator when the Tc2002 whole station instrument auto measure writing the following code can nicely carry out two of communication:

The MS CommlCOmmPort=1'the constitution string go a communication

The MS CommlSettings=''2400, e.7, IP1'constitution wave especially rate, strange accidentally check a school, data number and stop number

相关文档
最新文档