[go: up one dir, main page]

CN101630155B - Method for realizing instruction interaction in numerical control machine system - Google Patents

Method for realizing instruction interaction in numerical control machine system Download PDF

Info

Publication number
CN101630155B
CN101630155B CN2009101944086A CN200910194408A CN101630155B CN 101630155 B CN101630155 B CN 101630155B CN 2009101944086 A CN2009101944086 A CN 2009101944086A CN 200910194408 A CN200910194408 A CN 200910194408A CN 101630155 B CN101630155 B CN 101630155B
Authority
CN
China
Prior art keywords
instruction
data position
position pointer
pointer
pointed
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
CN2009101944086A
Other languages
Chinese (zh)
Other versions
CN101630155A (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.)
Nanjing Kaitong Automation Technology Co ltd
SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO LTD
Original Assignee
SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Shanghai Naikai Electronic Science and 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 SHANGHAI WEIHONG TECHNOLOGYCO Ltd, Shanghai Naikai Electronic Science and Technology Co Ltd filed Critical SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Priority to CN2009101944086A priority Critical patent/CN101630155B/en
Publication of CN101630155A publication Critical patent/CN101630155A/en
Application granted granted Critical
Publication of CN101630155B publication Critical patent/CN101630155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Numerical Control (AREA)

Abstract

The invention relates to a method for realizing instruction interaction in a numerical control machine system. The invention is characterized in that the system is provided with a circular buffer area; the method comprises the following steps: defining instructions; applying for a memory of the circular buffer area; executing a writing instruction; and executing a reading instruction. The method shares the memory of the circular buffer area in the numerical control machine system and uses once reading and only once writing in the buffer area so that the numerical control machine system saves the transmission cost from R0 to R3, improves the performance, saves the space and only requires one thread for reading operation and the other thread for writing operation because of the defined buffer area and has the safe threads for the instruction interaction.

Description

