WO2023037414A1 - Control device - Google Patents

Control device Download PDF

Info

Publication number
WO2023037414A1
WO2023037414A1 PCT/JP2021/032866 JP2021032866W WO2023037414A1 WO 2023037414 A1 WO2023037414 A1 WO 2023037414A1 JP 2021032866 W JP2021032866 W JP 2021032866W WO 2023037414 A1 WO2023037414 A1 WO 2023037414A1
Authority
WO
WIPO (PCT)
Prior art keywords
access frequency
shared variable
shared
unit
access
Prior art date
Application number
PCT/JP2021/032866
Other languages
French (fr)
Japanese (ja)
Inventor
拓哉 坂上
Original Assignee
ファナック株式会社
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 ファナック株式会社 filed Critical ファナック株式会社
Priority to PCT/JP2021/032866 priority Critical patent/WO2023037414A1/en
Publication of WO2023037414A1 publication Critical patent/WO2023037414A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication

Definitions

  • the present invention relates to a control device.
  • FIG. 14 is a diagram illustrating an example of shared variables linked between applications.
  • the control device C1 has, for example, a plurality of processor modules PM1, PM2, PM3, etc., and the plurality of processor modules PM1, PM2, PM3, etc. are connected via a bus (or network).
  • the processor module PM1 has a CPU1A and a memory M1
  • the processor module PM2 has a CPU2A and a memory M2
  • the processor module PM3 has a CPU3A and a memory M3.
  • the CPU 1A then executes the application AP1 and accesses the shared variable x stored in the memory M1.
  • the CPU 2A also executes the application AP2 and accesses the shared variable y stored in the memory M2.
  • the CPU 3A also executes the application AP3 and accesses the shared variable z stored in the memory M3.
  • the application AP2 executed by the CPU2A accesses the shared variable x stored in the memory M1 of the processor module PM1 via the bus (or network), thereby enabling the sharing between the application AP1 and the application AP2. Realize the variable x.
  • the CPU 2A frequently accesses the shared variable x stored in the memory M1 of the processor module PM1, there is a problem that the processing time increases due to an increase in the number of accesses to the memory M1.
  • control device of the present disclosure is a control device having a plurality of processors and a plurality of local memories accessed by each of the plurality of processors, wherein a shared memory including at least a virtual address of a shared variable and a physical address of a shared variable is provided.
  • a storage unit for storing variable information; an access frequency evaluation unit for evaluating frequency of access to the shared variable included in the shared variable information for each execution program executed by each of the plurality of processors; and a memory placement optimization unit that changes the local memory in which the shared variables are placed.
  • the access frequency of an application executed by each CPU to a shared variable, and allocate shared variables with a high access frequency to the local memory of the CPU executing the application.
  • the number of accesses via the bus (or network) is reduced, which has the effect of shortening the application processing time.
  • FIG. 1 is a functional block diagram showing a functional configuration example of a numerical controller according to a first embodiment
  • FIG. FIG. 4 is a diagram showing an example of shared variable information
  • FIG. 5 is a diagram showing an example of access frequency for each shared variable in an axis control application
  • FIG. 10 is a diagram showing an example of access frequency for each shared variable in a display control application
  • FIG. 10 is a diagram showing an example of access frequency for each shared variable in a peripheral device control application
  • FIG. 10 is a diagram showing an example of access frequency after correction for each shared variable in an axis control application;
  • FIG. 10 is a diagram showing an example of access frequency after correction for each shared variable in the display control application;
  • FIG. 10 is a diagram showing an example of corrected access frequency for each shared variable in a peripheral device control application; 4 is a flowchart for explaining placement optimization processing of a numerical control device;
  • FIG. 7 is a functional block diagram showing a functional configuration example of a numerical controller according to a second embodiment;
  • 2 is a functional block diagram showing a functional configuration example of an information processing device;
  • FIG. FIG. 11 is a functional block diagram showing a functional configuration example of a numerical controller according to a third embodiment;
  • 2 is a functional block diagram showing a functional configuration example of an information processing device;
  • FIG. It is a figure which shows an example of the evaluation parameter stored in an evaluation parameter memory
  • FIG. 1 is a functional block diagram showing a functional configuration example of a control device.
  • the control device 1 controls, for example, machine tools, robots, etc., and has a control module 2, n processor modules 3-1 to 3-n, and a storage unit 4 (n is 2 is an integer greater than or equal to ).
  • the control module 2, processor modules 3-1 to 3-n, and storage unit 4 are communicably connected via a bus 5.
  • FIG. 1 is a functional block diagram showing a functional configuration example of a control device.
  • the control device 1 controls, for example, machine tools, robots, etc., and has a control module 2, n processor modules 3-1 to 3-n, and a storage unit 4 (n is 2 is an integer greater than or equal to ).
  • the control module 2, processor modules 3-1 to 3-n, and storage unit 4 are communicably connected via a bus 5.
  • FIG. 1 is a functional block diagram showing a functional configuration example of a control device.
  • the control device 1 controls, for example, machine tools, robots,
  • the storage unit 4 is a main memory such as a ROM (Read Only Memory), and stores a system program and an application program executed by the control module 2, as well as n executions executed by each of the processor modules 3-1 to 3-n described later. format execution programs 40-1 to 40-n may be stored.
  • the storage unit 4 also includes shared variable information 41 .
  • the shared variable information 41 includes, for example, information on shared variables including at least virtual addresses of shared variables and physical addresses of shared variables for cooperative operation among the execution programs 40-1 to 40-n.
  • the processor modules 3-1 to 3-n have, for example, a CPU 30 and a local memory 22, and execute execution programs 40-1 to 40 for axis control, display control, etc. based on control instructions from the control module 2, which will be described later. -n each run.
  • the control module 2 has a CPU 21 and a local memory 22 such as a RAM (Random Access Memory).
  • the CPU 21 is a processor that controls the control device 1 as a whole.
  • the CPU 21 reads, via the bus 5, a system program stored in the storage unit 4, which is a main memory, and an application program for executing a function unit described later, loads them into the local memory 22, and stores the system program and the application program.
  • the entire control device 1 is controlled according to. Thereby, as shown in FIG. 1, the CPU 21 is configured to implement the functions of the access frequency evaluation unit 21-1 and the memory allocation optimization unit 21-2.
  • the access frequency evaluation unit 21-1 calculates the frequency of access to the shared variables included in the shared variable information 41 for each of the execution programs 40-1 to 40-n executed by the CPUs 30 of the processor modules 3-1 to 3-n. Evaluate.
  • the memory allocation optimization unit 21-2 changes the local memory 31 in which the shared variables are allocated among the processor modules 3-1 to 3-n based on the access frequency evaluated by the access frequency evaluation unit 21-1. By doing so, the control device 1 can analyze the access frequency of the application executed by each CPU 30 to the shared variable, and arrange the shared variable with high access frequency in the local memory of the CPU executing the application. .
  • the basic operation of the control device has been described above.
  • control device a specific embodiment of the control device will be described by exemplifying a numerical control device as the control device.
  • the present invention is not limited to numerical control devices, but can also be applied to robot control devices having a plurality of processors that control industrial robots, for example. It is also applicable to any control device with multiple processors.
  • an axis control application, a display control application, and a peripheral device control application will be exemplified as execution programs to be executed in each of a plurality of processors, the present invention can also be applied to execution programs of arbitrary applications other than these. . Note that each processor may execute a plurality of programs.
  • FIG. 2 is a functional block diagram showing a functional configuration example of the numerical controller according to the first embodiment.
  • the axis control application, the display control application, and the peripheral device control application are exemplified as described above.
  • the present invention is not limited to axis control applications, display control applications, and peripheral device control applications, and can be applied to arbitrary applications other than axis control applications, display control applications, and peripheral device control applications. As shown in FIG.
  • the numerical control device 10 is a numerical control device known to those skilled in the art. Send commands to a machine tool (not shown). Thereby, the numerical controller 10 controls the operation of the machine tool (not shown). If the machine tool (not shown) is a robot or the like, the numerical controller 10 may be a robot controller or the like.
  • the numerical controller 10 has a system control module 110 , an axis control module 120 , a display control module 130 , a peripheral device control module 140 and a storage section 150 .
  • the system control module 110 , the axis control module 120 , the display control module 130 , the peripheral device control module 140 and the storage unit 150 are communicably connected via the bus 160 .
  • the system control module 110 has a CPU 111 and a local memory 112 .
  • the CPU 111 also has an access frequency evaluation unit 1111 and a memory allocation optimization unit 1112 .
  • the axis control module 120 also has a CPU 121 and a local memory 122 .
  • the display control module 130 has a CPU 131 and a local memory 132 .
  • the peripheral device control module 140 has a CPU 141 and a local memory 142 .
  • the storage unit 150 is a main memory such as a ROM (Read Only Memory).
  • the storage unit 150 may store a system program and a plurality of application programs (eg, axis control application 151, display control application 152, peripheral device control application 153).
  • the storage unit 150 also includes shared variable information 154, which will be described later.
  • the axis control application 151 is, for example, an execution program that controls a spindle or the like included in a machine tool (not shown), and is loaded into the axis control module 120 described later and executed.
  • the display control application 152 is, for example, an execution program that controls the display of a display device such as an LCD (Liquid Crystal Display) included in the numerical controller 10, and is loaded into the display control module 130 described later and executed.
  • a display device such as an LCD (Liquid Crystal Display) included in the numerical controller 10
  • LCD Liquid Crystal Display
  • the peripheral device control application 153 is, for example, an execution program that controls peripheral devices arranged around a machine tool (not shown), and is loaded into the peripheral device control module 140 described later and executed.
  • the shared variable information 154 includes, for example, information on shared variables for cooperative operation among the axis control application 151, the display control application 152, and the peripheral device control application 153, for example. Specifically, the shared variable specified when each application accesses the shared variable, the virtual address used when referencing the value of the shared variable, and the physical address where the value of the shared variable is actually stored , and the corresponding relationship.
  • FIG. 3 is a diagram showing an example of the shared variable information 154. As shown in FIG. As shown in FIG.
  • the shared variable information 154 has storage areas for "shared variables,””virtualaddresses," and "physical addresses.”
  • shared variables such as "x", "y”, and "z” are stored.
  • virtual address in the shared variable information 154, for example, the shared variable x assigned for cooperative operation among the axis control application 151, the display control application 152, and the peripheral device control application 153, Virtual addresses such as "aaaaaaa”, “bbbbbbbb”, “ccccccccccccc" corresponding to y and z are stored.
  • the system control module 110 is a module that controls the entire numerical controller 10 and has a CPU 111 and a local memory 112 .
  • the local memory 112 is composed of a RAM (Random Access Memory) or the like.
  • a CPU 111 is a processor that controls the numerical controller 10 as a whole.
  • the CPU 111 reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit described later, loads the system program and the application program into the local memory 112, and loads the system program and the application program into the local memory 112.
  • the entire numerical controller 10 is controlled according to the following. Thereby, as shown in FIG. 2, the CPU 111 is configured to implement the functions of the access frequency evaluation unit 1111 and the memory allocation optimization unit 1112 .
  • the access frequency evaluation unit 1111 includes, for example, the axis control application 151, the display control application 152, the peripheral device control, and the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, and the CPU 141 of the peripheral device control module 140, which will be described later.
  • the frequency of access to the shared variables x, y, z, etc. included in the shared variable information 154 is evaluated for each application 153 .
  • the access frequency evaluation unit 1111 detects that the axis control application 151 is, for example, the shared variable x , y, and z in each execution cycle (access frequency).
  • the CPU 131 which will be described later, develops (loads) a display control application 152, which is an execution program for controlling the display of the display device, stored in the storage unit 150 into the local memory 132, the access frequency evaluation unit 1111
  • the display control application 152 acquires, for example, the number of accesses (access frequency) per execution cycle for each of the shared variables x, y, and z.
  • a peripheral device control application 153 which is an execution program for controlling a peripheral device stored in the storage unit 150, into the local memory 142, the access frequency evaluation unit 1111
  • the device control application 153 acquires, for example, the number of accesses per execution cycle (access frequency) for each of the shared variables x, y, and z.
  • the access frequency evaluation unit 1111 may include a reference instruction execution recording unit 1113 .
  • each of the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, and the CPU 141 of the peripheral device control module 140 executes the axis control application 151, which is an execution program for controlling the spindle and the like.
  • a display control application 152 which is an execution program for controlling the display of the display device, is expanded (loaded) into the local memory 122, and a peripheral device control application 153, which is an execution program for controlling peripheral devices, into the local memory 142.
  • the axis control application 151, the display control application 152, and the peripheral device control application 153 record the number of accesses to the respective shared variables x, y, and z per execution cycle.
  • the access frequency evaluation unit 1111 calculates the number of times the axis control application 151 accesses each of the shared variables x, y, and z in one execution cycle, and The number of accesses per execution cycle is stored as the access frequency to the shared variables of the axis control application 151 .
  • the access frequency evaluation unit 1111 calculates the number of times the display control application 152 accesses each of the shared variables x, y, and z per execution cycle, The number of accesses per unit is stored as the frequency of access to the shared variable of the display control application 152 .
  • the access frequency evaluation unit 1111 calculates the number of times the peripheral device control application 153 accesses each of the shared variables x, y, and z in one execution cycle, and calculates one execution for each of the shared variables x, y, and z.
  • the number of accesses per period is stored as the access frequency to the shared variable of the peripheral device control application 153 .
  • the number of accesses to the shared variables of each execution program per execution cycle is defined as the frequency of access to the shared variables of the axis control application 151. may be stored as By doing so, the memory allocation optimization unit 1112, which will be described later, can calculate the frequency of access to the shared variables of the processor.
  • FIG. 4A is a diagram showing an example of the access frequency for each shared variable in the axis control application 151.
  • FIG. FIG. 4B is a diagram showing an example of the access frequency for each shared variable in the display control application 152.
  • FIG. 4C is a diagram showing an example of the access frequency for each shared variable in the peripheral device control application 153.
  • the access frequency to the shared variable x is 80 times/cycle per execution cycle.
  • the access frequency to the shared variable y is 60 times/cycle per one execution period.
  • the access frequency to the shared variable z is 50 times/cycle per one execution period.
  • the axis control application 151, the display control application 152, and the peripheral device control application 153 have different execution cycles.
  • the matching time T is obtained by multiplying one execution cycle by an integer, and based on the frequency of access to the shared variables x, y, z, etc. for each application in the obtained time T, each shared variable x, y, z, etc. (also referred to as "access frequency in the same processing time", “corrected access frequency”, or simply “access frequency” unless otherwise specified), and based on the corrected access frequency, A reorganization of the physical addresses at which the values of shared variables are stored can be done.
  • the memory allocation optimization unit 1112 changes the local memory in which shared variables are allocated based on the corrected access frequency (hereinafter also referred to as “access frequency” unless otherwise specified).
  • 6A, 6B, and 6C show corrected access frequencies (access frequencies) of the axis control application 151, the display control application 152, and the peripheral device control application 153, respectively.
  • the memory allocation optimization unit 1112 stores the shared variable x, which has the highest access frequency in the axis control application 151, in the local memory 122 of the axis control module 120 (to be described later) that executes the axis control application 151, which is the allocation destination.
  • Obtain a physical address eg, "AAAAAAA"
  • the memory allocation optimizing unit 1112 changes the physical address of the shared variable x to be allocated, which is stored in the shared variable information 154, from, for example, “XXXXXXX” to “AAAAAAAAA”, and moves the shared variable x to the physical address of the local memory 122. It is placed at the address "AAAAAAAA”.
  • the memory allocation optimization unit 1112 stores the shared variable y with the highest access frequency in the display control application 152 in the local memory 132 of the later-described display control module 130 that executes the display control application 152, which is the allocation destination.
  • the memory allocation optimization unit 1112 changes the physical address of the shared variable y to be allocated, which is stored in the shared variable information 154 , from “YYYYYYY” to “BBBBBBBB”, for example, and places the shared variable y in the physical address of the local memory 132 . It is placed at the address "BBBBBBBB”.
  • the memory allocation optimizing unit 1112 stores the shared variable z, which has the highest access frequency in the peripheral device control application 153, in the local memory 142 of the peripheral device control module 140 (to be described later) that executes the peripheral device control application 153, which is the allocation destination.
  • Get a physical address eg, "CCCCCCCC" to store in the .
  • the memory allocation optimization unit 1112 changes the physical address of the shared variable z to be allocated, which is stored in the shared variable information 154 , from “ZZZZZZZZZZ” to “CCCCCC”, for example, and changes the shared variable z to the physical address of the local memory 142 . It is placed at the address "CCCCCCCC". By doing so, the CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
  • the axis control module 120 has a CPU 121 and a local memory 122 .
  • the CPU 121 controls the three axes of the X, Y, and Z axes that change the position and inclination of the spindle and table included in the machine tool (not shown), and the X and Y axes. , Z-axis, A-axis, and B-axis.
  • the local memory 122 is a RAM or the like, in which the axis control application 151 executed by the CPU 121 is loaded, and can access the shared variable x optimally allocated by the memory allocation optimization unit 1112 during execution.
  • the axis control module 120 controls three axes of the X axis, the Y axis, and the Z axis, or five axes of the X axis, the Y axis, the Z axis, the A axis, and the B axis, etc.
  • the axis control module 120 is not limited to this.
  • the numerical controller 10 may have multiple axis control modules 120 that control each axis.
  • the display control module 130 has a CPU 131 and a local memory 132 .
  • the CPU 131 executes the display control application 152 to control the display of the display device of the machine tool (not shown).
  • the local memory 132 is a RAM or the like, loads the display control application 152 executed by the CPU 131, and can access the shared variable y optimally allocated by the memory allocation optimization unit 1112 during execution.
  • the peripheral device control module 140 has a CPU 141 and a local memory 142 .
  • the CPU 141 controls peripheral devices arranged around the machine tool (not shown) by executing the peripheral device control application 153 .
  • the local memory 142 is a RAM or the like, loads the peripheral device control application 153 executed by the CPU 141, and can access the shared variable z optimally allocated by the memory allocation optimization unit 1112 during execution.
  • FIG. 7 is a flowchart for explaining the placement optimization processing of the numerical controller 10. As shown in FIG. The flow shown here is repeatedly executed when the numerical controller 10 loads an application.
  • step S11 the access frequency evaluation unit 1111 determines whether the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, or the CPU 141 of the peripheral device control module 140 stores the axis control application 151 and the display control application 152 in the storage unit 150. , the frequency of access to each of the shared variables x, y, and z per one execution cycle is calculated when the peripheral device control application 153 is developed in the local memory.
  • step S12 the access frequency evaluation unit 1111 determines whether or not the access frequencies of all applications have been calculated. When the access frequencies of all applications have been calculated, the process proceeds to step S13. On the other hand, if the access frequencies of all applications have not been calculated, the process returns to step S11.
  • step S13 the memory allocation optimization unit 1112 acquires the application access frequency of the axis control application 151, the display control application 152, or the peripheral device control application 153 calculated in step S11.
  • step S14 the memory allocation optimization unit 1112 compares the frequency of access to the shared variables acquired in step S13 among the applications, identifies the application with the highest access frequency to the shared variable, and executes the application.
  • the memory placement optimization unit 1112 changes the physical address of the shared variable to be placed stored in the shared variable information 154 to the acquired physical address, and places the shared variable in the local memory.
  • step S15 the memory placement optimization unit 1112 determines whether all shared variables have been placed in the local memory. When all shared variables have been placed in the local memory, the placement optimization process ends. On the other hand, if all shared variables have not been placed in the local memory, the process returns to step S13.
  • the numerical controller 10 analyzes the frequency of access to the shared variables of the axis control application 151, the display control application 152, and the peripheral device control application 153 executed by the respective CPUs 121, 131, and 141, Shared variables with high access frequency can be placed in the local memory of the CPU where the application is executed. In addition, the numerical controller 10 can reduce access to the storage unit 150 and shorten the processing time.
  • the first embodiment has been described above.
  • the numerical controller 10A acquires from an external device the number of reference instructions to shared variables from the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153, and is different from the first embodiment in that the access frequency to the shared variable is evaluated based on .
  • the numerical controller 10A of the second embodiment analyzes the frequency of access to the shared variables of the applications executed by each CPU, and arranges the shared variables with high access frequency in the local memory of the CPU executing the applications. can do.
  • a second embodiment will be described below.
  • FIG. 8 is a functional block diagram showing a functional configuration example of a numerical controller 10A according to the second embodiment. Elements having functions similar to those of the numerical control device 10 in FIG. As shown in FIG. 8, the numerical control device 10A may be directly connected to the information processing device 20 via a connection interface (not shown). Further, the numerical control device 10A may be connected to the information processing device 20 via a network (not shown) such as a LAN (Local Area Network) or the Internet. In this case, the numerical control device 10A and the information processing device 20 are provided with a communication section (not shown) for mutual communication through such connection. Although the numerical control device 10A is connected to one information processing device 20, it may be connected to a plurality of information processing devices 20. FIG.
  • FIG. 9 is a functional block diagram showing a functional configuration example of the information processing device 20.
  • the information processing device 20 has a control section 210 and a storage section 220 .
  • the control unit 210 has an analysis unit 211 and a compilation unit 212 .
  • the storage unit 220 is a RAM, HDD (Hard Disk Drive), or the like, and may store a system program and a plurality of application programs.
  • the storage unit 220 includes an axis control source program 221 , a display control source program 222 and a peripheral device control source program 223 .
  • the axis control source program 221 is the source program of the axis control application 151 stored in the storage unit 150 of the numerical controller 10A.
  • the display control source program 222 is the source program of the display control application 152 stored in the storage unit 150 of the numerical controller 10A.
  • the peripheral device control source program 223 is the source program of the peripheral device control application 153 stored in the storage unit 150 of the numerical controller 10A.
  • the control unit 210 has a CPU, a ROM, a RAM, a CMOS (Complementary Metal-Oxide-Semiconductor) memory, etc., which are known to those skilled in the art and are configured to communicate with each other via a bus.
  • the CPU is a processor that controls the information processing device 20 as a whole.
  • the CPU reads the system program stored in the ROM and the application program for executing the function units described later via the bus, loads them into a memory (not shown), and executes the information processing apparatus according to the system program and the application program. 20 as a whole.
  • the control unit 210 is configured to implement the functions of the analysis unit 211 and the compilation unit 212 .
  • CMOS memory is backed up by a battery (not shown) and configured as a non-volatile memory that retains the memory state even when the information processing apparatus 20 is powered off.
  • the analysis unit 211 receives, for example, an axis control source program 221, a display control source program 222, and a peripheral device control source program 223 from a user via an input device (not shown) such as a keyboard or touch panel included in the information processing device 20.
  • an analysis instruction for a source program is received, each source program is analyzed, and the number of control statements that refer to shared variables x, y, z, etc. from the beginning to the end of the source program (that is, one execution cycle) is shared. Obtained as the number of reference instructions for each variable.
  • the analysis unit 211 may store the obtained number of reference instructions such as the shared variables x, y, and z of each program in the execution format of each program, for example. By doing so, when the execution program is expanded (loaded) into respective local memories (to be described later) in the numerical control device 10A, the numerical control device 10A (access frequency evaluation unit) uses shared variables x, y , z, etc. can be obtained.
  • the compiling unit 212 receives an instruction to compile the axis control source program 221, the display control source program 222, or the peripheral device control source program 223 from the user via the input device (not shown) of the information processing device 20,
  • the axis control source program 221, the display control source program 222, or the peripheral device control source program 223 is compiled to generate the axis control application 151, the display control application 152, or the peripheral device control application 153 of the execution program.
  • the compiling unit 212 transmits the generated display control application 152 or peripheral device control application 153 to the numerical controller 10A.
  • the compilation unit 212 may have the function of the analysis unit 211 .
  • the compiling unit 212 calculates the number of reference instructions such as the shared variables x, y, and z of each program, and calculates the number of reference instructions of each program as described above. It can be stored in an executable program.
  • the numerical controller 10A has a system control module 110a, an axis control module 120, a display control module 130, a peripheral device control module 140, and a storage section 150, as shown in FIG.
  • the system control module 110 a has a CPU 111 a and a local memory 112 .
  • the CPU 111 a also has an access frequency evaluation unit 1111 a and a memory allocation optimization unit 1112 .
  • the memory layout optimization unit 1112 has functions equivalent to those of the memory layout optimization unit 1112 in the first embodiment.
  • the CPU 111a is a processor that controls the numerical controller 10A as a whole, like the CPU 111 of the first embodiment.
  • the CPU 111a reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit described later, loads them into the local memory 112, and stores the system program and the application program.
  • the entire numerical controller 10A is controlled according to the following. Thereby, as shown in FIG. 8, the CPU 111a is configured to implement the functions of the access frequency evaluation unit 1111a and the memory allocation optimization unit 1112.
  • FIG. 8 the CPU 111a is configured to implement the functions of the access frequency evaluation unit 11
  • the access frequency evaluation unit 1111a is an axis control source program 221, a display control source program 222, and a peripheral device, which are source programs for the axis control application 151, the display control application 152, and the peripheral device control application 153.
  • the number of reference instructions to the shared variables x, y, z, etc. obtained from the analysis of the control source program 223 is acquired from the information processing device 20 .
  • the access frequency evaluation unit 1111a per execution cycle based on the number of reference instructions to the shared variables x, y, z, etc. in each of the acquired execution programs, that is, the axis control application 151, the display control application 152, and the peripheral device control application 153. Evaluate the frequency of access to shared variables x, y, z, etc. in .
  • the arrangement optimization processing of the numerical control device 10A is the same as the processing shown in FIG. 7 except that the access frequency evaluation unit 1111a acquires the number of reference instructions from the information processing device 20, and detailed description thereof will be omitted.
  • the numerical control device 10A includes the axis control source program 221, which is the source program of the axis control application 151, the display control application 152, and the peripheral device control application 153, and the display control source program.
  • the frequency of access to the shared variables obtained from the analysis of the peripheral device control source program 223 is acquired from the information processing device 20 .
  • the numerical controller 10A can place the shared variable with the highest access frequency in the local memory of the CPU executing the application.
  • the CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
  • the second embodiment has been described above.
  • the numerical controller 10A has the access frequency evaluation unit 1111a, it is not limited to this.
  • the information processing device 20 may have an access frequency evaluation unit 1111a.
  • the analysis unit 211 has the function of the access frequency evaluation unit 1111a, and calculates the shared variables x, y, z, etc. based on the number of reference instructions to the shared variables x, y, z, etc. obtained from the analysis of each source program.
  • the access frequency may be evaluated, and the evaluated access frequency may be stored, for example, in the executable form of each program. By doing so, when the execution program is developed (loaded) into each local memory in the numerical control device 10A, the numerical control device 10A (memory allocation optimization unit) can set the shared variables x, y, z etc. can be placed in the optimal local memory.
  • the numerical controller 10B stores an evaluation parameter used for evaluating the access frequency, and when acquiring the number of reference instructions to the shared variable from the information processing device 20B as an external device, The difference from the first and second embodiments is that the number of reference instructions for each control statement is weighted and corrected by an evaluation parameter, and the frequency of access to shared variables is evaluated based on the corrected number of reference instructions. do.
  • the numerical controller 10B of the third embodiment analyzes the frequency of access to the shared variables of the applications executed by each CPU, and arranges shared variables with high access frequency in the local memory of the CPU executing the applications. can do.
  • a third embodiment will be described below.
  • FIG. 10 is a functional block diagram showing a functional configuration example of a numerical controller 10B according to the third embodiment. Elements having functions similar to those of the numerical control device 10 in FIG. As shown in FIG. 10, the numerical control device 10B may be directly connected to the information processing device 20B via a connection interface (not shown), similarly to the numerical control device 10A according to the second embodiment. Further, the numerical control device 10B may be connected to the information processing device 20B via a network (not shown) such as a LAN (Local Area Network) or the Internet.
  • a network not shown
  • LAN Local Area Network
  • FIG. 11 is a functional block diagram showing a functional configuration example of the information processing device 20B. Elements having functions similar to those of the information processing apparatus 20 shown in FIG. 9 are denoted by the same reference numerals, and detailed description thereof will be omitted.
  • the information processing device 20B has a control section 210b and a storage section 220.
  • the control unit 210b has an analysis unit 211b and a compilation unit 212 .
  • the control unit 210b has a CPU, a ROM, a RAM, a CMOS memory, etc., which are configured to communicate with each other via a bus. It is.
  • the CPU is a processor that controls the information processing device 20B as a whole.
  • the CPU reads the system program stored in the ROM and the application program for executing the function units described later via the bus, loads them into a memory (not shown), and executes the information processing apparatus according to the system program and the application program. 20B as a whole.
  • the control unit 210b is configured to implement the functions of the analysis unit 211b and the compilation unit 212.
  • the compiling unit 212 has functions equivalent to those of the compiling unit 212 in the second embodiment.
  • the analysis unit 211b receives an analysis instruction for the source programs of the axis control source program 221, the display control source program 222, and the peripheral device control source program 223 from the user via the input device (not shown) of the information processing device 20B.
  • type of control statements in each source program for example, "plain text", “IF statement”, “For statement”, etc.
  • the analysis unit 211b may store the obtained type of each control statement and the number of reference instructions for each control statement in, for example, an executable program of each program.
  • the numerical control device 10B determines the type of each control statement of each program and the number of reference instructions such as shared variables x, y, and z for each control statement.
  • the analysis unit 211 b may be included in the compilation unit 212 .
  • the numerical controller 10B has a system control module 110b, an axis control module 120, a display control module 130, a peripheral device control module 140, and a storage section 150, as shown in FIG.
  • the system control module 110 b has a CPU 111 b and a local memory 112 .
  • the CPU 111b also has an access frequency evaluation unit 1111b and a memory allocation optimization unit 1112 .
  • the access frequency evaluation unit 1111b also has an evaluation parameter storage unit 1114.
  • the memory layout optimization unit 1112 has functions equivalent to those of the memory layout optimization unit 1112 in the first embodiment.
  • the CPU 111b is a processor that controls the numerical controller 10B as a whole, like the CPU 111 of the first embodiment.
  • the CPU 111b reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit (to be described later), loads them into the local memory 112, and stores the system program and the application program in question.
  • the entire numerical controller 10B is controlled according to the following. Thereby, as shown in FIG. 10, the CPU 111b is configured to implement the functions of the access frequency evaluation unit 1111b and the memory allocation optimization unit 1112. FIG. Also, the access frequency evaluation unit 1111b is configured to realize the function of the evaluation parameter storage unit 1114.
  • the evaluation parameter storage unit 1114 stores, for example, the value of the evaluation parameter used for evaluating the access frequency for each control statement forming the source program of the application.
  • FIG. 12 is a diagram showing an example of evaluation parameters stored in the evaluation parameter storage unit 1114. As shown in FIG. As shown in FIG. 12, when the control statement is plain text, the evaluation parameter is set to a value such as "1.0", for example. Also, if the control statement is an IF statement, the evaluation parameter may not be executed depending on the conditions, so the evaluation parameter is set to a smaller value (for example, "0.8", etc.) than in the case of plain text.
  • the evaluation parameter is set to a larger value (for example, "10") than in the case of plain text because the control statement is repeatedly executed a plurality of times in one execution cycle.
  • the value of the evaluation parameter may be set in advance by the user via an input device (not shown) such as a keyboard or touch panel included in the numerical controller 10B.
  • the access frequency evaluation unit 1111b for example, the axis control source program 221, the display control source program 222, which are the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153 by the analysis unit 211 of the information processing device 20B,
  • the type of each control statement and the number of reference instructions for each control statement obtained from the analysis of the peripheral device control source program 223 are acquired from the information processing device 20B.
  • the access frequency evaluation unit 1111b weights and corrects the number of reference instructions for each control statement in the source program using an evaluation parameter corresponding to the type of control statement stored in the evaluation parameter storage unit 1114, and corrects the corrected number of reference instructions. Evaluate access frequency to shared variables based on . FIG.
  • FIG. 13 is a diagram showing an example explaining the operation of the access frequency evaluation unit 1111b.
  • the analysis unit 211b of the information processing device 20B analyzes the source code stored in the storage unit 220, and determines the type of each control statement and the number of reference instructions "1" per execution cycle. stored in the program of The access frequency evaluation unit 1111b of the numerical controller 10B determines the value of the evaluation parameter according to the type of the control statement for the number of reference instructions "1" for each control statement stored in the execution program received from the information processing device 20B. is weighted to correct the number of reference instructions.
  • the access frequency evaluation unit 1111b weights and corrects the number of reference instructions "1" of the first and second plaintext control statements with the evaluation parameter "1.0", and corrects the number per execution cycle. Then, the number of reference instructions "1" is calculated. Further, the access frequency evaluation unit 1111b weights and corrects the number of reference instructions of the control statement of the third IF statement "1" by weighting the evaluation parameter "0.8", and corrects the reference instruction count per one execution cycle. Calculate the number "0.8”. Further, the access frequency evaluation unit 1111b weights and corrects the reference instruction count “1” of the control statement of the fourth For statement with the evaluation parameter “10”, and corrects the corrected reference instruction count “1” per execution cycle. 10" is calculated.
  • the access frequency evaluation unit 1111b adds the corrected number of reference instructions to each of the shared variables x, y, and z in each of the axis control application 151, the display control application 152, and the peripheral device control application 153. Evaluate the frequency of access to shared variables x, y, z per By doing so, when executing the axis control application 151, the display control application 152, and the peripheral device control application 153, the numerical controller 10B can accurately evaluate the access frequency to the shared variables x, y, z, and the like. , and shared variables can be optimally placed in local memory 122 , 132 , 142 .
  • the access frequency evaluation unit 1111b acquires the number of reference instructions from the information processing device 20B and corrects it with an evaluation parameter. Description is omitted.
  • the numerical controller 10B includes the axis control source program 221, the display control source program 222, and the peripheral device control source program 221, which are the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153.
  • the type of each control statement of the source program 223 and the number of reference instructions for each control statement are obtained from the information processing device 20B.
  • the numerical controller 10B corrects the obtained number of reference instructions for each control statement by weighting it with an evaluation parameter according to the type of the control statement, and evaluates the access frequency to the shared variable based on the corrected number of reference instructions.
  • the shared variables with the highest access frequency can be placed in the local memory of the CPU where the application is executed.
  • the CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
  • the third embodiment has been described above.
  • the numerical controller 10B according to the third embodiment has the access frequency evaluation unit 1111b and the evaluation parameter storage unit 1114, but is not limited to this.
  • the information processing device 20B may have an access frequency evaluation unit 1111a and an evaluation parameter storage unit 1114.
  • the analysis unit 211b has the function of the access frequency evaluation unit 1111b, and obtains the type of each control statement and the number of reference instructions for each control statement obtained from the analysis of each source program.
  • the analysis unit 211b corrects the obtained number of reference instructions for each control statement in the source program by weighting it with an evaluation parameter corresponding to the type of control statement stored in the evaluation parameter storage unit 1114, and corrects the corrected number of reference instructions.
  • the numerical control device 10B may be used to evaluate the access frequency to the shared variable based on and store the evaluated access frequency in, for example, the executable program of each program. By doing so, when the execution program is expanded (loaded) into each local memory in the numerical control device 10B, the numerical control device 10B (memory allocation optimization unit) can set the shared variables x, y, z etc. can be placed in the optimal local memory.
  • the first embodiment, the second embodiment, the modification of the second embodiment, the third embodiment, and the modification of the third embodiment have been described above. It is not limited to the embodiment, and includes modifications, improvements, etc. within a range that can achieve the purpose.
  • the axis control module 120 and the display control module of the numerical controllers 10, 10A, and 10B 130 and the peripheral device control module 140 each executed one of the axis control application 151, the display control application 152, and the peripheral device control application 153, but is not limited to this.
  • the CPU 121 of the axis control module 120 of the numerical controllers 10, 10A, and 10B executes a plurality of applications such as an application for acquiring the position coordinates of the spindle of a machine tool (not shown) together with the axis control application 151. good too.
  • the access frequency to the shared variables in the axis control module 120 may be the sum of the access frequencies to the shared variables of these multiple applications.
  • the CPU 131 of the display control module 130 may execute a plurality of applications such as an application for obtaining execution lines of a machining program for operating a machine tool (not shown) together with the display control application 152 .
  • the access frequency to the shared variable in the display control module 130 may be the sum of the access frequencies to the shared variable of these multiple applications.
  • the CPU 141 of the peripheral device control module 140 may execute a plurality of applications such as an application for monitoring whether or not a worker is around the peripheral device together with the peripheral device control application 153 .
  • the frequency of access to shared variables in peripheral device control module 140 may be the sum of the access frequencies of these multiple applications to shared variables.
  • the local memories 122, 132 of the numerical controllers 10, 10A, 10B , 142 are shared variables with the highest access frequency among the shared variables x, y, z, etc., but are not limited to this.
  • shared variables having a predetermined access frequency or higher among the shared variables x, y, z, etc. may be allocated.
  • the information processing apparatuses 20 and 20B have the analysis units 211 and 221b set the axis control application 151 , the display control application 152, and the peripheral device control application 153 have been analyzed, but the present invention is not limited to this.
  • the compilation unit 212 may have the functions of the analysis units 211 and 211b.
  • each function included in the numerical controllers 10, 10A, and 10B according to the first embodiment, the second embodiment, the modification of the second embodiment, the third embodiment, and the modification of the third embodiment is Each can be implemented by hardware, software, or a combination thereof.
  • “implemented by software” means implemented by a computer reading and executing a program.
  • Non-transitory computer-readable media include various types of tangible storage media.
  • Examples of non-transitory computer-readable media include magnetic recording media (e.g., flexible discs, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical discs), CD-ROMs (Read Only Memory), CD- R, CD-R/W, semiconductor memory (eg, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM).
  • the program may also be supplied to the computer on various types of transitory computer readable medium. Examples of transitory computer-readable media include electrical signals, optical signals, and electromagnetic waves. Transitory computer-readable media can deliver the program to the computer via wired communication channels, such as wires and optical fibers, or wireless communication channels.
  • steps of writing a program recorded on a recording medium include not only processes that are executed chronologically in order, but also processes that are executed in parallel or individually, even if they are not necessarily processed chronologically. It also includes
  • control device of the present disclosure can take various embodiments having the following configurations.
  • the control device 1 of the present disclosure is a control device having a plurality of CPUs 30 and a plurality of local memories 31 accessed by each of the plurality of CPUs 30, and includes at least virtual addresses of shared variables and physical addresses of shared variables.
  • a storage unit 4 that stores shared variable information 41, and an access frequency evaluation unit that evaluates the frequency of access to shared variables included in the shared variable information 41 for each of the execution programs 40-1 to 40-n executed by each of the plurality of CPUs 30. 21-1, and a memory placement optimization unit 21-2 that changes the local memory 31 in which shared variables are placed based on the access frequency.
  • this control device 1 it is possible to analyze the access frequency of an application executed by each CPU to a shared variable, and arrange shared variables with a high access frequency in the local memory of the CPU executing the application.
  • the access frequency evaluation unit 1111 counts the number of executions of instructions that refer to shared variables when each of the CPUs 121, 131, and 141 executes an execution program. , 131, and 141, and the access frequency evaluation unit 1111 calculates a shared variable may be evaluated, and the memory placement optimizer 1112 may place shared variables in the local memory accessed by the processor with the highest evaluated access frequency. By doing so, the numerical controller 10 can accurately evaluate the access frequency and further optimize the allocation of shared variables.
  • the access frequency evaluation unit 1111a acquires the number of reference instructions to the shared variable for each execution program executed by each of the plurality of CPUs 121, 131, and 141, or acquires the number of information processing
  • the number of reference instructions to the shared variable obtained from the analysis of the source program of the execution program by the device 20 is acquired from the information processing device 20, the frequency of access to the shared variable is evaluated based on the acquired number of reference instructions, and the memory allocation is optimized.
  • the modifier 1112 may place the shared variables in the local memory accessed by the CPU with the highest evaluated access frequency. By doing so, the numerical controller 10A can achieve the same effect as (2).
  • the access frequency evaluation unit 1111b includes an evaluation parameter storage unit 1114 that stores evaluation parameters used for evaluating the access frequency, and the access frequency evaluation unit 1111b stores the reference instruction
  • the number of reference instructions for each control statement in the source program is weighted and corrected by the evaluation parameter stored in the evaluation parameter storage unit 1114, and shared based on the corrected number of reference instructions.
  • the frequency of access to variables may be evaluated. By doing so, the numerical controller 10B can accurately evaluate the access frequency to the shared variable without executing the application.
  • control device 2 control module 21 CPU 21-1 access frequency evaluation unit 21-2 memory allocation optimization unit 22 local memory 3-1 to 3-n processor module 30
  • Peripheral device control module 141 CPU 142 local memory 150 storage unit 151 axis control application 152 display control application 153 peripheral device control application 154 shared variable information 160 bus 20, 20B information processing device 210, 210b control unit 211, 211b analysis unit 212 compilation unit 220 storage unit 221 axis control Source program 222 Display control source program 223 Peripheral device control source program

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Numerical Control (AREA)

Abstract

The present invention analyzes the frequency of access to a shared variable by an application executed by each CPU, and places a shared variable with a high access frequency in the local memory of the CPU executing the application. Provided is a control device equipped with a plurality of processors and a plurality of local memories accessed by the plurality of processors, respectively, the control device comprising: a storage unit that stores shared variable information including at least the virtual address of the shared variable and the physical address of the shared variable; an access frequency evaluation unit that evaluates the frequency of access to the shared variable included in the shared variable information for each execution program executed by each of the plurality of processors; and a memory placement optimization unit that changes the local memory in which the shared variable is placed on the basis of the access frequency.

Description

制御装置Control device
 本発明は、制御装置に関する。 The present invention relates to a control device.
 多数の機能を持つ複雑な制御装置では、複数のCPU(Central Processing Unit)を使用してそれぞれ別のアプリケーションプログラム(以下、「アプリ」ともいう)を動作させている。また、処理の高速化のため、各CPUはローカルメモリを持ち、それらをネットワーク(又はバス)で結合している。
 この点、データベース・リソースのアクセス状況に応じて、共用型のインテグリテイ保証又は局所型のインテグリテイ保証が自動的に選択され、リソース管理の最適配置により、アクセスの高速化及び通信オーバヘッドの削減等の処理コストの低下を図る技術が知られている。例えば、特許文献1参照。
