JPH04211892A - Electronic computer - Google Patents

Electronic computer

Info

Publication number
JPH04211892A
JPH04211892A JP1560991A JP1560991A JPH04211892A JP H04211892 A JPH04211892 A JP H04211892A JP 1560991 A JP1560991 A JP 1560991A JP 1560991 A JP1560991 A JP 1560991A JP H04211892 A JPH04211892 A JP H04211892A
Authority
JP
Japan
Prior art keywords
event
internal state
storage means
received
pending
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
JP1560991A
Other languages
Japanese (ja)
Inventor
Yasutaka Tominaga
富永 保隆
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP1560991A priority Critical patent/JPH04211892A/en
Publication of JPH04211892A publication Critical patent/JPH04211892A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)

Abstract

PURPOSE:To prevent the complication of software accompanied by the complication of condition and to simplify the understanding of software and the change of specifications in an event driving computer control system by executing processing determined by the generation event and the current internal state and performing the transition (non-transition) to the internal state according to the result of the processing. CONSTITUTION:The processing method by types for generation event and holding event is set in advance. By referring to this, the execution, holding, or discard of the generation event and the execution or discard of the holding event are performed. Besides, a table is provided to indicate the plural internal states to be taken after the execution and the position for data deciding this for every processing determined by the event and the internal state to perform the transition to a new internal state by referring to this.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】この発明は外部で発生したイベン
トに対応した制御(イベント駆動型の制御ともいう、即
ち例えば自動販売機において、お金が入れられたら販売
できる商品を示すランプを点灯するとか、ボタンが押さ
れたら商品を出すなどの制御)を行う電子計算機装置に
関する。なお以下各図において同一の符号は同一もしく
は相当部分を示す。
[Industrial Application Field] This invention provides control in response to events that occur externally (also called event-driven control; for example, in a vending machine, when money is inserted, a lamp is turned on to indicate products that can be sold). The present invention relates to an electronic computer device that performs control such as dispensing a product when a button is pressed. Note that in the following figures, the same reference numerals indicate the same or corresponding parts.

【0002】0002

【従来の技術】従来、この種の電子計算機装置における
イベント駆動型の制御方法として状態遷移表を用いた手
法がある。この表は制御システム内で持っている内部状
態と、制御システムが受信可能なイベントとを対照させ
た表、換言すれば制御システム内の現在の内部状態のと
き、どのイベントを受信した場合、そのイベントに対応
するプログラムが実行できるか、あるいはそのイベント
を無視するかを決定するための表である。そしてこの決
定の手順をプログラムすることによりシステムの制御を
行っている。そしてイベントと内部状態により選択され
た処理プログラムを実行した結果、新しい内部状態に変
わる場合、その処理プログラムの中で新しい内部状態に
更新していた。しかしながら、上記の方法では受信した
イベントを一時的に保留しておくことができないため、
一度無視したイベントに対応するプログラムの実行は再
び同じイベントを受信するまで行われない。しかし一般
の制御システムでは受信したイベントを一時的に保留し
て後で処理しなければならないことが多い。そこで受信
したイベントを記憶するために、プログラム中にメモリ
を設け必要なイベントを記憶していた。
2. Description of the Related Art Conventionally, there is a method using a state transition table as an event-driven control method for this type of electronic computer device. This table compares the internal state of the control system and the events that the control system can receive.In other words, given the current internal state of the control system, which events are received, This is a table for determining whether a program corresponding to an event can be executed or whether the event should be ignored. The system is controlled by programming this decision procedure. If the internal state changes to a new one as a result of executing a processing program selected based on the event and internal state, the internal state is updated to the new internal state within the processing program. However, with the above method, it is not possible to temporarily hold received events, so
The program corresponding to the ignored event will not be executed until the same event is received again. However, in general control systems, it is often necessary to temporarily suspend received events and process them later. In order to store the received events, a memory was provided in the program to store the necessary events.

【0003】0003

【発明が解決しようとする課題】従来の方法はそれぞれ
の制御システムごとにイベントを記憶するために種々の
フラグやメモリを設け必要なイベントを記憶していたた
め、プログラムが複雑になり、プログラムの作成に時間
がかかっていた。また機能変更や追加のための修正には
プログラムを解析しなければならず、修正に時間がかか
っていた。一方マイクロコンピュータを用いた制御シス
テムへの要求は段々と複雑になってきており、しかも制
御システムを組込んだ製品の競争力を高めるために、機
能変更や追加が数多く発生し、しかも短時間で対応する
必要があった。そこで請求項1および請求項2に関わる
発明はこの問題を解消し得る電子計算機装置を提供する
ことを課題とする。
[Problems to be Solved by the Invention] In the conventional method, various flags and memories were provided to store events for each control system to store the necessary events, which resulted in complicated programs and the need for creating programs. It took a long time. In addition, modifications to change or add functionality require analysis of the program, which takes time. On the other hand, the requirements for control systems using microcomputers are becoming more and more complex, and in order to increase the competitiveness of products incorporating control systems, many changes and additions to functions have to be made in a short period of time. It was necessary to respond. Therefore, an object of the invention according to claims 1 and 2 is to provide an electronic computer device that can solve this problem.

【0004】また従来の方法は、イベントと内部状態に
より選択された処理プログラムを実行した結果で新しい
内部状態に変わる場合、その処理プログラムの中で新し
い内部状態に更新していたため、そのプログラムの作成
や、機能変更や追加のためにはその処理プログラムを解
析しなければならず、修正に時間がかかっていた。なお
この場合、処理プログラムの中で次に移行する内部状態
が常に1つになるように状態遷移表を作成すると、処理
プログラムの実行後に移行する内部状態を1つにするた
めの特別な内部状態を作る必要があり、内部状態の数が
多くなり状態遷移表が理解しにくくなってしまうという
問題もあった。一方マイクロコンピュータを用いた制御
システムへの要求は段々と複雑になってきており、しか
も制御システムを組込んだ製品の競争力を高めるために
、機能変更や追加が数多く発生し、しかも短時間で対応
するために、制御システムの状態遷移がどの様になって
いるかを一か所でわかるようにしたいという要求があっ
た。そこで請求項3に関わる発明はこの問題を解消でき
る電子計算機装置を提供することを課題とする。
[0004] In addition, in the conventional method, when the internal state changes to a new internal state as a result of executing a processing program selected based on an event and internal state, the new internal state is updated within the processing program. In addition, in order to change or add functions, the processing program had to be analyzed, which took time to modify. In this case, if you create a state transition table so that there is always one internal state to transition to next in the processing program, a special internal state will be created to ensure that there is only one internal state to transition to after the processing program is executed. There was also the problem that the number of internal states increased, making the state transition table difficult to understand. On the other hand, the requirements for control systems using microcomputers are becoming more and more complex, and in order to increase the competitiveness of products incorporating control systems, many changes and additions to functions have to be made in a short period of time. In order to respond to this, there was a demand for being able to see in one place how the state transitions of a control system are occurring. Therefore, an object of the invention according to claim 3 is to provide an electronic computer device that can solve this problem.

【0005】[0005]

【課題を解決するための手段】前記の課題を解決するた
めに請求項1の電子計算機装置は、『発生したイベント
(31など)と内部で持っている内部状態(32など)
とによってどのような処理を行うかを決定するイベント
駆動型の制御を行うマイクロコンピュータ制御システム
において、前記内部状態の種別を記憶する内部状態記憶
手段(7)と、発生した前記イベントを受信するイベン
ト受信手段(1)と、該イベント受信手段で受信したイ
ベントの前記内部状態の種別毎の処理方式を記憶したイ
ベント処理方式記憶手段(6)と、前記イベント受信手
段で受信したイベントを前記イベント処理方式記憶手段
と内部状態記憶手段とを参照し、受信したイベントに対
応したプログラムを実行するか、それとも一時保留する
か、無視するかを決定するイベント解析手段(2)と、
該イベント解析手段によって一時保留と決定したイベン
トを保留する保留イベント記憶手段(8)と、前記イベ
ント解析手段によって解析した結果にもとずき、受信し
たイベントに対応したプログラムの実行をするか、もし
くはそのイベントを前記保留イベント記憶手段に記憶す
るか、またはそのイベントを無視する受信イベント制御
手段(3)と、前記内部状態の種別毎の実行可能なイベ
ントを記憶する実行イベント記憶手段(9)と、内部状
態が変化したとき、前記実行イベント記憶手段を参照し
、前記保留イベント記憶手段より実行可能なイベントを
取り出し、そのイベントに対応するプログラムを実行さ
せる保留イベント制御手段(4)とを備えた』ものとし
[Means for Solving the Problems] In order to solve the above-mentioned problems, the electronic computer device according to claim 1 has the following features: ``An event that has occurred (such as 31) and an internal state that it has (such as 32)''.
In a microcomputer control system that performs event-driven control that determines what kind of processing is to be performed based on a receiving means (1), an event processing method storage means (6) storing a processing method for each type of the internal state of the event received by the event receiving means, and a method for processing the event received by the event receiving means; event analysis means (2) that refers to the method storage means and the internal state storage means and determines whether to execute a program corresponding to the received event, temporarily suspend it, or ignore it;
a suspended event storage means (8) for suspending an event determined to be temporarily suspended by the event analyzing means, and executing a program corresponding to the received event based on the result analyzed by the event analyzing means; or reception event control means (3) that stores the event in the pending event storage means or ignores the event; and execution event storage means (9) that stores executable events for each type of internal state. and pending event control means (4) that refers to the execution event storage means, retrieves an executable event from the pending event storage means, and executes a program corresponding to the event when the internal state changes. shall be

