JP2014071862A - Peripheral device for programmable controller - Google Patents

Peripheral device for programmable controller Download PDF

Info

Publication number
JP2014071862A
JP2014071862A JP2012220155A JP2012220155A JP2014071862A JP 2014071862 A JP2014071862 A JP 2014071862A JP 2012220155 A JP2012220155 A JP 2012220155A JP 2012220155 A JP2012220155 A JP 2012220155A JP 2014071862 A JP2014071862 A JP 2014071862A
Authority
JP
Japan
Prior art keywords
subprogram
program
processing unit
display
variable
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.)
Granted
Application number
JP2012220155A
Other languages
Japanese (ja)
Other versions
JP6115063B2 (en
Inventor
Terukazu Senda
輝一 千田
Sei Kato
聖 加藤
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.)
JTEKT Corp
Original Assignee
JTEKT Corp
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 JTEKT Corp filed Critical JTEKT Corp
Priority to JP2012220155A priority Critical patent/JP6115063B2/en
Publication of JP2014071862A publication Critical patent/JP2014071862A/en
Application granted granted Critical
Publication of JP6115063B2 publication Critical patent/JP6115063B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a peripheral device for a programmable controller which can easily be standardized as a sub-program in reusing an existing sequence program.SOLUTION: A sequence program edition processing part 400 is provided with: a sequence program display processing part 440; a selection processing part 410 and a copy processing part 420 for selecting and copying a ladder circuit within a designated range; a sub-programming processing part 431 for inputting a sub-program name and putting it into a sub-program format; a sub-program paste processing part 430 for pasting the ladder circuit put into the sub-program format to a sub-program area; a sub-program instruction insertion processing part 433; a sub-program display development processing part 441 for developing the sub-program display between a sub-program call instruction and its next step; a sub-program folding processing part 442 for folding display; and a display switch processing part 443 for switching display development and folding.

Description

本発明は、プログラマブルコントローラの周辺装置に関する。   The present invention relates to a peripheral device for a programmable controller.

生産設備には、設備を構成する機器を制御対象としたプログラマブルコントローラが数多く使用されている。これらのプログラマブルコントローラのシーケンス・プログラムは、周辺装置を用いて、ラダー回路等のプログラミング言語により作成されている。このプログラミングでは、従来デバイスのアドレスにより記述する方式が一般的であったが、近年では変数名を用いて記述し、変数名とデバイスのアドレスとの関連付けを別途おこなう方式も一般化してきている。このような変数を用いたプログラミング(以下、変数プログラミングという)では、シーケンス・プログラムがデバイスに対して、変数名を介してアドレスに依存しない記述となっている。そのため、変数プログラミングでは、制御対象とする機器に応じて変数名とデバイスのアドレスとの関連付けを変更することで、シーケンス・プログラムを再利用することができる。このように、変数プログラミングはデバイスを用いたプログラミングに比べ、再利用に対する柔軟性が高いといえる。   Many programmable controllers that control equipment constituting the equipment are used for production equipment. The sequence program of these programmable controllers is created by a programming language such as a ladder circuit using a peripheral device. In this programming, a method of describing by a conventional device address is generally used. However, in recent years, a method of describing by using a variable name and separately associating the variable name with the device address has been generalized. In programming using such a variable (hereinafter referred to as variable programming), a sequence program is a description that does not depend on an address via a variable name for a device. Therefore, in the variable programming, the sequence program can be reused by changing the association between the variable name and the device address according to the device to be controlled. Thus, variable programming is more flexible for reuse than programming using devices.

例えば、特許文献1では、全く同じ機能を有する複数台のプログラマブルコントローラを、統括的な役割を果たす1台のプログラマブルコントローラが制御するような制御システムを開発する場合において、各プログラマブルコントローラ間で同じ変数名(ラベル名)を用いて変数プログラミングができるプログラマブルコントローラの周辺装置が開示されている。   For example, in Patent Document 1, when developing a control system in which a plurality of programmable controllers having exactly the same function are controlled by a single programmable controller that plays a central role, the same variable is used between the programmable controllers. A peripheral device of a programmable controller capable of variable programming using a name (label name) is disclosed.

特開2007−265252号公報JP 2007-265252 A

しかしながら、既存のシーケンス・プログラムの再利用において、変数名とデバイスのアドレスとの関連付けを変更するだけでは対応できない場合がある。例えば、2台の同じ搬送装置が左右に配置された設備を制御するシーケンス・プログラムの作成において、この搬送装置が1台配置された設備を制御する既存のシーケンス・プログラムを再利用するような場合である。   However, there are cases in which reusing an existing sequence program cannot be performed by simply changing the association between variable names and device addresses. For example, when creating a sequence program for controlling equipment in which two identical transfer devices are arranged on the left and right, the existing sequence program for controlling equipment in which this transfer device is arranged is reused It is.

このような再利用では、上記の搬送装置に関わる制御部分のコピーを2セット作成して、2台分の制御をする方法がある。この方法ではセット間で変数名が重複するので、変数名とデバイスのアドレスとの関連付けを変更する前に、変数名を付け直して重複を解消する必要がある。このプログラム構成は保守性が低いといえる。   In such reuse, there is a method of controlling two units by creating two sets of copies of the control part related to the above-mentioned transport device. In this method, variable names are duplicated between sets. Therefore, before changing the association between the variable name and the device address, it is necessary to reassign the variable name to eliminate the duplication. It can be said that this program configuration has low maintainability.

また、上記の搬送装置に関わる制御部分をサブプログラムにして、このサブプログラムを多重に呼び出すことにより、2台の搬送装置を制御する再利用の方法がある。このプログラム構成は保守性が高いといえる。これには、制御部分をサブプログラムの形式にするだけではなく、サブプログラムの多重呼び出しが可能になるように変更する必要がある。このようにサブプログラムを多重呼び出し可能に変更することを、以下の説明ではサブプログラムの標準化という。   In addition, there is a reusing method for controlling two transport devices by using a control part related to the transport device as a sub-program and calling the sub-program in multiple times. This program configuration is highly maintainable. For this purpose, it is necessary not only to change the control part to the form of a subprogram but also to change the subprogram so that multiple calls can be made. In this way, changing a subprogram so that it can be called multiple times is referred to as standardization of the subprogram.

サブプログラムの標準化による再利用は、使用頻度の高い演算処理をファンクションまたはファンクションブロックとして関数化して再利用するのに比べ、再利用の規模が大きく、利便性の高いものとすることができる。また、プログラム構造として保守性が高いものとすることができる。   Reuse by standardization of subprograms can be performed with a larger scale of reuse and higher convenience compared to reusing functions that are frequently used as functions or function blocks. Also, the program structure can be highly maintainable.

サブプログラムの標準化には、入出力回路の分離、変数の内部デバイス化、実行結果を保持する変数の対応等があり、さらに、メインプログラム側にもサブプログラムの入力要素に値を受け渡す入力回路の作成、サブプログラムからの出力要素の値を受け渡す出力回路の作成等があり、手間がかかるという問題があった。   Subprogram standardization includes separation of input / output circuits, internalization of variables, correspondence of variables that hold execution results, and the input circuit that passes values to subprogram input elements on the main program side as well Creating an output circuit for transferring the value of an output element from a subprogram, and there is a problem that it takes time.

本発明は、上記問題点を解決するためになされたものであって、本発明が解決しようとする課題は、既存のシーケンス・プログラムの再利用において、サブプログラムとして標準化することが容易にできるプログラマブルコントローラの周辺装置を提供することにある。   The present invention has been made to solve the above-described problems, and the problem to be solved by the present invention is a programmable that can be easily standardized as a subprogram in reuse of an existing sequence program. It is to provide a peripheral device of a controller.

