JP2023034569A - Controller and file structure of program - Google Patents

Controller and file structure of program Download PDF

Info

Publication number
JP2023034569A
JP2023034569A JP2021140871A JP2021140871A JP2023034569A JP 2023034569 A JP2023034569 A JP 2023034569A JP 2021140871 A JP2021140871 A JP 2021140871A JP 2021140871 A JP2021140871 A JP 2021140871A JP 2023034569 A JP2023034569 A JP 2023034569A
Authority
JP
Japan
Prior art keywords
program
variable
local
controller
held
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2021140871A
Other languages
Japanese (ja)
Inventor
和紀 花田
Kazunori Hanada
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Intellectual Property Management Co Ltd
Original Assignee
Panasonic Intellectual Property Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Intellectual Property Management Co Ltd filed Critical Panasonic Intellectual Property Management Co Ltd
Priority to JP2021140871A priority Critical patent/JP2023034569A/en
Publication of JP2023034569A publication Critical patent/JP2023034569A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

To provide a controller capable of simply performing transfer of local variables between a plurality of programs.SOLUTION: A controller 20 of a robot control system 110 is connected with one or a plurality of devices. A plurality of programs 200 for performing transfer of data or commands between the one or plurality of devices are stored in the controller 20. In the plurality of programs 200, a program A for executing prescribed functions by referring to local variables LA and a program B for executing prescribed functions by referring to local variables LB are at least contained. The controller 20 is constituted so as to be capable of directly substituting values of local variables LA stored in the program A into the local variables LB stored in the program B.SELECTED DRAWING: Figure 4

Description

本開示は、コントローラ及びプログラムのファイル構造に関する。 The present disclosure relates to controller and program file structures.

従来、産業用ロボット(以下、単にロボットと言う)を含むシステム(以下、ロボットシステムと言う)の制御において、種々のコンピュータプログラム(以下、単にプログラムと言う)が使用されている。通常、プログラムは、C言語等の高級プログラミング言語で記述され、システム内のコンパイラで変換された後、システム内の各種機器で利用可能となる。また、ロボットシステムにおいては、実行対象となるプログラムが記載されたファイルを指定してプログラムの実行を開始する方法が一般的に採用されている。 2. Description of the Related Art Conventionally, various computer programs (hereinafter simply referred to as programs) are used in controlling systems (hereinafter simply referred to as robot systems) including industrial robots (hereinafter simply referred to as robots). A program is usually written in a high-level programming language such as C language, and after being converted by a compiler in the system, can be used in various devices in the system. Further, in robot systems, a method of specifying a file in which a program to be executed is described and starting execution of the program is generally adopted.

また、複数のプログラムを実行させるにあたって、共通した変数(例えば、グローバル変数)は、プログラムの外部で定義され、複数のプログラムで利用される。一方、それぞれのプログラムの内部で独自に定義された変数(例えば、ローカル変数)は、定義されたプログラムの関数の内部でしか使用できない。なお、通常、グローバル変数は、ロボットシステムのコントローラに設けられた記憶領域に保存される。 Also, when executing a plurality of programs, common variables (for example, global variables) are defined outside the programs and used in the plurality of programs. On the other hand, variables uniquely defined inside each program (for example, local variables) can only be used inside the function of the defined program. Note that the global variables are usually stored in a storage area provided in the controller of the robot system.

しかし、ロボットシステムで使用されるプログラムの数が多くなると、共通した変数を使用するプログラムも多くなる。この場合、グローバル変数の数が増えてしまうため、その編集管理作業、つまり、内容や数値範囲の変更、削除、あるいはグローバル変数自体の追加が増加してしまう。 However, as the number of programs used in the robot system increases, the number of programs using common variables also increases. In this case, since the number of global variables increases, the work of editing and managing them, that is, changing or deleting contents or numerical ranges, or adding global variables themselves increases.

このような課題に対して、例えば、特許文献1には、変数名と、その範囲である変数値、また変数値の保存先アドレスと、のそれぞれの記憶領域を設けた構成が開示されている。指定された変数名及び変数値を登録する場合に、既に同じ変数名がある場合は、当該変数名に対応する変数値を保存先アドレスの記憶領域からサーチし、当該変数値を指定された値に書き換える。同じ変数名が無い場合は、前述した記憶領域のそれぞれに、新たに変数名と変数値とアドレスとを書き込んで保存する。 To address this problem, for example, Patent Document 1 discloses a configuration in which storage areas are provided for each of a variable name, a variable value that is the range of the variable value, and a storage destination address of the variable value. . When registering the specified variable name and variable value, if the same variable name already exists, the variable value corresponding to the variable name is searched from the storage area of the save destination address, and the variable value is the specified value rewrite to If the same variable name does not exist, a new variable name, variable value, and address are written and saved in each of the storage areas described above.

また、特許文献2には、プログラムで使用されているローカル変数ワークシートとグローバル変数ワークシートとが予め作成、保存されたプログラム編集装置が開示されている。プログラムを分割する場合、複数のプログラム構成要素で共用されているローカル変数をグローバル変数ワークシートに追加し、当該ローカル変数は、ローカル変数ワークシートに外部参照変数として登録される。また、プログラムを結合する場合、結合前のプログラム構成要素でのみ外部参照変数として共用されていたグローバル変数をローカル変数に変えて、結合後のローカル変数ワークシートに登録するとともに、グローバル変数ワークシートから削除する。 Further, Patent Literature 2 discloses a program editing device in which local variable worksheets and global variable worksheets used in a program are created and stored in advance. When dividing a program, local variables shared by a plurality of program components are added to the global variable worksheet, and the local variables are registered as external reference variables in the local variable worksheet. Also, when combining programs, change the global variables that were shared as external reference variables only by the program components before combining to local variables and register them in the local variable worksheet after combining, and also from the global variable worksheet. delete.

特開平05-035476号公報JP-A-05-035476 特開2010-049484号公報JP 2010-049484 A

ところで、近年、ロボットシステムに接続される機器、例えば、センサやPC(Personal Computer)の数が大幅に増加してきている。このことに伴い、ロボットシステム内で使用されるプログラムの数やプログラムのファイル間でのデータのやり取りが大幅に増加してきている。このため、複数のプログラムにおいて、共通に使用される変数の種類や数も増加している。 By the way, in recent years, the number of devices connected to robot systems, such as sensors and PCs (Personal Computers), has increased significantly. Along with this, the number of programs used in robot systems and the exchange of data between program files have increased significantly. Therefore, the types and number of variables that are commonly used in multiple programs are increasing.

一方、例えば、特許文献2に開示された構成では、複数のプログラムで共通に使用される変数は、一旦、ローカル変数からグローバル変数に定義し直して使用する必要がある。 On the other hand, for example, in the configuration disclosed in Patent Document 2, it is necessary to once redefine variables that are commonly used in a plurality of programs from local variables to global variables before use.

しかし、コントローラに保存されたグローバル変数のみを用いて、共通に使用される変数、ひいては、複数のプログラムの編集管理を行うことは煩雑であり、また、プログラム間での変数の値の受け渡しが難しくなるおそれがあった。 However, it is complicated to edit and manage commonly used variables and multiple programs using only the global variables stored in the controller, and it is difficult to pass variable values between programs. There was a possibility that

本開示はかかる点に鑑みてなされたもので、その目的は、複数のプログラム間でローカル変数の値の受け渡しを簡便に行えるコントローラ及びプログラムのファイル構造を提供することにある。 The present disclosure has been made in view of this point, and an object thereof is to provide a controller and a program file structure that can easily transfer values of local variables between a plurality of programs.

上記目的を達成するため、本開示に係るコントローラは、制御システムが備えるコントローラであって、前記コントローラには、1または複数の機器が接続されるとともに、前記1または複数の機器との間でデータまたは命令の受け渡しを行うための複数のプログラムが保存されており、複数の前記プログラムには、ローカル変数を参照して所定の関数を実行する第1プログラム及び第2プログラムが少なくとも含まれ、前記コントローラは、前記第1プログラムに保持されたローカル変数の値を前記第2プログラムに保持されたローカル変数に直接代入可能に、または、前記第2プログラムに保持されたローカル変数の値を前記第1プログラムに保持されたローカル変数に直接代入可能に構成されていることを特徴とする。 In order to achieve the above object, a controller according to the present disclosure is a controller included in a control system, wherein one or more devices are connected to the controller, and data exchange with the one or more devices is performed. Alternatively, a plurality of programs are stored for transferring instructions, the plurality of programs include at least a first program and a second program that refer to local variables and execute a predetermined function, and the controller directly assigns the value of the local variable held in the first program to the local variable held in the second program, or assigns the value of the local variable held in the second program to the first program It is characterized by being configured so that it can be directly assigned to a local variable held in .