【0006】請求項2の電子計算機装置は、前記請求項
1の電子計算機装置にさらに、『内部状態が変化したと
き、該内部状態において保留していたイベントの中で廃
棄すべき対象となるイベントを記憶する廃棄イベント記
憶手段(10)と、該廃棄イベント記憶手段を参照し前
記保留イベント記憶手段に保留していたイベントを取り
消す廃棄イベント制御手段(5)とを備えた』ものとし
、また
[0006] The electronic computer device according to claim 2 further provides the electronic computer device according to claim 1, further adding: ``When the internal state changes, an event to be discarded among the events pending in the internal state. and a discard event control means (5) for referencing the discard event storage means and canceling the event held in the pending event storage means, and

【0007】請求項3の電子計算機装置は『現在の内部
状態(32など)の種別を記憶する内部状態記憶手段(
7)と、発生したイベント(31など)を受信するイベ
ント受信手段(1)と、前記の受信されたイベントおよ
び記憶された内部状態を参照し、どの処理プログラムを
実行するかを選択しその処理プログラムを実行させる処
理プログラム選択手段(13)とを備えた、イベント駆
動型の制御を行うマイクロコンピュータ制御システムに
おいて、前記の受信されたイベントおよび記憶された内
部状態の組合せ毎に、当該の処理プログラムの実行後に
とり得る1または複数の内部状態(レコード62など)
と、該内部状態を決定するためのアドレスデータであっ
て、前記処理プログラムの作業データを記憶する記憶手
段内に格納されるアドレスデータの格納位置を示すデー
タポインタ(レコード61など)とを予め(要素60な
どとして)設定され記憶する内部状態変更情報記憶手段
(17)、当該の処理プログラムの実行後、前記内部状
態変更情報記憶手段を参照して新しい内部状態を決定し
前記内部状態記憶手段を更新する内部状態変更手段(1
5)、を備えた』ものとする。
[0007] The electronic computer device according to claim 3 includes ``internal state storage means (for storing the type of the current internal state (32, etc.)).
7), an event receiving means (1) that receives an event that has occurred (such as 31), and selects which processing program to execute by referring to the received event and the stored internal state, and executes the processing. In a microcomputer control system that performs event-driven control and includes processing program selection means (13) for executing a program, the processing program is selected for each combination of the received event and the stored internal state. one or more internal states (such as record 62) that can exist after execution of
and a data pointer (record 61, etc.) indicating the storage position of the address data for determining the internal state and stored in the storage means for storing the work data of the processing program ( an internal state change information storage means (17) configured and stored (as element 60, etc.); after execution of the relevant processing program, a new internal state is determined by referring to the internal state change information storage means and the internal state storage means is Internal state changing means to update (1
5).

【0008】[0008]

【作用】[Effect]

(A)請求項1および請求項2に関わる発明について:
あらかじめ受信したイベントの処理方法を決めておき(
イベント処理方式)、内部状態と受信したイベントと予
め定めたイベント処理方式とからイベントの処理(即ち
イベントに対応するプログラムの実行、もしくはイベン
トの一時的保留、またはイベントの無視)を決定するイ
ベント解析手段、その決定に従って処理を行う受信イベ
ント制御手段、内部状態が変化したときに一時的に保留
してあったイベントを調べその処理が可能なものを実行
する保留イベント制御手段を用いることにより、機能変
更や追加が発生したときにはイベント処理方式を変更す
るだけで対応がとれるようにする。また内部状態が変化
したときに一時的に保留してあったイベントを調べ保留
しておく必要がなくなったイベントの保留を取り除くこ
とにより、制御システムの異常処理や例外処理が容易に
行えるようにする。
(A) Regarding the inventions related to claims 1 and 2:
Decide in advance how to process received events (
event processing method), event analysis that determines event processing (i.e., execution of a program corresponding to the event, temporary suspension of the event, or ignoring of the event) based on the internal state, received event, and predetermined event processing method. The functions can be improved by using a receiving event control means, a receiving event control means that processes according to the determination, and a pending event control means that checks temporarily suspended events when the internal state changes and executes those that can be processed. When a change or addition occurs, it is possible to deal with it simply by changing the event processing method. Additionally, by examining temporarily suspended events when the internal state changes and removing pending events that no longer need to be suspended, it is possible to easily handle abnormalities and exceptions in the control system. .

【0009】図1に請求項1および請求項2に関わる発
明の機能構成図を示す。あらかじめ受信したイベントの
処理方法を決めておき、その情報をイベント処理方式記
憶手段6に書き込んでおく。イベント受信手段1によっ
て受信されたイベントはイベント解析手段2によって解
析され、このイベントに対応するプログラムを実行する
か、このイベントを一時的に保留しておくか、またはこ
のイベントを無視するかの処理方法が決定される。これ
により受信イベント制御手段3は決定された処理方法に
応じてそれぞれ当該のイベントに対応するプログラムを
実行したり、当該イベントを保留イベント記憶手段8に
記憶したり、または当該イベントを無視したりする。ま
た保留イベント制御手段4は、内部状態が変化したとき
保留イベント記憶手段8より実行可能なイベントを取り
出し、そのイベントに対応するプログラムを実行させる
。また廃棄イベント制御手段5は、内部状態が変化した
とき、予め設定された廃棄イベント記憶手段10を参照
し、廃棄するイベントを保留イベント記憶手段8から取
り除く。
FIG. 1 shows a functional configuration diagram of the invention related to claims 1 and 2. A processing method for a received event is determined in advance, and the information is written in an event processing method storage means 6. The event received by the event receiving means 1 is analyzed by the event analyzing means 2, and processing is performed to execute a program corresponding to this event, temporarily suspend this event, or ignore this event. A method is determined. As a result, the reception event control means 3 executes a program corresponding to the event, stores the event in the pending event storage means 8, or ignores the event, depending on the determined processing method. . Further, the pending event control means 4 retrieves an executable event from the pending event storage means 8 when the internal state changes, and executes a program corresponding to the event. Furthermore, when the internal state changes, the discard event control means 5 refers to the preset discard event storage means 10 and removes the event to be discarded from the pending event storage means 8.

【0010】 (B)請求項3に関わる発明について:あらかじめイベ
ントと内部状態ごとに、当該の処理プログラムの実行後
、作業データ記憶手段内のどのデータがどんな値になっ
たとき、どの内部状態へ移行するかという情報を内部状
態変更情報記憶手段に記憶しておき、当該の処理プログ
ラムを実行した後、内部状態変更情報記憶手段を参照し
、新しい内部状態を決定し、内部状態記憶手段内の内部
状態を更新する。この方法により、制御システムの状態
遷移は内部状態変更情報記憶手段で管理できるので、内
部状態変更情報記憶手段を参照することにより、プログ
ラムを解析することなく制御システムの状態遷移がどの
様になっているかを短時間で知ることができる。
(B) Regarding the invention related to claim 3: For each event and internal state, after execution of the processing program, which data in the work data storage means has what value and which internal state Information indicating whether to migrate is stored in the internal state change information storage means, and after executing the relevant processing program, the internal state change information storage means is referred to, a new internal state is determined, and the information stored in the internal state storage means is Update internal state. With this method, the state transitions of the control system can be managed by the internal state change information storage means, so by referring to the internal state change information storage means, you can see how the state transitions of the control system occur without analyzing the program. You can find out in a short time if there are any.

【0011】図12に請求項3に関わる発明の機能構成
図を示す。あらかじめイベント31と内部状態32ごと
に、当該の処理プログラム14の実行後、作業データ記
憶手段16内のどのデータがどんな値になったとき内部
状態が変わるかという情報を内部状態変更情報記憶手段
17に記憶しておく。イベント受信手段1で受信したイ
ベント31と内部情報記憶手段7に記憶している現在の
内部状態32からそれに対応する処理プログラム14を
選択し実行する。選択された処理プログラム14は作業
データ記憶手段16内のデータを読み書きしながら定め
られた処理を行う。そして処理プログラム14の実行が
終了したとき、内部状態変更手段15がイベント31と
現在の内部状態32と内部状態変更情報記憶手段17と
作業データ記憶手段16とを参照し新しい内部状態を決
定し、内部状態記憶手段7を更新する。
FIG. 12 shows a functional configuration diagram of the invention related to claim 3. In advance, for each event 31 and internal state 32, the internal state change information storage means 17 stores information regarding which data in the work data storage means 16 becomes what value when the internal state changes after the processing program 14 in question is executed. Remember it. The processing program 14 corresponding to the event 31 received by the event receiving means 1 and the current internal state 32 stored in the internal information storage means 7 is selected and executed. The selected processing program 14 performs predetermined processing while reading and writing data in the work data storage means 16. When the execution of the processing program 14 is completed, the internal state change means 15 refers to the event 31, the current internal state 32, the internal state change information storage means 17, and the work data storage means 16, and determines a new internal state. The internal state storage means 7 is updated.

【0012】0012

【実施例】次に図1ないし図11に基づいて請求項1お
よび請求項2に関わる発明の実施例(便宜上第1の実施
例という)を説明する。ここでは、自動販売機における
制御システムを例にとり説明する。まず自動販売機の動
作について簡単に説明する。図2は本実施例における制
御システムの構成を示す。同図において21は主制御装
置、22は硬貨制御装置としてのコインメカニズム、2
3は機器制御装置、24はキーボード制御装置、25は
扉制御装置である。このシステムは、各制御装置21〜
25がそれぞれ機能別にマイクロコンピュータとメモリ
と入出力装置を持つマルチプロセッサシステムであり、
それぞれの制御装置21〜25は通信回線26で結ばれ
ている。
Embodiment Next, an embodiment (referred to as a first embodiment for convenience) of the invention relating to claims 1 and 2 will be described based on FIGS. 1 to 11. Here, a control system for a vending machine will be explained as an example. First, I will briefly explain the operation of a vending machine. FIG. 2 shows the configuration of the control system in this embodiment. In the figure, 21 is a main control device, 22 is a coin mechanism as a coin control device, 2
3 is a device control device, 24 is a keyboard control device, and 25 is a door control device. This system includes each control device 21 to
25 are multiprocessor systems each having a microcomputer, memory, and input/output device for each function.
The respective control devices 21 to 25 are connected by a communication line 26.

【0013】図3は本第1の実施例におけるイベント3
1と内部状態32で定まる処理内容を示した状態遷移表
である。同図において例えば自動販売機にお金が投入さ
れると、コインメカニズム22で検出し、コインメカニ
ズム22から主制御装置21へ投入金額検出イベントが
送信される。待機状態、入金状態のとき投入金額検出イ
ベントを受信したならば、主制御装置21は投入された
金額を計算し販売可能な商品のランプを点灯する入金処
理プログラムを実行する。また販売状態、返金状態のと
き投入金額検出イベントを受信したならば、そのイベン
トを一時保留し、内部状態が待機状態、または入金状態
になったときに図1の保留イベント制御手段4によって
入金処理を行う。またキーボード操作中状態になったと
き受信した投入金額検出イベントを廃棄し、また保留さ
れている投入金額検出イベントを図1の保留イベント記
憶手段8から取り除く。
FIG. 3 shows event 3 in the first embodiment.
1 is a state transition table showing processing contents determined by 1 and an internal state 32. In the figure, for example, when money is inserted into a vending machine, the coin mechanism 22 detects it, and the coin mechanism 22 transmits an inserted amount detection event to the main controller 21. If the main controller 21 receives an input amount detection event in the standby state or deposit state, the main controller 21 executes a deposit processing program that calculates the input amount and lights up the lamp of the product that can be sold. Furthermore, if an input amount detection event is received in the sales state or refund state, the event is temporarily put on hold, and when the internal state becomes the standby state or the deposit state, the deposit is processed by the hold event control means 4 shown in FIG. I do. Further, the input amount detection event received when the keyboard is being operated is discarded, and the suspended input amount detection event is removed from the pending event storage means 8 in FIG.

【0014】商品を選択するためのボタンが押されると
、扉制御装置25で検出し、扉制御装置25から主制御
装置21へボタン押下イベントが送信される。入金状態
のとき、どの商品を販売するかを決定して自動販売機前
面のどのボタンが押されたかを検出し、その決定にもと
ずき商品を搬出する販売処理プログラムを実行する。 それ以外の内部状態のときは受信したイベントを無視す
る。商品の販売が終了したら、機器制御装置23から主
制御装置21へ販売終了イベントが送信される。販売状
態のときは、釣銭を計算しコインメカニズム22より釣
銭を払い出す返金処理プログラムを実行する。それ以外
の内部状態のときは受信したイベントを無視する。
When a button for selecting a product is pressed, it is detected by the door control device 25, and a button press event is transmitted from the door control device 25 to the main control device 21. When the money is in the deposit state, it decides which product to sell, detects which button on the front of the vending machine is pressed, and executes a sales processing program to take out the product based on the decision. In any other internal state, the received event is ignored. When the sale of the product ends, a sales end event is transmitted from the device control device 23 to the main control device 21. In the sales state, a refund processing program is executed to calculate the change and pay out the change from the coin mechanism 22. In any other internal state, the received event is ignored.

【0015】釣銭の払い出しが終了したとき、コインメ
カニズム22から主制御装置21へ返金終了イベントが
送信される。返金状態のとき返金終了イベントを受信す
ると、販売のために点灯したランプを消灯し、待機状態
にもどるための待機移行処理プログラムを実行する。そ
れ以外の内部状態のときは受信したイベントを無視する
。サービスマンがキーボードの操作を行ったとき、キー
ボード制御装置24から主制御装置21へキーボード操
作開始イベントが送信される。待機状態のときキーボー
ド操作開始イベントを受信すると、キーボードからの入
力を制御するキー入力開始処理プログラムが実行される
。それ以外の内部状態のときは受信したイベントを無視
する。サービスマンがキーボードの操作を終了したとき
、キーボード制御装置24から主制御装置21へキーボ
ード操作終了イベントが送信される。キーボード操作中
状態のときキーボード操作終了イベントを受信すると、
キーボードからの入力処理を終了するキー入力終了処理
プログラムが実行される。それ以外の内部状態のときは
受信したイベントを無視する。
When the payout of change is completed, a refund end event is transmitted from the coin mechanism 22 to the main controller 21. When a refund end event is received in the refund state, the lamp turned off for sale is turned off and a standby transition processing program is executed to return to the standby state. In any other internal state, the received event is ignored. When the service person operates the keyboard, a keyboard operation start event is transmitted from the keyboard control device 24 to the main control device 21. When a keyboard operation start event is received in the standby state, a key input start processing program that controls input from the keyboard is executed. In any other internal state, the received event is ignored. When the service person finishes operating the keyboard, a keyboard operation end event is transmitted from the keyboard control device 24 to the main control device 21. When a keyboard operation end event is received while the keyboard is in operation,
A key input termination processing program is executed to terminate input processing from the keyboard. In any other internal state, the received event is ignored.

【0016】イベント31はマイクロコンピュータの中
で図5に示すようにコード化されている。このコードを
イベントコードという。図1の内部状態記憶手段7は1
バイトのデータを記憶する手段であり、この記憶手段7
には図4のコード割り付けに示す内部状態コードが格納
される。
Event 31 is coded in the microcomputer as shown in FIG. This code is called an event code. The internal state storage means 7 in FIG.
This storage means 7 is a means for storing byte data.
The internal status code shown in the code assignment in FIG. 4 is stored.

【0017】図6に図1のイベント処理方式記憶手段6
の構造を示す。それぞれ各イベント31と各内部状態3
2の別にアドレスサイズのデータ(本実施例では4バイ
ト)を持ち、0は受信したイベントを無視することを、
1は受信したイベントを保留することを、そして各プロ
グラムアドレスが記述されている部分はそのプログラム
を実行することを、それぞれ示している。例えばこの図
6において、内部状態が待機状態のとき(つまりこの図
の四角の枠内の最上段の横一列)は投入金額検出イベン
ト、キーボード操作開始イベントをそれぞれ受信した時
、そのイベントに対応するプログラム(即ち投入金額検
出イベント受信時は入金処理プログラム、キーボード操
作開始イベント受信時はキー入力開始処理プログラム)
を実行し、それ以外は受信したイベントを無視すること
を示している。同様に内部状態が販売状態のとき投入金
額検出イベントを受信したときは、そのイベントを保留
し、販売終了イベントを受信したときは、そのイベント
に対応するプログラム(即ち返金処理プログラム)を実
行し、それ以外は受信したイベントを無視することを示
す。以下他の状態も同様である。
FIG. 6 shows the event processing method storage means 6 of FIG.
The structure of Each event 31 and each internal state 3
In addition to 2, it has address size data (4 bytes in this example), and 0 indicates that the received event is ignored.
1 indicates that the received event is to be held on hold, and the portion where each program address is written indicates that the program is to be executed. For example, in this Figure 6, when the internal state is in the standby state (that is, the top horizontal row within the rectangular frame in this figure), when the input amount detection event and the keyboard operation start event are received, the event corresponds to that event. Program (i.e., the deposit processing program when receiving the input amount detection event, and the key input start processing program when receiving the keyboard operation start event)
, and otherwise ignore received events. Similarly, when the internal state is in the sales state and an input amount detection event is received, that event is put on hold, and when a sales end event is received, the program corresponding to that event (i.e., the refund processing program) is executed, Otherwise, indicates that the received event is to be ignored. The same applies to other states below.

【0018】図1のイベント解析手段2は内部状態記憶
手段7とイベント処理方式記憶手段6とを参照し、受信
したイベントをどのように処理するかを決定する。例え
ば、内部状態32が待機状態のとき投入金額検出イベン
トを受信すれば、その内部状態コードは0、イベントコ
ードは0であり、図6のイベント処理方式記憶手段の1
行1列目をみると受信したイベントに対応するプログラ
ムを実行することを示している。また、内部状態が販売
状態のとき投入金額検出イベントを受信すれば、その内
部状態コードは2、イベントコードは0であり、図6の
イベント処理方式記憶手段の3行1列目を見ると受信し
たイベントを保留することを示している。
The event analysis means 2 in FIG. 1 refers to the internal state storage means 7 and the event processing method storage means 6 and determines how to process the received event. For example, if the input amount detection event is received when the internal state 32 is in the standby state, the internal state code is 0, the event code is 0, and the event processing method storage means 1 of FIG.
Looking at the first row and column, it shows that the program corresponding to the received event is executed. Furthermore, if the input amount detection event is received when the internal state is in the selling state, the internal state code is 2 and the event code is 0. Looking at the third row and first column of the event processing method storage means in FIG. Indicates that the event that has occurred is to be held on hold.

【0019】図7に図1の保留イベント記憶手段8の構
造を示す。これは各イベントごとに1ビットのデータを
記憶するものであり、各イベントのビット位置は図5の
イベントコードに対応している。図1の受信イベント制
御手段3では、イベント解析手段2で決定したイベント
の処理方法が、イベントに対応するプログラムを実行す
ることならばそのプログラムを呼び出し(サブルーチン
コールや関数呼び出しなど)、イベントの保留であるな
らば図7に示す保留イベント記憶手段のイベント位置(
イベントコードで示す位置)のビットを1にする。
FIG. 7 shows the structure of the pending event storage means 8 of FIG. 1. This stores one bit of data for each event, and the bit position of each event corresponds to the event code in FIG. If the event processing method determined by the event analysis means 2 is to execute a program corresponding to the event, the reception event control means 3 in FIG. 1 calls that program (subroutine call, function call, etc.) and suspends the event. If so, the event position (
Set the bit at the position indicated by the event code to 1.

【0020】プログラムの実行によって内部状態が変化
したときは、図1の廃棄イベント制御手段5が起動し、
廃棄イベント記憶手段10を参照し、廃棄するイベント
を保留イベント記憶手段8の中から取り除く。図8に廃
棄イベント記憶手段10の構造を示す。廃棄イベント記
憶手段10はそれぞれ1ビットのデータを持っている。 これは図3に示した状態遷移表より作成したものであり
、保留していたイベントを廃棄する部分は0であり、そ
れ以外は1となっている。内部状態の示す行(内部状態
コードの示す横の並び)の廃棄イベント記憶手段10の
内容と保留イベント記憶手段8とのビットごとのAND
をとることにより、その内部状態で廃棄するイベントを
保留イベント記憶手段8から取り除くことができる。
When the internal state changes due to the execution of the program, the discard event control means 5 shown in FIG. 1 is activated.
The event to be discarded is removed from the pending event storage means 8 by referring to the discarded event storage means 10. FIG. 8 shows the structure of the discard event storage means 10. Each discard event storage means 10 has 1-bit data. This is created from the state transition table shown in FIG. 3, and the part where the pending event is discarded is 0, and the rest is 1. Bitwise AND of the contents of the discarded event storage means 10 in the row indicated by the internal state (horizontal row indicated by the internal state code) and the suspended event storage means 8
By taking , the event to be discarded in its internal state can be removed from the pending event storage means 8.

【0021】また図1の保留イベント制御手段4が起動
し、保留イベント記憶手段8の中に保留してあるイベン
トの中で実行イベント記憶手段9に設定された実行可能
なイベントに対応するプログラムを実行する。図9に実
行イベント記憶手段9の構造を示す。実行イベント記憶
手段9はそれぞれ1ビットのデータを持っている。これ
ば図3に示した状態遷移表より作成したものであり、プ
ログラムを実行するイベントの部分は1であり、それ以
外の部分は0となっている。内部状態の示す行(状態コ
ードの示す横の並び)の実行イベント記憶手段9の内容
と保留イベント記憶手段8とのビットごとのANDをと
ることにより、その内部状態で実行でき、かつ保留イベ
ント記憶手段8に保留されているイベントを取り出す。 そして取り出した実行可能なイベントに対応するプログ
ラムを保留イベント記憶手段8の左側から(つまり投入
金額検出、ボタン押下の順に)実行する。ここでは左側
から行うが、右側から行うことも可能である。
Further, the pending event control means 4 in FIG. Execute. FIG. 9 shows the structure of the execution event storage means 9. Each execution event storage means 9 has 1-bit data. This is created from the state transition table shown in FIG. 3, and the event part that executes the program is 1, and the other parts are 0. By performing a bit-by-bit AND between the contents of the execution event storage means 9 in the row indicated by the internal state (horizontal row indicated by the status code) and the pending event storage means 8, execution can be performed in that internal state and pending event storage can be performed. The event held in means 8 is retrieved. Then, the program corresponding to the retrieved executable event is executed from the left side of the pending event storage means 8 (that is, in the order of input amount detection and button press). Here, it is done from the left side, but it can also be done from the right side.

【0022】図10および図11に本第1の実施例の制
御全体のフローチャートを示す。この両図10,11中
、T1,T2はこの両図間の接続子であり、またステッ
プS2は廃棄イベント制御手段5の、ステップS3,S
5,S6は保留イベント制御手段4の、ステップS9は
イベント解析手段2の、またステップS11は受信イベ
ント制御手段3のそれぞれの動作を示し、この動作の条
件および動作の内容は既に述べた通りである。
FIGS. 10 and 11 show flowcharts of the overall control of the first embodiment. In both figures 10 and 11, T1 and T2 are connectors between these two figures, and step S2 is the step S3 and S of the discard event control means 5.
5, S6 indicates the operation of the pending event control means 4, step S9 indicates the operation of the event analysis means 2, and step S11 indicates the operation of the reception event control means 3, and the conditions and contents of this operation are as described above. be.

【0023】次に主として図12ないし図18に基づい
て請求項3に関わる発明の実施例(便宜上第2の実施例
という)を説明する。この第2の実施例においても図2
の自動販売機の制御システムを例にとり説明する。図1
3は、この第2の実施例における状態遷移表である。こ
の図13は図3に対し当該の処理プログラムの実行後に
移行する内部状態が追加されているほか、返金処理の部
分が変更されている。即ち自動販売機にお金(カードも
含む)が投入されると、コインメカニズム22で検出し
、コインメカニズム22から主制御装置21へ投入金額
検出イベントが送信される。待機状態、入金状態のとき
投入金額検出イベントを受信したならば、主制御装置2
1は投入された金額を計算し、販売可能な商品のランプ
を点灯する入金処理プログラムを実行し、内部状態32
を入金状態に変更する。また販売状態、返金状態のとき
投入金額検出イベントを受信したならば、そのイベント
31を一時保留し、内部状態が待機状態、入金状態にな
ったときに入金処理を行う。
Next, an embodiment of the invention according to claim 3 (referred to as a second embodiment for convenience) will be described mainly based on FIGS. 12 to 18. Also in this second embodiment, FIG.
This will be explained using a control system for a vending machine as an example. Figure 1
3 is a state transition table in this second embodiment. FIG. 13 differs from FIG. 3 in that an internal state to which the processing program is executed after execution has been added, and the refund processing portion has been changed. That is, when money (including a card) is inserted into the vending machine, it is detected by the coin mechanism 22, and an inserted amount detection event is transmitted from the coin mechanism 22 to the main controller 21. If the input amount detection event is received in the standby state or deposit state, the main controller 2
1 executes a deposit processing program that calculates the amount deposited and lights up the lamp of the product that can be sold, and the internal state 32
Change to deposit status. Further, if an input amount detection event is received in the sales state or refund state, the event 31 is temporarily put on hold, and the deposit processing is performed when the internal state becomes the standby state or deposit state.

【0024】商品を選択するためのボタンが押されると
、扉制御装置25で検出し、扉制御装置25から主制御
装置21へボタン押下イベントが送信される。内部状態
が入金状態のときは、どの商品を販売するかを決定(自
動販売機前面のどのボタンが押されたかを検出)し、そ
の決定にもとづき商品を搬出する販売処理プログラムを
実行し、内部状態を販売状態に変更する。それ以外の内
部状態のときは受信したイベントを無視する。商品の販
売が終了したら機器制御装置23から主制御装置21へ
販売終了イベントが送信される。内部状態が販売状態の
ときは、販売終了処理プログラムを実行し、内部状態を
入金状態か返金状態のどちらかに変更する。ここで販売
終了処理プログラムは、投入金額から商品価格を減算し
投入金額を更新する。そしてマルチベンドなら販売可能
な商品のランプを点灯し、内部状態32を入金状態に変
更する。他方、シングルベントなら更新した投入金額を
釣銭として払い出し、内部状態32を返金状態に変更す
る。なおマルチベンドとは、1回お金を投入すると、商
品の販売ごとに投入金額から商品価格を減算して投入金
額を更新し、まだ販売できる商品がある間(更新された
投入金額が商品価格よりも大きい間)、ボタンを押せば
続けて商品を販売できる販売方法である。またシングル
ベンドとは、1回お金を投入して1つの商品を販売する
と、更新した投入金額を釣銭として払い出す販売方法で
ある。また最初はマルチベンドであっても、更新した投
入金額が商品価格よりも小さくなればシングルベンドと
なる。内部状態が販売状態以外のときは受信したイベン
トを無視する。
When a button for selecting a product is pressed, it is detected by the door control device 25, and a button press event is transmitted from the door control device 25 to the main control device 21. When the internal state is in the deposit state, the internal Change the status to sold status. In any other internal state, the received event is ignored. When the sale of the product ends, a sale end event is transmitted from the device control device 23 to the main control device 21. When the internal state is in the sales state, a sales termination processing program is executed to change the internal state to either a deposit state or a refund state. Here, the sale termination processing program subtracts the product price from the input amount and updates the input amount. Then, if it is a multi-bend, the lamp of the product that can be sold is lit, and the internal state 32 is changed to the deposit state. On the other hand, if it is a single vent, the updated input amount is paid out as change and the internal state 32 is changed to a refund state. Multi-bend means that once you invest money, each time you sell a product, the product price is subtracted from the invested amount to update the invested amount, and while there are still products that can be sold (the updated invested amount is less than the product price). This is a sales method that allows you to continue selling products by pressing a button. Single bend is a sales method in which when a customer sells one product by inserting money once, the updated amount of money is paid out as change. Also, even if it is a multi-bend at first, if the updated input amount becomes smaller than the product price, it becomes a single-bend. Ignore the received event when the internal state is other than the sales state.

【0025】釣銭の払出しが終了したとき、コインメカ
ニズム22から主制御装置21へ返金終了イベントが送
信される。内部状態が返金状態のとき返金終了イベント
を受信すると、販売のために点灯したランプを消灯し待
機状態にもどるための待機移行処理プログラムを実行し
、内部状態を待機状態に変更する。それ以外の内部状態
のときは受信したイベントを無視する。サービスマンが
キーボードの操作を行ったとき、キーボード制御装置2
4から主制御装置21へキーボード操作開始イベントが
送信される。内部状態が待機状態のときキーボード操作
開始イベントを受信すると、キーボードからの入力を制
御するキー入力開始処理プログラムを実行し、内部状態
をキーボード操作中状態に変更する。それ以外の内部状
態のときは受信したイベントを無視する。サービスマン
がキーボードの操作を終了したとき、キーボード制御装
置24から主制御装置21へキーボード操作終了イベン
トが送信される。内部状態がキーボード操作中状態のと
きキーボード操作終了イベントを受信すると、キーボー
ドからの入力処理を終了するキー入力終了処理プログラ
ムを実行し、内部状態を待機状態に変更する。それ以外
の内部状態のときは受信したイベントを無視する。
When the payout of change is completed, a refund end event is transmitted from the coin mechanism 22 to the main controller 21. When a refund end event is received when the internal state is in the refund state, a standby transition processing program is executed to turn off the lamp that was lit for sale and return to the standby state, and the internal state is changed to the standby state. In any other internal state, the received event is ignored. When the serviceman operates the keyboard, the keyboard control device 2
4 sends a keyboard operation start event to the main controller 21. When a keyboard operation start event is received while the internal state is in a standby state, a key input start processing program that controls input from the keyboard is executed, and the internal state is changed to a keyboard operation in progress state. In any other internal state, the received event is ignored. When the service person finishes operating the keyboard, a keyboard operation end event is transmitted from the keyboard control device 24 to the main control device 21. When a keyboard operation end event is received while the internal state is in the keyboard operation state, a key input end processing program is executed to end the input processing from the keyboard, and the internal state is changed to a standby state. In any other internal state, the received event is ignored.

【0026】この第2の実施例においても、イベント3
1はマイクロコンピュータの中で図5に示すようにコー
ド化されている。また内部状態32もマイクロコンピュ
ータの中で図4に示すようにコード化されている。
[0026] Also in this second embodiment, event 3
1 is coded in the microcomputer as shown in FIG. The internal state 32 is also coded in the microcomputer as shown in FIG.

【0027】この第2の実施例では販売終了処理が実行
されたときの内部状態の更新方法を説明する。なお処理
プログラムを選択する方法は前記第1の実施例と同様で
ある。図14(a)に図12の内部状態変更情報記憶手
段17の構造を示す。内部状態変更情報記憶手段17は
2次元の配列構造であり、横方向に図5で述べたイベン
トコード、縦方向に図4で述べた内部状態コードが割り
付けてある。この配列の各要素60は図14(b)に示
すような構造体で構成される。この構造体中のレコード
61には次の内部状態を決定するために参照しなければ
ならない図12の作業データ記憶手段(つまり処理プロ
グラム14の処理に必要なデータや、その処理結果を格
納するメモリ)16の中にある整数型データについての
アドレスとしてのデータポインタを格納し、もし参照し
なければならないデータが無い場合は0を格納する。ま
たこの構造体中のレコード62は1次元配列構造であり
、この配列62の0〜3の添字はレコード61に格納さ
れているアドレス(データポインタ)の指す(作業デー
タ記憶手段16内の)メモリ領域に格納された値に対応
し、その添字部分の要素には更新すべき新しい内部状態
コードを格納している。本実施例ではレコード61に格
納されているアドレスの指すメモリ領域に格納された値
は0から3までを識別できる。(言い換えると次に移行
する内部状態は最大4つまで記述することができる。)
In this second embodiment, a method of updating the internal state when the sales termination process is executed will be explained. Note that the method for selecting a processing program is the same as in the first embodiment. FIG. 14(a) shows the structure of the internal state change information storage means 17 of FIG. 12. The internal state change information storage means 17 has a two-dimensional array structure, and the event codes described in FIG. 5 are allocated in the horizontal direction, and the internal state codes described in FIG. 4 are allocated in the vertical direction. Each element 60 of this array is composed of a structure as shown in FIG. 14(b). The record 61 in this structure contains the work data storage means of FIG. 12 that must be referred to in order to determine the next internal state (that is, the memory that stores the data necessary for processing the processing program 14 and the processing results). ) 16 as an address for the integer type data, and if there is no data to be referenced, 0 is stored. Also, the record 62 in this structure is a one-dimensional array structure, and the subscripts 0 to 3 of this array 62 are the memory (in the work data storage means 16) pointed to by the address (data pointer) stored in the record 61. Corresponding to the value stored in the area, the new internal status code to be updated is stored in the subscript element. In this embodiment, the values stored in the memory area pointed to by the address stored in the record 61 can be identified from 0 to 3. (In other words, up to four internal states to transition to next can be described.)

【0028】図15は内部状態変更情報記憶手段17の
要素60内の例を示している。図15(a)はイベント
31が販売終了、内部状態32が販売状態(イベントコ
ード=2,状態コード=2)のときの要素60aの例で
ある。この要素60aのレコード61には作業データ記
憶手段16内のデータとしてのシングルベンドフラグの
アドレスが格納されており、これはイベントが販売終了
、内部状態が販売状態の時、処理プログラム14の実行
後に移行する内部状態を決定するには、作業データ記憶
手段16内のデータとしてのシングルベンドフラグの値
を参照すべきことを示している。この要素60aのレコ
ード62には次に移行する内部状態(内部状態コード)
が格納されている。これはイベントが販売終了、内部状
態が販売状態のとき、次の内部状態は作業データ記憶手
段内のシングルベンドフラグの値を参照し、その値が0
のとき入金状態(内部状態コード=1)、その値が1の
とき返金状態(内部状態コード=3)、その値が0,1
以外のときは内部状態はそのまま(内部状態コード=−
1)であることを示している
FIG. 15 shows an example of the element 60 of the internal state change information storage means 17. FIG. 15A shows an example of the element 60a when the event 31 is the sale end and the internal state 32 is the sale state (event code=2, status code=2). The address of the single bend flag as data in the work data storage means 16 is stored in the record 61 of this element 60a. This indicates that the value of the single bend flag as data in the working data storage means 16 should be referred to in order to determine the internal state to which the transition will occur. The record 62 of this element 60a contains the internal state to be transferred to next (internal state code)
is stored. This means that when the event is sold out and the internal state is sold, the next internal state refers to the value of the single bend flag in the working data storage means, and the value is 0.
When the value is 1, the deposit status is (internal status code = 1), and when the value is 1, the refund status is (internal status code = 3), and the value is 0, 1.
Otherwise, the internal state remains unchanged (internal state code = -
1)

【0029】図15(b)は同様にイベント31が投入
金額検出、内部状態32が待機状態(イベントコード=
0,内部状態コード=0)のときの要素60bの例であ
る。この場合、レコード61には0が格納されているの
で、参照しなければならないデータが無いことを示して
いる。この場合はレコード62の配列の0番目に次に移
行する内部状態(内部状態コード)が格納されている。 本例ではイベントが投入金額検出、内部状態が待機状態
のとき、次の内部状態は入金状態(内部状態コード=1
)であることを示している。
Similarly, in FIG. 15(b), event 31 indicates the detection of the input amount, and internal state 32 indicates the standby state (event code=
0, internal state code=0) is an example of element 60b. In this case, record 61 stores 0, indicating that there is no data to be referenced. In this case, the next internal state (internal state code) is stored in the 0th position of the array of records 62. In this example, when the event detects the input amount and the internal state is in the standby state, the next internal state is the deposit state (internal state code = 1).
).

