JP2004171155A - Network system and controller - Google Patents

Network system and controller Download PDF

Info

Publication number
JP2004171155A
JP2004171155A JP2002334265A JP2002334265A JP2004171155A JP 2004171155 A JP2004171155 A JP 2004171155A JP 2002334265 A JP2002334265 A JP 2002334265A JP 2002334265 A JP2002334265 A JP 2002334265A JP 2004171155 A JP2004171155 A JP 2004171155A
Authority
JP
Japan
Prior art keywords
slave
small
point
memory
network
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
JP2002334265A
Other languages
Japanese (ja)
Other versions
JP4172255B2 (en
Inventor
Toshiyuki Kojima
俊之 小島
Masao Koga
政男 古賀
Satoshi Takahashi
聡 高橋
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2002334265A priority Critical patent/JP4172255B2/en
Publication of JP2004171155A publication Critical patent/JP2004171155A/en
Application granted granted Critical
Publication of JP4172255B2 publication Critical patent/JP4172255B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)
  • Selective Calling Equipment (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a controller which can effectively use a memory without increasing a node address more than necessary for allocating the memory. <P>SOLUTION: For an I/O memory 11b in a CPU unit 11 composing a PLC 10 connected to a network in which a slave of small point number having input-output point number of two or below and a multiple point slave having 16 points are mixed, a memory area for multiple point OUT data, a memory area for multiple point IN data, a memory area for small point number OUT data, and a memory area for small point number IN data are respectively prepared in correspondence with four kinds of slaves. Then, for four kinds of slaves of the small point number slave (IN slave) 21, the small point number slave (OUT slave) 22, the multiple point slave (IN slave) 23 and the multiple point slave (OUT slave) 24, a node address is assigned from #0, respectively. For identifying each slave, the kind thereof is factored in as well. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
この発明は、ネットワークシステム及びコントローラに関するものである。
【0002】
【従来の技術】
FA(ファクトリーオートメーション)で用いられるPLC(プログラマブルコントローラ)は、スイッチやセンサなどの入力機器のON/OFF情報を入力し、ラダー言語などで書かれたシーケンスプログラム(ユーザプログラム)に沿って論理演算を実行する。そして、PLCは、得られた演算結果にしたがって、リレー,バルブ,アクチュエータなどの出力機器に対し、ON/OFF情報の信号を出力することで制御が実行される。
【0003】
係るPLCの一形態として、各機能ごとに生成されたユニットを複数用意し、電気,機械的に連結して構成するものがある。係るタイプを構成するためのユニットとしては、電源ユニット,CPUユニット,I/Oユニット,マスタユニット等各種のものがある。
【0004】
そして、上記したマスタユニットは、制御系ネットワークに接続され、その制御系ネットワークに接続された各種のスレーブと制御系ネットワークを介して通信可能となっている。この種のスレーブの一例として、リモートIOがある。すなわち、上記した入力機器や出力機器は、PLCを構成するI/Oユニットに接続することもあるが、仮に全ての入出力機器を直接I/Oユニットに接続した場合には、それら入出力機器とI/Oユニットを結ぶ配線が、入出力機器の数だけ存在することになり、係る多数の配線がPLC(I/Oユニット)を起点として工場内に引き回されることになり、好ましくない。
【0005】
そこで、制御対象の付近に入出力機器を接続するための端子台となるI/Oユニットを設置し、PLC(マスタユニット)に接続されたネットワークケーブルに対して各I/Oユニットを接続する。そして、各I/OユニットとPLCとの間ではマスタ−スレーブ間通信などによってI/Oデータの送受を行い、実際の入出力機器に対しては係るI/Oユニットを介して情報の伝達をするようにしている。
【0006】
ところで、従来のリモートIOは、16点のものが主流であり、8点のものも存在する。また、最近では、2点或いは1点と言った小点数に対応したリモートIOも存在する。本明細書では、前者を多点スレーブと称し後者を小点数スレーブと称する。このように小点数スレーブを設けるのは、例えば搬送用コンベアラインのように10m間隔で1から2個のセンサ等を設置すれば足りるような場合、1つのリモートIOで複数箇所に対応するのは配線の引き回しの問題から好ましくなく、各箇所毎にリモートIOを設置することになる。すると、接続する入出力機器の数に対応して小点数スレーブを用いることになる。
【0007】
そして、各リモートIOの各点は、CPUユニットのIOメモリの所定アドレスに割り付けられており、そのIOメモリに対してデータを読み書きすることによりIOデータの送受を行っている。つまり、入力機器からのINデータは、エリア割り付けされたIOメモリの所定アドレスに格納される。従って、ユーザプログラムを演算実行する際に、INデータが格納されるアドレスを参照してINデータを取得し、それに基づいて演算処理をしてOUTデータを算出すると、そのOUTデータを特録すべきアドレスに格納する。これにより、そのOUTデータは、対応するノードのリモートIOに接続された出力機器に伝達され、所望の制御動作をする。
【0008】
一方、リモートIOを接続したネットワーク(リモートIO通信)に対し、多点スレーブと小点数スレーブが混在状態で接続されるようなネットワーク構成のものがある。例えば、上記した搬送用コンベアラインであっても、制御盤のように多数の入出力機器が設置される箇所もあり、係る箇所には多点スレーブが必要となる。そして、このように多点スレーブと小点数スレーブが混在するネットワークシステムにおけるIOメモリの割付は、以下のようにしたものがある。
【0009】
まず第1の方法としては、図1に示すように、小点数スレーブに合わせてメモリ割付を行う。つまり、1つのノード毎に2ビットずつメモリの割付を行う。係るメモリ割付をした場合、例えば16点の多点スレーブを接続する場合、16ビットのメモリ領域が必要となるので、8個分のノード領域を占有する。従って、小点数スレーブの場合には、予め設定したノード毎に割り付けるため、1つのスレーブが1つのノードを使用するが、1個の多点スレーブのために、例えばノード8からノード15までのメモリ領域を占有することになる。
【0010】
一方、第2の方法としては、図2に示すように、多点スレーブに併せてメモリを割り付ける方法がある。つまり、予め各ノード毎に16ビット分ずつメモリ領域を割り付ける。このようなメモリ割付を行ったIOメモリを小点数スレーブが使用する場合、各ノードの0番と1番のビットのみ使用し、2〜15番は空きビットとなる。そしてこの空きビットのメモリ領域は、他の用途のIOメモリとしては使用できない。
このようなメモリ割付については、例えば特許文献1の従来の技術の欄などに開示されている。
【0011】
【特許文献1】
特許第3011814号(段落[0008]から[0016]など)
【0012】
【発明が解決しようとする課題】
上記した従来のIOメモリのエリア割付方法では、以下に示す問題を有する。
例えば、第1の方法によるエリア割付の場合、16点スレーブを64台接続したい場合は1台あたり8個分のノードを占有するので、ノードアドレスが512個、例えば0〜511まで必要になり、設定がわずらわしい。さらに、各リモートIOなどのスレーブに設置する設定用スイッチも、512番個(例えば0〜511)まで設定可能なものにする必要があるのでコストが上がるという問題点がある。
【0013】
また上記した第2の方法のようなエリア割付では、2点スレーブを128台(256ビット分)接続したい場合は1台あたり1ch(16ビット)の割付エリアを占有するので、128chの割付エリアが必要となる。256ビット(16ch)のデータしか取り込まないのに空きエリアも含めて128chのデータエリアを確保することは、エリアを無駄に使用していることになり、エリアの大きなコントローラの採用が必要になりコストアップするというデメリットがある。
【0014】
この発明は、メモリ割付をする際のノードアドレスを必要以上に大きな数を用意する必要が無く、さらに、メモリの有効利用を行うことのできるネットワークシステム及びコントローラを提供することを目的とする。
【0015】
【課題を解決するための手段】
この発明によるネットワークシステムは、入出力点数が2点以下の小点数スレーブと、その小点数スレーブよりも多い入出力点数を扱う多点スレーブとが、同一のネットワーク上に混在し、そのネットワークに接続されたコントローラと通信可能とするネットワークシステムを前提とする。そして、前記コントローラに設けた入出力データを格納するメモリに対し、前記小点数スレーブ用のエリアと前記多点スレーブ用のエリアをそれぞれ設定し、前記ネットワークに接続された前記小点数スレーブは、自己のノードアドレスに対応する前記小点数スレーブ用のエリアの所定領域に割り付けられ、前記ネットワークに接続された前記多点スレーブは、自己のノードアドレスに対応する前記多点スレーブ用のエリアの所定領域に割り付けられるようにした。
【0016】
各スレーブは実施の形態では、リモートIOであり、この場合、ネットワークシステムは、リモートIOシステムと称することができる。コントローラは、実施の形態ではPLCに該当するが、CPUユニットとしても良い。
【0017】
そして、各スレーブに対するノードアドレスの設定は各種の方法・規則によって行うことができるが、例えば、ユーザーによって設定される前記小点数スレーブと、前記多点スレーブに対するノードアドレスは、重複した設定を許容するように割り当てるようにし、ネットワーク上での各スレーブの識別は、設定したノードアドレスとスレーブの種類に基づいて行うようにすることもできる。ここで、スレーブの種類は、例えば小点数か多点による識別がある。さらに、INかOUT(IN・OUTの複合)の区別を行うようにしても良い。そして、このスレーブの種別による特定は、ノードアドレスと共に種類情報を別途送るようにしても良いし、実施の形態で示すように、ユーザが設定したノードアドレスに対してさらに種類に識別するための情報を加味して真のアドレス(スレーブ識別コード)を生成し、スレーブ識別コードに基づいてデータの送受を行うと言うように間接的に種類情報を利用するものも含む。
【0018】
また、本発明に係るコントローラは、入出力点数が2点以下の小点数スレーブと、その小点数スレーブよりも多い入出力点数を扱う多点スレーブとが、混在するネットワーク上に接続可能なコントローラであって、ユーザプログラムを演算実行する制御部と、その制御部がアクセスする前記入出力データを格納するメモリを備える。そして、前記メモリは、前記小点数スレーブ用のエリアと前記多点スレーブ用のエリアをそれぞれ設定されるようにした。
【0019】
コントローラは、PLC全体はもちろんのこと、上記した制御部とメモリを備えたCPUユニットも含む。CPUユニットの場合には、通信はマスタユニット等を介して行うことになる。
【0020】
本発明によれば、小点数のエリアと多点のエリアを別々に持つことで、空きのないエリア割付が行えるとともに、ノードアドレスの最大値も小さくすることができる。
【0021】
そして、実際にネットワークに接続した小点数スレーブと、多点スレーブに対するノードアドレスの設定において、重複を許容して割り当てるようにすると、たとえば、多点スレーブと小点数スレーブに対し、共に小さい数に設定することにより、簡単な設定スイッチを用いることができる。その場合でも、スレーブの種類を加味することによりネットワーク上で各スレーブをユニークに特定することができる。
【0022】
【発明の実施の形態】
図3は、本発明が実装されたPLCと、リモートIOを含むネットワークの一例を示している。図3に示すように、PLC10と各種のスレーブが、デバイスネットなどのフィールドバス20を介して接続されネットワークシステムを構築している。スレーブとしては、1または2個の入力機器が接続される小点数スレーブ(INスレーブ)21や、1または2個の出力機器が接続される小点数スレーブ(OUTスレーブ)22や、多数の入力機器が接続される多点スレーブ(INスレーブ)23や、多数の出力機器が接続される多点スレーブ(OUTスレーブ)24などがある。さらに、各スレーブは、自己のノードアドレスをユーザ操作により設定可能な設定スイッチ(ディップスイッチやロータリースイッチ等のメカ的なスイッチ)を備えている。なお、符合25は、終点抵抗である。
【0023】
PLC10は、各機能ごとに生成されたユニットを連結することにより構成され、例えば、CPUユニット11,マスタユニット12などがある。マスタユニット12は、フィールドバス20に接続され、各スレーブと通信を行うようになっている。さらに、PLC10の内部バスを介してCPUユニット11のIOメモリにアクセスし、IOデータ等の読み書きを行うようになっている。
【0024】
CPUユニット11は、ラダー等で記述されたユーザプログラムを演算実行する制御部11aと、IOデータ等を格納するIOメモリ11b等を備えている。
もちろん、図示省略するがハードウェア構成としては、上記ユーザプログラムを記憶するメモリや、システムプログラム等を格納するシステムROMや、演算実行時にワークエリアとして使用するワークメモリ(RAM)等も備えている。
【0025】
良く知られているように、入力機器からのINデータや、そのINデータに基づいて制御部11aにて演算処理して得られた出力機器に対するOUTデータは、IOメモリ11bの所定アドレスに格納される。そして、PLC10は、ユーザメモリの演算実行と、IOデータを更新するIOリフレッシュと、周辺処理等をサイクリックに繰り返し実行するもので、IOリフレッシュの際にマスタユニット12はIOメモリ11bにアクセスし、INスレーブ21,23から取得したINデータの書き込みと、OUTデータの読み出しを行う。そして、読み出したOUTデータは、所定のOUTスレーブ22,24を介して出力機器に対して送信する。
【0026】
ここで本発明では、IOメモリ11bに、4種類のスレーブに対応させ、多点OUTデータ用メモリエリアと、多点INデータ用メモリエリアと、小点数OUTデータ用メモリエリアと、小点数INデータ用メモリエリアとを用意している。そして、小点数スレーブ(INスレーブ)21,小点数スレーブ(OUTスレーブ)22,多点スレーブ(INスレーブ)23並びに多点スレーブ(OUTスレーブ)24の4種類のスレーブに対し、それぞれノードアドレスを#0から割り当てるようにしている。
【0027】
各メモリエリアの具体的なデータ構造としては、多点スレーブ用のOUT,INデータエリアは、図5(a),(b)に示すようなデータ構造となり、小点数スレーブ用のOUT,INデータエリアは、図6(a),(b)に示すようなデータ構造となる。本実施の形態では、多点スレーブは16点としているので、各ノードは16ビットずつ割り付けられ、小点数スレーブは2点としているので、各ノードは2ビットずつ割り付けられる。なお、図5,図6では、ノード数をともにnとしているが、各メモリエリアにおけるnの値は必ずしも一致していなくても良い。一例としては、多点スレーブの最大ノード数を64にし、小点数スレーブの最大ノード数を128にするというように、異ならせることができる。もちろん一致させても良い。
【0028】
係る構成にすると、各スレーブ21〜24は、それぞれにあってメモリ割り付けがされているので、例えば小点数スレーブを図5に示す多点スレーブ用のメモリエリアを使用して2から15番のビットが空きビットになることは無いし、多点スレーブを図6に示す小点数スレーブ用のメモリエリアを使用することにより複数のノードアドレスが使用不能になるおそれはなくなる。
【0029】
また、実際に接続可能なスレーブ(リモートIO)の最大個数と、ノードアドレスの最大値は一致している(具体的な値は、0番から始まるためノードアドレスの方が1小さい)。従って、必要以上に大きな数値まで設定可能な設定スイッチを用意することが無く、通常の設定スイッチにより、各スレーブのノードアドレスを効率良く設定できる。
【0030】
一方、上記したようにスレーブのノードアドレスを種類毎に「0番」から割り振っているため、そのままではネットワーク上に同じノードアドレスのスレーブが最大4個存在することになり好ましくない。そこで本実施の形態では、ネットワーク上でのマスタ−スレーブ間通信において各スレーブを識別するためのコード(スレーブ識別コード)は例えば4桁にし、スレーブの種類は、最上位(先頭)の1桁を利用して特定し、上記した設定スイッチによる設定は、下位の2ないし3桁を利用して特定するようにする。
【0031】
つまり、例えば、小点数スレーブ(INスレーブ)21を「1」,小点数スレーブ(OUTスレーブ)22を「2」,多点スレーブ(INスレーブ)23を「3」並びに多点スレーブ(OUTスレーブ)24を「4」として振り分ける。すると、上記した実施の形態では、小点数スレーブはノード数を最大128としているので、下三桁を設定スイッチで設定することになり、小点数スレーブ(INスレーブ)のノードアドレスが#111とすると、スレーブ識別コードは#1111となる。また、多点スレーブはノード数を最大64としているので、下二桁を設定スイッチで設定することになり、多点スレーブ(OUTスレーブ)のノードアドレスが#50とすると、実際のノードアドレスは#4050となる。
【0032】
また、上記のように下2桁或いは下3桁をユーザが設定スイッチなどを操作して設定した値をそのまま用い、最上位桁にスレーブの種類を特定する値を付加することによりスレーブ識別コードを設定したが、本発明はこれに限ることはなく各種の設定を行うことができる。一例を示すと、ユーザが設定した値に対し、スレーブの種類に応じた数値を加算する(オフセットする)ことにより、各スレーブのスレーブ識別コードが重複しないユニークなものにすることができる。具体的には、下記表1に示すように、ノード数を適宜加算した値をオフセットすることにより、スレーブ識別コードを連続させつつユニークに設定することができる。すなわち、この例では、多点スレーブ(INスレーブ)はユーザの設定したノードアドレスをそのままスレーブ識別コードに使用し、多点スレーブ(OUTスレーブ)はユーザの設定したノードアドレスの値に64を加算した値をスレーブ識別コードに使用することにより、64から127を割り当てる。さらに、小数点スレーブ(INスレーブ)はユーザの設定したノードアドレスの値に128(=64+64)を加算した値をスレーブ識別コードに使用することにより、128から255を割り当てる。さらに、小数点スレーブ(OUTスレーブ)はユーザの設定したノードアドレスの値に256(=64+64+128)を加算した値をスレーブ識別コードに使用することにより、256から383を割り当てる。このように設定すると、識別コードのデータサイズを小さくすることができ、通信回線上のデータ伝送効率がよくなる。
【0033】
【表1】

Figure 2004171155
【0034】
そして、各リモートIOは、自分が上記4種類のどれであるかが分かっているので、設定スイッチで設定されたアドレスに基づいてスレーブ識別コード(真のノードアドレス)を設定し、マスタユニットさらには他のスレーブとの間で通信を行う場合に、スレーブの種類を付加した真のノードアドレスを用いて行う。各スレーブに設定されるノードアドレスは、そのフィールドバス20上でユニークとなり、通常のマスタ−スレーブ間通信によるデータの送受が行える。
【0035】
このように、本発明では、IOメモリへのエリア割付を、リモートIOの種類毎に行うようにしたが、それ以外の構成並びに作用効果は従来のものと同様に行うことができる。つまり、どのノードのIOデータがIOメモリのどこに格納されているかの情報などは、マスタユニット12並びにCPUユニット11が保有しており、それに基づいてIOメモリ11bへのアクセスを行うことができるし、マスタユニット12はノードアドレスにしたがって所定のスレーブ21〜24と通信を行うことができる。なお、マスタユニット12並びにスレーブ21〜24におけるデータの送受のための機構等は、従来と同様であるため、その詳細な説明を省略する。
【0036】
【発明の効果】
以上のように、この発明では、メモリ割付をする際のノードアドレスを必要以上に大きな数を用意する必要が無く、さらに、メモリの有効利用を行うことができる。
【図面の簡単な説明】
【図1】従来のメモリのエリア割付方法の一例を説明する図である。
【図2】従来のメモリのエリア割付方法の一例を説明する図である。
【図3】ネットワークシステムの一例を示す図である。
【図4】CPUユニットの内部構造の一例を示す図である。
【図5】多点スレーブ用のIOメモリ内のデータ構造の一例を示す図である。
【図6】小点数スレーブ用のIOメモリ内のデータ構造の一例を示す図である。
【符号の説明】
10 PLC
11 CPUユニット
11a 制御部
11b IOメモリ
12 マスタユニット
20 フィールドバス
21 小点数スレーブ(INスレーブ)
22 小点数スレーブ(OUTスレーブ)
23 多点スレーブ(INスレーブ)
24 多点スレーブ(OUTスレーブ)
25 終点抵抗[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a network system and a controller.
[0002]
[Prior art]
PLC (programmable controller) used in factory automation (FA) inputs ON / OFF information of input devices such as switches and sensors, and performs logical operations according to a sequence program (user program) written in a ladder language or the like. Execute. The PLC is controlled by outputting ON / OFF information signals to output devices such as relays, valves and actuators in accordance with the obtained calculation results.
[0003]
As one form of such a PLC, there is a type in which a plurality of units generated for each function are prepared and electrically and mechanically connected. There are various units such as a power supply unit, a CPU unit, an I / O unit, and a master unit as units for configuring such a type.
[0004]
The master unit is connected to a control network and can communicate with various slaves connected to the control network via the control network. An example of this type of slave is a remote IO. That is, the input devices and output devices described above may be connected to the I / O units constituting the PLC, but if all the input / output devices are directly connected to the I / O units, the input / output devices may be connected to the input / output devices. The number of wirings connecting the I / O unit to the I / O unit is the same as the number of input / output devices, and such a large number of wirings are routed inside the factory starting from the PLC (I / O unit). .
[0005]
Therefore, an I / O unit serving as a terminal block for connecting input / output devices is installed near the control target, and each I / O unit is connected to a network cable connected to a PLC (master unit). Then, I / O data is transmitted and received between each I / O unit and the PLC by master-slave communication or the like, and information is transmitted to actual input / output devices via the I / O unit. I am trying to do it.
[0006]
By the way, the conventional remote IO mainly has 16 points, and there are also 8 points. Recently, there is a remote IO corresponding to a small number of points such as two points or one point. In the present specification, the former is called a multipoint slave, and the latter is called a small-point slave. Providing a small number of slaves in this way is useful when it is sufficient to install one or two sensors or the like at 10 m intervals, such as a conveyor line, so that one remote IO corresponds to a plurality of locations. It is not preferable due to the problem of wiring routing, and remote IOs are installed at each location. Then, a small-point slave is used according to the number of input / output devices to be connected.
[0007]
Each point of each remote IO is assigned to a predetermined address of the IO memory of the CPU unit, and the IO data is transmitted and received by reading and writing data from and to the IO memory. That is, the IN data from the input device is stored at a predetermined address of the IO memory to which the area is allocated. Therefore, when executing the user program, the IN data is obtained by referring to the address where the IN data is stored, and when the OUT data is calculated based on the obtained IN data, the OUT data should be specially recorded. Store at address. As a result, the OUT data is transmitted to an output device connected to the remote IO of the corresponding node, and performs a desired control operation.
[0008]
On the other hand, there is a network configuration in which a multipoint slave and a small number of slaves are connected in a mixed state to a network to which remote IO is connected (remote IO communication). For example, even in the above-described conveyor line, there are places where a large number of input / output devices are installed, such as a control panel, and a multipoint slave is required at such places. In such a network system in which a multipoint slave and a small number of slaves coexist, the IO memory is allocated as follows.
[0009]
First, as a first method, as shown in FIG. 1, memory allocation is performed in accordance with a small number of slaves. That is, memory is allocated to each node by two bits. When such memory allocation is performed, for example, when connecting 16-point multi-point slaves, a 16-bit memory area is required, so that 8 node areas are occupied. Therefore, in the case of a small number of slaves, one slave uses one node because it is allocated to each node set in advance, but for one multipoint slave, for example, the memory from node 8 to node 15 is used. Will occupy the area.
[0010]
On the other hand, as a second method, as shown in FIG. 2, there is a method of allocating a memory along with a multipoint slave. That is, a memory area of 16 bits is allocated to each node in advance. When the small number slave uses the IO memory to which such memory allocation has been made, only the 0th and 1st bits of each node are used, and the 2nd to 15th bits are empty bits. The memory area of the empty bits cannot be used as an IO memory for another purpose.
Such a memory allocation is disclosed, for example, in the section of the prior art in Patent Document 1.
[0011]
[Patent Document 1]
Patent No. 30111814 (paragraphs [0008] to [0016] etc.)
[0012]
[Problems to be solved by the invention]
The conventional IO memory area allocation method described above has the following problems.
For example, in the case of the area allocation according to the first method, when 64 16-point slaves are to be connected, eight nodes are occupied per one. Therefore, 512 node addresses, for example, 0 to 511 are required. Setting is troublesome. Further, there is a problem that the cost is increased because the setting switches installed on the slaves such as the remote IOs need to be set to 512 (for example, 0 to 511).
[0013]
In the area allocation as in the second method described above, when it is desired to connect 128 two-point slaves (256 bits), one channel (16 bits) is occupied by one slave. Required. Securing a data area of 128 ch including an empty area although only 256-bit (16 ch) data is taken in means that the area is wastefully used, and a controller having a large area is required, resulting in cost. There is a disadvantage of up.
[0014]
SUMMARY OF THE INVENTION It is an object of the present invention to provide a network system and a controller that do not need to prepare an unnecessarily large number of node addresses when allocating memory and that can effectively use a memory.
[0015]
[Means for Solving the Problems]
In the network system according to the present invention, a small-point slave having two or less input / output points and a multi-point slave that handles a larger number of input / output points than the small-point slave are mixed on the same network and connected to the network. It is assumed that the network system is capable of communicating with the specified controller. Then, an area for the small-point slave and an area for the multi-point slave are set in a memory for storing input / output data provided in the controller, and the small-point slave connected to the network has Assigned to a predetermined area of the area for the small number of slaves corresponding to the node address of the multi-point slave, and connected to the network, the multi-point slave is assigned to a predetermined area of the area for the multi-point slave corresponding to its own node address. It can be assigned.
[0016]
Each slave is a remote IO in the embodiment, and in this case, the network system can be referred to as a remote IO system. The controller corresponds to the PLC in the embodiment, but may be a CPU unit.
[0017]
The setting of the node address for each slave can be performed by various methods and rules. For example, the small-point slave set by the user and the node address for the multi-point slave allow overlapping setting. It is also possible to assign each of the slaves on the network and to identify each slave on the network based on the set node address and the type of the slave. Here, the type of slave is identified by, for example, a small number of points or multiple points. Further, the distinction between IN and OUT (combination of IN and OUT) may be made. For the identification by the type of the slave, the type information may be separately transmitted together with the node address, or as shown in the embodiment, information for further identifying the type with respect to the node address set by the user. In addition, there is a case where a true address (slave identification code) is generated in consideration of the above, and data is transmitted / received based on the slave identification code.
[0018]
Further, the controller according to the present invention is a controller that can be connected to a network in which a small-point slave having two or less input / output points and a multi-point slave that handles a larger number of input / output points than the small-point slave are mixed. And a control unit for calculating and executing the user program, and a memory for storing the input / output data accessed by the control unit. In the memory, the area for the small number of slaves and the area for the multipoint slave are respectively set.
[0019]
The controller includes not only the entire PLC but also a CPU unit having the above-described control unit and memory. In the case of a CPU unit, communication is performed via a master unit or the like.
[0020]
According to the present invention, by having an area with a small number of points and an area with multiple points separately, it is possible to allocate an empty area and reduce the maximum value of the node address.
[0021]
When setting the node addresses for the small-point slaves actually connected to the network and the multi-point slaves and assigning them while permitting duplication, for example, both the multi-point slaves and the small-point slaves are set to small numbers. By doing so, a simple setting switch can be used. Even in that case, each slave can be uniquely specified on the network by considering the type of the slave.
[0022]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 3 shows an example of a PLC including the present invention and a network including a remote IO. As shown in FIG. 3, the PLC 10 and various slaves are connected via a field bus 20 such as a device net to form a network system. As the slave, a small-point slave (IN slave) 21 to which one or two input devices are connected, a small-point slave (OUT slave) 22 to which one or two output devices are connected, a large number of input devices Are connected, and a multi-point slave (OUT slave) 24 to which many output devices are connected. Further, each slave is provided with a setting switch (a mechanical switch such as a dip switch or a rotary switch) that can set its own node address by a user operation. Reference numeral 25 is an end point resistance.
[0023]
The PLC 10 is configured by connecting units generated for each function, and includes, for example, a CPU unit 11, a master unit 12, and the like. The master unit 12 is connected to the field bus 20 and communicates with each slave. Further, the CPU 10 accesses the IO memory of the CPU unit 11 via the internal bus of the PLC 10 to read and write IO data and the like.
[0024]
The CPU unit 11 includes a control unit 11a for executing a user program described in a ladder or the like and an IO memory 11b for storing IO data and the like.
Of course, although not shown, the hardware configuration includes a memory for storing the user program, a system ROM for storing a system program and the like, and a work memory (RAM) used as a work area when executing calculations.
[0025]
As is well known, the IN data from the input device and the OUT data for the output device obtained by performing the arithmetic processing in the control unit 11a based on the IN data are stored at a predetermined address of the IO memory 11b. You. The PLC 10 cyclically and repeatedly executes the operation of the user memory, the IO refresh for updating the IO data, the peripheral processing, and the like. In the IO refresh, the master unit 12 accesses the IO memory 11b, Writing of IN data acquired from the IN slaves 21 and 23 and reading of OUT data are performed. Then, the read OUT data is transmitted to the output device via predetermined OUT slaves 22 and 24.
[0026]
Here, in the present invention, the IO memory 11b is made to correspond to four types of slaves, and a multipoint OUT data memory area, a multipoint IN data memory area, a small point OUT data memory area, and a small point IN data Memory area. Then, the node address is set to # for each of the four types of slaves, the small-point slave (IN slave) 21, the small-point slave (OUT slave) 22, the multi-point slave (IN slave) 23, and the multi-point slave (OUT slave) 24. It is assigned from 0.
[0027]
As a specific data structure of each memory area, OUT and IN data areas for a multipoint slave have a data structure as shown in FIGS. 5A and 5B, and OUT and IN data for a small number of slaves. The area has a data structure as shown in FIGS. 6 (a) and 6 (b). In the present embodiment, since the multipoint slave has 16 points, each node is assigned 16 bits, and the small number of slaves has 2 points. Therefore, each node is assigned 2 bits. In FIGS. 5 and 6, the number of nodes is n, but the value of n in each memory area does not necessarily have to match. For example, the maximum number of nodes of the multipoint slave may be set to 64, and the maximum number of nodes of the small number of slaves may be set to 128. Of course, they may be matched.
[0028]
With such a configuration, each of the slaves 21 to 24 is assigned a memory, so that, for example, the small-point slave can be assigned the 2nd to 15th bits by using the memory area for the multipoint slave shown in FIG. Does not become a vacant bit, and there is no possibility that a plurality of node addresses become unusable by using a memory area for a small number of slaves as shown in FIG.
[0029]
In addition, the maximum number of slaves (remote IOs) that can be actually connected matches the maximum value of the node address (the specific value starts from 0 and the node address is smaller by 1). Accordingly, there is no need to prepare a setting switch capable of setting a numerical value larger than necessary, and the node address of each slave can be set efficiently with a normal setting switch.
[0030]
On the other hand, as described above, since the node addresses of the slaves are assigned from "No. 0" for each type, up to four slaves having the same node address exist on the network, which is not preferable. Therefore, in the present embodiment, the code (slave identification code) for identifying each slave in the master-slave communication on the network is, for example, four digits, and the type of the slave is the highest-order (leading) one digit. The setting using the setting switch is specified using the lower two or three digits.
[0031]
That is, for example, the small point slave (IN slave) 21 is “1”, the small point slave (OUT slave) 22 is “2”, the multipoint slave (IN slave) 23 is “3”, and the multipoint slave (OUT slave). 24 is assigned as “4”. Then, in the above-described embodiment, since the number of small-point slaves has a maximum of 128 nodes, the lower three digits are set by the setting switch. If the node address of the small-number slave (IN slave) is # 111, , The slave identification code is # 1111. Further, since the number of nodes of the multipoint slave is 64 at the maximum, the lower two digits are set by the setting switch. If the node address of the multipoint slave (OUT slave) is # 50, the actual node address is # 50. 4050.
[0032]
Further, as described above, the lower two digits or the lower three digits are set by the user by operating the setting switch or the like, and the value for specifying the type of the slave is added to the most significant digit to thereby specify the slave identification code. Although set, the present invention is not limited to this, and various settings can be made. As an example, by adding (offset) a numerical value according to the type of the slave to the value set by the user, the slave identification code of each slave can be made unique without duplication. More specifically, as shown in Table 1 below, by offsetting a value obtained by appropriately adding the number of nodes, it is possible to uniquely set the slave identification codes while making them continuous. That is, in this example, the multipoint slave (IN slave) uses the node address set by the user as it is as the slave identification code, and the multipoint slave (OUT slave) adds 64 to the value of the node address set by the user. Assign values from 64 to 127 by using the value for the slave identification code. Further, the decimal point slave (IN slave) allocates 255 from 128 by using a value obtained by adding 128 (= 64 + 64) to the value of the node address set by the user as the slave identification code. Further, the decimal point slave (OUT slave) assigns 256 to 383 by using a value obtained by adding 256 (= 64 + 64 + 128) to the value of the node address set by the user as the slave identification code. With this setting, the data size of the identification code can be reduced, and the data transmission efficiency on the communication line is improved.
[0033]
[Table 1]
Figure 2004171155
[0034]
Since each remote IO knows which of the above four types it is, it sets the slave identification code (true node address) based on the address set by the setting switch, When performing communication with another slave, the communication is performed using a true node address to which the type of the slave is added. The node address set for each slave is unique on the field bus 20, and data can be transmitted / received by normal master-slave communication.
[0035]
As described above, in the present invention, the area allocation to the IO memory is performed for each type of the remote IO, but the other configuration and operation and effect can be performed in the same manner as the conventional one. In other words, information such as which node's IO data is stored in the IO memory and where is held by the master unit 12 and the CPU unit 11, and the IO memory 11b can be accessed based on the information. The master unit 12 can communicate with predetermined slaves 21 to 24 according to the node address. Note that the mechanism for transmitting and receiving data between the master unit 12 and the slaves 21 to 24 is the same as that of the related art, and a detailed description thereof will be omitted.
[0036]
【The invention's effect】
As described above, according to the present invention, there is no need to prepare an unnecessarily large number of node addresses when allocating memory, and the memory can be effectively used.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an example of a conventional memory area allocation method.
FIG. 2 is a diagram illustrating an example of a conventional memory area allocation method.
FIG. 3 is a diagram illustrating an example of a network system.
FIG. 4 is a diagram illustrating an example of an internal structure of a CPU unit.
FIG. 5 is a diagram showing an example of a data structure in an IO memory for a multipoint slave.
FIG. 6 is a diagram showing an example of a data structure in an IO memory for a small number of slaves.
[Explanation of symbols]
10 PLC
11 CPU unit 11a Control unit 11b IO memory 12 Master unit 20 Field bus 21 Small point slave (IN slave)
22 small point slave (OUT slave)
23 Multi-point slave (IN slave)
24 Multipoint slave (OUT slave)
25 Endpoint resistance

Claims (3)

入出力点数が2点以下の小点数スレーブと、その小点数スレーブよりも多い入出力点数を扱う多点スレーブとが、同一のネットワーク上に混在し、そのネットワークに接続されたコントローラと通信可能とするネットワークシステムにおいて、
前記コントローラに設けた入出力データを格納するメモリに対し、前記小点数スレーブ用のエリアと前記多点スレーブ用のエリアをそれぞれ設定し、
前記ネットワークに接続された前記小点数スレーブは、自己のノードアドレスに対応する前記小点数スレーブ用のエリアの所定領域に割り付けられ、
前記ネットワークに接続された前記多点スレーブは、自己のノードアドレスに対応する前記多点スレーブ用のエリアの所定領域に割り付けられたことを特徴とするネットワークシステム。
A slave with a small number of I / O points of 2 or less and a multi-point slave that handles more I / O points than the slave with a small number of points are mixed on the same network and can communicate with a controller connected to that network. Network system,
For a memory for storing input / output data provided in the controller, an area for the small-number slave and an area for the multi-point slave are set, respectively.
The small-point slave connected to the network is allocated to a predetermined area of the small-point slave area corresponding to its own node address,
A network system, wherein the multipoint slave connected to the network is allocated to a predetermined area of the multipoint slave area corresponding to its own node address.
ユーザーによって設定される前記小点数スレーブと、前記多点スレーブに対するノードアドレスは、重複した設定を許容するように割り当てるようにし、
ネットワーク上での各スレーブの識別は、スレーブの種類と前記ユーザが設定したノードアドレスに基づいて行うことを特徴とする請求項1に記載のネットワークシステム。
The small-point slave set by the user and the node address for the multi-point slave are assigned to allow overlapping settings,
2. The network system according to claim 1, wherein identification of each slave on the network is performed based on a type of the slave and a node address set by the user.
入出力点数が2点以下の小点数スレーブと、その小点数スレーブよりも多い入出力点数を扱う多点スレーブとが、混在するネットワーク上に接続可能なコントローラであって、
ユーザプログラムを演算実行する制御部と、
その制御部がアクセスする入出力データを格納するメモリを備え、
前記メモリは、前記小点数スレーブ用のエリアと前記多点スレーブ用のエリアをそれぞれ設定されていることを特徴とするコントローラ。
A controller that can be connected to a mixed network, in which a small-point slave having two or less input / output points and a multi-point slave that handles a larger number of input / output points than the small-point slave,
A control unit for calculating and executing a user program;
A memory for storing input / output data accessed by the control unit,
The controller according to claim 1, wherein the memory has an area for the small number of slaves and an area for the multipoint slave.
JP2002334265A 2002-11-18 2002-11-18 Network system and controller Expired - Lifetime JP4172255B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002334265A JP4172255B2 (en) 2002-11-18 2002-11-18 Network system and controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002334265A JP4172255B2 (en) 2002-11-18 2002-11-18 Network system and controller

Publications (2)

Publication Number Publication Date
JP2004171155A true JP2004171155A (en) 2004-06-17
JP4172255B2 JP4172255B2 (en) 2008-10-29

Family

ID=32698762

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002334265A Expired - Lifetime JP4172255B2 (en) 2002-11-18 2002-11-18 Network system and controller

Country Status (1)

Country Link
JP (1) JP4172255B2 (en)

Also Published As

Publication number Publication date
JP4172255B2 (en) 2008-10-29

Similar Documents

Publication Publication Date Title
EP2035902B1 (en) Remote virtual placeholder configuration for distributed input/output modules
US20100146176A1 (en) Data transmission method, serial bus system, and switch-on unit for a passive station
US20070073446A1 (en) Method for dynamically allocating controlling and self- assigning of addresses in a network
JPS63273960A (en) Communication network adaptor
TWI547779B (en) Control system,master station and remote station
KR100720145B1 (en) Master module, function module, electronic device comprising the same and identification data setting method thereof
JP6009057B2 (en) Network air conditioning system, repeater and program
JP4172255B2 (en) Network system and controller
JP2006318367A (en) Bus management system and device
JP3896076B2 (en) Numerical controller
JP2008198148A (en) Programmable controller
EP2668747B1 (en) Transmission protocol
CN114124814A (en) Network on chip, control and configuration method, device, routing unit and equipment
TWI467385B (en) Mapping between two buses using serial addressing bits
US8032738B2 (en) Method for the start-up of numerical controls of machine tools or production machinery and numerical control for machine tools or production machinery
JP2005215936A (en) Link setting device of control equipment
JP3725530B2 (en) Programmable controller
JP2007241570A (en) Setting system of shared memory for communication between programmable controller
JPH07105804B2 (en) Address setter
JPH04107608A (en) Sequence controller
WO2024093357A1 (en) Method and apparatus for controlling bus system, and bus system and storage medium
JP6574917B1 (en) Information processing system and relay device
JPH10333715A (en) Programmable controller
JPH01125141A (en) Computer address assignment system
JP2001255910A (en) Input and output allocating method for programmable controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080303

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080318

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080516

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4172255

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110822

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120822

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130822

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term