本開示に係るファイル構造は、コントローラに1または複数の機器が接続された制御システムで実行されるプログラムのファイル構造であって、前記プログラムは、変数テーブル部を含んでおり、前記変数テーブル部は、前記プログラムに記述された関数の内部で定義されるローカル変数を少なくとも1つ含んでおり、前記ローカル変数は、変数名と変数情報とが互いに関連付けられた形式で前記変数テーブル部に保存されており、前記変数情報には、少なくとも前記ローカル変数の型情報が含まれることを特徴とする。 A file structure according to the present disclosure is a file structure of a program executed in a control system in which one or more devices are connected to a controller, the program including a variable table section, the variable table section , at least one local variable defined inside a function described in the program, and the local variable is stored in the variable table section in a form in which a variable name and variable information are associated with each other. and the variable information includes at least type information of the local variables.

本開示によれば、複数のプログラム間でローカル変数の値の受け渡しを簡便に行うことができる。このことにより、プログラムの編集管理作業を高速化でき、また、作業者にとっての利便性が向上する。 According to the present disclosure, it is possible to easily pass the values of local variables between a plurality of programs. This makes it possible to speed up the program editing management work and improve the convenience for the operator.

実施形態1に係るロボットシステムの概略構成図である。1 is a schematic configuration diagram of a robot system according to Embodiment 1. FIG. ロボットシステムの機能ブロック図である。1 is a functional block diagram of a robot system; FIG. プログラムのファイル構造を示す模式図である。4 is a schematic diagram showing the file structure of a program; FIG. プログラム間でのローカル変数の値の受け渡しを示す模式図である。FIG. 4 is a schematic diagram showing passing of values of local variables between programs; プログラム間でのローカル変数の値の受け渡し手順を示すフローチャートである。4 is a flow chart showing a procedure for passing values of local variables between programs; 比較のためのプログラム間でのローカル変数の値の受け渡しを示す模式図である。FIG. 4 is a schematic diagram showing passing of values of local variables between programs for comparison; 実施形態2に係る第1プログラムの変数テーブル部の概要を示す図である。FIG. 12 is a diagram showing an outline of a variable table part of the first program according to the second embodiment; FIG. 第2プログラムの変数テーブル部の概要を示す図である。It is a figure which shows the outline|summary of the variable table part of a 2nd program. プログラム間でのローカル変数の値の受け渡し手順を示すフローチャートである。4 is a flow chart showing a procedure for passing values of local variables between programs;

以下、本開示の実施形態を図面に基づいて説明する。なお、以下の好ましい実施形態の説明は、本質的に例示に過ぎず、本開示、その適用物或いはその用途を制限することを意図するものではない。 Hereinafter, embodiments of the present disclosure will be described based on the drawings. It should be noted that the following description of preferred embodiments is merely illustrative in nature and is not intended to limit the present disclosure, its applications or uses.

(実施形態1)
[ロボットシステムの構成]
図1は、本実施形態に係るロボットシステムの概略構成図を示し、図2は、ロボットシステムの機能ブロック図を示す。
(Embodiment 1)
[Configuration of robot system]
FIG. 1 shows a schematic configuration diagram of a robot system according to this embodiment, and FIG. 2 shows a functional block diagram of the robot system.

図1に示すように、ロボットシステム100は、ロボット10とロボット制御システム110と溶接制御部40とを備えている。 As shown in FIG. 1, the robot system 100 includes a robot 10, a robot control system 110, and a welding control section 40. As shown in FIG.

ロボット10は、アーク溶接に用いられる溶接ロボットである、ロボット10は、複数のサーボモータ12を有する多軸の多関節型ロボット10で構成されている。ロボットアーム11の先端部には、溶接用のトーチ13や図示しないワイヤ送給装置が取り付けられている。なお、関節軸数や水平多関節型、垂直多関節型等のロボット10の構成は、用途に合わせて適宜選択すればよい。また、ロボット10は、溶接ロボットに限られず、例えば、物品の搬送ロボットであってもよい。 The robot 10 is a welding robot used for arc welding. A welding torch 13 and a wire feeding device (not shown) are attached to the tip of the robot arm 11 . The number of joint axes and the configuration of the robot 10, such as a horizontal multi-joint type and a vertical multi-joint type, may be appropriately selected according to the application. Further, the robot 10 is not limited to a welding robot, and may be, for example, an article transport robot.

なお、図1に示す例では、ロボット10は1台であるが、ロボットシステム100は複数台のロボット10を備えていてもよい。その場合、すべてのロボット10に対して、ロボット制御システム110と溶接制御部40とが共通していてもよい。また、それぞれのロボット10に対して、ロボット制御システム110と溶接制御部40とが個別に設けられていてもよい。 In the example shown in FIG. 1 , there is one robot 10 , but the robot system 100 may have multiple robots 10 . In that case, the robot control system 110 and the welding control section 40 may be common to all the robots 10 . Also, the robot control system 110 and the welding control unit 40 may be provided individually for each robot 10 .

ロボット制御システム110は、コントローラ20とティーチングペンダント30とを有している。なお、ロボット制御システム110の外部に設けられたサーバー70(図2参照)がロボット制御システム110に含まれていてもよい。また、ロボット10が溶接ロボット以外の場合、ロボットシステム100から溶接制御部40は省略されうる。 A robot control system 110 has a controller 20 and a teaching pendant 30 . Note that the robot control system 110 may include a server 70 (see FIG. 2) provided outside the robot control system 110 . Also, if the robot 10 is other than a welding robot, the welding controller 40 may be omitted from the robot system 100 .

コントローラ20は、ロボット10に接続され、ロボット10の動作、具体的には、関節軸を駆動するサーボモータ12の動作を制御する。 The controller 20 is connected to the robot 10 and controls the operation of the robot 10, specifically, the operation of the servomotor 12 that drives the joint axes.

図2に示すように、コントローラ20には、ティーチングペンダント30、溶接制御部40、外部機器60、サーバー70、外部ロボット80及び外部軸90がそれぞれ接続されている。コントローラ20は、接続された各種機器等との間でデータまたは命令の受け渡しをそれぞれ行う。ここで、外部機器60は、例えば、各種センサや警報ランプ等である。また、外部機器60が、PLC(Programmable Logic Controller)やPCであってもよい。 As shown in FIG. 2, the controller 20 is connected to a teaching pendant 30, a welding control section 40, an external device 60, a server 70, an external robot 80 and an external axis 90, respectively. The controller 20 exchanges data or commands with various connected devices. Here, the external device 60 is, for example, various sensors, alarm lamps, and the like. Also, the external device 60 may be a PLC (Programmable Logic Controller) or a PC.

なお、外部ロボット80とは、図2に示すコントローラ20とは別のコントローラ(図示せず)に接続されたロボットであり、別のコントローラによって動作が制御される。複数のロボット20を強調して動作させる場合、コントローラ20を外部ロボット80に接続することがある。 The external robot 80 is a robot connected to a controller (not shown) different from the controller 20 shown in FIG. 2, and its operation is controlled by the separate controller. The controller 20 may be connected to the external robot 80 when a plurality of robots 20 are operated intensively.

外部軸90とは、ロボットシステム100におけるロボット10以外の駆動機構である。例えば、溶接対象となるワーク(図示せず)を保持し、所定の方向に移動させるステージ(図示せず)等が該当する。コントローラ20が外部軸90であるステージの動作を制御することで、トーチ13とワークとの相対的な位置関係を正確に決定できる。 The external shaft 90 is a drive mechanism other than the robot 10 in the robot system 100 . For example, a stage (not shown) that holds a workpiece (not shown) to be welded and moves it in a predetermined direction. By controlling the operation of the stage, which is the external shaft 90, by the controller 20, the relative positional relationship between the torch 13 and the workpiece can be accurately determined.

ティーチングペンダント30は、作業者がロボット10の動作や溶接条件などを定義したり、コントローラ20から送信されたロボット10の情報を表示したりするための装置である。ティーチングペンダント30とコントローラ20とは、有線通信または無線通信のいずれかで接続されている。 The teaching pendant 30 is a device for an operator to define the operation of the robot 10 and welding conditions, and to display information about the robot 10 transmitted from the controller 20 . The teaching pendant 30 and the controller 20 are connected by either wired communication or wireless communication.

ティーチングペンダント30は、ロボット10の動作内容を作業者が入力するための入力部31と、当該入力内容やコントローラ20から送信されたロボット10の情報等を表示するための表示部32と、を有している。図2に示すように、入力部31はキーボード等のハードキーでもよい。また、表示部32は液晶ディスプレイでもよい。なお、表示部32がタッチパネルである場合は、入力部31が表示部32に組み込まれてもよい。また、ティーチングペンダント30に情報処理部としてプロセッサ(図示せず)が搭載されていてもよい。 The teaching pendant 30 has an input unit 31 for the operator to input the operation details of the robot 10, and a display unit 32 for displaying the input details, information about the robot 10 transmitted from the controller 20, and the like. are doing. As shown in FIG. 2, the input unit 31 may be hard keys such as a keyboard. Also, the display unit 32 may be a liquid crystal display. Note that the input unit 31 may be incorporated in the display unit 32 when the display unit 32 is a touch panel. A processor (not shown) may be mounted on the teaching pendant 30 as an information processing section.