【0030】図15(c)はイベント31が投入金額検
出、内部状態32が待機状態(イベントコード=0,内
部状態コード=0)のときの要素60cの例である。こ
の場合、レコード61には0が格納されているので、参
照しなければならないデータが無いことを示している。 従ってレコード62の配列の0番目を参照し、内部状態
コードが−1であることを知る。内部状態コードが−1
の場合は、次に移行する内部状態は現在の内部状態と同
じ(内部状態の移行を行わない)ことを示している。
FIG. 15(c) is an example of the element 60c when the event 31 is the detection of the input amount and the internal state 32 is in the standby state (event code=0, internal state code=0). In this case, record 61 stores 0, indicating that there is no data to be referenced. Therefore, it refers to the 0th position in the array of record 62 and learns that the internal status code is -1. Internal status code is -1
In the case of , it indicates that the next internal state to be transitioned to is the same as the current internal state (internal state transition is not performed).

【0031】以下図16ないし図18のフローチャート
に従って説明する。図16は本第2の実施例の動作手順
を示すフローチャートである。同図のステップ801,
802は図12の処理プログラム選択手段13の動作手
順であり、内部状態32とイベント31から、ステップ
803〜808のどの処理プログラムを実行するかを決
める。ステップ809は図12の内部状態変更手段15
の動作手順であり、その詳細は図18に示す。
The process will be explained below according to the flowcharts shown in FIGS. 16 to 18. FIG. 16 is a flowchart showing the operation procedure of the second embodiment. Step 801 in the same figure,
802 is an operation procedure of the processing program selection means 13 in FIG. 12, which determines which processing program in steps 803 to 808 is to be executed based on the internal state 32 and the event 31. Step 809 is performed by the internal state changing means 15 in FIG.
The details are shown in FIG. 18.

