JP3234240B2 - Control method of serial port of programmable controller - Google Patents

Control method of serial port of programmable controller

Info

Publication number
JP3234240B2
JP3234240B2 JP00812091A JP812091A JP3234240B2 JP 3234240 B2 JP3234240 B2 JP 3234240B2 JP 00812091 A JP00812091 A JP 00812091A JP 812091 A JP812091 A JP 812091A JP 3234240 B2 JP3234240 B2 JP 3234240B2
Authority
JP
Japan
Prior art keywords
serial port
communication
transmission
programmable controller
general
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.)
Expired - Lifetime
Application number
JP00812091A
Other languages
Japanese (ja)
Other versions
JPH04250754A (en
Inventor
大 中井
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP00812091A priority Critical patent/JP3234240B2/en
Publication of JPH04250754A publication Critical patent/JPH04250754A/en
Application granted granted Critical
Publication of JP3234240B2 publication Critical patent/JP3234240B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、シリアルポートを内蔵
して通信が行えるプログラマブルコントローラの制御方
式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control system for a programmable controller capable of communicating with a built-in serial port.

【0002】[0002]

【従来の技術】プログラマブルコントローラに要求され
るシリアル通信には、コンピュータリンクのサービス部
が処理を行ってレスポンスを返す機能と、任意の手順に
てプログラマブルコントローラと他のシリアルポートを
持った計測器やコンピュータとの汎用通信を行う機能の
2種類がある。
2. Description of the Related Art Serial communication required by a programmable controller includes a function of a service unit of a computer link to return a response and a measuring instrument having a programmable controller and another serial port in an arbitrary procedure. There are two types of functions for performing general-purpose communication with a computer.

【0003】[0003]

【発明が解決しようとする課題】しかし、シリアルポー
トはコスト的な問題や、大きさの問題等で余り多く設け
ることができなかったので、従来のプログラマブルコン
トローラはこれらの2種類の機能の内、どちらか一方の
機能しか満たすことができなかった。本発明は、シリア
ルポートの通信制御処理を切り換えることによって、コ
ンピュータリンク、汎用通信のどちらの機能にも対応可
能としたプログラマブルコントローラのシリアルポート
の制御方式を提供するにある。
However, since a serial port could not be provided too much due to a cost problem or a size problem, a conventional programmable controller has two of these two functions. Only one of the functions could be satisfied. An object of the present invention is to provide a control method for a serial port of a programmable controller which can support both functions of computer link and general-purpose communication by switching communication control processing of the serial port.

【0004】[0004]

【課題を解決するための手段】本発明は、上述の目的を
達成するために、プログラマブルコントローラにシリア
ル通信用のシリアルポートを1つ以上備えるとともに、
このシリアルポートを使い分けるためのパラメータを書
き込むパラメータエリアを備え、該パラメータエリアに
シリアル通信を行う命令に基づく汎用通信機能と、専用
手順によるコンピュータリンク機能との何れかを選択設
定するパラメータをセットし、シリアルポートの通信制
御機能を上記パラメータに基づいて切り換えるものであ
る。
According to the present invention, in order to achieve the above-mentioned object, a programmable controller includes one or more serial ports for serial communication,
A parameter area for writing a parameter for selectively using the serial port is provided, and a parameter for selecting and setting one of a general-purpose communication function based on a command for performing serial communication and a computer link function by a dedicated procedure is set in the parameter area, The communication control function of the serial port is switched based on the above parameters.

【0005】[0005]

【作用】而して本発明によればパラメータエリアに汎用
通信、コンピュータリンクのいずれかの機能を選択する
パラメータを書き込むことにより、このパラメータエリ
アのパラメータを送受信処理の際にチェックすること
で、シリアルポートの通信制御処理の切り換えができ、
そのため汎用通信にも、コンピュータリンクにも使い分
けることができる。
According to the present invention, a parameter for selecting one of the general-purpose communication and computer link functions is written in the parameter area, and the parameter in this parameter area is checked at the time of transmission / reception processing. Port communication control processing can be switched,
Therefore, it can be used for both general communication and computer link.

【0006】[0006]

【実施例】図1は本発明に用いるプログラマブルコント
ローラの回路構成を示しており、このプログラマブルコ
ントローラは全体の信号処理を行うCPU1と、システ
ムプログラム等コンピュータリンクの専用手順等を格納
したROM2と、ユーザプログラムを格納したり、ワー
クエリアや、後述のパラメータエリアを設定したり、更
には通信時の受信バッファ、送信データの格納エリアを
構成するRAM3と、シリアルポート4と、I/Oイン
ターフェイス5とを備えたものである。
FIG. 1 shows a circuit configuration of a programmable controller used in the present invention. This programmable controller includes a CPU 1 for performing overall signal processing, a ROM 2 for storing computer link and other dedicated procedures such as system programs, and a user. A RAM 3, which stores a program, sets a work area and a parameter area to be described later, and configures a reception buffer and a transmission data storage area during communication, a serial port 4, and an I / O interface 5 It is provided.

【0007】RAM3に設定されるパラメータエリア
は、例えばアドレス0を、機能選択フラグをセットする
エリアとし、アドレス1を汎用通信機能の選択時におい
て、受信バッファの先頭番地を格納するエリア、アドレ
ス2を汎用通信機能の選択時において、受信バッファの
容量指定等に用いる。機能選択フラグは例えば、「0」
をセットしたときコンピュータリンク機能を、「1」を
セットしたとき汎用通信機能を選択設定する。
[0007] The parameter area set in the RAM 3 is, for example, an address 0 is an area for setting a function selection flag, an address 1 is an area for storing a head address of a reception buffer when a general communication function is selected, and an address 2 is an area for storing a head address. When selecting the general-purpose communication function, it is used to specify the capacity of the reception buffer. The function selection flag is, for example, “0”
When "1" is set, the computer link function is selected, and when "1" is set, the general-purpose communication function is selected and set.

【0008】而して本発明方式では、上述したパラメ−
タエリアに機能選択のフラグをセットすると、このセッ
トされたフラグに基づいてCPU1はシリアルポート4
の通信制御処理を切り換える。図2、図3は送受信処理
のフローを示しており、受信割り込みがかかると、図2
に示すように、CPU1はパラメータエリアのチェック
を行い、セットされている機能選択フラグが「1」であ
れば、汎用通信の制御処理に設定し、シリアルポート4
から受信データを読み取り「CR」コードの受信がなけ
れば、受信バイト数のインクリメント、受信バッファポ
イントの読み取り、受信バッファへのデータセットを行
う。この受信処理は「CR」コードの受信があるまで繰
り返して行う。
According to the method of the present invention, the above-described parameters are used.
When a function selection flag is set in the data area, the CPU 1 sets the serial port 4 based on the set flag.
Of the communication control process of (1). FIGS. 2 and 3 show the flow of the transmission / reception processing.
As shown in (2), the CPU 1 checks the parameter area, and if the set function selection flag is “1”, sets the control processing for general-purpose communication and sets the serial port 4
If no "CR" code is received, increment the number of received bytes, read the reception buffer point, and set data in the reception buffer. This receiving process is repeatedly performed until the “CR” code is received.

【0009】またこの汎用通信における送信は、送信命
令によって送信処理が為され、例えば図4のラーダー図
ではaの実行条件がオンすると、応用命令のコードF及
び応用命令のNo〔m〕からなる送信命令に基づいて、
送信要求する送信バファの先頭の番地Sと、その先頭に
格納されている送信バイト数とを図5に示す汎用通信処
理用ワークエリアA,Bへ複写して送信割り込みを許可
する。
The transmission in this general-purpose communication is performed by a transmission command. For example, in the ladder diagram of FIG. 4, when the execution condition a is turned on, the transmission command is composed of a code F of the application command and No. [m] of the application command. Based on the sending instruction,
The start address S of the transmission buffer for which transmission is requested and the number of transmission bytes stored at the start are copied to the general-purpose communication processing work areas A and B shown in FIG.

【0010】ここで送信バッファは図5に示すようなエ
リアの構成となっており、先頭番地0には送信バイト数
が、その後のアドレス1〜N+1には、送信データが格
納されている。しかして送信割り込みが許可され、パラ
メータエリアの機能選択フラグのチェックが行われ、汎
用通信機能がセットされていれば、CPU1は汎用通信
の制御処理に切り換え、まず汎用通信処理用ワークエリ
アAに格納している送信バイト数を取り込む。
Here, the transmission buffer has an area configuration as shown in FIG. 5, and the number of transmission bytes is stored at the head address 0, and transmission data is stored at subsequent addresses 1 to N + 1. Then, the transmission interrupt is permitted, the function selection flag in the parameter area is checked, and if the general-purpose communication function is set, the CPU 1 switches to the general-purpose communication control processing, and first stores it in the general-purpose communication processing work area A. Capture the number of transmitted bytes.

【0011】送信バイト数が0でなければ、取り込んだ
送信バイト数より1だけ減じた後、汎用通信処理用ワー
クエリアBに格納している送信バッファの先頭番地のポ
インタゲットを行い、送信バッファよりデータを読み取
り、シリアルポート4へデータを送信する。この送信
後、ワークエリアBに格納している送信バッファの先頭
番地のポインタのインクリメントを行う。このような処
理を送信バイト数が0となるまで繰り返して行い、送信
バイト数が0となれば、汎用通信を終了する。
If the number of transmission bytes is not 0, after subtracting 1 from the number of transmission bytes, the pointer of the start address of the transmission buffer stored in the general-purpose communication processing work area B is obtained. The data is read and transmitted to the serial port 4. After this transmission, the pointer of the start address of the transmission buffer stored in the work area B is incremented. Such processing is repeated until the number of transmission bytes becomes 0, and when the number of transmission bytes becomes 0, the general-purpose communication is terminated.

【0012】上記の送受信は汎用通信の場合であった
が、機能選択フラグが「0」にセットされ、コンピュー
タリンクの機能が選択されている場合は、次のような処
理がなされる。まず受信処理の場合、汎用通信の場合と
同様な処理がなされるが、コンピュータリンクの場合に
はRAM3に図6に示す専用の送受信バッファE,Fを
持っており、パラメータエリアには受信バッファFの先
頭番地のセット及び容量指定のデータの書き込みは行わ
れず、CPU1はコンピュータリンク機能の選択と判定
した場合に、コンピュータリンクサービス部の専用手順
に基づいて受信処理を開始する。
The above-mentioned transmission / reception is the case of general-purpose communication. However, when the function selection flag is set to "0" and the function of the computer link is selected, the following processing is performed. First, in the case of the reception processing, the same processing as in the case of the general-purpose communication is performed, but in the case of the computer link, the RAM 3 has dedicated transmission / reception buffers E and F shown in FIG. When the CPU 1 determines that the computer link function has been selected, the CPU 1 starts the receiving process based on the dedicated procedure of the computer link service unit.

【0013】一方送信処理の場合には、CPU1はコン
ピュータリンク機能の選択と判定したときに、コンピュ
ータリンクサービス部に基づいて専用手順に沿って専用
送信バッファEの送信バイト数及び専用送信バッファの
先頭番地をワークエリアC、Dに複写した後、上述の汎
用通信の処理と同様な処理を行う。
On the other hand, in the case of transmission processing, when the CPU 1 determines that the computer link function is selected, the number of transmission bytes of the dedicated transmission buffer E and the head of the dedicated transmission buffer are determined according to a dedicated procedure based on the computer link service unit. After copying the addresses to the work areas C and D, the same processing as the above-described general communication processing is performed.

【0014】[0014]

【発明の効果】本発明は、プログラマブルコントローラ
にシリアル通信用のシリアルポートを1つ以上備えると
ともに、このシリアルポートを使い分けるためのパラメ
ータを書き込むパラメータエリアを備え、該パラメータ
エリアにシリアル通信を行う命令に基づく汎用通信機能
と、専用手順によるコンピュータリンク機能との何れか
を選択設定するパラメータをセットし、シリアルポート
の通信制御機能を上記パラメータに基づいて切り換える
から、パラメータエリアに汎用通信機能、コンピュータ
リンク機能のいずれかを選択するパラメータを書き込む
ことにより、このパラメータエリアのパラメータを送受
信処理の際にチェックすることで、シリアルポートの通
信制御処理の切り換えができ、そのため汎用通信にも、
コンピュータリンクにも使い分けることができ、結果プ
ログラマブルコントローラのコストアップや大型化が避
けられるという効果がある。
According to the present invention, a programmable controller is provided with one or more serial ports for serial communication, a parameter area for writing a parameter for selectively using the serial port, and an instruction for performing serial communication is provided in the parameter area. A parameter for selecting and setting one of the general-purpose communication function based on the computer link function and the computer link function based on the special procedure is set, and the communication control function of the serial port is switched based on the above parameters. By writing a parameter to select one of the above, by checking the parameter in this parameter area at the time of transmission / reception processing, it is possible to switch the communication control processing of the serial port.
It can be properly used for a computer link, and as a result, there is an effect that cost increase and size increase of the programmable controller can be avoided.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例を示す回路ブロック図であ
る。
FIG. 1 is a circuit block diagram showing one embodiment of the present invention.

【図2】本発明の一実施例の受信処理のフローチャート
である。
FIG. 2 is a flowchart of a receiving process according to one embodiment of the present invention.

【図3】本発明の一実施例の送信処理のフローチャート
である。
FIG. 3 is a flowchart of a transmission process according to an embodiment of the present invention.

【図4】汎用通信の命令の説明用ラダー図である。FIG. 4 is a ladder diagram for explaining a general-purpose communication instruction.

【図5】汎用通信のワークエリアの説明図である。FIG. 5 is an explanatory diagram of a work area for general-purpose communication.

【図6】コンピュータリンクのワークエリアの説明図で
ある。
FIG. 6 is an explanatory diagram of a work area of a computer link.

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

1 CPU 2 ROM 3 RAM 4 シリアルポート 5 I/Oインターフェイス 1 CPU 2 ROM 3 RAM 4 serial port 5 I / O interface

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プログラマブルコントローラに1つ以上の
シリアル通信用のシリアルポートを備えるとともに、こ
のシリアルポートを使い分けるためのパラメータを書き
込むパラメータエリアを備え、該パラメータエリアにシ
リアル通信を行う命令に基づく汎用通信機能と、専用手
順によるコンピュータリンク機能との何れかを選択設定
するパラメータをセットし、シリアルポートの通信制御
機能を上記パラメータに基づいて切り換えることを特徴
とするプログラマブルコントローラのシリアルポートの
制御方式。
A programmable controller includes one or more serial ports for serial communication, a parameter area for writing parameters for selectively using the serial ports, and general-purpose communication based on a command for performing serial communication in the parameter area. A control method for a serial port of a programmable controller, wherein a parameter for selecting and setting one of a function and a computer link function by a dedicated procedure is set, and a communication control function of the serial port is switched based on the parameter.
JP00812091A 1991-01-28 1991-01-28 Control method of serial port of programmable controller Expired - Lifetime JP3234240B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00812091A JP3234240B2 (en) 1991-01-28 1991-01-28 Control method of serial port of programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00812091A JP3234240B2 (en) 1991-01-28 1991-01-28 Control method of serial port of programmable controller

Publications (2)

Publication Number Publication Date
JPH04250754A JPH04250754A (en) 1992-09-07
JP3234240B2 true JP3234240B2 (en) 2001-12-04

Family

ID=11684430

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00812091A Expired - Lifetime JP3234240B2 (en) 1991-01-28 1991-01-28 Control method of serial port of programmable controller

Country Status (1)

Country Link
JP (1) JP3234240B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7797461B2 (en) 2003-05-28 2010-09-14 Mitsubishi Denki Kabushiki Kaisha Programmable controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7797461B2 (en) 2003-05-28 2010-09-14 Mitsubishi Denki Kabushiki Kaisha Programmable controller

Also Published As

Publication number Publication date
JPH04250754A (en) 1992-09-07

Similar Documents

Publication Publication Date Title
US4095268A (en) System for stopping and restarting the operation of a data processor
US5600807A (en) Programmable controller capable of updating a user program during operation by switching between user program memories
JP3234240B2 (en) Control method of serial port of programmable controller
US4807178A (en) Programmable sequence controller having indirect and direct input/output apparatus
KR19980054349A (en) Optional automatic setting circuit
JPH01176113A (en) Digital signal processor
KR0184454B1 (en) Real time interfacing method between emulator and host
JP3114907B2 (en) How to change the sequence program of the programmable controller
JPH07129079A (en) Method for installing programming loader
JP3182287B2 (en) Microprocessor
JPH06103110A (en) Breakpoint setting system
JP2503634B2 (en) Micro program controller
JPH0962313A (en) Flexible input and output module and programmable controller
JPH03113503A (en) Industrial computer
JP4534288B2 (en) Signal processing system, signal processing circuit, and demodulator
JPS61151746A (en) Processing method of data error
JPH0628286A (en) Method and device for controlling communication
JPH04209007A (en) User program editing system for programmable controller
JPH05282232A (en) Device control mechanism
JPH06110506A (en) Comment storage method for programmable controller
JPH0215749A (en) System for setting line controlling information for communication control processor
JPH064472A (en) Input/output priority order control system
JPH01308656A (en) Evaluating circuit of program of printer
JPS6129953A (en) Trace controlling method
JPH06103471B2 (en) Program evaluation device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010911

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

Free format text: PAYMENT UNTIL: 20080921

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20080921

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090921

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090921

Year of fee payment: 8

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20090921

Year of fee payment: 8

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20090921

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100921

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110921

Year of fee payment: 10

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110921

Year of fee payment: 10