CN102279831A - Automatic registering method of serial communication terminal - Google Patents

Automatic registering method of serial communication terminal Download PDF

Info

Publication number
CN102279831A
CN102279831A CN201110226508XA CN201110226508A CN102279831A CN 102279831 A CN102279831 A CN 102279831A CN 201110226508X A CN201110226508X A CN 201110226508XA CN 201110226508 A CN201110226508 A CN 201110226508A CN 102279831 A CN102279831 A CN 102279831A
Authority
CN
China
Prior art keywords
communication terminal
serial
serial communication
host computer
serial ports
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201110226508XA
Other languages
Chinese (zh)
Inventor
周晓辉
武斌
陈磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XI'AN GUANGXIANG INFORMATION TECHNOLOGY CO., LTD.
Original Assignee
XI'AN HUIWEI INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XI'AN HUIWEI INFORMATION TECHNOLOGY Co Ltd filed Critical XI'AN HUIWEI INFORMATION TECHNOLOGY Co Ltd
Priority to CN201110226508XA priority Critical patent/CN102279831A/en
Publication of CN102279831A publication Critical patent/CN102279831A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses an automatic registering method of a serial communication terminal. In the field of serial communication, when the serial communication terminal is connected with an upper computer through a serial interface, the upper computer sends a handshaking request to all available serial interfaces according to available serial interface information prestored in a storage unit, if at least one serial interface feeds back a handshaking response, the upper computer is successfully handshaked and communicated with the serial communication terminal connected below the serial interface, and the serial interface information is deleted from the available serial interfaces stored in the storage unit. After the communication is established successfully, the serial communication terminal can send registering information cured in the serial communication terminal to the upper computer for registration, the upper computer stores the registering information of the serial communication terminal and information of the serial interface connected with the serial communication terminal into the storage unit of the upper computer, thus the serial communication terminal is automatically registered. The invention has the technical effects of greatly saving equipment debugging time and simplifying debugging program.

Description