【0032】図17は処理プログラム14(図12)の
具体例で販売終了処理のフローチャートである。ステッ
プ901で投入金額から商品価格を減算し投入金額を更
新する。ステップ902では更新した投入金額と商品価
格を比較し、投入金額の方が大きければステップ903
,904に進み、そうでなければステップ905,90
6に進む。ステップ903,904はマルチベンドのと
きであり、ステップ903で作業データ記憶手段16内
のデータとしてのシングルベンドフラグに0をセットす
る。ステップ904では次に販売できるようにするため
販売可能な商品のランプを点灯する。ステップ905,
906はシングルベンドのときであり、ステップ905
で作業データ記憶手段16内のシングルベンドフラグに
1をセットする。ステップ906では更新した投入金額
を釣銭として払い出す指令を出す。この販売終了処理で
はステップ903,905で作業データ記憶手段16内
のシングルベンドフラグの値を設定している。
FIG. 17 is a specific example of the processing program 14 (FIG. 12), which is a flowchart of sales termination processing. In step 901, the product price is subtracted from the input amount to update the input amount. In step 902, the updated input amount is compared with the product price, and if the input amount is larger, step 903
, 904, otherwise go to steps 905, 90
Proceed to step 6. Steps 903 and 904 are for multi-bend, and in step 903, the single-bend flag as data in the work data storage means 16 is set to 0. In step 904, lamps of salable products are turned on so that they can be sold next. step 905,
906 is a single bend, and step 905
Then, the single bend flag in the work data storage means 16 is set to 1. In step 906, a command is issued to pay out the updated amount of money as change. In this sales termination process, the value of the single bend flag in the work data storage means 16 is set in steps 903 and 905.