請求項1に係わる発明は、機器を制御するためのシーケンス・プログラムを編集するシーケンス・プログラム編集処理部を備えるプログラマブルコントローラの周辺装置において、前記シーケンス・プログラムは、接点およびコイル等の回路要素を含むラダー回路により記述され、メインプログラムとサブプログラム形式からなる複数のサブプログラムとから構成され、前記シーケンス・プログラム編集処理部は、前記シーケンス・プログラムを表示装置に表示するシーケンス・プログラム表示処理部と、前記表示装置に表示された前記シーケンス・プログラムから指定した範囲のラダー回路を選択する選択処理部と、前記選択処理部により選択した範囲のラダー回路をコピーするコピー処理部と、前記コピー処理部によりコピーされたラダー回路にサブプログラム名を入力し、前記サブプログラム形式にするサブプログラム化処理部と、前記サブプログラム形式にされたラダー回路を、前記シーケンス・プログラムのサブプログラム領域に貼り付けるサブプログラム貼り付け処理部と、指定された位置にサブプログラム呼び出し命令を挿入するサブプログラム命令挿入処理部と、前記サブプログラム呼び出し命令とその次ステップとの間に前記サブプログラムの表示を展開するサブプログラム表示展開処理部と、前記サブプログラム呼び出し命令とその次ステップとの間の前記サブプログラムの表示を折り畳むサブプログラム表示折り畳み処理部と、前記サブプログラムの表示の展開と折り畳みとを切り替える表示切替処理部とを備えることを特徴とする。   The invention according to claim 1 is a peripheral device of a programmable controller comprising a sequence program edit processing unit for editing a sequence program for controlling a device, wherein the sequence program includes circuit elements such as contacts and coils. It is described by a ladder circuit and is composed of a main program and a plurality of subprograms having a subprogram format, and the sequence / program edit processing unit includes a sequence / program display processing unit that displays the sequence program on a display device, A selection processing unit that selects a ladder circuit in a range designated from the sequence program displayed on the display device; a copy processing unit that copies a ladder circuit in a range selected by the selection processing unit; and the copy processing unit. The copied ladder A subprogram processing unit that inputs a subprogram name into a circuit and converts the subprogram format into a subprogram format, and a subprogram paste processing unit that pastes a ladder circuit in the subprogram format into a subprogram area of the sequence program A subprogram instruction insertion processing unit that inserts a subprogram call instruction at a specified position, and a subprogram display expansion processing unit that expands the display of the subprogram between the subprogram call instruction and the next step. A subprogram display folding processing unit that folds the display of the subprogram between the subprogram call instruction and the next step, and a display switching processing unit that switches between expansion and folding of the display of the subprogram. Features.

上記のように構成した請求項1の発明によれば、プログラマブルコントローラの周辺装置のシーケンス・プログラム編集処理部は、現在編集中のシーケンス・プログラムとは別の再利用するシーケンス・プログラムを読み出して、シーケンス・プログラム表示処理部により、表示装置に表示することができる。そして、表示装置に表示されたシーケンス・プログラムから、制御対象となる機器に関わり、サブプログラムとして標準化する制御部分の範囲のラダー回路を選択処理部により選択することができる。そして、「コピー」の編集コマンドを実行すると、コピー処理部が呼び出される。コピー処理部は、選択した範囲のラダー回路をバッファメモリ上に一時的にコピーして保持する。次に、現在編集中のシーケンス・プログラムにおいて、上記の制御対象となる機器を制御するステップ位置にて、「サブプログラムとして貼り付け」の編集コマンドを実行すると、サブプログラム化処理部とサブプログラム貼り付け処理部が呼び出される。サブプログラム化処理部は、サブプログラム名の入力を指示し、サブプログラム名が入力されると、サブプログラム命令挿入処理部が呼び出される。サブプログラム命令挿入処理部は、コマンドを実行したステップ位置に、サブプログラム呼び出し命令を挿入する。このサブプログラム呼び出し命令のオペランドには、先に入力したサブプログラム名が設定される。一方、バッファメモリ上のラダー回路は、サブプログラム貼り付け処理部により、サブプログラム領域に貼り付けられ、サブプログラム化処理部により、サブプログラム形式にされる。   According to invention of Claim 1 comprised as mentioned above, the sequence program edit process part of the peripheral device of a programmable controller reads the sequence program to recycle separately from the sequence program currently edited, It can be displayed on the display device by the sequence program display processing unit. Then, from the sequence program displayed on the display device, the selection processing unit can select a ladder circuit in the range of the control part to be standardized as a subprogram related to the device to be controlled. When the “copy” editing command is executed, the copy processing unit is called. The copy processing unit temporarily copies and holds the ladder circuit in the selected range on the buffer memory. Next, when the edit command “Paste as Subprogram” is executed at the step position for controlling the device to be controlled in the sequence program currently being edited, the subprogram processing unit and the subprogram paste The attachment processing unit is called. The subprogram processing unit instructs the input of a subprogram name. When the subprogram name is input, the subprogram instruction insertion processing unit is called. The subprogram instruction insertion processing unit inserts a subprogram call instruction at the step position where the command is executed. The previously entered subprogram name is set in the operand of this subprogram call instruction. On the other hand, the ladder circuit on the buffer memory is pasted to the subprogram area by the subprogram pasting processing unit, and is converted into a subprogram format by the subprogramming processing unit.

シーケンス・プログラム表示処理部は、上記のサブプログラム呼び出し命令を表示するとともに、サブプログラム表示展開処理部により、サブプログラム呼び出し命令とその次ステップとの間にサブプログラムの表示を展開する。この展開されたサブプログラムの表示は、表示切替処理部を呼び出すことにより、サブプログラム表示折り畳み処理部にて、サブプログラムの表示を折り畳むことができる。   The sequence / program display processing unit displays the subprogram call instruction, and the subprogram display expansion processing unit expands the display of the subprogram between the subprogram call instruction and the next step. The display of the expanded subprogram can be folded by the subprogram display folding processing unit by calling the display switching processing unit.

シーケンス・プログラム編集処理部は、サブプログラム表示の展開と折り畳みとに関わらず編集可能であり、サブプログラム表示を展開のまま編集することで、メインプログラムとサブプログラムとが同じ領域で連続したラダー回路であるかのように編集することができる。このようにメインプログラムとサブプログラムとの間の編集をスムーズにおこなうことができるので、サブプログラムを標準化する作業を容易におこなうことができる。   The sequence program edit processing unit can edit regardless of whether the subprogram display is expanded or folded, and by editing the subprogram display while expanding it, a ladder circuit in which the main program and subprogram are continuous in the same area. Can be edited as if Thus, the editing between the main program and the subprogram can be performed smoothly, so that the work of standardizing the subprogram can be easily performed.

請求項2に係わる発明は、請求項1に記載のプログラマブルコントローラの周辺装置であって、前記シーケンス・プログラムは、変数を使用して記述され、前記シーケンス・プログラムに対応して変数の情報を保持する変数情報テーブルと、前記変数情報テーブルの前記変数とデバイスのアドレスとの関連付けをおこなう変数情報テーブル編集処理部を備え、前記サブプログラム化処理部は、前記サブプログラム形式にされたラダー回路に対し、サブプログラム末尾の復帰命令の前ステップに、前記変数の値を内部デバイスに設けられた退避領域に転送する転送命令を挿入し、サブプログラム先頭のラベル命令の後ステップに、前記退避領域から前記変数に値を転送する転送命令を挿入する、サブプログラム変数保持処理部を備え、前記変数情報テーブル編集処理部は、前記サブプログラムにて使用される前記変数に内部デバイスのアドレスを関連付け、前記退避領域のアドレスが前記サブプログラムの呼び出しごとに異なるアドレスとなるようにすることを特徴とする。   The invention according to claim 2 is the peripheral device of the programmable controller according to claim 1, wherein the sequence program is described using a variable and holds variable information corresponding to the sequence program. A variable information table, and a variable information table editing processing unit for associating the variable of the variable information table with a device address, wherein the subprogram processing unit is configured to execute the ladder program in the subprogram format. The transfer instruction for transferring the value of the variable to the save area provided in the internal device is inserted in the step before the return instruction at the end of the subprogram, and the step from the save area to the step after the label instruction at the top of the subprogram is inserted. A subprogram variable holding processing unit for inserting a transfer instruction for transferring a value to the variable; The information table editing processing unit associates an address of an internal device with the variable used in the subprogram so that the address of the save area is different for each invocation of the subprogram. .

上記のように構成した請求項2の発明によれば、プログラマブルコントローラの周辺装置のサブプログラム変数保持処理部は、サブプログラム形式にされたラダー回路に対し、サブプログラムの先頭と末尾に、それぞれ内部デバイスに設けられた退避領域から変数に値を転送する転送命令および変数の値を退避領域に転送する転送命令を挿入している。   According to the invention of claim 2 configured as described above, the subprogram variable holding processing unit of the peripheral device of the programmable controller is internally provided at the beginning and the end of the subprogram with respect to the ladder circuit in the subprogram format. A transfer instruction for transferring a value from the save area provided in the device to the variable and a transfer instruction for transferring the value of the variable to the save area are inserted.

また、変数情報テーブル編集処理部は、サブプログラムにて使用される変数に内部デバイスのアドレスを関連付け、退避領域の内部デバイスのアドレスがサブプログラムの呼び出しごとに異なるアドレスとなるようにしている。このようにしてサブプログラム化されたラダー回路は、変数の前回値を保持することができるので、多重の呼び出しにも対応することができる。   Further, the variable information table editing processing unit associates the address of the internal device with the variable used in the subprogram so that the address of the internal device in the save area becomes a different address for each invocation of the subprogram. Since the ladder circuit subprogrammed in this way can hold the previous value of the variable, it can cope with multiple calls.

本発明によれば、既存のシーケンス・プログラムの再利用において、サブプログラムとして標準化することが容易にできるプログラマブルコントローラの周辺装置を提供することができる。   According to the present invention, it is possible to provide a peripheral device of a programmable controller that can be easily standardized as a subprogram in reuse of an existing sequence program.

本発明の実施形態に係る周辺装置のシステム構成図である。1 is a system configuration diagram of a peripheral device according to an embodiment of the present invention. 本発明の実施形態に係るプログラマブルコントローラの構成図である。It is a block diagram of the programmable controller which concerns on embodiment of this invention. 本発明の実施形態に係る周辺装置のプログラミング・モデルである。3 is a programming model of a peripheral device according to an embodiment of the present invention. 本発明の実施形態に係る周辺装置のシーケンス・プログラム編集処理部のプログラム構成図である。It is a program block diagram of the sequence program edit process part of the peripheral device which concerns on embodiment of this invention. 本発明の実施形態に係る周辺装置のダイアログボックスの画面例である。It is a screen example of the dialog box of the peripheral device according to the embodiment of the present invention. 本発明の実施形態に係る周辺装置のシーケンス・プログラム表示例1である。It is the sequence program display example 1 of the peripheral device which concerns on embodiment of this invention. 本発明の実施形態に係る周辺装置のシーケンス・プログラム表示例2である。It is a sequence program display example 2 of the peripheral device which concerns on embodiment of this invention. 本発明の実施形態に係るシーケンス・プログラムの動作説明図である。It is operation | movement explanatory drawing of the sequence program which concerns on embodiment of this invention. 本発明の実施形態に係る変数情報テーブルの説明図である。It is explanatory drawing of the variable information table which concerns on embodiment of this invention.

プログラマブルコントローラの周辺装置には、専用のハードウェアにより構成されるものや、汎用のパーソナルコンピュータ(以下、PCと記す)で構成されるもの等、種々のタイプが存在する。図1は、本実施形態の周辺装置ソフトウェアをインストールしたPCを周辺装置10として使用した場合のシステム構成図である。
以下、本発明の実施形態のプログラマブルコントローラの周辺装置10のシステム構成を図面に従って説明する。
There are various types of peripheral devices for programmable controllers, such as those composed of dedicated hardware and those composed of general-purpose personal computers (hereinafter referred to as PCs). FIG. 1 is a system configuration diagram when a PC on which peripheral device software of this embodiment is installed is used as the peripheral device 10.
Hereinafter, the system configuration of the peripheral device 10 of the programmable controller according to the embodiment of the present invention will be described with reference to the drawings.

図1に示すように、周辺装置10は、CPU(central processing unit)11のシステム・バス12を介して、システムメモリ28、HDD(hard disk drive)24、通信インターフェース27、キーボード22、マウス23、ディスプレイ21が接続されている。HDD24には、周辺装置ソフトウェア26がインストールされている。   As shown in FIG. 1, the peripheral device 10 includes a system memory 28, a hard disk drive (HDD) 24, a communication interface 27, a keyboard 22, a mouse 23, and the like via a system bus 12 of a CPU (central processing unit) 11. A display 21 is connected. Peripheral device software 26 is installed in the HDD 24.

システムメモリ28は、RAM(random access memory)14及びROM(read only memory)13等から構成される記憶手段である。RAM14は、CPU11によりHDD24から各プログラムを読み出して実行するのに使用される。また、RAM14は、各プログラムの実行に要するデータを一時記憶するデータ領域、各種情報を生成するワークエリアとして使用される。ROM13には、BIOS(basic input/output system)プログラム13aが記憶されており、周辺装置10の起動時において、初期設定をするとともに、HDD24にインストールされているOS(operating system)25の起動をおこなう。通信インターフェース27は、通信ケーブル(図示せず)を介して、プログラマブルコントローラとの通信をおこなう。ディスプレイ21は、出力デバイスであり、周辺装置ソフトウェア26により、シーケンス・プログラムの編集等をおこなう場合の画面表示の出力に使用される。キーボード22およびマウス23は、それぞれ入力デバイスであり、周辺装置ソフトウェア26により、シーケンス・プログラムの編集をおこなう場合等の情報の入力に使用される。HDD24は、ハードディスクにて構成される記憶装置であり、周辺装置ソフトウェア26およびOS25等がインストールされている。   The system memory 28 is a storage means including a RAM (random access memory) 14 and a ROM (read only memory) 13. The RAM 14 is used by the CPU 11 to read out and execute each program from the HDD 24. The RAM 14 is used as a data area for temporarily storing data required for executing each program and a work area for generating various information. The ROM 13 stores a basic input / output system (BIOS) program 13a, which performs initial settings when the peripheral device 10 is activated, and activates an operating system (OS) 25 installed in the HDD 24. . The communication interface 27 communicates with the programmable controller via a communication cable (not shown). The display 21 is an output device, and is used to output a screen display when the peripheral device software 26 edits a sequence program. The keyboard 22 and the mouse 23 are input devices, respectively, and are used for inputting information when the peripheral device software 26 edits a sequence program. The HDD 24 is a storage device composed of a hard disk, and has peripheral device software 26 and an OS 25 installed therein.

周辺装置ソフトウェア26は、シーケンス・プログラム編集プログラム26a、変換プログラム26b、コンパイル処理プログラム26c、変数情報テーブル編集プログラム26d等が含まれている。周辺装置10は、周辺装置ソフトウェア26の各プログラムにより、各機能が実装されている。OS25は、例えば、Windows7(マイクロソフト社の登録商標)等が適用される。   The peripheral device software 26 includes a sequence / program editing program 26a, a conversion program 26b, a compile processing program 26c, a variable information table editing program 26d, and the like. Each function of the peripheral device 10 is implemented by each program of the peripheral device software 26. For example, Windows 7 (registered trademark of Microsoft Corporation) or the like is applied to the OS 25.

シーケンス・プログラム編集プログラム26aは、ラダー回路図の形式のシーケンス・プログラム(ソースコード)14aを編集する。変数情報テーブル編集プログラム26dは、シーケンス・プログラム(ソースコード)14aにて使用する変数情報テーブルを編集する。シーケンス・プログラム(ソースコード)14aは、シーケンス・プログラム(バイナリコード)(図示せず)を読み出し、変換プログラム26bによりに変換したものである。編集後のシーケンス・プログラム(ソースコード)14aは、変情報数テーブル14bとともにコンパイル処理プログラム27bにより、コンパイルされ、変換プログラム26bによりシーケンス・プログラム(バイナリコード)に変換される。   The sequence program editing program 26a edits a sequence program (source code) 14a in the form of a ladder circuit diagram. The variable information table editing program 26d edits the variable information table used in the sequence program (source code) 14a. The sequence program (source code) 14a is obtained by reading a sequence program (binary code) (not shown) and converting it into a conversion program 26b. The edited sequence program (source code) 14a is compiled by the compile processing program 27b together with the variable information number table 14b, and converted to a sequence program (binary code) by the conversion program 26b.

図2は、プログラマブルコントローラ100の構成図である。
CPUユニット110は、CPU111の内部バス112を介して、ROM115、RAM114、プログラムメモリ113、入出力制御回路118、通信インターフェース119が接続されている。通信インターフェース119は、通信ケーブル(図示せず)を介して、周辺装置10との通信をおこなう。周辺装置10により、通信インターフェース119を介して、書き込まれたシーケンス・プログラムおよびパラメータは、プログラムメモリ113に格納される。ROM115には、システムプログラム115aが、RAM114には、内部メモリ114aが記憶されている。システムプログラム115aは、CPUユニット110を制御するとともに、シーケンス・プログラム113aを実行することにより、シーケンス制御をおこなっている。
FIG. 2 is a configuration diagram of the programmable controller 100.
The CPU unit 110 is connected to a ROM 115, a RAM 114, a program memory 113, an input / output control circuit 118, and a communication interface 119 via an internal bus 112 of the CPU 111. The communication interface 119 communicates with the peripheral device 10 via a communication cable (not shown). The sequence program and parameters written by the peripheral device 10 via the communication interface 119 are stored in the program memory 113. The ROM 115 stores a system program 115a, and the RAM 114 stores an internal memory 114a. The system program 115a controls the CPU unit 110 and executes sequence control by executing the sequence program 113a.

図3は、周辺装置10におけるプログラマブルコントローラ100のプログラミング・モデル200である。
シーケンス・プログラム113aは、メインプログラム113bおよびサブプログラム形式からなるサブプログラム113cから構成され、メインプログラム113bが格納されるメインプログラム領域211および複数のサブプログラム113cが格納されるサブプログラム領域212を有している。メインプログラム領域211とサブプログラム領域212を区分するのは、メインプログラム113bの末尾ステップを示すプログラムエンド命令である。シーケンス・プログラム113aの容量は、対応するプログラマブルコントローラ100の仕様およびパラメータにより規定されている。
FIG. 3 is a programming model 200 of the programmable controller 100 in the peripheral device 10.
The sequence program 113a includes a main program 113b and a subprogram 113c having a subprogram format, and has a main program area 211 in which the main program 113b is stored and a subprogram area 212 in which a plurality of subprograms 113c are stored. ing. The main program area 211 and the subprogram area 212 are divided by a program end instruction indicating the last step of the main program 113b. The capacity of the sequence program 113a is defined by the specifications and parameters of the corresponding programmable controller 100.

シーケンス・プログラム113aは、プログラマブルコントローラ100のプログラムメモリに格納されて実行される。メインプログラム113bは、プログラマブルコントローラ100のスキャンごとに先頭ステップから末尾ステップに至るまでシーケンシャルに実行される。サブプログラム113cは、メインプログラム113bから呼び出されて実行される。   The sequence program 113a is stored in the program memory of the programmable controller 100 and executed. The main program 113b is executed sequentially from the first step to the last step for each scan of the programmable controller 100. The subprogram 113c is called from the main program 113b and executed.

サブプログラム113cは、サブプログラム形式のプログラムであり、先頭ステップにラベル命令(LABEL)、末尾ステップに復帰命令(RETURN)を有し、この2つの命令の間がプログラム本体として構成されている。ラベル命令は、オペランドにサブプログラム名称を有し、このサブプログラム名称により他のサブプログラム113cと区別されている。   The subprogram 113c is a subprogram type program, and has a label instruction (LABEL) at the top step and a return instruction (RETURN) at the end step, and the section between these two instructions is configured as a program body. The label instruction has a subprogram name as an operand, and is distinguished from other subprograms 113c by this subprogram name.

サブプログラム113cは、サブプログラム呼び出し命令(CALL)により呼び出される。呼び出されるサブプログラム113cは、オペランドに設定されたサブプログラム名称のサブプログラム113cである。メインプログラム113bから呼び出されたサブプログラム113cは、先頭ステップのラベル命令(LABEL)からシーケンシャルに実行された後、末尾ステップの復帰命令(RETURN)により、呼び出し元のメインプログラム113bに復帰する。   The subprogram 113c is called by a subprogram call instruction (CALL). The subprogram 113c to be called is the subprogram 113c having the subprogram name set in the operand. The subprogram 113c called from the main program 113b is executed sequentially from the label instruction (LABEL) at the head step, and then returns to the main program 113b as the caller by a return instruction (RETURN) at the tail step.

内部デバイス231は、プログラマブルコントローラ100の内部メモリである。変数情報テーブル220には、内部デバイス231のアドレスと変数名との関連付けが示されている。通常、変数情報テーブル220の内部デバイス231は、コンパイル処理により、変数名ごとに異なるアドレスが割り付けられている。   The internal device 231 is an internal memory of the programmable controller 100. The variable information table 220 shows the association between the address of the internal device 231 and the variable name. Normally, the internal device 231 of the variable information table 220 is assigned a different address for each variable name by the compilation process.

入出力デバイス232は、制御対象の機器160と入出力制御回路を介して接続されるプログラマブルコントローラ100の入出力部である。変数情報テーブル220には、入出力デバイス232のアドレスと変数名の関連付けが示されている。通常、変数情報テーブル220の入出力デバイス232は、機器160との接続位置によりアドレスが割り付けられている。すなわち、入出力デバイス232のアドレスは設計時において決定されている。   The input / output device 232 is an input / output unit of the programmable controller 100 connected to the device 160 to be controlled via an input / output control circuit. The variable information table 220 shows the association between the address of the input / output device 232 and the variable name. Normally, the input / output device 232 of the variable information table 220 is assigned an address depending on the connection position with the device 160. That is, the address of the input / output device 232 is determined at the time of design.

変数プログラミングにおいては、シーケンス・プログラム113aの各要素は変数名で記述され、シーケンス・プログラム113aは、変数情報テーブル220を介して、デバイス種別およびアドレスが関係付けられている。   In variable programming, each element of the sequence program 113a is described by a variable name, and the sequence program 113a is associated with a device type and an address via the variable information table 220.

図4は、プログラマブルコントローラ100の周辺装置10のシーケンス・プログラム編集処理部400のプログラム構成である。
このように構成されたシーケンス・プログラム編集処理部400において、既存のシーケンス・プログラムの再利用において、サブプログラムとして標準化する処理について説明する。
FIG. 4 shows a program configuration of the sequence / program edit processing unit 400 of the peripheral device 10 of the programmable controller 100.
In the sequence program editing processing section 400 configured as described above, a process for standardizing as a subprogram in reuse of an existing sequence program will be described.

