WO2023181400A1 - システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体 - Google Patents

システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体 Download PDF

Info

Publication number
WO2023181400A1
WO2023181400A1 PCT/JP2022/014623 JP2022014623W WO2023181400A1 WO 2023181400 A1 WO2023181400 A1 WO 2023181400A1 JP 2022014623 W JP2022014623 W JP 2022014623W WO 2023181400 A1 WO2023181400 A1 WO 2023181400A1
Authority
WO
WIPO (PCT)
Prior art keywords
system program
numerical control
constant value
control device
optimization
Prior art date
Application number
PCT/JP2022/014623
Other languages
English (en)
French (fr)
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/JP2022/014623 priority Critical patent/WO2023181400A1/ja
Publication of WO2023181400A1 publication Critical patent/WO2023181400A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4155Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by programme execution, i.e. part programme or machine function execution, e.g. selection of a programme

Definitions

  • the present invention relates to a system program optimization device, a system program optimization system, and a computer-readable storage medium.
  • Optimization is a process that makes a program more efficient, shortens its execution time, and reduces its execution load. Optimizations reduce the number of memory executions, use faster instructions, use the memory hierarchy efficiently, and use memory with a high degree of parallelism.
  • To reduce the number of instruction executions use common subexpression elimination, constant folding, constant propagation, loop invariant elimination, induction variable elimination, operator strength reduction, loop unrolling, loop fusion, and unexecuted instructions. , copy propagation, code hoisting, specializing procedure calls, and exploiting properties of expressions.
  • An important optimization for compilers is loop optimization. Execution time can be improved by optimizing a few loops.
  • a numerical control device is not a dedicated machine specialized for one machine tool, but a general-purpose machine that can be applied to multiple machine tools. Therefore, in a system program for a numerical control device, unnecessary source codes and symbols (variables) are generated depending on the system configuration of the numerical control device, machine tool, and external equipment. Conventionally, system programs have been optimized using methods such as those disclosed in Patent Document 1 and Patent Document 2.
  • a system program optimization device that is an aspect of the present disclosure is a system program optimization device that manages a system program of a numerical control device, and is configured to respond to an external input signal input from an external device connected to the numerical control device.
  • the compiler includes a constant value acquisition unit that acquires a set constant value, and a compiler that converts the source code of a system program into an object program that can be executed by a numerical control device. includes an optimization section that optimizes.
  • a system program optimization system that is an aspect of the present disclosure includes a constant value setting unit that accepts setting of a constant value for an external input signal input from an external device connected to a numerical control device; an information processing device that manages a system program of a numerical control device, the information processing device comprising: a constant value output unit that outputs a constant value to A constant value acquisition unit that acquires constant values set for the A system program optimization device includes an optimization unit that optimizes a program.
  • a storage medium that is an aspect of the present disclosure acquires a constant value set for an external input signal input from an external device connected to a numerical control device by executing one or more processors, Compiling the source code of a system program of the numerical control device into an object program that can be executed by the numerical control device, and storing processor-readable instructions for optimizing the system program with constant values of external input signals during compilation. .
  • system programs can be optimized.
  • FIG. 1 is a conceptual diagram of a system program optimization system.
  • FIG. 2 is a diagram illustrating a system program.
  • FIG. 2 is a diagram illustrating a system program.
  • FIG. 1 is a block diagram of a system program optimization system. This is an example of a constant value setting screen. This is an example of a constant value setting screen.
  • FIG. 2 is a diagram showing the hardware configuration of a numerical control device.
  • FIG. 2 is a diagram showing the configuration of a compiler.
  • FIG. 3 is a diagram showing an example of source code and constant values of macro variables.
  • FIG. 3 is a diagram showing changes in source code due to optimization.
  • 3 is a flowchart illustrating processing for setting constant values of external input signals.
  • FIG. 2 is a diagram showing the hardware configuration of a system program optimization device.
  • FIG. 1 is a conceptual diagram of a system program optimization system 1000.
  • the system program optimization system 1000 includes a server as the system program optimization device 100, a numerical control device 200 that uses the system program, and an information processing device 300 (including a PC: personal computer) connected to the numerical control device 200. configured.
  • the system program optimization device 100 provides a system program to the user of the numerical control device 200.
  • the system program is a program that is the basis of the numerical control device 200 (FIG. 2).
  • System programs include: storing machining programs, editing machining programs, executing machining programs, controlling and monitoring axis movements and peripheral devices, storing tool compensation data, editing tool compensation data, tool dimension compensation, tool management, and workpiece management. , measurement of tools, measurement of workpieces, monitoring of operating status, collection of status information, synchronous control with external devices (data exchange during tool exchange), loading and unloading of workpieces, job management (numerical control devices, robots, PLCs) This is a program that controls the basic operations of the numerical control device 200, such as joint work of multiple devices such as .
  • the system program includes programs that execute the basic functions described above.
  • the numerical control device 200 is a general-purpose device and can be applied to various types of machine tools. All functions are comprehensively written into the original system program.
  • the original system program was made up of redundant code to accommodate a variety of machine tools and peripheral devices. If the original system program is used as is, unnecessary calculations will increase and calculation efficiency will deteriorate.
  • the system program optimization device 100 obtains constant values of external input signals from the user, optimizes the system program, and improves the calculation efficiency of the numerical control device 200.
  • the system program optimization device 100 collectively manages system programs of a plurality of numerical control devices 200.
  • a system program optimization device 100 of a numerical control device manufacturer and an information processing device 300 of a numerical control device user are connected via an external network.
  • the system program optimization device 100 stores the source code of the original system program, the type of the numerical control device 200, the type of machine tool, the functions of the numerical control device 200 used by the user, and external devices connected to the numerical control device 200. Optimize using constant values of external input signals from.
  • the manufacturer of the numerical control device 200 provides the user with a system program optimized for each numerical control device 200.
  • FIG. 4 is a block diagram of system program optimization system 1000.
  • the information processing device 300 (including the numerical control device 200) on the user side includes a constant value setting section 31 and a constant value output section 32.
  • the constant value setting section 31 accepts the setting of a constant value of an external input signal by a user.
  • FIG. 5 shows an example of a constant value setting screen. On the constant value setting screen in FIG. 5, a list of names of external devices that output external input signals, names of external input signals, addresses of external input signals, etc. is displayed. The user inputs the constant value while referring to the signal name.
  • the constant value setting section 31 displays a list of the above-mentioned external input signals and accepts settings of constant values of the external input signals.
  • FIG. 6 shows another example of the constant value setting screen.
  • the type of machine tool, the function of the machine tool, etc. are specified, and input of constant values of external input signals related to the specified machine tool or function is accepted.
  • the configuration of the constant value setting screen is not limited to the configurations shown in FIGS. 5 and 6.
  • On the constant value setting screen it is only necessary to obtain an address assigned to a terminal of an I/O unit or the like to be described later, a constant value of a signal input to the terminal, and an index corresponding to the set external input signal.
  • the content of the external input signal changes depending on the mode, operating state, etc. of the numerical control device 200.
  • the address and constant value of the external input signal may be set in association with the mode and operating state of the numerical control device 200.
  • the constant value output unit 32 outputs the index corresponding to the external input signal set by the user and its constant value to the system program optimization device 100.
  • FIG. 7 shows an example of the hardware configuration of the numerical control device 200.
  • the numerical control device 200 includes a main CPU 201, a main memory 202, a serial I/O control unit 203, a parallel I/O control unit 204, an HMI communication I/F 205, a PLC control unit (PLC CPU) 206, a machine input/output communication I /F207, servo communication I/F208, etc.
  • the numerical control device 200 is connected to a display unit via an HMI communication I/F 205, and is connected to an input unit such as a touch panel or an operation panel via the display unit.
  • the numerical control device 200 includes a machine input/output communication I/F 207.
  • the machine input/output communication I/F 207 inputs and outputs signals to and from limit switches, sensors, contactors, lamps, etc. of the machine tool via the remote I/O unit 231.
  • the numerical control device 200 is connected to a main shaft amplifier 241 and a servo amplifier 242 via a servo communication I/F 208.
  • the numerical control device 200 acquires signals from the spindle motor and servo motor via the servo communication I/F 208.
  • the numerical control device 200 includes a PLC control section 206.
  • the PLC control unit 206 acquires signals from sensors and devices incorporated in the numerical control device 200.
  • signals from devices built into the numerical control device 200 such as operation panels and sensors, are also referred to as external input signals.
  • the system program optimization device 100 includes a system program management section 11, a constant value acquisition section 12, a compiler 13, and a system program output section 14.
  • the system program management unit 11 collectively manages the system programs of the numerical control devices 200 of multiple users.
  • the system program management unit 11 manages system programs customized for each numerical control device 200, such as identification information of the numerical control device 200, constant values of external input signals set for each numerical control device 200, and the like.
  • the constant value acquisition unit 12 acquires the constant value of the external input signal from the user's information processing device (including the numerical control device 200) 300.
  • the compiler 13 converts the source code of a system program written in a high-level language into an object program that can be interpreted and executed by the numerical control device 200. As shown in FIG. 8, the compiler 13 includes a lexical analysis section 15, a syntax analysis section 16, a semantic analysis section 17, an optimization section 18, and a code generation section 19.
  • the lexical analysis unit 15 decomposes the character string of the source code into a string of language elements (tokens).
  • the syntax analysis unit 16 converts the string of tokens into a structure that reflects the meaning. This structure is often represented as a tree structure and is called an abstract syntax tree.
  • the semantic analysis unit 17 analyzes the meaning of the syntax tree. Semantic analysis converts source code into intermediate code.
  • the optimization unit 18 transforms the intermediate code and converts it into an efficient program.
  • the optimization unit 18 of the present disclosure performs optimization to reduce the number of executions of an instruction using a constant value of an external input signal. The processing of the optimization unit 18 will be described later.
  • the code generation unit 19 converts the internal code into an object program language. For example, the intermediate code is converted into an assembly language for the numerical control device 200.
  • the system program output unit 14 outputs a system program optimized using the constant value of the external input signal to the user's information processing device (including the numerical control device 200) 300.
  • FIG. 9 shows an example of the source code and constant values of macro variables
  • FIG. 10 shows changes in the source code due to optimization.
  • the macro variable "CNC_DATA_1” has a constant value "0”
  • CNC_DATA_2 has a constant value "1”
  • CNC_DATA_3 has a constant value "100”
  • CNC_DATA_4" has a constant value "200” is set.
  • FIG. 11 is a flowchart of processing for setting constant values of external input signals
  • FIG. 13 is a flowchart of processing for optimization.
  • the constant value setting unit 31 receives a constant value setting for an external input signal from the user (step S1).
  • the constant value of the external input signal is associated with the index and address on the memory corresponding to the external input signal.
  • the index is associated with a macro variable.
  • FIG. 12 for "CNC_DATA_1_IDX”, "CNC_DATA_2_IDX”, “CNC_DATA_3_IDX”, “CNC_DATA_4_IDX", . . . DATA_4", ... is the string It is attached.
  • the system program optimization device associates indexes with macro variables.
  • the constant value setting unit 31 sets a constant value specified by the user on the memory of the numerical control device 200 (step S2).
  • the constant value output unit 32 outputs the constant value and the index to the system program optimization device 100 (step S3).
  • the constant value acquisition unit 12 of the system program optimization device 100 acquires the index of the external input signal and the constant value (step S11).
  • the constant value acquisition unit 12 identifies a macro variable corresponding to the index of the external input signal (step S12).
  • the constant value acquisition unit 12 defines a macro variable with the constant value of the external input signal (step S13).
  • the optimization unit 18 replaces the macro variables with constant values (step S14).
  • the optimization unit 18 optimizes the system program (step S15).
  • the system program output unit 14 identifies the user based on the information managed by the system program management unit 11, and outputs the system program to the user's information processing device (including the numerical control device 200) 300 (step S16).
  • the user installs the acquired system program into the numerical control device 200 (step S17).
  • the system program optimization system 1000 of the present disclosure includes the system program optimization device 100.
  • the system program optimization device 100 manages the system program of the numerical control device 200 via the network.
  • the system program optimization device 100 optimizes the system program using constant values of external input signals obtained from the user.
  • the user installs the optimized system program into his or her numerical control device 200.
  • An example of the external input signal in the second embodiment is a machine lock signal.
  • the numerical control device 200 enters the machine lock state. In the machine lock state, even if a movement command is executed, the machine tool does not actually move, and only the position display is updated.
  • the main CPU 201 accesses the machine lock signal every control cycle and determines whether the machine lock state is in the machine lock state (the machine lock signal is on).
  • the main CPU 201 can determine that the machine lock state is not present without accessing the machine lock signal. Therefore, the waiting time of the control cycle for acquiring an external input signal is shortened, and furthermore, the time for processing a branch for determining the machine lock state is shortened.
  • An example of the external input signal in the third embodiment is a feed rate override signal.
  • the feed rate override signal represents a numerical value that adjusts the feed rate and rotation speed during cutting.
  • the feed speed override signal is normally a constant speed (100%), and can be specified in a range such as 0% to 200%.
  • the main CPU 201 accesses the feed rate override signal at control intervals, reads the value of the feed rate override signal from memory, and controls the feed rate.
  • the main CPU 201 controls the feed speed to be constant without accessing the feed speed override signal. Therefore, the standby time of the control cycle for acquiring external input signals is shortened.
  • An example of the external input signal in the fourth embodiment is a skip signal.
  • the main CPU 201 advances to the next block (the next line of the machining program) when the signal is input, even if the currently executed block (one line of the machining program) is not completed.
  • the main CPU 201 accesses the skip signal at control intervals, and if the skip signal is on, it skips the currently executed block and reads the next block.
  • the main CPU 201 executes the machining program without accessing the skip signal. Therefore, the standby time of the control cycle for acquiring external input signals is shortened.
  • the system program optimization system 1000 of the present disclosure allows the user to set constant values for external input signals, and optimizes the system program using the set constant values. Optimization improves execution efficiency by reducing access time to external input signals for each control signal, eliminating branch instructions, and convolving constants. Furthermore, by disabling functions that are not to be executed, redundant code related to unnecessary functions can be deleted, which improves execution efficiency.
  • Optimizing the system program reduces the code area and data area used for processing external input signals. Since the memory capacity for running system programs can be reduced, the load on hardware is reduced.
  • signals from an input unit such as a touch panel or an operation panel are given as examples, but as shown in FIG. 6, external input signals input to the numerical control device 200 are , and signals from other external devices (machine tool limit switches, sensors, contactors, lamps, spindle motors, servo motors, etc.).
  • the system program optimization device 100 obtains the constant value of the external input signal via the network, but it may also obtain the constant value via a portable storage medium.
  • the hardware configuration of the system program optimization device 100 will be described with reference to FIG. 14.
  • the CPU 111 included in the system program optimization device 100 is a processor that controls the system program optimization device 100 as a whole.
  • the CPU 111 reads the operating system processed into the ROM 112 via the bus, and controls the entire system program optimization apparatus 100 according to the operating system.
  • the RAM 113 temporarily stores temporary calculation data, display data, various data input by the user via the input unit 71, and the like.
  • the display unit 70 is a monitor attached to the system program optimization device 100 or the like.
  • the input unit 71 is a keyboard, a touch panel, an operation button, etc. that is integrated with the display unit 70 or separate from the display unit 70. The user operates the input unit 71 to perform input on the screen displayed on the display unit 70 and the like.
  • the nonvolatile memory 114 is, for example, a memory that is backed up by a battery (not shown) and maintains its storage state even when the system program optimization device 100 is powered off.
  • Nonvolatile memory 114 stores management information for system programs.
  • the management information of the system program includes identification information of the numerical control device, constant values of external input signals, and the like.
  • the nonvolatile memory 114 stores programs read from an external device via an interface (not shown), programs input via the input unit 71, and various data obtained from each part of the system program optimization device 100. .
  • the programs and various data stored in the non-volatile memory 114 may be expanded to the RAM 113 at the time of execution/use.
  • various system programs are written in the ROM 112 in advance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