【0033】図18は内部状態変更手段15の動作手順
を示すフローチャートである。ステップ1001で現在
の内部状態32とイベント31をもとにして、内部状態
変更情報記憶手段17内の該当する要素60のレコード
61の値を変数dataptr に代入する。これは次
の内部状態を決定するために参照しなければならない作
業データ記憶手段16の中にある整数型データのアドレ
スを示している。例えば、処理プログラムが販売終了処
理のときはシングルベンドフラグのアドレスが格納され
ている(図15(a)を参照)。ステップ1002では
変数dataptr の値が0かどうかを調べ、0であ
ればステップ1003へ、そうでなければステップ10
04に進む。変数dataptr の値が0の場合は参
照するデータが無いことを示しているのでステップ10
03に進み、変数datanoに0を格納する。変数d
ataptr の値が0以外の場合は、ステップ100
4に進み、変数dataptr に格納されているアド
レスの指す値を取り出し変数datanoに格納する。 ステップ1005では変数datanoを用い該当要素
60のレコード62の変数datanoに相当する配列
番号位置に格納されているデータを取り出し、変数ns
tsに代入する。 ここには次に移行する内部状態コードが書かれている。 ステップ1006で変数nstsを調べ、nstsが−
1でなければステップ1007で新しい内部状態を内部
状態記憶手段に格納する。nstsが−1の場合は次に
移行する内部状態は現在の内部状態と同じである(内部
状態の移行を行わない)ので何もせずに終了する。
FIG. 18 is a flowchart showing the operation procedure of the internal state changing means 15. In step 1001, based on the current internal state 32 and event 31, the value of the record 61 of the corresponding element 60 in the internal state change information storage means 17 is assigned to the variable dataptr. This indicates the address of the integer type data in the working data storage means 16 that must be referred to in order to determine the next internal state. For example, when the processing program is a sales end process, the address of the single bend flag is stored (see FIG. 15(a)). In step 1002, it is checked whether the value of the variable dataptr is 0. If it is 0, go to step 1003, otherwise go to step 10.
Proceed to 04. If the value of the variable dataptr is 0, it means that there is no data to refer to, so proceed to step 10.
Proceed to step 03 and store 0 in the variable datano. variable d
If the value of ataptr is other than 0, step 100
Proceeding to step 4, the value pointed to by the address stored in the variable dataptr is retrieved and stored in the variable datano. In step 1005, the variable datano is used to retrieve the data stored in the array number position corresponding to the variable datano of the record 62 of the corresponding element 60, and the variable ns
Assign to ts. The internal status code for the next transition is written here. In step 1006, the variable nsts is checked and nsts is -
If it is not 1, the new internal state is stored in the internal state storage means in step 1007. If nsts is -1, the internal state to which the next transition is made is the same as the current internal state (no internal state transition is performed), so the process ends without doing anything.