最初に、シーケンス・プログラム編集処理部400は、現在編集中のシーケンス・プログラムとは別の再利用するシーケンス・プログラムを読み出して、シーケンス・プログラム表示処理部440により、表示装置に表示する。   First, the sequence program edit processing unit 400 reads out a sequence program to be reused, which is different from the sequence program currently being edited, and displays the sequence program on the display device by the sequence program display processing unit 440.

そして、選択処理部410により、表示装置に表示されたシーケンス・プログラムから、制御対象となる機器に関わる制御部分のラダー回路の範囲を特定して、このラダー回路の範囲を選択する。   Then, the selection processing unit 410 identifies the range of the ladder circuit of the control portion related to the device to be controlled from the sequence program displayed on the display device, and selects the range of the ladder circuit.

次に「コピー」の編集コマンドを実行するとコピー処理部420が呼び出される。
コピー処理部420は、選択した範囲のラダー回路および変数情報テーブルをバッファメモリ上に一時的にコピーして保持する。
Next, when the “copy” editing command is executed, the copy processing unit 420 is called.
The copy processing unit 420 temporarily copies and stores the ladder circuit and variable information table in the selected range on the buffer memory.

次に、現在編集中のシーケンス・プログラムにおいて、上記の制御対象となる装置を制御するステップ位置にて、「サブプログラムとして貼り付け」の編集コマンドを実行すると、サブプログラム化処理部431とサブプログラム貼り付け処理部430が呼び出される。   Next, in the sequence program that is currently being edited, when the edit command “Paste as subprogram” is executed at the step position for controlling the device to be controlled, the subprogram processing unit 431 and the subprogram The paste processing unit 430 is called.

サブプログラム化処理部431は、図5に示すサブプログラム名称を問い合わせるダイアログボックス310を表示して、サブプログラム名311の入力を指示する。   The subprogram processing unit 431 displays a dialog box 310 for inquiring about the subprogram name shown in FIG. 5 and instructs the input of the subprogram name 311.

ダイアログボックス310にサブプログラム名311(図5)が入力されると、図4のサブプログラム命令挿入処理部433が呼び出される。サブプログラム命令挿入処理部433は、コマンドを実行した編集カーソルの位置に、サブプログラム呼び出し命令(CALL)を挿入する。このサブプログラム呼び出し命令(CALL)のオペランドには、先にダイアログボックス310(図5)で入力したサブプログラム名311(図5)と、後述する退避領域のアドレスが設定される。   When the subprogram name 311 (FIG. 5) is input to the dialog box 310, the subprogram instruction insertion processing unit 433 of FIG. 4 is called. The subprogram instruction insertion processing unit 433 inserts a subprogram call instruction (CALL) at the position of the edit cursor that executed the command. In the operand of this subprogram call instruction (CALL), the subprogram name 311 (FIG. 5) input in the dialog box 310 (FIG. 5) and the address of a save area described later are set.

一方、サブプログラム貼り付け処理部430は、バッファメモリ上のラダー回路をサブプログラム領域に貼り付ける。また、サブプログラム化処理部431は、サブプログラム領域に貼り付けたラダー回路をサブプログラム形式にする。すなわち、先頭ステップにラベル命令(LABEL)を挿入し、末尾ステップに復帰命令(RETURN)を追加する。このオペランドには、先に入力したサブプログラム名311(図5)が設定される。   On the other hand, the subprogram pasting processing unit 430 pastes the ladder circuit on the buffer memory to the subprogram area. Further, the subprogramming processing unit 431 converts the ladder circuit pasted into the subprogram area into a subprogram format. That is, a label instruction (LABEL) is inserted in the first step, and a return instruction (RETURN) is added in the last step. In this operand, the previously input subprogram name 311 (FIG. 5) is set.

サブプログラム変数保持処理部432は、末尾ステップの復帰命令(RETURN)の前ステップに、変数の値を内部デバイスに設けられた退避領域に転送する転送命令(MOVE)を挿入し、先頭ステップのラベル命令(LABEL)の後ステップに、退避領域から変数に値を転送する転送命令(MOVE)を挿入する。この退避領域のアドレスは、サブプログラムの呼び出しごとに異なるアドレスとなるように、サブプログラム呼び出し命令(CALL)のオペランドで設定される。転送するデータサイズはサブプログラムにて使用されるすべての変数の領域のサイズとされる。   The subprogram variable holding processing unit 432 inserts a transfer instruction (MOVE) that transfers the value of the variable to the save area provided in the internal device in the step before the return instruction (RETURN) of the last step, and labels the first step. A transfer instruction (MOVE) for transferring a value from the save area to the variable is inserted in a step subsequent to the instruction (LABEL). The address of this save area is set by the operand of the subprogram call instruction (CALL) so that it becomes a different address for each subprogram call. The data size to be transferred is the size of all variable areas used in the subprogram.

また、バッファメモリ上の変数情報テーブルを現在編集中のシーケンス・プログラムの変数情報テーブルに追加するとともに、サブプログラムにて使用されるすべての変数に内部デバイスを関連付ける。そして、変数情報テーブル編集処理部450が、これら内部デバイスにアドレスを関連付ける。変数のアドレスは空きアドレスから順に詰められて、サブプログラムにて使用される変数の領域が連続したメモリブロックとなっている。   Further, the variable information table on the buffer memory is added to the variable information table of the sequence program currently being edited, and the internal device is associated with all variables used in the subprogram. Then, the variable information table edit processing unit 450 associates addresses with these internal devices. The variable addresses are packed in order from the empty address, and the variable area used in the subprogram is a continuous memory block.

シーケンス・プログラム表示処理部400は、上記のサブプログラム呼び出し命令(CALL)を表示するとともに、サブプログラム表示展開処理部441により、サブプログラム呼び出し命令(CALL)とその次ステップとの間にサブプログラムの表示を展開する。一方、サブプログラム表示折り畳み処理部442は、この展開されたサブプログラムの表示を折り畳むことができる。   The sequence / program display processing unit 400 displays the above-mentioned subprogram call instruction (CALL), and the subprogram display expansion processing unit 441 causes the subprogram display instruction (CALL) to be displayed between the subprogram call instruction (CALL) and the next step. Expand the display. On the other hand, the subprogram display folding processing unit 442 can fold the display of the expanded subprogram.

シーケンス・プログラム表示処理部400は、表示切替処理部443を呼び出すことにより、サブプログラムの表示の展開と折り畳みを切り替えることができる。なお、ここに表示されるサブプログラムはサブプログラムそのものあるが、サブプログラムの実体は表示された位置ではなく、サブプログラム領域に存在している。   The sequence / program display processing unit 400 can switch between expansion and folding of the display of the subprogram by calling the display switching processing unit 443. Note that the subprogram displayed here is the subprogram itself, but the substance of the subprogram exists in the subprogram area, not at the displayed position.

図6および図7は、シーケンス・プログラム表示処理部400による、シーケンス・プログラムの表示例である。
図6に示すように、シーケンス・プログラムは、ラダー回路を構成する接点、コイル等の回路要素が格子状のシートに配置されて表示される。この格子の1つには編集カーソル340が表示されており、マウスやキーボードの方向キーで格子間を移動することができる。そして、編集操作により、編集カーソル340が示す位置の回路要素を編集することができる。
6 and 7 are sequence program display examples by the sequence program display processing unit 400. FIG.
As shown in FIG. 6, the sequence program is displayed by arranging circuit elements such as contacts and coils constituting the ladder circuit on a grid sheet. An edit cursor 340 is displayed on one of the grids, and can be moved between the grids with a direction key of a mouse or a keyboard. Then, the circuit element at the position indicated by the editing cursor 340 can be edited by the editing operation.