システムプログラム最適化システムは、情報処理装置と、システムプログラム最適化装置と、を備える。情報処理装置は、数値制御装置に接続される外部装置から入力する外部入力信号に対する定数値の設定を受け付け、定数値をシステムプログラム最適化装置に出力し、システムプログラム最適化装置は、数値制御装置に接続される外部装置から入力する外部入力信号に対して設定された定数値を取得し、システムプログラムのソースコードを数値制御装置が実行できるオブジェクトプログラムにコンパイルし、コンパイルにおいて、外部入力信号の定数値でシステムプログラムを最適化する。

Description

システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体
 本発明は、システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体に関する。
 現在、プログラムの最適化という技術が存在する。最適化とは、プログラムを効率化し、実行時間の短縮や実行負荷を低減する処理である。最適化により、メモリの実行回数が削減され、より早い命令が使用され、メモリ階層が効率的に使用され、並列度の高いメモリが使用される。
 命令の実行回数を減らすには、共通部分式の削除、定数の畳み込み、定数伝播、ループ不変式の削除、帰納変数の削除、演算子の強さの低減、ループ展開、ループ融合、実行されない命令の削除、複写の伝播、コードの巻き上げ、手続き呼び出しの特殊化、式の性質の利用などがある。
 メモリ階層を効率的に使用するには、レジスタ、キャッシュ(1次、2次)、メモリ、ディスクというメモリ階層のうち、レジスタを効率的に使うように最適化する。実行順序を入れ替えてキャッシュを効率的に使う最適化もある。
 コンパイラで重要な最適化は、ループに関する最適化である。数個のループを最適化することで実行時間を改善することができる。
 従来、プログラムの最適化方法として、システムプログラムの内部を検索及び解析し、ソースコードに含まれるシンボル(変数)の使用/未使用を判定し、未使用と特定できたシンボル(変数)について最適化を行う方法が提案されている。例えば、特許文献1参照。
 数値制御装置のシステムプログラムに関して、加工プログラム実行時の機能の使用履歴をもとに、使用されない機能の不要な分岐命令を最適化する技術も存在する。例えば、特許文献2参照。