溶接制御部40は、コントローラ20の処理に対応して制御信号を出力し、ロボット10に取り付けられた溶接用のトーチ13やワイヤ送給装置(図示せず)の動作を制御する。なお、溶接制御部40は、コントローラ20と一体に構成されていてもよい。 The welding control unit 40 outputs a control signal corresponding to the processing of the controller 20 and controls the operation of the welding torch 13 attached to the robot 10 and the wire feeding device (not shown). Note that the welding control unit 40 may be configured integrally with the controller 20 .

コントローラ20は、有線通信または無線通信のいずれかでサーバー70に接続されている。サーバー70は、コントローラ20に送信されたデータ及びコントローラ20の内部で生成されたデータをバックアップして保存する。サーバー70は、コントローラ20のプログラム保存領域25に保存されたプログラムや記憶領域24に保存されたデータ、例えば、グローバル変数のテーブル等をバックアップして保存してもよい。また、サーバー70は、データの一部を表示可能に構成されていてもよい。 The controller 20 is connected to the server 70 either by wired communication or wireless communication. The server 70 backs up and stores data transmitted to the controller 20 and data generated inside the controller 20 . The server 70 may back up and store programs stored in the program storage area 25 of the controller 20 and data stored in the storage area 24, for example, a table of global variables. Also, the server 70 may be configured to be able to display part of the data.

図2に示すように、コントローラ20は、CPU(情報処理部)21と入出力制御部22と電源制御部23と記憶領域24とプログラム保存領域25と通信インターフェイス部26とを有している。つまり、コントローラ20は、一種のコンピュータシステムである。コントローラ20は、電源50から電源制御部23に供給された電力によって動作する。 As shown in FIG. 2 , the controller 20 has a CPU (information processing section) 21 , an input/output control section 22 , a power control section 23 , a storage area 24 , a program storage area 25 and a communication interface section 26 . That is, the controller 20 is a kind of computer system. The controller 20 operates by power supplied from the power supply 50 to the power supply control section 23 .

CPU(Central Processing Unit)21は、ティーチングペンダント30から入力された指令や、教示プログラムまたは所定の制御シーケンスに対応して、ロボット制御システム110全体の制御を行うプロセッサである。なお、教示プログラムは、プログラム保存領域25に保存されている。 A CPU (Central Processing Unit) 21 is a processor that controls the entire robot control system 110 in response to commands input from the teaching pendant 30, teaching programs, or predetermined control sequences. Note that the teaching program is stored in the program storage area 25 .

また、CPU21は、ロボット10のサーボモータ12のドライバ(図示せず)より送信された検出角度に基づいて、プログラム保存領域25に記憶されているサーボモータ12の特性やロボット10のアーム長等の値と順運動学演算とを用いて、直交座標系におけるロボット10のトーチ13の先端位置を演算する。 The CPU 21 also determines the characteristics of the servomotor 12 and the arm length of the robot 10 stored in the program storage area 25 based on the detected angle transmitted from the driver (not shown) of the servomotor 12 of the robot 10 . Using the values and forward kinematics calculations, the tip position of the torch 13 of the robot 10 in the Cartesian coordinate system is calculated.

なお、複数個のCPU21がコントローラ20に搭載されていてもよい。複数のCPU21には、例えば、ロボット制御システム110の全体管理を行うメインCPUやサーボモータ12の駆動管理を行うサーボCPUが含まれる。また、溶接制御部40を制御する溶接CPUや入出力制御部22を制御する入出力CPUが含まれることがある。 Note that a plurality of CPUs 21 may be mounted on the controller 20 . The plurality of CPUs 21 includes, for example, a main CPU that performs overall management of the robot control system 110 and a servo CPU that performs drive management of the servo motors 12 . A welding CPU that controls the welding control unit 40 and an input/output CPU that controls the input/output control unit 22 may also be included.

1個のCPU21に異常が生じた場合、残りのCPU21でバックアップ動作を行うことができる。また、ロボット制御システム110全体の制御を行うCPU21と、トーチ13の先端位置を演算するCPU21とが、別個に設けられていてもよい。 If one CPU 21 malfunctions, the remaining CPU 21 can perform a backup operation. Alternatively, the CPU 21 that controls the entire robot control system 110 and the CPU 21 that calculates the tip position of the torch 13 may be provided separately.

入出力制御部22は、CPU21の処理に対応して、コントローラ20に接続された各種機器等の情報取得及び送信処理を行う。 The input/output control unit 22 performs information acquisition and transmission processing of various devices connected to the controller 20 in correspondence with the processing of the CPU 21 .

記憶領域24は、ロボット制御システム110で使用される各種プログラムで共通に使用されるデータを保存する。例えば、記憶領域24は、サーボモータ12の特性値やロボット10のアーム長等のロボット10の動作に関する値等を保存する。後で述べるグローバル変数も記憶領域24に保存される。なお、記憶領域24にそれ以外のデータが保存されていてもよい。記憶領域24は、コントローラ20の内部メモリ、例えば、ROM(Read Only Memory)またはRAM(Random Access Memory)で構成される。記憶領域24は、例えば、HDD(Hard Disk Drive)やSSD(Solid State Drive)等で構成されてもよい。 The storage area 24 stores data commonly used by various programs used in the robot control system 110 . For example, the storage area 24 stores the characteristic values of the servo motors 12 and the values related to the operation of the robot 10 such as the arm length of the robot 10 . Global variables, which will be described later, are also stored in the storage area 24 . Note that the storage area 24 may store other data. The storage area 24 is composed of an internal memory of the controller 20, such as ROM (Read Only Memory) or RAM (Random Access Memory). The storage area 24 may be composed of, for example, an HDD (Hard Disk Drive), an SSD (Solid State Drive), or the like.

プログラム保存領域25は、前述の教示プログラムを始めとしたロボット制御システム110で使用される各種プログラムを保存する。プログラム保存領域25は、前述したコントローラ20の内部メモリで構成されてもよい。また、プログラム保存領域25は、コントローラ20に接続されたSDカード等の外部メモリであってもよい。なお、コントローラ20の内部の同じメモリに前述した記憶領域24とプログラム保存領域25とが存在していてもよい。 The program storage area 25 stores various programs used in the robot control system 110 including the teaching program described above. The program storage area 25 may consist of the internal memory of the controller 20 described above. Also, the program storage area 25 may be an external memory such as an SD card connected to the controller 20 . Note that the storage area 24 and the program storage area 25 may exist in the same memory inside the controller 20 .

通信インターフェイス部26は、電源50が投入されてサーバー70との接続が確立された後で、コントローラ20に送信されたデータ及びコントローラ20の内部で生成されたデータを一定のタイミングでサーバー70に対して送信する。なお、通信インターフェイス部26は、有線通信または無線通信のいずれかでティーチングペンダント30に接続されていてもよい。 After the power supply 50 is turned on and the connection with the server 70 is established, the communication interface unit 26 transmits data transmitted to the controller 20 and data generated inside the controller 20 to the server 70 at a certain timing. to send. The communication interface section 26 may be connected to the teaching pendant 30 by either wired communication or wireless communication.

[プログラム間でのローカル変数の値の受け渡し手順]
図3は、プログラムのファイル構造を模式的に示す。図4は、プログラム間でのローカル変数の値の受け渡しを模式的に示す。図5は、プログラム間でのローカル変数の値の受け渡し手順を示すフローチャートである。図6は、比較のためのプログラム間でのローカル変数の値の受け渡しを模式的に示す。
[Procedure for passing values of local variables between programs]
FIG. 3 schematically shows the file structure of the program. FIG. 4 schematically shows the passing of values of local variables between programs. FIG. 5 is a flow chart showing a procedure for passing values of local variables between programs. FIG. 6 schematically shows the passing of values of local variables between programs for comparison.

ロボット制御システム110で使用される各種プログラムは、所定のプログラミング言語、例えば、C言語やC++言語やJava(登録商標)等で記述されている。また、各プログラムに対し、宣言された変数を代入、または参照することで、プログラム上でデータの識別や管理を行うことができる。また、プログラムにおいて、当該変数に対応付けられた関数を実行することができる。 Various programs used in the robot control system 110 are written in a predetermined programming language such as C language, C++ language, Java (registered trademark), or the like. Also, by assigning or referencing declared variables to each program, data can be identified and managed on the program. Also, in the program, a function associated with the variable can be executed.

変数は、そのスコープ(適用範囲)の違いによって、ローカル変数とグローバル変数とに分けられる。ローカル変数とは、プログラムの内部で定義された変数であり、当該プログラムの内部でしか通常は使用できない。グローバル変数とは、プログラムの外部で定義された変数であり、異なるプログラムでも共通に使用可能である。なお、厳密に言えば、プログラミング言語によっては、ローカル変数の定義は異なるが、本願明細書では、前述した通り、ローカル変数を定義する。 Variables are classified into local variables and global variables according to the difference in scope (range of application). A local variable is a variable defined inside a program and can normally be used only inside the program. A global variable is a variable defined outside a program and can be commonly used by different programs. Strictly speaking, the definition of local variables differs depending on the programming language, but in this specification, local variables are defined as described above.