Realize the method for instruction interaction in the numerically-controlled machine tool system
Technical field
The present invention relates to the numerically-controlled machine tool system field, particularly the numerically-controlled machine tool system motion control field specifically is instruction and the mutual method of hardware of realizing in a kind of digital control system.
Background technology
Manufacturing industry is the basic industry of national economy, and manufacturing level just is to weigh the important symbol of an industrial development degree of country.Numerically-controlled machine quality level is just concerning the height of national manufacturing industry level.
We often use machine tool system to carry out the control corresponding motor performance in existing technology.In the Machine-Tool Control kinematic system, machine tool instructions sends in the Machine-Tool Control card.If take traditional mode, instruct very poor efficiency of transmission mode so.So just may not reach the controller bed motion track that we want.In addition since constantly application internal memory, releasing memory, duplicate operation such as internal memory, caused the loss of performance.
Summary of the invention
Technical matters to be solved by this invention is, overcome problems of the prior art, provide a kind of and can realize in the numerically-controlled machine control system that high-speed transfer is instructed, processing procedure is simple, reusable, the easy understanding of memory headroom, data transmit safety.The scope of application realizes the method for instruction transmission at a high speed in the numerically-controlled machine tool system comparatively widely.
In order to address the above problem technical scheme of the present invention is such:
Realize the method for instruction interaction in the numerically-controlled machine tool system, its feature may further comprise the steps:
1) defined instruction
A 1a) instruction of definition memory headroom piece, the size of normally maximum instruction memory headroom;
1b) use an identifier, be convenient to instruction identification;
1c) according to instruction identifier, in instruction, place different command informations;
2) buffer circle internal memory application, instruction write, instruct and read;
2a) system definition read data position pointer and write data position pointer;
2b) memory headroom of system's application, its memory headroom size are the memory headroom multiples of instruction;
2c) system all points to step 2b with read data position pointer and write data position pointer) starting position of memory headroom of application;
2d) apply for above-mentioned data structure memory headroom, then its data pointer is sent to application program R3 at R0;
(R0 and R3 are the level of privilege that CPU sets, and are respectively R0, R1, R2, R3.R0 has highest level, can all resource of access count machine, and operating system is in this layer; R3 is minimum rank, can't access system in nuclear resource, application program operates in this layer, R3 can not visit the R0 data in simple terms, R0 may visit the R3 data);
3) instruction writes
3a) system's entry instruction write operation;
3b) judge in the buffer circle whether expired;
If 3c) buffer circle less than, then the loop buffer formation is put in instruction, just director data is copied in the buffer circle;
If 3d) buffer zone is full, then wait for a period of time, return above-mentioned 3b) step;
4) instruction is read
4a) whether there are data readable in system's poll buffer circle;
If 4b) have data readable, then define a command variable, from buffer circle, take out an instruction then, and director data is copied in the command variable;
If 4c) no datat is readable, handle other operations, enter above-mentioned 4a then) step.
Described instruction memory headroom piece all is the same in each instruction; Instruction all has a sign, and what identify this instruction is specifically to finish what function; The data field that has dependent instruction information in the instruction.
The space size of described buffer circle is L, L=Nn, and wherein, N is the number of instructions of system definition, n is the space size of instruction.
Beneficial effect: adopt in the numerically-controlled machine tool system of this invention and realize instruct transmission method, owing in numerically-controlled machine tool system, adopt the buffer circle memory shared, and has only a read-write in the use buffer zone, our numerically-controlled machine tool system has been saved R0 to R3 transmission cost like this, improved performance and also saved the space, because the buffer zone of our definition only requires that a thread is used for read operation, a thread is used for write operation, and this numerically-controlled machine tool system is a thread-safe for instruction interaction like this.
Description of drawings
Describe the present invention in detail below in conjunction with the drawings and specific embodiments;
Fig. 1 is the instruction flow that writes of the present invention.
Fig. 2 is a reading command flow process of the present invention.
Fig. 3 is the system architecture process flow diagram.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
Referring to Fig. 1, Fig. 2, Fig. 3
At first the several nouns in the numerically-controlled machine technical field are made an explanation:
Instruction---refer to be used to control the command information of integrated circuit board, in driving, be interpreted into significant information.
The logic positive dirction---deposit in earlier in the finger ring shape buffer zone data to after deposit the logical direction of the arrangement of data in buffer circle in.
The logic negative direction---deposit in earlier in the finger ring shape buffer zone data to after deposit the opposite direction of the logical direction of the arrangement of data in buffer circle in.
Realize the method for high speed instruction interaction in this numerically-controlled machine tool system, be characterized in: be provided with a buffer circle in the described system, described method comprises defined instruction 1), buffer circle internal memory application 2), instruction writes 3), instruction reads 4).
1) described defined instruction method may further comprise the steps:
1a) instruction of definition memory headroom piece, the normally size of maximum instruction;
1b) use an identifier, be convenient to instruction identification;
1c) according to instruction identifier, in instruction, place different command informations.
Instruction is that three main points are arranged in definition:
Instruction institute's memory headroom size of applying for all is the same in each instructs;
It is the identifier of which kind of instruction that instruction all has an expression;
Instruction has the data field of dependent instruction information.
2) described buffer circle internal memory procedure to apply:
2a) system definition read data position pointer and write data position pointer;
2b) memory headroom of system's application, its space size are the memory headroom multiples of instruction;
2c) system all points to read data position pointer and write data position pointer the starting position of the memory headroom of the rapid application of previous step;
2d) apply for above-mentioned data structure memory headroom, then its data pointer is sent to application program R3 at R0;
(R0 and R3 are the level of privilege that CPU sets, and are respectively R0, R1, R2, R3.R0 has highest level, can all resource of access count machine, and operating system is in this layer; R3 is minimum rank, can't access system in nuclear resource, application program operates in this layer.R3 can not visit the R0 data in simple terms, and R0 may visit the R3 data).
Realize the space size L of buffer circle in this digital control system, determine according to following formula:
L=Nn
Wherein, N is the number of instructions of system definition, and n is the size of instruction.
3) step of writing instructions:
3a) system's entry instruction write operation;
3b) judge in the buffer circle whether expire;
If 3c) buffer circle less than, then the loop buffer formation is put in instruction, just director data is copied in the buffer circle.Copy step is as follows:
If 3c1) buffer circle has instruction, then read data position pointer and write data position pointer instruction record pointed is not same, if not then waiting for a period of time, returns above-mentioned steps 3b);
If 3c2) position of write data pointer instruction pointed record with write instruction location of instruction unit pointed, read data position, be not equal to the predetermined pointer number-1 of system in the distance of positive dirction, if not then waiting for a period of time, return above-mentioned steps 3b);
Information during 3c3) system will instruct is written in the described write data position pointer record cell pointed;
3c4) system's location of instruction that read data position pointer is pointed moves a unit to the logic positive dirction.
If 3d) buffer circle is full, wait for a period of time, return above-mentioned steps 3b) in;
4) instruction read step:
4a) whether there are data readable in system's poll buffer circle;
If 4b) have data readable, then define a command variable, from buffer circle, take out an instruction then, and director data is copied in the command variable.The write data step is as follows:
4b1) judge that the location of instruction that described read data position pointer is pointed and the write data position pointer location of instruction pointed is inconsistent, and read data position pointer and the first Data Position pointer location of instruction pointed is inconsistent; If inconsistent, then enter next step, otherwise system will enter above-mentioned steps 4a) in;
If 4b2) the next instruction position indicator pointer of the logic positive dirction of read data pointer is with to write the Data Position pointer inconsistent.If inconsistent, then enter next step, otherwise system will enter above-mentioned steps 4a) in;
4b3) system reads out the command information of read data position pointer of this moment, and puts into above-mentioned steps 4b) in the variable of application;
4b4) system moves an instruction unit with read data position pointer to the logic positive dirction;
4b5) the instruction that system handles read, system enters above-mentioned steps 4a then) in.
If 4c) no datat is readable, wait for a period of time, enter above-mentioned steps 4a then) in.
Realize in this numerically-controlled machine tool system being provided with read data position pointer in the buffer circle, write data position pointer describedly is written to buffer circle with the instruction in the numerically-controlled machine tool system, may further comprise the steps:
If 1 buffer circle is without any command unit, then read data position pointer, the same record cell of write data position pointed;
If 2 buffer circles have instruction, then read data position pointer and write data position pointer instruction record pointed is not same;
If the position of 3 write data pointers instruction pointed record with write instruction location of instruction unit pointed, read data position, be not equal to the predetermined pointer number-1 of system in the distance of positive dirction;
4, the information during system will instruct is written in the described write data position pointer record cell pointed;
5, system's location of instruction that read data position pointer is pointed moves a unit to the logic positive dirction.
Realize in this numerically-controlled machine tool system that the value of establishing has read data position pointer in the buffer circle, write data position pointer writes, and is described with the mode that reads for loop buffer in the numerically-controlled machine tool system, may further comprise the steps:
If the location of instruction that 1 described read data position pointer is pointed and the write data position pointer location of instruction pointed is inconsistent, and read data position pointer and the first Data Position pointer location of instruction pointed is inconsistent;
If the next instruction position indicator pointer of the logic positive dirction of 2 read data pointers is with to write the Data Position pointer inconsistent;
3, system moves an instruction unit with read data position pointer to the logic positive dirction;
4, system reads out the command information of the read data position pointer of this moment.
Adopt in the numerically-controlled machine tool system of this invention and realize instruct transmission method, owing in numerically-controlled machine tool system, adopt the buffer circle memory shared, and has only a read-write in the use buffer zone, our numerically-controlled machine tool system has been saved R0 to R3 transmission cost like this, improved performance and also saved the space, because the buffer zone of our definition is only required a thread read operation, a thread write operation, this numerically-controlled machine tool system is a thread-safe for instruction interaction like this.
More than show and described ultimate principle of the present invention, principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in the foregoing description and the instructions just illustrates principle of the present invention; the present invention also has various changes and modifications without departing from the spirit and scope of the present invention, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (2)

1. realize the method for instruction interaction in the numerically-controlled machine tool system, may further comprise the steps:
1) defined instruction
1a) instruction of definition memory headroom piece, the normally size of maximum instruction;
1b) use an identifier, be convenient to instruction identification;
1c) according to instruction identifier, in instruction, place different command informations;
2) buffer circle internal memory application;
2a) system definition read data position pointer and write data position pointer;
2b) memory headroom of system's application, its space size are the memory headroom multiples of instruction;
2c) system all points to read data position pointer and write data position pointer the starting position of the memory headroom of the rapid application of previous step;
2d) apply for above-mentioned data structure memory headroom, then its data pointer is sent to application program R3 at R0;
The space size L of buffer circle, determine according to following formula:
L=Nn
Wherein, N is the number of instructions of system definition, and n is the size of instruction;
3) instruction writes
3a) system's entry instruction write operation;
3b) judge in the buffer circle whether expired;
If 3c) buffer circle less than, then the loop buffer formation is put in instruction, just director data is copied in the buffer circle;
Copy step is as follows:
If 3c1) buffer circle has instruction, then read data position pointer and write data position pointer instruction record pointed is not same, if not then waiting for a period of time, returns above-mentioned steps 3b);
If 3c2) position of write data pointer instruction pointed record with write instruction location of instruction unit pointed, read data position, be not equal to the predetermined pointer number-1 of system in the distance of positive dirction, if not then waiting for a period of time, return above-mentioned steps 3b);
Information during 3c3) system will instruct is written in the described write data position pointer record cell pointed;
3c4) system's location of instruction that read data position pointer is pointed moves a unit to the logic positive dirction;
If 3d) buffer zone is full, then wait for a period of time, return above-mentioned 3b) step;
4) instruction is read
4a) whether there are data readable in system's poll buffer circle;
If 4b) have data readable, then define a command variable, from buffer circle, take out an instruction then, and director data is copied in the command variable; The copy data step is as follows:
4b1) judge that the location of instruction that described read data position pointer is pointed and the write data position pointer location of instruction pointed is inconsistent, and read data position pointer and the first Data Position pointer location of instruction pointed is inconsistent; If inconsistent, then enter next step, otherwise system will enter above-mentioned steps 4a) in;
If 4b2) if the next instruction position indicator pointer of the logic positive dirction of read data pointer inconsistent, then enter next step, otherwise system will enter above-mentioned steps 4a with to write the Data Position pointer inconsistent) in;
4b3) system reads out the command information of read data position pointer of this moment, and puts into above-mentioned steps 4b) in the variable of application;
4b4) system moves an instruction unit with read data position pointer to the logic positive dirction;
4b5) the instruction that system handles read, system enters above-mentioned steps 4a then) in;
If 4c) no datat is readable, handle other operations, enter above-mentioned 4a then) step.
2. realize the method for instruction interaction in the numerically-controlled machine tool system according to claim 1, it is characterized in that described instruction memory headroom piece all is the same in each instruction; Instruction all has an indications that is denoted as what type instruction; The data field that has dependent instruction information in the instruction.
CN2009101944086A 2009-08-21 2009-08-21 Method for realizing instruction interaction in numerical control machine system Active CN101630155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101944086A CN101630155B (en) 2009-08-21 2009-08-21 Method for realizing instruction interaction in numerical control machine system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101944086A CN101630155B (en) 2009-08-21 2009-08-21 Method for realizing instruction interaction in numerical control machine system

Publications (2)

Publication Number Publication Date
CN101630155A CN101630155A (en) 2010-01-20
CN101630155B true CN101630155B (en) 2011-04-20

Family

ID=41575290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101944086A Active CN101630155B (en) 2009-08-21 2009-08-21 Method for realizing instruction interaction in numerical control machine system

Country Status (1)

Country Link
CN (1) CN101630155B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103163827A (en) * 2011-12-14 2013-06-19 沈阳高精数控技术有限公司 Key data acquisition method for bus type numerical control system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5906956B2 (en) * 2012-06-20 2016-04-20 株式会社ミツトヨ NC machine tool control method, control program, and control apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1391176A (en) * 2002-04-09 2003-01-15 威盛电子股份有限公司 Remote node reads local memory maintenance method and its application device
EP1640830A1 (en) * 2004-09-16 2006-03-29 Yamazaki Mazak Corporation Simulation apparatus and method for NC machining
CN101006437A (en) * 2004-08-13 2007-07-25 ClearSpeed科技公司 Processor memory system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1391176A (en) * 2002-04-09 2003-01-15 威盛电子股份有限公司 Remote node reads local memory maintenance method and its application device
CN101006437A (en) * 2004-08-13 2007-07-25 ClearSpeed科技公司 Processor memory system
EP1640830A1 (en) * 2004-09-16 2006-03-29 Yamazaki Mazak Corporation Simulation apparatus and method for NC machining

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JP特开2000-228757A 2000.08.15
刘德志.开放式数控系统的译码模块的软件化实现.《哈尔滨工业大学硕士学位论文》.2006,全文. *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103163827A (en) * 2011-12-14 2013-06-19 沈阳高精数控技术有限公司 Key data acquisition method for bus type numerical control system
CN103163827B (en) * 2011-12-14 2015-07-29 沈阳高精数控技术有限公司 A kind of key data acquisition method for bus-type numerical control system

Also Published As

Publication number Publication date
CN101630155A (en) 2010-01-20

Similar Documents

Publication Publication Date Title
CN103154918B (en) For Memory Controller based on crossfire transaction information application page-management policies, system and method
CN107590099B (en) Method for accessing slave machines by multiple hosts, extension device and storage medium
CN102724035B (en) Encryption and decryption method for encrypt card
CN102141406B (en) Method for depicting electronic navigation map and server
CN103207846A (en) Memory controller and control method
CN106406227A (en) Numerical control system interpolation algorithm and numerical control system
CN102226894A (en) Mobile device memory management method and device
CN103092534A (en) Scheduling method and device of memory structure
US20140101340A1 (en) Efficient Scheduling of Transactions from Multiple Masters
CN101216751A (en) DRAM device with data handling capacity based on distributed memory structure
CN113032162B (en) Multi-process communication method based on shared memory backup mechanism
CN112905365B (en) Data processing method, device, equipment and medium
CN102521179A (en) Achieving device and achieving method of direct memory access (DMA) reading operation
CN102855199A (en) Data processing device and data processing arrangement
CN101630155B (en) Method for realizing instruction interaction in numerical control machine system
US8886844B2 (en) Efficient scheduling of read and write transactions in dynamic memory controllers
WO2018000765A1 (en) Co-processor, data reading method, processor system and storage medium
CN109062857B (en) Novel message controller capable of realizing communication among multiple processors at high speed and communication method thereof
CN102478813A (en) Method for realizing interaction between instruction and hardware in numerical control system
CN102654760B (en) Numerical value control method for machine tool
CN112068948B (en) Data hashing method, readable storage medium and electronic device
CN103389893A (en) Read-write method and device for configuration register
CN105955971A (en) Key value buffer memory implementation method and device
CN101556556B (en) Data storage method and device
CN201084005Y (en) Embedded machine tool numerical control system based on ARM technology

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: SHANGHAI NAIKAI ELECTRONIC TECHNOLOGY CO., LTD.

Effective date: 20120712

Free format text: FORMER OWNER: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

Effective date: 20120712

C41 Transfer of patent application or patent right or utility model
C56 Change in the name or address of the patentee

Owner name: SHANGHAI WEIHONG ELECTRONIC CO., LTD.

Free format text: FORMER NAME: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 201114 MINHANG, SHANGHAI TO: 200237 XUHUI, SHANGHAI

CP03 Change of name, title or address

Address after: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Patentee after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 200237 Shanghai Xuhui District Xietu Road No. 1221 Room 305

Patentee before: Shanghai Weihong Electronic Technology Co.,Ltd.

TR01 Transfer of patent right

Effective date of registration: 20120712

Address after: 200237 Shanghai Xuhui District Xietu Road No. 1221 Room 305

Patentee after: Shanghai Weihong Electronic Technology Co.,Ltd.

Address before: 201114, G, room 115, 778 Yue Yue Road, Shanghai, Minhang District

Co-patentee before: Shanghai Weihong Electronic Technology Co.,Ltd.

Patentee before: Shanghai Naikai Technology Co.,Ltd.

TR01 Transfer of patent right

Effective date of registration: 20211123

Address after: 201108 4th floor, 29 Lane 1277, zhuanxing East Road, Minhang District, Shanghai

Patentee after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Patentee after: Nanjing Kaitong Automation Technology Co.,Ltd.

Address before: 201108 No.29, enterprise park, No.1 headquarters, Lane 2338, Duhui Road, Minhang District, Shanghai

Patentee before: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right