特開2000-207226号公報 特開2016-133911号公報
 数値制御装置は、1つの工作機械に特化した専用機ではなく、複数の工作機械に適用できる汎用機である。このため、数値制御装置のシステムプログラムでは、数値制御装置と、工作機械と、外部機器とのシステム構成によって不要なソースコードやシンボル(変数)が生じる。従来は、特許文献1、特許文献2に開示されたような方法を用いて、システムプログラムの最適化を行っている。
 しかしながら、特許文献1のようにシステムプログラムを解析しても、どのような外部入力信号が入力されるかは判定できない。また、特許文献2のように機能ごとに最適化しても、機能のなかのさらに細かい外部入力信号を最適化することができない。
 数値制御装置の分野では、システムプログラムを最適化する技術が望まれている。
 本開示の一態様であるシステムプログラム最適化装置は、数値制御装置のシステムプログラムを管理するシステムプログラム最適化装置であって、数値制御装置に接続される外部装置から入力する外部入力信号に対して設定された定数値を取得する定数値取得部と、システムプログラムのソースコードを数値制御装置が実行できるオブジェクトプログラムに変換するコンパイラと、を備え、コンパイラは、外部入力信号の定数値で前記システムプログラムを最適化する最適化部を備える。
 本開示の一態様であるシステムプログラム最適化システムは、数値制御装置に接続される外部装置から入力する外部入力信号に対する定数値の設定を受け付ける定数値設定部と、定数値をシステムプログラム最適化装置に出力する定数値出力部と、を備える情報処理装置と、数値制御装置のシステムプログラムを管理するシステムプログラム最適化装置であって、数値制御装置に接続される外部装置から入力する外部入力信号に対して設定された定数値を取得する定数値取得部と、システムプログラムのソースコードを数値制御装置が実行できるオブジェクトプログラムに変換するコンパイラと、を備え、コンパイラは、外部入力信号の定数値でシステムプログラムを最適化する最適化部を備える、システムプログラム最適化装置と、を含む。
 本開示の一態様である記憶媒体は、1つ又は複数のプロセッサが実行することにより、数値制御装置に接続される外部機器から入力する外部入力信号に対して設定された定数値を取得し、数値制御装置のシステムプログラムのソースコードを、数値制御装置が実行できるオブジェクトプログラムにコンパイルし、コンパイルにおいて、外部入力信号の定数値で前記システムプログラムを最適化する、プロセッサが読み取り可能な命令を記憶する。
 本発明の一態様により、システムプログラムを最適化することができる。