通常、産業用ロボットの駆動制御システム、例えば、図1に示すようなロボット制御システム110では、コントローラ20の記憶領域24に保存されたグローバル変数を異なるプログラムに共通に適用して、データ管理を簡素化している。なお、この場合も、各々のプログラムにおいて、ローカル変数が定義、使用されることは妨げられない。 Generally, in a drive control system for an industrial robot, for example, a robot control system 110 as shown in FIG. 1, global variables stored in the storage area 24 of the controller 20 are commonly applied to different programs to simplify data management. is becoming Also in this case, the definition and use of local variables in each program is not prevented.

しかし、ロボットシステム100が複雑化するのに伴い、コントローラ20に接続される機器数は増えてきている。このことに伴い、ロボット制御システム110において使用されるプログラムの数が増えてきている。また、各々のプログラム間で使用するデータのやり取りが増えてきている。このため、グローバル変数のみで各プログラムの編集管理を行うことが難しくなってきている。 However, as the robot system 100 becomes more complicated, the number of devices connected to the controller 20 is increasing. Along with this, the number of programs used in the robot control system 110 is increasing. In addition, exchange of data used between programs is increasing. Therefore, it is becoming difficult to edit and manage each program using only global variables.

そこで、本願発明者等は、ロボット制御システム110において使用されるプログラム200のファイル構造を図3に示すように設定した。また、図4に示すように、一のプログラムで定義されたローカル変数の値を、別のプログラムで直接使用できるようにした。これらについてさらに説明する。 Therefore, the inventors set the file structure of the program 200 used in the robot control system 110 as shown in FIG. Also, as shown in FIG. 4, the values of local variables defined in one program can be used directly in another program. These will be further explained.

本願明細書に示すプログラム200は、図3に示すように、1つのプログラムファイルにヘッダ部210と、命令レコード部220と、変数テーブル部230と、を少なくとも含んだ構造となっている。ただし、プログラム200に含まれるデータの数や種類は特にこれに限定されない。 The program 200 shown in the specification of the present application has a structure including at least a header section 210, an instruction record section 220, and a variable table section 230 in one program file, as shown in FIG. However, the number and types of data included in the program 200 are not particularly limited to this.

ヘッダ部210は、プログラム200において使用される変数や定数、関数、その他予め宣言する必要があるデータや命令の宣言を記述したテキストファイルまたはバイナリファイルの格納領域である。 The header section 210 is a storage area for a text file or a binary file that describes declarations of variables, constants, functions, and other data and instructions that must be declared in advance to be used in the program 200 .

命令レコード部220は、プログラム200の実行内容を記述したテキストファイルまたはバイナリファイルであり、例えば、ソースコードとして記述されている。 The instruction record part 220 is a text file or binary file describing the execution contents of the program 200, and is described as source code, for example.

変数テーブル部230は、プログラム200で使用されるローカル変数が、テーブル形式で保持されたデータである。テーブル形式については、実施形態2で述べる。 The variable table portion 230 is data in which local variables used in the program 200 are held in a table format. The table format will be described in the second embodiment.

また、本実施形態では、変数テーブル部230に含まれるローカル変数が1つである場合を例に取って説明するが、通常は、1つのプログラム200には、複数個のローカル変数が定義される。その場合、ロボット10の位置情報等に関する変数である等、複数種類のローカル変数が存在することが多い。また、ローカル変数の型は、整数型、浮動点小数型、文字列型、論理型等、目的に応じて多様である。変数テーブル部230に保存される場合、ローカル変数は、変数名と、その範囲、さらに変数情報(ローカル変数の種類や型等)とが互いに関連付けられた形式で保存される。なお、以降の説明において、「ローカル変数の値」とは、指定されたローカル変数に付与されたデータの範囲を言う。例えば、対象となるローカル変数に1または複数の数値が付与されていれば、ローカル変数の値は、付与された1または複数の数値である。対象となるローカル変数に文字列が付与されていれば、ローカル変数の値は、付与された文字列である。 Also, in this embodiment, the case where the variable table section 230 includes one local variable will be described as an example, but normally, one program 200 defines a plurality of local variables. . In that case, there are often multiple types of local variables such as variables related to the position information of the robot 10 and the like. Also, the types of local variables are diverse, such as integer type, floating point decimal type, character string type, and logical type, depending on the purpose. When stored in the variable table section 230, the local variables are stored in a format in which the variable name, its range, and further variable information (local variable type, type, etc.) are associated with each other. In the following description, "local variable value" refers to the range of data assigned to the specified local variable. For example, if the target local variable is given one or more numerical values, the value of the local variable is the given one or more numerical values. If a character string is assigned to the target local variable, the value of the local variable is the assigned character string.

このようにプログラム200のファイル構造を規定した場合、複数のプログラム200の間でローカル変数の値を直接受け渡しすることが可能となる。 When the file structure of the programs 200 is defined in this way, it becomes possible to directly transfer the values of local variables among the plurality of programs 200 .

従来、異なるプログラム間でローカル変数の値を共通して使用したい場合は、コントローラ20に保存されるグローバル変数を使用するか、または、グローバル変数を介してローカル変数の値を書き換える必要があった。 Conventionally, when it is desired to use the values of local variables in common between different programs, it is necessary to use the global variables stored in the controller 20 or to rewrite the values of the local variables via the global variables.

つまり、図6に示すように、プログラムA(第1プログラム)が保持するローカル変数LAの値(=1)をコントローラ20が保持するグローバル変数GAに代入する。プログラムAの命令レコード部220において、命令実行情報として記述した上で、この代入が実行される。次に、プログラムB(第2プログラム)のローカル変数LBに対し、グローバル変数GAの値を代入する。プログラムBの命令レコード部220において、命令実行情報として記述した上で、この代入が実行される。 That is, as shown in FIG. 6, the value (=1) of local variable LA held by program A (first program) is substituted for global variable GA held by controller 20 . In the instruction record section 220 of program A, this assignment is executed after being described as instruction execution information. Next, the value of global variable GA is substituted for local variable LB of program B (second program). In the instruction record section 220 of program B, this assignment is executed after being described as instruction execution information.

このようにグローバル変数GAの値の書き換えを経て、プログラムBのローカル変数LBの値をプログラムAのローカル変数LAの値と同じにすることができる。つまり、異なるプログラム間でローカル変数の値を共通化することができる。なお、図6に示す処理は、コントローラ20のCPU21上でプログラムA及びプログラムBをそれぞれ実行して行われる。 By rewriting the value of the global variable GA in this manner, the value of the local variable LB of the program B can be made the same as the value of the local variable LA of the program A. In other words, the values of local variables can be shared between different programs. The processing shown in FIG. 6 is performed by executing programs A and B on the CPU 21 of the controller 20, respectively.

しかし、図6に示す処理は、CPU21の負荷が高くなるとともに時間を要する。また、数値を代入可能なグローバル変数が存在しない場合は、新たなグローバル変数を定義する必要がある。いずれの場合も、ロボット制御システム110の利用者にとっては不便であった。また、グローバル変数を介することで、異なるプログラム間で変数の指定間違いが起こるおそれがあった。 However, the processing shown in FIG. 6 increases the load on the CPU 21 and takes time. Also, if there is no global variable to which a numerical value can be assigned, a new global variable must be defined. In either case, it was inconvenient for the user of the robot control system 110 . In addition, by using global variables, there is a risk of misdesignation of variables between different programs.

そこで、図3に示すように、プログラム200に変数テーブル部230を設けるようにする。さらに、図4に示すように、プログラムAにおけるローカル変数LAの値をプログラムBにおけるローカル変数LBに直接代入する。つまり、記憶領域24に保存されたグローバル変数GAに関しては何らの操作を必要としない。なお、図4に示す処理は、コントローラ20のCPU21上でプログラムAを実行して行われる。また、この場合、ローカル変数LAの型及び種類、つまり変数情報とローカル変数LBの変数情報とは一致している必要がある。 Therefore, as shown in FIG. 3, the program 200 is provided with a variable table section 230. FIG. Furthermore, as shown in FIG. 4, the value of local variable LA in program A is directly assigned to local variable LB in program B. In other words, no manipulation is required for the global variable GA saved in the storage area 24 . The processing shown in FIG. 4 is performed by executing the program A on the CPU 21 of the controller 20. FIG. Also, in this case, the type and type of the local variable LA, that is, the variable information and the variable information of the local variable LB must match.

なお、図4に示す処理は、実際には図5に示す手順に則って行われる。また、前述したように、図5に示すフローチャートの各ステップは、コントローラ20のCPU21により実行される。 Note that the processing shown in FIG. 4 is actually performed according to the procedure shown in FIG. Moreover, as described above, each step of the flowchart shown in FIG. 5 is executed by the CPU 21 of the controller 20 .

