JPH0242507A - Program control device - Google Patents

Program control device

Info

Publication number
JPH0242507A
JPH0242507A JP19368588A JP19368588A JPH0242507A JP H0242507 A JPH0242507 A JP H0242507A JP 19368588 A JP19368588 A JP 19368588A JP 19368588 A JP19368588 A JP 19368588A JP H0242507 A JPH0242507 A JP H0242507A
Authority
JP
Japan
Prior art keywords
signal
program
output
scan
states
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP19368588A
Other languages
Japanese (ja)
Inventor
Nobuyuki Kitani
木谷 信之
Yasushi Onishi
靖史 大西
Yoshihiro Itsubo
井坪 芳弘
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.)
Fanuc Corp
Original Assignee
Fanuc 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 Fanuc Corp filed Critical Fanuc Corp
Priority to JP19368588A priority Critical patent/JPH0242507A/en
Publication of JPH0242507A publication Critical patent/JPH0242507A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PURPOSE:To easily produce and maintain a program including the signal state changed by the lapse of time when such a program is required by storing the signal states of the desired frequency covering the past through the future and easily referring to the contents of storage of said signal states. CONSTITUTION:A processor 1 which performs the overall control includes an index 2 and a mask register 3. An input circuit 13 receives an external signal and transmits this signal to a bus 12 after converting the signal level. Then an output circuit 14 outputs an output signal to the outside from the inside. Only in case an input signal I1 is presently kept on and also was kept on in the preceding scan cycle I1-1 and its preceding scan period I1-2 respectively, an output signal Q1 is turned on. In other words, a function is secured as a kind of a filter that turns on the output only when the ON states are continuous in three times. Thus a program can be produced and maintained in consideration of the lapse of time.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はPC(プログラマブル・コントローラ)装置に
関し、特にサイクリックスキャン方式で動作するPC装
置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a PC (programmable controller) device, and particularly to a PC device that operates in a cyclic scan method.

〔従来の技術〕[Conventional technology]

従来用いられたサイクリックスキャン方式のPC装置に
おいては、外部の入出力信号に1対1に対応する内部メ
モリを有しており、スキャン周期毎に内部メモリへ外部
信号の状態を読み取り、内部メモリに対して演算を行っ
たのち、内部メモリに残された演算結果に従って外部信
号を更新していた。
A conventional cyclic scan type PC device has an internal memory that corresponds to external input/output signals on a one-to-one basis, and reads the state of the external signal into the internal memory at each scan cycle. After performing calculations on the data, the external signals were updated according to the calculation results left in the internal memory.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来方式のPC装置においては、信号状態を記憶するた
めの内部メモリが一組しか存在しなかった。したがって
、現在のスキャン周期と前回のスキャン周期との双方の
信号状態に基づいて今回の出力を決定しようとするよう
な、時間経過に沿う信号状態の変化を意識したプログラ
ムを作成しようとすると、スキャン周期毎の信号状態を
次回の演算のために他の内部メモリに記憶する等の処理
を、プログラム側で特に意識して行わなければならなか
った。そのためプログラムが複雑となり、プログラムの
作成や保守上好ましくないという問題点があった。
In conventional PC devices, there was only one set of internal memories for storing signal states. Therefore, if you try to create a program that is aware of changes in signal states over time, such as determining the current output based on the signal states of both the current scan period and the previous scan period, the scan The program had to be especially conscious of processing such as storing the signal state for each cycle in another internal memory for the next calculation. As a result, the program becomes complicated, which is disadvantageous in terms of program creation and maintenance.

本発明はこのような点に鑑みてなされたものであり、時
間経過を含む論理を簡単にプログラムできるPC装置を
提供することを目的とする。
The present invention has been made in view of these points, and it is an object of the present invention to provide a PC device in which logic including the passage of time can be easily programmed.

〔課題を解決するための手段〕[Means to solve the problem]

本発明では上記課題を解決するために、サイクリックス
キャン方式のPC装置において、現在のスキャン周期に
おける信号状態に加えて、過去のスキャン周期と将来の
スキャン周期との双方又はそのいずれかの所定回数のス
キャン周期の信号状態がともにメモリに記憶され、 前記メモリへの前記記憶内容がユーザプログラムから個
々に参照され得ることを特徴とするPC装置、 が提供される。
In order to solve the above-mentioned problems, the present invention provides a PC device using a cyclic scan method. There is provided a PC device, characterized in that signal states of scan cycles of are both stored in a memory, and the contents stored in the memory can be individually referenced from a user program.