図6は、サブプログラム表示展開処理部441(図4)により、ステップ0103のサブプログラム呼び出し命令(CALL)とその次ステップ0104との間にサブプログラムSUB010の表示が展開された状態を示している。また、サブプログラムSUB010の範囲が、区切り線331、332により示されている。   FIG. 6 shows a state in which the display of the subprogram SUB010 is expanded between the subprogram call instruction (CALL) in step 0103 and the next step 0104 by the subprogram display expansion processing unit 441 (FIG. 4). . Further, the range of the subprogram SUB010 is indicated by dividing lines 331 and 332.

図7は、サブプログラム表示折り畳み処理部442(図4)により、ステップ0103のサブプログラム呼び出し命令(CALL)とその次ステップ0104との間のサブプログラムSUB010の表示を折り畳んだ状態を示している。   FIG. 7 shows a state in which the display of the subprogram SUB010 between the subprogram call instruction (CALL) in step 0103 and the next step 0104 is folded by the subprogram display folding processing unit 442 (FIG. 4).

図6のマウスカーソル(矢印アイコン)380を、この区切り線331、332上に移動させると、マウスカーソル(矢印アイコン)380は、マウスカーソル(折り畳みアイコン)381に切り替わる。マウスカーソル(折り畳みアイコン)381の状態でクリックすると、表示切替処理部443(図4)からサブプログラム表示折り畳み処理部442(図4)が呼び出され、図7に示すように、サブプログラムSUB010の表示を折り畳むことができる。このとき、区切り線331、332は1つとなる。   When the mouse cursor (arrow icon) 380 in FIG. 6 is moved onto the dividing lines 331 and 332, the mouse cursor (arrow icon) 380 is switched to the mouse cursor (folding icon) 381. When the mouse cursor (folding icon) 381 is clicked, the sub-program display folding processing unit 442 (FIG. 4) is called from the display switching processing unit 443 (FIG. 4), and the sub-program SUB010 is displayed as shown in FIG. Can be folded. At this time, there is only one separator line 331, 332.

マウスカーソル(矢印アイコン)380を、1つになった区切り線331、332上に移動させると、マウスカーソル(矢印アイコン)381は、マウスカーソル(展開アイコン)382に切り替わる。マウスカーソル(展開アイコン)382の状態でクリックすると、表示切替処理部443(図4)からサブプログラム表示展開処理部441(図4)が呼び出され、図6に示す表示に戻り、サブプログラムSUB010の表示を展開することができる。   When the mouse cursor (arrow icon) 380 is moved onto a single dividing line 331, 332, the mouse cursor (arrow icon) 381 is switched to a mouse cursor (expanded icon) 382. When the mouse cursor (development icon) 382 is clicked, the display switching processing unit 443 (FIG. 4) calls the subprogram display development processing unit 441 (FIG. 4) to return to the display shown in FIG. 6, and the subprogram SUB010 is displayed. The display can be expanded.

編集カーソル340は、サブプログラム表示の展開と折り畳みとに関わらず、区切り線331、332をまたいで移動することができる。   The edit cursor 340 can be moved across the dividing lines 331 and 332 regardless of whether the subprogram display is expanded or folded.

このように、シーケンス・プログラム編集処理部400は、サブプログラム表示の展開と折り畳みとに関わらず編集可能であり、サブプログラム表示を展開のまま編集することで、メインプログラムとサブプログラムとが同じ領域で連続したラダー回路であるかのように編集することができる。   In this way, the sequence / program edit processing unit 400 can edit regardless of the expansion and folding of the subprogram display, and the main program and the subprogram can be in the same area by editing the subprogram display while expanding it. Can be edited as if it were a continuous ladder circuit.

次に、このようにして作成されたシーケンス・プログラムの動作について説明する。
図1の周辺装置10は、通信ケーブル(図示せず)を介して接続された図2のプログラマブルコントローラ100のプログラムメモリ113に、シーケンス・プログラム113aを格納する。
Next, the operation of the sequence program created in this way will be described.
The peripheral device 10 in FIG. 1 stores the sequence program 113a in the program memory 113 of the programmable controller 100 in FIG. 2 connected via a communication cable (not shown).

図8に示すシーケンス・プログラム113aは、図2のプログラムメモリ113に格納され、システムプログラム115aにより実行される、メインプログラムおよび標準化したサブプログラムSUB010である。このサブプログラムSUB010は、2台の同じ機器(機器1、機器2)が左右に配置された設備を制御するシーケンス・プログラム113aから多重に呼び出されて、機器1、機器2を個別に制御するものである。   The sequence program 113a shown in FIG. 8 is a main program and a standardized subprogram SUB010 stored in the program memory 113 of FIG. 2 and executed by the system program 115a. This subprogram SUB010 is called by a sequence program 113a that controls equipment in which two identical devices (device 1 and device 2) are arranged on the left and right, and controls device 1 and device 2 individually. It is.

図9は、サブプログラムSUB010に対応する変数情報テーブル500である。サブプログラムの標準化により、サブプログラムが使用するすべての変数は内部デバイスが割り付けられている。シーケンス・プログラム113aは、変数名とデバイスのアドレスとの関連付けられた変数情報テーブルを参照して、使用されるすべての変数にアドレスが関連付けられた状態で、プログラマブルコントローラ100のプログラムメモリ113に格納されている。   FIG. 9 is a variable information table 500 corresponding to the subprogram SUB010. Due to the standardization of subprograms, all variables used by subprograms are assigned internal devices. The sequence program 113a is stored in the program memory 113 of the programmable controller 100 in a state in which addresses are associated with all the variables to be used with reference to a variable information table associated with variable names and device addresses. ing.

図8に示す内部デバイスは、図2のRAM114の内部メモリ114aであり、サブプログラムSUB010は、領域sp0の変数値を参照して実行される。領域sp1,sp2は、退避領域であり、サブプログラムの呼び出し命令(CALL)ごとに異なるアドレスとなるとなるように、オペランドで設定されている。なお、領域sp0,sp1,sp2のサイズは、サブプログラムにて使用されるすべての変数の領域のサイズと同じである。   The internal device shown in FIG. 8 is the internal memory 114a of the RAM 114 in FIG. 2, and the subprogram SUB010 is executed with reference to the variable value in the area sp0. The areas sp1 and sp2 are save areas, and are set by operands so that different addresses are provided for each subprogram call instruction (CALL). The sizes of the areas sp0, sp1, and sp2 are the same as the sizes of all the variable areas used in the subprogram.

図8に示すように、シーケンス・プログラム113aは、機器1を制御するステップ位置において、サブプログラム呼び出し命令(CALL)601を実行する。このオペランドにおいてサブプログラム名SUB010と退避領域のアドレス(sp1)が設定されている。サブプログラム呼び出し命令(CALL)601が実行されると、実行ステップのポインタがサブプログラムSUB010のラベル命令(LABEL)に移る。   As shown in FIG. 8, the sequence program 113 a executes a subprogram call instruction (CALL) 601 at a step position where the device 1 is controlled. In this operand, the subprogram name SUB010 and the save area address (sp1) are set. When the subprogram call instruction (CALL) 601 is executed, the execution step pointer moves to the label instruction (LABEL) of the subprogram SUB010.

次に、ラベル命令(LABEL)の次ステップの転送命令(MOVE)が実行されると、内部デバイスの領域sp1から領域sp0に変数の前回値が転送される。サブプログラムSUB010は、領域sp0の変数値を参照して、プログラム本体部を実行することにより、機器1の制御を実行する。そして、復帰命令(RETURN)の前ステップの転送命令(MOVE)が実行されることにより、領域sp0から領域sp1に変数の今回値が転送される。   Next, when the transfer instruction (MOVE) of the next step of the label instruction (LABEL) is executed, the previous value of the variable is transferred from the area sp1 to the area sp0 of the internal device. The subprogram SUB010 executes control of the device 1 by referring to the variable value in the area sp0 and executing the program body. Then, by executing the transfer instruction (MOVE) in the previous step of the return instruction (RETURN), the current value of the variable is transferred from the area sp0 to the area sp1.

また、シーケンス・プログラム113aは、機器2を制御するステップ位置において、サブプログラム呼び出し命令(CALL)602を実行する。このオペランドにおいてサブプログラム名SUB010と退避領域のアドレス(sp2)が設定されている。サブプログラム呼び出し命令(CALL)602が実行されると、実行ステップのポインタがサブプログラムSUB010のラベル命令(LABEL)に移る。   In addition, the sequence program 113a executes a subprogram call instruction (CALL) 602 at a step position where the device 2 is controlled. In this operand, the subprogram name SUB010 and the save area address (sp2) are set. When the subprogram call instruction (CALL) 602 is executed, the pointer of the execution step moves to the label instruction (LABEL) of the subprogram SUB010.

次に、ラベル命令(LABEL)の次ステップの転送命令(MOVE)が実行されると、内部デバイスの領域sp2から領域sp0に変数の前回値が転送される。サブプログラムSUB010は、領域sp0の変数値を参照して、プログラム本体部を実行することにより、機器2の制御を実行する。そして、復帰命令(RETURN)の前ステップの転送命令(MOVE)が実行されることにより、領域sp0から領域sp2に変数の今回値が転送される。   Next, when the transfer instruction (MOVE) of the next step of the label instruction (LABEL) is executed, the previous value of the variable is transferred from the area sp2 of the internal device to the area sp0. The subprogram SUB010 executes control of the device 2 by referring to the variable value in the area sp0 and executing the program main body. Then, by executing the transfer instruction (MOVE) in the previous step of the return instruction (RETURN), the current value of the variable is transferred from the area sp0 to the area sp2.

このように、標準化されたサブプログラムSUB010は、変数の前回値の復帰と今回値を保持をおこなうことができるので、サブプログラムSUB010を多重に呼び出して、機器1、機器2を別個に制御することができる。本実施形態によれば、このようなサブプログラムを標準化する作業を容易におこなうことができる。   Thus, since the standardized subprogram SUB010 can restore the previous value of the variable and hold the current value, the subprogram SUB010 can be called in multiple times to control the devices 1 and 2 separately. Can do. According to the present embodiment, the work of standardizing such a subprogram can be easily performed.

本発明は、上記実施形態に限定されるものではなく、特許請求の範囲に記載された発明の範囲内で適宜変更することが可能である。例えば、本実施形態ではサブプログラムの表示切替を、区切り線上でマウスカーソルをクリックすることでおこなっているが、例えば、表示コマンド「サブプログラム表示切替」による方法でもよい。また、メインプログラムとサブプログラムとの境界を区切り線にて示しているが、背景色等により境界を示すようにしてもよい。   The present invention is not limited to the above-described embodiment, and can be appropriately changed within the scope of the invention described in the claims. For example, in this embodiment, the display switching of the subprogram is performed by clicking the mouse cursor on the dividing line, but for example, a method using a display command “subprogram display switching” may be used. In addition, the boundary between the main program and the subprogram is indicated by a dividing line, but the boundary may be indicated by a background color or the like.

10:周辺装置、 11:CPU、 12:内部バス、 13:ROM、
13a:BIOS、 14:RAM、
14a:シーケンス・プログラム(ソースコード)、 14b:変数情報テーブル、
14c:パラメータ、 21:ディスプレイ、 22:キーボード、 23:マウス、
24:HDD、 25:OS、 26:周辺装置ソフトウェア、
26a:シーケンス・プログラム編集プログラム、 26b:変換プログラム、
26c:コンパイル処理プログラム、 26d:変数情報テーブル編集プログラム、
27:通信インターフェース、 28:システムメモリ、
100:プログラマブルコントローラ、 110:CPUユニット、 111:CPU、
112:内部バス、 113:プログラムメモリ、 113a:シーケンス・プログラム、
113b:メインプログラム、 113c:サブプログラム、 114:RAM、
114a:内部メモリ、 115:ROM、 115a:システムプログラム、
118:入出力制御回路、 119:通信インターフェース、 160:機器、
200:プログラミング・モデル、 220:変数情報テーブル、
231:内部デバイス、 232:入出力デバイス、
310:サブプログラムとして貼り付けダイアログボックス、
311:サブプログラム名、 331,332:区切り線、 340:編集カーソル、
380:マウスカーソル(矢印アイコン)、
381:マウスカーソル(折り畳みアイコン)、
382:マウスカーソル(展開アイコン)、
400:シーケンス・プログラム編集処理部、 410:選択処理部、
420:コピー処理部、 430:サブプログラム貼り付け処理部、
431:サブプログラム化処理部、 432:サブプログラム変数保持処理部、
433:サブプログラム命令挿入処理部、 440:シーケンス・プログラム表示処理部、
441:サブプログラム表示展開処理部、 442:サブプログラム表示折り畳み処理部、
443:表示切替処理部、 450:変数情報テーブル編集処理部、
500:変数情報テーブル、 601,602:サブプログラム呼び出し命令
10: peripheral device, 11: CPU, 12: internal bus, 13: ROM,
13a: BIOS, 14: RAM,
14a: sequence program (source code), 14b: variable information table,
14c: parameter, 21: display, 22: keyboard, 23: mouse
24: HDD, 25: OS, 26: Peripheral device software,
26a: sequence program editing program, 26b: conversion program,
26c: compilation processing program, 26d: variable information table editing program,
27: Communication interface, 28: System memory,
100: Programmable controller, 110: CPU unit, 111: CPU,
112: Internal bus 113: Program memory 113a: Sequence program
113b: main program, 113c: subprogram, 114: RAM,
114a: internal memory, 115: ROM, 115a: system program,
118: Input / output control circuit, 119: Communication interface, 160: Device
200: Programming model, 220: Variable information table,
231: Internal device, 232: Input / output device,
310: Paste as subprogram dialog box,
311: Subprogram name, 331, 332: Separator line, 340: Edit cursor,
380: Mouse cursor (arrow icon),
381: Mouse cursor (folding icon),
382: Mouse cursor (expanded icon),
400: Sequence program editing processing unit 410: Selection processing unit
420: Copy processing unit, 430: Subprogram pasting processing unit,
431: Subprogram processing unit, 432: Subprogram variable holding processing unit,
433: Subprogram instruction insertion processing unit, 440: Sequence program display processing unit,
441: Subprogram display development processing unit, 442: Subprogram display folding processing unit,
443: display switching processing unit, 450: variable information table editing processing unit,
500: Variable information table, 601 and 602: Subprogram call instruction

Claims (2)

機器を制御するためのシーケンス・プログラムを編集するシーケンス・プログラム編集処理部を備えるプログラマブルコントローラの周辺装置において、
前記シーケンス・プログラムは、接点およびコイル等の回路要素を含むラダー回路により記述され、メインプログラムとサブプログラム形式からなる複数のサブプログラムとから構成され、
前記シーケンス・プログラム編集処理部は、
前記シーケンス・プログラムを表示装置に表示するシーケンス・プログラム表示処理部と、
前記表示装置に表示された前記シーケンス・プログラムから指定した範囲のラダー回路を選択する選択処理部と、
前記選択処理部により選択した範囲のラダー回路をコピーするコピー処理部と、
前記コピー処理部によりコピーされたラダー回路にサブプログラム名を入力し、前記サブプログラム形式にするサブプログラム化処理部と、
前記サブプログラム形式にされたラダー回路を、前記シーケンス・プログラムのサブプログラム領域に貼り付けるサブプログラム貼り付け処理部と、
指定された位置にサブプログラム呼び出し命令を挿入するサブプログラム命令挿入処理部と、
前記サブプログラム呼び出し命令とその次ステップとの間に前記サブプログラムの表示を展開するサブプログラム表示展開処理部と、
前記サブプログラム呼び出し命令とその次ステップとの間の前記サブプログラムの表示を折り畳むサブプログラム表示折り畳み処理部と、
前記サブプログラムの表示の展開と折り畳みとを切り替える表示切替処理部と
を備えることを特徴としたプログラマブルコントローラの周辺装置。
In a peripheral device of a programmable controller comprising a sequence / program edit processing unit for editing a sequence / program for controlling a device,
The sequence program is described by a ladder circuit including circuit elements such as contacts and coils, and includes a main program and a plurality of subprograms having a subprogram format.
The sequence program edit processing unit
A sequence program display processing unit for displaying the sequence program on a display device;
A selection processing unit for selecting a ladder circuit in a specified range from the sequence program displayed on the display device;
A copy processing unit for copying a ladder circuit in a range selected by the selection processing unit;
A subprogram processing unit that inputs a subprogram name to the ladder circuit copied by the copy processing unit, and converts the program into the subprogram format;
A sub-program pasting processing unit for pasting the ladder circuit in the sub-program format into the sub-program area of the sequence program;
A subprogram instruction insertion processing unit for inserting a subprogram call instruction at a specified position;
A subprogram display expansion processing unit for expanding the display of the subprogram between the subprogram call instruction and the next step;
A subprogram display folding processing unit for folding the display of the subprogram between the subprogram call instruction and the next step;
A peripheral device for a programmable controller, comprising: a display switching processing unit that switches between expansion and folding of display of the subprogram.
請求項1に記載のプログラマブルコントローラの周辺装置であって、
前記シーケンス・プログラムは、変数を使用して記述され、
前記シーケンス・プログラムに対応して変数の情報を保持する変数情報テーブルと、
前記変数情報テーブルの前記変数とデバイスのアドレスとの関連付けをおこなう変数情報テーブル編集処理部を備え、
前記サブプログラム化処理部は、
前記サブプログラム形式にされたラダー回路に対し、
サブプログラム末尾の復帰命令の前ステップに、前記変数の値を内部デバイスに設けられた退避領域に転送する転送命令を挿入し、
サブプログラム先頭のラベル命令の後ステップに、前記退避領域から前記変数に値を転送する転送命令を挿入する、
サブプログラム変数保持処理部を備え、
前記変数情報テーブル編集処理部は、
前記サブプログラムにて使用される前記変数に内部デバイスのアドレスを関連付け、
前記退避領域のアドレスが前記サブプログラムの呼び出しごとに異なるアドレスとなるようにすることを特徴としたプログラマブルコントローラの周辺装置。
The peripheral device of the programmable controller according to claim 1,
The sequence program is described using variables,
A variable information table for holding variable information corresponding to the sequence program;
A variable information table editing processing unit for associating the variable of the variable information table with a device address;
The subprogramming processing unit includes:
For the ladder circuit in the subprogram format,
Insert a transfer instruction to transfer the value of the variable to the save area provided in the internal device in the previous step of the return instruction at the end of the subprogram,
Insert a transfer instruction to transfer a value from the save area to the variable after the label instruction at the top of the subprogram.
It has a subprogram variable holding processing unit,
The variable information table edit processing unit
Associate an internal device address with the variable used in the subprogram,
A peripheral device of a programmable controller, wherein the address of the save area is different for each call of the subprogram.
JP2012220155A 2012-10-02 2012-10-02 Peripheral device of programmable controller Expired - Fee Related JP6115063B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012220155A JP6115063B2 (en) 2012-10-02 2012-10-02 Peripheral device of programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012220155A JP6115063B2 (en) 2012-10-02 2012-10-02 Peripheral device of programmable controller

Publications (2)

Publication Number Publication Date
JP2014071862A true JP2014071862A (en) 2014-04-21
JP6115063B2 JP6115063B2 (en) 2017-04-19

Family

ID=50746948

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012220155A Expired - Fee Related JP6115063B2 (en) 2012-10-02 2012-10-02 Peripheral device of programmable controller

Country Status (1)

Country Link
JP (1) JP6115063B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6388736B1 (en) * 2017-04-24 2018-09-12 三菱電機株式会社 Programmable logic controller system and engineering tool program
WO2021024520A1 (en) 2019-08-08 2021-02-11 オムロン株式会社 Information processing device, support program, and support system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007265252A (en) * 2006-03-29 2007-10-11 Mitsubishi Electric Corp Program preparation support device and method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007265252A (en) * 2006-03-29 2007-10-11 Mitsubishi Electric Corp Program preparation support device and method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6388736B1 (en) * 2017-04-24 2018-09-12 三菱電機株式会社 Programmable logic controller system and engineering tool program
WO2018198174A1 (en) * 2017-04-24 2018-11-01 三菱電機株式会社 Programmable logic controller system, programmable logic controller, and engineering tool program
KR20190026923A (en) * 2017-04-24 2019-03-13 미쓰비시덴키 가부시키가이샤 Programmable logic controller systems and engineering tool programs
CN109643096A (en) * 2017-04-24 2019-04-16 三菱电机株式会社 Programmable logic controller system, programmable logic controller (PLC) and engineering tools program
KR102005224B1 (en) 2017-04-24 2019-07-29 미쓰비시덴키 가부시키가이샤 Programmable logic controller systems and engineering tool programs
US10466674B2 (en) 2017-04-24 2019-11-05 Mitsubishi Electric Corporation Programmable logic controller system, and engineering tool computer program product
CN109643096B (en) * 2017-04-24 2020-11-10 三菱电机株式会社 Programmable logic controller system and computer-readable storage medium storing engineering tool program
WO2021024520A1 (en) 2019-08-08 2021-02-11 オムロン株式会社 Information processing device, support program, and support system
JP2021026642A (en) * 2019-08-08 2021-02-22 オムロン株式会社 Information processor, support program, and support system
CN114072740A (en) * 2019-08-08 2022-02-18 欧姆龙株式会社 Information processing apparatus, support program, and support system

Also Published As

Publication number Publication date
JP6115063B2 (en) 2017-04-19

Similar Documents

Publication Publication Date Title
US8843885B2 (en) Program creation support device
US20090303519A1 (en) Printing controller, gui display method, printer driver, and recording medium
US10295985B2 (en) Program processing apparatus and program
JP2008282363A (en) Programmable controller, program creation support device, computer program and programmable logic controller (plc) system
JP6115063B2 (en) Peripheral device of programmable controller
JPH03229352A (en) Program changing method
JP2005301520A (en) Programming system
JP4266334B2 (en) Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium
CN110471659A (en) Multilingual method and system, human-machine interface configuration software end and equipment end
JP2016224559A (en) Program creation support device, control method and program
JP2010224597A (en) Method and system for generating programmable controller control program
JP5205988B2 (en) PLC global variable definition method
JP4877257B2 (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JPH0410081B2 (en)
JP4387288B2 (en) Display device for control, editor device, program, and recording medium
WO2022190417A1 (en) Development support device, development support method, and development support program
JPS62282301A (en) Program generating device
JP2009181173A (en) Machine control panel screen display system, and display device having sequential control processing function
JPS63109578A (en) Processing system for logic diagram outline display
JPH04294424A (en) Interactive screen controller for computer system
JP2659092B2 (en) Cursor display control method in logic diagram creation processor
JP4057766B2 (en) Program creation support apparatus and method, and medium on which program creation support program is recorded
JP6639238B2 (en) Programs and computers
CN104461490A (en) Software implementation method compatible with different formats of documents
JP2004272409A (en) Temporary object storing device, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150922

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160720

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160726

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160908

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170306

R150 Certificate of patent or registration of utility model

Ref document number: 6115063

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees