A keyboard design method and system for a general numerical control system

CN117008737BActive Publication Date: 2026-08-21WUHAN HUAZHONG NUMERICAL CONTROL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310227050.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2026-08-21
Estimated Expiration
2043-03-03

AI Technical Summary

Technical Problem

[0005]本发明针对现有技术中存在的当前常用的数控系统键盘,在键盘面膜的硬件结构根据不同机型进行调整,硬件需要重新修改按键行列矩阵和每个按键的键值定义,将固件代码重新烧录,效率低且成本高的技术问题

Benefits of technology

[0030]有益效果:本发明提供的一种通用数控系统键盘设计方法及系统,其中方法包括以下步骤:将各数控系统键盘上按键的按键状态与按键事件进行对应配置成键值映射表;读取当前数控系统键盘上的按键实时状态,将按键实时状态写入按键输入报告中;解析所述按键输入报告中的按键实时状态数据,在键值映射表内搜寻到相应的按键事件;将搜寻到的按键事件翻译成当前数控系统能辨识的标准键值,根据标准键值定义新型按键。本方案只需要记录数控系统键盘上按键的位置以及按下/弹起状态,再结合键值映射配置获取到相应的按键键值,以此适应不同数控系统键盘的需求,达到简化数控系统键盘设计流程的目的。可配置的键值映射表满足不同用户对数控系统键盘的需求;大大降低了研发和调试成本,减少根据不同需求频繁更改键值定义,同时也减少更改数控系统键盘的固件代码,降低成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117008737B_ABST
    Figure CN117008737B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of numerical control, and particularly provides a general numerical control system keyboard design method and system, wherein the method comprises the following steps: corresponding configuration of the key state and the key event of each numerical control system keyboard into a key value mapping table; reading the real-time state of the key on the current numerical control system keyboard, and writing the real-time state of the key into a key input report; analyzing the real-time state data of the key in the key input report, and searching for the corresponding key event in the key value mapping table; translating the searched key event into a standard key value recognizable by the current numerical control system, and defining a new key according to the standard key value. The configurable key value mapping table of the scheme meets the needs of different users for the numerical control system keyboard, greatly reduces the research and development and debugging costs, reduces the frequent change of key value definition according to different needs, also reduces the change of the firmware code of the numerical control system keyboard, and reduces the cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of numerical control technology, and more specifically, to a general numerical control system keyboard design method and system. Background Technology

[0002] The CNC keyboard in a CNC system serves as a crucial interface for human-machine interaction. It consists of letter keys, function keys, and number keys. It is used for programming machining operations, modifying parameters, and facilitating functional operations between the operator and the system. There are many types of CNC machine tools, including major categories such as lathes, milling machines, grinders, punching machines, and planers, as well as subcategories within each major category. The operating methods for each model differ.

[0003] The row and column matrix of the CNC system keyboard panel varies depending on the machine model. In product development, the key value definitions for CNC keyboards differ, so CNC system keyboard designs typically employ different key value definitions to adapt to different machine models. The hardware of the CNC keyboard requires modification of firmware code to match the key row and column matrix on the keyboard panel and to change the key values ​​corresponding to each key position. Furthermore, the hardware of CNC keyboards generally uses FPGA or MCU units, whose code programming is relatively complicated, and each firmware code change requires retesting, thus increasing development and debugging costs.

[0004] Therefore, when the hardware structure of the keyboard panel in a commonly used CNC system is adjusted according to different machine models, the hardware needs to be re-modified, including the key row and column matrix and the key value definition of each key, and the firmware code needs to be re-flashed. When the key presses on the CNC system keyboard change, the key value is written to an input report and sent to the CNC system software, which then responds to the key event. This process is cumbersome, inefficient, costly, and difficult to promote and apply. Summary of the Invention

[0005] This invention addresses the technical problem of existing CNC system keyboards, which require adjustments to the hardware structure of the keyboard faceplate according to different models. This necessitates modifying the key row and column matrix and the key value definition of each key, as well as re-burning the firmware code, resulting in low efficiency and high cost.