2. Description of the Related Art In a complicated control device having many functions, a plurality of CPUs (Central Processing Units) are used to run separate application programs (hereinafter also referred to as "applications"). In addition, each CPU has a local memory and is connected by a network (or bus) to speed up processing.
In this regard, shared integrity assurance or local integrity assurance is automatically selected according to the access status of database resources, and the optimal arrangement of resource management increases access speed and reduces communication overhead. Techniques for reducing processing costs are known. See Patent Document 1, for example.
特開平2-247748号公報JP-A-2-247748
 複数のCPUそれぞれで実行されるアプリを、アプリ間で連携して動作させるために共有変数が使用されている。
 図14は、アプリ間で連携される共有変数の一例を示す図である。
 図14に示すように、制御装置C1は、例えば、複数のプロセッサモジュールPM1、PM2、PM3等を有し、複数のプロセッサモジュールPM1、PM2、PM3等は、バス(又はネットワーク)で接続されている。また、プロセッサモジュールPM1は、CPU1A、及びメモリM1を有し、プロセッサモジュールPM2は、CPU2A、及びメモリM2を有し、プロセッサモジュールPM3は、CPU3A、及びメモリM3を有する。そして、CPU1Aは、アプリAP1を実行し、メモリM1に格納された共有変数xにアクセスする。また、CPU2Aは、アプリAP2を実行し、メモリM2に格納された共有変数yにアクセスする。また、CPU3Aは、アプリAP3を実行し、メモリM3に格納された共有変数zにアクセスする。
 図14の場合、例えば、CPU2Aで実行されるアプリAP2が、プロセッサモジュールPM1のメモリM1に格納された共有変数xをバス(又はネットワーク)経由でアクセスすることで、アプリAP1とアプリAP2間の共有変数xを実現する。
 しかしながら、CPU2AがプロセッサモジュールPM1のメモリM1に格納された共有変数xに頻繁にアクセスすると、メモリM1へのアクセス回数が増えることにより処理時間が長くなるという問題がある。
A shared variable is used to coordinate and operate applications executed by each of a plurality of CPUs.
FIG. 14 is a diagram illustrating an example of shared variables linked between applications.
As shown in FIG. 14, the control device C1 has, for example, a plurality of processor modules PM1, PM2, PM3, etc., and the plurality of processor modules PM1, PM2, PM3, etc. are connected via a bus (or network). . The processor module PM1 has a CPU1A and a memory M1, the processor module PM2 has a CPU2A and a memory M2, and the processor module PM3 has a CPU3A and a memory M3. The CPU 1A then executes the application AP1 and accesses the shared variable x stored in the memory M1. The CPU 2A also executes the application AP2 and accesses the shared variable y stored in the memory M2. The CPU 3A also executes the application AP3 and accesses the shared variable z stored in the memory M3.
In the case of FIG. 14, for example, the application AP2 executed by the CPU2A accesses the shared variable x stored in the memory M1 of the processor module PM1 via the bus (or network), thereby enabling the sharing between the application AP1 and the application AP2. Realize the variable x.
However, if the CPU 2A frequently accesses the shared variable x stored in the memory M1 of the processor module PM1, there is a problem that the processing time increases due to an increase in the number of accesses to the memory M1.
 そこで、各CPUが実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することが望まれている。 Therefore, it is desirable to analyze the access frequency of an application executed by each CPU to a shared variable and to allocate shared variables with a high access frequency to the local memory of the CPU executing the application.
 本開示の制御装置の一態様は、複数のプロセッサと前記複数のプロセッサそれぞれがアクセスする複数のローカルメモリとを有する制御装置であって、少なくとも共有変数の仮想アドレス及び共有変数の物理アドレスを含む共有変数情報を格納する記憶部と、前記複数のプロセッサそれぞれが実行する実行プログラム毎に前記共有変数情報に含まれる前記共有変数へのアクセス頻度を評価するアクセス頻度評価部と、前記アクセス頻度に基づいて前記共有変数を配置する前記ローカルメモリを変更するメモリ配置最適化部と、を備える。 One aspect of the control device of the present disclosure is a control device having a plurality of processors and a plurality of local memories accessed by each of the plurality of processors, wherein a shared memory including at least a virtual address of a shared variable and a physical address of a shared variable is provided. a storage unit for storing variable information; an access frequency evaluation unit for evaluating frequency of access to the shared variable included in the shared variable information for each execution program executed by each of the plurality of processors; and a memory placement optimization unit that changes the local memory in which the shared variables are placed.
 一態様によれば、各CPUが実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することができる。その結果、バス(又はネットワーク)経由のアクセスが減少し、アプリの処理時間の短縮という効果を奏する。 According to one aspect, it is possible to analyze the access frequency of an application executed by each CPU to a shared variable, and allocate shared variables with a high access frequency to the local memory of the CPU executing the application. As a result, the number of accesses via the bus (or network) is reduced, which has the effect of shortening the application processing time.
制御装置の機能的構成例を示す機能ブロック図である。It is a functional block diagram showing an example of functional composition of a control device. 第1実施形態に係る数値制御装置の機能的構成例を示す機能ブロック図である。1 is a functional block diagram showing a functional configuration example of a numerical controller according to a first embodiment; FIG. 共有変数情報の一例を示す図である。FIG. 4 is a diagram showing an example of shared variable information; 軸制御アプリにおける共有変数毎のアクセス頻度の一例を示す図である。FIG. 5 is a diagram showing an example of access frequency for each shared variable in an axis control application; 表示制御アプリにおける共有変数毎のアクセス頻度の一例を示す図である。FIG. 10 is a diagram showing an example of access frequency for each shared variable in a display control application; 周辺機器制御アプリにおける共有変数毎のアクセス頻度の一例を示す図である。FIG. 10 is a diagram showing an example of access frequency for each shared variable in a peripheral device control application; アプリ毎の実行周期の一例を示す図である。It is a figure which shows an example of the execution period for every application. 軸制御アプリにおける共有変数毎の補正後のアクセス頻度の一例を示す図である。FIG. 10 is a diagram showing an example of access frequency after correction for each shared variable in an axis control application; 表示制御アプリにおける共有変数毎の補正後のアクセス頻度の一例を示す図である。FIG. 10 is a diagram showing an example of access frequency after correction for each shared variable in the display control application; 周辺機器制御アプリにおける共有変数毎の補正後のアクセス頻度の一例を示す図である。FIG. 10 is a diagram showing an example of corrected access frequency for each shared variable in a peripheral device control application; 数値制御装置の配置最適化処理について説明するフローチャートである。4 is a flowchart for explaining placement optimization processing of a numerical control device; 第2実施形態に係る数値制御装置の機能的構成例を示す機能ブロック図である。FIG. 7 is a functional block diagram showing a functional configuration example of a numerical controller according to a second embodiment; 情報処理装置の機能的構成例を示す機能ブロック図である。2 is a functional block diagram showing a functional configuration example of an information processing device; FIG. 第3実施形態に係る数値制御装置の機能的構成例を示す機能ブロック図である。FIG. 11 is a functional block diagram showing a functional configuration example of a numerical controller according to a third embodiment; 情報処理装置の機能的構成例を示す機能ブロック図である。2 is a functional block diagram showing a functional configuration example of an information processing device; FIG. 評価パラメータ記憶部に格納される評価パラメータの一例を示す図である。It is a figure which shows an example of the evaluation parameter stored in an evaluation parameter memory|storage part. アクセス頻度評価部の動作を説明する一例を示す図である。It is a figure which shows an example explaining operation|movement of an access frequency evaluation part. アプリ間で連携される共有変数の一例を示す図である。It is a figure which shows an example of the shared variable linked between applications.
 制御装置の具体的な実施形態について説明するにあたり、最初に制御装置の基本動作について説明する。
 図1は、制御装置の機能的構成例を示す機能ブロック図である。
 図1に示すように、制御装置1は、例えば、工作機械やロボット等を制御し、制御モジュール2、n個のプロセッサモジュール3-1~3-n、及び記憶部4を有する(nは2以上の整数である)。制御モジュール2、プロセッサモジュール3-1~3-n、及び記憶部4は、バス5を介して通信可能に接続される。
Before describing a specific embodiment of the control device, the basic operation of the control device will be described first.
FIG. 1 is a functional block diagram showing a functional configuration example of a control device.
As shown in FIG. 1, the control device 1 controls, for example, machine tools, robots, etc., and has a control module 2, n processor modules 3-1 to 3-n, and a storage unit 4 (n is 2 is an integer greater than or equal to ). The control module 2, processor modules 3-1 to 3-n, and storage unit 4 are communicably connected via a bus 5. FIG.
 記憶部4は、ROM(Read Only Memory)等のメインメモリであり、制御モジュール2が実行するシステムプログラム及びアプリケーションプログラムとともに、後述するプロセッサモジュール3-1~3-nそれぞれが実行するn個の実行形式の実行プログラム40-1~40-nが格納されてもよい。また、記憶部4は、共有変数情報41を含む。
 共有変数情報41は、例えば、実行プログラム40-1~40-nの間で連携して動作させるための少なくとも共有変数の仮想アドレス及び共有変数の物理アドレスを含む共有変数に関する情報を含む。
The storage unit 4 is a main memory such as a ROM (Read Only Memory), and stores a system program and an application program executed by the control module 2, as well as n executions executed by each of the processor modules 3-1 to 3-n described later. format execution programs 40-1 to 40-n may be stored. The storage unit 4 also includes shared variable information 41 .
The shared variable information 41 includes, for example, information on shared variables including at least virtual addresses of shared variables and physical addresses of shared variables for cooperative operation among the execution programs 40-1 to 40-n.
 プロセッサモジュール3-1~3-nは、例えば、CPU30、及びローカルメモリ22を有し、後述する制御モジュール2の制御指示に基づいて、例えば軸制御や表示制御等の実行プログラム40-1~40-nそれぞれを実行する。 The processor modules 3-1 to 3-n have, for example, a CPU 30 and a local memory 22, and execute execution programs 40-1 to 40 for axis control, display control, etc. based on control instructions from the control module 2, which will be described later. -n each run.
 制御モジュール2は、CPU21と、RAM(Random Access Memory)等のローカルメモリ22と、を有する。
 CPU21は制御装置1を全体的に制御するプロセッサである。CPU21は、メインメモリである記憶部4に格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バス5を介して読み出し、ローカルメモリ22にロードし、システムプログラム及び当該アプリケーションプログラムに従って制御装置1全体を制御する。これにより、図1に示すように、CPU21が、アクセス頻度評価部21-1、及びメモリ配置最適化部21-2の機能を実現するように構成される。