【0034】[0034]

【発明の効果】請求項1に関わる発明によれば、発生し
たイベント31と内部で持っている内部状態32とによ
ってどのような処理を行うかを決定するイベント駆動型
の制御を行うマイクロコンピュータ制御システムにおい
て、前記内部状態の種別を記憶する内部状態記憶手段7
と、発生した前記イベントを受信するイベント受信手段
1と、該イベント受信手段1で受信したイベントの前記
内部状態の種別毎の処理方式を記憶したイベント処理方
式記憶手段6と、前記イベント受信手段1で受信したイ
ベントを前記イベント処理方式記憶手段6と内部状態記
憶手段7とを参照し、受信したイベントに対応したプロ
グラムを実行するか、それとも一時保留するか、無視す
るかを決定するイベント解析手段2と、該イベント解析
手段2によって一時保留と決定したイベントを保留する
保留イベント記憶手段8と、前記イベント解析手段2に
よって解析した結果にもとずき、受信したイベントに対
応したプログラムを実行するか、もしくはそのイベント
を前記保留イベント記憶手段8に記憶するか、またはそ
のイベントを無視する受信イベント制御手段3と、前記
内部状態の種別毎の実行可能なイベントを記憶する実行
イベント記憶手段9と、内部状態が変化したとき、前記
実行イベント記憶手段9を参照し、前記保留イベント記
憶手段8より実行可能なイベントを取り出し、そのイベ
ントに対応するプログラムを実行させる保留イベント制
御手段4とを備えるようにしたので、汎用的なイベント
管理方法を提供することにより制御システムの制御方式
が変更されたとき、受信したイベントの一時保留や保留
していたイベントの実行および廃棄が、イベント処理方
式記憶手段、実行イベント記憶手段、廃棄イベント記憶
手段に記憶されているデータの変更のみで可能となり、
制御システムの制御方式の変更が容易に行えるいう効果
が得られる。
Effects of the Invention According to the invention related to claim 1, the microcomputer control performs event-driven control that determines what kind of processing is to be performed depending on the event 31 that has occurred and the internal state 32 that it has internally. In the system, internal state storage means 7 for storing the type of the internal state.
, an event receiving means 1 that receives the event that has occurred, an event processing method storage means 6 that stores a processing method for each type of the internal state of the event received by the event receiving means 1, and the event receiving means 1. event analysis means for determining whether to execute a program corresponding to the received event, temporarily suspend it, or ignore it by referring to the event processing method storage means 6 and internal state storage means 7; 2, a suspended event storage means 8 for suspending the event determined to be temporarily suspended by the event analyzing means 2, and executing a program corresponding to the received event based on the results analyzed by the event analyzing means 2. or, a reception event control means 3 which stores the event in the pending event storage means 8 or ignores the event, and an execution event storage means 9 which stores executable events for each type of internal state. and pending event control means 4 which refers to the execution event storage means 9, retrieves an executable event from the pending event storage means 8, and executes a program corresponding to the event when the internal state changes. By providing a general-purpose event management method, when the control method of the control system is changed, the event processing method storage means, the temporary suspension of received events, the execution and discarding of the suspended events, This is possible by simply changing the data stored in the execution event storage means and the discard event storage means.
The effect is that the control method of the control system can be easily changed.