〔作用] プロセッサの内部にマスクレジスタとインデクスレジス
タとが用意され、マスクレジスタには信号を記憶すべき
回数がセットされる。また、インデクスレジスタは、0
からマスクレジスタにセットされた値までの範囲を指し
示すように、1スキヤン毎に自動的に加算される。
[Operation] A mask register and an index register are prepared inside the processor, and the number of times a signal should be stored is set in the mask register. Also, the index register is 0
It is automatically added for each scan to indicate the range from to the value set in the mask register.

そして、ユーザプログラムの命令中に指示されたアドレ
ス部を解釈する際、そのアドレス部とマスクレジスタと
インデクスレジスタとの演算によって実効アドレス、す
なわち実際に参照すべきアドレスを決定する。
When interpreting the address part specified in the instruction of the user program, the effective address, that is, the address to be actually referenced, is determined by calculations between the address part, the mask register, and the index register.

〔実施例〕〔Example〕

以下、本発明の一実施例を図面に基づいて説明する。 Hereinafter, one embodiment of the present invention will be described based on the drawings.

第1図に本発明のPCのハードウェアのブロック図を示
す。図において、1は全体を制御するためのプロセッサ
であり、インデクスレジスタ2(以下、IRと記す)と
マスクレジスタ3(以下、MRと記す)とを含む。4は
ROMであり、システムプログラム5等を格納している
。6はRAMであり、ユーザプログラム7、入力信号メ
モリ8、出力信号メモリ9等を格納している。
FIG. 1 shows a block diagram of the hardware of a PC according to the present invention. In the figure, 1 is a processor for overall control, and includes an index register 2 (hereinafter referred to as IR) and a mask register 3 (hereinafter referred to as MR). 4 is a ROM, which stores a system program 5 and the like. A RAM 6 stores a user program 7, an input signal memory 8, an output signal memory 9, and the like.

10はプログラマ用インタフェースであり、プログラマ
11とハス12とを接続している。13は入力回路であ
り、外部からの信号を受け、信号レヘルを変換してパス
12へ伝送する。14は出力回路であり、内部からの出
力信号を外部へ出力する。
10 is a programmer interface, which connects the programmer 11 and the lotus 12. An input circuit 13 receives a signal from the outside, converts the signal level, and transmits it to the path 12. 14 is an output circuit, which outputs an output signal from the inside to the outside.

第2図はプログラムの一例の動作結果を示したタイムチ
ャートである。図に示したように本例では、人力信号■
1が現在ONであってしかも前回のスキャン周期(11
−1)と前々回のスキャン周#J4(11−2)とにお
いて共にONであった場合にのみ出力信号QlをONと
する。すなわち、ON状態が3回続いた場合にのみ出力
をONとする一種のフィルタとして作動する。
FIG. 2 is a time chart showing the operation results of an example of the program. As shown in the figure, in this example, the human input signal ■
1 is currently ON and the previous scan cycle (11
-1) and the scan cycle #J4 (11-2) before the previous time, the output signal Ql is turned ON only when it is ON. That is, it operates as a type of filter that turns on the output only when the ON state continues three times.

第3図はプログラムの一例であり、上述のフィルタの機
能を二−モニック言語で表示したものである。
FIG. 3 is an example of a program in which the functions of the above-mentioned filter are displayed in monic language.

このプログラムは、第4図に示された各ステ。This program includes each step shown in Figure 4.

プ16ビツトの命令コードに変換される。ここで、命令
コードの上位2ビツト(ビット14.15)は命令の種
類を示し、次の1ビツト(ピント13)は参照する信号
が入力であるか出力であるかを示す。残り13ビツトの
アドレス部(AR)で信号アドレスを示す。アドレス部
(AR)のうちMRに相当する下位2ビツト(ビット0
.1)は過去から現在に至るまでのどのスキャン周期の
信号であるかを示し、残り11ビツト(ビット2〜12
)で信号番号を示す。
is converted into a 16-bit instruction code. Here, the upper two bits (bits 14 and 15) of the instruction code indicate the type of instruction, and the next one bit (pin 13) indicates whether the reference signal is input or output. The remaining 13 bits of the address field (AR) indicate the signal address. The lower 2 bits (bit 0) of the address part (AR) corresponding to MR
.. 1) indicates which scan period from the past to the present the signal is, and the remaining 11 bits (bits 2 to 12)
) indicates the signal number.

第5図はMRとIRとの構成を示す図であり、IRは0
からMRで示された値までの範囲を周期的に指示するよ
うに1スキヤン毎に1ずつ加算される。すなわち、IR
は0O101,10,11と変化し、11の次にはOO
に戻る。
FIG. 5 is a diagram showing the configuration of MR and IR, and IR is 0.
1 is added for each scan so as to periodically indicate the range from MR to the value indicated by MR. That is, I.R.
changes to 0O101, 10, 11, and after 11 is OO
Return to