The control module 2 has a CPU 21 and a local memory 22 such as a RAM (Random Access Memory).
The CPU 21 is a processor that controls the control device 1 as a whole. The CPU 21 reads, via the bus 5, a system program stored in the storage unit 4, which is a main memory, and an application program for executing a function unit described later, loads them into the local memory 22, and stores the system program and the application program. The entire control device 1 is controlled according to. Thereby, as shown in FIG. 1, the CPU 21 is configured to implement the functions of the access frequency evaluation unit 21-1 and the memory allocation optimization unit 21-2.
 アクセス頻度評価部21-1は、例えば、プロセッサモジュール3-1~3-nのCPU30それぞれが実行する実行プログラム40-1~40-n毎に共有変数情報41に含まれる共有変数へのアクセス頻度を評価する。 The access frequency evaluation unit 21-1, for example, calculates the frequency of access to the shared variables included in the shared variable information 41 for each of the execution programs 40-1 to 40-n executed by the CPUs 30 of the processor modules 3-1 to 3-n. Evaluate.
 メモリ配置最適化部21-2は、アクセス頻度評価部21-1により評価されたアクセス頻度に基づいて共有変数を、プロセッサモジュール3-1~3-nのうち配置するローカルメモリ31を変更する。
 そうすることにより、制御装置1は、各CPU30が実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することができる。
 以上、制御装置の基本動作について説明した。
The memory allocation optimization unit 21-2 changes the local memory 31 in which the shared variables are allocated among the processor modules 3-1 to 3-n based on the access frequency evaluated by the access frequency evaluation unit 21-1.
By doing so, the control device 1 can analyze the access frequency of the application executed by each CPU 30 to the shared variable, and arrange the shared variable with high access frequency in the local memory of the CPU executing the application. .
The basic operation of the control device has been described above.
 次に、制御装置の具体的な実施形態について、制御装置として数値制御装置を例示して説明する。なお、本発明は、数値制御装置に限定されず、例えば産業用ロボット等を制御する、複数のプロセッサを備えるロボット制御装置に対しても適用可能である。また、複数のプロセッサを備える、任意の制御装置に対しても適用可能である。
 また、複数のプロセッサそれぞれにおいて実行する実行プログラムとして、軸制御アプリ、表示制御アプリ、周辺機器制御アプリを例示して説明するが、これ以外の任意のアプリの実行プログラムに対しても適用可能である。なお、各プロセッサにおいて、複数のプログラムを実行させるようにしてもよい。また、ロボット制御装置、及び任意の制御装置において、各プロセッサにおいて複数のプログラムを実行させる場合にも適用される。
 まず、第1実施形態について説明する。
<第1実施形態>
 図2は、第1実施形態に係る数値制御装置の機能的構成例を示す機能ブロック図である。
 また、複数のCPUそれぞれが実行するアプリとして、前述したように軸制御アプリ、表示制御アプリ、周辺機器制御アプリを例示する。なお、本発明は、軸制御アプリ、表示制御アプリ、周辺機器制御アプリに限定されず、軸制御アプリ、表示制御アプリ、周辺機器制御アプリ以外の任意のアプリに対しても適用可能である。
 図2に示すように、数値制御装置10は、当業者にとって公知の数値制御装置であり、例えば、図示しないCAD/CAM装置等から取得した加工プログラムに基づいて動作指令を生成し、生成した動作指令を工作機械(図示しない)に送信する。これにより、数値制御装置10は、図示しない工作機械の動作を制御する。なお、図示しない工作機械がロボット等の場合、数値制御装置10は、ロボット制御装置等でもよい。
Next, a specific embodiment of the control device will be described by exemplifying a numerical control device as the control device. It should be noted that the present invention is not limited to numerical control devices, but can also be applied to robot control devices having a plurality of processors that control industrial robots, for example. It is also applicable to any control device with multiple processors.
Further, although an axis control application, a display control application, and a peripheral device control application will be exemplified as execution programs to be executed in each of a plurality of processors, the present invention can also be applied to execution programs of arbitrary applications other than these. . Note that each processor may execute a plurality of programs. Moreover, in a robot control device and an arbitrary control device, the present invention can be applied to the case where each processor executes a plurality of programs.
First, the first embodiment will be explained.
<First embodiment>
FIG. 2 is a functional block diagram showing a functional configuration example of the numerical controller according to the first embodiment.
Also, as applications executed by each of the plurality of CPUs, the axis control application, the display control application, and the peripheral device control application are exemplified as described above. The present invention is not limited to axis control applications, display control applications, and peripheral device control applications, and can be applied to arbitrary applications other than axis control applications, display control applications, and peripheral device control applications.
As shown in FIG. 2, the numerical control device 10 is a numerical control device known to those skilled in the art. Send commands to a machine tool (not shown). Thereby, the numerical controller 10 controls the operation of the machine tool (not shown). If the machine tool (not shown) is a robot or the like, the numerical controller 10 may be a robot controller or the like.
 図2に示すように、数値制御装置10は、システム制御モジュール110、軸制御モジュール120、表示制御モジュール130、周辺機器制御モジュール140、及び記憶部150を有する。システム制御モジュール110、軸制御モジュール120、表示制御モジュール130、周辺機器制御モジュール140、及び記憶部150は、バス160を介して通信可能に接続される。
 システム制御モジュール110は、CPU111、及びローカルメモリ112を有する。また、CPU111は、アクセス頻度評価部1111、及びメモリ配置最適化部1112を有する。また、軸制御モジュール120は、CPU121、及びローカルメモリ122を有する。また、表示制御モジュール130は、CPU131、及びローカルメモリ132を有する。また、周辺機器制御モジュール140は、CPU141、及びローカルメモリ142を有する。
As shown in FIG. 2 , the numerical controller 10 has a system control module 110 , an axis control module 120 , a display control module 130 , a peripheral device control module 140 and a storage section 150 . The system control module 110 , the axis control module 120 , the display control module 130 , the peripheral device control module 140 and the storage unit 150 are communicably connected via the bus 160 .
The system control module 110 has a CPU 111 and a local memory 112 . The CPU 111 also has an access frequency evaluation unit 1111 and a memory allocation optimization unit 1112 . The axis control module 120 also has a CPU 121 and a local memory 122 . Also, the display control module 130 has a CPU 131 and a local memory 132 . Also, the peripheral device control module 140 has a CPU 141 and a local memory 142 .
<記憶部150>
 記憶部150は、ROM(Read Only Memory)等のメインメモリである。記憶部150は、システムプログラム及び複数のアプリケーションプログラム(例えば、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153)が格納されてもよい。また、記憶部150は、後述する共有変数情報154を含む。
<Storage unit 150>
The storage unit 150 is a main memory such as a ROM (Read Only Memory). The storage unit 150 may store a system program and a plurality of application programs (eg, axis control application 151, display control application 152, peripheral device control application 153). The storage unit 150 also includes shared variable information 154, which will be described later.
 軸制御アプリ151は、例えば、工作機械(図示しない)に含まれる主軸等を制御する実行プログラムであり、後述する軸制御モジュール120にロードされ実行される。 The axis control application 151 is, for example, an execution program that controls a spindle or the like included in a machine tool (not shown), and is loaded into the axis control module 120 described later and executed.
 表示制御アプリ152は、例えば、数値制御装置10に含まれるLCD(Liquid Crystal Display)等の表示装置の表示を制御する実行プログラムであり、後述する表示制御モジュール130にロードされ実行される。 The display control application 152 is, for example, an execution program that controls the display of a display device such as an LCD (Liquid Crystal Display) included in the numerical controller 10, and is loaded into the display control module 130 described later and executed.
 周辺機器制御アプリ153は、例えば、工作機械(図示しない)の周辺に配置された周辺機器を制御する実行プログラムであり、後述する周辺機器制御モジュール140にロードされ実行される。 The peripheral device control application 153 is, for example, an execution program that controls peripheral devices arranged around a machine tool (not shown), and is loaded into the peripheral device control module 140 described later and executed.
 共有変数情報154は、例えば、軸制御アプリ151、表示制御アプリ152、及び周辺機器制御アプリ153それぞれのアプリ間で、例えば連携して動作させるための共有変数に関する情報を含む。具体的には、それぞれのアプリが共有変数にアクセスするときに指定する共有変数と、当該共有変数の値を参照する際の仮想アドレスと、当該共有変数の値が実際に記憶されている物理アドレスと、の対応関係を含む。
 図3は、共有変数情報154の一例を示す図である。
 図3に示すように、共有変数情報154は、「共有変数」、「仮想アドレス」、及び「物理アドレス」の格納領域を有する。
 共有変数情報154内の「共有変数」の格納領域には、例えば、「x」、「y」、「z」等の共有変数が格納される。
 共有変数情報154内の「仮想アドレス」の格納領域には、例えば、軸制御アプリ151、表示制御アプリ152、及び周辺機器制御アプリ153間で連携して動作するために割り当てられた共有変数x、y、zそれぞれに対応する仮想アドレス「aaaaaaaa」、「bbbbbbbb」、「cccccccc」等が格納される。
 共有変数情報154内の「物理アドレス」の格納領域には、例えば、共有変数x、y、z等それぞれが記憶されたローカルメモリに割り振られた際の実際の物理アドレス「XXXXXXXX」、「YYYYYYYY」、「ZZZZZZZZ」等が格納される。
The shared variable information 154 includes, for example, information on shared variables for cooperative operation among the axis control application 151, the display control application 152, and the peripheral device control application 153, for example. Specifically, the shared variable specified when each application accesses the shared variable, the virtual address used when referencing the value of the shared variable, and the physical address where the value of the shared variable is actually stored , and the corresponding relationship.
FIG. 3 is a diagram showing an example of the shared variable information 154. As shown in FIG.
As shown in FIG. 3, the shared variable information 154 has storage areas for "shared variables,""virtualaddresses," and "physical addresses."
In the storage area of "shared variables" in the shared variable information 154, shared variables such as "x", "y", and "z" are stored.
In the storage area of the "virtual address" in the shared variable information 154, for example, the shared variable x assigned for cooperative operation among the axis control application 151, the display control application 152, and the peripheral device control application 153, Virtual addresses such as "aaaaaaaa", "bbbbbbbb", "cccccccc" corresponding to y and z are stored.
In the "physical address" storage area in the shared variable information 154, for example, the actual physical addresses "XXXXXXXXX" and "YYYYYYYY" when allocated to the local memory storing the shared variables x, y, z, etc., respectively. , “ZZZZZZZZ” and the like are stored.
 <システム制御モジュール110>
 システム制御モジュール110は、数値制御装置10全体を制御するモジュールであり、CPU111と、ローカルメモリ112と、を有する。
 ローカルメモリ112は、RAM(Random Access Memory)等により構成される。
 CPU111は数値制御装置10を全体的に制御するプロセッサである。CPU111は、メインメモリである記憶部150に格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バス160を介して読み出し、ローカルメモリ112にロードし、システムプログラム及び当該アプリケーションプログラムに従って数値制御装置10全体を制御する。これにより、図2に示すように、CPU111が、アクセス頻度評価部1111、及びメモリ配置最適化部1112の機能を実現するように構成される。
<System control module 110>
The system control module 110 is a module that controls the entire numerical controller 10 and has a CPU 111 and a local memory 112 .
The local memory 112 is composed of a RAM (Random Access Memory) or the like.
A CPU 111 is a processor that controls the numerical controller 10 as a whole. The CPU 111 reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit described later, loads the system program and the application program into the local memory 112, and loads the system program and the application program into the local memory 112. The entire numerical controller 10 is controlled according to the following. Thereby, as shown in FIG. 2, the CPU 111 is configured to implement the functions of the access frequency evaluation unit 1111 and the memory allocation optimization unit 1112 .
 アクセス頻度評価部1111は、例えば、後述する軸制御モジュール120のCPU121、表示制御モジュール130のCPU131、及び周辺機器制御モジュール140のCPU141それぞれが実行する軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153毎に共有変数情報154に含まれる共有変数x、y、z等へのアクセス頻度を評価する。
 具体的には、アクセス頻度評価部1111は、主軸等を制御する実行プログラムである軸制御アプリ151をローカルメモリ122に展開(ロード)した際に、当該軸制御アプリ151が、例えば、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数(アクセス頻度)を取得する。
 同様に、アクセス頻度評価部1111は、後述するCPU131が記憶部150に記憶された、表示装置の表示を制御する実行プログラムである表示制御アプリ152をローカルメモリ132に展開(ロード)した際に、当該表示制御アプリ152が、例えば、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数(アクセス頻度)を取得する。
 同様に、アクセス頻度評価部1111は、後述するCPU141が記憶部150に記憶された周辺機器を制御する実行プログラムである周辺機器制御アプリ153をローカルメモリ142に展開(ロード)した際に、当該周辺機器制御アプリ153が、例えば、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数(アクセス頻度)を取得する。
The access frequency evaluation unit 1111 includes, for example, the axis control application 151, the display control application 152, the peripheral device control, and the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, and the CPU 141 of the peripheral device control module 140, which will be described later. The frequency of access to the shared variables x, y, z, etc. included in the shared variable information 154 is evaluated for each application 153 .
Specifically, when the axis control application 151, which is an execution program for controlling the spindle and the like, is expanded (loaded) into the local memory 122, the access frequency evaluation unit 1111 detects that the axis control application 151 is, for example, the shared variable x , y, and z in each execution cycle (access frequency).
Similarly, when the CPU 131, which will be described later, develops (loads) a display control application 152, which is an execution program for controlling the display of the display device, stored in the storage unit 150 into the local memory 132, the access frequency evaluation unit 1111 The display control application 152 acquires, for example, the number of accesses (access frequency) per execution cycle for each of the shared variables x, y, and z.
Similarly, when the CPU 141 (to be described later) develops (loads) a peripheral device control application 153, which is an execution program for controlling a peripheral device stored in the storage unit 150, into the local memory 142, the access frequency evaluation unit 1111 The device control application 153 acquires, for example, the number of accesses per execution cycle (access frequency) for each of the shared variables x, y, and z.
 このため、アクセス頻度評価部1111は、参照命令実行記録部1113を備えるようにしてもよい。
 ここで、参照命令実行記録部1113は、軸制御モジュール120のCPU121、表示制御モジュール130のCPU131、及び周辺機器制御モジュール140のCPU141それぞれが、主軸等を制御する実行プログラムである軸制御アプリ151をローカルメモリ122に、表示装置の表示を制御する実行プログラムである表示制御アプリ152をローカルメモリ132に、及び周辺機器を制御する実行プログラムである周辺機器制御アプリ153をローカルメモリ142に、展開(ロード)した際に、軸制御アプリ151、表示制御アプリ152、及び周辺機器制御アプリ153が、それぞれ1実行周期あたりにそれぞれの共有変数x、y、zにアクセスするアクセス回数を記録する。
Therefore, the access frequency evaluation unit 1111 may include a reference instruction execution recording unit 1113 .
Here, in the reference instruction execution recording unit 1113, each of the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, and the CPU 141 of the peripheral device control module 140 executes the axis control application 151, which is an execution program for controlling the spindle and the like. A display control application 152, which is an execution program for controlling the display of the display device, is expanded (loaded) into the local memory 122, and a peripheral device control application 153, which is an execution program for controlling peripheral devices, into the local memory 142. ), the axis control application 151, the display control application 152, and the peripheral device control application 153 record the number of accesses to the respective shared variables x, y, and z per execution cycle.
 そうすることで、アクセス頻度評価部1111は、当該軸制御アプリ151が1実行周期あたりにそれぞれの共有変数x、y、zにアクセスするアクセス回数を算出し、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数を軸制御アプリ151の共有変数へのアクセス頻度として記憶する。
 同様に、アクセス頻度評価部1111は、表示制御アプリ152が1実行周期あたりにそれぞれの共有変数x、y、zにアクセスするアクセス回数を算出し、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数を表示制御アプリ152の共有変数へのアクセス頻度として記憶する。
 同様に、アクセス頻度評価部1111は、周辺機器制御アプリ153が1実行周期あたりにそれぞれの共有変数x、y、zにアクセスするアクセス回数を算出し、共有変数x、y、zそれぞれに対する1実行周期あたりのアクセス回数を周辺機器制御アプリ153の共有変数へのアクセス頻度として記憶する。
 なお、1つのモジュール(例えば軸制御モジュール120)上で、複数の実行プログラムを実行する場合、各実行プログラムの共有変数に対する1実行周期あたりのアクセス回数を軸制御アプリ151の共有変数へのアクセス頻度として記憶するようにしてもよい。そうすることで、後述するメモリ配置最適化部1112は、当該プロセッサの共有変数へのアクセス頻度を算出することができる。