【0035】また請求項2に関わる発明によれば、前記
請求項1に関わる発明の電子計算機装置にさらに、内部
状態が変化したとき、該内部状態において保留していた
イベントの中で廃棄すべき対象となるイベントを記憶す
る廃棄イベント記憶手段10と、該廃棄イベント記憶手
段10を参照し前記保留イベント記憶手段8に保留して
いたイベントを取り消す廃棄イベント制御手段5とを備
えるようにしたので、内部状態が変化したときに一時的
に保留してあったイベントを調べ、保留しておく必要が
なくなったイベントの保留を取りやめることにより、制
御システムの異常処理や例外処理が容易に行えるという
効果が得られる。
Further, according to the invention related to claim 2, when the internal state of the computer device of the invention related to claim 1 changes, an event that should be discarded among the pending events in the internal state is further provided. The discard event storage means 10 stores the target event, and the discard event control means 5 refers to the discard event storage means 10 and cancels the event held in the pending event storage means 8. By checking the events that were temporarily suspended when the internal state changes and canceling the suspension of events that no longer need to be suspended, it is possible to easily handle abnormalities and exceptions in the control system. can get.

【0036】また請求項3に関わる発明によれば、現在
の内部状態32の種別を記憶する内部状態記憶手段7と
、発生したイベント31を受信するイベント受信手段1
と、前記の受信されたイベント31および記憶された内
部状態32を参照し、どの処理プログラム14を実行す
るかを選択しその処理プログラム14を実行させる処理
プログラム選択手段13とを備えた、イベント駆動型の
制御を行うマイクロコンピュータ制御システムにおいて
、前記の受信されたイベント31および記憶された内部
状態32の組合せ毎に、当該の処理プログラム14の実
行後にとり得る1または複数の内部状態(レコード62
)と、該内部状態を決定するためのアドレスデータであ
って、前記処理プログラムの作業データを記憶する記憶
手段16内に格納されるアドレスデータの格納位置を示
すデータポインタ(レコード62)とを予め(要素60
として)設定され記憶する内部状態変更情報記憶手段1
7、当該の処理プログラム14の実行後、前記内部状態
変更情報記憶手段17を参照して新しい内部状態を決定
し前記内部状態記憶手段7を更新する内部状態変更手段
15、を備えるようにしたので、内部状態変更情報記憶
手段17を見れば、プログラムを解析することなく制御
システムの状態遷移がどの様になっているかを短時間で
知ることができるという効果が得られる。
According to the third aspect of the invention, the internal state storage means 7 stores the type of the current internal state 32, and the event reception means 1 receives the event 31 that has occurred.
and a processing program selection means 13 that refers to the received event 31 and the stored internal state 32, selects which processing program 14 is to be executed, and causes the processing program 14 to be executed. In a microcomputer control system that performs mold control, for each combination of the received event 31 and the stored internal state 32, one or more internal states (record 62
) and a data pointer (record 62) indicating the storage position of the address data, which is address data for determining the internal state and is stored in the storage means 16 that stores the work data of the processing program. (Element 60
Internal state change information storage means 1 for setting and storing (as)
7. Internal state changing means 15 is provided, which refers to the internal state change information storage means 17 to determine a new internal state and updates the internal state storage means 7 after the processing program 14 is executed. By looking at the internal state change information storage means 17, it is possible to obtain the effect that the state transition of the control system can be known in a short time without analyzing the program.

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

【図1】請求項1および請求項2に関わる発明の機能構
成を示すブロック図
[Fig. 1] A block diagram showing the functional configuration of the invention related to claims 1 and 2.

【図2】本発明の適用される実施例としての自動販売機
のシステム構成を示すブロック図
FIG. 2 is a block diagram showing the system configuration of a vending machine as an embodiment to which the present invention is applied.

【図3】図2のシステムにおけるイベントおよび内部状
態別の処理内容を示す図
[Figure 3] Diagram showing processing contents by event and internal state in the system in Figure 2

【図4】同じく状態コードの実施例を示す図[Figure 4] A diagram showing an example of the status code as well.

【図5】同
じくイベントコードの実施例を示す図
[Figure 5] Diagram showing an example of the event code

【図6】同じくイ
ベント処理方式記憶手段の内容の実施例を示す図
FIG. 6 is a diagram showing an example of the contents of the event processing method storage means.

【図7】同じく保留イベント記憶手段の構成の実施例を
示す図
FIG. 7 is a diagram showing an example of the configuration of the pending event storage means.

【図8】同じく廃棄イベント記憶手段の構成の実施例を
示す図
FIG. 8 is a diagram showing an example of the configuration of the discard event storage means.

【図9】同じく実行イベント記憶手段の構成の実施例を
示す図
FIG. 9 is a diagram showing an example of the configuration of the execution event storage means.

【図10】,[Figure 10],

【図11】図1中の各制御手段の動作手順を総括して表
わすフローチャート
[FIG. 11] A flowchart summarizing the operation procedure of each control means in FIG. 1.

【図12】請求項3に関わる発明の機能構成を示すブロ
ック図
FIG. 12 is a block diagram showing the functional configuration of the invention according to claim 3.

【図13】同じく状態遷移表の実施例を示す図[Figure 13] A diagram showing an example of the state transition table as well.

【図14
】図12の内部状態変更情報記憶手段の構成を示す図
[Figure 14
] A diagram showing the configuration of the internal state change information storage means in FIG. 12.

【図15】内部状態変更情報記憶手段の要素の例を示す
FIG. 15 is a diagram showing an example of elements of internal state change information storage means.

【図16】図12の動作の実施例としてのフローチャー
FIG. 16 is a flowchart as an example of the operation in FIG. 12;

【図17】処理プログラムの実施例としてのフローチャ
ート
[Figure 17] Flowchart as an example of a processing program

【図18】図12の内部状態変更手段の動作を示す詳細
フローチャート
FIG. 18 is a detailed flowchart showing the operation of the internal state changing means in FIG. 12;

【符号の説明】[Explanation of symbols]

1    イベント受信手段 2    イベント解析手段 3    受信イベント制御手段 4    保留イベント制御手段 5    廃棄イベント制御手段 6    イベント処理方式記憶手段 7    内部状態記憶手段 8    保留イベント記憶手段 9    実行イベント記憶手段 10    廃棄イベント記憶手段 13    処理プログラム選択手段 14    処理プログラム 15    内部状態変更手段 16    作業データ記憶手段 17    内部状態変更情報記憶手段31    イ
ベント 32    内部状態 60(60a〜60c)    要素 61    レコード 62    レコード
1 Event receiving means 2 Event analyzing means 3 Received event controlling means 4 Pending event controlling means 5 Discarding event controlling means 6 Event processing method storing means 7 Internal state storing means 8 Pending event storing means 9 Execution event storing means 10 Discarding event storing means 13 Processing program selection means 14 Processing program 15 Internal state change means 16 Work data storage means 17 Internal state change information storage means 31 Event 32 Internal state 60 (60a to 60c) Element 61 Record 62 Record

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】発生したイベントと内部で持っている内部
状態とによってどのような処理を行うかを決定するイベ
ント駆動型の制御を行うマイクロコンピュータ制御シス
テムにおいて前記内部状態の種別を記憶する内部状態記
憶手段と、発生した前記イベントを受信するイベント受
信手段と、該イベント受信手段で受信したイベントの前
記内部状態の種別毎の処理方式を記憶したイベント処理
方式記憶手段と、前記イベント受信手段で受信したイベ
ントを前記イベント処理方式記憶手段と内部状態記憶手
段とを参照し、受信したイベントに対応したプログラム
を実行するか、それとも一時保留するか、無視するかを
決定するイベント解析手段と、該イベント解析手段によ
って一時保留と決定したイベントを保留する保留イベン
ト記憶手段と、前記イベント解析手段によって解析した
結果にもとずき、受信したイベントに対応したプログラ
ムを実行するか、もしくはそのイベントを前記保留イベ
ント記憶手段に記憶するか、またはそのイベントを無視
する受信イベント制御手段と、前記内部状態の種別毎の
実行可能なイベントを記憶する実行イベント記憶手段と
、内部状態が変化したとき、前記実行イベント記憶手段
を参照し、前記保留イベント記憶手段より実行可能なイ
ベントを取り出し、そのイベントに対応するプログラム
を実行させる保留イベント制御手段とを備えたことを特
徴とする電子計算機装置。
[Claim 1] An internal state that stores the type of the internal state in a microcomputer control system that performs event-driven control that determines what kind of processing is to be performed depending on an event that occurs and an internal state that it has. a storage means, an event reception means for receiving the event that has occurred, an event processing method storage means for storing a processing method for each type of the internal state of the event received by the event reception means, and an event reception means for receiving the event by the event reception means. event analysis means for determining whether to execute a program corresponding to the received event, temporarily suspend it, or ignore it by referring to the event processing method storage means and internal state storage means; A pending event storage means for suspending an event determined to be temporarily suspended by the analysis means; and a program corresponding to the received event is executed or the event is suspended based on the result analyzed by the event analysis means. reception event control means for storing the event in the event storage means or ignoring the event; execution event storage means for storing executable events for each type of the internal state; and when the internal state changes, the execution event A computer device comprising pending event control means for referring to storage means, extracting an executable event from said pending event storage means, and causing a program corresponding to the event to be executed.
【請求項2】発生したイベントと内部で持っている内部
状態とによってどのような処理を行うかを決定するイベ
ント駆動型の制御を行うマイクロコンピュータ制御シス
テムにおいて、前記内部状態の種別を記憶する内部状態
記憶手段と、発生した前記イベントを受信するイベント
受信手段と、該イベント受信手段で受信したイベントの
前記内部状態の種別毎の処理方式を記憶したイベント処
理方式記憶手段と、前記イベント受信手段で受信したイ
ベントを前記イベント処理方式記憶手段と内部状態記憶
手段とを参照し、受信したイベントに対応したプログラ
ムを実行するか、それとも一時保留するか、無視するか
を決定するイベント解析手段と、該イベント解析手段に
よって一時保留と決定したイベントを保留する保留イベ
ント記憶手段と、前記イベント解析手段によって解析し
た結果にもとずき、受信したイベントに対応したプログ
ラムを実行するか、もしくはそのイベントを前記保留イ
ベント記憶手段に記憶するか、またはそのイベントを無
視する受信イベント制御手段と、前記内部状態の種別毎
の実行可能なイベントを記憶する実行イベント記憶手段
と、内部状態が変化したとき、前記実行イベント記憶手
段を参照し、前記保留イベント記憶手段より実行可能な
イベントを取り出し、そのイベントに対応するプログラ
ムを実行させる保留イベント制御手段と内部状態が変化
したとき、該内部状態において保留していたイベントの
中で廃棄すべき対象となるイベントを記憶する廃棄イベ
ント記憶手段と、該廃棄イベント記憶手段を参照し前記
保留イベント記憶手段に保留していたイベントを取り消
す廃棄イベント制御手段とを備えたことを特徴とする電
子計算機装置。
2. In a microcomputer control system that performs event-driven control that determines what kind of processing is to be performed depending on an event that occurs and an internal state that it has, an internal memory that stores the type of the internal state. a state storage means; an event reception means for receiving the event that has occurred; an event processing method storage means for storing a processing method for each type of the internal state of the event received by the event reception means; event analysis means that refers to the received event in the event processing method storage means and the internal state storage means and determines whether to execute a program corresponding to the received event, temporarily suspend it, or ignore it; A pending event storage means for suspending an event determined to be temporarily suspended by the event analyzing means; and a pending event storing means for suspending an event determined to be temporarily suspended by the event analyzing means, and a program corresponding to the received event is executed or the event is received event control means for storing the event in the pending event storage means or ignoring the event; execution event storage means for storing executable events for each type of the internal state; Pending event control means refers to the event storage means, retrieves an executable event from the pending event storage means, and executes a program corresponding to the event; and when the internal state changes, the event that was pending in the internal state; A discard event storage means for storing an event to be discarded in the event storage means, and a discard event control means for referring to the discard event storage means and canceling an event held in the pending event storage means. Characteristic electronic computer equipment.
【請求項3】現在の内部状態の種別を記憶する内部状態
記憶手段と、発生したイベントを受信するイベント受信
手段と、前記の受信されたイベントおよび記憶された内
部状態を参照し、どの処理プログラムを実行するかを選
択しその処理プログラムを実行させる処理プログラム選
択手段とを備えた、イベント駆動型の制御を行うマイク
ロコンピュータ制御システムにおいて、前記の受信され
たイベントおよび記憶された内部状態の組合せ毎に、当
該の処理プログラムの実行後にとり得る1または複数の
内部状態と、該内部状態を決定するためのアドレスデー
タであって、前記処理プログラムの作業データを記憶す
る記憶手段内に格納されるアドレスデータの格納位置を
示すデータポインタとを予め設定され記憶する内部状態
変更情報記憶手段、当該の処理プログラムの実行後、前
記内部状態変更情報記憶手段を参照して新しい内部状態
を決定し前記内部状態記憶手段を更新する内部状態変更
手段を備えたことを特徴とする電子計算機装置。
3. Internal state storage means for storing the type of current internal state; event reception means for receiving the generated event; and a processing program that refers to the received event and the stored internal state. In a microcomputer control system that performs event-driven control, the microcomputer control system includes processing program selection means for selecting a processing program to be executed and executing the processing program. one or more internal states that can be assumed after execution of the processing program, and address data for determining the internal states, the address being stored in a storage means for storing work data of the processing program; an internal state change information storage means for presetting and storing a data pointer indicating a data storage position, and after executing the processing program, refers to the internal state change information storage means to determine a new internal state; An electronic computer device comprising internal state changing means for updating storage means.
JP1560991A 1990-02-08 1991-02-07 Electronic computer Pending JPH04211892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1560991A JPH04211892A (en) 1990-02-08 1991-02-07 Electronic computer

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2-28739 1990-02-08
JP2873990 1990-02-08
JP1560991A JPH04211892A (en) 1990-02-08 1991-02-07 Electronic computer

Publications (1)

Publication Number Publication Date
JPH04211892A true JPH04211892A (en) 1992-08-03

Family

ID=26351791

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1560991A Pending JPH04211892A (en) 1990-02-08 1991-02-07 Electronic computer

Country Status (1)

Country Link
JP (1) JPH04211892A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008311978A (en) * 2007-06-15 2008-12-25 Auto Network Gijutsu Kenkyusho:Kk Relay connection unit
JP2017168070A (en) * 2016-03-10 2017-09-21 富士電機株式会社 Multitask control device, multitask control system, and vending machine

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008311978A (en) * 2007-06-15 2008-12-25 Auto Network Gijutsu Kenkyusho:Kk Relay connection unit
JP2017168070A (en) * 2016-03-10 2017-09-21 富士電機株式会社 Multitask control device, multitask control system, and vending machine

Similar Documents

Publication Publication Date Title
US6141650A (en) Sales data processing system capable of automatically calculating sales taxes
JPH04211892A (en) Electronic computer
JPS5941209B2 (en) Bi-programmable electronic accounting system
KR19980079668A (en) Parallel Data Processing System and Its Control Method
EP0303660A1 (en) Electronic business terminal.
KR20010076275A (en) Semiconductor memory device and program discrimination system
JP2893989B2 (en) Electronic cash register
JPH0719311B2 (en) Data processing device
JPH0193886A (en) Data setter for vending machine
JPH10187548A (en) Storage device
JPH04245395A (en) Program control method
JPH09270059A (en) Control program display system for automatic vending machine
JPH0950391A (en) Data processing device
KR930003992B1 (en) Method of connecting terminals in electrical cash register
KR100250876B1 (en) How to manage program change history for cash registers
JP2501121B2 (en) Task management method
CN118710055A (en) Virtual and real combined resource processing method, device, equipment and storage medium
KR950003799B1 (en) How to Handle Function Keys in Electronic Cash Registers
JPH0944283A (en) Keyboard control method
JPS6388674A (en) Transaction processing device
JPH0334017A (en) Automatic product installing system
JP2509928B2 (en) Refund handling period setting method
JP2811906B2 (en) Vending machine data error notification control device
JPH04336631A (en) Error message output system
KR20030042240A (en) Method of processing alarm at the interactive program in a mmi system