まず、プログラムAを起動して、所定の命令を実行させる(ステップS1)。ここで、命令の具体的な内容は、「プログラムAにおけるローカル変数LAの値をプログラムBにおけるローカル変数LBに直接代入」することである。 First, program A is started to execute a predetermined command (step S1). Here, the specific content of the instruction is to "directly assign the value of local variable LA in program A to local variable LB in program B".

次に、プログラム保存領域25にプログラムBが存在するか否かが判断される(ステップS2)。ステップS2の判断結果が否定的、すなわち、プログラム保存領域25にプログラムBが存在しなければ、コントローラ20は作業者またはロボット制御システム110の操作者に対して、エラーを通知し、ロボット制御システム110を一旦停止させる(ステップS3)。 Next, it is determined whether or not the program B exists in the program storage area 25 (step S2). If the determination result in step S2 is negative, that is, if the program B does not exist in the program storage area 25, the controller 20 notifies the worker or the operator of the robot control system 110 of an error, and the robot control system 110 is once stopped (step S3).

なお、本願明細書において、ロボットシステムの異常として、「エラー」と「ワーニング」と「アラーム」とが設定されている。エラーとは、ロボット制御システム110を一旦停止させる必要がある程度の異常を言う。ワーニングは、ロボット制御システム110を停止させるまでには至らない警告である。したがって、ワーニングは、作業者にコントローラ20または機器が正常時と異なる状態であることを注意喚起するために報知されるにとどまる。 In the specification of the present application, "error", "warning" and "alarm" are set as abnormalities of the robot system. An error refers to a certain degree of abnormality that requires the robot control system 110 to be temporarily stopped. Warnings are warnings that do not stop the robot control system 110 . Therefore, the warning is only issued to alert the operator that the controller 20 or the device is in a different state than normal.

一方、アラームは、ロボット制御システム110全体を停止させる必要がある異常を言う。よって、アラームが発生した場合、コントローラ20や各機器に電力を供給する電源がシャットダウンされる。また、シャットダウン後は、作業者が再起動するまでロボット制御システム110、ひいてはロボットシステム100は動作しない。 Alarms, on the other hand, refer to abnormalities that require the entire robot control system 110 to stop. Therefore, when an alarm occurs, the power supply that supplies power to the controller 20 and each device is shut down. Further, after shutdown, the robot control system 110 and, in turn, the robot system 100 do not operate until the operator restarts.

ステップS2の判断結果が肯定的、すなわち、プログラム保存領域25にプログラムBが存在していれば、次に、コントローラ20は、プログラムAにローカル変数LAが定義され存在しているか否かを判断する(ステップS4)。ステップS4の判断結果が否定的、すなわち、プログラムAにローカル変数LAが存在しなければ、ステップS3と同様に、コントローラ20はエラーを通知し、ロボット制御システム110を一旦停止させる(ステップS5)。 If the determination result in step S2 is affirmative, that is, if program B exists in program storage area 25, then controller 20 determines whether local variable LA is defined and exists in program A. (Step S4). If the determination result in step S4 is negative, that is, if the local variable LA does not exist in program A, the controller 20 notifies an error and temporarily stops the robot control system 110 (step S5), as in step S3.

ステップS4の判断結果が肯定的、すなわち、プログラムAにローカル変数LAが存在していれば、次に、コントローラ20は、プログラムBにローカル変数LBが定義され存在しているか否かを判断する(ステップS6)。ステップS6の判断結果が否定的、すなわち、プログラムBにローカル変数LBが存在しなければ、ステップS3と同様に、コントローラ20はエラーを通知し、ロボット制御システム110を一旦停止させる(ステップS7)。 If the determination result in step S4 is affirmative, that is, if the local variable LA exists in the program A, then the controller 20 determines whether the local variable LB is defined and exists in the program B ( step S6). If the determination result in step S6 is negative, that is, if the local variable LB does not exist in program B, the controller 20 notifies an error and temporarily stops the robot control system 110 as in step S3 (step S7).

ステップS6の判断結果が肯定的、すなわち、プログラムBにローカル変数LBが存在していれば、コントローラ20は、プログラムAにおけるローカル変数LAの値をプログラムBにおけるローカル変数LBに直接代入し(ステップS8)、一連の処理が完了する。なお、ステップS8の終了後、ローカル変数LBに代入された値は、そのまま保持される。 If the determination result in step S6 is affirmative, that is, if the local variable LB exists in the program B, the controller 20 directly assigns the value of the local variable LA in the program A to the local variable LB in the program B (step S8 ), a series of processing is completed. After step S8 is completed, the value assigned to the local variable LB is held as it is.

なお、外部機器60としてPCが接続されている場合、PCからプログラムAに対し、ステップS1に示す命令を書き込んで実行してもよい。PCからの入力内容は、コントローラ20のCPU21を介して実行される。 When a PC is connected as the external device 60, the command shown in step S1 may be written from the PC to the program A and executed. Input contents from the PC are executed via the CPU 21 of the controller 20 .

また、図5に示すように、プログラムBの存在や、プログラムAにおけるローカル変数LAの存在や、プログラムBにおけるローカル変数LBの存在を順次確認しながら処理を進めている。このようにすることで、プログラムAからプログラムBへローカル変数の値を確実に受け渡すことができる。このため、ローカル変数LBの値が書き換えられた後のプログラムBが誤動作して、ロボット制御システム110やロボットシステム100に、エラーやアラームを発生させることが無い。つまり、プログラムBの書き換え後も、安全にロボットシステム100やロボット制御システム110を動作させることができる。 Further, as shown in FIG. 5, the existence of the program B, the existence of the local variable LA in the program A, and the existence of the local variable LB in the program B are sequentially confirmed while proceeding with the processing. By doing so, the value of the local variable can be reliably transferred from program A to program B. Therefore, the program B after the value of the local variable LB has been rewritten will not malfunction and cause an error or an alarm in the robot control system 110 or the robot system 100 . In other words, the robot system 100 and the robot control system 110 can be safely operated even after the program B is rewritten.

なお、本実施形態では、プログラムAにおけるローカル変数LAの値をプログラムBにおけるローカル変数LBに直接代入する例を示したが、その逆の処理を行うことも可能である。つまり、コントローラ20、具体的には、CPU21は、プログラムBにおけるローカル変数LBの値をプログラムAにおけるローカル変数LAに直接代入可能に構成されていてもよい。 In this embodiment, an example of directly assigning the value of the local variable LA in the program A to the local variable LB in the program B is shown, but the reverse process is also possible. That is, the controller 20, specifically the CPU 21, may be configured to be able to directly substitute the value of the local variable LB in the program B into the local variable LA in the program A.

[効果等]
以上説明したように、本実施形態に係るコントローラ20は、ロボット制御システム110に備わっている。
[Effects, etc.]
As described above, the controller 20 according to this embodiment is provided in the robot control system 110 .

コントローラ20には、複数の機器が接続されている。また、コントローラ20のプログラム保存領域25には、複数の機器との間でデータまたは命令の受け渡しを行うための複数のプログラム200が保存されている。なお、コントローラ20に接続される機器は1台であってもよい。 A plurality of devices are connected to the controller 20 . A program storage area 25 of the controller 20 stores a plurality of programs 200 for exchanging data or commands with a plurality of devices. Note that the number of devices connected to the controller 20 may be one.

複数のプログラム200には、ローカル変数LAを参照して所定の関数を実行するプログラムA(第1プログラム)とローカル変数LBを参照して所定の関数を実行するプログラムB(第2プログラム)とが少なくとも含まれる。 The plurality of programs 200 includes a program A (first program) that references a local variable LA and executes a predetermined function, and a program B (second program) that references a local variable LB and executes a predetermined function. included at least.

コントローラ20は、プログラムAに保持されたローカル変数LAの値をプログラムBに保持されたローカル変数LBに直接代入可能に構成されている。また、コントローラ20は、プログラムBに保持されたローカル変数LBの値をプログラムAに保持されたローカル変数LAに直接代入可能に構成されている。 The controller 20 is configured to be able to directly substitute the value of the local variable LA held in the program A into the local variable LB held in the program B. Also, the controller 20 is configured to be able to directly substitute the value of the local variable LB held in the program B into the local variable LA held in the program A.

本実施形態によれば、コントローラ20の記憶領域24に保存されたグローバル変数GAを経由すること無く、プログラムAで使用されるローカル変数LAの値をプログラムBで使用されるローカル変数LBに直接受け渡すことができる。つまり、それぞれ異なるプログラム200で定義されたローカル変数LAの値とローカル変数LBの値とを共通化できる。このことにより、プログラム200の編集管理作業を高速化できる。また、ロボット制御システム110の作業者にとっての利便性が向上する。 According to this embodiment, the value of the local variable LA used in program A is directly received by the local variable LB used in program B without going through the global variable GA saved in the storage area 24 of the controller 20. can pass. That is, the values of local variables LA and LB defined by different programs 200 can be shared. This makes it possible to speed up the editing management work of the program 200 . Also, the convenience of the robot control system 110 for the operator is improved.

