CN104503852A - Multiprocess serial port communication method - Google Patents

Multiprocess serial port communication method Download PDF

Info

Publication number
CN104503852A
CN104503852A CN201410824323.2A CN201410824323A CN104503852A CN 104503852 A CN104503852 A CN 104503852A CN 201410824323 A CN201410824323 A CN 201410824323A CN 104503852 A CN104503852 A CN 104503852A
Authority
CN
China
Prior art keywords
serial port
serial
program
communication module
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
CN201410824323.2A
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.)
HENAN XINAN COMMUNICATION TECHNOLOGY Co Ltd
Original Assignee
HENAN XINAN COMMUNICATION 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 HENAN XINAN COMMUNICATION TECHNOLOGY Co Ltd filed Critical HENAN XINAN COMMUNICATION TECHNOLOGY Co Ltd
Priority to CN201410824323.2A priority Critical patent/CN104503852A/en
Publication of CN104503852A publication Critical patent/CN104503852A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a multiprocess serial port communication method which comprises the following steps that: Step 1, N programs operate a single serial port program and give serial port operation commands, wherein N is a natural number and is equal to or greater than 1; Step 2, the N serial port operation commands given by the N programs wait in line in a serial port program communication module; and Step 3, the serial port communication module transmits the serial port operation commands; after a computer serial port make a response, the serial port program communication module is accessed; the N serial port operation commands waiting in line in the serial port communication module make a response sequentially; and the corresponding N programs are executed according to a response sequence. The method can realize operation of the programs on the single serial port.

Description

A kind of multi-process serial port communication method
Technical field
The present invention relates to a kind of communication means, especially relate to a kind of multi-process serial port communication method.
Background technology
In prior art; often have multiple program to run on computers simultaneously; sometimes need multiple process to operate computer serial port simultaneously; and when multiple process operates computer serial port simultaneously; there will be a process take serial ports handle and other processes cannot be accessed serial ports, cause other programs normally to run.
Summary of the invention
In view of this, the object of the invention is for the deficiencies in the prior art, provide a kind of multi-process serial port communication method, the method can realize multiple program and operate same serial ports.
For achieving the above object, the present invention by the following technical solutions:
A kind of multi-process serial port communication method, comprises the steps:
Step 1, the same serial ports program of N number of procedure operation, sends operation serial port command, and N is natural number, N >=1;
Step 2, N number of operation serial port command that N number of program sends is ranked wait in serial ports interprogram communication module;
Step 3, serial communication modular transmit operation serial port command, after serial ports of computers response, access serial ports interprogram communication module, the N number of operation serial port command waited in line in serial communication modular responds successively, performs corresponding N number of program by the order of response.
As preferably, the time order and function order that N number of operation serial port command of described N number of program sends by operational order in serial ports interprogram communication module is ranked wait.
The invention has the beneficial effects as follows:
When the program of multiple operation serial ports is run, multi-process serial communication program, using the middle layer as procedure operation serial ports, communicates with the serial ports of computing machine, and gives corresponding program by the responsive feedback of serial ports.The invention solves when multiple program needs to access same serial equipment, when the process of a program obtains serial ports handle, cause the problem that other program cannot operate this serial ports, multi-process serial port communication technology can make all programs access a serial equipment simultaneously.
Accompanying drawing explanation
Fig. 1 is process flow diagram of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the invention will be further described.
As shown in Figure 1, the present invention includes following steps:
Step 1, the same serial ports program of N number of procedure operation, each program sends 1 operation serial port command, and N number of program sends N number of operation serial port command altogether, accesses same serial ports, and N is natural number, N >=1.
Step 2, N number of operation serial port command to be ranked wait by the time order and function order sent in serial ports interprogram communication module; Here serial ports interprogram communication module is the multi-process serial ports interprogram communication module software module built.
Step 3, serial communication modular sends serial port command to serial ports of computers, after serial ports of computers response, and access serial ports interprogram communication module, the N number of operation serial port command waited in line in serial communication modular responds successively, performs corresponding N number of program by the order of response.When order 1 responds, perform corresponding program 1, after program 1 is finished, order 2 response, perform corresponding program 2, program N is to the last finished.
The multiple process in prior art that the invention solves there will be a process and takes serial ports handle and other processes cannot be accessed serial ports when operating serial ports of computers, cause the technical barrier that other programs cannot normally be run.The present invention can realize multiple process and operate serial ports of computers simultaneously, and the program of avoiding normally cannot be run and cause deadlock problem.The invention solves a computer and dispose the inconvenience that multiple serial equipment brings and the problem of saving hardware purchase expense.
What finally illustrate is, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, other amendments that those of ordinary skill in the art make technical scheme of the present invention or equivalently to replace, only otherwise depart from the spirit and scope of technical solution of the present invention, all should be encompassed in the middle of right of the present invention.

Claims (2)