A kind of serial communication terminal automatic registration method
Technical field
The present invention relates to communication technical field, particularly terminal device automatic registration method in the serial communication.
Background technology
At present, at instrument and meter and communication technical field, particularly use under the situations such as serial communication equipment is debugged, operation, usually need in equipment manager, check serial ports that computing machine has manual unlocking successively, causing the reduction and the insignificant duplication of labour of work efficiency, will be a no small workload if there are a lot of equipment to connect simultaneously.
Summary of the invention
The objective of the invention is to overcome the deficiencies in the prior art, a kind of serial communication terminal automatic registration method is provided, its step is as follows:
At first, in serial communication terminal and host computer, pre-install Handshake Protocol respectively, in the serial communication terminal, solidified the log-on message of this serial communication terminal simultaneously;
When the serial communication terminal connects host computer by serial ports, host computer is according to the available Serial Port Information that is pre-stored in storage unit, send handshake request to all available serial ports, if having the serial ports feedback of at least one to shake hands replys, then shake hands successfully, and set up with the serial communication terminal that this serial ports is connected down and to communicate by letter, delete in the available serial ports that this Serial Port Information is stored from storage unit simultaneously;
After communication is set up successfully, the serial communication terminal can send to host computer in log-on message wherein and registers solidifying, host computer is stored in the storage unit of host computer in the lump with the information of the log-on message of serial communication terminal and the serial ports that connected thereof, and registration is finished automatically.
Further, aforesaid serial communication terminal automatic registration method, the judgement of wherein said available serial ports is as follows:
Host computer is opened all serial ports successively, if can successfully be opened, illustrates that this serial ports can use, and the storage unit that simultaneously the string slogan of available serial ports is kept at host computer is standby.
Described serial communication terminal automatic registration method wherein also comprises:
After a serial communication endpoint registration was finished, host computer can repeat to send a handshake request to all available serial ports, if shake hands response feedback, and the then renewal of registration, otherwise, finish.
Described log-on message comprises at least a in the address, product type, production code member, firmware version number, product producer of communication terminal.
As preferred version serial communication terminal automatic registration method, host computer receives that the response time of shaking hands of serial communication terminal is between 0 millisecond to 5000 milliseconds.
As preferred version serial communication terminal automatic registration method, host computer receives that the response time of shaking hands of serial communication terminal is between 0 millisecond to 500 milliseconds.
As preferred version serial communication terminal automatic registration method, all serial ports numbers of host computer self are no less than 1.
As preferred version serial communication terminal automatic registration method, all serial ports numbers of host computer self are 2 to 10.
Described Handshake Protocol is as follows:
Serial communication terminal and host computer communication protocol are the ASCII character of 10 byte regular lengths, and protocol format is: AAA#BBB#CC, and wherein AAA is an instruction type, and BBB is operation, and CC is a parameter, and # is a blank character, can not have.
Instruction type comprises two kinds: CMD and DAT, CMD representative sends is instruction, the transmission of DAT representative be data.
When beginning to shake hands, host computer sends to the serial communication terminal:
CMD#CHK#00 represents whether host computer inspection serial communication terminal is normal;
After the serial communication terminal is received instruction, if the serial communication terminal normally sends to host computer:
CMD#CHK#OK ;
If the serial communication terminal is wrong, send to host computer:
CMD#ERR#XX?;
Annotate: XX is an error code.
Receive the CMD#CHK#OK of serial communication terminal transmission when host computer after, send Address requests to the serial communication terminal:
CMD#ADD#RE?;
When the serial communication terminal is received Address requests, send:
CMD#ADD#XX;
Annotate: XX is the ASCII character address, serial port terminal device address 00-99;
Host computer sends the log-on message request code to the serial communication terminal:
CMD#VER#RE;
When the serial communication terminal is received above-mentioned request, send:
CMD#?VER?#XX;
Annotate: XX is the ASCII character address, serial communication terminal code 00-99;
Host computer is to serial communication terminal transmits data request code:
CMD#REQ#XX;
Annotate: XX is the request of ASCII character data type;
When the serial communication terminal is received request of data, send the data length bag:
DAT#NUMXXX;
Annotate: XXX is an ASCII character packet number;
Next serial communication terminal transmission length is 10 packet, sends the back that finishes and sends:
CMD#DAT#OK;
The expression data send and finish.
Description of drawings
The process flow diagram of Fig. 1 embodiment of the invention 1.
The process flow diagram of Fig. 2 embodiment of the invention 2.
Embodiment
The present invention will be further described below in conjunction with embodiment.
Embodiment 1
Shown in Fig. 1, the serial ports number of the host computer in the present embodiment is 10, logic flow of the present invention is as follows: the host computer start is to start to open own serial ports according to serial ports number preface, if can successfully be opened, illustrate that this serial ports can use, after serial ports all is opened, judge whether the string slogan of opening for the last time is 10, if host computer is standby with the storage unit that the string slogan of available serial ports is kept at host computer, otherwise return step S101.When the serial communication terminal connects host computer by serial ports, host computer is according to the available Serial Port Information that is pre-stored in storage unit, send handshake request to all available serial ports, if having the serial ports of at least one to shake hands 500 milliseconds of internal feedbacks replys, then shake hands successfully, and set up communication with the serial communication terminal that this serial ports is connected down.Delete in the available serial ports that this Serial Port Information is stored from storage unit simultaneously, otherwise repeat this step S104.
After communication is set up successfully, the serial communication terminal can send to host computer in log-on message wherein and registers solidifying, host computer is stored in the storage unit of host computer in the lump with the information of the log-on message of serial communication terminal and the serial ports that connected thereof, and registration is finished automatically.
After a serial communication endpoint registration was finished, host computer can repeat to send a handshake request to available serial ports, if shake hands response feedback, then returns step S104, otherwise, enter step S109, the log-on message of the statistics and the equipment of preservation.
Embodiment 2
Shown in Fig. 2, the serial ports number of the host computer in the present embodiment is 2, logic flow of the present invention is as follows: the host computer start is to start to open own serial ports according to serial ports number preface, if can successfully be opened, illustrate that this serial ports can use, after serial ports all is opened, judge whether the string slogan of opening for the last time is 2, if host computer is standby with the storage unit that the string slogan of available serial ports is kept at host computer, otherwise return step S201.When the serial communication terminal connects host computer by serial ports, host computer is according to the available Serial Port Information that is pre-stored in storage unit, send handshake request to all available serial ports, if having the serial ports of at least one to shake hands 200 milliseconds of internal feedbacks replys, then shake hands successfully, and set up communication with the serial communication terminal that this serial ports is connected down.Delete in the available serial ports that this Serial Port Information is stored from storage unit simultaneously, otherwise repeat this step S204.
After communication is set up successfully, the serial communication terminal can send to host computer in log-on message wherein and registers solidifying, host computer is stored in the storage unit of host computer in the lump with the information of the log-on message of serial communication terminal and the serial ports that connected thereof, and registration is finished automatically
After a serial communication endpoint registration was finished, host computer can repeat to send a handshake request to available serial ports, if shake hands response feedback, then returns step S204, otherwise, enter step S209, the log-on message of the statistics and the equipment of preservation.
Embodiment 3
Present embodiment is a kind of software program that utilizes method of the present invention to finish, said procedure operates in the host computer, this program not only can be finished technique effect of the present invention, the Serial Port Information of host computer can also be reported to operating personnel by man-machine interface simultaneously.
When the serial ports automatic identification procedure moves, open on the computing machine serial ports 1 at first respectively to serial ports 20, if opening, serial ports illustrates that successfully serial ports exists and do not have occupied.After the been scanned, available serial ports is preserved storage unit.Afterwards, program can be opened available serial ports successively, and sends handshake request, replys if receive shaking hands of serial communication terminal in 1000 milliseconds, then thinks and communicates by letter successfully.Shake hands after the success, the serial communication terminal sends the address to host computer, registers on host computer, and host computer is also preserved the Serial Port Information of this equipment connection simultaneously, finishes automatic identifying.Host computer among this embodiment is an X86 framework PC.Software development environment Microsoft Visual Studio 2008; Programming language is a C# language.This program major function and characteristics: this program is applied to various serial communication equipment, obtains the Serial Port Information of connection device automatically.Characteristics such as this program has simply, and is easy to operate have also been saved people's working time simultaneously greatly, have saved human cost.
The above, it only is preferred embodiment of the present invention, be not that the present invention is done any pro forma restriction, though the present invention has disclosed with preferred embodiment as is above-mentioned, yet be not to be used to limit the present invention, any those skilled in the art, in not breaking away from technical scheme scope of the present invention, can utilize the technology contents of above-mentioned disclosure to make the equivalent embodiment that a little change is considered as equivalent variations, all contents that does not break away from technical solution of the present invention, according to technical spirit of the present invention above embodiment is made any simple modification, equivalent variations and modification all belong to technical scope of the present invention.

