Processing program management device and computer-readable storage medium
By dividing processing programs into management units with additional block count information, the processing program management device efficiently searches for block positions, addressing the inefficiencies of existing systems and enhancing management efficiency.
Patent Information
- Application Number
- PCT/JP2023/004870
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2025-06-19
AI Technical Summary
Existing processing program management systems are inefficient in searching for block positions within long processing programs, as they require reading the program string one character at a time, leading to increased search time.
The proposed processing program management device divides the processing program into management units, each with additional information such as the number of blocks, allowing for efficient search of block positions by calculating block numbers and determining the storage position within the management unit.
This approach significantly reduces the time required to search for block positions, improving the overall efficiency of processing program management by allowing for faster access and manipulation of blocks within the program.
Smart Images

Figure JP2023004870_19062025_PF_FP_ABST
Abstract
Description
Machining program management device and computer-readable storage medium
[0001] The present disclosure relates to a machining program management device and a computer-readable storage medium.
[0002] A numerical control device is a control device for machine tools. A numerical control device analyzes the machining program and controls the position of the workpiece and spindle, the rotation speed of the cutting tool, etc. using digital "numerical values." A machining program is made up of a collection of units called blocks. Block numbers are serial numbers representing blocks from the beginning of the machining program, and indicate the position in the machining program.
[0003] When editing a machining program, an editing screen is displayed and editing can be performed by inputting data from a keyboard. Since machining programs can be edited block by block, it is possible to change the operation of the machine tool by rewriting blocks while the machine tool is running, for example. For example, see Patent Document 1.
[0004] Japanese Patent Application Laid-Open No. 2003-248507
[0005] When searching for block positions in a machining program, the program string is read character by character from the beginning of the machining program, the characters indicating block delimiters are counted as the number of blocks, and the block number on the editing screen and the block position in memory are searched for. With this search method, the longer the machining program, the longer the search takes.
[0006] In managing machining programs, it is desirable to make it possible to efficiently search for block positions.
[0007] The machining program management device disclosed herein includes a machining program storage unit that stores a machining program in a format in which the machining program is divided into a series of management units; a block number acquisition unit that acquires a specific block number of the machining program; a management unit search unit that reads the number of blocks of the management unit, which is additional information of the management unit, and searches for a management unit containing the specific block number using the block number; and a block search unit that calculates block numbers sequentially from the first block of the management unit containing the specific block number, and searches for the storage location of the block corresponding to the specific block number.
[0008] 1 is a block diagram of a machining program management device. FIG. 2 is a schematic diagram explaining the format of a machining program. FIG. 3 is a schematic diagram explaining the format of a machining program. FIG. 4 is a screen configuration diagram of an editing screen for a machining program. FIG. 5 is a flowchart explaining a block search method. FIG. 6 is an explanatory diagram of a block search method. FIG. 7 is an explanatory diagram of writing a block. FIG. 8 is an explanatory diagram of a block search method in a machining program converted to the format (1). FIG. 9 is an explanatory diagram of a block search method in a machining program converted to the format (2). FIG. 10 is a flowchart explaining a block search method in a machining program converted to the format (3). FIG. 11 is an explanatory diagram of a block search method in a machining program converted to the format (3). FIG. 12 is a hardware configuration diagram of a machining program management device.
[0009] The configuration of the machining program management device 100 will be described with reference to FIG. 1. First, the relationship between the machining program management device 100 and the machining program editing device 200 will be described. The machining program management device 100 of this embodiment divides a machining program into management units and manages them. The machining program management device 100 is applied to an information processing device such as a numerical control device. The machining program editing device 200 includes a program display unit 21 and an edit receiving unit 22, receives edits to the machining program by a user, and outputs the block numbers of the edited machining program and the edit contents to the machining program management device 100. The machining program management device 100 converts the block numbers acquired from the machining program editing device 200 into storage locations in the machining program storage unit 17. The machining program management device 100 can rewrite the machining program on a block-by-block basis. This allows for flexible operations such as partial addition, modification, and deletion without rewriting the entire machining program. The machining program editing device 200 is implemented in a numerical control device, a PC (personal computer), or the like. The machining program management device 100 and the machining program editing device 200 may be implemented in a single device.
[0010] 1 is a block diagram of a machining program management device 100. The machining program management device 100 includes a new program acquisition unit 11, a format conversion unit 12, a block number acquisition unit 13, a management unit search unit 14, a block search unit 15, and a block writing unit 16. Note that the components of the machining program management device 100 are categorized by their functions, and do not necessarily have to be clearly distinguished in terms of physical configuration and program configuration.
[0011] The new program acquisition unit 11 acquires a new machining program that is not divided into management units. The new program is created using an editor in an information processing device such as a numerical control device or a PC. The new program may be acquired from a portable storage medium or via a network.
[0012] The format conversion unit 12 converts the format of the acquired new program. In converting the format, the format conversion unit 12 divides the new program into predetermined management units. The predetermined management units are, for example, a predetermined size such as several kilobytes or several megabytes. The size is assumed to be set in advance. The management unit 1 of the machining program 3 in FIG. 2 includes five blocks. Dividing the machining program into management units facilitates local editing of the machining program. For example, if the size of the management unit is exceeded due to the insertion of a block, a new management unit is added without rewriting the entire file. Dividing the program into management units allows for frequent editing, such as additions, changes, and deletions.
[0013] The format conversion unit 12 divides the machining program into management units and adds additional information called the block number to each management unit. The block number indicates the number of block separators included in the management unit. A block separator is a specific character string that indicates the end of a block. Line feed characters (CR = '0x0D', LF = '0x0A') are often used as block separators. Any character code may be used for block separators. The format conversion unit 12 can associate characters constituting the machining program with block numbers by counting the block separators. That is, by reading each character from the beginning of the machining program, the block number of the block up to the first block separator is "1," the block number of the block up to the next block separator is "2," the block number of the block up to the next block separator is "3," and so on. The format conversion unit 12 counts the block separators included in the management unit and adds them to the management unit as additional information called the "block number." For example, the management unit in Figure 2 includes five block separators. The format conversion unit 12 adds additional information called the block number "5" to the management unit.
[0014] Here, the format of the machining program will be described. For example, as shown in FIG. 3 , machining program formats include (1) a format in which blocks are not divided and a block separator is arranged as the last character of a management unit; (2) a format in which blocks are divided so that the last block of a management unit straddles the next block; and (3) a format in which (1) and (2) are mixed. (1) When blocks are recorded without being divided so that a block separator is the last character of a management unit, the number of block separators included in the management unit matches the number of blocks constituting the management unit. (2) When blocks are divided and recorded so that the last block of a management unit straddles the next block, a discrepancy occurs between the number of block separators included in the first management unit and the number of blocks constituting the first management unit. In the case of (3), the method of searching for and writing blocks changes depending on which method is used. This will be described in another embodiment. The method to be used is specified by the machining program management device 100.
[0015] The block number acquisition unit 13 acquires block numbers from the machining program editing device 200. The machining program editing device 200 accepts user operations on the machining program displayed on the program display unit 21, and outputs the block numbers of the blocks of the machining program accepted by the edit acceptance unit 22 and the edit content to the machining program management device 100. Figure 4 shows an example of an edit screen of the machining program editing device 200. On the edit screen of Figure 4, a block number is displayed for each block of the machining program. The block number may or may not be displayed on the edit screen. The edit acceptance unit 22 of the machining program editing device 200 accepts user operations. The block number acquisition unit 13 acquires the operation content accepted by the edit acceptance unit 22 and the block number of the operation target.
[0016] The management unit search unit 14 searches for a management unit containing a block with the block number acquired by the block number acquisition unit 13. The block position search method will be described with reference to the flowchart of FIG. 5 and the explanatory diagram of FIG. 6. The number of blocks is read first from the first management unit 1. The management unit search unit 14 first inputs 1 into n (step S11) and reads the number of blocks in management unit n (step S12). The management unit search unit 14 calculates the range of block numbers included in management unit n based on the number of blocks and determines whether the block to be searched exists in management unit n (step S13). If the block to be searched exists in management unit n (step S14; Yes), the management unit search unit 14 performs a block search, as described below. If the block to be searched does not exist in management unit n (step S14; No), the management unit search unit 14 inputs n+1 into n and changes the management unit n to be searched to the next management unit n+1 (step S15). The management unit search unit 14 proceeds to step S12 and reads the number of blocks in the next management unit. The management unit search section 14 repeats the processes from step S12 to step S15 until it detects a management unit that includes the block to be searched.
[0017] The block search unit 15 reads the machining program character by character from the beginning of the management unit containing the block to be searched, and determines whether the read character is a block separator. If the read character is a block separator, the block search unit 15 increments the block number by 1. The value of the block number at this time is the block number of the block next to the most recently read block separator. The block search unit 15 compares the calculated block number with the block number to be searched, and associates the block number of the block to be searched with the position in the machining program storage unit 17.
[0018] A block search method will be described in detail with reference to FIG. 6. First, a search is made for the management unit that contains the block to be searched. In the example of FIG. 6, the number of blocks in "management unit 1" is "10," so blocks with block numbers "1 to 10" exist in "management unit 1." Since the block number of the block to be searched is "12," the block to be searched does not exist in "management unit 1." Since the next "management unit 2" has the number of blocks "7," blocks with block numbers "11 to 17" exist in "management unit 2." Since the block number of the block to be searched is "12," "11≦12≦17" holds, and the determination result is that the block to be searched exists in "management unit 2."
[0019] The block search unit 15 searches for where in the management unit the search target block is located. The block search unit 15 compares the block number of the first block in "management unit 2" with the block number of the search target block. The first block number of "management unit 2" is "11", which is different from the block number "12" of the search target block. The block search unit 15 reads the machining program of "management unit 2" character by character, and if a block separator is found, adds "1" to the block number. By adding "1" to the block number, the block number becomes "12 (= 11 + 1)". The search target block number "12" is equal to the block number of the character next to the block separator. This allows the block search unit 15 to associate the search target block number obtained from the machining program editing device 200 with the storage location of the block in the machining program storage unit 17.
[0020] The block writing unit 16 updates the edited content in the machining program editing device 200 so as to reflect the edited content in the machining program in the memory. Block writing will be described with reference to Fig. 7. As a premise, in the example of Fig. 7, the number of blocks in "management unit 1" is "k", and the number of blocks in "management unit 2" is "l". The block with block number "k+2" is the target of editing, and one block "(k+2)'" is added next to "k+2".
[0021] When the block writer 16 inserts a block, it adds the number of block separators that has increased due to the insertion of the block, and updates the number of blocks as additional information of the management unit.
[0022] When editing increases the number of characters in a block or inserts a block, the size of the management unit may be exceeded. When the size of the management unit is exceeded, the block writing unit 16 adds a new management unit. When adding a new management unit, the block is written in one of the formats (1), (2), or (3) described above. The format to be used is assumed to be specified in advance.
[0023] As described above, the machining program management device 100 divides a machining program into management units and manages them. The machining program management device 100 adds the number of blocks included in the management unit to the management unit. The machining program management device 100 can search for which management unit the target block is included in based on the number of blocks added to the management unit. The machining program management device 100 of this embodiment only reads one character at a time from the beginning of the management unit and determines the number of blocks in the management unit that includes the target block. Therefore, it is not necessary to determine one character at a time in management units other than the management unit that includes the target block, and the block position search can be made more efficient.
[0024] [Correction based on Rule 91 07.04.2025] To determine whether the search target block is included in a management unit, it is also possible to calculate only the block number at the end of the management unit. Using the machining program in Figure 6 as an example, the last block number of management unit 1 is "10." Since the search target block number "12" is larger than the last block number "10" of management unit 1, it is clear that the search target block is not included in management unit 1. The last block number of management unit 2 is "17." Since the search target block number "12" is smaller than the last block number "17" of management unit 2, it is clear that the search target block is included in management unit 2.
[0025] [Search Method for Each Format] The search method for a block differs depending on the format of the management unit. Below, the differences in the search method for the three formats (1), (2), and (3) will be explained.
[0026] [(1) Format in which the last character of a management unit is a block delimiter] When a machining program is saved so that the last character of a management unit is a block delimiter, the number of blocks constituting the management unit matches the number of blocks, which is additional information of the management unit. The management unit search unit 14 calculates the range of block numbers included in management unit n using the following method. In the following description, the block number of the first block in management unit n is referred to as FBN (First Block Number), the block number of the last block in management unit n is referred to as LBN (Last Block Number), and the block number to be searched is referred to as TN (Target Number).
[0027] The range of block numbers included in management unit n is between the block number FBN of the first block and the block number LBN of the last block. If the number of blocks in management unit n is "m", the block number FBN of the first block in management unit n is the sum of the number of blocks up to the management unit n-1 immediately before management unit n plus 1. The block number LBN of the last block in management unit n is the sum of the number of blocks up to the management unit n-1 immediately before management unit n plus the number of blocks "m" of management unit n.
[0028] [Correction based on Rule 91 07.04.2025] The management unit search unit 14 searches for management units containing block number TN, starting from the first management unit 1. The search method involves first calculating the first block number FBN and the last block number LBN of the first management unit 1 and comparing them with the search target block number TN. If the search target block number TN is not included in management unit 1, the management unit search unit 14 calculates the first block number FBN and the last block number LBN of the next management unit 2 and compares them with the search target block number TN. If the search target block number TN is not included in management unit 2, the management unit search unit 14 calculates the first block number FBN and the last block number LBN of the next management unit. The management unit search unit 14 repeats the same process to search for a management unit containing the block with the search target block number TN.
[0029] The block search unit 15 searches for the block to be searched. The block search unit 15 first compares the block number FBN of the first block in the management unit that includes the block to be searched with the block number TN of the block to be searched. If the comparison shows that the block number TN of the block to be searched is greater than the block number FBN of the first block in the management unit, the block search unit 15 reads the next character. If the next character is a block separator, the block search unit 15 adds 1 to the first block number and compares it with the block number TN of the block to be searched. If the next character is not a block separator, the block search unit 15 reads the character after that. The block search unit 15 repeats this process until the block number of the read character matches the block number TN of the block to be searched.
[0030] The block search method will be specifically described with reference to Figure 8. In the example of Figure 8, the number of blocks in management unit 1 is "k", the number of blocks in management unit 2 is "l", the number of blocks in management unit 3 is "m", and the block number TN of the block to be searched is "k+l+2". The management unit search unit 14 first calculates the first block number FBN and the last block number LBN of the first management unit 1. The first block number FBN of management unit 1 is "1", and the last block number LBN is "k". The search target block number TN "k+l+2" is not included in this range. If the search target block is not included in management unit 1, the management unit search unit 14 calculates the range of block numbers included in the next management unit 2. The first block number FBN of management unit 2 is "the number of blocks k in management unit 1 plus 1", that is, "k+1". The last block number LBN of management unit 2 is "k+l", which is the sum of the number of blocks "k" in management unit 1 and the number of blocks "l" in management number 2. If the block to be searched is not included in management unit 2, the management unit search unit 14 determines that the block to be searched is not included in management unit 2, and calculates the range of block numbers of the next management unit 3. The first block number FBN of management unit 3 is "the sum of the number of blocks in management unit 1 and management unit 2 plus 1", that is, "k+l+1". The last block number LBN of management unit 3 is "k+l+m", which is the sum of the first block number "k+l" in management unit 1 and management unit 2 plus the number of blocks "m" in management unit 3. The search target block number TN "k+l+2" is included in this range. The management unit search unit 14 determines that the management unit containing the search target block is management unit 3.
[0031] The block search unit 15 searches for the target block. The block search unit 15 reads each character from the beginning of the management unit 3 and searches for a block separator. If the read character is a block separator, the block search unit 15 increments the block number by 1. If the calculated block number is equal to the target block number TN, the block search unit 15 determines that the character next to the most recently read block separator is the first character of the target block. This associates the target block number with the position of the target block in the machining program storage unit 17. In the example of FIG. 8 , when the block search unit 15 detects a block separator, it adds 1 to the first block number "k+l+1" of the management unit 3 and calculates the block number "k+l+2" of the next block. The calculated block number "k+l+2" is equal to the target block number "k+l+2." This determines the position of the target block number "k+l+2" in the machining program storage unit 17.
[0032] In the above-described machining program management device 100, the machining program is saved so that the last character of the management unit becomes a block separator. As a result, the number of blocks constituting the management unit matches the number of blocks (the number of block separators included in the management unit) as additional information of the management unit. Using the above-described method, the machining program management device 100 can calculate the range of block numbers included in the management unit and search for which management unit the target block is included in.
[0033] [(2) Format in which the last block of a management unit straddles the next block] In the case of (2), a discrepancy occurs between the number of blocks (the number of block separators included in the management unit) as additional information for the management unit and the number of blocks included in the management unit. Because the last block of management unit n is divided into two and recorded across the next management unit n+1, the number of blocks included in management unit n is greater than the number of blocks (the number of block separators) by a discrepancy of "1." In the case of (2), to correct the discrepancy in the number of blocks in the management unit, 1 is added to the block number LBN at the end of the management unit. In the example of FIG. 9, if the number of blocks in management unit n is "m," the block number of the last block of management unit n is calculated by adding the sum of the number of blocks up to the management unit n-1 immediately before management unit n, the number of blocks "m" in management unit n, and the discrepancy in the number of blocks "1." This allows the range of block numbers for the blocks included in each management unit to be calculated.
[0034] A block search method will be specifically described with reference to FIG. 9 . In the example of FIG. 9 , the number of blocks in management unit 1 is "k," the number of blocks in management unit 2 is "l," the number of blocks in management unit 3 is "m," and the block number TN of the block to be searched is "k+l+2." The management unit search unit 14 first calculates the first block number FBN and the last block number LBN of the first management unit 1. The first block number FBN of management unit 1 is "1," and the last block number LBN is "k+1," which is the value obtained by adding the block number "k" to the block number deviation "1." Because the search target block number TN "k+l+2" is not included in this range, the management unit search unit 14 determines that the search target block is not included in management unit 1 and calculates the range of block numbers included in the next management unit 2. The block number FBN of the first block of management unit 2 is "the value obtained by adding 1 to the block number k of management unit 1," i.e., "k+1." The last block number of management unit 2 is the sum of the number of blocks in management unit 1 and management unit 2 plus "1", i.e., "k+l+1". Because the search target block number "k+l+2" is not included in this range, the management unit search unit 14 calculates the range of block numbers included in the next management unit 3. The first block FBN of management unit 3 is the "sum of the number of blocks in management unit 1 and management unit 2 plus 1", i.e., "k+l+1". The last block number LBN of management unit 3 is "k+l+m+1", the "sum of the number of blocks in management unit 1 and management unit 2" plus the number of blocks "m" in management unit 3 and the difference in block numbers of "1". The search target block number "k+l+2" is included in the range of management unit 3. The management unit search unit 14 determines that the management unit containing the search target block is management unit 3.
[0035] The block search unit 15 searches for the position of the block number TN to be searched for in the management unit 3. The block search unit 15 reads each character from the beginning of the management unit 3, and if the read character is a block separator, it adds "1" to the current block number. The block search unit 15 determines whether the block number TN to be searched for is equal to the calculated block number. If the two block numbers are equal, it determines that the character following the most recently read block separator is the first character of the block to be searched.
[0036] In the above-described machining program management device 100, blocks are divided and saved so that the last block of a management unit straddles the next block. In the format (2), machining programs can be recorded without gaps in the management unit, eliminating wasted capacity. In the search method (2), the management unit search unit 14 can calculate the range of block numbers included in the management unit, just like in (1), simply by adding a offset of "1," which is efficient and requires less computational load. However, in the format (2), because blocks are adjusted so as to straddle two management units, a process of inserting unnecessary characters may be required when recording the machining program.
[0037] [(3) A format in which (1) and (2) are mixed] When (1) and (2) are mixed, the judgment condition is changed depending on whether the last character of the management unit is a block separator or not.
[0038] 10 is a flowchart showing the operation of the machining program management device in case (3). When calculating the range of block numbers included in management unit n (step S21), the management unit search unit 14 first reads the last character of management unit n (step S22) and determines whether the last character is a block separator (step S23). If the last character is a block separator (step S24; Yes), the number of blocks (the number of block separators), which is additional information of management unit n, does not differ from the number of blocks included in management unit n, so correction of the discrepancy is not necessary. The management unit search unit 14 adds the number of blocks "m" of management unit n to the sum of the number of blocks up to the management unit (n-1) immediately before management unit n to calculate the block number LBN of the last block of management unit n (step S25).
[0039] If the last character of management unit n is not a block separator (step S24; No), the number of blocks (the number of block separators), which is additional information of management unit n, does not match the number of blocks included in management unit n. The management unit search unit 14 adds the sum of the numbers of blocks up to the management unit n-1 immediately before management unit n, the number of blocks "m" of management unit n, and the block number difference "1" to calculate the block number LBN of the last block of management unit n (step S26).
[0040] The management unit search unit 14 determines whether the block of the search target block number TN is included within the range of management unit n (step S27). If the block of the search target block number TN is not included within the range of management unit n (step S28; No), the management unit search unit 14 proceeds to step S22, inputs n+1 to n, and changes the search target management unit n to the next management unit n+1 (step S29). If the block of the search target block number TN is included within the range of management unit n (step S28; Yes), the management unit search unit 14 determines that the search target block is included in management unit n.
[0041] [Correction based on Rule 91 07.04.2025] A specific description of the management unit search method for case (3) will be given with reference to Figure 11. In the example of Figure 11, the number of blocks in management unit 1 is "k," the number of blocks in management unit 2 is "l," and the number of blocks in management unit 3 is "m." The management unit search unit 14 reads the last character of the first management unit 1 and determines whether the last character is a block separator. The last character of management unit 1 in Figure 11 is a block separator. The management unit search unit 14 calculates the block number LBN "k" of the last block of management unit 1. The management unit search unit 14 compares the block number LBN "k" of the last block of management unit 1 with the search target block number TK "k+l+2" and determines that the search target block is not included in management unit 1. The management unit search unit 14 reads the last character of the next management unit 2 and determines whether the last character of management unit 2 is a block separator. The last character of management unit 2 in Figure 11 is not a block separator. The management unit search unit 14 adds the number of blocks "l" in management unit 2 and a shift of "1" to the number of blocks "k" in management unit 1 to calculate the block number LBK "k+l+1" of the block at the end of management unit 2. The management unit search unit 14 compares the block number LBN "k+l+1" of the block at the end of management unit 2 with the search target block number TK "k+l+2" and determines that the search target block is not included in management unit 2. The management unit search unit 14 reads the next management unit 3 and determines whether the last character of management unit 3 is a block delimiter. The last character of management unit 3 in FIG. 11 is not a block delimiter. The management unit search unit 14 adds the number of blocks "m" in management unit 3 and a shift of "1" to the sum "k+l" of the numbers of blocks in management unit 1 and management unit 2 to calculate the block number LBK "k+l+m+1" of the block at the end of management unit 3. The management unit search unit 14 compares the block number LBK "k+l+m+1" at the end of management unit 3 with the block number TK "k+l+2" to be searched for, and determines that the block to be searched for is included in management unit 3.
[0042] In format (3), there are cases where misalignment occurs at the end of the management unit and cases where no misalignment occurs. If the last character is not a block delimiter, the machining program management device 100 corrects the misalignment by adding "1" to the block number at the end of the management unit. If the last character of the management unit is a block delimiter, no misalignment correction is performed. The search method (3) is highly versatile because it can be applied to both formats (1) and (2). The format (3) records the machining program without gaps, eliminating waste. Furthermore, the format (3) does not require adjusting the position of the block delimiter. However, the search method (3) has the problem of requiring more calculations than methods (1) and (2) because it determines whether to correct the misalignment when searching for the management unit.
[0043] The hardware configuration of the machining program management device 100 to which the present disclosure is applied will be described below. Fig. 12 is a hardware configuration diagram of the machining program management device 100. As shown in Fig. 12, the machining program management device 100 includes a CPU 111 that controls the entire machining program management device 100, a ROM 112 that records programs and data, and a RAM 113 for temporarily expanding data. The CPU 111 reads out a system program recorded in the ROM 112 via a bus and executes machining program management processing.
[0044] The nonvolatile memory 114 is backed up by, for example, a battery (not shown), and the stored state is maintained even when the power of the machining program management device 100 is turned off. The nonvolatile memory 114 stores various data, such as programs read from the external device 120 via the interfaces 115, 118, and 119 and user operations input via the input unit 30. The nonvolatile memory 114 may also store programs and data for executing the block search of the present disclosure. In addition, various data are displayed on the display unit 70.
[0045] The interface 115 is an interface for connecting the machining program management device 100 to an external device 120 such as an adapter. Programs, various parameters, etc. are read from the external device 120.
[0046] Although the present disclosure has been described in detail, the present disclosure is not limited to the individual embodiments described above. Various additions, substitutions, modifications, partial deletions, etc. are possible in these embodiments without departing from the gist of the present disclosure or the gist of the present disclosure derived from the claims and their equivalents. Furthermore, these embodiments can also be implemented in combination. For example, in the above-described embodiments, the order of each operation and the order of each process are shown as examples and are not limited to these.
[0047] The following supplementary notes are further disclosed regarding the above-described embodiment and modified examples. (Supplementary Note 1) The machining program management device (100) includes a machining program storage unit (17) that stores a machining program in a format in which the machining program is divided into a series of management units, a block number acquisition unit (13) that acquires a specific block number of the machining program, a management unit search unit (14) that reads the number of blocks of the management unit, which is additional information of the management unit, and searches for a management unit including the specific block number using the block number, and a block search unit (15) that calculates block numbers sequentially from the first block of the management unit including the specific block number and searches for a storage position of a block corresponding to the specific block number. (Supplementary Note 2) In the machining program management device (100), the block number acquisition unit (13) includes a block writing unit (16) that acquires editing content of the block indicated by the specific block number, edits the blocks included in the management unit according to the editing content, and updates the number of blocks, which is additional information of the management unit. (Supplementary Note 3) In the machining program management device (100), when the editing causes the management unit to exceed a predetermined size, the block writing unit (16) adds a new management unit and writes the excess edited content. (Supplementary Note 4) The machining program management device (100) includes a new program acquisition unit (11) that acquires a new machining program that is not divided into management units, and a format conversion unit (12) that divides the new machining program into a series of management units, counts the number of blocks included in each management unit, and adds the number of blocks to each management unit as additional information. (Supplementary Note 5) In the machining program management device (100), the number of blocks is the number of block separators included in each management unit, and in the series of management units, the last block of each management unit is divided so as to span over to the next block, and the management unit search unit (14) adds 1 to the number of blocks as additional information of the management unit to correct a discrepancy between the number of blocks as the additional information and the number of blocks included in the management unit.(Supplementary Note 6) In the machining program management device (100), the number of blocks is the number of block separators included in each management unit, and the management unit search unit (14) determines whether the last character of the management unit is a block separator, and if the last character of the management unit is not a block separator, adds 1 to the number of blocks to correct a discrepancy between the number of blocks as the additional information and the number of blocks included in the management unit. (Supplementary Note 7) A computer-readable storage medium (112, 113, 114), when executed by one or more processors (111), stores a machining program in a format divided into a series of management units in a predetermined storage area, acquires a specific block number of the machining program, reads the number of blocks of the management unit which is additional information of the management unit, uses the number of blocks to search for a management unit including the specific block number, calculates block numbers in order from the first block of the management unit including the specific block number, and searches for a storage position of a block corresponding to the specific block number.
[0048] 100 Machining program management device 11 New program acquisition unit 12 Format conversion unit 13 Block number acquisition unit 14 Management unit search unit 15 Block search unit 16 Block writing unit 17 Machining program storage unit 111 CPU 112 ROM 113 RAM 114 Non-volatile memory
Claims
1. A machining program management apparatus comprising: a machining program storage unit that stores a machining program in a format in which the machining program is divided into a series of management units; a block number acquisition unit that acquires a specific block number of the machining program; a management unit search unit that reads out the number of blocks of the management unit, which is additional information of the management unit, and searches for a management unit including the specific block number using the number of blocks; and a block search unit that calculates block numbers in order from the head block of the management unit including the specific block number and searches for a storage position of a block corresponding to the specific block number.
2. The machining program management apparatus according to claim 1, wherein the block number acquisition unit includes a block writing unit that acquires editing contents of a block indicated by the specific block number, edits blocks included in the management unit according to the editing contents, and updates the number of blocks, which is additional information of the management unit.
3. The machining program management apparatus according to claim 2, wherein when the management unit exceeds a predetermined size due to the editing, the block writing unit adds a new management unit and writes the exceeded editing contents.
4. The machining program management apparatus according to claim 1, further comprising: a new program acquisition unit that acquires a new machining program not divided into management units; and a format conversion unit that divides the new machining program into a series of management units, counts the number of blocks included in each management unit, and adds the number of blocks as additional information to each management unit.
5. The number of blocks is the number of block delimiters included in each management unit. In the series of management units, the last block of each management unit is divided so as to span to the next block. The management unit search unit corrects a deviation between the number of blocks as additional information of the management unit and the number of blocks included in the management unit by adding 1 to the number of blocks as additional information of the management unit. The machining program management apparatus according to claim 1.
6. The number of blocks is the number of block delimiters included in each management unit. The management unit search unit determines whether the last character of the management unit is a block delimiter. If the last character of the management unit is not a block delimiter, 1 is added to the number of blocks to correct the deviation between the number of blocks as the additional information and the number of blocks included in the management unit. The processing program management device according to claim 1.
7. A computer-readable storage medium storing instructions that, when executed by one or more processors, store a processing program in a format divided into a series of management units in a predetermined storage area, obtain a specific block number of the processing program, read the number of blocks of the management unit that is the additional information of the management unit, use the number of blocks to search for the management unit including the specific block number, calculate block numbers in order from the first block of the management unit including the specific block number, and search for the storage position of the block corresponding to the specific block number.