By doing so, the access frequency evaluation unit 1111 calculates the number of times the axis control application 151 accesses each of the shared variables x, y, and z in one execution cycle, and The number of accesses per execution cycle is stored as the access frequency to the shared variables of the axis control application 151 .
Similarly, the access frequency evaluation unit 1111 calculates the number of times the display control application 152 accesses each of the shared variables x, y, and z per execution cycle, The number of accesses per unit is stored as the frequency of access to the shared variable of the display control application 152 .
Similarly, the access frequency evaluation unit 1111 calculates the number of times the peripheral device control application 153 accesses each of the shared variables x, y, and z in one execution cycle, and calculates one execution for each of the shared variables x, y, and z. The number of accesses per period is stored as the access frequency to the shared variable of the peripheral device control application 153 .
Note that when a plurality of execution programs are executed on one module (for example, the axis control module 120), the number of accesses to the shared variables of each execution program per execution cycle is defined as the frequency of access to the shared variables of the axis control application 151. may be stored as By doing so, the memory allocation optimization unit 1112, which will be described later, can calculate the frequency of access to the shared variables of the processor.
 図4Aは、軸制御アプリ151における共有変数毎のアクセス頻度の一例を示す図である。図4Bは、表示制御アプリ152における共有変数毎のアクセス頻度の一例を示す図である。図4Cは、周辺機器制御アプリ153における共有変数毎のアクセス頻度の一例を示す図である。
 図4Aに示すように、軸制御アプリ151の場合には、共有変数xへのアクセス頻度は1実行周期あたり80回/cycleである。また、図4Bに示すように、表示制御アプリ152の場合には、共有変数yへのアクセス頻度は、1実行周期あたり60回/cycleである。また、図4Cに示すように、周辺機器制御アプリ153の場合には、共有変数zへのアクセス頻度は、1実行周期あたり50回/cycleである。
FIG. 4A is a diagram showing an example of the access frequency for each shared variable in the axis control application 151. FIG. FIG. 4B is a diagram showing an example of the access frequency for each shared variable in the display control application 152. As shown in FIG. FIG. 4C is a diagram showing an example of the access frequency for each shared variable in the peripheral device control application 153. As shown in FIG.
As shown in FIG. 4A, in the case of the axis control application 151, the access frequency to the shared variable x is 80 times/cycle per execution cycle. Further, as shown in FIG. 4B, in the case of the display control application 152, the access frequency to the shared variable y is 60 times/cycle per one execution period. Also, as shown in FIG. 4C, in the case of the peripheral device control application 153, the access frequency to the shared variable z is 50 times/cycle per one execution period.
 なお、図5に示すように、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153毎に1実行周期が異なることから、後述するように、メモリ配置最適化部1112は、各アプリの1実行周期を整数倍することにより一致する時間Tを求め、求めた時間Tにおけるアプリ毎の共有変数x、y、z等へのアクセス頻度に基づいて、各共有変数x、y、z等への時間Tにおけるアクセス回数を算出し(「同一処理時間におけるアクセス頻度」、「補正後アクセス頻度」、又は、特に断らない限り単に「アクセス頻度」ともいう)、当該補正後アクセス頻度に基づいて、共有変数の値が記憶される物理アドレスの再編成を行うことができる。 As shown in FIG. 5, the axis control application 151, the display control application 152, and the peripheral device control application 153 have different execution cycles. The matching time T is obtained by multiplying one execution cycle by an integer, and based on the frequency of access to the shared variables x, y, z, etc. for each application in the obtained time T, each shared variable x, y, z, etc. (also referred to as "access frequency in the same processing time", "corrected access frequency", or simply "access frequency" unless otherwise specified), and based on the corrected access frequency, A reorganization of the physical addresses at which the values of shared variables are stored can be done.
 メモリ配置最適化部1112は、補正後のアクセス頻度(以下、特に断らない限り「アクセス頻度」ともいう)に基づいて共有変数を配置するローカルメモリを変更する。図6A、図6B、及び図6Cに、それぞれ軸制御アプリ151、表示制御アプリ152、及び周辺機器制御アプリ153の補正後のアクセス頻度(アクセス頻度)を図示する。
 具体的には、メモリ配置最適化部1112は、軸制御アプリ151において最もアクセス頻度が高かった共有変数xを、配置先である軸制御アプリ151を実行する後述する軸制御モジュール120のローカルメモリ122に記憶するための物理アドレス(例えば、「AAAAAAAA」)を取得する。メモリ配置最適化部1112は、共有変数情報154に格納されている、配置対象の共有変数xの物理アドレスを、例えば「XXXXXXXX」から「AAAAAAAA」に変更し、共有変数xをローカルメモリ122の物理アドレス「AAAAAAAA」に配置する。
 また、メモリ配置最適化部1112は、表示制御アプリ152において最もアクセス頻度が高かった共有変数yを、配置先である表示制御アプリ152を実行する後述する表示制御モジュール130のローカルメモリ132に記憶するための物理アドレス(例えば、「BBBBBBBBBB」)を取得する。メモリ配置最適化部1112は、共有変数情報154に格納されている、配置対象の共有変数yの物理アドレスを、例えば「YYYYYYYY」から「BBBBBBBB」に変更し、共有変数yをローカルメモリ132の物理アドレス「BBBBBBBB」に配置する。
 また、メモリ配置最適化部1112は、周辺機器制御アプリ153において最もアクセス頻度が高かった共有変数zを、配置先である周辺機器制御アプリ153を実行する後述する周辺機器制御モジュール140のローカルメモリ142に記憶するための物理アドレス(例えば、「CCCCCCCC」)を取得する。メモリ配置最適化部1112は、共有変数情報154に格納されている、配置対象の共有変数zの物理アドレスを、例えば「ZZZZZZZZ」から「CCCCCCCC」に変更し、共有変数zをローカルメモリ142の物理アドレス「CCCCCCCC」に配置する。
 そうすることで、CPU121、131、141は、バス160を経由したローカルメモリへのアクセスが減少し、処理時間を短縮することができる。
The memory allocation optimization unit 1112 changes the local memory in which shared variables are allocated based on the corrected access frequency (hereinafter also referred to as “access frequency” unless otherwise specified). 6A, 6B, and 6C show corrected access frequencies (access frequencies) of the axis control application 151, the display control application 152, and the peripheral device control application 153, respectively.
Specifically, the memory allocation optimization unit 1112 stores the shared variable x, which has the highest access frequency in the axis control application 151, in the local memory 122 of the axis control module 120 (to be described later) that executes the axis control application 151, which is the allocation destination. Obtain a physical address (eg, "AAAAAAA") to store in the . The memory allocation optimizing unit 1112 changes the physical address of the shared variable x to be allocated, which is stored in the shared variable information 154, from, for example, “XXXXXXXXX” to “AAAAAAAAA”, and moves the shared variable x to the physical address of the local memory 122. It is placed at the address "AAAAAAAA".
In addition, the memory allocation optimization unit 1112 stores the shared variable y with the highest access frequency in the display control application 152 in the local memory 132 of the later-described display control module 130 that executes the display control application 152, which is the allocation destination. Get a physical address (eg, “BBBBBBBBBB”) for The memory allocation optimization unit 1112 changes the physical address of the shared variable y to be allocated, which is stored in the shared variable information 154 , from “YYYYYYYY” to “BBBBBBBB”, for example, and places the shared variable y in the physical address of the local memory 132 . It is placed at the address "BBBBBBBB".
In addition, the memory allocation optimizing unit 1112 stores the shared variable z, which has the highest access frequency in the peripheral device control application 153, in the local memory 142 of the peripheral device control module 140 (to be described later) that executes the peripheral device control application 153, which is the allocation destination. Get a physical address (eg, "CCCCCCCC") to store in the . The memory allocation optimization unit 1112 changes the physical address of the shared variable z to be allocated, which is stored in the shared variable information 154 , from “ZZZZZZZZZZ” to “CCCCCCCC”, for example, and changes the shared variable z to the physical address of the local memory 142 . It is placed at the address "CCCCCCCC".
By doing so, the CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
<軸制御モジュール120>
 軸制御モジュール120は、CPU121と、ローカルメモリ122と、を有する。
 CPU121は、軸制御アプリ151を実行することにより、工作機械(図示しない)に含まれる主軸やテーブルの位置及び傾きを変化させるX軸、Y軸、Z軸の3軸や、X軸、Y軸、Z軸、A軸、B軸の5軸等それぞれを制御する。
 ローカルメモリ122は、RAM等であり、CPU121により実行される軸制御アプリ151がロードされ、実行時には、メモリ配置最適化部1112により最適配置された共有変数xにアクセスすることができる。
 なお、軸制御モジュール120は、X軸、Y軸、Z軸の3軸、又はX軸、Y軸、Z軸、A軸、B軸の5軸等それぞれを制御するとしたが、これに限定されない。例えば、数値制御装置10は、各軸を制御する複数の軸制御モジュール120を有してもよい。
<Axis control module 120>
The axis control module 120 has a CPU 121 and a local memory 122 .
By executing the axis control application 151, the CPU 121 controls the three axes of the X, Y, and Z axes that change the position and inclination of the spindle and table included in the machine tool (not shown), and the X and Y axes. , Z-axis, A-axis, and B-axis.
The local memory 122 is a RAM or the like, in which the axis control application 151 executed by the CPU 121 is loaded, and can access the shared variable x optimally allocated by the memory allocation optimization unit 1112 during execution.
Although the axis control module 120 controls three axes of the X axis, the Y axis, and the Z axis, or five axes of the X axis, the Y axis, the Z axis, the A axis, and the B axis, etc., the axis control module 120 is not limited to this. . For example, the numerical controller 10 may have multiple axis control modules 120 that control each axis.
<表示制御モジュール130>
 表示制御モジュール130は、CPU131と、ローカルメモリ132と、を有する。
 CPU131は、表示制御アプリ152を実行することにより、工作機械(図示しない)の表示装置の表示を制御する。
 ローカルメモリ132は、RAM等であり、CPU131により実行される表示制御アプリ152がロードされ、実行時には、メモリ配置最適化部1112により最適配置された共有変数yにアクセスすることができる。
<Display control module 130>
The display control module 130 has a CPU 131 and a local memory 132 .
The CPU 131 executes the display control application 152 to control the display of the display device of the machine tool (not shown).
The local memory 132 is a RAM or the like, loads the display control application 152 executed by the CPU 131, and can access the shared variable y optimally allocated by the memory allocation optimization unit 1112 during execution.
<周辺機器制御モジュール140>
 周辺機器制御モジュール140は、CPU141と、ローカルメモリ142と、を有する。
 CPU141は、周辺機器制御アプリ153を実行することにより、工作機械(図示しない)の周辺に配置された周辺機器を制御する。
 ローカルメモリ142は、RAM等であり、CPU141により実行される周辺機器制御アプリ153がロードされ、実行時には、メモリ配置最適化部1112により最適配置された共有変数zにアクセスすることができる。
<Peripheral Device Control Module 140>
The peripheral device control module 140 has a CPU 141 and a local memory 142 .
The CPU 141 controls peripheral devices arranged around the machine tool (not shown) by executing the peripheral device control application 153 .
The local memory 142 is a RAM or the like, loads the peripheral device control application 153 executed by the CPU 141, and can access the shared variable z optimally allocated by the memory allocation optimization unit 1112 during execution.
<数値制御装置10の配置最適化処理>
 次に、図7を参照しながら、数値制御装置10の配置最適化処理の流れを説明する。
 図7は、数値制御装置10の配置最適化処理について説明するフローチャートである。ここで示すフローは、数値制御装置10がアプリをロードする際に、繰り返し実行される。
<Placement Optimization Processing of Numerical Control Device 10>
Next, with reference to FIG. 7, the flow of the arrangement optimization processing of the numerical controller 10 will be described.
FIG. 7 is a flowchart for explaining the placement optimization processing of the numerical controller 10. As shown in FIG. The flow shown here is repeatedly executed when the numerical controller 10 loads an application.
 ステップS11において、アクセス頻度評価部1111は、軸制御モジュール120のCPU121、表示制御モジュール130のCPU131、又は周辺機器制御モジュール140のCPU141が記憶部150に記憶された軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153をローカルメモリに展開する際に、1実行周期あたりの共有変数x、y、zそれぞれへのアクセス頻度を算出する。 In step S11, the access frequency evaluation unit 1111 determines whether the CPU 121 of the axis control module 120, the CPU 131 of the display control module 130, or the CPU 141 of the peripheral device control module 140 stores the axis control application 151 and the display control application 152 in the storage unit 150. , the frequency of access to each of the shared variables x, y, and z per one execution cycle is calculated when the peripheral device control application 153 is developed in the local memory.
 ステップS12において、アクセス頻度評価部1111は、全てのアプリのアクセス頻度を算出したか否かを判定する。全てのアプリのアクセス頻度を算出した場合、処理はステップS13に進む。一方、全てのアプリのアクセス頻度を算出していない場合、処理はステップS11に戻る。 In step S12, the access frequency evaluation unit 1111 determines whether or not the access frequencies of all applications have been calculated. When the access frequencies of all applications have been calculated, the process proceeds to step S13. On the other hand, if the access frequencies of all applications have not been calculated, the process returns to step S11.
 ステップS13において、メモリ配置最適化部1112は、ステップS11で算出した軸制御アプリ151、表示制御アプリ152、又は周辺機器制御アプリ153のアプリのアクセス頻度を取得する。 In step S13, the memory allocation optimization unit 1112 acquires the application access frequency of the axis control application 151, the display control application 152, or the peripheral device control application 153 calculated in step S11.
 ステップS14において、メモリ配置最適化部1112は、ステップS13で取得した共有変数へのアクセス頻度をアプリ間で比較し、当該共有変数へのアクセス頻度が最も高いアプリを特定し、当該アプリを実行する軸制御モジュール120のローカルメモリ122、表示制御モジュール130のローカルメモリ132、又は周辺機器制御モジュール140のローカルメモリ142の物理アドレスを取得する。メモリ配置最適化部1112は、共有変数情報154に格納されている配置対象の共有変数の物理アドレスを取得した物理アドレスに変更して、共有変数をローカルメモリに配置する。 In step S14, the memory allocation optimization unit 1112 compares the frequency of access to the shared variables acquired in step S13 among the applications, identifies the application with the highest access frequency to the shared variable, and executes the application. Obtain the physical address of the local memory 122 of the axis control module 120 , the local memory 132 of the display control module 130 , or the local memory 142 of the peripheral device control module 140 . The memory placement optimization unit 1112 changes the physical address of the shared variable to be placed stored in the shared variable information 154 to the acquired physical address, and places the shared variable in the local memory.
 ステップS15において、メモリ配置最適化部1112は、全ての共有変数をローカルメモリに配置したか否かを判定する。全ての共有変数をローカルメモリに配置した場合、配置最適化処理は終了する。一方、全ての共有変数をローカルメモリに配置していない場合、処理はステップS13に戻る。 In step S15, the memory placement optimization unit 1112 determines whether all shared variables have been placed in the local memory. When all shared variables have been placed in the local memory, the placement optimization process ends. On the other hand, if all shared variables have not been placed in the local memory, the process returns to step S13.
 以上により、第1実施形態に係る数値制御装置10は、各CPU121、131、141が実行する軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153の共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数をアプリが実行されるCPUのローカルメモリに配置することができる。
 そして、数値制御装置10は、記憶部150へのアクセスが減少し、処理時間を短縮することができる。
 以上、第1実施形態について説明した。
As described above, the numerical controller 10 according to the first embodiment analyzes the frequency of access to the shared variables of the axis control application 151, the display control application 152, and the peripheral device control application 153 executed by the respective CPUs 121, 131, and 141, Shared variables with high access frequency can be placed in the local memory of the CPU where the application is executed.
In addition, the numerical controller 10 can reduce access to the storage unit 150 and shorten the processing time.
The first embodiment has been described above.
<第2実施形態>
 次に、第2実施形態について説明する。第2実施形態では、数値制御装置10Aは、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムから共有変数への参照命令数を外部装置から取得し、取得した参照命令数に基づいて共有変数へのアクセス頻度を評価する点で、第1実施形態と相違する。
 これにより、第2実施形態の数値制御装置10Aは、各CPUが実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することができる。
 以下に、第2実施形態について説明する。
<Second embodiment>
Next, a second embodiment will be described. In the second embodiment, the numerical controller 10A acquires from an external device the number of reference instructions to shared variables from the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153, and is different from the first embodiment in that the access frequency to the shared variable is evaluated based on .
As a result, the numerical controller 10A of the second embodiment analyzes the frequency of access to the shared variables of the applications executed by each CPU, and arranges the shared variables with high access frequency in the local memory of the CPU executing the applications. can do.
A second embodiment will be described below.
 図8は、第2実施形態に係る数値制御装置10Aの機能的構成例を示す機能ブロック図である。なお、図2の数値制御装置10の要素と同様の機能を有する要素については、同じ符号を付し、詳細な説明は省略する。
 図8に示すように、数値制御装置10Aは、情報処理装置20と図示しない接続インタフェースを介して互いに直接接続されてもよい。また、数値制御装置10Aは、情報処理装置20とLAN(Local Area Network)やインターネット等の図示しないネットワークを介して接続されていてもよい。この場合、数値制御装置10A、及び情報処理装置20は、かかる接続によって相互に通信を行うための図示しない通信部を備えている。
 なお、数値制御装置10Aは、1つの情報処理装置20と接続されているが、複数の情報処理装置20と接続されてもよい。
FIG. 8 is a functional block diagram showing a functional configuration example of a numerical controller 10A according to the second embodiment. Elements having functions similar to those of the numerical control device 10 in FIG.
As shown in FIG. 8, the numerical control device 10A may be directly connected to the information processing device 20 via a connection interface (not shown). Further, the numerical control device 10A may be connected to the information processing device 20 via a network (not shown) such as a LAN (Local Area Network) or the Internet. In this case, the numerical control device 10A and the information processing device 20 are provided with a communication section (not shown) for mutual communication through such connection.
Although the numerical control device 10A is connected to one information processing device 20, it may be connected to a plurality of information processing devices 20. FIG.
<情報処理装置20>
 情報処理装置20は、例えば、コンピュータやタブレット端末等である。
 図9は、情報処理装置20の機能的構成例を示す機能ブロック図である。
 図9に示すように、情報処理装置20は、制御部210、及び記憶部220を有する。さらに、制御部210は、解析部211、及びコンパイル部212を有する。
