JP2005092808A - Ladder program macro generator and generation method, program therefor and computer-readable recording medium - Google Patents

Ladder program macro generator and generation method, program therefor and computer-readable recording medium Download PDF

Info

Publication number
JP2005092808A
JP2005092808A JP2003329025A JP2003329025A JP2005092808A JP 2005092808 A JP2005092808 A JP 2005092808A JP 2003329025 A JP2003329025 A JP 2003329025A JP 2003329025 A JP2003329025 A JP 2003329025A JP 2005092808 A JP2005092808 A JP 2005092808A
Authority
JP
Japan
Prior art keywords
macro
unit
program
argument
ladder program
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
JP2003329025A
Other languages
Japanese (ja)
Other versions
JP4266334B2 (en
Inventor
Hiroshi Sasaki
弘志 佐々木
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2003329025A priority Critical patent/JP4266334B2/en
Publication of JP2005092808A publication Critical patent/JP2005092808A/en
Application granted granted Critical
Publication of JP4266334B2 publication Critical patent/JP4266334B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the work of correcting macros even when the position of a unit or the assignment of a device is changed, and to facilitate the use of the macros. <P>SOLUTION: This ladder program macro generator is provided with: an argument setting part for setting the unit number of a specific unit which is to be used in the macros among a plurality of units and which shows the connection position at a programmable controller and also setting an arbitrary device number included in the macros as the arguments of the macros; a macro registering and converting part for extracting the device number included in the range of the device assigned to the unit set as the argument by the argument setting part from the plurality of device numbers included in the macros before registration, and converting the extracted device number into the relative position by using the leading device number of the range of the device as a reference; and a macro registering part for registering the macros whose argument includes the unit number set by the argument setting part. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、プログラマブルコントロール装置等に使用されるラダー図を作成、編集するためのラダー図編集装置やプログラムに使用可能なマクロを作成するための、ラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体に関する。   The present invention provides a ladder diagram macro creation device, a ladder program macro creation method for creating a ladder diagram editing device for creating and editing a ladder diagram used for a programmable control device and the like, and a macro usable for a program, The present invention relates to a ladder program macro creation program and a computer-readable recording medium.

プログラマブルコントローラ、プログラマブルロジックコントローラ、PLC、シーケンサ等と呼ばれるプログラマブルコントロール装置(以下、PLCという)による制御シーケンスを定めるプログラムには、ラダー図(ラダーダイヤグラム)が使用される。ラダー図はラダー図編集装置やプログラムなどで作成される。ラダー図を用いて作成された実行プログラムは、PLCに転送されて実行され、PLCに接続された外部の制御対象機器を制御して所望の処理を行う。   A ladder diagram (ladder diagram) is used as a program for defining a control sequence by a programmable controller (hereinafter referred to as PLC) called a programmable controller, programmable logic controller, PLC, sequencer or the like. A ladder diagram is created by a ladder diagram editing device or a program. The execution program created using the ladder diagram is transferred to the PLC and executed, and controls an external control target device connected to the PLC to perform a desired process.

PLCには、必要な機能を内蔵した一体型のパッケージタイプと、個別のユニットに種々の機能を備え、必要なユニットを組み合わせて構成するビルディングブロックタイプがある。後者については、CPUを備えるCPUユニット、外部の制御対象機器と通信するためのコミュニケーションユニットやリンクユニット、入出力部(I/O)を備える入出力ユニット、A/D変換ユニット、D/A変換ユニット、コンピュータリンクユニット、位置決めユニット、カウンタユニット、温度調節ユニット、電源ユニット、イーサネット(登録商標)ユニット、エンドユニット等がある。各ユニットは、それぞれ背面をベースユニットに固定して、隣接するユニット同士を接続する。あるいはベースユニットを解することなくユニット同士を直接連結する。またこれらのユニットの機能を複数、一台のユニットに統合することもできる。図1に、複数のユニット33を組み合わせたビルディングブロックタイプのPLCシステム32の構成例を示す。   There are two types of PLCs: an integrated package type that incorporates necessary functions, and a building block type that has various functions in individual units and is configured by combining necessary units. For the latter, a CPU unit including a CPU, a communication unit or link unit for communicating with an external control target device, an input / output unit including an input / output unit (I / O), an A / D conversion unit, a D / A conversion There are a unit, a computer link unit, a positioning unit, a counter unit, a temperature control unit, a power supply unit, an Ethernet (registered trademark) unit, an end unit, and the like. Each unit fixes the back surface to a base unit, and connects adjacent units. Alternatively, the units are directly connected without solving the base unit. It is also possible to integrate the functions of these units into a single unit. FIG. 1 shows a configuration example of a building block type PLC system 32 in which a plurality of units 33 are combined.

このように複数のユニット33を連結してPLCシステム32を構成する場合は、接続された複数のユニット33を区別するために、各ユニット33には固有のユニット番号が付与されていることがある。ユニット番号は、PLCのシステムにおいては一般にCPUユニットを基準として、そのユニットがCPUユニットから数えて何番目に接続されているかを示すものである。例えば図2のPLCシステム32においては、図2(a)にPLCシステム32を構成する各ユニット33の上に付された数字がユニット番号を示している。この図において、CPUユニット31のユニット番号は0である。また各ユニット33には、ユニット番号に応じて、PLC中のデバイスの範囲が割り当てられる。ユニット番号は、CPUユニット31で実行されるラダープログラムと各ユニット33との情報のやり取りに用いられる。図2(b)に、各ユニット33にデバイス領域範囲を設定する例を示す。   When the PLC system 32 is configured by connecting a plurality of units 33 in this way, each unit 33 may be given a unique unit number in order to distinguish the connected units 33. . In the PLC system, the unit number generally indicates the number of units connected to the CPU unit with respect to the CPU unit. For example, in the PLC system 32 of FIG. 2, the numbers given on the units 33 constituting the PLC system 32 in FIG. 2A indicate unit numbers. In this figure, the unit number of the CPU unit 31 is 0. Each unit 33 is assigned a range of devices in the PLC according to the unit number. The unit number is used for exchanging information between the ladder program executed by the CPU unit 31 and each unit 33. FIG. 2B shows an example in which a device area range is set for each unit 33.

ところで、PLCで実行されるラダープログラムの作成においては、所定の手順を記述したマクロプログラム(本明細書において「マクロ」と呼ぶ)が使用されることがある。マクロは、再利用を目的として作成されるプログラムの集合である。例えば、PLCと制御対象機器との通信を行うための通信プロトコルマクロにおいては、プロトコルマクロは複数の送受信シーケンスで構成される。各送受信シーケンスはステップ単位のコマンド群からなる。CPUユニットのラダープログラム上で専用命令によりプロトコルマクロのシーケンス番号を指定することにより、指定されたシーケンスを実行する。これにより、メッセージが作成され、伝送路を介してリンクユニットと汎用外部機器との間での送受信が行われる。   By the way, in creating a ladder program executed by the PLC, a macro program (referred to as “macro” in the present specification) describing a predetermined procedure may be used. A macro is a set of programs created for reuse. For example, in a communication protocol macro for performing communication between a PLC and a control target device, the protocol macro is composed of a plurality of transmission / reception sequences. Each transmission / reception sequence consists of a command group in units of steps. The designated sequence is executed by designating the sequence number of the protocol macro by a dedicated instruction on the ladder program of the CPU unit. As a result, a message is created, and transmission / reception is performed between the link unit and the general-purpose external device via the transmission path.

このようなPLCのプログラミング用アプリケーションにおけるマクロ内のプログラム中では、使用時の状況によって可変となるようなデバイスや直値を引数に指定することができる。マクロの一例を図3に基づいて説明する。図3においては、アプリケーションに利用可能な登録済みマクロとして、MACROAおよびMACROAが予めシステムのデータファイル34に登録されている。MACROAにおいては、R0は実リレーの0番を指定しており、またP0は引数に指定されている。このため、MACROAを実際に使用するときは、引数P0をユーザが指定する必要がある。図3の例では、左上に示す制御プログラムにMACROAが利用され、MACROA内の引数P0としてR500のデバイスを指定している。これによってMACROA内のP0は、R500に置き換えられて、展開された制御プログラムが実行される。   In a program in a macro in such a PLC programming application, a device or a direct value that can be changed depending on a situation during use can be designated as an argument. An example of the macro will be described with reference to FIG. In FIG. 3, MACROA and MACROA are registered in advance in the data file 34 of the system as registered macros that can be used for the application. In MACROA, R0 designates the actual relay number 0, and P0 is designated as an argument. For this reason, when MACROA is actually used, the user needs to specify the argument P0. In the example of FIG. 3, MACROA is used for the control program shown in the upper left, and the device of R500 is designated as the argument P0 in MACROA. As a result, P0 in MACROA is replaced with R500, and the developed control program is executed.

このようにマクロにおいては、プログラム中で用いることのできる任意のデバイスや直値を、引数として指定することができる。しかしながら、従来のマクロにおいては、ユニットに割り当てられたデバイスをそのままマクロの引数として登録した場合、通常のデバイスと何ら区別なく扱われる。このため、マクロを使用したプログラムで、ユニットに割り当てられたデバイスの位置が変更されると、プログラム中のマクロを使用している部分の引数を全て変更する必要があった。   In this way, in a macro, any device or direct value that can be used in a program can be specified as an argument. However, in a conventional macro, when a device assigned to a unit is registered as a macro argument as it is, it is handled without distinction from a normal device. For this reason, when the position of a device assigned to a unit is changed in a program using a macro, all the arguments of the part using the macro in the program must be changed.

すなわち、ユニットに割り当てられたデバイスが変更されると、デバイスを引数に含んでいるマクロについては、該引数で指定されたデバイスを新たなデバイスに変更するデバッグ作業が必要となり、プログラムの変更作業が極めて面倒になるという問題があった。特に従来のマクロではユニット番号を指定することができず、このため各ユニットに割り当てられたデバイスをマクロ側で検出できず、ユニット構成の変更に容易に対処できなかった。
特開2002−229613号公報
In other words, when a device assigned to a unit is changed, for a macro that includes a device as an argument, debugging work is required to change the device specified by the argument to a new device. There was a problem of being extremely troublesome. In particular, in the conventional macro, the unit number cannot be specified, and therefore the device assigned to each unit cannot be detected on the macro side, and the change of the unit configuration cannot be easily dealt with.
JP 2002-229613 A

本発明は、このような問題点を解決するためになされたものである。本発明の主な目的は、ユニットの位置やデバイスの割り当てが変更されてもマクロの修正作業を軽減しマクロの利用を容易にしたラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体を提供することにある。   The present invention has been made to solve such problems. A main object of the present invention is to provide a ladder program macro creation device, a ladder program macro creation method, and a ladder program macro creation that reduce the macro correction work and facilitate the use of the macro even if the unit position or device assignment is changed. To provide a recording medium readable by a program and a computer.

上記の目的を達成するために、本発明の請求項1のラダープログラムマクロ作成装置は、複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成装置であって、複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定可能な引数設定部と、登録前のマクロ中に含まれる複数のデバイス番号から、前記引数設定部で引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換するマクロ登録変換部と、前記引数設定部で設定されたユニット番号を引数に含むマクロを登録するマクロ登録部とを備えることを特徴とする。   In order to achieve the above object, a ladder program macro creation device according to claim 1 of the present invention is a programmable control device that is composed of a plurality of units, and a range of devices that can be specified is assigned to one or more units. A ladder program macro creation device for creating a macro that can be used when creating a ladder program to be executed, and a connection position in a programmable control device of a specific unit used in the macro among a plurality of units As an argument in the argument setting unit, from an argument setting unit that can be set as a macro argument, and an arbitrary device number included in the macro, and a plurality of device numbers included in the macro before registration Devices included in the device range assigned to the configured unit A macro registration conversion unit that converts the extracted device number into a relative position based on the first device number of the device range, and the unit number set by the argument setting unit as an argument And a macro registration unit for registering a macro to be included.

また、請求項2に記載されるラダープログラムマクロ作成装置は、請求項1に記載のラダープログラムマクロ作成装置であって、さらに前記マクロ登録部に登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記マクロ登録変換部で変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換するマクロ実行変換部を備えることを特徴とする。   A ladder program macro creation device according to claim 2 is the ladder program macro creation device according to claim 1, and further includes an argument input when a macro registered in the macro registration unit is called. Macro execution that converts the device number represented by the relative position converted by the macro registration conversion unit into the actual device number by referring to the first device number of the device range assigned to the unit corresponding to the unit number A conversion unit is provided.

この構成よれば、マクロの引数登録を行なう時に、ユニットに割り当てられたデバイスに対してユニット番号を設定でき、さらに登録したマクロを用いる時に、引数であるユニット番号を入力することで、ユニットに割り当てられたデバイスを特定できる。この結果、マクロ中に引数として設定されたユニットに割り当てられたデバイスを含んでいる場合に、ユニットに割り当てられたデバイスが変更されてもプログラムに変更が生じず、マクロの管理、再利用が容易となる。   According to this configuration, when registering a macro argument, the unit number can be set for the device assigned to the unit, and when using the registered macro, the unit number can be assigned by entering the unit number as an argument. Identified devices. As a result, if the device assigned to the unit set as an argument is included in the macro, the program will not change even if the device assigned to the unit is changed, and the macro can be easily managed and reused. It becomes.

さらに、請求項3に記載されるラダープログラムマクロ作成方法は、複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成方法であって、複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定するステップと、登録前のマクロ中に含まれる複数のデバイス番号から、引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換するステップと、前記設定されたユニット番号を引数に含むマクロを登録するステップとを備えることを特徴とする。   Furthermore, the ladder program macro creating method according to claim 3 creates a ladder program that is executed by a programmable control device that is composed of a plurality of units and in which a range of devices that can be specified is assigned to one or more units. A ladder program macro creation method for creating a macro that can be used when a macro is used, a unit number indicating a connection position in a programmable control device of a specific unit used in a macro among a plurality of units, and a macro The device included in the range of devices assigned to the unit set as an argument from the step of setting any device number included in the macro as an argument and the multiple device numbers included in the macro before registration The number is extracted and the extracted data The chair numbers, characterized by comprising the steps of converting the relative position from the first device number in the range of the device, and registering the macro that contains the set unit number as an argument.

さらにまた、請求項4に記載されるラダープログラムマクロ作成方法は、請求項3に記載のラダープログラムマクロ作成方法であって、さらに前記登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換するステップを備えることを特徴とする。   Furthermore, the ladder program macro creation method according to claim 4 is the ladder program macro creation method according to claim 3, and further, the unit number of the input argument is set when the registered macro is called. The method includes a step of converting a device number expressed by the converted relative position into an actual device number by referring to a head device number of a range of devices assigned to the corresponding unit.

また、請求項5に記載されるラダープログラムマクロ作成プログラムは、複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成プログラムであって、コンピュータに、複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定する機能と、登録前のマクロ中に含まれる複数のデバイス番号から、引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換する機能と、前記設定されたユニット番号を引数に含むマクロを登録する機能とを実現させることを特徴とする。   The ladder program macro creation program according to claim 5 is a ladder program that is executed by a programmable control device that includes a plurality of units and is assigned a range of devices that can be designated to one or more units. This is a ladder program macro creation program for creating a macro that can be used when performing a unit number indicating a connection position in a programmable control device of a specific unit used in a macro among a plurality of units. And the function to set any device number included in the macro as an argument of the macro, and from the multiple device numbers included in the macro before registration, to the range of devices assigned to the unit set as the argument Extracting the device number included And realizing a function of converting the extracted device number into a relative position based on the first device number of the device range and a function of registering a macro including the set unit number as an argument. It is characterized by.

さらに、請求項6に記載されるラダープログラムマクロ作成プログラムは、請求項5に記載のラダープログラムマクロ作成プログラムであって、さらにコンピュータに、前記登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換する機能を実現させることを特徴とする。   Furthermore, the ladder program macro creation program according to claim 6 is the ladder program macro creation program according to claim 5, and further includes a unit of an argument input to the computer when the registered macro is called. A function for converting a device number represented by the converted relative position into an actual device number by referring to a head device number of a device range assigned to a unit corresponding to the number is provided. To do.

また、本発明の請求項7に記載されたコンピュータで読み取り可能な記録媒体は、請求項5または6に記載されるラダープログラムマクロ作成プログラムを格納したものである。記録媒体には、CD−ROM、CD−R、CD−RWやフレキシブルディスク、磁気テープ、MO、DVD−ROM、DVD−RAM、DVD−R、DVD−RW、DVD+R、DVD+RW、blu−layディスク、AOD等の磁気ディスク、光ディスク、光磁気ディスク、半導体メモリその他のプログラムを格納可能な媒体が含まれる。また上記のプログラムは、ネットワークを介してダウンロード可能な形態も含まれる。   A computer-readable recording medium described in claim 7 of the present invention stores the ladder program macro creation program described in claim 5 or 6. Recording media include CD-ROM, CD-R, CD-RW, flexible disk, magnetic tape, MO, DVD-ROM, DVD-RAM, DVD-R, DVD-RW, DVD + R, DVD + RW, Blu-ray disc, A medium such as an AOD magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like capable of storing a program is included. The above-mentioned program includes a form that can be downloaded via a network.

本発明のラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体によれは、マクロを再利用が容易な状態で登録でき、ユニット構成が変更されてもデバッグ工程を軽減できるという優れた特長が実現される。それは、本発明が、マクロの引数登録を行なう時に、ユニットに割り当てられたデバイスに対してユニット番号を指定できるようにしたからである。これによって、引数として登録されるデバイスの内、指定されたユニット番号のユニットに割り当てられたデバイスの範囲に含まれるデバイスを、該範囲における基準位置からのオフセットとして表現できる。そしてマクロの使用時においては、指定されたユニット番号のユニットに割り当てられたデバイスの範囲から、該当するオフセット位置のデバイスに変換することで、マクロにおけるデバイスが指定される。これによって、ユーザはユニットに割り当てられたデバイス領域範囲などの情報を意識することなく、引数を指定する際に単にユニット番号を伝えるのみで、プログラム側が正しくデバイスを解釈できる。このため、マクロを利用したプログラムの構造化を進め、マクロの再利用を促進し、プログラムの管理、デバッグ工数の削減が実現される。   According to the ladder program macro creation apparatus, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium of the present invention, the macro can be registered in an easily reusable state, and the unit configuration is changed. Also realizes the excellent feature of reducing the debugging process. This is because the present invention makes it possible to specify a unit number for a device assigned to a unit when registering a macro argument. As a result, among the devices registered as arguments, the devices included in the device range assigned to the unit of the specified unit number can be expressed as an offset from the reference position in the range. When the macro is used, the device in the macro is designated by converting the device range assigned to the unit of the designated unit number into the device at the corresponding offset position. Accordingly, the user can correctly interpret the device by simply transmitting the unit number when specifying the argument without being aware of information such as the device area range allocated to the unit. Therefore, structuring of programs using macros is promoted, macro reuse is promoted, program management and debugging man-hours are reduced.

特に、ユニットに割り当てられたデバイスの範囲や位置が変更された場合でも、変更されたデバイス割り当てにおけるオフセット位置としてデバイスが解釈される。このため、マクロの引数に指定されたデバイスをユーザが変更しなくてもよくなり、デバッグ工程の手間が解消される。このように本発明によればマクロとユニット構成との独立性が高まり、マクロの再利用性、保守性が向上する。   In particular, even when the range or position of a device assigned to a unit is changed, the device is interpreted as an offset position in the changed device assignment. This eliminates the need for the user to change the device specified as the macro argument, eliminating the trouble of the debugging process. As described above, according to the present invention, the independence between the macro and the unit configuration is enhanced, and the reusability and maintainability of the macro are improved.

以上のように本発明は、デバイスの情報を意識することなくマクロを利用でき、しかもデバッグの手間も低減されるため、マクロを非常に使い易くして再利用を促進し、プログラミング作業の効率化が図られるという優れた特長が実現される。   As described above, according to the present invention, macros can be used without being aware of device information, and the debugging effort is reduced. Therefore, macros are very easy to use, promote reuse, and increase the efficiency of programming work. An excellent feature is realized.

以下、本発明の実施の形態を図面に基づいて説明する。ただし、以下に示す実施の形態は、本発明の技術思想を具体化するためのラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体を例示するものであって、本発明はラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体を以下のものに特定しない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the embodiments described below exemplify a ladder program macro creation device, a ladder program macro creation method, a ladder program macro creation program, and a computer-readable recording medium for embodying the technical idea of the present invention. The present invention does not specify a ladder program macro creation device, a ladder program macro creation method, a ladder program macro creation program, and a computer-readable recording medium as follows.

また、本明細書は特許請求の範囲に示される部材を、実施の形態の部材に特定するものでは決してない。特に実施の形態に記載されている構成部品の寸法、材質、形状、その相対的配置等は特に特定的な記載がない限りは、本発明の範囲をそれのみに限定する趣旨ではなく、単なる説明例にすぎない。なお、各図面が示す部材の大きさや位置関係等は、説明を明確にするため誇張していることがある。さらに以下の説明において、同一の名称、符号については同一もしくは同質の部材を示しており、詳細説明を適宜省略する。さらに、本発明を構成する各要素は、複数の要素を同一の部材で構成して一の部材で複数の要素を兼用する態様としてもよいし、逆に一の部材の機能を複数の部材で分担して実現することもできる。   Further, the present specification by no means specifies the members shown in the claims to the members of the embodiments. In particular, the dimensions, materials, shapes, relative arrangements, and the like of the component parts described in the embodiments are not intended to limit the scope of the present invention unless otherwise specified, and are merely explanations. It's just an example. Note that the size, positional relationship, and the like of the members shown in each drawing may be exaggerated for clarity of explanation. Furthermore, in the following description, the same name and symbol indicate the same or the same members, and detailed description thereof will be omitted as appropriate. Furthermore, each element constituting the present invention may be configured such that a plurality of elements are constituted by the same member and the plurality of elements are shared by one member, and conversely, the function of one member is constituted by a plurality of members. It can also be realized by sharing.

本明細書においてラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体は、ラダープログラムのマクロ作成や編集を行うシステムそのもの、ならびにマクロの作成などに関連する入出力、表示、演算、通信その他の処理をハードウェア的に行う装置や方法に限定するものではない。ソフトウェア的に処理を実現する装置や方法も本発明の範囲内に包含する。例えば汎用の回路やコンピュータにソフトウェアやプログラム、プラグイン、オブジェクト、ライブラリ、アプレット、コンパイラ、モジュール、特定のプログラム上で動作するプログラムマクロ等を組み込んでラダープログラムのマクロの作成や登録、呼び出し、あるいはこれに関連する処理を可能とした汎用あるいは専用のコンピュータ、ワークステーション、端末、携帯型電子機器、PDCやCDMA、W−CDMA、FOMA(登録商標)、GSM、IMT2000や第4世代等の携帯電話、PHS、PDA、ページャ、スマートフォンその他の電子デバイスも、本発明のラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体の少なくともいずれかに含まれる。また本明細書においては、プログラム自体もラダープログラムマクロ作成装置に含むものとする。また本プログラムは単体で使用するものに限られず、特定のコンピュータプログラムやソフトウェア、サービス等の一部として機能する態様や、必要時に呼び出されて機能する態様、OS等の環境においてサービスとして提供される態様、環境に常駐して動作する態様、バックグラウンドで動作する態様やその他の支援プログラムという位置付けで使用することもできる。   In this specification, the ladder program macro creation device, the ladder program macro creation method, the ladder program macro creation program, and the computer-readable recording medium relate to the system itself for creating and editing the ladder program macro, and the macro creation, etc. However, the present invention is not limited to devices and methods that perform input / output, display, calculation, communication, and other processes to be performed in hardware. An apparatus and method for realizing processing by software are also included in the scope of the present invention. For example, creating, registering, calling, or calling a ladder program macro by incorporating software, programs, plug-ins, objects, libraries, applets, compilers, modules, program macros that run on specific programs, etc. into a general-purpose circuit or computer General-purpose or dedicated computers, workstations, terminals, portable electronic devices, mobile phones such as PDC, CDMA, W-CDMA, FOMA (registered trademark), GSM, IMT2000, fourth generation, etc. A PHS, PDA, pager, smartphone, and other electronic devices are also included in the ladder program macro creation apparatus, the ladder program macro creation method, the ladder program macro creation program, and the computer-readable recording medium of the present invention. Even without being included in any. In this specification, the program itself is also included in the ladder program macro creation device. In addition, this program is not limited to the one used alone, but is provided as a service in an environment that functions as a part of a specific computer program, software, service, etc., an aspect that is called and functions when necessary, and an environment such as an OS. It can also be used as a mode, a mode that operates resident in the environment, a mode that operates in the background, and other support programs.

本発明の実施の形態において使用されるラダープログラムマクロ作成装置とこれに接続される操作、制御、表示、その他の処理等のためのコンピュータ、プリンタ、外部記憶装置その他の周辺機器との接続は、例えばIEEE1394、RS−232xやRS−422、USB等のシリアル接続、パラレル接続、あるいは10BASE−T、100BASE−TX、1000BASE−T等のネットワークを介して電気的、あるいは磁気的、光学的に接続して通信を行う。接続は有線を使った物理的な接続に限られず、IEEE802.1x、OFDM方式等の無線LANやBluetooth等の電波、赤外線、光通信等を利用した無線接続等でもよい。さらにデータの交換や設定の保存等を行うための記録媒体には、メモリカードや磁気ディスク、光ディスク、光磁気ディスク、半導体メモリ等が利用できる。なお本明細書においてラダープログラムマクロ作成装置とは、ラダープログラムマクロ作成装置本体のみならず、これにコンピュータ、外部記憶装置等の周辺機器を組み合わせた制御システムも含む意味で使用する。   The ladder program macro creation device used in the embodiment of the present invention is connected to a computer, a printer, an external storage device and other peripheral devices for operation, control, display, and other processing connected thereto. For example, IEEE1394, RS-232x, RS-422, serial connection such as USB, parallel connection, or 10BASE-T, 100BASE-TX, 1000BASE-T, etc. To communicate. The connection is not limited to a physical connection using a wire, but may be a wireless connection using a wireless LAN such as IEEE 802.1x or OFDM, radio waves such as Bluetooth, infrared rays, optical communication, or the like. Furthermore, a memory card, a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like can be used as a recording medium for exchanging data or storing settings. In this specification, the ladder program macro creation device is used to include not only the main body of the ladder program macro creation device but also a control system in which peripheral devices such as a computer and an external storage device are combined.

図4に、ラダープログラムマクロ作成装置を接続した制御システムの一例を示す。この図に示す制御システムは、コンピュータ1と、PLC2と、表示器3を備える。図4の例では、コンピュータ1は、ユニット構成作成プログラムと、ラダー図編集プログラムと、ラダープログラムマクロ作成プログラムの3つのプログラムを、記録媒体11を介してインストールすることにより、ラダープログラムマクロの作成、登録、実行を実現している。これらのプログラムは、個別のプログラムで構成する他、ラダー作成支援プログラムとして統合したり、一のプログラムから他のプログラムの機能を呼び出して使用することもできる。またコンピュータ1は、ラダープログラムマクロ作成プログラムのみをインストールし、ラダープログラムマクロの登録のみを行わせてもよい。以下の実施例では、ラダープログラムマクロ作成プログラムに、上記の機能を統合したプログラムを例として説明する。なおラダープログラムマクロ作成装置やプログラムは、ラダー図を直接作成する他ニモニック形式のプログラムの作成にも利用できる。   FIG. 4 shows an example of a control system to which a ladder program macro creation device is connected. The control system shown in this figure includes a computer 1, a PLC 2, and a display 3. In the example of FIG. 4, the computer 1 creates a ladder program macro by installing three programs of a unit configuration creation program, a ladder diagram editing program, and a ladder program macro creation program via the recording medium 11. Registration and execution are realized. These programs can be configured as individual programs, integrated as a ladder creation support program, or used by calling functions of other programs from one program. Further, the computer 1 may install only the ladder program macro creation program and perform only the registration of the ladder program macro. In the following embodiment, a program in which the above functions are integrated into a ladder program macro creation program will be described as an example. Note that the ladder program macro creation device and program can also be used to create other mnemonic programs that directly create ladder diagrams.

PLC2は制御対象機器である入出力機器4を接続し、これらを制御する装置である。PLC2は、内蔵するCPU部によって制御機能プログラムに従い、ラダー図編集プログラムで作成されたラダープログラムで定められた手順で、入出力機器4の動作を制御する。   The PLC 2 is a device that connects and controls the input / output device 4 that is the device to be controlled. The PLC 2 controls the operation of the input / output device 4 in accordance with a procedure defined by the ladder program created by the ladder diagram editing program according to the control function program by the built-in CPU unit.

表示器3は、PLC2に接続され、PLC2やPLC2で制御される入出力機器4の動作状態を設定し表示する。また表示器3には、制御対象機器を接続するための入出力ユニットなどを搭載することによってPLCの制御機能を備えたプログラマブル表示器を使用しても良い。あるいはソフトウェアで動作するいわゆるオープンコントローラ(ソフトウェアPLC)とすることもできる。   The display 3 is connected to the PLC 2 and sets and displays the operating state of the input / output device 4 controlled by the PLC 2 or the PLC 2. Moreover, you may use the programmable indicator provided with the control function of PLC by mounting the input / output unit etc. for connecting a control object apparatus to the indicator 3. FIG. Or what is called an open controller (software PLC) which operate | moves with software can also be used.

コンピュータ1は、汎用的なコンピュータであり、CPU5、メモリ部6、表示部7、入力デバイス8、外部記憶部9、インターフェース部10を備えている。CPU5は、コンピュータ1にインストールされているOS(オペレーティングシステム)上でユニット構成作成プログラムと、ラダー図編集プログラムと、ラダープログラムマクロ作成プログラムを含む各種のアプリケーションプログラムを動作させる際の各部の制御や演算処理を行う。メモリ部6は、RAM、ROMなどのメモリを備えており、データの格納、一時的なデータ記憶、CPUの演算処理時における作業エリアの提供といった役割を果たしている。   The computer 1 is a general-purpose computer, and includes a CPU 5, a memory unit 6, a display unit 7, an input device 8, an external storage unit 9, and an interface unit 10. The CPU 5 controls and operates each unit when operating various application programs including a unit configuration creation program, a ladder diagram editing program, and a ladder program macro creation program on an OS (operating system) installed in the computer 1. Process. The memory unit 6 includes a memory such as a RAM and a ROM, and plays a role of storing data, temporarily storing data, and providing a work area during the arithmetic processing of the CPU.

表示部7は、CRT、LCD、あるいは液晶パネルやELパネルのような平板型表示素子によって構成されている。入力デバイス8は、キーボード、マウスなどの入力操作を行うための装置であり、特に、GUI環境下で動作するラダープログラムマクロ作成プログラムでの入力作業にはマウスなどのポインティングデバイスが好適である。外部記憶部9は、ハードディスク装置等の固定ディスクドライブや磁気ディスクドライブ、CD−ROMドライブなどの光ディスクドライブといった装置であり、少なくとも、記録媒体11に記録されたラダープログラムマクロ作成プログラムなどの情報を読み出すことができる記録媒体駆動装置を含んでいる。なお、データやプログラムの読み出し、書き込みには、記録媒体を介さなくとも、ネットワーク接続されたサーバコンピュータなどと通信することにより直接外部記憶装置9で読み書きすることもできる。インターフェース部10は、表示器3やPLC2との間でデータ通信を行う入出力部である。ラダー図編集プログラムで作成されたラダープログラムは、このインターフェース部10を介してPLC2に転送され、PLC2内のメモリにダウンロードされる。   The display unit 7 is configured by a flat panel display element such as a CRT, LCD, liquid crystal panel, or EL panel. The input device 8 is an apparatus for performing an input operation such as a keyboard and a mouse. In particular, a pointing device such as a mouse is suitable for an input operation in a ladder program macro creation program that operates in a GUI environment. The external storage unit 9 is a device such as a fixed disk drive such as a hard disk device, an optical disk drive such as a magnetic disk drive, or a CD-ROM drive, and reads at least information such as a ladder program macro creation program recorded in the recording medium 11. A recording medium driving device capable of recording a recording medium; Note that data and programs can be read and written directly by the external storage device 9 by communicating with a server computer or the like connected to a network without using a recording medium. The interface unit 10 is an input / output unit that performs data communication with the display 3 and the PLC 2. The ladder program created by the ladder diagram editing program is transferred to the PLC 2 via the interface unit 10 and downloaded to the memory in the PLC 2.

上記のコンピュータ1で実現されるラダープログラムマクロ作成装置は、マクロの引数としてユニット番号やデバイス番号などを設定可能な引数設定部と、引数設定部で引数に設定されたデバイス番号を相対値に変換するマクロ登録変換部と、マクロ登録変換部で所定の変換を行ったマクロを登録するマクロ登録部と、マクロ登録部に登録されたマクロの呼び出し時に、引数の相対値をデバイス番号に変換するマクロ実行変換部を備える。これらの部材や機能を実現するための処理は、実質的にはコンピュータ1のCPU5で実行される。   The ladder program macro creation device realized by the above computer 1 converts an argument setting unit that can set a unit number, a device number, etc. as a macro argument, and a device number set as an argument in the argument setting unit into a relative value A macro registration conversion unit, a macro registration unit that registers a macro that has undergone predetermined conversion by the macro registration conversion unit, and a macro that converts a relative value of an argument into a device number when a macro registered in the macro registration unit is called An execution conversion unit is provided. Processing for realizing these members and functions is substantially executed by the CPU 5 of the computer 1.

[ユーザインターフェース]
図5は、ラダープログラムマクロ作成プログラムの一インターフェース画面を示す。この図に示す画面は、ツリー表示部15と、ラダー図表示部16と、検索結果文字列表示部17を備える。なお、これらの画面において各入力欄や各ボタン等の配置、形状、表示の仕方、サイズ、配色、模様等は適宜変更できることはいうまでもない。デザインの変更によってより見やすく、評価や判断が容易な表示としたり操作しやすいレイアウトとすることもできる。例えば検索条件をウィザード形式で入力させるようにして、ユーザは質問に答えていくだけで必要な設定ができるようにしても良い。また、本明細書の説明では検索結果を別ウィンドウで表示させている場合や同一ウィンドウ内に表示している場合があるが、いずれか一方に変更したり両者を併用させても利用できることはいうまでもない。
[User interface]
FIG. 5 shows an interface screen of the ladder program macro creation program. The screen shown in this figure includes a tree display unit 15, a ladder diagram display unit 16, and a search result character string display unit 17. In these screens, it goes without saying that the arrangement, shape, display method, size, color scheme, pattern, etc. of the input fields and buttons can be changed as appropriate. By changing the design, the layout can be made easier to display, easier to evaluate and judge, and easy to operate. For example, the search conditions may be input in a wizard format so that the user can make the necessary settings simply by answering the question. In the description of this specification, the search result may be displayed in a separate window or in the same window, but it can be used by changing to either one or using both together. Not too long.

これらのプログラムのユーザインターフェース画面において、仮想的に設けられたボタン類や入力欄に対するON/OFF操作、数値や命令入力等の指定は、ラダープログラムマクロ作成プログラムをインストールされたコンピュータ1に設けられた入力デバイスで行う。本明細書において「押下する」とは、ボタン類に物理的に触れて操作する他、入力デバイスによりクリックあるいは選択して擬似的に押下することを含む。入出力デバイスはコンピュータ1と有線もしくは無線で接続され、あるいはコンピュータ1に固定されている。一般的な入力デバイスとしては、例えばマウスやキーボード、スライドパッド、トラックポイント、タブレット、ジョイスティック、コンソール、ジョグダイヤル、デジタイザ、ライトペン、テンキー、タッチパッド、アキュポイント等の各種ポインティングデバイスが挙げられる。また、インターフェース画面を表示する表示部自体にタッチスクリーンやタッチパネルを利用して、画面上をユーザが手で直接触れることにより入力や操作を可能としたり、または音声入力その他の既存の入力手段を利用、あるいはこれらを併用することもできる。   On the user interface screens of these programs, ON / OFF operations for numerically provided buttons and input fields, numerical values, command inputs, and the like are specified in the computer 1 in which the ladder program macro creation program is installed. Use an input device. In this specification, “pressing” includes not only physically touching and operating buttons, but also clicking or selecting with an input device for pseudo-pressing. The input / output device is connected to the computer 1 by wire or wirelessly, or is fixed to the computer 1. Examples of general input devices include various pointing devices such as a mouse, keyboard, slide pad, track point, tablet, joystick, console, jog dial, digitizer, light pen, numeric keypad, touch pad, and accu point. In addition, using a touch screen or touch panel on the display unit itself that displays the interface screen, the user can directly input and operate the screen by hand, or use voice input or other existing input means. Or these can also be used together.

なお、ラダープログラムマクロ作成プログラムをインストールされたコンピュータ1に接続された入出力デバイスから設定を行う態様の他、ラダープログラムマクロ作成プログラムやハードウェアをPLCに組み込み、PLC側で設定を行えるようにしても良い。この場合、入出力デバイスはPLCに設けられあるいは接続され、必要に応じて表示器やモニタ等が接続される。   In addition to an aspect in which the ladder program macro creation program is set from an input / output device connected to the computer 1 in which the ladder program macro creation program is installed, a ladder program macro creation program and hardware are incorporated in the PLC so that the setting can be performed on the PLC side. Also good. In this case, the input / output device is provided in or connected to the PLC, and a display, a monitor, or the like is connected as necessary.

[ツリー表示部15]
ツリー表示部15は、制御プログラムのファイル構成やPLCシステムの構成などを表示すると共に、メインの作業領域であるラダー図表示部16で表示、編集等の作業を行いたい項目を選択するための領域である。選択された項目はツリー表示部15でハイライト表示されるとともに、選択された項目に応じてラダー図表示部16での表示内容が切り替えられる。例えば、ラダープログラムのモジュールをツリー表示部15から選択すると、選択されたラダープログラムがラダー図表示部16で表示されて、プログラムの編集作業が可能となる。ラダープログラムの編集は、ラダー図編集プログラムで行う。
[Tree display section 15]
The tree display unit 15 displays a control program file configuration, a PLC system configuration, and the like, and an area for selecting items to be displayed and edited in the ladder diagram display unit 16 which is a main work area. It is. The selected item is highlighted on the tree display unit 15, and the display content on the ladder diagram display unit 16 is switched according to the selected item. For example, when a module of a ladder program is selected from the tree display unit 15, the selected ladder program is displayed on the ladder diagram display unit 16, and the program can be edited. The ladder program is edited using the ladder diagram editing program.

またツリー表示部15で項目を選択することによって、PLCを構成するユニットに関する設定やコメント、ラベルなどの編集、ローカルデバイスの設定など、PLCのシステム設定も行える。例えばPLCを構成する各ユニットに割り当てられたデバイスの範囲を設定できる。このような設定には、ユニット構成プログラムが使用される。   Also, by selecting an item in the tree display section 15, PLC system settings such as settings relating to units constituting the PLC, editing of comments and labels, setting of local devices, and the like can be performed. For example, the range of devices assigned to each unit constituting the PLC can be set. A unit configuration program is used for such setting.

ユニット構成プログラムは、PLCシステムを構成するユニットとして選択可能なユニットの選択肢の中から、ユーザが選択したユニットをコンピュータ画面上で任意に配列することにより、図1や図2に示すようにPLCシステムを画面上でイメージ的に構築する。各ユニットには、CPUユニットからの接続順に、ユニット番号が付与されている。また、構成されたPLCの動作をシュミレーションすることもできる。   The unit configuration program arranges the units selected by the user from the choices of units that can be selected as the units constituting the PLC system on the computer screen, so that the PLC system as shown in FIG. 1 and FIG. On the screen. Each unit is assigned a unit number in the order of connection from the CPU unit. Also, the operation of the configured PLC can be simulated.

さらにユニット構成プログラムは、PLCシステムの各構成ユニットのデバイスにリレー使用可能範囲、DM使用可能範囲を割り付ける機能を備える。割り付けは、図2(b)に示すようにユニット番号毎に範囲で指定される。ユニット構成プログラムプログラムは、図2(a)に示すようなビジュアル表示と、図2(b)に示すようなボックス表示を切り替えて表示し、各ユニットのリレー等の割付の設定及び確認を行う。   Further, the unit configuration program has a function of assigning the relay usable range and DM usable range to the devices of the respective constituent units of the PLC system. As shown in FIG. 2B, the allocation is specified in a range for each unit number. The unit configuration program program switches between a visual display as shown in FIG. 2A and a box display as shown in FIG. 2B, and performs setting and confirmation of the assignment of relays and the like of each unit.

このようなユニット構成プログラムを含むことで、ユニット構成プログラムで作成したデータを活用して、このデータをマクロの作成時に取り込むことで、ユニット構成プログラムで作成したデータをマクロ作成プログラムで活用し、また、マクロ作成プログラムで作成したデータをラダー図編集プログラムで活用することができ、ラダー図作成におけるユーザの入力作業の負担を軽減することができる。   By including such a unit configuration program, the data created by the unit configuration program can be used, and when this macro is created, the data created by the unit configuration program can be used by the macro creation program. The data created by the macro creation program can be utilized by the ladder diagram editing program, and the burden of the user's input work in creating the ladder diagram can be reduced.

[ラダー図表示部16]
ラダー図表示部16は、編集対象のラダー図を表示する。ラダー図は、ラダー図表示領域に構成され、ラダー図表示領域の一部もしくは全体がラダー図表示部16で表示される。ラダー図表示領域の全体がラダー図表示部16の表示領域に収まらないときは、ラダー図表示領域の一部をラダー図表示部16で表示し、画面をスクロールして他の部分を表示する。また表示倍率を変更してラダー図表示領域の全体を表示したり、一部を拡大することもできる。
[Ladder diagram display unit 16]
The ladder diagram display unit 16 displays a ladder diagram to be edited. The ladder diagram is configured in a ladder diagram display area, and a part or the whole of the ladder diagram display area is displayed on the ladder diagram display unit 16. When the entire ladder diagram display area does not fit in the display area of the ladder diagram display unit 16, a part of the ladder diagram display region is displayed on the ladder diagram display unit 16, and the screen is scrolled to display other parts. The display magnification can be changed to display the entire ladder diagram display area, or a part of it can be enlarged.

[検索結果文字列表示部17]
ラダープログラムマクロ作成プログラムは検索機能を備えており、検索結果文字列表示部17は、検索機能実行時に検索対象の文字列を含む行を一覧で表示するための領域である。検索は、文字列の検索であるため、プログラムをシンボルで表示するラダー図よりも文字列で表示するニモニック形式で行うのが好ましい。文字列の検索には既存のテキストエディタなどで利用される既知の手法や将来開発される文字列検索の手法が適宜利用できる。例えば大文字小文字、全角半角、長音記号の有無などの表記ゆれを考慮した曖昧検索、複数の検索キーワードによるAND検索やOR検索、NOT検索やGREP検索などが適宜利用できる。検索したい文字列としては、例えば命令語、デバイス名やPLCのアドレス、定数等のオペランド、コメント文等が挙げられる。また検索条件の指定には、範囲指定やワイルドカードの利用なども適宜採用できる。検索結果文字列表示部17は、図5に示すように画面の下部に一体的に表示する方式の他、別ウィンドウで表示させることもできるし、図6のように非表示とすることもできる。
[Search result character string display unit 17]
The ladder program macro creating program has a search function, and the search result character string display unit 17 is an area for displaying a list of lines including the character string to be searched when executing the search function. Since the search is a search for a character string, it is preferable to perform the search in a mnemonic format that displays a program as a character string rather than a ladder diagram that displays a program as a symbol. A known method used in an existing text editor or a character string search method developed in the future can be used as appropriate for the character string search. For example, an ambiguous search that takes into account fluctuations such as upper / lower case letters, full-width / half-width characters, the presence or absence of a long sound symbol, an AND search or OR search using a plurality of search keywords, a NOT search, or a GREP search can be used as appropriate. Examples of character strings to be searched include command words, device names, PLC addresses, operands such as constants, comment sentences, and the like. For specifying the search condition, range specification, use of a wild card, or the like can be adopted as appropriate. The search result character string display unit 17 can be displayed in a separate window in addition to the method of displaying it integrally at the bottom of the screen as shown in FIG. 5, or can be hidden as shown in FIG. .

以上のようにして、ユーザはラダー図編集機能で作成された制御プログラムを、マクロとして登録しておき、これをプログラム作成時に呼び出して使用できる。マクロによって、ユーザは以前作成したラダー図を流用でき、プログラミング作業を省力化できる。しかしながら、従来のマクロにおいては、デバイスを表現する際、そのアドレスを直値で表現するか、あるいはアドレスを引数として、マクロ実行時にユーザが所望のアドレスを直値で入力する必要があった。この方法では、ユニットのシステム構成が変更された場合、すなわちユニットに割り当てられたアドレスが変更になった場合にマクロをそのまま使用できないという問題があった。   As described above, the user can register the control program created by the ladder diagram editing function as a macro and call it at the time of creating the program for use. Macros allow users to divert previously created ladder diagrams and save programming effort. However, in a conventional macro, when expressing a device, the address must be expressed as a direct value, or the user must input a desired address as a direct value when executing the macro using the address as an argument. This method has a problem that the macro cannot be used as it is when the system configuration of the unit is changed, that is, when the address assigned to the unit is changed.

そこで本実施の形態では、マクロでデバイスを表現する際、引数としてユニット番号を指定可能とすることで、該ユニットに割り当てられたデバイスを直値でなく相対値として保持している。そして、マクロの使用時に引数として指定されたユニット番号に応じて、該ユニットにマクロの実行時点で割り当てられているデバイスに応じて、マクロ内のデバイスを相対値から直値に変換する。これによって、使用するユニットに応じてプログラム側が自動的にアドレスを変換してマクロを使用可能としてくれるため、ユーザはユニット毎に割り当てられたデバイスの範囲を意識することなく、マクロを登録、使用することが可能となり、マクロの利用が容易になる。またこの方法であれば、ユニットへのデバイス割り当てが変更されてもマクロが使用できるため、ユーザはマクロのデバッグ作業を行うことなく異なるシステム構成においても使用できる。   Therefore, in this embodiment, when a device is expressed by a macro, a unit number can be specified as an argument, so that a device assigned to the unit is held as a relative value instead of a direct value. Then, according to the unit number designated as an argument when the macro is used, the device in the macro is converted from a relative value to a direct value according to the device assigned to the unit at the time of execution of the macro. As a result, the program automatically converts the address according to the unit to be used, and the macro can be used, so the user can register and use the macro without being aware of the device range assigned to each unit. This makes it easier to use macros. Also, with this method, since the macro can be used even if the device assignment to the unit is changed, the user can also use it in different system configurations without performing macro debugging work.

以下、ユニットに割り当てられたデバイスをマクロに登録して、このマクロを制御プログラム中で使用する手順を図6〜図8に基づいて説明する。   A procedure for registering a device assigned to a unit in a macro and using the macro in a control program will be described below with reference to FIGS.

[マクロの登録]
ここでは、図7に示す制御プログラムをマクロとして登録する手順を説明する。この例で説明するPLC制御システムにはユニットAのみが接続されており、ユニットAのユニット番号は1、ユニットAに割り当てられているデバイスの領域は、リレー番号がR3000〜R3115と、データメモリアドレス番号がDM100〜DM419であるとする。
[Register Macro]
Here, a procedure for registering the control program shown in FIG. 7 as a macro will be described. Only the unit A is connected to the PLC control system described in this example, the unit number of the unit A is 1, the device area allocated to the unit A is the relay number R3000 to R3115, and the data memory address Assume that the numbers are DM100 to DM419.

まず、図7の左側に表示されるマクロ登録前の制御プログラムを作成する。この作業はラダープログラムマクロ作成プログラムに含まれるラダー図編集機能や、別のプログラムであるラダー図編集プログラムを呼び出す等の方法により行われる。例えばラダーシンボルをテンプレート中から選択し、ドラッグ&ドロップなどにより所望の位置に配置する。さらに、ラダー命令語やデバイス番号等のオペランドなど、必要な情報を入力する。デバイス番号には、リレー番号(R)やデータメモリアドレス番号(DM)等がある。なお、この制御プログラム中で使用されるデバイスの内、R3000とDM120はユニットAに割り当てられたデバイス領域範囲内である。   First, a control program before macro registration displayed on the left side of FIG. 7 is created. This work is performed by a method such as calling a ladder diagram editing function included in the ladder program macro creation program or a ladder diagram editing program which is another program. For example, a ladder symbol is selected from the template and placed at a desired position by drag and drop. Furthermore, necessary information such as ladder instruction words and operands such as device numbers are input. The device number includes a relay number (R) and a data memory address number (DM). Of the devices used in this control program, R3000 and DM120 are within the device area range assigned to unit A.

また、マクロの作成においては、引数を指定することができる。引数とは、一般にはプログラム内の関数にあてられる値やパラメータであり、デバイス番号やユニット番号等を指定する。図6に、ラダープログラムマクロ作成プログラムで引数設定ダイヤログ30を表示して引数を設定する画面例を示す。引数設定ダイヤログ30は引数設定部の一形態であり、この画面上で引数のタイトル、パレット用説明、ユニット種類等を設定する。ここでは引数デバイスP0、P1、P2のそれぞれの内容を設定する。   When creating a macro, arguments can be specified. An argument is generally a value or parameter assigned to a function in a program, and specifies a device number, a unit number, or the like. FIG. 6 shows an example of a screen for setting the argument by displaying the argument setting dialog 30 by the ladder program macro creation program. The argument setting dialog 30 is a form of the argument setting unit, and sets the title of the argument, the description for the palette, the unit type, and the like on this screen. Here, the contents of the argument devices P0, P1, and P2 are set.

以上のようにして引数設定部からマクロの引数を設定し、図7の例ではユニット番号1を設定する。このとき、引数としてユニット番号1が設定されたユニットAに割り当てられたデバイス領域範囲内に含まれるデバイスR3000とDM120は、後述するようにマクロの登録時にマクロ登録変換部で自動的に抽出されて該ユニット用の引数デバイスに置換される。また、ユニット番号以外にも必要なデバイス番号を引数デバイスとして指定する。引数としてデバイス番号を指定する方法は、従来と同様である。   As described above, the macro argument is set from the argument setting unit, and unit number 1 is set in the example of FIG. At this time, the devices R3000 and DM120 included in the device area range assigned to the unit A in which unit number 1 is set as an argument are automatically extracted by the macro registration conversion unit at the time of macro registration, as will be described later. Replaced with the argument device for the unit. In addition to the unit number, a necessary device number is specified as an argument device. The method for specifying a device number as an argument is the same as in the conventional method.

その後、マクロの登録を行なう。マクロの登録はドラッグ&ドロップ類似の操作で登録できる。例えば、図5のラダー図表示部16から、編集中のプログラムの所望の範囲を選択後、ツリー表示部15にドラッグ&ドロップ操作することにより、選択された範囲のプログラムがマクロとして登録され、ツリー表示部15に登録されたマクロのアイコンが表示される。   Then, macro registration is performed. Macro registration can be done by drag and drop similar operations. For example, after selecting a desired range of the program being edited from the ladder diagram display unit 16 in FIG. 5, by dragging and dropping to the tree display unit 15, the program in the selected range is registered as a macro. Macro icons registered in the display unit 15 are displayed.

また、登録されたマクロの使用時においても、ツリー表示部15から所望のマクロをドラッグし、ラダー図表示部16で編集中のプログラムの任意の位置にドロップすることで、マクロが貼り付けられる。このとき、マクロ内で引数に設定された項目の入力欄が表示され、ユーザは所望の値を入力する。マクロは、マクロとして登録された具体的なプログラムを展開して表示されても良いし、図3の展開プログラムに示すように、マクロとして省略して表示しても良い。なお、マクロに登録された回路のデバイスは、ユーザが任意のデバイスに変更することもできる。このようにマクロを利用することで、ラダー作成工数、デバッグ工数を大幅に削減できる。   Even when a registered macro is used, a desired macro can be pasted by dragging a desired macro from the tree display unit 15 and dropping it in an arbitrary position of the program being edited on the ladder diagram display unit 16. At this time, an input field for an item set as an argument in the macro is displayed, and the user inputs a desired value. The macro may be displayed by expanding a specific program registered as a macro, or may be displayed by omitting it as a macro as shown in the expanded program of FIG. The device of the circuit registered in the macro can be changed to any device by the user. By using macros in this way, ladder creation man-hours and debugging man-hours can be greatly reduced.

図7の例では、マクロ登録部でMACROAとして登録した。登録されたマクロでは、ユニットに割り当てられたR3000とDM120のデバイスは、マクロ登録変換部でユニット用の引数デバイスに置換される。この例では、R3000のデバイスはUR0に、DM120のデバイスUM0+20に、それぞれ置換されている。ここで、UR0、UM0はそれぞれ、ユニット番号で指定されるデバイス領域範囲の先頭デバイス番号を表す。また、UM0+20の表記は、UM0の示すデバイス番号から20だけオフセットしたデバイスを表す。例えばDM0+100であれば、DM100を表す。   In the example of FIG. 7, the macro registration unit registers as MACROA. In the registered macro, the R3000 and DM120 devices assigned to the unit are replaced with the unit argument device by the macro registration conversion unit. In this example, the R3000 device is replaced with UR0 and the DM120 device UM0 + 20. Here, UR0 and UM0 each represent the first device number of the device area range specified by the unit number. The notation UM0 + 20 represents a device offset by 20 from the device number indicated by UM0. For example, DM0 + 100 represents DM100.

また、ユニットAに割り当てられていないデバイス番号で引数として指定された引数デバイスについては、通常通りユーザがマクロの使用時に所望の値を指定することになる。図7の例では、マクロ登録後はデバイス番号R0000が引数P1として、デバイス番号DM0が引数P2としてそれぞれ表示され、またDM2は引数P2に基づきP2+2と表示される。さらに、引数として指定されたなかったデバイス番号については、実デバイスとしてそのまま表示される。図7の例では、デバイス番号R0500、R0515がマクロ登録後もそのまま引き継がれる。   As for the argument device designated as an argument with the device number not assigned to the unit A, the user designates a desired value when using the macro as usual. In the example of FIG. 7, after macro registration, the device number R0000 is displayed as an argument P1, the device number DM0 is displayed as an argument P2, and DM2 is displayed as P2 + 2 based on the argument P2. Furthermore, device numbers that were not specified as arguments are displayed as real devices. In the example of FIG. 7, the device numbers R0500 and R0515 are taken over as they are after macro registration.

[マクロの使用]
次に、登録されたマクロを制御プログラムに使用する手順を図8に基づき説明する。図8では、図7で登録したマクロMACROAをユーザが別の制御プログラムに組み込んで、あるいは呼び出して使用する。この例では、ユニットAはCPUユニットから数えて3台目に接続されており、すなわちユニット番号は3であり、ユニットAに割り当てられているデバイスの領域は、R3500〜R3615とDM110〜DM429であるとする。
Use macro
Next, a procedure for using the registered macro in the control program will be described with reference to FIG. In FIG. 8, the macro MACROA registered in FIG. 7 is used by the user by being incorporated in another control program or by calling. In this example, the unit A is connected to the third unit counted from the CPU unit, that is, the unit number is 3, and the device areas allocated to the unit A are R3500 to R3615 and DM110 to DM429. And

まず、マクロの引数をユーザが入力あるいは指定する。MACROAでは、引数としてユニット番号、P1、P2が設定されていた。ここでは、ユニット番号3、P1=R1500、P2=DM10を入力し、指定された値に基づいてマクロ実行変換部がマクロを変換する。ユニット番号3が割り当てられているデバイスAの、デバイス領域範囲の先頭デバイスはR3500であるから、MACROAのUR0はR3500に、UM0+20は、DM110+20=DM130に、それぞれ変換される。また、通常の引数デバイスとして指定されたP1はR1500、P2はDM10、P2+2はDM10+2=DM12に、それぞれ変換される。さらに実デバイスで指定されたデバイスはそのまま維持される。この結果、MACROAの実体として、図8の左側に示す展開マクロプログラムが生成される。   First, the user inputs or specifies macro arguments. In MACROA, unit numbers, P1 and P2 are set as arguments. Here, unit number 3, P1 = R1500, and P2 = DM10 are input, and the macro execution conversion unit converts the macro based on the designated value. Since device A to which unit number 3 is assigned is the first device in the device area range of R3500, UR0 of MACROA is converted to R3500, and UM0 + 20 is converted to DM110 + 20 = DM130. Also, P1 designated as a normal argument device is converted to R1500, P2 to DM10, and P2 + 2 to DM10 + 2 = DM12. Furthermore, the device designated by the real device is maintained as it is. As a result, the expanded macro program shown on the left side of FIG. 8 is generated as the MACROA entity.

[ユニット構成の変更]
次に、登録されたマクロにおいて使用されるユニットの構成が変更になった場合の動作について説明する。まず、ユニットの接続順序を変更する等してユニット番号が変わった場合は、上述のとおり、ユニットに対応してマクロ中で用いられているマクロの引数を自動で検索して、ユニット番号を新しいものに変更する。この場合は、マクロを修正する必要はない。一方、ユニット自体が削除された場合は、該ユニットに対応するデバイスは、保留デバイスとする。この場合はユニットが存在しないためデバイス番号を決定できず、このマクロの使用時にユーザが直接デバイス番号を指定する、あるいはマクロを修正して新たなデバイス番号を指定する等の方法で対処する。
[Change unit configuration]
Next, an operation when the configuration of a unit used in a registered macro is changed will be described. First, if the unit number changes due to changing the unit connection order, etc., as described above, the macro argument used in the macro corresponding to the unit is automatically searched and the unit number is changed to a new one. Change to something. In this case, there is no need to modify the macro. On the other hand, when the unit itself is deleted, the device corresponding to the unit is a reserved device. In this case, since the unit does not exist, the device number cannot be determined, and the user directly specifies the device number when using the macro, or corrects the macro and specifies a new device number.

また、ユニット番号はそのままで、ユニットに割り当てられたデバイス領域範囲を変更した場合は、マクロの変更は不要である。マクロの登録時に、ユニットに割り当てられたデバイス領域範囲に対応してデバイス番号を決定できるように、予めオフセット位置等の相対値で規定されているため、マクロをプログラムで使用していてもマクロの引数を変更する必要はない。   In addition, if the device area range assigned to the unit is changed without changing the unit number, the macro need not be changed. When registering a macro, the device number is determined in advance so that the device number can be determined according to the device area range assigned to the unit. There is no need to change the argument.

このように、本発明の実施の形態によれば、ユニット構成の変更に応じてマクロを修正する手間を省き、プログラミング作業が省力化できるという優れた特長が得られる。PLCのプログラミングに利用される従来のマクロは、実デバイスで指定されていたため、ユニット構成が変更されると、これに応じて実デバイスの値を修正する必要があった。特に、従来のマクロではユニット毎に割り当てられたデバイス領域範囲を知ることができないため、自動的にマクロを修正することもできなかった。これに対して本発明の実施の形態では、特殊な引数としてユニット番号を指定可能とすることにより、該ユニット番号のユニットに割り当てられたデバイス領域範囲をプログラム側で問い合わせ可能とした。そして、このデバイス領域範囲に含まれるデバイス番号を実アドレスでなく、デバイス領域範囲の先頭デバイスを基準とする相対的な引数デバイスとすることで、マクロがユニット番号をCPUユニットなどに問い合わせることで、該当するユニットに割り当てられたデバイス領域範囲を確認でき、相対的に特定される引数デバイスのデバイス番号も特定できる。これによって、一旦登録したマクロをユニット構成を変更した場合でもそのまま利用可能として、マクロの利用が大いに促進される。マクロは本来的に一度行った作業や手順と同様の作業を繰り返し行わせるものであり、プログラミング作業の負担を低減するものである。そのマクロを容易に利用できるようにすることで、本発明の実施の形態によってさらにマクロの使用が促進されてプログラミング作業の効率が改善されるという効果が得られる。また、ユーザは引数としてユニット番号を指定するだけで、このユニットのデバイス領域範囲に含まれるデバイス番号の抽出やオフセット量での引数デバイスの指定などの作業はマクロ側で自動的に処理可能であるため、ユーザは一々ユニット毎のデバイスの割り当てなどを気にする必要はない。このようなデバイス情報をユーザは意識することなく、マクロの登録や実行を容易に行うことができ、マクロを利用し易い環境が提供される。   Thus, according to the embodiment of the present invention, it is possible to obtain an excellent feature that the labor of correcting the macro according to the change in the unit configuration can be saved and the programming work can be saved. Since the conventional macro used for PLC programming is specified by an actual device, when the unit configuration is changed, the value of the actual device needs to be corrected accordingly. In particular, since the conventional macro cannot know the device area range assigned to each unit, the macro cannot be automatically corrected. On the other hand, in the embodiment of the present invention, the unit number can be designated as a special argument, so that the device area range assigned to the unit of the unit number can be inquired on the program side. And by making the device number included in this device area range not a real address but a relative argument device based on the first device in the device area range, the macro inquires the CPU unit etc. for the unit number, The device area range assigned to the corresponding unit can be confirmed, and the device number of the relatively specified argument device can also be specified. As a result, once a macro is registered, it can be used as it is even when the unit configuration is changed, and the use of the macro is greatly promoted. The macro is intended to repeatedly perform the same work and procedure as originally performed, and reduces the burden of programming work. By making the macro easily available, the use of the macro is further promoted by the embodiment of the present invention, and the efficiency of the programming operation is improved. Also, the user can specify the unit number as an argument, and the macro side can automatically perform operations such as extracting the device number included in the device area range of this unit and specifying the argument device with the offset amount. Therefore, the user does not need to worry about device allocation for each unit. Macro registration and execution can be easily performed without the user being aware of such device information, and an environment in which macros can be easily used is provided.

本発明の実施の形態に係るラダープログラムマクロ作成は、以下のようにしてマクロを登録、実行する。   The ladder program macro creation according to the embodiment of the present invention registers and executes a macro as follows.

1.マクロの登録
編集作業中のプログラムで対象とされているユニットのシステム構成情報を、CPUユニットから取得する。特に、このユニットに割り当てられているデバイスの範囲を取得する。そしてプログラム中から、この範囲に含まれるデバイスをリストアップし、ユニット用のデバイスとしてマクロ登録変換部が置換する。例えば、ユニットBが割り当てられているデバイスの領域を、DM3000〜DM3115とし、マクロ中に使用されるデバイスとしてDM2999、DM3000、DM3010、DM3115、DM3116が存在する場合、これらのデバイスはマクロ登録変換部によって以下のように置換される。
DM2999→DM2999(デバイスの範囲外なので変更無し)
DM3000→UM0
DM3010→UM0+10
DM3115→UM0+115
DM3116→DM3116(デバイスの範囲外なので変更無し)
1. Macro registration Acquires the system configuration information of the unit targeted by the program being edited from the CPU unit. In particular, get the range of devices assigned to this unit. Then, the devices included in this range are listed from the program, and the macro registration conversion unit replaces them as device devices. For example, if the area of the device to which unit B is allocated is DM 3000 to DM 3115 and DM 2999, DM 3000, DM 3010, DM 3115, and DM 3116 exist as devices used in the macro, these devices are converted by the macro registration conversion unit. Is replaced as follows:
DM2999 → DM2999 (No change because it is out of device range)
DM3000 → UM0
DM3010 → UM0 + 10
DM3115 → UM0 + 115
DM3116 → DM3116 (No change because it is out of device range)

以上のように、マクロ登録変換部は、引数のユニット番号に割り当てられたデバイス範囲に含まれるデバイスについては、自動的にデバイス番号を相対アドレスに変更する。これによって、このユニットの接続位置や形態が変更されてユニット番号が変更され、割り当てられるデバイス番号が変更された場合でも、マクロ側でこれに応じたデバイス番号に自動的に変換される。   As described above, the macro registration conversion unit automatically changes the device number to a relative address for a device included in the device range assigned to the argument unit number. As a result, the unit number is changed by changing the connection position and form of this unit, and even when the assigned device number is changed, the macro side automatically converts it to the corresponding device number.

2.マクロの使用
プログラムでマクロを使用する場合は、引数を入力する必要がある。引数にユニット番号がある場合、ユニット番号に基づき、該当ユニットに割り当てられたデバイス先頭番号を取得する。そして、その先頭番号をマクロ実行変換部がマクロ内のユニット用のデバイスと置換する。例えば、ユニットBに割り当てられているデバイスの領域を、DM4000〜DM4115とする。このユニットに上記のマクロを使用する場合、マクロ実行変換部は先頭デバイス番号を基準として、マクロ中に登場したデバイスを以下のように置換する。
UM0→DM4000
UM0+10→DM4010
UM0+115→DM4115
なお、DM2999とDM3116については、引数でないので変更はない。
2. Using macros To use macros in a program, you must enter arguments. When the unit number is included in the argument, the device head number assigned to the corresponding unit is acquired based on the unit number. Then, the macro execution conversion unit replaces the head number with the device for the unit in the macro. For example, the area of the device allocated to the unit B is assumed to be DM4000 to DM4115. When the above macro is used for this unit, the macro execution conversion unit replaces the device appearing in the macro as follows based on the head device number.
UM0 → DM4000
UM0 + 10 → DM4010
UM0 + 115 → DM4115
Note that DM2999 and DM3116 are not arguments and are not changed.

以上のように、マクロ実行変換部はユニットに割り当てられた先頭デバイス番号を基準として、マクロ登録変換部で相対アドレスに変換されたデバイスを実デバイス番号に復号する。これによって、作成されたマクロは、ユニットの構成に応じて適切なデバイス番号に変換されて実行可能となる。   As described above, the macro execution conversion unit decodes the device converted into the relative address by the macro registration conversion unit into the actual device number with reference to the head device number assigned to the unit. As a result, the created macro can be converted into an appropriate device number according to the unit configuration and executed.

なお、マクロ登録変換部とマクロ実行変換部とは、別部材とする必要はなく、同じ部材で構成することもできる。例えば、CPUユニットに備えられたCPUなどの制御部がこれらの変換機能を実現する。同様に、引数設定部やマクロ登録部についても、実際の処理はCPUユニットなどで実現可能である。   Note that the macro registration conversion unit and the macro execution conversion unit do not have to be separate members, and can be configured by the same member. For example, a control unit such as a CPU provided in the CPU unit realizes these conversion functions. Similarly, for the argument setting unit and the macro registration unit, the actual processing can be realized by a CPU unit or the like.

以上、PLCのラダー回路をプログラミングする装置を説明したが、本発明はPLCを接続した用途に限定されるものでなく、ラダープログラムの作成、編集を行うあらゆるアプリケーションに適用できる。   The apparatus for programming the PLC ladder circuit has been described above. However, the present invention is not limited to the application to which the PLC is connected, and can be applied to any application for creating and editing ladder programs.

本発明のラダープログラムマクロ作成装置、ラダープログラムマクロ作成方法、ラダープログラムマクロ作成プログラムおよびコンピュータで読み取り可能な記録媒体は、作成したラダープログラムをPLCに転送して制御プログラムを実行させることができる。   The ladder program macro creation apparatus, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium of the present invention can transfer the created ladder program to the PLC and execute the control program.

PLCシステムの一例においてユニット番号を示すイメージ図である。It is an image figure which shows a unit number in an example of a PLC system. PLCシステムの他の例において、各ユニットのユニット番号と各ユニットに割り当てられたデバイス領域範囲とを示すイメージ図である。In another example of a PLC system, it is an image figure which shows the unit number of each unit, and the device area | region range allocated to each unit. 登録済みマクロをアプリケーションに使用する態様を示す概念図である。It is a conceptual diagram which shows the aspect which uses a registered macro for an application. 本発明の実施の形態に係るラダープログラムマクロ作成装置を接続した制御システムの一例を示すブロック図である。It is a block diagram which shows an example of the control system which connected the ladder program macro creation apparatus which concerns on embodiment of this invention. 本発明の実施の形態に係るラダープログラムマクロ作成プログラムの一インターフェース画面を示すイメージ図である。It is an image figure which shows one interface screen of the ladder program macro creation program which concerns on embodiment of this invention. 本発明の他の実施の形態に係るラダープログラムマクロ作成プログラムで引数を設定する画面を示すイメージ図である。It is an image figure which shows the screen which sets an argument with the ladder program macro creation program which concerns on other embodiment of this invention. 制御プログラムをマクロとして登録する手順を示す概念図である。It is a conceptual diagram which shows the procedure which registers a control program as a macro. 登録されたマクロを制御プログラムに使用する手順を示す概念図である。It is a conceptual diagram which shows the procedure which uses the registered macro for a control program.

符号の説明Explanation of symbols

1…コンピュータ
2…PLC
3…表示器
4…入出力機器
5…CPU
6…メモリ部
7…表示部
8…入力デバイス
9…外部記憶部
10…インターフェース部
11…記録媒体
15…ツリー表示部
16…ラダー図表示部
17…検索結果文字列表示部
21…ユニット構成作成プログラム
22…ラダー図編集プログラム
23…ラダープログラムマクロ作成プログラム
30…引数設定ダイヤログ
31…CPUユニット
32…PLCシステム
33…ユニット
34…データファイル
1 ... Computer 2 ... PLC
3 ... Display 4 ... Input / output equipment 5 ... CPU
DESCRIPTION OF SYMBOLS 6 ... Memory part 7 ... Display part 8 ... Input device 9 ... External storage part 10 ... Interface part 11 ... Recording medium 15 ... Tree display part 16 ... Ladder figure display part 17 ... Search result character string display part 21 ... Unit structure creation program 22 ... Ladder diagram editing program 23 ... Ladder program macro creation program 30 ... Argument setting dialog 31 ... CPU unit 32 ... PLC system 33 ... Unit 34 ... Data file

Claims (7)

複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成装置であって、
複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定可能な引数設定部と、
登録前のマクロ中に含まれる複数のデバイス番号から、前記引数設定部で引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換するマクロ登録変換部と、
前記引数設定部で設定されたユニット番号を引数に含むマクロを登録するマクロ登録部と、
を備えることを特徴とするラダープログラムマクロ作成装置。
Ladder program macro creation to create a macro that can be used when creating a ladder program that is executed in a programmable control device that is composed of multiple units and to which a range of devices that can be specified is assigned to one or more units A device,
A unit number indicating a connection position in a programmable control device of a specific unit used in a macro among a plurality of units, and an argument setting unit capable of setting an arbitrary device number included in the macro as a macro argument ,
Extracting the device number included in the range of devices assigned to the unit set as an argument in the argument setting unit from the plurality of device numbers included in the macro before registration, and the extracted device number, A macro registration conversion unit for converting to a relative position based on the first device number of the device range;
A macro registration unit for registering a macro including the unit number set in the argument setting unit as an argument;
A ladder program macro creation device comprising:
請求項1に記載のラダープログラムマクロ作成装置であって、さらに
前記マクロ登録部に登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記マクロ登録変換部で変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換するマクロ実行変換部を備えることを特徴とするラダープログラムマクロ作成装置。
The ladder program macro creation device according to claim 1, further comprising a head device in a range of devices assigned to a unit corresponding to a unit number of an input argument when a macro registered in the macro registration unit is called. A ladder program macro creation device comprising a macro execution conversion unit that converts a device number expressed by a relative position converted by the macro registration conversion unit into an actual device number by referring to the number.
複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成方法であって、
複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定するステップと、
登録前のマクロ中に含まれる複数のデバイス番号から、引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換するステップと、
前記設定されたユニット番号を引数に含むマクロを登録するステップと、
を備えることを特徴とするラダープログラムマクロ作成方法。
Ladder program macro creation to create a macro that can be used when creating a ladder program that is executed in a programmable control device that is composed of multiple units and to which a range of devices that can be specified is assigned to one or more units A method,
A step of setting a unit number indicating a connection position in a programmable control device of a specific unit used in a macro among a plurality of units and an arbitrary device number included in the macro as arguments of the macro;
A device number included in a device range assigned to a unit set as an argument is extracted from a plurality of device numbers included in a macro before registration, and the extracted device number is extracted from the device range. Converting to a relative position based on the first device number;
Registering a macro including the set unit number as an argument;
A ladder program macro creation method comprising:
請求項3に記載のラダープログラムマクロ作成方法であって、さらに
前記登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換するステップを備えることを特徴とするラダープログラムマクロ作成方法。
The ladder program macro creation method according to claim 3, further comprising referring to a head device number of a device range assigned to a unit corresponding to a unit number of an input argument when the registered macro is called. Thus, a ladder program macro creation method comprising the step of converting the device number represented by the converted relative position into an actual device number.
複数のユニットで構成され、一以上のユニットに指定可能なデバイスの範囲が割り当てられているプログラマブルコントロール装置において実行されるラダープログラムを作成する際に利用可能なマクロを作成するためのラダープログラムマクロ作成プログラムであって、コンピュータに、
複数のユニットの内、マクロで使用される特定のユニットの、プログラマブルコントロール装置における接続位置を示すユニット番号と、マクロ中に含まれる任意のデバイス番号を、マクロの引数として設定する機能と、
登録前のマクロ中に含まれる複数のデバイス番号から、引数として設定されたユニットに割り当てられたデバイスの範囲に含まれるデバイス番号を抽出すると共に、前記抽出されたデバイス番号を、前記デバイスの範囲の先頭デバイス番号を基準とする相対位置に変換する機能と、
前記設定されたユニット番号を引数に含むマクロを登録する機能と、
を実現させることを特徴とするラダープログラムマクロ作成プログラム。
Ladder program macro creation to create a macro that can be used when creating a ladder program that is executed in a programmable control device that is composed of multiple units and to which a range of devices that can be specified is assigned to one or more units A program, on a computer,
A function of setting a unit number indicating a connection position in a programmable control device of a specific unit used in a macro among a plurality of units and an arbitrary device number included in the macro as arguments of the macro;
A device number included in a device range assigned to a unit set as an argument is extracted from a plurality of device numbers included in a macro before registration, and the extracted device number is extracted from the device range. A function to convert relative position relative to the top device number,
A function of registering a macro including the set unit number as an argument;
A ladder program macro creation program characterized by realizing
請求項5に記載のラダープログラムマクロ作成プログラムであって、さらにコンピュータに、前記登録されたマクロの呼び出し時に、入力された引数のユニット番号に該当するユニットに割り当てられたデバイスの範囲の先頭デバイス番号を参照することで、前記変換された相対位置で表現されるデバイス番号を、実デバイス番号に変換する機能を実現させることを特徴とするラダープログラムマクロ作成プログラム。   6. The ladder program macro creation program according to claim 5, further comprising: a first device number in a range of devices assigned to a unit corresponding to a unit number of an input argument when the registered macro is called to the computer. A ladder program macro creation program that realizes a function of converting a device number represented by the converted relative position into an actual device number by referring to FIG. 請求項5または6に記載されるラダープログラムマクロ作成プログラムを格納したコンピュータで読み取り可能な記録媒体。   A computer-readable recording medium storing the ladder program macro creation program according to claim 5.
JP2003329025A 2003-09-19 2003-09-19 Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium Expired - Fee Related JP4266334B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003329025A JP4266334B2 (en) 2003-09-19 2003-09-19 Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003329025A JP4266334B2 (en) 2003-09-19 2003-09-19 Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium

Publications (2)

Publication Number Publication Date
JP2005092808A true JP2005092808A (en) 2005-04-07
JP4266334B2 JP4266334B2 (en) 2009-05-20

Family

ID=34458416

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003329025A Expired - Fee Related JP4266334B2 (en) 2003-09-19 2003-09-19 Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium

Country Status (1)

Country Link
JP (1) JP4266334B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008287619A (en) * 2007-05-21 2008-11-27 Koyo Electronics Ind Co Ltd Plc module, building-block type programmable controller and portable communication device
US7877728B2 (en) 2005-05-10 2011-01-25 Fanuc Ltd Sequence program editing apparatus
WO2011080945A1 (en) * 2009-12-28 2011-07-07 三菱電機株式会社 Program creation support device
JP2013143096A (en) * 2012-01-12 2013-07-22 Yokogawa Electric Corp Ladder program generation device
JP2014052673A (en) * 2012-09-04 2014-03-20 Keyence Corp Programmable controller, programming support device, and program
CN105278459A (en) * 2014-07-18 2016-01-27 株式会社安川电机 Ladder chart creation device, monitoring device, and machine control device
CN109669432A (en) * 2017-10-13 2019-04-23 横河电机株式会社 Setting system, setting device, setting method and setting program
JP6664563B1 (en) * 2019-03-05 2020-03-13 三菱電機株式会社 Program creation support device, program creation support method, and program creation support program

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877728B2 (en) 2005-05-10 2011-01-25 Fanuc Ltd Sequence program editing apparatus
JP2008287619A (en) * 2007-05-21 2008-11-27 Koyo Electronics Ind Co Ltd Plc module, building-block type programmable controller and portable communication device
WO2011080945A1 (en) * 2009-12-28 2011-07-07 三菱電機株式会社 Program creation support device
JPWO2011080945A1 (en) * 2009-12-28 2013-05-09 三菱電機株式会社 Program creation support device
JP5506822B2 (en) * 2009-12-28 2014-05-28 三菱電機株式会社 Program creation support device
US8843885B2 (en) 2009-12-28 2014-09-23 Mitsubishi Electric Corporation Program creation support device
CN103218218B (en) * 2012-01-12 2016-04-20 横河电机株式会社 Trapezoid figure program creates equipment
JP2013143096A (en) * 2012-01-12 2013-07-22 Yokogawa Electric Corp Ladder program generation device
US9176734B2 (en) 2012-01-12 2015-11-03 Yokogawa Electric Corporation Ladder program creation apparatus
JP2014052673A (en) * 2012-09-04 2014-03-20 Keyence Corp Programmable controller, programming support device, and program
CN105278459A (en) * 2014-07-18 2016-01-27 株式会社安川电机 Ladder chart creation device, monitoring device, and machine control device
CN109669432A (en) * 2017-10-13 2019-04-23 横河电机株式会社 Setting system, setting device, setting method and setting program
JP2019074880A (en) * 2017-10-13 2019-05-16 横河電機株式会社 Setting system, setting device, setting method, and setting program
JP2021192315A (en) * 2017-10-13 2021-12-16 横河電機株式会社 Setting system, i/o device, setting method, and setting program
CN109669432B (en) * 2017-10-13 2022-07-26 横河电机株式会社 Setting system, setting device, and setting method
JP7283509B2 (en) 2017-10-13 2023-05-30 横河電機株式会社 Setting system, I/O device, setting method, and setting program
JP6664563B1 (en) * 2019-03-05 2020-03-13 三菱電機株式会社 Program creation support device, program creation support method, and program creation support program
WO2020178983A1 (en) * 2019-03-05 2020-09-10 三菱電機株式会社 Program creation assistance device, program creation assistance method, and program creation assistance program
CN113518947A (en) * 2019-03-05 2021-10-19 三菱电机株式会社 Program creation support device, program creation support method, and program creation support program
CN113518947B (en) * 2019-03-05 2022-10-21 三菱电机株式会社 Program creation support device, program creation support method, and recording medium storing program creation support program

Also Published As

Publication number Publication date
JP4266334B2 (en) 2009-05-20

Similar Documents

Publication Publication Date Title
Paterno et al. One model, many interfaces
JP2011118902A (en) Automatic form layout method, system, and computer program
JP2006119884A (en) Editing apparatus of sequence program
JP4266334B2 (en) Ladder program macro creation device, ladder program macro creation method, ladder program macro creation program, and computer-readable recording medium
JP2008203912A (en) Screen forming apparatus, method and program
US20110126171A1 (en) Dynamic native editor code view facade
JP3835589B2 (en) Drawing device and computer-readable recording medium recording drawing program
JP2003044108A (en) Registering device for editor, registering program, and recording medium where the same is recorded
JP4995009B2 (en) POD screen generation device and program thereof
JP4476223B2 (en) Screen data creation device, screen data editing method, and screen data editing program
JP2005092807A (en) Ladder diagram editor, ladder diagram editing method and program, and computer-readable recording medium
CN112272820B (en) Support device and recording medium for supporting program
JP3795357B2 (en) Editor device, editor program, and recording medium recording the same
JP2010244110A (en) Software design support device and computer program
JP4299620B2 (en) Ladder diagram editing apparatus, ladder diagram editing method, ladder diagram editing program, and computer-readable recording medium
JP4970105B2 (en) Editor device and editor program
CN103902676A (en) Bill extension item user-defining device and method
JP2010182031A (en) Software generation support device
JP4387288B2 (en) Display device for control, editor device, program, and recording medium
JP2004302880A (en) Programmable logic controller, program editor device, their program, and recording medium
JPH0954688A (en) Gui design supporting method
WO2009091089A1 (en) Multi-platform based user interface screen editing method and device supporting concurrent editing of user interface screens
CN116431142B (en) High-efficiency programming method capable of being quickly constructed and not prone to error
KR102382703B1 (en) Multi-Channel Integration Platform Authoring Device and Method Thereby
JPH07334358A (en) Procedure editing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060824

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090204

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090216

R150 Certificate of patent or registration of utility model

Ref document number: 4266334

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120227

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120227

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150227

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees