CN109085798B - Embedded system G code asynchronous communication mechanism, protocol and programming method - Google Patents

Embedded system G code asynchronous communication mechanism, protocol and programming method Download PDF

Info

Publication number
CN109085798B
CN109085798B CN201810882541.XA CN201810882541A CN109085798B CN 109085798 B CN109085798 B CN 109085798B CN 201810882541 A CN201810882541 A CN 201810882541A CN 109085798 B CN109085798 B CN 109085798B
Authority
CN
China
Prior art keywords
instruction
protocol
protocol format
module
code
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.)
Active
Application number
CN201810882541.XA
Other languages
Chinese (zh)
Other versions
CN109085798A (en
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.)
Changzhou Vocational Institute of Light Industry
Original Assignee
Changzhou Vocational Institute of Light Industry
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 Changzhou Vocational Institute of Light Industry filed Critical Changzhou Vocational Institute of Light Industry
Priority to CN201810882541.XA priority Critical patent/CN109085798B/en
Publication of CN109085798A publication Critical patent/CN109085798A/en
Application granted granted Critical
Publication of CN109085798B publication Critical patent/CN109085798B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4093Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by part programming, e.g. entry of geometrical information as taken from a technical drawing, combining this with machining and material information to obtain control information, named part programme, for the NC machine
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/408Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by data handling or data format, e.g. reading, buffering or conversion of data
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4155Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by programme execution, i.e. part programme or machine function execution, e.g. selection of a programme
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/45Nc applications
    • G05B2219/45136Turning, lathe

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Geometry (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses an embedded system G code asynchronous communication mechanism, a protocol and a programming method.A G program file is encapsulated by a protocol through an upper computer to generate a specified protocol format, the protocol format is sent to a lower computer, if an interactive control real-time instruction exists, the lower computer is sent by judging the priority of the protocol format and the interactive control real-time instruction, and the priority is higher; the lower computer receives the protocol format sent by the upper computer, analyzes the protocol format through a protocol analysis module, fills the analyzed data into a command FIFO memory through a sequential instruction filling module, and then performs instruction pre-reading and instruction execution according to the position of the command FIFO memory; if the real-time instruction is analyzed by the protocol analysis module, the real-time instruction does not need to be stored in the command FIFO memory to directly implement instruction execution; the invention effectively reduces the overall cost of the upper and lower motion control systems and improves the execution efficiency of the G code of the embedded system.

Description

Embedded system G code asynchronous communication mechanism, protocol and programming method
Technical Field
The invention belongs to the technical field of numerical control machine tool control, and particularly relates to an embedded system G code asynchronous communication mechanism, a protocol and a programming method.
Background
The numerical control system is a typical application of computer technology in the field of mechanical manufacturing, integrates a plurality of technologies such as computer, machining, micro-electronics and automatic control, and is a high and new technology which develops rapidly in the application field in recent years. Since the 70 s, modern basic machines represented by numerical control machines have become the most important technical features of manufacturing industry, and the level of numerical control machines and the degree of numerical control rate of machine tools have become important marks for measuring the level of national industrialization.
At present, the general trend of the technical development of numerical control systems at home and abroad is as follows: the new generation of numerical control systems is developing towards the direction of PC and open architecture. The driving device is developed in the direction of alternating current and digitalization. The communication function is enhanced, and the development is towards networking. The numerical control system develops towards intellectualization in control performance. The development from a special closed open-loop control mode to a general open real-time dynamic full closed-loop control mode is realized.
The machine tool has modularized structure and specialized numerical control function, and the cost performance of the machine tool is obviously improved and accelerated. In order to adapt to the characteristics of multiple varieties and small batch of numerical control machines, the machine tool structure is modularized, the numerical control function is specialized, the cost performance of the machine tool is obviously improved, and the optimization is accelerated. Personalization is a particularly evident trend in recent years.
With the development of market globalization, market competition is unprecedented and the product produced by a manufacturer is required to be low in price, good in quality, short in delivery time and good in after-sale service, and fully meets the special requirements of users, namely the product is required to be personalized. The traditional numerical control system is a special closed system and cannot meet the requirement of market development. New environments require CNC to further translate to open control systems.
At present, the open numerical control systems of numerical control system manufacturers at home and abroad are mainly concentrated in high-end markets and are high in price. With the application of more and more small numerical control systems, more and more attention is paid to an economic, open and intelligent embedded small multi-axis open type economic numerical control system.
Currently, there are roughly several embedded small systems:
1. the controller of the structure takes the DSP and the FPGA as control cores, has good real-time performance and control precision and low cost, but the human-computer interaction and the motion algorithm of the controller depend on the DSP processor, if the good human-computer interaction is considered, the DSP processor seems to be careless, the real-time performance is seriously influenced, and the expansibility is poor.
2. The industrial control platform mainly adopts an X86 processor structure, has higher processing capacity and strong system expansibility, but has high cost and great application difficulty in small-size motion control requirements.
3. The single-chip microcomputer structure mainly adopts a single ARM or 51-kernel 32-bit processor, is low in cost, but is very closed, low in expansibility and difficult to change once the system is shaped.
Disclosure of Invention
The invention mainly aims to provide an embedded system G code asynchronous communication mechanism, a protocol and a programming method, wherein the method adopts the coordination and cooperation between an upper computer and a lower computer, realizes the real-time property and the diversified humanization of control, and is used for solving the problems of poor real-time property and poor expansibility in the prior art; the specific technical scheme is as follows:
an embedded system G code asynchronous communication mechanism, protocol and programming method, employ the communication between host computer and lower computer, adopt the asynchronous communication mode between host computer and lower computer in the said method, the host computer encapsulates the G code program into the appointed protocol format, and transmit the said protocol format to the lower computer, for the lower computer to analyze and carry out; the method comprises the steps of preparing and sending the G code program file by the upper computer and receiving and processing the protocol format by the lower computer, wherein:
the process of preparing and sending the G code program file by the upper computer comprises the following steps:
s11: generating a set of instruction sets capable of being sequentially executed by a human-computer interaction interface or a parameterization setting interface to form a G program file, and packaging the G program file into a sequential instruction buffer area;
s12: judging whether an upper computer generates an interactive control real-time instruction needing real-time processing, if so, storing the interactive control real-time instruction into an insertion instruction buffer area, and storing the interactive control real-time instruction into an instruction sending buffer area; otherwise, the G program files packaged and encapsulated in the sequence instruction buffer area are saved in the instruction sending buffer area;
s13: the protocol sending module detects whether the instruction sending buffer area has an instruction needing to be sent or not, judges whether a sending condition is met or not, if yes, the protocol sending module sends the instruction to a lower computer in sequence, and otherwise, the protocol sending module does not execute sending operation;
the process that the lower computer receives and processes the protocol format comprises the following steps:
s21: receiving the protocol format by a protocol receiving module in the lower computer in an interrupt mode and sending the protocol format to a protocol receiving buffer;
s22: the protocol analysis module monitors the protocol receiving buffer in real time, judges whether the protocol receiving buffer stores data, decomposes and extracts the data based on the protocol format, and judges the type of the data at the same time;
s23: if the data is a sequential instruction, the sequential instruction is stored in a command FIFO memory through a sequential instruction filling module, otherwise, the data is a real-time instruction, and the real-time instruction is executed;
s24: reading the sequential instructions stored in the command FIFO memory through an instruction pre-reading module, executing the sequential instructions by an instruction execution module, pre-reading and pre-processing the next sequential instructions in the command FIFO memory through a pre-reading instruction and data processing module, and storing the next sequential instructions in a waiting execution module;
s25: and judging whether the instruction execution module finishes the instruction execution, if so, continuing to execute the sequence instruction stored in the waiting execution module, otherwise, keeping the waiting execution module in a waiting state.
Further, the protocol format is composed of a header, a byte number, a command code, control data, a CRC check and a trailer, wherein the header is fixed data 0x7E for identifying the protocol format; the byte number is used for assisting a lower computer to accurately find the command code, the control data and the CRC; the command codes are used for carrying out thinning numbering on the instructions sent by the upper computers; the CRC check is used for judging whether the protocol format is legal or not; the trailer is fixed data 0x0D, and the lower computer identifies whether the instruction contained in the protocol format is finished according to the specific data of the trailer.
Further, in step S22, the method further includes: the lower computer traverses the protocol receiving buffer area, searches a header and a trailer of each protocol format, monitors the size of a storage space of the command FIFO memory through the sequential instruction filling module, if the storage space is full, the upper computer does not send the protocol format, and consumes the protocol format stored in the command FIFO memory through the instruction pre-reading module and the instruction execution module; otherwise, the command FIFO memory continues to receive the protocol format sent by the upper computer.
Further, the header and the trailer are represented by hexadecimal data, and the byte number, the command code, the control data and the CRC check are represented by ASCII codes.
Further, the protocol format is stored in the command FIFO memory as 32-bit data after passing through the protocol parsing module.
The embedded system G code asynchronous communication mechanism, the protocol and the programming method of the invention generate a specified protocol format by protocol encapsulation of a G program file through an upper computer, send the protocol format to a lower computer, if an interactive control real-time instruction exists, send the lower computer by judging the priority of the protocol format and the interactive control real-time instruction, and send the lower computer with higher priority first; the lower computer receives the protocol format sent by the upper computer, analyzes the protocol format through the protocol analysis module, fills the analyzed data into the command FIFO memory through the sequential instruction filling module, performs instruction pre-reading and instruction execution according to the position of the command FIFO memory, performs pre-reading and pre-processing on the next instruction through the pre-reading instruction and data processing module, sends the pre-reading and pre-processing result to the execution waiting module, and waits for execution; if the real-time instruction is analyzed by the protocol analysis module, the instruction execution is directly implemented without storing the real-time instruction into the command FIFO memory; compared with the prior art, the invention can realize that the upper computer organizes and generates the G code by using a programming method such as a high-level language and the like under the condition of limited CPU processing resources of the embedded system, enhances the programming of human-computer interaction and other humanized codes, realizes the support of the lower computer on the instruction of the G code, effectively reduces the overall cost of the upper and lower motion control systems, and improves the execution efficiency of the G code of the embedded system.
Drawings
Fig. 1 is a block diagram illustrating a communication flow between the upper computer and the lower computer according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a G file preparing and sending mechanism of the upper computer in the embodiment of the present invention;
FIG. 3 is a schematic diagram of a receiving and processing mechanism of the lower computer according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a file delivery protocol format of the upper computer in the embodiment of the present invention;
FIG. 5 is a schematic diagram of the command FIFO storage format according to the embodiment of the present invention;
FIG. 6 is a flowchart illustrating a command parsing procedure according to an embodiment of the present invention.
And (4) marking and explaining: 5-sequential instruction buffer, 6-insert instruction buffer, 7-instruction issue buffer, 14-command FIFO memory.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 2 and fig. 3, the invention provides an embedded system G code asynchronous communication mechanism, protocol and programming method, which applies communication between an upper computer and a lower computer, in the method, the upper computer and the lower computer adopt an asynchronous communication mode, the upper computer encapsulates a G code program into a specified protocol format, and transmits the protocol format to the lower computer for the lower computer to analyze and execute; the method comprises the steps of preparing and sending the G code program file by the upper computer and receiving and processing the protocol format by the lower computer, wherein the step of preparing and sending the G code program file by the upper computer comprises the following steps: s11: generating a set of instruction sets capable of being sequentially executed by a human-computer interaction interface or a parameterization setting interface to form a G program file 1, and packaging the G program file 1 into a sequential instruction buffer area 3; s12: judging whether the upper computer generates an interactive control real-time instruction 4 needing real-time processing, if so, storing the interactive control real-time instruction 4 into an insertion instruction buffer area 6, and storing the instruction into an instruction sending buffer area 7; otherwise, storing the G program file 1 packaged and encapsulated into the sequential instruction buffer 5 into an instruction sending buffer 7; s13: the protocol sending module 8 detects whether the instruction sending buffer 7 has an instruction to be sent, and judges whether a sending condition is met, if so, the instructions are sent to a lower computer in sequence, otherwise, the sending operation is not executed.
The process that the lower computer receives and processes the protocol format comprises the following steps: s21: a protocol receiving module 9 in the lower computer receives a protocol format in an interrupt mode and sends the protocol format to a protocol receiving buffer; s22: the protocol analysis module 10 monitors the protocol receiving buffer in real time, judges whether the protocol receiving buffer stores data, decomposes and extracts the data based on the protocol format, and judges the type of the data at the same time; s23: if the data is a sequential instruction, the sequential instruction is stored in the command FIFO memory 14 through the sequential instruction filling module 11, otherwise, the data is a real-time instruction 12, and the real-time instruction 12 is executed; s24: the sequential instructions stored in the command FIFO memory 14 are read by the instruction pre-reading module 15 and executed by the instruction execution module 16, while the next sequential instructions in the command FIFO memory 14 are pre-read and pre-processed by the pre-reading instruction and data processing module 17 and stored in the waiting execution module 18; s25: it is determined whether the instruction execution module 16 completes the execution of the instruction, and if so, the execution of the sequential instruction stored in the wait execution module 18 is continued, otherwise, the wait execution module 18 is in a wait state.
Referring to fig. 4, in the embodiment of the present invention, the protocol format is composed of a header 19, a byte number 20, a command code 21, a command encoding 22, control data 23, a CRC check 24, and a trailer 25, where the header 19 is fixed data 0x7E for identifying the protocol format; the byte number 20 is used for assisting the lower computer to accurately find the command code 21, the command code 22, the control data 23 and the CRC check 24; the command code 21 is used for carrying out thinning numbering on the instructions sent by the upper computer; the CRC check 24 is used to determine whether the protocol format is legitimate; the trailer 25 is fixed data 0x0D, and the lower computer identifies whether the instruction contained in the protocol format is finished according to the specific data of the trailer 25; wherein in the particular embodiment the header 19 and trailer 25 are represented by hexadecimal data and the byte count 20, command code 21, command code 22, control data 23 and CRC check 24 are represented by ascii codes.
Specifically, when the protocol receiving module intercepts a complete piece of protocol data, the byte number 20 can help the lower computer to accurately find the accurate positions of the command code 21, the command number 22, the control data 23 and the CRC check 24, so that the lower computer can conveniently extract the data and calculate the CRC check data; the CRC check 24 judges whether the protocol data is a legal available protocol according to the calculation result of the CRC check data, and if the CRC check is incorrect, the protocol data is invalidated; the command code 21 then essentially identifies the command type of the protocol, such as: the character 'G' represents that the protocol is a motion control instruction, 'M' represents that the protocol is an IO control instruction, 'F' represents that the protocol is a parameter setting instruction; the command number 22 is used for detailing the number of a class of instructions, so that the instructions can conveniently execute corresponding programs; the control data 23 is data required for a certain type of instruction, and corresponds to the fact that a 'G' type instruction is motion data of each axis, a 'M' type instruction is an IO control parameter, and a 'F' type instruction is an operation parameter of a system in a lower computer, and the like.
Referring to fig. 5, in the present invention, the protocol format is stored in the command FIFO memory 14 as 32-bit data 26 after passing through the protocol parsing module 10, as can be seen from the figure, each 32-bit data 26 is composed of 4 8-bit data, and each 8-bit data may mean a command type, a command number, command configuration data, command parameters, etc. according to the difference of the command code 21, depending on the number of the command code 21.
With reference to fig. 6, in the embodiment of the present invention, the analyzing, by the lower computer, the instruction command sent by the upper computer in step S22 further includes: the lower computer traverses the protocol receiving buffer area, specifically, a header and a trailer of each protocol format are searched to implement comprehensive traversal operation, the size of a storage space of the command FIFO memory 14 is monitored through the sequential instruction filling module 11, if the storage space is full, the upper computer does not send the protocol format, and the protocol format stored in the command FIFO memory 14 is consumed through the instruction pre-reading module 15 and the instruction execution module 16; otherwise, the FIFO memory 14 is instructed to continue to receive the protocol format sent by the upper computer; the storage space in the command FIFO memory 14 is enough to satisfy the instruction execution fluency of the lower computer, and the interruption of instruction execution caused by the state transition of the command FIFO memory 14 being full or the command FIFO memory space being free can not be caused, thereby ensuring the fluency of the continuity of the upper computer controlling the lower computer in the G code asynchronous communication mechanism, the protocol and the programming method of the embedded system, namely the fluency of the whole embedded system.
Preferably, in the embodiment of the invention, the upper computer adopts an A8 processor with a main frequency of up to 1GHz, the lower computer adopts an ARM7 processor with a main frequency of 128MHz, the characteristics of high processing capability and strong expansibility are considered by the upper computer, and the characteristics of high real-time supervision and control progress are considered by the lower computer, so that the hardware implementation cost of the system is reduced on the whole; of course, the present invention does not limit and fix this, and can be selected according to actual situations.
The embedded system G code asynchronous communication mechanism, the protocol and the programming method of the invention produce the appointed protocol format by the protocol encapsulation of the G program file through the upper computer, send the protocol format to the lower computer, if the interactive control real-time instruction exists, send the lower computer by judging the priority level of the protocol format and the interactive control real-time instruction, and send the priority level to be higher first; the lower computer receives the protocol format sent by the upper computer, analyzes the protocol format through the protocol analysis module, fills the analyzed data into the command FIFO memory through the sequential instruction filling module, performs instruction pre-reading and instruction execution according to the position of the command FIFO memory, performs pre-reading and pre-processing on the next instruction through the pre-reading instruction and data processing module, sends the pre-reading and pre-processing result to the execution waiting module, and waits for execution; if the real-time instruction is obtained by the protocol analysis module, the instruction execution is directly carried out without storing the real-time instruction into the command FIFO memory; compared with the prior art, the invention can realize that the upper computer organizes and generates the G code by using a programming method such as a high-level language and the like under the condition of limited CPU processing resources of the embedded system, enhances the programming of human-computer interaction and other humanized codes, realizes the support of the lower computer on the instruction of the G code, effectively reduces the overall cost of the upper and lower motion control systems, and improves the execution efficiency of the G code of the embedded system.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing detailed description, or equivalent changes may be made in some of the features of the embodiments described above. All equivalent structures made by using the contents of the specification and the attached drawings of the invention can be directly or indirectly applied to other related technical fields, and are also within the protection scope of the patent of the invention.

Claims (5)

1. An embedded system G code asynchronous communication mechanism, protocol and programming method, employ and communicate between lower computer and the upper computer, characterized by that, adopt the asynchronous communication mode between lower computer and the upper computer in the said method, the upper computer encapsulates the G code program into the appointed protocol format, and transmit the said protocol format to the lower computer, for the lower computer to analyze and carry out; the method comprises the steps of preparing and sending the G code program file by the upper computer and receiving and processing the protocol format by the lower computer, wherein: the process of preparing and sending the G code program file by the upper computer comprises the following steps:
s11: generating a set of instruction sets capable of being sequentially executed by a human-computer interaction interface or a parameterization setting interface to form a G program file, and packaging the G program file into a sequential instruction buffer area;
s12: judging whether an upper computer generates an interactive control real-time instruction needing real-time processing, if so, storing the interactive control real-time instruction into an insertion instruction buffer area, and storing the interactive control real-time instruction into an instruction sending buffer area; otherwise, the G program files packaged and encapsulated in the sequence instruction buffer area are saved in the instruction sending buffer area;
s13: the protocol sending module detects whether the instruction sending buffer area has an instruction needing to be sent or not, judges whether a sending condition is met or not, if yes, the protocol sending module sends the instruction to a lower computer in sequence, and otherwise, the protocol sending module does not execute sending operation;
the process that the lower computer receives and processes the protocol format comprises the following steps:
s21: receiving the protocol format by a protocol receiving module in the lower computer in an interrupt mode and sending the protocol format to a protocol receiving buffer;
s22: the protocol analysis module monitors the protocol receiving buffer in real time, judges whether the protocol receiving buffer stores data, decomposes and extracts the data based on the protocol format, and judges the type of the data at the same time;
s23: if the data is a sequential instruction, the sequential instruction is stored in a command FIFO memory through a sequential instruction filling module, otherwise, the data is a real-time instruction, and the real-time instruction is executed;
s24: reading the sequential instructions stored in the command FIFO memory through an instruction pre-reading module, executing the sequential instructions by an instruction execution module, pre-reading and pre-processing the next sequential instructions in the command FIFO memory through a pre-reading instruction and data processing module, and storing the next sequential instructions in a waiting execution module;
s25: and judging whether the instruction execution module finishes the instruction execution, if so, continuing to execute the sequence instruction stored in the waiting execution module, otherwise, keeping the waiting execution module in a waiting state.
2. The embedded system G code asynchronous communication mechanism, protocol and programming method of claim 1, wherein the protocol format is composed of a header, a byte number, a command code, control data, a CRC check and a trailer, wherein the header is fixed data 0x7E for identifying the protocol format; the byte number is used for assisting a lower computer to accurately find the command code, the control data and the CRC; the command codes are used for carrying out thinning numbering on the instructions sent by the upper computers; the CRC check is used for judging whether the protocol format is legal or not; the trailer is fixed data 0x0D, and the lower computer identifies whether the instruction contained in the protocol format is finished according to the specific data of the trailer.
3. The embedded system G-code asynchronous communication mechanism, protocol and programming method of claim 2, wherein in step S22, further comprising: the lower computer traverses the protocol receiving buffer area, searches a header and a trailer of each protocol format, monitors the size of a storage space of the command FIFO memory through the sequential instruction filling module, if the storage space is full, the upper computer does not send the protocol format, and consumes the protocol format stored in the command FIFO memory through the instruction pre-reading module and the instruction execution module; otherwise, the command FIFO memory continues to receive the protocol format sent by the upper computer.
4. The embedded system G-code asynchronous communication mechanism, protocol and programming method of claim 2, wherein the header and trailer are represented by hexadecimal data, and the number of bytes, command code, control data and CRC check are represented by ASCII code.
5. The embedded system G code asynchronous communication mechanism, protocol and programming method as claimed in any one of claims 1 to 4, wherein the protocol format is stored in the command FIFO memory as 32 bits of data after passing through the protocol parsing module.
CN201810882541.XA 2018-08-06 2018-08-06 Embedded system G code asynchronous communication mechanism, protocol and programming method Active CN109085798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810882541.XA CN109085798B (en) 2018-08-06 2018-08-06 Embedded system G code asynchronous communication mechanism, protocol and programming method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810882541.XA CN109085798B (en) 2018-08-06 2018-08-06 Embedded system G code asynchronous communication mechanism, protocol and programming method

Publications (2)

Publication Number Publication Date
CN109085798A CN109085798A (en) 2018-12-25
CN109085798B true CN109085798B (en) 2021-01-26

Family

ID=64833521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810882541.XA Active CN109085798B (en) 2018-08-06 2018-08-06 Embedded system G code asynchronous communication mechanism, protocol and programming method

Country Status (1)

Country Link
CN (1) CN109085798B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889481B (en) * 2018-12-26 2022-09-20 广州市中海达测绘仪器有限公司 Data acquisition and fusion method and device based on multi-sensor equipment
JP6997131B2 (en) * 2019-04-05 2022-01-17 ファナック株式会社 Numerical control device
CN111522588B (en) * 2020-04-16 2023-05-05 珠海泰芯半导体有限公司 Chip operation interaction method and communication system based on SWD protocol
CN112925266B (en) * 2021-02-02 2024-08-06 深圳市显控科技股份有限公司 G code generation method, device, equipment and storage medium based on universal HMI

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534259A (en) * 2009-04-15 2009-09-16 兰州大成自动化工程有限公司 An asynchronous communication controller and its control method
CN101826273A (en) * 2009-11-11 2010-09-08 深圳市和怡科技有限公司 Network connection based teaching equipment adopting multiple numerical control systems and communication method
CN102665298A (en) * 2012-02-06 2012-09-12 福建三元达软件有限公司 Wireless communication module multiple return state processing method in foreground-background design
CN103888227A (en) * 2014-04-21 2014-06-25 华北水利水电大学 Data frame receiving and analyzing device and method based on VL
CN104239254A (en) * 2014-09-04 2014-12-24 西南技术物理研究所 Serial asynchronous communication data transmission method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013284A1 (en) * 2007-07-02 2009-01-08 Virsycom, Inc. Systems and Methods for Communicating Information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534259A (en) * 2009-04-15 2009-09-16 兰州大成自动化工程有限公司 An asynchronous communication controller and its control method
CN101826273A (en) * 2009-11-11 2010-09-08 深圳市和怡科技有限公司 Network connection based teaching equipment adopting multiple numerical control systems and communication method
CN102665298A (en) * 2012-02-06 2012-09-12 福建三元达软件有限公司 Wireless communication module multiple return state processing method in foreground-background design
CN103888227A (en) * 2014-04-21 2014-06-25 华北水利水电大学 Data frame receiving and analyzing device and method based on VL
CN104239254A (en) * 2014-09-04 2014-12-24 西南技术物理研究所 Serial asynchronous communication data transmission method

Also Published As

Publication number Publication date
CN109085798A (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN109085798B (en) Embedded system G code asynchronous communication mechanism, protocol and programming method
CN106933212B (en) reconfigurable industrial robot programming control method in distributed manufacturing environment
CN110620712B (en) Method for realizing real-time EtherCAT master station of Window platform
EP1037145A2 (en) A hybrid just-in-time compiler that consumes minimal resources
JP2004038876A (en) Data format conversion method and device for program and the like, and controller management system using the data format conversion device
CN102787932A (en) Apparatus and method for matching and calibrating electric control diesel engine based on serial communication
CN104317236A (en) Soft PLC technology-based wireless sensor network control terminal
CN109842428B (en) WiFi chip and self-adaptive method
CN111698268A (en) Equipment communication protocol converter
CN111267111B (en) Robot control method, device and system
CN115453967A (en) Scheduling execution method of PLCopen single-axis motion control function block
CN110032115B (en) Internet of things control system and method utilizing near field connection for real-time interaction
CN117573132A (en) Integrated compiling and downloading method for controllers of different architectures
US7296187B1 (en) Hardware debug device having script-based host interface
CN109634203B (en) Control system for controlling IO terminal based on numerical control controller and corresponding method
CN105843659B (en) Method and system for implementing embedded C compiler
CN110794731A (en) Embedded soft PLC control system supporting Ethernet
JP4500484B2 (en) Controller and information communication service method
CN110989499A (en) Hybrid architecture control system based on high-speed wireless communication
CN110442520A (en) A kind of cross debugging system and method based on PLC programming language
CN108932171B (en) Embedded software interaction method
Liang Embedded controller Visual Configuration software design analysis
CN107273134A (en) Numerical control program performs method and device
CN112327740B (en) Embedded motion controller integrated with Tango equipment service
CN113279154B (en) Instruction execution method and device of sewing equipment, terminal equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 213164 No.28, Mingxin Middle Road, Wujin District, Changzhou City, Jiangsu Province

Applicant after: Changzhou Polytechnic

Address before: 213164 No.28, Mingxin Middle Road, Wujin District, Changzhou City, Jiangsu Province

Applicant before: CHANGZHOU VOCATIONAL INSTITUTE OF LIGHT INDUSTRY

GR01 Patent grant
GR01 Patent grant