システムプログラム最適化システムの概念図である。 システムプログラムを説明する図である。 システムプログラムを説明する図である。 システムプログラム最適化システムのブロック図である。 定数値設定画面の一例である。 定数値設定画面の一例である。 数値制御装置のハードウェア構成を示す図である。 コンパイラの構成を示す図である。 ソースコードとマクロ変数の定数値の例を示す図である。 最適化によるソースコードの変化を示す図である。 外部入力信号の定数値を設定する処理を説明するフローチャートである。 インデックスとマクロ変数の関連を示す図である。 定数値を読み出して最適化を行う処理のフローチャートである。 システムプログラム最適化装置のハードウェア構成を示す図である。
 [第1の実施の態様]
 以下、第1の実施の態様のシステムプログラム最適化システム1000について説明する。図1は、システムプログラム最適化システム1000の概念図である。
 システムプログラム最適化システム1000は、システムプログラム最適化装置100としてのサーバと、システムプログラムを使用する数値制御装置200、数値制御装置200と接続された情報処理装置300(PC:パーソナルコンピュータも含む)から構成される。
 システムプログラム最適化装置100は、数値制御装置200のユーザにシステムプログラムを提供する。
 システムプログラムとは、数値制御装置200の基本となるプログラムである(図2)。システムプログラムは、加工プログラムの格納、加工プログラムの編集、加工プログラムの実行、軸動作や周辺装置の制御及び監視、ツール補正データの格納、ツール補正データの編集、ツール寸法補正、工具管理、ワーク管理、工具の計測、ワークの計測、稼働状況のモニタリング、状態情報の収集、外部装置との同期制御(工具交換時のデータ交換)、ワークの搬入及び搬出、ジョブ管理(数値制御装置、ロボット、PLC等の複数装置の共同作業)など、数値制御装置200の基本的な動作を制御するプログラムである。
 図3に示すように、システムプログラムには、上述した基本的な機能を実行するプログラムが含まれている。数値制御装置200は、汎用的な装置であり、様々な種類の工作機械に適用できる。オリジナルのシステムプログラムには、全ての機能が網羅的に書きこまれている。オリジナルのシステムプログラムは、多様な工作機械、及び周辺機器に対応するため、冗長なコードとなっている。オリジナルのシステムプログラムをそのまま用いると、無駄な演算が増え、演算効率が悪くなる。システムプログラム最適化装置100は、外部入力信号の定数値をユーザから取得し、システムプログラムの最適化を行い、数値制御装置200の演算効率を向上させる。
 システムプログラム最適化装置100は、複数の数値制御装置200のシステムプログラムを一括管理している。数値制御装置メーカのシステムプログラム最適化装置100と、数値制御装置ユーザの情報処理装置300は外部ネットワークを介して接続されている。システムプログラム最適化装置100は、オリジナルのシステムプログラムのソースコードを、数値制御装置200の種類、工作機械の種類、ユーザが使用する数値制御装置200の機能、数値制御装置200に接続される外部装置からの外部入力信号の定数値などを用いて最適化する。数値制御装置200のメーカは、数値制御装置200ごとに最適化したシステムプログラムをユーザに提供する。
 図4は、システムプログラム最適化システム1000のブロック図である。
 ユーザ側の情報処理装置300(数値制御装置200も含む)は、定数値設定部31、定数値出力部32を備える。
 定数値設定部31は、ユーザにより外部入力信号の定数値の設定を受け付ける。図5に、定数値設定画面の一例を示す。図5の定数値設定画面では、外部入力信号を出力する外部装置の名称、外部入力信号の名称、外部入力信号のアドレスなどの一覧が表示される。ユーザは、信号の名称を参照しながら定数値を入力する。
 定数値設定部31は、上述した外部入力信号の一覧を表示し、外部入力信号の定数値の設定を受け付ける。
 図6は、定数値設定画面の他の例である。図6の定数値設定画面では、工作機械の種類、工作機械の機能などを指定して、指定した工作機械や機能に関連する外部入力信号の定数値の入力を受け付ける。
 定数値設定画面の構成は、図5及び図6の構成に限定しない。定数値設定画面では、後述するI/Oユニットなどの端子に割り当てられるアドレスと、端子に入力される信号の定数値と、設定した外部入力信号に対応するインデックスが取得できればよい。なお、外部入力信号の内容は、数値制御装置200のモードや動作状態などによって変化する。外部入力信号のアドレス及び定数値は、数値制御装置200のモードや動作状態と関連づけて設定してもよい。
 定数値出力部32は、ユーザが設定した外部入力信号に対応するインデックスとその定数値をシステムプログラム最適化装置100に出力する。
 次いで、数値制御装置200に接続される外部装置の例を説明する。図7は数値制御装置200のハードウェア構成の一例である。
 数値制御装置200は、メインCPU201、メインメモリ202、シリアルI/O制御部203、パラレルI/O制御部204、HMI通信I/F205、PLC制御部(PLC用CPU)206、機械入出力通信I/F207、サーボ通信I/F208などを備える。
 数値制御装置は200、HMI通信I/F205を介して表示ユニットと接続されており、表示ユニットを介してタッチパネルや操作盤などの入力部に接続されている。タッチパネルや操作盤への入力は、リモートI/Oを221介して数値制御装置200に出力される。
 数値制御装置200は、機械入出力通信I/F207を備える。機械入出力通信I/F207は、リモートI/Oユニット231を介して、工作機械のリミットスイッチ、センサ、コンタクタ、ランプなどと信号の入出力を行う。数値制御装置200は、サーボ通信I/F208を介して主軸アンプ241及びサーボアンプ242と接続されている。数値制御装置200は、サーボ通信I/F208を介して主軸モータやサーボモータの信号を取得する。
 数値制御装置200は、PLC制御部206を備える。PLC制御部206は、数値制御装置200に組み込まれたセンサや装置からの信号を取得する。本開示では、操作盤やセンサなどの数値制御装置200に組み込まれた装置からの信号も外部入力信号と呼ぶ。
 次いで、システムプログラム最適化装置100について説明する。
 図4に示すように、システムプログラム最適化装置100は、システムプログラム管理部11、定数値取得部12、コンパイラ13、システムプログラム出力部14を備える。
 システムプログラム管理部11は、複数のユーザの数値制御装置200のシステムプログラムを一括管理する。システムプログラム管理部11は、数値制御装置200の識別情報など、数値制御装置200ごとにカスタマイズしたシステムプログラム、数値制御装置200ごとに設定された外部入力信号の定数値などを、管理する。
 定数値取得部12は、ユーザの情報処理装置(数値制御装置200を含む)300から外部入力信号の定数値を取得する。
 コンパイラ13は、高級言語でかかれたシステムプログラムのソースコードを、数値制御装置200が解釈/実行できるオブジェクトプログラムに変換する。コンパイラ13は、図8に示すように、字句解析部15、構文解析部16、意味解析部17、最適化部18、コード生成部19を備える。
 字句解析部15は、ソースコードの文字列を言語の要素(トークン)の列に分解する。
 構文解析部16は、トークンの列を、意味を反映した構造に変換する。この構造は、しばしば、木構造で表現され、抽象構文木と呼ばれる。
 意味解析部17は、構文木の意味を解析する。意味解析により、ソースコードは、中間コードに変換される。
 最適化部18は、中間コードを変形して、効率のよいプログラムに変換する。本開示の最適化部18は、外部入力信号の定数値を用いて命令の実行回数を減らす最適化を行う。最適化部18の処理については後述する。
 コード生成部19は、内部コードをオブジェクトプログラムの言語に変換する。例えば、中間コードを数値制御装置200のアセンブリ言語に変換する。
 システムプログラム出力部14は、外部入力信号の定数値で最適化したシステムプログラムをユーザの情報処理装置(数値制御装置200を含む)300に出力する。
 図9及び図10を参照して定数値を用いた最適化を説明する。
 図9はソースコードとマクロ変数の定数値の例、図10は最適化によるソースコードの変化を示す。
 図9に示すように、マクロ変数「CNC_DATA_1」には定数値「0」、「CNC_DATA_2」には定数値「1」、「CNC_DATA_3」には定数値「100」、「CNC_DATA_4」には定数値「200」が設定されている。
 ソースコードは、「If(CNC_DATA_1){func_1();}:」、「If(CNC_DATA_2){func_2();}:」、「val_3=CNC_DATA_3:」、「val_4+=CNC_DATA_4:」である。
 図10を参照して最適化によるソースコードの変化を説明する。
 1行目の関数:最適化前の関数「If(CNC_DATA_1){func_1();}」を実行すると、数値制御装置は、マクロ変数「CNC_DATA_1」に対応する外部入力信号をメモリから読み込み、条件判定を行い、条件判定の結果が「真」の場合、func_1()を呼び出す。
 最適化によりマクロ変数「CNC_DATA_1」に定数値「0」を代入すると、関数は「If(0){func_1();}」となり、条件文は常に「偽」となり、この関数は死んだ命令となり削除できる。このコードに対して、数値制御装置は何もしない。
 2行目の関数:最適化前の関数「If(CNC_DATA_2){func_2();}」を実行すると、数値制御装置は、マクロ変数「CNC_DATA_2」に対応する外部入力信号をメモリから読み込み、条件判定を行い、条件判定の結果が「真」の場合、func_2()を呼び出す。
 最適化によりマクロ変数「CNC_DATA_2」に定数値「1」を代入すると、関数は「If(1){func_2();}」となり、条件文は常に「真」となり、条件分岐が不要となる。また、マクロ変数「CNC_DATA_2」は定数なので外部入力信号を読み込む処理が不要になる。
 3行目の式:最適化前の式「val_3=CNC_DATA_3;」を実行すると、数値制御装置は、マクロ変数「CNC_DATA_3」に対応する外部入力信号をメモリから読み込み、変数「val_3」に代入する。
 最適化により「val_3」に定数値「100」を代入すると、外部入力信号を読み込む処理が不要になる。
 4行目の式:最適化前の式「val_4+=CNC_DATA_4;」を実行すると、数値制御装置は、マクロ変数「CNC_DATA_4」に対応する外部入力信号をメモリから読み込み、変数「val_4」に加算する。
 最適化により「val_4」に定数値「200」を代入すると、外部入力信号を読み込むことなく、変数「val_4」に200を加算する。
 上述した最適化により命令の実行回数を減らすことができる。
 次いで、図11及び図13を参照して、本開示のシステムプログラム最適化システム1000の動作を説明する。図11は、外部入力信号の定数値を設定する処理のフローチャートであり、図13は最適化を行う処理のフローチャートである。
 定数値設定部31は、外部入力信号の定数値の設定をユーザから受け付ける(ステップS1)。外部入力信号の定数値は、外部入力信号に対応するインデックスおよびメモリ上のアドレスと関連づけられている。インデックスは、マクロ変数と対応づけられている。図12の例では、「CNC_DATA_1_IDX」、「CNC_DATA_2_IDX」、「CNC_DATA_3_IDX」、「CNC_DATA_4_IDX」、・・・に対して、「CNC_DATA_1」、「CNC_DATA_2」、「CNC_DATA_3」、「CNC_DATA_4」、・・・が紐づけられている。インデックスとマクロ変数の対応付けはシステムプログラム最適化装置が行う。
 定数値設定部31は、数値制御装置200のメモリ上にユーザが指定した定数値を設定する(ステップS2)。
 定数値出力部32は、定数値と、インデックスをシステムプログラム最適化装置100に出力する(ステップS3)。
 図13を参照して最適化処理について説明する。
 システムプログラム最適化装置100の定数値取得部12は、外部入力信号のインデックスと、定数値を取得する(ステップS11)。定数値取得部12は、外部入力信号のインデックスに対応するマクロ変数を特定する(ステップS12)。定数値取得部12は、外部入力信号の定数値でマクロ変数を定義する(ステップS13)。
 最適化部18は、マクロ変数を定数値に置き換える(ステップS14)。最適化部18は、システムプログラムを最適化する(ステップS15)。システムプログラム出力部14は、システムプログラム管理部11が管理する情報に基づき、ユーザを特定し、ユーザの情報処理装置(数値制御装置200を含む)300にシステムプログラムを出力する(ステップS16)。
 ユーザは、取得したシステムプログラムを数値制御装置200にインストールする(ステップS17)。
 以上説明したように、本開示のシステムプログラム最適化システム1000は、システムプログラム最適化装置100を備える。システムプログラム最適化装置100は、ネットワークを介して数値制御装置200のシステムプログラムを管理する。システムプログラム最適化装置100は、ユーザから取得した外部入力信号の定数値を用いてシステムプログラムの最適化を行う。ユーザは、最適化されたシステムプログラムを自己の数値制御装置200にインストールする。
[第2の実施の態様]
 外部入力信号の具体的な例を説明する。
 第2の実施の形態での外部入力信号の例は、マシンロック信号である。マシンロック信号をオンにすると、数値制御装置200はマシンロック状態になる。マシンロック状態では、移動指令を実行しても工作機械を実際に動かさず、位置表示のみを更新する。通常、メインCPU201は、制御周期ごとにマシンロック信号にアクセスし、マシンロック状態(マシンロック信号がオン)であるかどうかを判定する。
 マシンロック信号をオフ(定数値)に設定して最適化を行うと、メインCPU201は、マシンロック信号にアクセスすることなく、マシンロック状態ではないと判定できる。そのため、外部入力信号取得のための制御周期の待機時間が短縮され、さらに、マシンロック状態を判定する分岐を処理する時間が短縮される。
[第3の実施の態様]
 第3の実施の形態での外部入力信号の例は、送り速度オーバライド信号である。送り速度オーバライド信号は、切削加工中の送り速度と回転速度を調整する数値を表す。送り速度オーバライド信号は、通常は定速(100%)であり、0%~200%などの範囲で指定できる。通常、メインCPU201は、切削加工中、制御周期で送り速度オーバライド信号にアクセスし、送り速度オーバライド信号の値をメモリから読み出し、送り速度を制御する。
 送り速度オーバライド信号を100%(定数値)に設定して最適化を行うと、メインCPU201は、送り速度オーバライド信号にアクセスすることなく、送り速度が一定になるように制御する。そのため、外部入力信号取得のための制御周期の待機時間が短縮される。
[第4の実施の態様]
 第4の実施の態様での外部入力信号の例は、スキップ信号である。スキップ信号がオンになると、メインCPU201は、実行中のブロック(加工プログラムの1行)が終了しなくても、信号が入力された時点で次ブロック(加工プログラムの次の行)に進む。通常、メインCPU201は、制御周期でスキップ信号にアクセスし、スキップ信号がオンであれば、現在実行中のブロックをスキップし、次ブロックを読み出す。
 スキップ信号をオフに設定して最適化を行うと、メインCPU201は、スキップ信号にアクセスすることなく、加工プログラムを実行する。そのため、外部入力信号取得のための制御周期の待機時間が短縮される。
 以上説明したように、本開示のシステムプログラム最適化システム1000では、外部入力信号の定数値をユーザに設定させ、設定された定数値を用いてシステムプログラムを最適化する。最適化により、制御信号ごとの外部入力信号へのアクセス時間、分岐命令の削除、定数の畳み込みなどが可能になるため実行効率が向上する。また、実行しない機能を無効にすると、不要な機能に関する冗長なコードを削除することができるので、実行効率が向上する。
 外部入力信号は、ノイズにより電圧レベルが変わり誤作動するリスクがあるが、定数値を設定することにより、ノイズによる誤作動が発生しない。また、定数値に設定することで、ノイズによる誤作動が発生しないため、ノイズ対策部品などにかかるコストも削減される。
 システムプログラムを最適化すると、外部入力信号の処理に用いられるコード領域やデータ領域が削減される。システムプログラムを動作させるメモリ容量を抑えることができるので、ハードウェアへの負荷が削減される。
 なお、第2から第4の実施の態様では、タッチパネルや操作盤などの入力部からの信号を例としてあげたが、図6に示すように、数値制御装置200に入力される外部入力信号は、その他の外部装置(工作機械のリミットスイッチ、センサ、コンタクタ、ランプ、主軸モータ、サーボモータなど)からの信号も含む。
 第1の実施の態様では、システムプログラム最適化装置100は、外部入力信号の定数値を、ネットワークを介して取得したが、可搬性記憶媒体を介して取得してもよい。
 従来、数値制御装置200の仕様やシステムプログラムのソースコードを解析することによりシステムプログラムを最適化する技術は存在する。しかしながら、数値制御装置200のシステムプログラムは、ユーザの仕様に基づいて最適化されるが、本開示の場合、ユーザが実際に使用する環境に合わせてさらなる最適化を促すことができる。
[ハードウェア構成]
 図14を参照して、システムプログラム最適化装置100のハードウェア構成を説明する。システムプログラム最適化装置100が備えるCPU111は、システムプログラム最適化装置100を全体的に制御するプロセッサである。CPU111は、バスを介してROM112に加工されたオペレーティングシステムを読み出し、該オペレーティングシステムに従ってシステムプログラム最適化装置100の全体を制御する。RAM113には、一時的な計算データや表示データ、入力部71を介してユーザが入力した各種データ等が一時的に格納される。
 表示部70は、システムプログラム最適化装置100に付属のモニタなどである。
 入力部71は、表示部70と一体、又は、表示部70とは別のキーボード、タッチパネル、操作ボタンなどである。ユーザは入力部71を操作して、表示部70に表示された画面への入力などを行う。
 不揮発性メモリ114は、例えば、図示しないバッテリでバックアップされるなどして、システムプログラム最適化装置100の電源がオフされても記憶状態が保持されるメモリである。不揮発性メモリ114は、システムプログラムの管理情報を記憶する。システムプログラムの管理情報には、数値制御装置の識別情報、外部入力信号の定数値などが含まれる。不揮発性メモリ114には、図示しないインターフェースを介して外部機器から読み込まれたプログラムや入力部71を介して入力されたプログラム、システムプログラム最適化装置100の各部から取得された各種データが記憶される。不揮発性メモリ114に記憶されたプログラムや各種データは、実行時/利用時にはRAM113に展開されてもよい。また、ROM112には、各種のシステムプログラムがあらかじめ書き込まれている。
  1000 システムプログラム最適化システム
  100  システムプログラム最適化装置
  11   システムプログラム管理部
  12   定数値取得部
  13   コンパイラ
  14   システムプログラム出力部
  18   最適化部
  200  数値制御装置
  300  情報処理装置
  31   定数値設定部
  32   定数値出力部
  70   表示部
  71   入力部
  111  CPU
  112  ROM
  113  RAM
  114  不揮発性メモリ