また、本実施形態によれば、ローカル変数LBの値の書き換え作業用のバッファメモリを確保する必要も無く、コントローラ20への負荷を軽減できる。 Further, according to this embodiment, there is no need to secure a buffer memory for rewriting the value of the local variable LB, and the load on the controller 20 can be reduced.

また、グローバル変数GAを経由しないため、ロボット制御システム110で使用される他のプログラム200への影響も最小限にできる。つまり、安全にロボット制御システム110やロボットシステム100を動作させることができる。また、ロボット制御システム110及びロボットシステム100のダウンタイムを削減できる。 Moreover, since the global variable GA is not passed, the influence on other programs 200 used in the robot control system 110 can be minimized. That is, the robot control system 110 and the robot system 100 can be operated safely. Also, downtime of the robot control system 110 and the robot system 100 can be reduced.

なお、ロボット制御システム110で使用されるプログラム200をプログラムAからプログラムBに切り替える場合も、切り替えるタイミングで、ローカル変数LBの値を書き換えることが可能である。プログラムAとプログラムBとが同時に実行される場合も、実行前のタイミングで、ローカル変数LBの値を書き換えることが可能である。 When the program 200 used in the robot control system 110 is switched from the program A to the program B, the value of the local variable LB can be rewritten at the switching timing. Even when program A and program B are executed at the same time, it is possible to rewrite the value of local variable LB at the timing before execution.

ローカル変数LAの値をローカル変数LBに代入するにあたっては、プログラムAに保持されたローカル変数LAの変数情報と、プログラムBに保持されたローカル変数LBの変数情報と、が一致していることが必要となる。 When assigning the value of the local variable LA to the local variable LB, the variable information of the local variable LA held in program A and the variable information of the local variable LB held in program B must match. necessary.

本実施形態に係るプログラム200は、変数テーブル部230を少なくとも含んだファイル構造を有している。 The program 200 according to this embodiment has a file structure including at least the variable table section 230 .

変数テーブル部230は、プログラム200に記述された関数の内部で定義されるローカル変数を少なくとも1つ含んでいる。 The variable table section 230 contains at least one local variable defined inside the function described in the program 200 .

ローカル変数は、変数名と変数情報とが互いに関連付けられた形式で変数テーブル部230に保存されている。 Local variables are stored in the variable table section 230 in a format in which variable names and variable information are associated with each other.

変数情報には、少なくともローカル変数の型情報が含まれている。 The variable information includes at least type information of local variables.

プログラム200のファイル構造をこのように規定することで、異なるプログラム200の間でローカル変数の値を直接受け渡して、それぞれの値を共通化できる。このことにより、プログラム200の編集管理作業を高速化できる。また、ロボット制御システム110の作業者にとっての利便性が向上する。 By defining the file structure of the program 200 in this way, the values of local variables can be directly passed between different programs 200, and the respective values can be shared. This makes it possible to speed up the editing management work of the program 200 . Also, the convenience of the robot control system 110 for the operator is improved.

(実施形態2)
図7Aは、本実施形態に係る第1プログラムの変数テーブル部の概要を示し、図7Bは、第2プログラムの変数テーブル部の概要を示す。図8は、プログラム間でのローカル変数の値の受け渡し手順のフローチャートを示す。
(Embodiment 2)
FIG. 7A shows an overview of the variable table portion of the first program according to this embodiment, and FIG. 7B shows an overview of the variable table portion of the second program. FIG. 8 shows a flow chart of a procedure for passing values of local variables between programs.

前述したように、変数テーブル部230に保持されるローカル変数は、通常、複数個存在する。これらを管理するにあたって、図7A,7Bに示すように、予め、他のプログラムとの間で共用される可能性のある複数のローカル変数をテーブル形式で変数テーブル部230に保持するのが好ましい場合がある。ここで言うテーブル形式とは、複数のローカル変数が1つのテーブル(以下、変数テーブルとも言う)にまとめられた形で変数テーブル部230に保存されていることを言う。 As described above, there are usually a plurality of local variables held in the variable table section 230 . In managing these, as shown in FIGS. 7A and 7B, when it is preferable to hold in advance a plurality of local variables that may be shared with other programs in the form of a table in the variable table section 230. There is The table format referred to here means that a plurality of local variables are stored in the variable table section 230 in the form of a single table (hereinafter also referred to as a variable table).

例えば、図7Aに示すように、親プログラム(第1プログラム)の変数テーブル部230に含まれる変数テーブル(Table01~03)には、それぞれ3つのローカル変数が保持されている。同様に、図7Bに示すように、子プログラム(第2プログラム)の変数テーブル部230に含まれる変数テーブル(Table01~03)にも、それぞれ3つのローカル変数が保持されている。なお、各テーブルに保持されるローカル変数の数は、特に限定されない。ただし、データの受け渡し対象となるテーブル間では、ローカル変数の数は同じであることが好ましい。 For example, as shown in FIG. 7A, each variable table (Table01 to Table03) included in the variable table section 230 of the parent program (first program) holds three local variables. Similarly, as shown in FIG. 7B, the variable tables (Table01 to Table03) included in the variable table section 230 of the child program (second program) also hold three local variables. Note that the number of local variables held in each table is not particularly limited. However, it is preferable that the number of local variables be the same between tables to which data is to be transferred.

また、各テーブルにおいて、ローカル変数に通し番号(以下、単に番号と言う)が付与されている。複数のプログラム200の間で、同じ番号が付与されたローカル変数は、その種類やローカル変数の型や種類が共通であることが好ましい。このようにすることで、異なるプログラム200の間で複数のローカル変数の値を一括して受け渡すことができる。以下、さらに説明する。 Also, in each table, serial numbers (hereinafter simply referred to as numbers) are assigned to local variables. It is preferable that the local variables assigned the same numbers among the plurality of programs 200 have the same types and the types and types of the local variables in common. By doing so, the values of a plurality of local variables can be collectively transferred between different programs 200 . Further explanation is given below.

1つのプログラム200を修正して新たに保存する場合や1つのプログラム200をベースにして複数の異なるプログラム200を作成する場合、多くのローカル変数が共通していることが多い。また、これ以外にも、複数のローカル変数の値を異なるプログラム200の間で共通して使用したい場合もある。 When one program 200 is modified and newly saved, or when a plurality of different programs 200 are created based on one program 200, many local variables are often common. In addition to this, there are cases where it is desired to commonly use the values of a plurality of local variables among different programs 200 .

しかし、通常は、図4,5に示すように、ローカル変数の型や種類、つまり、変数情報が一致した場合のみ、異なるプログラム200の間でローカル変数の値の受け渡しが可能となるのが好ましい。変数情報が異なるローカル変数を受け取った側のプログラム200が正しく動作しないからである。 However, normally, as shown in FIGS. 4 and 5, it is preferable that the values of local variables can be transferred between different programs 200 only when the types and types of the local variables, that is, the variable information match. . This is because the program 200 that receives local variables with different variable information does not operate correctly.

したがって、複数のローカル変数の値を受け渡す場合、対象となるローカル変数毎に変数情報の一致を確認する必要がある。受け渡し対象となるローカル変数の数が増えてくると、この作業は手間がかかり、時間を要することがある。 Therefore, when passing the values of a plurality of local variables, it is necessary to confirm the matching of variable information for each target local variable. As the number of local variables to be passed increases, this task can become cumbersome and time consuming.

一方、本実施形態によれば、複数のローカル変数をテーブル形式で変数テーブルにまとめ、変数テーブル部230に保存しておくことで、複数のローカル変数の値を一括で受け渡せる。図8を用いてさらに説明する。なお、図8に示すフローは、親プログラムから子プログラムへの変数テーブル、さらに言うとローカル変数の値の受け渡しに関する。ただし、子プログラムから親プログラムへの変数テーブル(ローカル変数の値)の受け渡しも同様のフローに則って処理されることは言うまでもない。 On the other hand, according to the present embodiment, a plurality of local variables are grouped into a variable table in a table format and stored in the variable table unit 230, so that the values of the plurality of local variables can be delivered collectively. Further description will be made with reference to FIG. Note that the flow shown in FIG. 8 relates to the transfer of the variable table from the parent program to the child program, more specifically, the value of the local variable. However, it goes without saying that the delivery of the variable table (values of local variables) from the child program to the parent program is also processed according to the same flow.

図8に示すステップS11~S13は、図5に示すステップS1~S3と同様であるため、説明を省略する。 Steps S11 to S13 shown in FIG. 8 are the same as steps S1 to S3 shown in FIG. 5, so description thereof will be omitted.

ステップS14では、自身の変数テーブル、この場合は、親プログラムの変数テーブルが正常であるか否かを判断する。ステップS14の判断は、コントローラ20のCPU21で実行される。 In step S14, it is determined whether or not its own variable table, in this case, the variable table of the parent program is normal. The determination of step S<b>14 is executed by the CPU 21 of the controller 20 .