1. a multi-process serial port communication method, is characterized in that: comprise the steps:
Step 1, the same serial ports program of N number of procedure operation, sends operation serial port command, and N is natural number, N >=1;
Step 2, N number of operation serial port command that N number of program sends is ranked wait in serial ports interprogram communication module;
Step 3, serial communication modular transmit operation serial port command, after serial ports of computers response, access serial ports interprogram communication module, the N number of operation serial port command waited in line in serial communication modular responds successively, performs corresponding N number of program by the order of response.
2. according to a kind of multi-process serial port communication method described in claim 1, it is characterized in that: the time order and function order that N number of operation serial port command of described N number of program sends by operational order in serial ports interprogram communication module is ranked wait.
CN201410824323.2A 2014-12-26 2014-12-26 Multiprocess serial port communication method Pending CN104503852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410824323.2A CN104503852A (en) 2014-12-26 2014-12-26 Multiprocess serial port communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410824323.2A CN104503852A (en) 2014-12-26 2014-12-26 Multiprocess serial port communication method

Publications (1)

Publication Number Publication Date
CN104503852A true CN104503852A (en) 2015-04-08

Family

ID=52945252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410824323.2A Pending CN104503852A (en) 2014-12-26 2014-12-26 Multiprocess serial port communication method

Country Status (1)

Country Link
CN (1) CN104503852A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475318A (en) * 2020-04-29 2020-07-31 中国人民解放军军事科学院国防科技创新研究院 Serial port communication device, method and system supporting multi-user access

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751291A (en) * 2009-12-30 2010-06-23 广东威创视讯科技股份有限公司 Method of sharing one serial port by application programs and device
CN102446144A (en) * 2010-09-30 2012-05-09 北大方正集团有限公司 Method, device and system for scheduling serial port resources

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751291A (en) * 2009-12-30 2010-06-23 广东威创视讯科技股份有限公司 Method of sharing one serial port by application programs and device
CN102446144A (en) * 2010-09-30 2012-05-09 北大方正集团有限公司 Method, device and system for scheduling serial port resources

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475318A (en) * 2020-04-29 2020-07-31 中国人民解放军军事科学院国防科技创新研究院 Serial port communication device, method and system supporting multi-user access
CN111475318B (en) * 2020-04-29 2021-02-23 中国人民解放军军事科学院国防科技创新研究院 Serial port communication device, method and system supporting multi-user access

Similar Documents

Publication Publication Date Title
JP6503387B2 (en) Numerical control system based on virtual upper equipment
JP6588930B2 (en) Numerical control system and control method based on virtualization technology
JP2013540317A5 (en)
CN105373407A (en) DSP and FPGA online upgrading method for embedded system
CN102567074A (en) USB (universal serial bus) device redirecting method facing virtual machines
CN103019368B (en) A kind of method that local I/O node switches with KVM module intelligence
CN103433926A (en) Multi-robot coordination control device and method
CN102541787A (en) Serial switching using system and method
CN103670457A (en) Real-time monitoring system for hydraulic support on coal mine fully mechanized working face
CN102622136A (en) Multipoint touch system data processing method and device
CN103595773A (en) System performance optimization method based on cloud desktop
CN102929619A (en) Process automation software development system across hardware platform
CN104503852A (en) Multiprocess serial port communication method
CN103699461A (en) Double-host machine mutual redundancy hot backup method
CN107305363A (en) Multi-axis motion controller
CN202267950U (en) Remote upgrading device of embedded devices
CN104416107A (en) Modularized control method for die-forging hydraulic press
CN206906851U (en) Programmable controller with Redundant Control and bootstrap loading function
CN204331449U (en) Based on the SCADA intelligent monitoring dispatching system of GDI
CN204408370U (en) A kind of CAN network monitor diagnostic system
CN204566137U (en) The robot control system of the multiple driver of a kind of compatibility
CN205375150U (en) Realize PLC controlling means at FPGA platform
CN203149551U (en) Over-hardware-platform process automation software development system
CN203911987U (en) Data processing system based on cloud computing
CN104536533A (en) Remote control method and system for interior computer module of interactive smart tablet

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: Kim street 450002 in Henan province Zhengzhou City Hospital No. 7 office building No. 1

Applicant after: HENAN XIN'AN COMMUNICATION TECHNOLOGY CO., LTD.

Address before: Kim street 450002 in Henan province Zhengzhou City Hospital No. 7 office building No. 1

Applicant before: HENAN XINAN COMMUNICATION TECHNOLOGY CO., LTD.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: HENAN XIN'AN COMMUNICATION TECHNOLOGY LTD. TO: HENAN XIN'AN COMMUNICATION TECHNOLOGY CO., LTD.

CB02 Change of applicant information
CB02 Change of applicant information

Address after: 450001 No. 5 Sakura street, hi tech Development Zone, Henan, Zhengzhou

Applicant after: HENAN XIN'AN COMMUNICATION TECHNOLOGY CO., LTD.

Address before: Kim street 450002 in Henan province Zhengzhou City Hospital No. 7 office building No. 1

Applicant before: HENAN XIN'AN COMMUNICATION TECHNOLOGY CO., LTD.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150408