Claims (6)

  1.  数値制御装置のシステムプログラムを管理するシステムプログラム最適化装置であって、
     前記数値制御装置に接続される外部装置から入力する外部入力信号に対して設定された定数値を取得する定数値取得部と、
     前記システムプログラムのソースコードを前記数値制御装置が実行できるオブジェクトプログラムに変換するコンパイラと、を備え、
     前記コンパイラは、前記外部入力信号の定数値で前記システムプログラムを最適化する最適化部を備える、システムプログラム最適化装置。
  2.  前記定数値取得部は、前記外部入力信号の前記数値制御装置のメモリ上のアドレスと対応付けられたインデックスを取得し、インデックスを基にシステムプログラムの変数を特定する、請求項1記載のシステムプログラム最適化装置。
  3.  複数の数値制御装置のシステムプログラムを管理するシステムプログラム管理部と、
     前記定数値を用いて最適化したシステムプログラムをユーザの情報処理装置に出力するシステムプログラム出力部を備える、請求項1記載のシステムプログラム最適化装置。
  4.  オリジナルのシステムプログラムは、複数の数値制御装置に適合する汎用的なプログラムであり、
     前記最適化部は、前記オリジナルのシステムプログラムを、ユーザの数値制御装置に最適化させる、請求項1記載のシステムプログラム最適化装置。
  5.  数値制御装置に接続される外部装置から入力する外部入力信号に対する定数値の設定を受け付ける定数値設定部と、
     前記定数値をシステムプログラム最適化装置に出力する定数値出力部と、を備える情報処理装置と、
     数値制御装置のシステムプログラムを管理するシステムプログラム最適化装置であって、
     前記数値制御装置に接続される外部装置から入力する外部入力信号に対して設定された定数値を取得する定数値取得部と、
     前記システムプログラムのソースコードを前記数値制御装置が実行できるオブジェクトプログラムに変換するコンパイラと、を備え、
     前記コンパイラは、前記外部入力信号の定数値で前記システムプログラムを最適化する最適化部を備える、システムプログラム最適化装置と、
     を含むシステムプログラム最適化システム。
  6.  1つ又は複数のプロセッサが実行することにより、
     数値制御装置に接続される外部機器から入力する外部入力信号に対して設定された定数値を取得し、
     前記数値制御装置のシステムプログラムのソースコードを、前記数値制御装置が実行できるオブジェクトプログラムにコンパイルし、
     前記コンパイルにおいて、前記外部入力信号の定数値で前記システムプログラムを最適化する、
     前記プロセッサが読み取り可能な命令を記憶する記憶媒体。
PCT/JP2022/014623 2022-03-25 2022-03-25 システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体 WO2023181400A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/014623 WO2023181400A1 (ja) 2022-03-25 2022-03-25 システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/014623 WO2023181400A1 (ja) 2022-03-25 2022-03-25 システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体

Publications (1)

Publication Number Publication Date
WO2023181400A1 true WO2023181400A1 (ja) 2023-09-28

Family

ID=88100319

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/014623 WO2023181400A1 (ja) 2022-03-25 2022-03-25 システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体

Country Status (1)

Country Link
WO (1) WO2023181400A1 (ja)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003216434A (ja) * 2002-01-25 2003-07-31 Hewlett Packard Co <Hp> 小型情報機器において、ユーザプロファイルデータの活用により、ダウンロードプログラムの最適化を図る方法およびシステム。
JP2016133911A (ja) * 2015-01-16 2016-07-25 ファナック株式会社 加工プログラムに応じて数値制御装置のコントロールソフトウェアを最適化する機能を備えた制御システム
JP2016143075A (ja) * 2015-01-29 2016-08-08 東芝ソリューション株式会社 仕様抽出装置、仕様抽出方法およびプログラム
JP2018185734A (ja) * 2017-04-27 2018-11-22 ファナック株式会社 数値制御装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003216434A (ja) * 2002-01-25 2003-07-31 Hewlett Packard Co <Hp> 小型情報機器において、ユーザプロファイルデータの活用により、ダウンロードプログラムの最適化を図る方法およびシステム。
JP2016133911A (ja) * 2015-01-16 2016-07-25 ファナック株式会社 加工プログラムに応じて数値制御装置のコントロールソフトウェアを最適化する機能を備えた制御システム
JP2016143075A (ja) * 2015-01-29 2016-08-08 東芝ソリューション株式会社 仕様抽出装置、仕様抽出方法およびプログラム
JP2018185734A (ja) * 2017-04-27 2018-11-22 ファナック株式会社 数値制御装置

Similar Documents

Publication Publication Date Title
CN109254776B (zh) 多语言代码编译方法及编译器
US5606697A (en) Compiler system for language processing program
US6311324B1 (en) Software profiler which has the ability to display performance data on a computer screen
US7493610B1 (en) Versioning optimization for dynamically-typed languages
EP1164478A2 (en) Method and apparatus for resolving data references in generated code
US7356813B2 (en) System and method for optimizing a program
US20230004368A1 (en) Multi-chip compatible compiling method and device
KR20010086159A (ko) 자바 프로그램들 및 이를 위한 소프트웨어 프러덕트의플랫폼 특정 효율 강화를 위한 방법
KR20020070809A (ko) 포스트-링크 코드 최적화
JP3813087B2 (ja) プログラム変換方法、コンピュータ装置及びプログラム
US11256481B2 (en) Software development environment with compilation and read-evaluate-print-loop operations
WO2023181400A1 (ja) システムプログラム最適化装置、システムプログラム最適化システム、及びコンピュータが読み取り可能な記憶媒体
CN113934431A (zh) 一种量子程序编译方法、装置及电子设备
Kessler Peep: an architectural description driven peephole optimizer
KR20170046864A (ko) Plc 명령어 컴파일 최적화 방법
JP5038760B2 (ja) ソースコード変換装置及びソースコード変換方法
JP3389592B2 (ja) プログラマブルコントローラ
JPH0410081B2 (ja)
JPH05334096A (ja) 言語翻訳プログラム及びその出力結果を用いるデバッグ装置
KR20210101770A (ko) 복수 프로그래밍 언어 지원을 위한 plc 제어방법
JP3922699B2 (ja) ループ内不変な式の移動に関する最適化方式およびプログラム
JPH086797A (ja) 定数参照最適化処理装置
JP2000081984A (ja) コンパイル処理装置およびコンパイル処理方法
JP3424596B2 (ja) シンボル参照情報のキャッシュ方法ならびに装置
JP2000242504A (ja) コンパイラ装置

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: 22933538

Country of ref document: EP

Kind code of ref document: A1