第6図(a)、(b)、(c)及び(d)に入力信号メ
モリ(IM)の状態変化の説明図を示す。
FIGS. 6(a), (b), (c) and (d) are explanatory diagrams of state changes of the input signal memory (IM).

IRが周期的に変化するのに応じて、命令中で参照され
た信号アドレスと入力信号メモリ上の実効アドレスとの
対応が第6図(a)から第6図(d)へと順次変化し、
第6図(d)の次には再び第6図(a)に戻る。
As the IR changes periodically, the correspondence between the signal address referenced in the instruction and the effective address on the input signal memory changes sequentially from FIG. 6(a) to FIG. 6(d). ,
After FIG. 6(d), the process returns to FIG. 6(a).

第7図は実効アドレス演算方式を示す図である。FIG. 7 is a diagram showing an effective address calculation method.

この例では図に示した手順によって、IRとMRとAR
とから実効アドレスとして5が求められる。
In this example, by the procedure shown in the figure, IR, MR, and AR
5 is found as the effective address from .

プロセッサは、入力信号メモリ([M)の(5)を参照
し、IRが10であるから、第6図から明らかなように
、前回のスキャン周期における入力11の状態(11−
1)が演算に使用される。
The processor refers to (5) of the input signal memory ([M), and since the IR is 10, as is clear from FIG. 6, the state of input 11 (11-
1) is used for calculation.

この実施例においては、単一のメモリ領域が四つの区画
に分割されて使用され、現在のスキャン周期における信
号状態に加えて3回前までのスキャン周期における信号
状態が記憶されており、その記憶内容を個々にユーザプ
ログラムから参照することが出来る。
In this embodiment, a single memory area is divided into four sections, and in addition to the signal states in the current scan cycle, the signal states in the previous three scan cycles are stored. The contents can be referenced individually from the user program.

尚、本実施例においてはアドレス部(AR)の下位2ビ
ツトの二進数00.01.10.11をそれぞれ0、−
3、−2、−1というように負数として解釈したので、
過去のスキャン周期の信号状態を参照することとなった
In this embodiment, the binary numbers 00.01.10.11 of the lower two bits of the address field (AR) are set to 0 and -, respectively.
I interpreted it as a negative number like 3, -2, -1, so
The signal state of the past scan cycle is now referred to.

しかし、これらの二進数を0、+1、+2、+3という
ように正数として解釈すれば、将来の数スキャン分の信
号状態を指示することが出来る。
However, if these binary numbers are interpreted as positive numbers such as 0, +1, +2, +3, it is possible to indicate the signal state for several scans in the future.

これは、成る信号の立ち上がりを捉えて次のスキャンに
て他の信号をONにするというように、将来のスキャン
時の出力結果をプログラムするのに有効である。
This is effective for programming the output results during future scans, such as capturing the rising edge of a signal and turning on other signals in the next scan.

更に、前記の二進数0O101,10,11を0、+1
、−2、−1と解釈し、前々回から次回までのスキャン
周期の信号状態として参照することも可能である。
Furthermore, the above binary numbers 0O101, 10, 11 are changed to 0, +1
, -2, -1, and can also be referred to as the signal state of the scan period from the time before the previous time to the next time.

また、本実施例におけるMRのビット数は2であったが
、1を設定するMRのビット数を1.2.3、・−・と
増すに従って、信号状態を記憶出来る回数が2回、4回
、8回、−・と増し、必要な回数に設定可能である。
In addition, the number of MR bits in this embodiment was 2, but as the number of MR bits setting 1 increases to 1, 2, 3, etc., the number of times the signal state can be stored increases from 2 to 4. times, 8 times, etc., and can be set to the required number of times.

その上、本発明のPC装置は、MRの全てのビットにO
を設定することにより、従来のPC装置と同様の動作を
させることが可能である。
Moreover, the PC device of the present invention provides O
By setting , it is possible to operate in the same way as a conventional PC device.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明では、過去から将来までにわ
たる必要なだけの回数の信号状態を記憶し、その記憶内
容を容易に参照し得るように構成したので時間経過によ
る信号状態の変化を踏まえたプログラムが必要な場合に
、プログラムの作成と保守とが容易となる。
As explained above, in the present invention, the signal state is stored as many times as necessary from the past to the future, and the stored contents are configured to be easily referenced. If a program is needed, it becomes easier to create and maintain the program.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例のPC装置のハードウェアの
ブロック図、 第2図はプログラムの一例のタイムチャート、第3図は
プログラムの一例を示す図、 第4図は第3図のプログラム例の命令コードを示す図、 第5図はマスクレジスタ(MR)とインデクスレジスタ
(IR)との構成を示す図、 第6図(a)、(b)、(c)及び(d)は入力信号メ
モリ(IM)の状態変化を示す図、第7図は実効アドレ
ス演算方式を示す図である。 プロセッサ インデクスレジスタ(IR) ・・マスクレジスタ(MR) ・ROM ・システムプログラム ・−RAM ・−ユーザ・プログラム −・入力信号メモリ(IM) −・出力信号メモリ ー・・・プログラマ用インタフェース ・・−プログラマ −・ノマス ・−入力回路 2−−−−・・−−−一−・ 3−・・・・− 4−−−−一・ 5−−−−・・ 6−−−−−・ 7・・−−−〜・・・ 8・−−−−・−−−−・ 9−−−・−・−・ 10−・・・ 11−−−−・−−−−・ 12−・−・ 13−・・−・ ・・・−出力回路
FIG. 1 is a block diagram of the hardware of a PC device according to an embodiment of the present invention, FIG. 2 is a time chart of an example of a program, FIG. 3 is a diagram showing an example of a program, and FIG. 4 is a diagram of an example of a program. Figure 5 shows the structure of the mask register (MR) and index register (IR). Figure 6 (a), (b), (c) and (d) shows the instruction code of the program example. FIG. 7 is a diagram showing changes in the state of the input signal memory (IM), and FIG. 7 is a diagram showing an effective address calculation method. Processor index register (IR) - Mask register (MR) - ROM - System program - RAM - User program - Input signal memory (IM) - Output signal memory - Programmer interface - Programmer -・Nomas・−Input circuit 2−−−−・・−−−1−・3−・・・・− 4−−−−−1・5−−−−・・ 6−−−−−・7・・−−−〜・・・ 8・−−−−・−−−−・ 9−−−・−・−・ 10−・・・ 11−−−−・−−−−・ 12−・−・ 13 −・・−・ ・・・−Output circuit

Claims (2)

【特許請求の範囲】[Claims] (1)サイクリックスキャン方式のPC装置において、 現在のスキャン周期における信号状態に加えて、過去の
スキャン周期と将来のスキャン周期との双方又はそのい
ずれかの所定回数のスキャン周期の信号状態がともにメ
モリに記憶され、 前記メモリへの前記記憶内容がユーザプログラムから個
々に参照され得ることを特徴とするPC装置。
(1) In a cyclic scan type PC device, in addition to the signal state in the current scan cycle, the signal state in a predetermined number of scan cycles in both the past scan cycle and the future scan cycle, or both A PC device characterized in that the content is stored in a memory, and the content stored in the memory can be individually referenced from a user program.
(2)前記メモリが、単一のメモリ領域を、信号状態を
記憶すべきスキャン周期の回数に応じた数の区画に分割
されて使用されることを特徴とする特許請求の範囲第1
項記載のPC装置。
(2) The first aspect of the present invention is characterized in that the memory is used by dividing a single memory area into a number of sections corresponding to the number of scan cycles in which signal states are to be stored.
PC device described in section.
JP19368588A 1988-08-03 1988-08-03 Program control device Pending JPH0242507A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19368588A JPH0242507A (en) 1988-08-03 1988-08-03 Program control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19368588A JPH0242507A (en) 1988-08-03 1988-08-03 Program control device

Publications (1)

Publication Number Publication Date
JPH0242507A true JPH0242507A (en) 1990-02-13

Family

ID=16312083

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19368588A Pending JPH0242507A (en) 1988-08-03 1988-08-03 Program control device

Country Status (1)

Country Link
JP (1) JPH0242507A (en)

Similar Documents

Publication Publication Date Title
US4941081A (en) Interrupt zone in rung of ladder program in programmable controller
JPH0242507A (en) Program control device
JPH04195205A (en) Program executing system for cnc device
JP2543781B2 (en) Method for creating sequence program for controller for injection molding machine
JPH0751610Y2 (en) Programmable controller with override function
JPS635402A (en) Programmable controller
JPS6323563B2 (en)
JP2526894B2 (en) Programmable controller arithmetic unit
JP2938246B2 (en) Behavioral description programmable controller
JPH0348333A (en) Processor and plotting processor
KR910002318B1 (en) Hardware logic analysis circuit with pipeline structure
JPH045703A (en) Sequence program generating device
JPH0612253A (en) Microcomputer
EP0474725B1 (en) Process control
JP2731166B2 (en) Programmable controller
JP2919841B2 (en) Testing method for data processing equipment
JPH01169505A (en) Processing method for input/output data for programmable controller
JPH01244502A (en) Pc program display system
JPS62256004A (en) Programmable controller
JPS616704A (en) Programmable controller
JPS60101612A (en) Programmable controller
JPH0310123B2 (en)
JPH06139066A (en) Digital signal processor
JPS62166430A (en) Data processing system
JPS6314192U (en)