<Information processing device 20>
The information processing device 20 is, for example, a computer, a tablet terminal, or the like.
FIG. 9 is a functional block diagram showing a functional configuration example of the information processing device 20. As shown in FIG.
As shown in FIG. 9 , the information processing device 20 has a control section 210 and a storage section 220 . Furthermore, the control unit 210 has an analysis unit 211 and a compilation unit 212 .
<記憶部220>
 記憶部220は、RAMやHDD(Hard Disk Drive)等であり、システムプログラム及び複数のアプリケーションプログラムが格納されてもよい。記憶部220は、軸制御ソースプログラム221、表示制御ソースプログラム222、及び周辺機器制御ソースプログラム223を含む。
 軸制御ソースプログラム221は、数値制御装置10Aの記憶部150に記憶される軸制御アプリ151のソースプログラムである。
 表示制御ソースプログラム222は、数値制御装置10Aの記憶部150に記憶される表示制御アプリ152のソースプログラムである。
 周辺機器制御ソースプログラム223は、数値制御装置10Aの記憶部150に記憶される周辺機器制御アプリ153のソースプログラムである。
<Storage unit 220>
The storage unit 220 is a RAM, HDD (Hard Disk Drive), or the like, and may store a system program and a plurality of application programs. The storage unit 220 includes an axis control source program 221 , a display control source program 222 and a peripheral device control source program 223 .
The axis control source program 221 is the source program of the axis control application 151 stored in the storage unit 150 of the numerical controller 10A.
The display control source program 222 is the source program of the display control application 152 stored in the storage unit 150 of the numerical controller 10A.
The peripheral device control source program 223 is the source program of the peripheral device control application 153 stored in the storage unit 150 of the numerical controller 10A.
<制御部210>
 制御部210は、CPU、ROM、RAM、CMOS(Complementary Metal-Oxide-Semiconductor)メモリ等を有し、これらはバスを介して相互に通信可能に構成される、当業者にとって公知のものである。
 CPUは情報処理装置20を全体的に制御するプロセッサである。CPUは、ROMに格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バスを介して読み出し、メモリ(図示せず)にロードし、システムプログラム及び当該アプリケーションプログラムに従って情報処理装置20全体を制御する。これにより、図9に示すように、制御部210が、解析部211、及びコンパイル部212の機能を実現するように構成される。RAMには一時的な計算データや表示データ等の各種データが格納される。また、CMOSメモリは図示しないバッテリでバックアップされ、情報処理装置20の電源がオフされても記憶状態が保持される不揮発性メモリとして構成される。
<Control unit 210>
The control unit 210 has a CPU, a ROM, a RAM, a CMOS (Complementary Metal-Oxide-Semiconductor) memory, etc., which are known to those skilled in the art and are configured to communicate with each other via a bus.
The CPU is a processor that controls the information processing device 20 as a whole. The CPU reads the system program stored in the ROM and the application program for executing the function units described later via the bus, loads them into a memory (not shown), and executes the information processing apparatus according to the system program and the application program. 20 as a whole. Thereby, as shown in FIG. 9, the control unit 210 is configured to implement the functions of the analysis unit 211 and the compilation unit 212 . Various data such as temporary calculation data and display data are stored in the RAM. Further, the CMOS memory is backed up by a battery (not shown) and configured as a non-volatile memory that retains the memory state even when the information processing apparatus 20 is powered off.
 解析部211は、例えば、情報処理装置20に含まれるキーボードやタッチパネル等の入力装置(図示しない)を介してユーザから軸制御ソースプログラム221、表示制御ソースプログラム222、及び周辺機器制御ソースプログラム223のソースプログラムに対する解析指示を受け付けた場合、各ソースプログラムを解析し、ソースプログラムの最初から最後まで(すなわち、1実行周期)における共有変数x、y、z等それぞれを参照する制御文の数を共有変数毎に参照命令数として求める。解析部211は、求めた各プログラムの共有変数x、y、z等の参照命令数を、例えば各プログラムの実行形式のプログラムに格納するようにしてもよい。そうすることで、当該実行プログラムを数値制御装置10Aにおける、後述するそれぞれのローカルメモリに展開(ロード)した際に、数値制御装置10A(アクセス頻度評価部)は、各プログラムの共有変数x、y、z等の参照命令数を取得することができる。 The analysis unit 211 receives, for example, an axis control source program 221, a display control source program 222, and a peripheral device control source program 223 from a user via an input device (not shown) such as a keyboard or touch panel included in the information processing device 20. When an analysis instruction for a source program is received, each source program is analyzed, and the number of control statements that refer to shared variables x, y, z, etc. from the beginning to the end of the source program (that is, one execution cycle) is shared. Obtained as the number of reference instructions for each variable. The analysis unit 211 may store the obtained number of reference instructions such as the shared variables x, y, and z of each program in the execution format of each program, for example. By doing so, when the execution program is expanded (loaded) into respective local memories (to be described later) in the numerical control device 10A, the numerical control device 10A (access frequency evaluation unit) uses shared variables x, y , z, etc. can be obtained.
 コンパイル部212は、例えば、情報処理装置20の入力装置(図示しない)を介してユーザから軸制御ソースプログラム221、表示制御ソースプログラム222、又は周辺機器制御ソースプログラム223のコンパイル指示を受け付けた場合、軸制御ソースプログラム221、表示制御ソースプログラム222、又は周辺機器制御ソースプログラム223をコンパイルし、実行プログラムの軸制御アプリ151、表示制御アプリ152、又は周辺機器制御アプリ153を生成する。コンパイル部212は、生成した表示制御アプリ152、又は周辺機器制御アプリ153を数値制御装置10Aに送信する。
 なお、コンパイル部212は、解析部211の機能を有してもよい。そうすることで、コンパイル部212は、コンパイル指示を受け付けた場合に、前述したように、各プログラムの共有変数x、y、z等の参照命令数を算出し、参照命令数を、各プログラムの実行形式のプログラムに格納することができる。
For example, when the compiling unit 212 receives an instruction to compile the axis control source program 221, the display control source program 222, or the peripheral device control source program 223 from the user via the input device (not shown) of the information processing device 20, The axis control source program 221, the display control source program 222, or the peripheral device control source program 223 is compiled to generate the axis control application 151, the display control application 152, or the peripheral device control application 153 of the execution program. The compiling unit 212 transmits the generated display control application 152 or peripheral device control application 153 to the numerical controller 10A.
Note that the compilation unit 212 may have the function of the analysis unit 211 . By doing so, when receiving a compilation instruction, the compiling unit 212 calculates the number of reference instructions such as the shared variables x, y, and z of each program, and calculates the number of reference instructions of each program as described above. It can be stored in an executable program.
<数値制御装置10A>
 数値制御装置10Aは、図8に示すように、システム制御モジュール110a、軸制御モジュール120、表示制御モジュール130、周辺機器制御モジュール140、及び記憶部150を有する。
<Numerical control device 10A>
The numerical controller 10A has a system control module 110a, an axis control module 120, a display control module 130, a peripheral device control module 140, and a storage section 150, as shown in FIG.
 <システム制御モジュール110a>
 システム制御モジュール110aは、CPU111aと、ローカルメモリ112と、を有する。また、CPU111aは、アクセス頻度評価部1111a、及びメモリ配置最適化部1112を有する。
 メモリ配置最適化部1112は、第1実施形態におけるメモリ配置最適化部1112と同等の機能を有する。
 CPU111aは、第1実施形態のCPU111と同様に、数値制御装置10Aを全体的に制御するプロセッサである。CPU111aは、メインメモリである記憶部150に格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バス160を介して読み出し、ローカルメモリ112にロードし、システムプログラム及び当該アプリケーションプログラムに従って数値制御装置10A全体を制御する。これにより、図8に示すように、CPU111aが、アクセス頻度評価部1111a、及びメモリ配置最適化部1112の機能を実現するように構成される。
<System Control Module 110a>
The system control module 110 a has a CPU 111 a and a local memory 112 . The CPU 111 a also has an access frequency evaluation unit 1111 a and a memory allocation optimization unit 1112 .
The memory layout optimization unit 1112 has functions equivalent to those of the memory layout optimization unit 1112 in the first embodiment.
The CPU 111a is a processor that controls the numerical controller 10A as a whole, like the CPU 111 of the first embodiment. The CPU 111a reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit described later, loads them into the local memory 112, and stores the system program and the application program. The entire numerical controller 10A is controlled according to the following. Thereby, as shown in FIG. 8, the CPU 111a is configured to implement the functions of the access frequency evaluation unit 1111a and the memory allocation optimization unit 1112. FIG.
 アクセス頻度評価部1111aは、情報処理装置20の解析部211による軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムである軸制御ソースプログラム221、表示制御ソースプログラム222、周辺機器制御ソースプログラム223の解析から求めた共有変数x、y、z等への参照命令数を情報処理装置20から取得する。
 アクセス頻度評価部1111aは、取得した実行プログラム、すなわち軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153それぞれにおける共有変数x、y、z等への参照命令数に基づいて1実行周期あたりの共有変数x、y、z等へのアクセス頻度を評価する。
The access frequency evaluation unit 1111a is an axis control source program 221, a display control source program 222, and a peripheral device, which are source programs for the axis control application 151, the display control application 152, and the peripheral device control application 153. The number of reference instructions to the shared variables x, y, z, etc. obtained from the analysis of the control source program 223 is acquired from the information processing device 20 .
The access frequency evaluation unit 1111a per execution cycle based on the number of reference instructions to the shared variables x, y, z, etc. in each of the acquired execution programs, that is, the axis control application 151, the display control application 152, and the peripheral device control application 153. Evaluate the frequency of access to shared variables x, y, z, etc. in .
 なお、数値制御装置10Aの配置最適化処理は、アクセス頻度評価部1111aが情報処理装置20から参照命令数を取得する点を除き図7に示す処理と同様であり、詳細な説明は省略する。 Note that the arrangement optimization processing of the numerical control device 10A is the same as the processing shown in FIG. 7 except that the access frequency evaluation unit 1111a acquires the number of reference instructions from the information processing device 20, and detailed description thereof will be omitted.
 以上により、第2実施形態に係る数値制御装置10Aは、情報処理装置20による軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムである軸制御ソースプログラム221、表示制御ソースプログラム222、周辺機器制御ソースプログラム223の解析から求めた共有変数へのアクセス頻度を情報処理装置20から取得する。数値制御装置10Aは、取得した各共有変数へのアクセス頻度を評価することで、アクセス頻度が最も高い共有変数をアプリが実行されるCPUのローカルメモリに配置することができる。
 そして、CPU121、131、141は、バス160を経由したローカルメモリへのアクセスが減少し、処理時間を短縮することができる。
 以上、第2実施形態について説明した。
As described above, the numerical control device 10A according to the second embodiment includes the axis control source program 221, which is the source program of the axis control application 151, the display control application 152, and the peripheral device control application 153, and the display control source program. 222 , the frequency of access to the shared variables obtained from the analysis of the peripheral device control source program 223 is acquired from the information processing device 20 . By evaluating the frequency of access to each acquired shared variable, the numerical controller 10A can place the shared variable with the highest access frequency in the local memory of the CPU executing the application.
The CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
The second embodiment has been described above.
<第2実施形態の変形例>
 第2実施形態に係る数値制御装置10Aは、アクセス頻度評価部1111aを有したが、これに限定されない。例えば、情報処理装置20は、アクセス頻度評価部1111aを有してもよい。
 例えば、解析部211は、アクセス頻度評価部1111aの機能を有し、各ソースプログラムの解析から求めた共有変数x、y、z等への参照命令数に基づいて共有変数x、y、z等へのアクセス頻度を評価し、評価したアクセス頻度を、例えば各プログラムの実行形式のプログラムに格納するようにしてもよい。そうすることで、当該実行プログラムを数値制御装置10Aにおける、それぞれのローカルメモリに展開(ロード)した際に、数値制御装置10A(メモリ配置最適化部)は、各プログラムの共有変数x、y、z等を最適なローカルメモリに配置することができる。
<Modification of Second Embodiment>
Although the numerical controller 10A according to the second embodiment has the access frequency evaluation unit 1111a, it is not limited to this. For example, the information processing device 20 may have an access frequency evaluation unit 1111a.
For example, the analysis unit 211 has the function of the access frequency evaluation unit 1111a, and calculates the shared variables x, y, z, etc. based on the number of reference instructions to the shared variables x, y, z, etc. obtained from the analysis of each source program. The access frequency may be evaluated, and the evaluated access frequency may be stored, for example, in the executable form of each program. By doing so, when the execution program is developed (loaded) into each local memory in the numerical control device 10A, the numerical control device 10A (memory allocation optimization unit) can set the shared variables x, y, z etc. can be placed in the optimal local memory.
<第3実施形態>
 次に、第3実施形態について説明する。第3実施形態では、数値制御装置10Bは、アクセス頻度の評価に用いる評価パラメータを格納し、共有変数への参照命令数を外部装置としての情報処理装置20Bから取得する場合、アプリのソースプログラム中の制御文毎の参照命令数を評価パラメータによる重み付けを行い補正し、補正した参照命令数に基づいて共有変数へのアクセス頻度を評価する点で、第1実施形態、及び第2実施形態と相違する。
 これにより、第3実施形態の数値制御装置10Bは、各CPUが実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することができる。
 以下に、第3実施形態について説明する。
<Third Embodiment>
Next, a third embodiment will be described. In the third embodiment, the numerical controller 10B stores an evaluation parameter used for evaluating the access frequency, and when acquiring the number of reference instructions to the shared variable from the information processing device 20B as an external device, The difference from the first and second embodiments is that the number of reference instructions for each control statement is weighted and corrected by an evaluation parameter, and the frequency of access to shared variables is evaluated based on the corrected number of reference instructions. do.
As a result, the numerical controller 10B of the third embodiment analyzes the frequency of access to the shared variables of the applications executed by each CPU, and arranges shared variables with high access frequency in the local memory of the CPU executing the applications. can do.
A third embodiment will be described below.
 図10は、第3実施形態に係る数値制御装置10Bの機能的構成例を示す機能ブロック図である。なお、図2の数値制御装置10の要素と同様の機能を有する要素については、同じ符号を付し、詳細な説明は省略する。
 図10に示すように、数値制御装置10Bは、第2実施形態に係る数値制御装置10Aと同様に、情報処理装置20Bと図示しない接続インタフェースを介して互いに直接接続されてもよい。また、数値制御装置10Bは、情報処理装置20BとLAN(Local Area Network)やインターネット等の図示しないネットワークを介して接続されていてもよい。
FIG. 10 is a functional block diagram showing a functional configuration example of a numerical controller 10B according to the third embodiment. Elements having functions similar to those of the numerical control device 10 in FIG.
As shown in FIG. 10, the numerical control device 10B may be directly connected to the information processing device 20B via a connection interface (not shown), similarly to the numerical control device 10A according to the second embodiment. Further, the numerical control device 10B may be connected to the information processing device 20B via a network (not shown) such as a LAN (Local Area Network) or the Internet.
<情報処理装置20B>
 図11は、情報処理装置20Bの機能的構成例を示す機能ブロック図である。なお、図9の情報処理装置20の要素と同様の機能を有する要素については、同じ符号を付し、詳細な説明は省略する。
 図11に示すように、情報処理装置20Bは、制御部210b、及び記憶部220を有する。また、制御部210bは、解析部211b、及びコンパイル部212を有する。
<Information processing device 20B>
FIG. 11 is a functional block diagram showing a functional configuration example of the information processing device 20B. Elements having functions similar to those of the information processing apparatus 20 shown in FIG. 9 are denoted by the same reference numerals, and detailed description thereof will be omitted.
As shown in FIG. 11, the information processing device 20B has a control section 210b and a storage section 220. As shown in FIG. Also, the control unit 210b has an analysis unit 211b and a compilation unit 212 .
 制御部210bは、第2実施形態の制御部210と同様に、CPU、ROM、RAM、CMOSメモリ等を有し、これらはバスを介して相互に通信可能に構成される、当業者にとって公知のものである。
 CPUは情報処理装置20Bを全体的に制御するプロセッサである。CPUは、ROMに格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バスを介して読み出し、メモリ(図示せず)にロードし、システムプログラム及び当該アプリケーションプログラムに従って情報処理装置20B全体を制御する。これにより、図11に示すように、制御部210bが、解析部211b、及びコンパイル部212の機能を実現するように構成される。
 コンパイル部212は、第2実施形態におけるコンパイル部212と同等の機能を有する。
As with the control unit 210 of the second embodiment, the control unit 210b has a CPU, a ROM, a RAM, a CMOS memory, etc., which are configured to communicate with each other via a bus. It is.
The CPU is a processor that controls the information processing device 20B as a whole. The CPU reads the system program stored in the ROM and the application program for executing the function units described later via the bus, loads them into a memory (not shown), and executes the information processing apparatus according to the system program and the application program. 20B as a whole. Thereby, as shown in FIG. 11, the control unit 210b is configured to implement the functions of the analysis unit 211b and the compilation unit 212. FIG.
The compiling unit 212 has functions equivalent to those of the compiling unit 212 in the second embodiment.
 解析部211bは、例えば、情報処理装置20Bの入力装置(図示しない)を介してユーザから軸制御ソースプログラム221、表示制御ソースプログラム222、及び周辺機器制御ソースプログラム223のソースプログラムに対する解析指示を受け付けた場合、各ソースプログラムの制御文それぞれの種類(例えば、「平文」、「IF文」、「For文」等)と、制御文毎に共有変数x、y、z等を参照する参照命令数と、を求める。解析部211bは、求めた各制御文の種類と制御文毎の参照命令数とを、例えば各プログラムの実行形式のプログラムに格納するようにしてもよい。そうすることで、当該実行プログラムを数値制御装置10Bにおける、後述するそれぞれのローカルメモリに展開(ロード)した際に、数値制御装置10B(アクセス頻度評価部)は、各プログラムの各制御文の種類と制御文毎の共有変数x、y、z等の参照命令数とを取得することができる。
 なお、解析部211bは、コンパイル部212に含まれてもよい。