[0006] This invention provides a general CNC system keyboard design method comprising the following steps:

[0007] S1, Configure the key states and key events of the keys on the keyboard of each CNC system into a key value mapping table;

[0008] S2, Read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report;

[0009] S3, parse the real-time status data of the keys in the key input report, and search for the corresponding key event in the key value mapping table;

[0010] S4 translates the searched key events into standard key values ​​that the current CNC system can recognize, and defines new keys based on the standard key values.

[0011] Preferably, S1 specifically includes:

[0012] Define the key states of the keys on the keyboard of different CNC systems, translate the actual execution actions represented by the key states of each CNC system into key events, and form a key-value mapping table by mapping the key states to key events.

[0013] Preferably, each actual action corresponds to at least one key state, and the actual action corresponds one-to-one with the key event.

[0014] Preferably, the real-time status of the buttons in S2 specifically includes: the row and column of the button whose status has changed on the CNC system keyboard, and the state of the button being pressed or released.

[0015] Preferably, the step S2 of writing the real-time status of the key to the key input report specifically includes:

[0016] Based on the maximum single data reception capacity of the current CNC system, all transmittable key states are packaged and written into a key input report in chronological order within this unit capacity.

[0017] Preferably, step S5 is included after step S4:

[0018] Once the states of all buttons in a CNC system are defined, a new universal keyboard is obtained. Based on the new universal keyboard, the real-time states of the buttons in the next CNC system are integrated into the new universal keyboard.

[0019] Preferably, the fusion process in S5 specifically includes:

[0020] Based on the key value mapping table, the key status under the current CNC system is translated into the corresponding key event, and the corresponding new key on the new universal keyboard is searched through the standard key value corresponding to the key event.

[0021] If no corresponding new key is found, a new key will be added to correspond to the standard key value.

[0022] If a corresponding new key is found, a correspondence is established between the new key and the standard key value.

[0023] This invention also provides a universal CNC system keyboard design system, the system being used to implement a universal CNC system keyboard design method, comprising:

[0024] The mapping establishment module is used to configure the key states and key events of the keys on the keyboard of each CNC system into a key-value mapping table;

[0025] The report caching module is used to read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report.

[0026] The report parsing module is used to parse the real-time status data of the keys in the key input report and search for the corresponding key events in the key value mapping table.

[0027] The keyboard definition module is used to translate the searched key events into standard key values ​​that the current CNC system can recognize, and define new keys based on the standard key values.

[0028] The present invention also provides an electronic device, including a memory and a processor, wherein the processor is used to implement the steps of a general CNC system keyboard design method when executing a computer management program stored in the memory.

[0029] The present invention also provides a computer-readable storage medium storing a computer management program thereon, wherein the computer management program, when executed by a processor, implements the steps of a general CNC system keyboard design method.

[0030] Beneficial Effects: This invention provides a universal CNC system keyboard design method and system. The method includes the following steps: configuring the key states and key events of each CNC system keyboard into a key value mapping table; reading the real-time key states of the current CNC system keyboard and writing them into a key input report; parsing the real-time key state data in the key input report and searching for the corresponding key events in the key value mapping table; translating the searched key events into standard key values ​​that the current CNC system can recognize, and defining new keys based on the standard key values. This solution only needs to record the position and pressed / released state of the keys on the CNC system keyboard, and then obtain the corresponding key values ​​by combining the key value mapping configuration, thereby adapting to the needs of different CNC system keyboards and simplifying the CNC system keyboard design process. The configurable key value mapping table meets the needs of different users for CNC system keyboards; it greatly reduces R&D and debugging costs, reduces frequent changes to key value definitions based on different needs, and also reduces changes to the firmware code of the CNC system keyboard, thus reducing costs. Attached Figure Description

[0031] Figure 1 A flowchart of a general CNC system keyboard design method provided by the present invention;

[0032] Figure 2 This invention provides a schematic diagram of the working principle of a universal CNC system keyboard.

[0033] Figure 3 The standard key input report information diagram provided by this invention;

[0034] Figure 4 This invention provides a novel universal keyboard key input report information diagram;

[0035] Figure 5 This is a diagram of the keyboard panel of the CNC milling system provided by the present invention;

[0036] Figure 6 This invention provides a novel universal keyboard key state mapping diagram.

[0037] Figure 7 This invention provides a configuration diagram of a novel universal keyboard key state mapping file.

[0038] Figure 8 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention;

[0039] Figure 9 This is a schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. Detailed Implementation

[0040] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0041] like Figure 1 and Figure 2 As shown, the present invention provides a general CNC system keyboard design method, comprising:

[0042] First, configurations are made according to different CNC systems, mapping the key states and key events on the keyboard of each CNC system into a key-value mapping table. Specifically, the key states on the keyboards of different CNC systems are defined, and the actual execution actions represented by the key states in each CNC system are translated into key events. The key states and key events are then mapped to form a key-value mapping table. Each actual execution action corresponds to at least one key state, and there is a one-to-one correspondence between the actual execution action and the key event.

[0043] The key state mapping file can be configured for different products to simultaneously meet the keyboard requirements of CNC systems for various products. Even if the key states are the same across different CNC systems, the matched key events may differ. In other words, in the key value mapping table, one key event can correspond to different key states, and the actual execution action (key event) behind these key states is the same.

[0044] Suppose that there is a button named X1 in CNC milling machine system A and a button named Y1 in CNC lathe system B. Although the names of these two buttons are different, pressing these two buttons both represent pausing. In this case, the button press state of these two buttons can be mapped to the pausing button event.

[0045] Therefore, during configuration, it is necessary to match the actual actions behind the key states, correspond the actual actions expressed by the key states, and match key states with the same actual actions to form a key-value mapping table.

[0046] Secondly, when the key status on the CNC system keyboard changes, the real-time key status is recorded, including the key's row, column, and whether it is pressed or released, and written to the key input report. The key input report acts as an intermediary, storing key statuses and transmitting them to the CNC system. The data is transmitted in the chronological order of key status changes for easier processing by the CNC system.

[0047] The system analyzes the real-time button status data in the button input report and searches for the corresponding real-time button event in the key value mapping table. Each real-time button event corresponds to a standard key value, which is the button status information that the CNC system can recognize. A unique action can be executed based on the standard key value. Therefore, as long as the CNC system can obtain the standard key value, it can execute the button event corresponding to that button status.

[0048] Finally, the real-time button events are translated into standard key values ​​that the current CNC system can recognize, and new buttons are defined based on these standard key values. The button input report is then sent to the CNC system software. When the CNC system software receives the button data, it parses the button state data and finds the corresponding standard key value in the button state mapping file. Based on this standard key value, a new button is defined. This process is repeated until all current button states can be mapped to a new button, resulting in a complete new universal keyboard. This new universal keyboard, acting as an external keyboard, can then send operation commands to the CNC system. For example, when a new button is pressed, the CNC system can convert the button state of the new button into a standard key value based on the button input report. The CNC system can then execute the corresponding operation based on the button event corresponding to the standard key value.

[0049] Once the button states of a CNC system are defined, a new universal keyboard is obtained. Based on this new universal keyboard, the real-time button states of the next CNC system are integrated into the new universal keyboard. After defining the new buttons for a CNC system according to the above steps, a new universal keyboard can be formed.

[0050] Then, keyboard translation and fusion are performed on other CNC systems. The translation and fusion process specifically includes:

[0051] The key status of the current CNC system is translated into the corresponding key event according to the key value mapping table. The corresponding new key on the new universal keyboard is searched through the standard key value corresponding to the key event. If no corresponding new key is found, a new new key is added to correspond to the standard key value. If a corresponding new key is found, a correspondence is established between the new key and the standard key value.

[0052] Specifically, if a new button event is discovered, such as different operations for lathes and milling machines, a new button needs to be added. The definition of the new button follows the same method described above, and will not be repeated here. If the button event has already been defined, the current real-time state of that button in the current system can be merged into the corresponding new button under the same button event.

[0053] Taking the keyboard of a general-purpose milling machine CNC system as an example, such as Figure 5 As shown, the CNC keyboard hardware only needs to adjust the corresponding row and column matrix according to the hardware structure on the mask. It does not require modification of the specific key state definition for each key. When the key status on the CNC system keyboard changes, the key data (row, column, pressed / released state) is transmitted to the CNC system software. Then, the corresponding standard key is obtained according to the key state mapping table, and the software interface responds to the key event. Through this series of processes, a universal CNC system keyboard is achieved, such as... Figure 2 As shown. In contrast to an external standard keyboard, an external keyboard directly sends standard key presses to the CNC system, and the software interface responds to the corresponding key events.

[0054] The preferred approach, which involves writing the real-time status of the buttons into the button input report, specifically includes:

[0055] Based on the maximum single data reception capacity of the current CNC system, all transmittable key states are packaged and written into a key input report in chronological order within this unit capacity. This saves on the number of data transmissions and improves data transmission efficiency.

[0056] Specifically, when the key state of the CNC system keyboard changes, the row, column, and press / release status information of the key are written into the input report, and the data is transmitted to the CNC system software. Taking the data transmission of USB-HID (Universal Serial Bus-Human Interface Device) devices as an example, USB-HID devices can be divided into low-speed devices, full-speed devices, and high-speed devices according to their transmission speed. Most HID products on the market are low-speed devices. Taking low-speed devices as an example, the maximum data that can be transmitted in each transaction is 8 bytes (Buf[8]). Figure 4 As shown, Buf[0]-Buf[2] can store the row where the key is located, with each 4 bits representing a row of one key, and a maximum of 6 rows of keys can be recorded at the same time. Buf[3]-Buf[5] can store the column where the key is located, with each 4 bits representing a column of one key, and a maximum of 6 columns of keys can be recorded at the same time. Each bit of Buf[6] represents the pressed state of a key, and each bit of Buf[7] represents the released state of a key. Compared with the input report of the standard key, the comparison... Figure 3 and Figure 4 The input report of the new universal keyboard keys can meet the data transmission requirements of the original standard keyboard keys.

[0057] The key state mapping configuration file is configured based on the key states of a standard keyboard (i.e., an existing conventional keyboard), with each key corresponding to a specific key state. When the CNC system software receives key data, it translates the data in the input report into the corresponding standard key state using the key state mapping table. For example... Figure 6 As shown. The button status mapping file can be modified according to different products and different models of CNC systems, such as... Figure 7 As shown, this example uses an XML file format, but is not limited to using XML file format to configure key state mapping files. Figure 8 The CNC milling machine panel shown allows configuration of attributes such as row, column, key, and modifiers in the key state mapping file. The row and column attributes represent the row and column positions of the keys, the key attribute represents the standard key state, and the modifiers attribute represents the key modifiers, enabling the processing of individual or combined keys. Replacing the original method of modifying firmware code to define key states with a key state mapping configuration file provides a more convenient way to handle the needs of different CNC keyboards.

[0058] This invention also provides a universal CNC system keyboard design system, which is used to implement the universal CNC system keyboard design method described above, including:

[0059] The mapping establishment module is used to configure the key states and key events of the keys on the keyboard of each CNC system into a key-value mapping table;

[0060] The report caching module is used to read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report.

[0061] The report parsing module is used to parse the real-time status data of the keys in the key input report and search for the corresponding key events in the key value mapping table.

[0062] The keyboard definition module is used to translate the searched key events into standard key values ​​that the current CNC system can recognize, and define new keys based on the standard key values.

[0063] Please see Figure 8 This is a schematic diagram illustrating an embodiment of the electronic device provided in this invention. For example... Figure 8 As shown, an embodiment of the present invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, it performs the following steps: S1, configuring the key states and key events of the keys on each CNC system keyboard into a key value mapping table.

[0064] S2, Read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report;

[0065] S3, parse the real-time status data of the keys in the key input report, and search for the corresponding key event in the key value mapping table;

[0066] S4 translates the searched key events into standard key values ​​that the current CNC system can recognize, and defines new keys based on the standard key values.

[0067] Please see Figure 9 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. (See diagram below.) Figure 9 As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by the processor, it performs the following steps: S1, configuring the key states and key events of the keys on each CNC system keyboard into a key-value mapping table.

[0068] S2, Read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report;

[0069] S3, parse the real-time status data of the keys in the key input report, and search for the corresponding key event in the key value mapping table;

[0070] S4 translates the searched key events into standard key values ​​that the current CNC system can recognize, and defines new keys based on the standard key values.

[0071] Compared with traditional CNC system keyboards, this invention has the following advantages:

[0072] (1) The configurable key-value mapping table meets the needs of different users for the CNC system keyboard;

[0073] (2) Reduce the frequency of key value definition changes according to different needs, and also reduce the need to change the firmware code of the CNC system keyboard, thus reducing costs.

[0074] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0075] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0076] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0077] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0078] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0079] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0080] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A general keyboard design method for CNC systems, characterized in that, Includes the following steps: S1, Configure the key states and key events of the keys on the keyboard of each CNC system into a key value mapping table; S2, Read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report; The real-time status of the buttons specifically includes: the row and column of the button on the CNC system keyboard where the status has changed, and the state of the button when it is pressed or released. S3, parse the real-time status data of the keys in the key input report, and search for the corresponding key event in the key value mapping table; S4 translates the searched key events into standard key values ​​that the current CNC system can recognize, and defines new keys based on the standard key values; S5. After all the button states of a CNC system are defined, a new universal keyboard is obtained. Based on the new universal keyboard, the real-time button states of the next CNC system are integrated into the new universal keyboard. The fusion process specifically includes: translating the key state of the current CNC system into the corresponding key event according to the key value mapping table, and searching for the corresponding new key on the new universal keyboard through the standard key value corresponding to the key event; If no corresponding new key is found, a new key will be added to correspond to the standard key value. If a corresponding new key is found, a correspondence is established between the new key and the standard key value.

2. The general CNC system keyboard design method according to claim 1, characterized in that, S1 specifically includes: Define the key states of the keys on the keyboard of different CNC systems, translate the actual execution actions represented by the key states of each CNC system into key events, and form a key-value mapping table by mapping the key states to key events.

3. The general CNC system keyboard design method according to claim 2, characterized in that, Each actual action corresponds to at least one key state, and the actual action and the key event are in one-to-one correspondence.

4. The general CNC system keyboard design method according to claim 1, characterized in that, The step of writing the real-time status of the key presses into the key input report in S2 specifically includes: Based on the maximum single data reception capacity of the current CNC system, all transmittable key states are packaged and written into a key input report in chronological order within this unit capacity.

5. A general-purpose CNC system keyboard design system, characterized in that, The system is used to implement the general CNC system keyboard design method as described in any one of claims 1-4, including: The mapping establishment module is used to configure the key states and key events of the keys on the keyboard of each CNC system into a key-value mapping table; The report caching module is used to read the real-time status of the keys on the CNC system keyboard and write the real-time status of the keys into the key input report. The report parsing module is used to parse the real-time status data of the keys in the key input report and search for the corresponding key events in the key value mapping table. The keyboard definition module is used to translate the searched key events into standard key values ​​that the current CNC system can recognize, and define new keys based on the standard key values.

6. An electronic device, characterized in that, It includes a memory and a processor, wherein the processor is used to implement the steps of the general CNC system keyboard design method as described in any one of claims 1-4 when executing a computer management program stored in the memory.

7. A computer-readable storage medium, characterized in that, It stores a computer management program, which, when executed by a processor, implements the steps of the general CNC system keyboard design method as described in any one of claims 1-4.