ステップS14での判断結果が肯定的な場合は、ステップS16に進む。一方、ステップS14での判断結果が否定的な場合は、コントローラ20はエラーを通知し、ロボット制御システム110を一旦停止させる(ステップS15)。なお、ステップS14での判断は、対象となる変数テーブルにローカル変数が含まれているか否か、また、ローカル変数の変数情報がテーブルの番号に対応しているか否か等で判断される。いずれかが否の場合に否定的と判断される。 If the determination result in step S14 is affirmative, the process proceeds to step S16. On the other hand, if the determination result in step S14 is negative, the controller 20 notifies an error and temporarily stops the robot control system 110 (step S15). The determination in step S14 is based on whether or not the target variable table contains a local variable, and whether or not the variable information of the local variable corresponds to the table number. It is judged to be negative when either is negative.

ステップS16では、相手先の変数テーブル、この場合は、子プログラムの変数テーブルが正常であるか否かを判断する。ステップS16の判断も、コントローラ20のCPU21で実行される。 In step S16, it is determined whether or not the variable table of the other party, in this case, the variable table of the child program is normal. The determination of step S16 is also executed by the CPU 21 of the controller 20. FIG.

ステップS16での判断結果が肯定的な場合は、ステップS18に進む。一方、ステップS16での判断結果が否定的な場合は、コントローラ20はエラーを通知し、ロボット制御システム110を一旦停止させる(ステップS17)。なお、ステップS16の判断基準もステップS14の判断基準と同様である。 If the determination result in step S16 is affirmative, the process proceeds to step S18. On the other hand, if the determination result in step S16 is negative, the controller 20 notifies an error and temporarily stops the robot control system 110 (step S17). The criteria for determination in step S16 are the same as the criteria for determination in step S14.

ステップS18では、コントローラ20は、親プログラムにおけるテーブルの値を子プログラムにおけるテーブルに直接代入し、一連の処理が完了する。 At step S18, the controller 20 directly substitutes the values of the table in the parent program into the table in the child program, completing a series of processes.

例えば、図7Aに示す変数テーブル(Table02)を、図7Bに示す変数テーブル(Table01)に代入する場合、以下の処理が一括して行われる。Table02に保持されたローカル変数LR:011の値が、Table01のローカル変数LL:001に代入される。同時に、Table02に保持されたローカル変数LR:012の値が、Table01のローカル変数LL:002に代入される。同様に、Table02に保持されたローカル変数LR:013の値が、Table01のローカル変数LL:003に代入される。 For example, when substituting the variable table (Table02) shown in FIG. 7A into the variable table (Table01) shown in FIG. 7B, the following processing is collectively performed. The value of the local variable LR:011 held in Table02 is assigned to the local variable LL:001 of Table01. At the same time, the value of the local variable LR:012 held in Table02 is assigned to the local variable LL:002 of Table01. Similarly, the value of the local variable LR:013 held in Table02 is assigned to the local variable LL:003 of Table01.

一方、子プログラムから親プログラムへローカル変数の値を受け渡す場合は、例えば、以下のように行われる。図7Bに示す変数テーブル(Table02)を、図7Aに示す変数テーブル(Table03)に一括して直接代入する。Table02に保持されたローカル変数LL:004の値が、Table03のローカル変数LL:021に代入される。同時に、Table02に保持されたローカル変数LL:005の値が、Table03のローカル変数LL:022に代入される。同様に、Table02に保持されたローカル変数LL:006の値が、Table03のローカル変数LL:023に代入される。 On the other hand, passing the value of a local variable from a child program to a parent program is performed as follows, for example. The variable table (Table02) shown in FIG. 7B is collectively directly substituted into the variable table (Table03) shown in FIG. 7A. The value of the local variable LL:004 held in Table02 is assigned to the local variable LL:021 of Table03. At the same time, the value of the local variable LL:005 held in Table02 is assigned to the local variable LL:022 of Table03. Similarly, the value of the local variable LL:006 held in Table02 is assigned to the local variable LL:023 of Table03.

なお、ステップS18の終了後、変数テーブルに代入されたローカル変数のそれぞれの値は、そのまま保持される。また、外部機器60としてPCが接続されている場合、PCから親プログラムに対し、ステップS11に示す命令を書き込んで実行してもよい。PCからの入力内容は、コントローラ20のCPU21を介して実行される。 After step S18 is completed, each value of the local variables assigned to the variable table is held as it is. Further, when a PC is connected as the external device 60, the PC may write the command shown in step S11 to the parent program and execute it. Input contents from the PC are executed via the CPU 21 of the controller 20 .

以上説明したように、本実施形態では、親プログラム(第1プログラム)及び子プログラム(第2プログラム)は、複数のローカル変数がテーブル形式で保持された変数テーブルをそれぞれ有している。 As described above, in this embodiment, the parent program (first program) and child program (second program) each have a variable table in which a plurality of local variables are held in a table format.

コントローラ20は、親プログラムに保持された変数テーブルに含まれる複数のローカル変数の値を、子プログラムに保持された変数テーブルに含まれる複数のローカル変数に直接代入可能に構成されている。また、コントローラ20は、子プログラムに保持された変数テーブルに含まれる複数のローカル変数の値を、親プログラムに保持された変数テーブルに含まれる複数のローカル変数に直接代入可能に構成されている。 The controller 20 is configured to be able to directly substitute the values of multiple local variables contained in the variable table held in the parent program into multiple local variables contained in the variable table held in the child program. Also, the controller 20 is configured to be able to directly substitute values of multiple local variables included in the variable table held in the child program into multiple local variables included in the variable table held in the parent program.

このようにすることで、親プログラムから子プログラムへ、あるいは子プログラムから親プログラムへ所定の変数テーブル毎でローカル変数の値を確実に受け渡すことができる。このことにより、複数個、複数種類のローカル変数の値を異なるプログラム200の間で一括して受け渡せるため、ローカル変数の値の受け渡しに関する処理速度及びプログラム200の編集管理作業をさらに高速化できる。また、作業者にとっての利便性が向上する。 By doing so, it is possible to reliably transfer the values of the local variables from the parent program to the child program or from the child program to the parent program for each predetermined variable table. As a result, the values of a plurality of types of local variables can be transferred collectively between different programs 200, so that the processing speed for transferring the values of the local variables and the editing management work of the programs 200 can be further accelerated. In addition, convenience for workers is improved.

親プログラムの変数テーブル(ローカル変数の値)を子プログラムの変数テーブル(ローカル変数の値)に代入するにあたっては、それぞれの変数テーブルに含まれる複数のローカル変数の変数情報が互いに一致していることが好ましい。また、このことを簡便に整理するために、親プログラム及び子プログラムのそれぞれにおいて、変数テーブル部230は、複数のローカル変数が所定の順番で配列された変数テーブルを少なくとも1つ有しているのが好ましい。 When assigning the parent program's variable table (local variable values) to the child program's variable table (local variable values), the variable information of multiple local variables contained in each variable table must match each other. is preferred. In addition, in order to easily organize this, in each of the parent program and the child program, the variable table section 230 has at least one variable table in which a plurality of local variables are arranged in a predetermined order. is preferred.

受け渡し対象となる変数テーブル間で、それぞれに含まれるローカル変数の変数情報を予め共通にしておくことで、変数テーブル毎にローカル変数の値を受け渡すことが容易となる。また、例えば、ローカル変数の型等にとらわれず、受け渡し対象となるローカル変数を自由に選択できる。 By sharing the variable information of the local variables included in each of the variable tables to be transferred in advance, it becomes easy to transfer the values of the local variables for each variable table. Also, for example, the local variables to be passed can be freely selected regardless of the type of the local variables.

また、ローカル変数の値を書き換えられたプログラム200が誤動作して、ロボット制御システム110やロボットシステム100に、エラーやアラームを発生させることが無い。つまり、プログラム200の書き換え後も、安全にロボットシステム100やロボット制御システム110を動作させることができる。また、ロボット制御システム110及びロボットシステム100のダウンタイムを削減できる。 Also, the program 200 in which the values of the local variables have been rewritten will not malfunction, causing the robot control system 110 or the robot system 100 to generate an error or alarm. That is, even after rewriting the program 200, the robot system 100 and the robot control system 110 can be operated safely. Also, downtime of the robot control system 110 and the robot system 100 can be reduced.

なお、本開示のコントローラ20やプログラム200のファイル構造、またローカル変数の値や変数テーブルの受け渡し方法は、ロボットシステム100やロボット制御システム110への適用に特に限定されない。コントローラ20に複数の機器が接続されて使用される別の制御システムにおいて適用されてもよい。その場合、当該別の制御システムにおいて、複数のプログラム200が使用されることは言うまでもない。 Note that the file structure of the controller 20 and the program 200 of the present disclosure, and the method of transferring the values of local variables and the variable table are not particularly limited to application to the robot system 100 and the robot control system 110 . It may be applied in another control system in which a plurality of devices are connected to the controller 20 and used. In that case, it goes without saying that a plurality of programs 200 are used in the separate control system.

本開示のコントローラは、異なるプログラムの間でローカル変数の値を簡便に受け渡すことができるため、有用である。 The controller of the present disclosure is useful because it allows convenient passing of values of local variables between different programs.

10 ロボット
11 ロボットアーム
12 サーボモータ
13 トーチ
20 コントローラ
21 CPU(情報処理部)
24 記憶領域
25 プログラム保存領域
30 ティーチングペンダント
40 溶接制御部
50 電源
60 外部機器
70 サーバー
80 外部ロボット
90 外部軸
100 ロボットシステム
110 ロボット制御システム
10 robot 11 robot arm 12 servo motor 13 torch 20 controller 21 CPU (information processing unit)
24 storage area 25 program storage area 30 teaching pendant 40 welding control unit 50 power supply 60 external device 70 server 80 external robot 90 external axis 100 robot system 110 robot control system

Claims (8)

制御システムが備えるコントローラであって、
前記コントローラには、1または複数の機器が接続されるとともに、前記1または複数の機器との間でデータまたは命令の受け渡しを行うための複数のプログラムが保存されており、
複数の前記プログラムには、ローカル変数を参照して所定の関数を実行する第1プログラム及び第2プログラムが少なくとも含まれ、
前記コントローラは、前記第1プログラムに保持されたローカル変数の値を前記第2プログラムに保持されたローカル変数に直接代入可能に、または、前記第2プログラムに保持されたローカル変数の値を前記第1プログラムに保持されたローカル変数に直接代入可能に構成されていることを特徴とするコントローラ。
A controller included in a control system,
The controller is connected to one or more devices and stores a plurality of programs for exchanging data or instructions with the one or more devices,
the plurality of programs include at least a first program and a second program that refer to local variables and execute a predetermined function;
The controller directly assigns the value of the local variable held in the first program to the local variable held in the second program, or assigns the value of the local variable held in the second program to the A controller characterized in that it is configured so that it can be directly assigned to a local variable held in one program.
請求項1に記載のコントローラにおいて、
前記第1プログラムに保持された前記ローカル変数の変数情報と、前記第2プログラムに保持された前記ローカル変数の変数情報と、が一致している場合に、
前記コントローラは、前記第1プログラムに保持された前記ローカル変数の値を前記第2プログラムに保持された前記ローカル変数に直接代入可能に、または、前記第2プログラムに保持された前記ローカル変数の値を前記第1プログラムに保持された前記ローカル変数に直接代入可能に構成されていることを特徴とするコントローラ。
2. The controller of claim 1, wherein
when the variable information of the local variables held in the first program matches the variable information of the local variables held in the second program,
The controller directly assigns the value of the local variable held in the first program to the local variable held in the second program, or the value of the local variable held in the second program. can be directly substituted into the local variable held in the first program.
請求項1に記載のコントローラにおいて、
前記第1プログラム及び前記第2プログラムは、複数の前記ローカル変数がテーブル形式で保持された変数テーブルをそれぞれ有しており、
前記コントローラは、前記第1プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の値を、前記第2プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数に直接代入可能に、または、前記第2プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の値を、前記第1プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数に直接代入可能に構成されていることを特徴とするコントローラ。
2. The controller of claim 1, wherein
The first program and the second program each have a variable table in which a plurality of the local variables are held in a table format,
The controller can directly substitute the values of the plurality of local variables included in the variable table held in the first program into the plurality of local variables included in the variable table held in the second program. Alternatively, the values of the plurality of local variables contained in the variable table held in the second program can be directly substituted into the plurality of local variables contained in the variable table held in the first program. A controller characterized by comprising:
請求項3に記載のコントローラにおいて、
前記第1プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の変数情報と、前記第2プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の変数情報と、がそれぞれ一致している場合に、
前記コントローラは、前記第1プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の値を、前記第2プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数に直接代入可能に、または、前記第2プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数の値を、前記第1プログラムに保持された前記変数テーブルに含まれる複数の前記ローカル変数に直接代入可能に構成されていることを特徴とするコントローラ。
4. The controller of claim 3, wherein
The variable information of the plurality of local variables contained in the variable table held in the first program and the variable information of the plurality of local variables contained in the variable table held in the second program, respectively. if they match
The controller can directly substitute the values of the plurality of local variables included in the variable table held in the first program into the plurality of local variables included in the variable table held in the second program. Alternatively, the values of the plurality of local variables contained in the variable table held in the second program can be directly substituted into the plurality of local variables contained in the variable table held in the first program. A controller characterized by comprising:
コントローラに1または複数の機器が接続された制御システムで実行されるプログラムのファイル構造であって、
前記プログラムは、変数テーブル部を含んでおり、
前記変数テーブル部は、前記プログラムに記述された関数の内部で定義されるローカル変数を少なくとも1つ含んでおり、
前記ローカル変数は、変数名と変数情報とが互いに関連付けられた形式で前記変数テーブル部に保存されており、
前記変数情報には、少なくとも前記ローカル変数の型情報が含まれることを特徴とするプログラムのファイル構造。
A file structure of a program executed in a control system in which one or more devices are connected to a controller,
The program includes a variable table section,
the variable table section includes at least one local variable defined inside a function described in the program;
the local variables are stored in the variable table section in a form in which variable names and variable information are associated with each other;
A file structure of a program, wherein the variable information includes at least type information of the local variables.
請求項5に記載のファイル構造において、
前記変数テーブル部は、複数の前記ローカル変数が所定の順番で配列された変数テーブルを少なくとも1つ有していることを特徴とするファイル構造。
The file structure of claim 5, wherein
A file structure, wherein the variable table section has at least one variable table in which the plurality of local variables are arranged in a predetermined order.
請求項6に記載のファイル構造において、
前記制御システムで使用される前記プログラムが複数存在する場合、複数の前記プログラムのそれぞれに含まれる前記変数テーブルでは、同じ順番に配列された前記ローカル変数の前記変数情報が互いに一致していることを特徴とするファイル構造。
The file structure of claim 6, wherein
When there are a plurality of the programs used in the control system, the variable information of the local variables arranged in the same order must match each other in the variable table included in each of the plurality of programs. Characterized file structure.
請求項5ないし7のいずれか1項に記載のファイル構造において、
前記プログラムは、ヘッダ部と命令レコード部とをさらに含んでおり、
前記ヘッダ部は、前記プログラムで使用されるデータや命令の宣言が記述され、
前記命令レコード部は、前記プログラムの実行内容が記述されることを特徴とするファイル構造。
In the file structure according to any one of claims 5 to 7,
The program further includes a header section and an instruction record section,
The header part describes declarations of data and instructions used in the program,
The file structure, wherein the execution contents of the program are described in the instruction record section.
JP2021140871A 2021-08-31 2021-08-31 Controller and file structure of program Pending JP2023034569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021140871A JP2023034569A (en) 2021-08-31 2021-08-31 Controller and file structure of program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021140871A JP2023034569A (en) 2021-08-31 2021-08-31 Controller and file structure of program

Publications (1)

Publication Number Publication Date
JP2023034569A true JP2023034569A (en) 2023-03-13

Family

ID=85504414

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021140871A Pending JP2023034569A (en) 2021-08-31 2021-08-31 Controller and file structure of program

Country Status (1)

Country Link
JP (1) JP2023034569A (en)

Similar Documents

Publication Publication Date Title
CN100408277C (en) Programming device for returning robot to waiting position
US8688258B2 (en) Method of controlling a machine tool
US20200316775A1 (en) Machining control system and machining system
JP2001088071A (en) Control device of robot
JP7022260B1 (en) Numerical control system
US20230286169A1 (en) Numerical control system and robot control method
JP2023034569A (en) Controller and file structure of program
JP2013226602A (en) Industrial machine system
JP2005292949A (en) Industrial robot
US11454952B2 (en) Numerical control apparatus
JP7492006B2 (en) Numerical Control System
WO2022004647A1 (en) Numerical control system
WO2019207679A1 (en) Monitoring assistance device, programmable logic controller, monitoring assistance method, and monitoring assistance program
JPH02213905A (en) Input/output control system
JP2021068180A (en) Optimization processor
WO2022004651A1 (en) Numerical control system
US20230273592A1 (en) Controller
WO2024089884A1 (en) Robot controller and method for comparing control software before and after update
CN117575452B (en) Path planning method, device, equipment and medium based on node dynamic addressing
WO2022208849A1 (en) Robot control device, robot control system, and robot control method
US20230405810A1 (en) Modular robot control architecture
WO2022107817A1 (en) Control device
WO2022097268A1 (en) Tool transport system, control method for tool transport system, and control program for tool transport system
US20230185272A1 (en) Program analyzer and control system
WO2022025049A1 (en) Numerical value control device having function of changing set parameter for controlling control object at certain timing, and method for changing set parameter therefor