For example, the analysis unit 211b receives an analysis instruction for the source programs of the axis control source program 221, the display control source program 222, and the peripheral device control source program 223 from the user via the input device (not shown) of the information processing device 20B. type of control statements in each source program (for example, "plain text", "IF statement", "For statement", etc.) and the number of reference instructions that refer to shared variables x, y, z, etc. for each control statement And ask. The analysis unit 211b may store the obtained type of each control statement and the number of reference instructions for each control statement in, for example, an executable program of each program. By doing so, when the execution program is developed (loaded) into each local memory described later in the numerical control device 10B, the numerical control device 10B (access frequency evaluation unit) determines the type of each control statement of each program and the number of reference instructions such as shared variables x, y, and z for each control statement.
Note that the analysis unit 211 b may be included in the compilation unit 212 .
<数値制御装置10B>
 数値制御装置10Bは、図10に示すように、システム制御モジュール110b、軸制御モジュール120、表示制御モジュール130、周辺機器制御モジュール140、及び記憶部150を有する。
<Numerical control device 10B>
The numerical controller 10B has a system control module 110b, an axis control module 120, a display control module 130, a peripheral device control module 140, and a storage section 150, as shown in FIG.
 <システム制御モジュール110b>
 システム制御モジュール110bは、CPU111bと、ローカルメモリ112と、を有する。また、CPU111bは、アクセス頻度評価部1111b、及びメモリ配置最適化部1112を有する。また、アクセス頻度評価部1111bは、評価パラメータ記憶部1114を有する。
 メモリ配置最適化部1112は、第1実施形態におけるメモリ配置最適化部1112と同等の機能を有する。
 CPU111bは、第1実施形態のCPU111と同様に、数値制御装置10Bを全体的に制御するプロセッサである。CPU111bは、メインメモリである記憶部150に格納されたシステムプログラム及び後述する機能部を実行するためのアプリケーションプログラムを、バス160を介して読み出し、ローカルメモリ112にロードし、システムプログラム及び当該アプリケーションプログラムに従って数値制御装置10B全体を制御する。これにより、図10に示すように、CPU111bが、アクセス頻度評価部1111b、及びメモリ配置最適化部1112の機能を実現するように構成される。また、アクセス頻度評価部1111bが、評価パラメータ記憶部1114の機能を実現するように構成される。
<System control module 110b>
The system control module 110 b has a CPU 111 b and a local memory 112 . The CPU 111b also has an access frequency evaluation unit 1111b and a memory allocation optimization unit 1112 . The access frequency evaluation unit 1111b also has an evaluation parameter storage unit 1114. FIG.
The memory layout optimization unit 1112 has functions equivalent to those of the memory layout optimization unit 1112 in the first embodiment.
The CPU 111b is a processor that controls the numerical controller 10B as a whole, like the CPU 111 of the first embodiment. The CPU 111b reads, via the bus 160, a system program stored in the storage unit 150, which is a main memory, and an application program for executing a function unit (to be described later), loads them into the local memory 112, and stores the system program and the application program in question. The entire numerical controller 10B is controlled according to the following. Thereby, as shown in FIG. 10, the CPU 111b is configured to implement the functions of the access frequency evaluation unit 1111b and the memory allocation optimization unit 1112. FIG. Also, the access frequency evaluation unit 1111b is configured to realize the function of the evaluation parameter storage unit 1114. FIG.
 評価パラメータ記憶部1114は、例えば、アプリのソースプログラムを構成する制御文毎にアクセス頻度の評価に用いる評価パラメータの値を格納する。
 図12は、評価パラメータ記憶部1114に格納される評価パラメータの一例を示す図である。
 図12に示すように、制御文が平文の場合、評価パラメータは、例えば、「1.0」等の値に設定される。また、制御文がIF文の場合、評価パラメータは、条件によっては実行されない場合もあるため、平文の場合と比べて小さい値(例えば、「0.8」等)に設定される。また、制御文がFor文の場合、評価パラメータは、1実行周期で複数回繰り返し実行されることから、平文の場合と比べて大きい値(例えば、「10」等)に設定される。
 なお、評価パラメータの値は、数値制御装置10Bに含まれるキーボードやタッチパネル等の入力装置(図示しない)を介してユーザにより予め設定されてもよい。
The evaluation parameter storage unit 1114 stores, for example, the value of the evaluation parameter used for evaluating the access frequency for each control statement forming the source program of the application.
FIG. 12 is a diagram showing an example of evaluation parameters stored in the evaluation parameter storage unit 1114. As shown in FIG.
As shown in FIG. 12, when the control statement is plain text, the evaluation parameter is set to a value such as "1.0", for example. Also, if the control statement is an IF statement, the evaluation parameter may not be executed depending on the conditions, so the evaluation parameter is set to a smaller value (for example, "0.8", etc.) than in the case of plain text. Also, when the control statement is a For statement, the evaluation parameter is set to a larger value (for example, "10") than in the case of plain text because the control statement is repeatedly executed a plurality of times in one execution cycle.
The value of the evaluation parameter may be set in advance by the user via an input device (not shown) such as a keyboard or touch panel included in the numerical controller 10B.
 アクセス頻度評価部1111bは、例えば、情報処理装置20Bの解析部211による軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムである軸制御ソースプログラム221、表示制御ソースプログラム222、周辺機器制御ソースプログラム223の解析から求めた各制御文の種類と制御文毎の参照命令数とを情報処理装置20Bから取得する。アクセス頻度評価部1111bは、ソースプログラム中の制御文毎の参照命令数を、評価パラメータ記憶部1114に格納された制御文の種類に応じた評価パラメータによる重み付けを行い補正し、補正した参照命令数に基づいて共有変数へのアクセス頻度を評価する。
 図13は、アクセス頻度評価部1111bの動作を説明する一例を示す図である。
 図13に示すように、情報処理装置20Bの解析部211bは、記憶部220に記憶されたソースコードを解析し、制御文それぞれの種類と1実行周期あたり参照命令数「1」とを実行形式のプログラムに格納する。
 数値制御装置10Bのアクセス頻度評価部1111bは、情報処理装置20Bから受信した実行プログラムに格納された制御文毎の参照命令数「1」に対して当該制御文の種類に応じた評価パラメータの値を重み付けすることで参照命令数を補正する。例えば、アクセス頻度評価部1111bは、1つ目及び2つ目の平文の制御文の参照命令数「1」に対して評価パラメータ「1.0」で重み付けして補正し、1実行周期あたり補正した参照命令数「1」を算出する。また、アクセス頻度評価部1111bは、3つ目のIF文の制御文の参照命令数「1」に対して評価パラメータ「0.8」で重み付けして補正し、1実行周期あたり補正した参照命令数「0.8」を算出する。また、アクセス頻度評価部1111bは、4つ目のFor文の制御文の参照命令数「1」に対して評価パラメータ「10」で重み付けして補正し、1実行周期あたり補正した参照命令数「10」を算出する。
 そして、アクセス頻度評価部1111bは、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153それぞれにおいて、補正した参照命令数を共有変数x、y、z毎に加算することで、1実行周期あたりの共有変数x、y、zへのアクセス頻度を評価する。
 そうすることで、数値制御装置10Bは、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153を実行するにあたり、共有変数x、y、z等へのアクセス頻度を精度良く評価することができ、共有変数をローカルメモリ122、132、142に最適配置することができる。
The access frequency evaluation unit 1111b, for example, the axis control source program 221, the display control source program 222, which are the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153 by the analysis unit 211 of the information processing device 20B, The type of each control statement and the number of reference instructions for each control statement obtained from the analysis of the peripheral device control source program 223 are acquired from the information processing device 20B. The access frequency evaluation unit 1111b weights and corrects the number of reference instructions for each control statement in the source program using an evaluation parameter corresponding to the type of control statement stored in the evaluation parameter storage unit 1114, and corrects the corrected number of reference instructions. Evaluate access frequency to shared variables based on .
FIG. 13 is a diagram showing an example explaining the operation of the access frequency evaluation unit 1111b.
As shown in FIG. 13, the analysis unit 211b of the information processing device 20B analyzes the source code stored in the storage unit 220, and determines the type of each control statement and the number of reference instructions "1" per execution cycle. stored in the program of
The access frequency evaluation unit 1111b of the numerical controller 10B determines the value of the evaluation parameter according to the type of the control statement for the number of reference instructions "1" for each control statement stored in the execution program received from the information processing device 20B. is weighted to correct the number of reference instructions. For example, the access frequency evaluation unit 1111b weights and corrects the number of reference instructions "1" of the first and second plaintext control statements with the evaluation parameter "1.0", and corrects the number per execution cycle. Then, the number of reference instructions "1" is calculated. Further, the access frequency evaluation unit 1111b weights and corrects the number of reference instructions of the control statement of the third IF statement "1" by weighting the evaluation parameter "0.8", and corrects the reference instruction count per one execution cycle. Calculate the number "0.8". Further, the access frequency evaluation unit 1111b weights and corrects the reference instruction count “1” of the control statement of the fourth For statement with the evaluation parameter “10”, and corrects the corrected reference instruction count “1” per execution cycle. 10" is calculated.
Then, the access frequency evaluation unit 1111b adds the corrected number of reference instructions to each of the shared variables x, y, and z in each of the axis control application 151, the display control application 152, and the peripheral device control application 153. Evaluate the frequency of access to shared variables x, y, z per
By doing so, when executing the axis control application 151, the display control application 152, and the peripheral device control application 153, the numerical controller 10B can accurately evaluate the access frequency to the shared variables x, y, z, and the like. , and shared variables can be optimally placed in local memory 122 , 132 , 142 .
 なお、数値制御装置10Bの配置最適化処理は、アクセス頻度評価部1111bが情報処理装置20Bから参照命令数を取得し評価パラメータで補正する点を除き図7に示す処理と同様であり、詳細な説明は省略する。 7 except that the access frequency evaluation unit 1111b acquires the number of reference instructions from the information processing device 20B and corrects it with an evaluation parameter. Description is omitted.
 以上により、第3実施形態に係る数値制御装置10Bは、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムである軸制御ソースプログラム221、表示制御ソースプログラム222、周辺機器制御ソースプログラム223の各制御文の種類と制御文毎の参照命令数とを情報処理装置20Bから取得する。数値制御装置10Bは、取得した制御文毎の参照命令数を制御文の種類に応じた評価パラメータによる重み付けを行い補正し、補正した参照命令数に基づいて共有変数へのアクセス頻度を評価することで、アクセス頻度が最も高い共有変数をアプリが実行されるCPUのローカルメモリに配置することができる。
 そして、CPU121、131、141は、バス160を経由したローカルメモリへのアクセスが減少し、処理時間を短縮することができる。
 以上、第3実施形態について説明した。
As described above, the numerical controller 10B according to the third embodiment includes the axis control source program 221, the display control source program 222, and the peripheral device control source program 221, which are the source programs of the axis control application 151, the display control application 152, and the peripheral device control application 153. The type of each control statement of the source program 223 and the number of reference instructions for each control statement are obtained from the information processing device 20B. The numerical controller 10B corrects the obtained number of reference instructions for each control statement by weighting it with an evaluation parameter according to the type of the control statement, and evaluates the access frequency to the shared variable based on the corrected number of reference instructions. , the shared variables with the highest access frequency can be placed in the local memory of the CPU where the application is executed.
The CPUs 121, 131, and 141 can reduce the access to the local memory via the bus 160 and shorten the processing time.
The third embodiment has been described above.
<第3実施形態の変形例>
 第3実施形態に係る数値制御装置10Bは、アクセス頻度評価部1111b及び評価パラメータ記憶部1114を有したが、これに限定されない。例えば、情報処理装置20Bは、アクセス頻度評価部1111a及び評価パラメータ記憶部1114を有してもよい。
 例えば、解析部211bは、アクセス頻度評価部1111bの機能を有し、各ソースプログラムの解析から求めた各制御文の種類と制御文毎の参照命令数とを求める。解析部211bは、求めたソースプログラム中の制御文毎の参照命令数を、評価パラメータ記憶部1114に格納された制御文の種類に応じた評価パラメータによる重み付けを行い補正し、補正した参照命令数に基づいて共有変数へのアクセス頻度を評価し、評価したアクセス頻度を、例えば各プログラムの実行形式のプログラムに格納するようにしてもよい。そうすることで、当該実行プログラムを数値制御装置10Bにおける、それぞれのローカルメモリに展開(ロード)した際に、数値制御装置10B(メモリ配置最適化部)は、各プログラムの共有変数x、y、z等を最適なローカルメモリに配置することができる。
<Modified example of the third embodiment>
The numerical controller 10B according to the third embodiment has the access frequency evaluation unit 1111b and the evaluation parameter storage unit 1114, but is not limited to this. For example, the information processing device 20B may have an access frequency evaluation unit 1111a and an evaluation parameter storage unit 1114. FIG.
For example, the analysis unit 211b has the function of the access frequency evaluation unit 1111b, and obtains the type of each control statement and the number of reference instructions for each control statement obtained from the analysis of each source program. The analysis unit 211b corrects the obtained number of reference instructions for each control statement in the source program by weighting it with an evaluation parameter corresponding to the type of control statement stored in the evaluation parameter storage unit 1114, and corrects the corrected number of reference instructions. may be used to evaluate the access frequency to the shared variable based on and store the evaluated access frequency in, for example, the executable program of each program. By doing so, when the execution program is expanded (loaded) into each local memory in the numerical control device 10B, the numerical control device 10B (memory allocation optimization unit) can set the shared variables x, y, z etc. can be placed in the optimal local memory.
 以上、第1実施形態、第2実施形態、第2実施形態の変形例、第3実施形態、及び第3実施形態の変形例について説明したが、数値制御装置10、10A、10Bは、上述の実施形態に限定されるものではなく、目的を達成できる範囲での変形、改良等を含む。 The first embodiment, the second embodiment, the modification of the second embodiment, the third embodiment, and the modification of the third embodiment have been described above. It is not limited to the embodiment, and includes modifications, improvements, etc. within a range that can achieve the purpose.
<変形例1>
 第1実施形態、第2実施形態、第2実施形態の変形例、第3実施形態、及び第3実施形態の変形例では、数値制御装置10、10A、10Bの軸制御モジュール120、表示制御モジュール130、周辺機器制御モジュール140それぞれは、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153の1つを実行したが、これに限定されない。例えば、数値制御装置10、10A、10Bの軸制御モジュール120のCPU121は、軸制御アプリ151とともに、工作機械(図示しない)の主軸等の位置座標を取得するアプリ等、複数のアプリを実行してもよい。この場合、軸制御モジュール120における共有変数へのアクセス頻度は、これら複数のアプリの共有変数へのアクセス頻度を合計したものとしてもよい。また、表示制御モジュール130のCPU131は、表示制御アプリ152とともに、工作機械(図示しない)を動作させる加工プログラムの実行行を取得するアプリ等、複数のアプリを実行してもよい。この場合、表示制御モジュール130における共有変数へのアクセス頻度は、これら複数のアプリの共有変数へのアクセス頻度を合計したものとしてもよい。また、周辺機器制御モジュール140のCPU141は、周辺機器制御アプリ153とともに、作業員が周辺機器の周りにいるか否かを監視するアプリ等、複数のアプリを実行してもよい。この場合、周辺機器制御モジュール140における共有変数へのアクセス頻度は、これら複数のアプリの共有変数へのアクセス頻度を合計したものとしてもよい。
<Modification 1>
In the first embodiment, the second embodiment, the modification of the second embodiment, the third embodiment, and the modification of the third embodiment, the axis control module 120 and the display control module of the numerical controllers 10, 10A, and 10B 130 and the peripheral device control module 140 each executed one of the axis control application 151, the display control application 152, and the peripheral device control application 153, but is not limited to this. For example, the CPU 121 of the axis control module 120 of the numerical controllers 10, 10A, and 10B executes a plurality of applications such as an application for acquiring the position coordinates of the spindle of a machine tool (not shown) together with the axis control application 151. good too. In this case, the access frequency to the shared variables in the axis control module 120 may be the sum of the access frequencies to the shared variables of these multiple applications. In addition, the CPU 131 of the display control module 130 may execute a plurality of applications such as an application for obtaining execution lines of a machining program for operating a machine tool (not shown) together with the display control application 152 . In this case, the access frequency to the shared variable in the display control module 130 may be the sum of the access frequencies to the shared variable of these multiple applications. In addition, the CPU 141 of the peripheral device control module 140 may execute a plurality of applications such as an application for monitoring whether or not a worker is around the peripheral device together with the peripheral device control application 153 . In this case, the frequency of access to shared variables in peripheral device control module 140 may be the sum of the access frequencies of these multiple applications to shared variables.
<変形例2>
 また例えば、第1実施形態、第2実施形態、第2実施形態の変形例、第3実施形態、及び第3実施形態の変形例では、数値制御装置10、10A、10Bのローカルメモリ122、132、142は、共有変数x、y、z等のうちアクセス頻度が最も高い共有変数が配置されたが、これに限定されない。例えば、ローカルメモリ122、132、142には、共有変数x、y、z等のうちアクセス頻度が予め設定された所定値以上の共有変数が配置されてもよい。