Claims (8)

1. serial communication terminal automatic registration method, its step is as follows:
In serial communication terminal and host computer, pre-install Handshake Protocol respectively, in the serial communication terminal, solidified the log-on message of this serial communication terminal simultaneously;
When the serial communication terminal connects host computer by serial ports, host computer is according to the available Serial Port Information that is pre-stored in storage unit, send handshake request to all available serial ports, if having the serial ports feedback of at least one to shake hands replys, then shake hands successfully, and set up with the serial communication terminal that this serial ports is connected down and to communicate by letter, delete in the available serial ports that this Serial Port Information is stored from storage unit simultaneously;
After communication is set up successfully, the serial communication terminal can send to host computer in log-on message wherein and registers solidifying, host computer is stored in the storage unit of host computer in the lump with the information of the log-on message of serial communication terminal and the serial ports that connected thereof, and registration is finished automatically.
2. serial communication terminal automatic registration method according to claim 1, the judgement of wherein said available serial ports is as follows:
Host computer is opened all serial ports successively, if can successfully be opened, illustrates that this serial ports can use, and the storage unit that simultaneously the string slogan of available serial ports is kept at host computer is standby.
3. serial communication terminal automatic registration method according to claim 1 and 2 wherein also comprises:
After a serial communication endpoint registration was finished, host computer can repeat to send a handshake request to all available serial ports, if shake hands response feedback, and the then renewal of registration, otherwise, finish.
4. serial communication terminal automatic registration method according to claim 1, described log-on message comprise at least a in the address, product type, production code member, firmware version number, product producer of communication terminal.
5. serial communication terminal automatic registration method according to claim 1, host computer receive that the response time of shaking hands of serial communication terminal is between 0 millisecond to 5000 milliseconds.
6. serial communication terminal automatic registration method according to claim 5, host computer receive that the response time of shaking hands of serial communication terminal is between 0 millisecond to 500 milliseconds.
7. serial communication terminal automatic registration method according to claim 1 and 2, all serial ports numbers of host computer self are no less than 1.
8. serial communication terminal automatic registration method according to claim 7, all serial ports numbers of host computer self are 2 to 10.
CN201110226508XA 2011-08-09 2011-08-09 Automatic registering method of serial communication terminal Pending CN102279831A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110226508XA CN102279831A (en) 2011-08-09 2011-08-09 Automatic registering method of serial communication terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110226508XA CN102279831A (en) 2011-08-09 2011-08-09 Automatic registering method of serial communication terminal

Publications (1)

Publication Number Publication Date
CN102279831A true CN102279831A (en) 2011-12-14

Family

ID=45105288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110226508XA Pending CN102279831A (en) 2011-08-09 2011-08-09 Automatic registering method of serial communication terminal

Country Status (1)

Country Link
CN (1) CN102279831A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536926A (en) * 2014-12-22 2015-04-22 深圳市科漫达智能管理科技有限公司 Control method and device of serial devices
WO2018039879A1 (en) * 2016-08-29 2018-03-08 深圳市华阳信通科技发展有限公司 Serial port data sequence keeping method and system
CN107967229A (en) * 2017-12-22 2018-04-27 安徽博微长安电子有限公司 A kind of serial ports automatic identifying method, system and computer-readable recording medium
CN108509366A (en) * 2018-03-22 2018-09-07 成都泰盟软件有限公司 A kind of embedded intelligence serial port implementing method
CN111010286A (en) * 2019-11-11 2020-04-14 杭州中恒电气股份有限公司 Intelligent registration method and device based on serial bus, electronic equipment and medium
CN111913894A (en) * 2020-08-18 2020-11-10 广州市紫晶通信科技有限公司 Serial port configuration method and device and IEC61850 protocol converter
CN114301992A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Data transmission method and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536926A (en) * 2014-12-22 2015-04-22 深圳市科漫达智能管理科技有限公司 Control method and device of serial devices
CN104536926B (en) * 2014-12-22 2018-05-01 深圳市科漫达智能管理科技有限公司 The control method and device of serial equipment
WO2018039879A1 (en) * 2016-08-29 2018-03-08 深圳市华阳信通科技发展有限公司 Serial port data sequence keeping method and system
CN107967229A (en) * 2017-12-22 2018-04-27 安徽博微长安电子有限公司 A kind of serial ports automatic identifying method, system and computer-readable recording medium
CN108509366A (en) * 2018-03-22 2018-09-07 成都泰盟软件有限公司 A kind of embedded intelligence serial port implementing method
CN111010286A (en) * 2019-11-11 2020-04-14 杭州中恒电气股份有限公司 Intelligent registration method and device based on serial bus, electronic equipment and medium
CN111913894A (en) * 2020-08-18 2020-11-10 广州市紫晶通信科技有限公司 Serial port configuration method and device and IEC61850 protocol converter
CN114301992A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Data transmission method and storage medium

Similar Documents

Publication Publication Date Title
CN102270168A (en) Method for automatically detecting serial port information
CN102279831A (en) Automatic registering method of serial communication terminal
CN104149717B (en) A kind of long-range noiseless renewal system and method for car load control
CN204759403U (en) System based on data pass realization equipment internal module thoroughly and upgrade
CN100367235C (en) Method for realizing automatic test and its system
CN103019788A (en) Remote online upgrading method based on CAN (Controller Area Network) bus
CN106851626B (en) The realization device and method of Android system batch upgrade under LAN environment
WO2010133051A1 (en) Method and device for auto-adapting wireless data cards of multiple modes
CN109246628B (en) Wireless dispatching desk based on air bus digital trunking system and implementation method
CN104486419A (en) Network firmware updating method based on FT platform
CN103198007A (en) Multi-process log output method and system
CN103095703A (en) Method and equipment and system for achieving data interaction between network and serial port
CN102075389A (en) Debugging method and equipment
CN109302476A (en) A kind of PLC program upgrade method and system based on mobile terminal
CN111427602B (en) Method for upgrading firmware on line of intelligent platform management controller of VPX case
CN104580187B (en) A method of realizing that the external device of different MODULEBUS agreements is interacted with server
CN102571474B (en) Virtualized Radius test macro and method
CN103905498B (en) Service information management method and service information management system
CN104348645A (en) Server and data transmission method of server
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
CN109634856B (en) IOS intelligent terminal remote real machine debugging system and method based on cloud service
CN109725621A (en) A kind of secondary bus program based on 1553B bus and CAN bus is in line writing method
CN102811143A (en) Method and device for monitoring failure of data link layer, and network equipment
CN112416829B (en) Method for transmitting data to HMI (human machine interface) and USB HID (Universal Serial bus) equipment
CN110445642B (en) Communication method for maintaining flight parameter system across buses

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: XI'AN GOSHINE INFORMATION TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: XI'AN HUIWEI INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20131225

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20131225

Address after: 5, N501 building, floor 710075, hi tech innovation building, Xi'an hi tech Zone, Shaanxi, China

Applicant after: XI'AN GUANGXIANG INFORMATION TECHNOLOGY CO., LTD.

Address before: 710075, E, block 508, pioneer research & Development Park, 69 Kam Yip Road, Shaanxi, Xi'an

Applicant before: Xi'an Huiwei Information Technology Co., Ltd.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20111214

WD01 Invention patent application deemed withdrawn after publication