<Modification 2>
Further, for example, in the first embodiment, the second embodiment, the modified example of the second embodiment, the third embodiment, and the modified example of the third embodiment, the local memories 122, 132 of the numerical controllers 10, 10A, 10B , 142 are shared variables with the highest access frequency among the shared variables x, y, z, etc., but are not limited to this. For example, in the local memories 122, 132, 142, shared variables having a predetermined access frequency or higher among the shared variables x, y, z, etc. may be allocated.
<変形例3>
 また例えば、第2実施形態、第2実施形態の変形例、第3実施形態、及び第3実施形態の変形例では、情報処理装置20、20Bは、解析部211、221bが、軸制御アプリ151、表示制御アプリ152、周辺機器制御アプリ153のソースプログラムを解析したが、これに限定されない。例えば、コンパイル部212が、解析部211、211bの機能を有してもよい。
<Modification 3>
Further, for example, in the second embodiment, the modified example of the second embodiment, the third embodiment, and the modified example of the third embodiment, the information processing apparatuses 20 and 20B have the analysis units 211 and 221b set the axis control application 151 , the display control application 152, and the peripheral device control application 153 have been analyzed, but the present invention is not limited to this. For example, the compilation unit 212 may have the functions of the analysis units 211 and 211b.
 なお、第1実施形態、第2実施形態、第2実施形態の変形例、第3実施形態、及び第3実施形態の変形例に係る数値制御装置10、10A、10Bに含まれる各機能は、ハードウェア、ソフトウェア又はこれらの組み合わせによりそれぞれ実現することができる。ここで、ソフトウェアによって実現されるとは、コンピュータがプログラムを読み込んで実行することにより実現されることを意味する。 Note that each function included in the numerical controllers 10, 10A, and 10B according to the first embodiment, the second embodiment, the modification of the second embodiment, the third embodiment, and the modification of the third embodiment is Each can be implemented by hardware, software, or a combination thereof. Here, "implemented by software" means implemented by a computer reading and executing a program.
 プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(Non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(Tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えば、フレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば、光磁気ディスク)、CD-ROM(Read Only Memory)、CD-R、CD-R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM)を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(Transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は、無線通信路を介して、プログラムをコンピュータに供給できる。 Programs can be stored and supplied to computers using various types of non-transitory computer readable media. Non-transitory computer-readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (e.g., flexible discs, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical discs), CD-ROMs (Read Only Memory), CD- R, CD-R/W, semiconductor memory (eg, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM). The program may also be supplied to the computer on various types of transitory computer readable medium. Examples of transitory computer-readable media include electrical signals, optical signals, and electromagnetic waves. Transitory computer-readable media can deliver the program to the computer via wired communication channels, such as wires and optical fibers, or wireless communication channels.
 なお、記録媒体に記録されるプログラムを記述するステップは、その順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。 It should be noted that the steps of writing a program recorded on a recording medium include not only processes that are executed chronologically in order, but also processes that are executed in parallel or individually, even if they are not necessarily processed chronologically. It also includes
 以上を換言すると、本開示の制御装置は、次のような構成を有する各種各様の実施形態を取ることができる。 In other words, the control device of the present disclosure can take various embodiments having the following configurations.
 (1)本開示の制御装置1は、複数のCPU30と複数のCPU30それぞれがアクセスする複数のローカルメモリ31とを有する制御装置であって、少なくとも共有変数の仮想アドレス及び共有変数の物理アドレスを含む共有変数情報41を格納する記憶部4と、複数のCPU30それぞれが実行する実行プログラム40-1~40-n毎に共有変数情報41に含まれる共有変数へのアクセス頻度を評価するアクセス頻度評価部21-1と、アクセス頻度に基づいて共有変数を配置するローカルメモリ31を変更するメモリ配置最適化部21-2と、を備える。
 この制御装置1によれば、各CPUが実行するアプリの共有変数へのアクセス頻度を解析し、アクセス頻度が高い共有変数を当該アプリが実行されるCPUのローカルメモリに配置することができる。
(1) The control device 1 of the present disclosure is a control device having a plurality of CPUs 30 and a plurality of local memories 31 accessed by each of the plurality of CPUs 30, and includes at least virtual addresses of shared variables and physical addresses of shared variables. A storage unit 4 that stores shared variable information 41, and an access frequency evaluation unit that evaluates the frequency of access to shared variables included in the shared variable information 41 for each of the execution programs 40-1 to 40-n executed by each of the plurality of CPUs 30. 21-1, and a memory placement optimization unit 21-2 that changes the local memory 31 in which shared variables are placed based on the access frequency.
According to this control device 1, it is possible to analyze the access frequency of an application executed by each CPU to a shared variable, and arrange shared variables with a high access frequency in the local memory of the CPU executing the application.
 (2) (1)に記載の数値制御装置10において、アクセス頻度評価部1111は、複数のCPU121、131、141それぞれによる実行プログラムの実行時に、共有変数を参照する命令の実行回数を複数のCPU121、131、141毎に記録する参照命令実行記録部1113を備え、アクセス頻度評価部1111は、参照命令実行記録部1113に記録された複数のCPU121、131、141毎の実行回数に基づいて共有変数へのアクセス頻度を評価し、メモリ配置最適化部1112は、評価されたアクセス頻度が最も高いプロセッサがアクセスするローカルメモリに共有変数を配置してもよい。
 そうすることで、数値制御装置10は、アクセス頻度を精度良く評価することができ、共有変数の配置をより最適化することができる。
(2) In the numerical control device 10 described in (1), the access frequency evaluation unit 1111 counts the number of executions of instructions that refer to shared variables when each of the CPUs 121, 131, and 141 executes an execution program. , 131, and 141, and the access frequency evaluation unit 1111 calculates a shared variable may be evaluated, and the memory placement optimizer 1112 may place shared variables in the local memory accessed by the processor with the highest evaluated access frequency.
By doing so, the numerical controller 10 can accurately evaluate the access frequency and further optimize the allocation of shared variables.
 (3) (1)に記載の数値制御装置10Aにおいて、アクセス頻度評価部1111aは、複数のCPU121、131、141それぞれが実行する実行プログラム毎に共有変数への参照命令数を取得、又は情報処理装置20による実行プログラムのソースプログラムの解析から求めた共有変数への参照命令数を情報処理装置20から取得し、取得した参照命令数に基づいて共有変数へのアクセス頻度を評価し、メモリ配置最適化部1112は、評価されたアクセス頻度が最も高いCPUがアクセスするローカルメモリに共有変数を配置してもよい。
 そうすることで、数値制御装置10Aは、(2)と同様の効果を奏することができる。
(3) In the numerical controller 10A described in (1), the access frequency evaluation unit 1111a acquires the number of reference instructions to the shared variable for each execution program executed by each of the plurality of CPUs 121, 131, and 141, or acquires the number of information processing The number of reference instructions to the shared variable obtained from the analysis of the source program of the execution program by the device 20 is acquired from the information processing device 20, the frequency of access to the shared variable is evaluated based on the acquired number of reference instructions, and the memory allocation is optimized. The modifier 1112 may place the shared variables in the local memory accessed by the CPU with the highest evaluated access frequency.
By doing so, the numerical controller 10A can achieve the same effect as (2).
 (4) (3)に記載の数値制御装置10Bにおいて、アクセス頻度評価部1111bは、アクセス頻度の評価に用いる評価パラメータを格納する評価パラメータ記憶部1114を備え、アクセス頻度評価部1111bは、参照命令数を情報処理装置20Bから取得する場合、ソースプログラム中の制御文毎の参照命令数を評価パラメータ記憶部1114に格納された評価パラメータによる重み付けを行い補正し、補正した参照命令数に基づいて共有変数へのアクセス頻度を評価してもよい。
 そうすることで、数値制御装置10Bは、アプリを実行しなくても、共有変数へのアクセス頻度を精度良く評価できる。
(4) In the numerical controller 10B described in (3), the access frequency evaluation unit 1111b includes an evaluation parameter storage unit 1114 that stores evaluation parameters used for evaluating the access frequency, and the access frequency evaluation unit 1111b stores the reference instruction When acquiring the number from the information processing device 20B, the number of reference instructions for each control statement in the source program is weighted and corrected by the evaluation parameter stored in the evaluation parameter storage unit 1114, and shared based on the corrected number of reference instructions. The frequency of access to variables may be evaluated.
By doing so, the numerical controller 10B can accurately evaluate the access frequency to the shared variable without executing the application.
 1 制御装置
 2 制御モジュール
 21 CPU
 21-1 アクセス頻度評価部
 21-2 メモリ配置最適化部
 22 ローカルメモリ
 3-1~3-n プロセッサモジュール
 30 CPU
 31 ローカルメモリ
 4 記憶部
 40-1~40-n 実行プログラム
 41 共有変数情報
 5 バス
 10、10A、10B 数値制御装置
 110、110a、110b システム制御モジュール
 111、111a、111b CPU
 1111、1111a、1111b アクセス頻度評価部
 1112 メモリ配置最適化部
 1113 参照命令実行記録部
 1114 評価パラメータ記憶部
 120 軸制御モジュール
 121 CPU
 122 ローカルメモリ
 130 表示制御モジュール
 131 CPU
 132 ローカルメモリ
 140 周辺機器制御モジュール
 141 CPU
 142 ローカルメモリ
 150 記憶部
 151 軸制御アプリ
 152 表示制御アプリ
 153 周辺機器制御アプリ
 154 共有変数情報
 160 バス
 20、20B 情報処理装置
 210、210b 制御部
 211、211b 解析部
 212 コンパイル部
 220 記憶部
 221 軸制御ソースプログラム
 222 表示制御ソースプログラム
 223 周辺機器制御ソースプログラム
1 control device 2 control module 21 CPU
21-1 access frequency evaluation unit 21-2 memory allocation optimization unit 22 local memory 3-1 to 3-n processor module 30 CPU
31 local memory 4 storage unit 40-1 to 40-n execution program 41 shared variable information 5 bus 10, 10A, 10B numerical controller 110, 110a, 110b system control module 111, 111a, 111b CPU
1111, 1111a, 1111b access frequency evaluation unit 1112 memory allocation optimization unit 1113 reference instruction execution recording unit 1114 evaluation parameter storage unit 120 axis control module 121 CPU
122 local memory 130 display control module 131 CPU
132 Local memory 140 Peripheral device control module 141 CPU
142 local memory 150 storage unit 151 axis control application 152 display control application 153 peripheral device control application 154 shared variable information 160 bus 20, 20B information processing device 210, 210b control unit 211, 211b analysis unit 212 compilation unit 220 storage unit 221 axis control Source program 222 Display control source program 223 Peripheral device control source program

Claims (4)

  1.  複数のプロセッサと前記複数のプロセッサそれぞれがアクセスする複数のローカルメモリとを有する制御装置であって、
     少なくとも共有変数の仮想アドレス及び共有変数の物理アドレスを含む共有変数情報を格納する記憶部と、
     前記複数のプロセッサそれぞれが実行する実行プログラム毎に前記共有変数情報に含まれる前記共有変数へのアクセス頻度を評価するアクセス頻度評価部と、
     前記アクセス頻度に基づいて前記共有変数を配置する前記ローカルメモリを変更するメモリ配置最適化部と、
     を備える制御装置。
    A controller having a plurality of processors and a plurality of local memories accessed by each of the plurality of processors,
    a storage unit for storing shared variable information including at least the virtual address of the shared variable and the physical address of the shared variable;
    an access frequency evaluation unit that evaluates the frequency of access to the shared variables included in the shared variable information for each execution program executed by each of the plurality of processors;
    a memory placement optimization unit that changes the local memory in which the shared variables are placed based on the access frequency;
    A control device comprising:
  2.  前記アクセス頻度評価部は、前記複数のプロセッサそれぞれによる前記実行プログラムの実行時に、前記共有変数を参照する命令の実行回数を前記複数のプロセッサ毎に記録する参照命令実行記録部を備え、
     前記アクセス頻度評価部は、前記参照命令実行記録部に記録された前記複数のプロセッサ毎の前記実行回数に基づいて前記共有変数へのアクセス頻度を評価し、
     前記メモリ配置最適化部は、評価された前記アクセス頻度が最も高いプロセッサがアクセスするローカルメモリに前記共有変数を配置する、請求項1に記載の制御装置。
    The access frequency evaluation unit includes a reference instruction execution recording unit that records, for each of the plurality of processors, the number of times an instruction that references the shared variable is executed when the execution program is executed by each of the plurality of processors,
    The access frequency evaluation unit evaluates the frequency of access to the shared variable based on the number of executions for each of the plurality of processors recorded in the reference instruction execution recording unit,
    2. The control device according to claim 1, wherein said memory allocation optimizing unit allocates said shared variables in a local memory accessed by said processor evaluated to have the highest access frequency.
  3.  前記アクセス頻度評価部は、前記複数のプロセッサそれぞれが実行する実行プログラム毎に前記共有変数への参照命令数を取得、又は外部装置による前記実行プログラムのソースプログラムの解析から求めた前記共有変数への参照命令数を前記外部装置から取得し、取得した参照命令数に基づいて前記共有変数へのアクセス頻度を評価し、
     前記メモリ配置最適化部は、評価された前記アクセス頻度が最も高いプロセッサがアクセスするローカルメモリに前記共有変数を配置する、請求項1に記載の制御装置。
    The access frequency evaluation unit acquires the number of instructions referring to the shared variable for each execution program executed by each of the plurality of processors, or obtains the number of instructions to the shared variable obtained from analysis of the source program of the execution program by an external device. obtaining the number of reference instructions from the external device, evaluating the frequency of access to the shared variable based on the obtained number of reference instructions;
    2. The control device according to claim 1, wherein said memory allocation optimizing unit allocates said shared variables in a local memory accessed by said processor evaluated to have the highest access frequency.
  4.  前記アクセス頻度評価部は、前記アクセス頻度の評価に用いる評価パラメータを格納する評価パラメータ記憶部を備え、
     前記アクセス頻度評価部は、前記参照命令数を前記外部装置から取得する場合、前記ソースプログラム中の制御文毎の前記参照命令数を前記評価パラメータ記憶部に格納された前記評価パラメータによる重み付けを行い補正し、補正した前記参照命令数に基づいて前記共有変数へのアクセス頻度を評価する、請求項3に記載の制御装置。
    The access frequency evaluation unit includes an evaluation parameter storage unit that stores evaluation parameters used to evaluate the access frequency,
    When the number of reference instructions is obtained from the external device, the access frequency evaluation unit weights the number of reference instructions for each control statement in the source program by the evaluation parameter stored in the evaluation parameter storage unit. 4. The control device according to claim 3, wherein the access frequency to the shared variable is evaluated based on the corrected number of reference instructions.
PCT/JP2021/032866 2021-09-07 2021-09-07 Control device WO2023037414A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/032866 WO2023037414A1 (en) 2021-09-07 2021-09-07 Control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/032866 WO2023037414A1 (en) 2021-09-07 2021-09-07 Control device

Publications (1)

Publication Number Publication Date
WO2023037414A1 true WO2023037414A1 (en) 2023-03-16

Family

ID=85507301

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/032866 WO2023037414A1 (en) 2021-09-07 2021-09-07 Control device

Country Status (1)

Country Link
WO (1) WO2023037414A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016224882A (en) * 2015-06-04 2016-12-28 富士通株式会社 Parallel calculation device, compilation device, parallel processing method, compilation method, parallel processing program, and compilation program
US20210055967A1 (en) * 2019-08-19 2021-02-25 Research & Business Foundation Sungkyunkwan University Method and apparatus for memory allocation in a multi-core processor system, and recording medium therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016224882A (en) * 2015-06-04 2016-12-28 富士通株式会社 Parallel calculation device, compilation device, parallel processing method, compilation method, parallel processing program, and compilation program
US20210055967A1 (en) * 2019-08-19 2021-02-25 Research & Business Foundation Sungkyunkwan University Method and apparatus for memory allocation in a multi-core processor system, and recording medium therefor

Similar Documents

Publication Publication Date Title
US10810051B1 (en) Autoscaling using file access or cache usage for cluster machines
Stecke et al. A study of FMS part type selection approaches for short-term production planning
US11321132B2 (en) Edge computing method and apparatus for flexibly allocating computing resource
JP6333796B2 (en) Numerical control device for optimal load distribution with multiple CPU cores
US11301294B2 (en) Control device, control method, and control program
US10303128B2 (en) System and method for control and/or analytics of an industrial process
JP6406466B1 (en) Control device, control method, and control program
JP2012118715A (en) Plc system, development support device for the same, and program
KR102247249B1 (en) A computer program for asynchronous data processing in a database management system
WO2020138485A1 (en) Robot operation plan creation method and operation plan creation device
WO2023037414A1 (en) Control device
JP5146134B2 (en) Compile processing device, access pattern change processing method, and processing program
JP2820189B2 (en) Control software execution system for numerical controller
CN109388102B (en) Control system and upper server
JP6156379B2 (en) Scheduling apparatus and scheduling method
KR101755154B1 (en) Method and apparatus for power load balancing for heterogeneous processors
JP6945766B1 (en) Data analysis program creation support device, data analysis program creation support method, and data analysis program creation support program
Siemiatkowski et al. Planning optimised multi-tasking operations under the capability for parallel machining
Nehzati et al. Research outline on reconfigurable manufacturing system production scheduling employing fuzzy logic
KR20210053830A (en) A computer program for asynchronous data processing in a database management system
Wada et al. The pompp framework: From simple dsl to sophisticated power management for hpc systems
WO2022264424A1 (en) Control device and control method
JP7037001B1 (en) Control device and data communication system
JPH08185377A (en) Distributed computer system
Howard et al. An integrated compiler/run-time system for global data distribution in distributed shared memory systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21956712

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE