CN112835321B - Programmable controller systems and modules - Google Patents
Programmable controller systems and modules Download PDFInfo
- Publication number
- CN112835321B CN112835321B CN202011031198.1A CN202011031198A CN112835321B CN 112835321 B CN112835321 B CN 112835321B CN 202011031198 A CN202011031198 A CN 202011031198A CN 112835321 B CN112835321 B CN 112835321B
- Authority
- CN
- China
- Prior art keywords
- synchronization
- correction
- module
- synchronization correction
- self
- 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.)
- Active
Links
- 238000012937 correction Methods 0.000 claims abstract description 326
- 239000000758 substrate Substances 0.000 claims abstract description 35
- 230000000630 rising effect Effects 0.000 claims description 8
- 238000000034 method Methods 0.000 description 30
- 230000008569 process Effects 0.000 description 27
- 230000006870 function Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 14
- 230000001360 synchronised effect Effects 0.000 description 12
- 239000013078 crystal Substances 0.000 description 8
- 238000012545 processing Methods 0.000 description 5
- 230000007704 transition Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000012905 input function Methods 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- RFHAOTPXVQNOHP-UHFFFAOYSA-N fluconazole Chemical compound C1=NC=NN1CC(C=1C(=CC(F)=CC=1)F)(O)CN1C=NC=N1 RFHAOTPXVQNOHP-UHFFFAOYSA-N 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 230000015654 memory Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/18—Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
- G05B19/404—Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by control arrangements for compensation, e.g. for backlash, overshoot, tool offset, tool wear, temperature, machine construction errors, load, inertia
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/12—Plc mp multi processor system
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/15—Plc structure of the system
- G05B2219/15049—Timer, counter, clock-calendar, flip-flop as peripheral
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Human Computer Interaction (AREA)
- Manufacturing & Machinery (AREA)
- Programmable Controllers (AREA)
Abstract
本发明提供一种可编程控制器系统和模块,该可编程控制器系统能够使构成可编程控制器系统的各模块的自模块周期同步。可编程控制器系统(SYS)具备基板(B1)以及与基板连接的多个模块(M1~M6),该可编程控制器系统构成为,多个模块各自具备:用于生成独立时钟的独立时钟生成部(CL1~CL6);计数器部(Co1~Co6),其根据由独立时钟生成部生成的独立时钟,来生成自模块周期;以及同步校正部(SY1~SY6),其根据自模块周期和基于从同步控制部输出的同步开始信号的同步基准点,来计算自模块周期的偏移量,基于计算出的偏移量来对自模块周期进行校正。
The present invention provides a programmable controller system and a module, wherein the programmable controller system can synchronize the self-module cycles of the modules constituting the programmable controller system. The programmable controller system (SYS) comprises a substrate (B1) and a plurality of modules (M1 to M6) connected to the substrate, wherein the plurality of modules each comprises: an independent clock generating unit (CL1 to CL6) for generating an independent clock; a counter unit (Co1 to Co6) for generating a self-module cycle based on the independent clock generated by the independent clock generating unit; and a synchronization correction unit (SY1 to SY6) for calculating the offset of the self-module cycle based on the self-module cycle and a synchronization reference point based on a synchronization start signal output from a synchronization control unit, and correcting the self-module cycle based on the calculated offset.
Description
技术领域Technical Field
本发明涉及一种可编程控制器系统和模块。The invention relates to a programmable controller system and a module.
背景技术Background technique
近年来,可编程控制器(也称为“PLC”)系统的应用领域随着高性能化、高功能化而扩大,用户的需求也变得多种多样。为了应对可编程控制器系统和使用可编程控制器系统的装置的高性能化、高功能化,作为使用PLC的控制方法,采用了基于预测控制等高级的控制理论的控制方法。另外,还通过用于进行可编程控制器系统的控制运算的CPU(CentralProcessing Unit:中央处理单元)模块的运算性能提高来进行应对。In recent years, the application fields of programmable controller (also called "PLC") systems have expanded with the development of high performance and high functionality, and the needs of users have also become diverse. In order to cope with the high performance and high functionality of programmable controller systems and devices using programmable controller systems, control methods based on advanced control theories such as predictive control have been adopted as control methods using PLCs. In addition, the computing performance of the CPU (Central Processing Unit) module used to perform control operations of programmable controller systems has been improved to cope with this.
作为这种可编程控制器系统,已知有如下技术:在由多个模块(单元)构成的控制装置的单元之间将成为控制定时的基础的时刻同步,来在可编程控制器系统的整体上提高性能(例如,参照专利文献1)。专利文献1所记载的各模块基于由时钟生成部生成的脉冲来执行扫描。本来,在以同等的结构、同等的性能进行动作的设备的情况下,扫描动作也是同样的。As such a programmable controller system, the following technology is known: the time synchronization between the units of a control device composed of a plurality of modules (units) is used to improve the performance of the programmable controller system as a whole (for example, refer to Patent Document 1). Each module described in Patent Document 1 performs scanning based on a pulse generated by a clock generating unit. Originally, in the case of devices operating with the same structure and the same performance, the scanning operation is also the same.
然而,由于电源接通的时间的差异、CPU模块的初始化内容的不同等,扫描定时有可能产生偏移。由时钟生成部生成的脉冲可以是任何脉冲,但是通常是由晶体振荡器等提供的稳定的信号,在此后的说明中记述为时钟脉冲。However, the scanning timing may be offset due to differences in the power-on time, the initialization content of the CPU module, etc. The pulse generated by the clock generation unit may be any pulse, but is generally a stable signal provided by a crystal oscillator, etc., and is described as a clock pulse in the following description.
因此,在专利文献1所记载的可编程控制器系统中,关于与基板连接的各模块的基准时钟,通过配置于基板的同步控制电路来使基准时钟同步。在专利文献1所记载的可编程控制器系统中,是在各模块的启动开始之后进行所有模块的基准时刻的同步。Therefore, in the programmable controller system described in Patent Document 1, the reference clocks of the modules connected to the substrate are synchronized by a synchronization control circuit configured on the substrate. In the programmable controller system described in Patent Document 1, the reference time of all modules is synchronized after the start of each module.
现有技术文献Prior art literature
专利文献Patent Literature
专利文献1:国际公开第2012/081115号Patent Document 1: International Publication No. 2012/081115
发明内容Summary of the invention
发明要解决的问题Problem that the invention aims to solve
然而,在各模块的一部分为不同的整数倍的周期且一部分模块的启动开始时刻发生了延迟的情况下,或者在使一部分模块在之后启动并要进行同步的情况下,存在如下问题:在以从最初开始就存在的不同的整数倍的周期运行的模块与之后启动的模块之间的关系上产生基准时刻的起点不一致的状况。However, when part of each module has a cycle of different integer multiples and the startup start time of some modules is delayed, or when some modules are started later and synchronized, there is a problem that the starting point of the reference time is inconsistent in the relationship between the modules that have been running with a cycle of different integer multiples from the beginning and the modules that are started later.
本发明是鉴于上述的问题点而完成的,其目的之一在于提供一种能够使构成可编程控制器系统的各模块的自模块周期同步的可编程控制器系统。The present invention has been made in view of the above-mentioned problems, and one object of the present invention is to provide a programmable controller system capable of synchronizing the module cycles of the modules constituting the programmable controller system.
用于解决问题的方案Solutions for solving problems
关于本实施方式的可编程控制器系统,在其一方式中,是具备基板以及与所述基板连接的多个模块的可编程控制器系统,所述可编程控制器系统的特征在于,所述基板具备用于控制所述多个模块的同步的同步控制部,所述多个模块各自具备:用于生成独立时钟的独立时钟生成部;计数器部,其根据由所述独立时钟生成部生成的所述独立时钟,来生成自模块周期;以及同步校正部,其根据所述自模块周期和基于从所述同步控制部输出的同步开始信号的同步基准点,来计算所述自模块周期的偏移量,基于计算出的所述偏移量,来对所述自模块周期进行校正。Regarding the programmable controller system of the present embodiment, in one mode, it is a programmable controller system including a substrate and a plurality of modules connected to the substrate, wherein the programmable controller system is characterized in that the substrate includes a synchronization control unit for controlling the synchronization of the plurality of modules, and each of the plurality of modules includes: an independent clock generating unit for generating an independent clock; a counter unit for generating a self-module period based on the independent clock generated by the independent clock generating unit; and a synchronization correction unit for calculating an offset of the self-module period based on the self-module period and a synchronization reference point based on a synchronization start signal output from the synchronization control unit, and correcting the self-module period based on the calculated offset.
发明的效果Effects of the Invention
根据本发明,能够提供一种能够使构成可编程控制器系统的各模块的自模块周期同步的可编程控制器系统。According to the present invention, it is possible to provide a programmable controller system capable of synchronizing the module cycles of the modules constituting the programmable controller system.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是示出本实施方式的可编程控制器系统的结构的图。FIG. 1 is a diagram showing a configuration of a programmable controller system according to the present embodiment.
图2是示出PLC系统的功能结构的一例的图。FIG. 2 is a diagram showing an example of a functional configuration of a PLC system.
图3是示出在第一CPU模块~第六CPU模块与基板之间通知的信息的时序图的一例的图。FIG. 3 is a diagram showing an example of a timing chart of information notified between the first to sixth CPU modules and the substrate.
图4是示出接收到同步开始信号的第一CPU模块~第六CPU模块从同步不一致状态向同步状态转变的状态的图。FIG. 4 is a diagram showing a state in which the first to sixth CPU modules, which have received a synchronization start signal, transition from a missynchronization state to a synchronization state.
图5是示出在构成PLC系统的第一CPU模块、第二CPU模块与基板之间执行的同步校正处理的序列图的一例的图。5 is a diagram showing an example of a sequence chart of a synchronization correction process executed between the first CPU module, the second CPU module, and the substrate constituting the PLC system.
图6是示出第一CPU模块执行的同步校正处理的一例的流程图。FIG. 6 is a flowchart showing an example of synchronization correction processing executed by the first CPU module.
图7是示出同步校正执行处理的一例的流程图。FIG. 7 is a flowchart showing an example of synchronization correction execution processing.
附图标记说明Description of Reference Numerals
SYS:可编程控制器系统;M1~M6:第一CPU模块~第六CPU模块;K1~K6:连接器;B1:基板;P1~P6:处理器;W1~W6:中断控制部;CL1~CL6:独立时钟生成部;Co1~Co6:计数器部;Pa1~Pa6:电源控制部;SY1~SY6:同步校正部;BSY1:同步控制部;BCL1:基准时钟生成部。SYS: programmable controller system; M1~M6: first CPU module~sixth CPU module; K1~K6: connector; B1: baseboard; P1~P6: processor; W1~W6: interrupt control unit; CL1~CL6: independent clock generation unit; Co1~Co6: counter unit; Pa1~Pa6: power supply control unit; SY1~SY6: synchronization correction unit; BSY1: synchronization control unit; BCL1: reference clock generation unit.
具体实施方式Detailed ways
下面,详细地说明本发明的一个实施方式(下面简称为“实施方式”。)。此外,本发明不限定于下面的实施方式,能够在其主旨的范围内进行各种变形来实施。Hereinafter, an embodiment of the present invention (hereinafter simply referred to as “embodiment”) will be described in detail. Note that the present invention is not limited to the following embodiment, and can be implemented with various modifications within the scope of the gist thereof.
图1是示出本发明的实施方式的可编程控制器系统的结构的图。可编程控制器(下面称为“PLC”)系统SYS构成为包括第一CPU模块M1~第六CPU模块M6、连接器K1~K6以及基板B1。Fig. 1 is a diagram showing a configuration of a programmable controller system according to an embodiment of the present invention. A programmable controller (hereinafter referred to as "PLC") system SYS is configured to include first to sixth CPU modules M1 to M6, connectors K1 to K6, and a substrate B1.
第一CPU模块M1~第六CPU模块M6通过连接器K1~K6并通过基板B1上的总线(未图示)进行连接。对于第一CPU模块M1~第六CPU模块M6,在不特别加以区分来进行说明的情况下,下面称为“模块M”。The first to sixth CPU modules M1 to M6 are connected via connectors K1 to K6 and via a bus (not shown) on the substrate B1. The first to sixth CPU modules M1 to M6 are hereinafter referred to as "modules M" unless otherwise specifically distinguished.
图2是示出PLC系统的功能结构的一例的图。第一CPU模块M1~第六CPU模块M6各自具备处理器P1~P6、中断控制部W1~W6、独立时钟生成部CL1~CL6、计数器部Co1~Co6、电源控制部Pa1~Pa6、同步校正部SY1~SY6。基板B1具备同步控制部BSY1和基准时钟生成部BCL1。Fig. 2 is a diagram showing an example of the functional structure of the PLC system. The first CPU module M1 to the sixth CPU module M6 each include processors P1 to P6, interrupt control units W1 to W6, independent clock generation units CL1 to CL6, counter units Co1 to Co6, power supply control units Pa1 to Pa6, and synchronization correction units SY1 to SY6. The substrate B1 includes a synchronization control unit BSY1 and a reference clock generation unit BCL1.
第一CPU模块M1和第二CPU模块M2具备执行用户的应用程序的应用程序执行功能。第三CPU模块M3和第四CPU模块M4还被称为IO总线内置CPU模块,具备IO总线功能和应用程序执行功能。IO总线功能用于以恒定的周期在自身所具有的远程网络之间进行通信。第五CPU模块M5和第六CPU模块M6还被称为IO总线主模块,具备IO总线功能。各模块M也可以将其它的输入模块、输出模块等各种模块设为同步对象。The first CPU module M1 and the second CPU module M2 have an application execution function for executing the user's application. The third CPU module M3 and the fourth CPU module M4 are also called IO bus built-in CPU modules, which have IO bus functions and application execution functions. The IO bus function is used to communicate between remote networks that they have at a constant cycle. The fifth CPU module M5 and the sixth CPU module M6 are also called IO bus master modules, which have IO bus functions. Each module M can also set various modules such as other input modules and output modules as synchronization objects.
独立时钟生成部CL1~CL6生成各第一CPU模块M1~第六CPU模块M6执行的自模块周期的独立时钟。计数器部Co1~Co6根据由独立时钟生成部CL1~CL6生成的独立时钟来生成自模块周期。另外,计数器部Co1~Co6对由独立时钟生成部CL1~CL6生成的独立时钟值进行计数并作为计数值进行保持。在本实施方式中,独立时钟生成部CL1~CL6使用规定频率的晶体来生成任意周期的脉冲后将其输出。各独立时钟生成部CL1~CL6的晶体的晶振误差(百万分率(PPM:Parts Per Million)误差)存在偏差,时钟频率也根据温度而改变,并不是恒定的,因此各模块M的自模块周期逐渐发生偏移。独立时钟生成部CL1~CL6生成的独立时刻的自模块周期的独立时钟可以是任意的值,但是在本实施方式中,独立时钟生成部CL1~CL6使用1MHz的晶体来生成100μs周期的脉冲。The independent clock generating units CL1 to CL6 generate independent clocks of the self-module cycles executed by the first CPU module M1 to the sixth CPU module M6. The counter units Co1 to Co6 generate the self-module cycles based on the independent clocks generated by the independent clock generating units CL1 to CL6. In addition, the counter units Co1 to Co6 count the independent clock values generated by the independent clock generating units CL1 to CL6 and hold them as count values. In this embodiment, the independent clock generating units CL1 to CL6 use a crystal of a specified frequency to generate a pulse of an arbitrary cycle and then output it. The crystal oscillator error (parts per million (PPM: Parts Per Million) error) of the crystal of each independent clock generating unit CL1 to CL6 varies, and the clock frequency also changes according to the temperature and is not constant, so the self-module cycle of each module M gradually shifts. The independent clock of the self-module cycle at the independent time generated by the independent clock generating units CL1 to CL6 can be an arbitrary value, but in this embodiment, the independent clock generating units CL1 to CL6 use a 1MHz crystal to generate a pulse of a 100μs cycle.
处理器P1~P6分别以恒定的周期执行各第一CPU模块M1~第六CPU模块M6所具备的独立的功能。处理器P1~P6可以执行输入功能、应用程序执行功能、输出功能等,其中,该输入功能用于获取PLC系统SYS的输入信号,并将该输入信号作为输入数据进行通知,该应用程序执行功能用于接收这些输入数据,并对这些输入数据进行运算,将运算结果作为输出数据进行通知,该输出功能用于接收输出数据,并将该输出数据作为数字或模拟信号进行输出。处理器P1~P6也可以根据需要而一并具备用于将模块间连接的总线功能、外部存储器、输入电路或输出电路等。Processors P1 to P6 respectively execute the independent functions of the first CPU module M1 to the sixth CPU module M6 at a constant cycle. Processors P1 to P6 can execute input functions, application execution functions, output functions, etc., wherein the input function is used to obtain input signals of the PLC system SYS and notify the input signals as input data, the application execution function is used to receive the input data, perform operations on the input data, and notify the operation results as output data, and the output function is used to receive output data and output the output data as digital or analog signals. Processors P1 to P6 can also have bus functions, external memories, input circuits or output circuits, etc. for connecting modules as needed.
电源控制部Pa1~Pa6将各第一CPU模块M1~第六CPU模块M6的电源状态(SY_P1~SY_P6)通知给配置于基板B1上的同步控制部BSY1。电源状态(SY_P1~SY_P6)是用于将自身的模块M的电源的状态通知给基板B1的同步控制部BSY1的信息,是在各第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6的电源接通时通知的。电源状态(SY_P1~SY_P6)例如是由1比特(bit)构成的信息,在初始状态时为“0”(关闭),电源控制部Pa1~Pa6在自身的模块M的电源被接通的情况下通知“1”(开启)。The power control units Pa1 to Pa6 notify the synchronization control unit BSY1 disposed on the substrate B1 of the power state (SY_P1 to SY_P6) of each of the first CPU module M1 to the sixth CPU module M6. The power state (SY_P1 to SY_P6) is information for notifying the synchronization control unit BSY1 of the substrate B1 of the power state of its own module M, and is notified when the power of the synchronization correction units SY1 to SY6 of each of the first CPU module M1 to the sixth CPU module M6 is turned on. The power state (SY_P1 to SY_P6) is, for example, information consisting of 1 bit, which is "0" (off) in the initial state, and the power control units Pa1 to Pa6 notify "1" (on) when the power of their own modules M is turned on.
处理器P1~P6根据是否需要同步,使用同步开始请求寄存器和同步设定寄存器对同步校正部SY1~SY6进行表示是否为同步对象的同步设定,并在模块各自的启动完成时等时刻进行同步开始请求。Processors P1 to P6 use synchronization start request registers and synchronization setting registers to set synchronization correction units SY1 to SY6 to indicate whether they are synchronization targets, depending on whether synchronization is required, and issue synchronization start requests when each module is started up.
同步校正部SY1~SY6使用同步设定寄存器将各第一CPU模块M1~第六CPU模块M6的同步设定状态(SY_EN1~SY_EN6)通知给配置于基板B1上的同步控制部BSY1。The synchronization correction units SY1 to SY6 notify the synchronization control unit BSY1 disposed on the substrate B1 of the synchronization setting states (SY_EN1 to SY_EN6) of the first to sixth CPU modules M1 to M6 using the synchronization setting registers.
同步设定状态寄存器是用于将自身的模块M是否为同步对象通知给基板B1的同步控制部BSY1的信息,是在自身的模块M的电源接通时通知的。同步设定状态寄存器例如是由1比特构成的信息。同步校正部SY1~SY6在自身的模块M不是同步对象的情况下,对同步设定状态寄存器设定“0”(关闭)并进行通知,在自身的模块M是同步对象的情况下,对同步设定状态寄存器设定“1”(开启)并进行通知。The synchronization setting status register is information for notifying the synchronization control unit BSY1 of the substrate B1 whether its own module M is a synchronization target, and is notified when the power of its own module M is turned on. The synchronization setting status register is, for example, information consisting of 1 bit. When its own module M is not a synchronization target, the synchronization correction units SY1 to SY6 set "0" (off) to the synchronization setting status register and notify, and when its own module M is a synchronization target, they set "1" (on) to the synchronization setting status register and notify.
同步校正部SY1~SY6使用同步开始请求寄存器将各第一CPU模块M1~第六CPU模块M6的同步开始请求(SY_RQ1~SY_RQ6)通知给配置于基板B1上的同步控制部BSY1。The synchronization correction units SY1 to SY6 notify the synchronization control unit BSY1 disposed on the substrate B1 of the synchronization start requests (SY_RQ1 to SY_RQ6) of the first to sixth CPU modules M1 to M6 respectively using the synchronization start request registers.
同步开始请求寄存器是用于向基板B1上的同步控制部BSY1请求开始同步的信息,是在自身的模块M的电源状态(SY_P1~SY_P6)、同步设定状态(SY_EN1~SY_EN6)以及初始化完成时等任意的时刻通知的。同步开始请求寄存器例如是由1比特构成的信息。同步校正部SY1~SY6在进行同步开始的请求之前,对同步开始请求寄存器设定“0”(关闭)并进行通知,在进行同步开始的请求的情况下,对同步开始请求寄存器设定“1”(开启)并进行通知。The synchronization start request register is used to request the synchronization control unit BSY1 on the substrate B1 to start synchronization. It is notified at any time such as the power supply state (SY_P1 to SY_P6) of the module M itself, the synchronization setting state (SY_EN1 to SY_EN6), and the completion of initialization. The synchronization start request register is, for example, information composed of 1 bit. Before making a request for synchronization start, the synchronization correction unit SY1 to SY6 sets the synchronization start request register to "0" (off) and notifies. When making a request for synchronization start, it sets the synchronization start request register to "1" (on) and notifies.
基准时钟生成部BCL1生成作为使PLC系统SYS同步的基准的基准时刻。基准时钟生成部BCL1将所生成的基准时刻的信息输出至配置于第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6以及配置于基板B1上的同步控制部BSY1。基准时钟生成部BCL1生成的基准时刻的周期可以为任意的值,但是在本实施方式中,基准时钟生成部BCL1使用1MHz的晶体来生成100μs周期的脉冲(CLK100μs),并将该脉冲作为基准时刻进行输出。The reference clock generator BCL1 generates a reference time that is used as a reference for synchronizing the PLC system SYS. The reference clock generator BCL1 outputs the information of the generated reference time to the synchronization correction units SY1 to SY6 configured in the first CPU module M1 to the sixth CPU module M6 and the synchronization control unit BSY1 configured on the substrate B1. The period of the reference time generated by the reference clock generator BCL1 can be any value, but in this embodiment, the reference clock generator BCL1 uses a 1MHz crystal to generate a pulse with a period of 100μs (CLK100μs), and outputs the pulse as the reference time.
同步控制部BSY1基于从各第一CPU模块M1~第六CPU模块M6接收到的同步设定状态(SY_EN1~SY_EN6)、同步开始请求(SY_RQ1~SY_RQ6)、电源状态(SY_P1~SY_P6)以及由基准时钟生成部BCL1生成的基准时刻(CLK100μs)的信息,来生成同步开始信号(SY_EXE),并将该同步开始信号输出至各第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6。例如,同步控制部BSY1基于由基准时钟生成部BCL1生成的基准时刻(CLK100μs)的上升沿或下降沿,来将同步开始信号(SY_EXE)输出至各第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6。The synchronization control unit BSY1 generates a synchronization start signal (SY_EXE) based on the synchronization setting state (SY_EN1 to SY_EN6), synchronization start request (SY_RQ1 to SY_RQ6), power supply state (SY_P1 to SY_P6) received from each of the first CPU module M1 to the sixth CPU module M6, and the reference time (CLK100μs) generated by the reference clock generation unit BCL1, and outputs the synchronization start signal to the synchronization correction unit SY1 to SY6 of each of the first CPU module M1 to the sixth CPU module M6. For example, the synchronization control unit BSY1 outputs the synchronization start signal (SY_EXE) to the synchronization correction unit SY1 to SY6 of each of the first CPU module M1 to the sixth CPU module M6 based on the rising edge or falling edge of the reference time (CLK100μs) generated by the reference clock generation unit BCL1.
图3是示出在第一CPU模块~第六CPU模块与基板B1之间通知的信息的时序图的一例的图。在第一CPU模块M1~第六CPU模块M6的电源状态(SY_P1~SY_P6)以及作为同步对象的模块M的同步设定状态(SY_EN1~SY_EN6)为开启的状态下作为同步对象的所有模块M的同步开始请求(SY_RQ1~SY_RQ6)为开启的情况下,同步控制部BSY1使用触发器来保持每个模块M的同步开始请求(SY_RQ1~SY_RQ6)。Fig. 3 is a diagram showing an example of a timing diagram of information notified between the first CPU module to the sixth CPU module and the substrate B1. When the power supply states (SY_P1 to SY_P6) of the first CPU module M1 to the sixth CPU module M6 and the synchronization setting states (SY_EN1 to SY_EN6) of the modules M to be synchronized are on, and the synchronization start requests (SY_RQ1 to SY_RQ6) of all the modules M to be synchronized are on, the synchronization control unit BSY1 uses a trigger to hold the synchronization start request (SY_RQ1 to SY_RQ6) of each module M.
同步控制部BSY1从第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6分别将同步开始请求(SY_RQ1~SY_RQ6)以脉冲形式进行接收。同步控制部BSY1根据基准时刻(时钟)的上升沿来判断是否在T1~T6的时刻接收到作为同步对象的模块M的所有的同步开始请求(SY_RQ1~SY_RQ6)。同步控制部BSY1将接收到的同步开始请求(SY_RQ1~SY_RQ6)锁存为内部信号(SY_RQFF1~SY_RQFF6),由此能够判断出是否从作为同步对象的所有模块M接收到了同步开始请求(SY_RQ1~SY_RQ6)。同步控制部BSY1在从作为同步对象的所有模块M接收到了同步开始请求(SY_RQ1~SY_RQ6)的情况下,基于基准时刻(CLK100μs)的上升沿或下降沿,来将同步开始信号(SY_EXE)以脉冲的形式输出至作为同步对象的各模块M。The synchronization control unit BSY1 receives the synchronization start request (SY_RQ1 to SY_RQ6) in the form of pulses from the synchronization correction units SY1 to SY6 of the first CPU module M1 to the sixth CPU module M6. The synchronization control unit BSY1 determines whether all the synchronization start requests (SY_RQ1 to SY_RQ6) of the module M that is the synchronization object are received at the time T1 to T6 based on the rising edge of the reference time (clock). The synchronization control unit BSY1 latches the received synchronization start request (SY_RQ1 to SY_RQ6) as an internal signal (SY_RQFF1 to SY_RQFF6), thereby being able to determine whether the synchronization start request (SY_RQ1 to SY_RQ6) is received from all the modules M that are the synchronization object. When receiving synchronization start requests (SY_RQ1 to SY_RQ6) from all modules M to be synchronized, the synchronization control unit BSY1 outputs a synchronization start signal (SY_EXE) in the form of a pulse to each module M to be synchronized based on the rising or falling edge of the reference time (CLK100 μs).
图4是示出接收到同步开始信号(SY_EXE)的第一CPU模块~第六CPU模块从同步不一致状态向同步状态转变的状态的图。图4的(1)是示出第一CPU模块M1~第六CPU模块M6的同步不一致状态的图。图4的(2)是示出第一CPU模块M1~第六CPU模块M6从同步不一致状态向同步状态转变的状态的图。Fig. 4 is a diagram showing the state where the first to sixth CPU modules that have received the synchronization start signal (SY_EXE) transition from the synchronization inconsistency state to the synchronization state. Fig. 4 (1) is a diagram showing the synchronization inconsistency state of the first CPU module M1 to the sixth CPU module M6. Fig. 4 (2) is a diagram showing the state where the first CPU module M1 to the sixth CPU module M6 transition from the synchronization inconsistency state to the synchronization state.
如图4的(1)所示,在同步校正前,第一CPU模块M1~第六CPU模块M6自身的模块M的周期(下面也称为“自模块周期”)的开始起点例如在时刻T7处各不一致。因此,进行同步校正,使得各第一CPU模块M1~第六CPU模块M6的自模块周期的开始起点一致。As shown in (1) of Fig. 4, before the synchronization correction, the starting points of the cycles of the modules M of the first CPU module M1 to the sixth CPU module M6 (hereinafter also referred to as "self-module cycles") are inconsistent, for example, at time T7. Therefore, the synchronization correction is performed so that the starting points of the self-module cycles of the first CPU module M1 to the sixth CPU module M6 are consistent.
首先,接收到同步开始信号(SY_EXE)的各模块M的同步校正部SY1~SY6分别从计数器部Co1~Co6的时间状态获取自模块周期。同步校正部SY1~SY6根据自模块周期和基于同步开始信号(SY_EXE)的同步基准点,来计算同步基准偏移幅度。同步基准偏移幅度是表示自模块周期的偏移量的差。同步基准点是作为使各模块M之间同步的基准的时刻,在本实施方式中,同步校正部SY1~SY6基于同步开始信号(SY_EXE)的上升沿来设定同步基准点。在该情况下,输出同步开始信号(SY_EXE)的时刻与同步基准点的时刻一致。此外,同步校正部SY1~SY6也可以将从输出同步开始信号(SY_EXE)起经过规定时间之后的时刻设定为同步基准点。First, the synchronization correction units SY1 to SY6 of each module M that receives the synchronization start signal (SY_EXE) obtain the self-module cycle from the time state of the counter units Co1 to Co6 respectively. The synchronization correction units SY1 to SY6 calculate the synchronization reference offset amplitude based on the self-module cycle and the synchronization reference point based on the synchronization start signal (SY_EXE). The synchronization reference offset amplitude is the difference in the offset amount from the self-module cycle. The synchronization reference point is the moment that serves as the reference for synchronizing each module M. In this embodiment, the synchronization correction units SY1 to SY6 set the synchronization reference point based on the rising edge of the synchronization start signal (SY_EXE). In this case, the moment of outputting the synchronization start signal (SY_EXE) coincides with the moment of the synchronization reference point. In addition, the synchronization correction units SY1 to SY6 may also set the moment after a specified time has passed since the output of the synchronization start signal (SY_EXE) as the synchronization reference point.
同步校正部SY1~SY6计算从自模块周期的开始起点到同步基准点为止的经过时间来作为同步基准偏移幅度。例如,如图4的(2)所示,第一CPU模块M1的同步校正部SY1计算从第一CPU模块M1的周期的开始起点t1到基于同步开始信号(SY_EXE)的上升沿设定的同步基准点Te为止的经过时间(Te-t1=k1)来作为第一CPU模块M1的同步基准偏移幅度。同步校正部SY1基于所计算出的同步基准偏移幅度满足(1)式和(2)式中的哪一个式子,来设定校正方向。The synchronization correction units SY1 to SY6 calculate the elapsed time from the start of the module cycle to the synchronization reference point as the synchronization reference offset width. For example, as shown in (2) of FIG. 4 , the synchronization correction unit SY1 of the first CPU module M1 calculates the elapsed time (Te-t1=k1) from the start of the cycle of the first CPU module M1 to the synchronization reference point Te set based on the rising edge of the synchronization start signal (SY_EXE) as the synchronization reference offset width of the first CPU module M1. The synchronization correction unit SY1 sets the correction direction based on which of the equations (1) and (2) the calculated synchronization reference offset width satisfies.
同步基准偏移幅度≥(自模块周期-同步基准偏移幅度):负(-)的校正方向···(1)Synchronous reference offset width ≥ (self-module period - synchronous reference offset width): Negative (-) correction direction... (1)
同步基准偏移幅度<(自模块周期-同步基准偏移幅度):正(+)的校正方向···(2)Synchronous reference offset width < (self-module period - synchronous reference offset width): Positive (+) correction direction... (2)
在(1)式成立的情况下,同步校正部SY1将校正方向设定为-(负)的校正方向、即使周期缩短的方向。在(2)式成立的情况下,同步校正部SY1将校正方向设定为+(正)的校正方向、即使周期延长的方向。同步校正部SY2~SY6与同步校正部SY1同样地设定第二CPU模块M2~第六CPU模块M6的校正方向。在图4的(2)中,用两根线的箭头表示-(负)的校正方向、即使周期缩短的方向的校正方向的周期(例如,下一周期C1、C3、C5),用三根线的箭头表示+(正)的校正方向、即使周期延长的方向的校正方向的周期(例如,下一周期C2、C4、C6)。此外,同步校正部SY1~SY6也可以计算从同步基准点到自模块周期的结束时刻为止的经过时间作为同步基准偏移幅度。在该情况下,同步校正部SY1~SY6将校正方向的正负符号反过来设定。When equation (1) holds true, the synchronization correction unit SY1 sets the correction direction to the - (negative) correction direction, that is, the direction in which the cycle is shortened. When equation (2) holds true, the synchronization correction unit SY1 sets the correction direction to the + (positive) correction direction, that is, the direction in which the cycle is extended. The synchronization correction units SY2 to SY6 set the correction directions of the second CPU module M2 to the sixth CPU module M6 in the same way as the synchronization correction unit SY1. In (2) of FIG. 4 , the correction direction of - (negative) or the cycle of the correction direction in the direction in which the cycle is shortened (for example, the next cycle C1, C3, C5) is indicated by two arrows, and the correction direction of + (positive) or the cycle of the correction direction in the direction in which the cycle is extended (for example, the next cycle C2, C4, C6) is indicated by three arrows. In addition, the synchronization correction units SY1 to SY6 may calculate the elapsed time from the synchronization reference point to the end time of the self-module cycle as the synchronization reference offset width. In this case, the synchronization correction units SY1 to SY6 set the positive and negative signs of the correction directions in reverse.
同步校正部SY1~SY6将所确定的校正方向的信息设定到同步校正方向寄存器中。同步校正方向寄存器是用于确定是向负方向进行校正还是向正方向进行校正的信息。同步校正方向寄存器例如是由1比特构成的信息。同步校正部SY1~SY6在所确定的校正方向为+(正)的情况下,对同步校正方向寄存器设定“0”,在所确定的校正方向为-(负)的情况下,对同步校正方向寄存器设定“1”。The synchronization correction units SY1 to SY6 set the information of the determined correction direction to the synchronization correction direction register. The synchronization correction direction register is information for determining whether to perform correction in the negative direction or in the positive direction. The synchronization correction direction register is, for example, information consisting of 1 bit. When the determined correction direction is + (positive), the synchronization correction units SY1 to SY6 set "0" to the synchronization correction direction register, and when the determined correction direction is - (negative), the synchronization correction direction register is set to "1".
例如,对自模块周期为“4000μs”、同步基准偏移幅度为“3700μs”的图4的第五CPU模块M5的情况进行说明。在从自模块周期开始起的3700μs时接收到同步开始信号(SY_EXE)的脉冲的情况下,即在将同步基准点Te设定为3700μs的情况下,判断从自模块周期“4000μs”减去同步基准偏移幅度“3700μs”所得到的值是否大于同步基准偏移幅度“3700μs”。For example, the case of the fifth CPU module M5 in FIG. 4 in which the self-module cycle is "4000 μs" and the synchronization reference offset width is "3700 μs" is described. When a pulse of the synchronization start signal (SY_EXE) is received at 3700 μs from the start of the self-module cycle, that is, when the synchronization reference point Te is set to 3700 μs, it is determined whether the value obtained by subtracting the synchronization reference offset width "3700 μs" from the self-module cycle "4000 μs" is greater than the synchronization reference offset width "3700 μs".
从自模块周期“4000μs”减去同步基准偏移幅度“3700μs”所得到的值“300μs”小于同步基准偏移幅度“3700μs”,即(1)式成立。在该情况下,第五CPU模块M5的同步校正部SY5将校正方向设定为-(负)的校正方向、即使接收到同步开始信号(SY_EXE)的脉冲时的下一个周期(下面也称为“下一周期”)C5的周期缩短的方向。The value "300μs" obtained by subtracting the synchronization reference offset width "3700μs" from the self-module cycle "4000μs" is less than the synchronization reference offset width "3700μs", that is, equation (1) holds. In this case, the synchronization correction unit SY5 of the fifth CPU module M5 sets the correction direction to the correction direction of - (negative), that is, the direction in which the cycle of the next cycle (hereinafter also referred to as "next cycle") C5 is shortened even when a pulse of the synchronization start signal (SY_EXE) is received.
另外,对自模块周期为4000μs、同步基准偏移幅度为“1800μs”的图4的第六CPU模块M6的情况进行说明。在从自模块周期开始起的1800μs时接收到同步开始信号(SY_EXE)的脉冲的情况下,即在同步基准点Te为1800μs的情况下,判断从自模块周期“4000μs”减去同步基准偏移幅度“1800μs”所得到的值是否大于同步基准偏移幅度“1800μs”。In addition, the case of the sixth CPU module M6 in FIG. 4 in which the self-module cycle is 4000 μs and the synchronization reference offset width is "1800 μs" is described. When a pulse of the synchronization start signal (SY_EXE) is received at 1800 μs from the start of the self-module cycle, that is, when the synchronization reference point Te is 1800 μs, it is determined whether the value obtained by subtracting the synchronization reference offset width "1800 μs" from the self-module cycle "4000 μs" is greater than the synchronization reference offset width "1800 μs".
从自模块周期“4000μs”减去同步基准偏移幅度“1800μs”所得到的值“2200μs”大于同步基准偏移幅度“1800μs”,即(2)式成立。在该情况下,第六CPU模块M6的同步校正部SY6将校正方向设定为+(正)的校正方向、即使下一周期C6的周期延长的方向。The value "2200μs" obtained by subtracting the synchronization reference offset width "1800μs" from the self-module cycle "4000μs" is greater than the synchronization reference offset width "1800μs", that is, equation (2) holds. In this case, the synchronization correction unit SY6 of the sixth CPU module M6 sets the correction direction to the + (positive) correction direction, that is, the direction in which the cycle of the next cycle C6 is extended.
此外,在如第六CPU模块M6的同步一致时的例子那样第六CPU模块M6的周期的开始起点t6’与基于同步开始信号(SY_EXE)的上升沿设定的同步基准点Te一致的情况下,即在同步基准偏移幅度为0的情况下,同步校正部SY1~SY6不设定校正方向,也不进行同步校正。In addition, when the starting point t6' of the cycle of the sixth CPU module M6 is consistent with the synchronization reference point Te set based on the rising edge of the synchronization start signal (SY_EXE) as in the example of the synchronization consistency of the sixth CPU module M6, that is, when the synchronization reference offset amplitude is 0, the synchronization correction units SY1~SY6 do not set the correction direction and do not perform synchronization correction.
像这样,通过基于从自模块周期减去同步基准偏移幅度所得到的值是否大于同步基准偏移幅度来改变校正方向,由此在必须进行最大为自模块周期的校正时,能够以该自模块周期的大约一半的时间进行校正。By changing the correction direction based on whether the value obtained by subtracting the synchronization reference shift width from the self-module period is larger than the synchronization reference shift width, correction can be performed in approximately half the self-module period when correction up to the self-module period is required.
同步校正部SY1~SY6将同步基准偏移幅度的值和从自模块周期减去同步基准偏移幅度所得到的值中的较少(小)一方的值作为同步校正目标时间设定到同步校正目标时间寄存器。同步校正目标时间寄存器是由任意的比特数构成的信息。同步校正目标时间是用于进行同步校正的整体时间的信息。The synchronization correction units SY1 to SY6 set the smaller value of the synchronization reference offset width and the value obtained by subtracting the synchronization reference offset width from the self-module period to the synchronization correction target time register as the synchronization correction target time. The synchronization correction target time register is information composed of an arbitrary number of bits. The synchronization correction target time is information on the overall time for synchronization correction.
例如,对自模块周期为“4000μs”、同步基准偏移幅度为“3700μs”的图4的第五CPU模块M5的情况进行说明。第五CPU模块M5的同步基准偏移幅度“3700μs”大于从自模块周期减去同步基准偏移幅度所得到的值“4000μs-3700μs=300μs”。因而,第五CPU模块M5的同步校正部SY5将从自模块周期减去同步基准偏移幅度所得到的值“300μs”作为同步校正目标时间设定到同步校正目标时间寄存器。For example, the case of the fifth CPU module M5 in FIG. 4 in which the self-module cycle is "4000μs" and the synchronization reference offset width is "3700μs" is described. The synchronization reference offset width "3700μs" of the fifth CPU module M5 is greater than the value "4000μs-3700μs=300μs" obtained by subtracting the synchronization reference offset width from the self-module cycle. Therefore, the synchronization correction unit SY5 of the fifth CPU module M5 sets the value "300μs" obtained by subtracting the synchronization reference offset width from the self-module cycle as the synchronization correction target time to the synchronization correction target time register.
另外,对自模块周期为“4000μs”、同步基准偏移幅度为“1800μs”的图4的第六CPU模块M6的情况进行说明。第六CPU模块M6的同步基准偏移幅度“1800μs”小于从自模块周期减去同步基准偏移幅度所得到的值“4000μs-1800μs=2200μs”。因此,第六CPU模块M6的同步校正部SY6将同步基准偏移幅度“1800μs”作为同步校正目标时间设定到同步校正目标时间寄存器。In addition, the case of the sixth CPU module M6 in FIG. 4 in which the self-module period is "4000μs" and the synchronization reference offset width is "1800μs" is described. The synchronization reference offset width "1800μs" of the sixth CPU module M6 is smaller than the value "4000μs-1800μs=2200μs" obtained by subtracting the synchronization reference offset width from the self-module period. Therefore, the synchronization correction unit SY6 of the sixth CPU module M6 sets the synchronization reference offset width "1800μs" as the synchronization correction target time to the synchronization correction target time register.
同步校正部SY1~SY6将进行同步校正时的任意的单位时间作为同步校正幅度设定到同步校正幅度寄存器。同步校正部SY1~SY6以在同步校正幅度寄存器中设定的同步校正幅度为单位,校正与同步校正目标时间相应的量。同步校正幅度寄存器是由任意的比特数构成的信息。同步校正幅度是表示在一次的周期进行校正的单位时间并且表示针对同步校正目标时间以何种程度的幅度进行分割来进行校正的信息。The synchronization correction units SY1 to SY6 set an arbitrary unit time when performing synchronization correction as the synchronization correction amplitude in the synchronization correction amplitude register. The synchronization correction units SY1 to SY6 use the synchronization correction amplitude set in the synchronization correction amplitude register as a unit to correct an amount corresponding to the synchronization correction target time. The synchronization correction amplitude register is information composed of an arbitrary number of bits. The synchronization correction amplitude is information indicating the unit time for correction in one cycle and indicating the degree of amplitude by which the synchronization correction target time is divided for correction.
同步校正幅度寄存器中设定的同步校正幅度也可以是预先在处理器P1~P6、中断控制部W1~W6中指定的值。另外,也可以在同步校正幅度寄存器中指定用于实际进行校正的同步校正目标时间。在同步校正目标时间比同步校正幅度长的情况下,可以在下一周期以后从周期时间按一个周期增减与同步校正幅度相应的量,来对自模块周期进行校正。由此,通过第一CPU模块M1~第六CPU模块M6所具备的IO总线、所实现的功能,能够防止由于一次性大幅度地进行校正而导致加入IO总线的部分(模块)脱落等问题。在同步校正目标时间与同步校正幅度相同、或者同步校正目标时间比同步校正幅度短的情况下,也可以为在下一周期校正与同步校正目标时间相应的量。The synchronization correction amplitude set in the synchronization correction amplitude register may also be a value specified in advance in the processors P1 to P6 and the interrupt control units W1 to W6. In addition, the synchronization correction target time for actual correction may also be specified in the synchronization correction amplitude register. When the synchronization correction target time is longer than the synchronization correction amplitude, the self-module cycle may be corrected by increasing or decreasing the amount corresponding to the synchronization correction amplitude from the cycle time by one cycle after the next cycle. Thus, through the IO bus and the functions realized by the first CPU module M1 to the sixth CPU module M6, it is possible to prevent problems such as the detachment of the part (module) added to the IO bus due to a one-time large-scale correction. When the synchronization correction target time is the same as the synchronization correction amplitude, or the synchronization correction target time is shorter than the synchronization correction amplitude, the amount corresponding to the synchronization correction target time may also be corrected in the next cycle.
同步校正部SY1~SY6将用于指示同步校正执行的信息设定到同步校正执行寄存器中。同步校正执行寄存器例如是由1比特构成的信息。同步校正部SY1~SY6在进行同步校正之前,对同步校正执行寄存器设定“0”(关闭)并进行通知,在进行同步校正的情况下,对同步校正执行寄存器设定“1”(开启)并进行通知。The synchronization correction units SY1 to SY6 set information for indicating the execution of synchronization correction in the synchronization correction execution register. The synchronization correction execution register is, for example, information consisting of 1 bit. Before performing synchronization correction, the synchronization correction units SY1 to SY6 set the synchronization correction execution register to "0" (off) and notify, and when performing synchronization correction, set the synchronization correction execution register to "1" (on) and notify.
同步校正部SY1~SY6设定同步校正目标时间寄存器的信息、同步校正方向寄存器的信息以及同步校正幅度寄存器的信息,并通过将同步校正执行寄存器设定为“1”(开启)来分别开始同步校正。The synchronization correction units SY1 to SY6 set information of a synchronization correction target time register, information of a synchronization correction direction register, and information of a synchronization correction width register, and start synchronization correction by setting a synchronization correction execution register to "1" (ON).
例如,在同步校正目标时间为同步校正幅度以下的情况下,同步校正部SY1~SY6将同步校正目标时间设定为实际校正时间。与此相对,在同步校正目标时间大于同步校正幅度的情况下,同步校正部SY1计算同步校正幅度并将其设定为实际校正时间。For example, when the synchronization correction target time is less than the synchronization correction width, the synchronization correction units SY1 to SY6 set the synchronization correction target time as the actual correction time. On the other hand, when the synchronization correction target time is greater than the synchronization correction width, the synchronization correction unit SY1 calculates the synchronization correction width and sets it as the actual correction time.
例如,对同步校正目标时间为“300μs”、同步校正幅度为“500μs”的图4的第五CPU模块M5的情况进行说明。在同步校正目标时间“300μs”为同步校正幅度“500μs”以下的情况下,同步校正部SY5将同步校正目标时间“300μs”设定为实际校正时间。然后,在所设定的校正方向为-(负)方向的情况下,同步校正部SY5将从自模块周期“4000μs”减去所设定的实际校正时间“300μs”所得到的值“4000μs-300μs=3700μs”设定为下一周期的长度C5来对自模块周期进行校正。For example, the case of the fifth CPU module M5 in FIG. 4 where the synchronization correction target time is "300μs" and the synchronization correction width is "500μs" is described. When the synchronization correction target time "300μs" is less than the synchronization correction width "500μs", the synchronization correction unit SY5 sets the synchronization correction target time "300μs" as the actual correction time. Then, when the set correction direction is the - (negative) direction, the synchronization correction unit SY5 sets the value "4000μs-300μs=3700μs" obtained by subtracting the set actual correction time "300μs" from the self-module cycle "4000μs" as the length C5 of the next cycle to correct the self-module cycle.
对同步校正目标时间为“1800μs”、同步校正幅度为“500μs”的图4的第六CPU模块M6的情况进行说明。在同步校正目标时间“1800μs”为同步校正幅度“500μs”以下的情况下,同步校正部SY5将同步校正目标时间“1800μs”设定为实际校正时间。然后,在所设定的校正方向为+(正)方向的情况下,同步校正部SY5将对自模块周期“4000μs”加上所设定的实际校正时间“1800μs”所得到的值“4000μs+1800μs=5800μs”设定为下一周期C6的长度来对自模块周期进行校正。The case of the sixth CPU module M6 in FIG. 4 in which the synchronization correction target time is "1800μs" and the synchronization correction width is "500μs" is described. When the synchronization correction target time "1800μs" is less than the synchronization correction width "500μs", the synchronization correction unit SY5 sets the synchronization correction target time "1800μs" as the actual correction time. Then, when the set correction direction is the + (positive) direction, the synchronization correction unit SY5 sets the value "4000μs+1800μs=5800μs" obtained by adding the set actual correction time "1800μs" to the self-module cycle "4000μs" as the length of the next cycle C6 to correct the self-module cycle.
由此,自模块周期同样为“4000μs”的第五CPU模块M5的周期C5的下个周期C5b的开始起点Tb与第六CPU模块M6的周期C6的下个周期C6b的开始起点Tb一致。由此,如图4的(1)所示,能够使同步不一致的状态的各模块M的自模块周期的开始起点一致。Thus, the starting point Tb of the next cycle C5b of the cycle C5 of the fifth CPU module M5, which also has a self-module cycle of "4000 μs", coincides with the starting point Tb of the next cycle C6b of the cycle C6 of the sixth CPU module M6. Thus, as shown in (1) of FIG. 4 , the starting points of the self-module cycles of the modules M in a state of synchronization inconsistency can be made consistent.
另外,以同样方式决定自模块周期为“1000μs”的第一CPU模块M1、第二CPU模块M2的下一周期C1、C2、自模块周期为“2000μs”的第三CPU模块M3、第三CPU模块M3的下一周期C3、C4的周期的长度并进行同步校正。In addition, the lengths of the first CPU module M1 with a module cycle of "1000μs", the next cycles C1 and C2 of the second CPU module M2, and the third CPU module M3 with a module cycle of "2000μs", and the next cycles C3 and C4 of the third CPU module M3 are determined in the same way and synchronization correction is performed.
由此,如图4的(2)所示,能够在自模块周期不同的、第一CPU模块M1、第二CPU模块M2的自模块周期“1ms”、第三CPU模块M3、第四CPU模块M4的自模块周期“2ms”以及第五CPU模块M5、第六CPU模块M6的自模块周期“4ms”的最小公倍数“4ms”之后的开始起点Tb,使各模块的自模块周期的开始起点一致。Therefore, as shown in (2) of Figure 4, the starting starting point Tb of the self-module cycles of each module can be made consistent after the least common multiple "4ms" of the self-module cycles of the first CPU module M1 and the second CPU module M2, the self-module cycles of the third CPU module M3 and the fourth CPU module M4, and the self-module cycles of the fifth CPU module M5 and the sixth CPU module M6.
即,如图4的(1)所示,在进行以同步开始信号(SY_EXE)为起点的一系列的同步校正之前的非同步状态中,第一CPU模块M1~第六CPU模块M6基于+++状态。That is, as shown in (1) of FIG. 4 , in the asynchronous state before a series of synchronization corrections starting with the synchronization start signal (SY_EXE) are performed, the first CPU module M1 to the sixth CPU module M6 are in the +++ state.
与此相对,在本实施方式中,在进行了以同步开始信号(SY_EXE)为起点的一系列的同步校正的情况下,在接收到同步开始信号(SY_EXE)时,第一CPU模块M1~第六CPU模块M6的同步校正部SY1~SY6决定同步校正方向和同步校正目标时间。由此,同步校正部SY1~SY6通过在下一周期进行同步校正,能够在各模块M的最小公倍数后的第一个周期或第二个周期使开始起点同步。由此,不另外具备对PLC系统SYS的同步进行管理的模块等结构,就能够使构成PLC系统SYS的各模块M的自模块周期同步。In contrast, in the present embodiment, when a series of synchronization corrections are performed starting from the synchronization start signal (SY_EXE), upon receiving the synchronization start signal (SY_EXE), the synchronization correction units SY1 to SY6 of the first CPU module M1 to the sixth CPU module M6 determine the synchronization correction direction and the synchronization correction target time. Thus, the synchronization correction units SY1 to SY6 can synchronize the starting point in the first cycle or the second cycle after the least common multiple of each module M by performing synchronization correction in the next cycle. Thus, the self-module cycle of each module M constituting the PLC system SYS can be synchronized without separately having a module or the like for managing the synchronization of the PLC system SYS.
另外,在同步校正目标时间为“300μs”、同步校正幅度为“1μs”的情况下,同步校正部SY1~SY6以分割为“300次”的周期的方式进行校正,该“300次”是将同步校正目标时间“300μs”除以同步校正幅度“1μs”的幅度所得到的值。In addition, when the synchronization correction target time is "300μs" and the synchronization correction width is "1μs", the synchronization correction units SY1~SY6 perform correction in a manner divided into a cycle of "300 times", where "300 times" is the value obtained by dividing the synchronization correction target time "300μs" by the synchronization correction width "1μs".
在该情况下,在校正方向为-(负)方向的情况下,同步校正部SY1~SY6以从同步校正目标时间“300μs”减去同步校正幅度“1μs”所得到的值“299μs”分为“300次”的周期来进行校正。In this case, when the correction direction is the - (negative) direction, the synchronization correction units SY1 to SY6 perform correction in a cycle of "300 times" with a value "299 μs" obtained by subtracting the synchronization correction width "1 μs" from the synchronization correction target time "300 μs".
另外,在校正方向为+(正)方向的情况下,同步校正部SY1~SY6以对同步校正目标时间“300μs”加上同步校正幅度“1μs”所得到的值“301μs”分为“300次”的周期来进行校正。When the correction direction is the positive direction, the synchronization correction units SY1 to SY6 perform correction in a cycle of "300 times" with a value "301 μs" obtained by adding the synchronization correction width "1 μs" to the synchronization correction target time "300 μs".
更具体地说,对同步校正目标时间为“300μs”、自模块周期为“4000μs”、同步校正幅度为“100μs”的情况进行说明。在同步校正目标时间“300μs”大于同步校正幅度“100μs”的情况下,同步校正部SY5将同步校正幅度“100μs”设定为实际校正时间。然后,在所设定的校正方向为+(正)方向的情况下,同步校正部SY1~SY6将对自模块周期“4000μs”加上所设定的实际校正时间“100μs”所得到的值“4000μs+100μs=4100μs”设定为下一周期的长度来对自模块周期进行校正。More specifically, the case where the synchronization correction target time is "300μs", the self-module cycle is "4000μs", and the synchronization correction width is "100μs" is described. When the synchronization correction target time "300μs" is greater than the synchronization correction width "100μs", the synchronization correction unit SY5 sets the synchronization correction width "100μs" as the actual correction time. Then, when the set correction direction is the + (positive) direction, the synchronization correction units SY1 to SY6 set the value "4000μs+100μs=4100μs" obtained by adding the set actual correction time "100μs" to the self-module cycle "4000μs" as the length of the next cycle to correct the self-module cycle.
同步校正部SY1~SY6将从同步校正目标时间“300μs”减去实际校正时间“100μs”所得到的值“300μs-100μs=200μs”设定为同步校正目标时间。之后,同步校正部SY1~SY6在同步校正目标时间变为“0”以下之前的期间,重复执行按每个周期加上实际校正时间和减去同步校正目标时间,来分为三次的周期进行自模块周期的校正。The synchronization correction units SY1 to SY6 set the value "300μs-100μs=200μs" obtained by subtracting the actual correction time "100μs" from the synchronization correction target time "300μs" as the synchronization correction target time. Thereafter, the synchronization correction units SY1 to SY6 repeatedly perform the self-module cycle correction in three cycles by adding the actual correction time and subtracting the synchronization correction target time in each cycle until the synchronization correction target time becomes equal to or less than "0".
像这样,通过以分割为多个周期的方式进行校正,来抑制自模块周期骤然缩短,由此能够防止在缩短后的周期内无法在时间内执行应用程序执行功能、IO总线功能,能够防止PLC系统SYS的误工作。By performing correction in a divided manner into a plurality of cycles in this way, a sudden shortening of the self-module cycle can be suppressed, thereby preventing the application execution function and the IO bus function from being unable to be executed within the shortened cycle, thereby preventing malfunction of the PLC system SYS.
另外,也可以将同步校正幅度设定为比同步校正目标时间大的值。在该情况下,同步校正部SY1~SY6校正与同步校正目标时间相应的量。例如,在同步校正目标时间为“300μs”、同步校正幅度为“500μs”的情况下,同步校正幅度“500μs”大于同步校正目标时间“300μs”。在该情况下,同步校正部SY1~SY6以同步校正目标时间“300μs”进行校正。In addition, the synchronization correction width may be set to a value greater than the synchronization correction target time. In this case, the synchronization correction units SY1 to SY6 correct by an amount corresponding to the synchronization correction target time. For example, when the synchronization correction target time is "300 μs" and the synchronization correction width is "500 μs", the synchronization correction width "500 μs" is greater than the synchronization correction target time "300 μs". In this case, the synchronization correction units SY1 to SY6 perform correction with the synchronization correction target time "300 μs".
另外,在PLC系统SYS的初始启动时(例如初始化的时刻),作为同步校正幅度,设定最大值,并以一个周期对自模块周期进行校正,在PLC系统SYS启动之后将各模块M单独地进行启动的情况下(例如,多个模块M中的至少一个模块进行动作的时刻),可以设定任意的同步校正幅度,针对自模块周期以分割为n(n>2)次的周期的方式进行校正。由此,在PLC系统SYS的初始启动时,能够提早进行同步校正,并且在PLC系统SYS启动之后将各模块M单独地进行启动的情况下,能够防止因自模块周期骤然缩短而导致各模块M无法执行各种功能。In addition, at the initial startup of the PLC system SYS (for example, at the time of initialization), as the synchronization correction amplitude, a maximum value is set, and the self-module cycle is corrected in one cycle. When each module M is started separately after the PLC system SYS is started (for example, when at least one of the multiple modules M is in action), an arbitrary synchronization correction amplitude can be set, and the self-module cycle is corrected in a manner of dividing it into n (n>2) cycles. As a result, at the initial startup of the PLC system SYS, synchronization correction can be performed early, and when each module M is started separately after the PLC system SYS is started, it can be prevented that each module M cannot perform various functions due to a sudden shortening of the self-module cycle.
此外,同步校正部SY1~SY6在进行同步校正之后,使用计数器部Co1~Co6等来判定各模块M的独立时钟生成部CL1~CL6与基板B1上的基准时钟生成部BCL1的晶振误差(PPM误差)。然后,在判定的结果为晶振误差(PPM误差)超出一定的范围的情况下,在基板B1上的基准时钟生成部BCL1启动时,或者在处理器P1~P6、中断控制部W1~W6的IO总线功能中指定的任意的时刻,开始同样的同步校正处理过程,针对各模块M各自的自模块周期通过暂时地进行减法或加法来进行校正,从而持续维持同步。Furthermore, after the synchronization correction, the synchronization correction units SY1 to SY6 use the counter units Co1 to Co6 and the like to determine the crystal oscillator error (PPM error) between the independent clock generators CL1 to CL6 of each module M and the reference clock generator BCL1 on the substrate B1. Then, when the result of the determination is that the crystal oscillator error (PPM error) exceeds a certain range, the same synchronization correction process is started when the reference clock generator BCL1 on the substrate B1 is started, or at any time specified in the IO bus function of the processors P1 to P6 and the interrupt control units W1 to W6, and the self-module cycle of each module M is corrected by temporarily performing subtraction or addition, thereby continuously maintaining synchronization.
图5是示出在构成PLC系统SYS的第一CPU模块M1、第二CPU模块M2与基板B1之间执行的同步校正处理的序列图的一例的图。在图5的实施方式中,仅对第一CPU模块M1~第六CPU模块M6中的第一CPU模块M1和第二CPU模块M2进行说明,第三CPU模块M3~第四CPU模块6也是同样的。Fig. 5 is a diagram showing an example of a sequence diagram of a synchronization correction process performed between the first CPU module M1, the second CPU module M2 and the substrate B1 constituting the PLC system SYS. In the embodiment of Fig. 5, only the first CPU module M1 and the second CPU module M2 among the first CPU module M1 to the sixth CPU module M6 are described, and the third CPU module M3 to the fourth CPU module 6 are also described in the same manner.
首先,当第一CPU模块M1的电源被接通时,第一CPU模块M1的电源控制部Pa1将电源状态(SY_P1)通知给基板B1(S101)。另外,第一CPU模块M1的同步校正部SY1将同步设定状态(SY_EN1)通知给基板B1(S102)。First, when the power of the first CPU module M1 is turned on, the power control unit Pa1 of the first CPU module M1 notifies the board B1 of the power state (SY_P1) (S101). In addition, the synchronization correction unit SY1 of the first CPU module M1 notifies the board B1 of the synchronization setting state (SY_EN1) (S102).
同样地,当第二CPU模块M2的电源被接通时,第二CPU模块M2的电源控制部Pa2将电源状态(SY_P2)通知给基板B1(S103)。另外,第二CPU模块M2的同步校正部SY2将同步设定状态(SY_EN2)通知给基板B1(S104)。Similarly, when the power of the second CPU module M2 is turned on, the power control unit Pa2 of the second CPU module M2 notifies the board B1 of the power state (SY_P2) (S103). In addition, the synchronization correction unit SY2 of the second CPU module M2 notifies the board B1 of the synchronization setting state (SY_EN2) (S104).
第一CPU模块M1的同步校正部SY1使用同步开始请求寄存器,在任意的时刻将同步开始请求(SY_RQ1)通知给配置于基板B1上的同步控制部BSY1(S105)。同样地,第二CPU模块M2的同步校正部SY2使用同步开始请求寄存器,在任意的时刻将同步开始请求(SY_RQ2)通知给配置于基板B1上的同步控制部BSY1(S106)。The synchronization correction unit SY1 of the first CPU module M1 uses the synchronization start request register to notify the synchronization control unit BSY1 configured on the substrate B1 of the synchronization start request (SY_RQ1) at any time (S105). Similarly, the synchronization correction unit SY2 of the second CPU module M2 uses the synchronization start request register to notify the synchronization control unit BSY1 configured on the substrate B1 of the synchronization start request (SY_RQ2) at any time (S106).
基板B1的同步控制部BSY1判定是否从作为同步对象的所有的模块M接收到同步开始请求(SY_RQ1~SY_RQ6)(S107)。在没有从作为同步对象的所有的模块M接收到同步开始请求(SY_RQ1~SY_RQ6)的情况下(S107:“否”),使处理待机,直到从作为同步对象的所有的模块M接收到同步开始请求(SY_RQ1~SY_RQ6)为止。The synchronization control unit BSY1 of the substrate B1 determines whether the synchronization start request (SY_RQ1 to SY_RQ6) is received from all the modules M as synchronization targets (S107). If the synchronization start request (SY_RQ1 to SY_RQ6) is not received from all the modules M as synchronization targets (S107: "No"), the process is put on standby until the synchronization start request (SY_RQ1 to SY_RQ6) is received from all the modules M as synchronization targets.
在从作为同步对象的所有的模块M接收到同步开始请求(SY_RQ1~SY_RQ6)的情况下(S107:“是”),基板B1的同步控制部BSY1基于由基准时钟生成部BCL1生成的基准时刻(CLK100μs)的上升沿,来将同步开始信号(SY_EXE)和基准时刻(CLK100μs)分别输出至第一CPU模块M1的同步校正部SY1、第二CPU模块M2的同步校正部SY2(S108~S111)。When a synchronization start request (SY_RQ1 to SY_RQ6) is received from all modules M that are synchronization objects (S107: "Yes"), the synchronization control unit BSY1 of the substrate B1 outputs the synchronization start signal (SY_EXE) and the reference time (CLK100μs) to the synchronization correction unit SY1 of the first CPU module M1 and the synchronization correction unit SY2 of the second CPU module M2, respectively, based on the rising edge of the reference time (CLK100μs) generated by the reference clock generation unit BCL1 (S108 to S111).
接收到同步开始请求(SY_RQ1)的第一CPU模块M1的同步校正部SY1进行后述的同步校正处理(S112)。同样地,接收到同步开始请求(SY_RQ2)的第二CPU模块M2的同步校正部SY2进行后述的同步校正处理(S113)。下面,由第一CPU模块M1进行的S112的同步校正处理与由第二CPU模块M2进行的S113的同步校正处理为大致相同的处理,因此下面基于相同的标记来通过流程图进行说明。The synchronization correction unit SY1 of the first CPU module M1 that has received the synchronization start request (SY_RQ1) performs the synchronization correction process (S112) described later. Similarly, the synchronization correction unit SY2 of the second CPU module M2 that has received the synchronization start request (SY_RQ2) performs the synchronization correction process (S113) described later. The synchronization correction process of S112 performed by the first CPU module M1 and the synchronization correction process of S113 performed by the second CPU module M2 are substantially the same processes, and therefore are described below using a flowchart based on the same reference numerals.
图6是示出第一CPU模块执行的同步校正处理的一例的流程图。此外,第二CPU模块M2~第六CPU模块M6执行的同步校正处理也与第一CPU模块M1执行的同步校正处理是同样的,因此省略说明。Fig. 6 is a flowchart showing an example of the synchronization correction process executed by the first CPU module. The synchronization correction process executed by the second CPU module M2 to the sixth CPU module M6 is also the same as the synchronization correction process executed by the first CPU module M1, so the description thereof is omitted.
首先,同步校正部SY1在自模块为同步对象的情况下,进行模块功能的初始设定(S201)。同步校正部SY1判定初始设定是否已完成(S202)。在判定的结果为初始设定未完成的情况下(S202:“否”),使处理待机。在判定的结果为初始设定已完成的情况下(S202:“是”),同步校正部SY1向基板B1通知同步开始请求(SY_RQ1)(S203)。First, when the module itself is the synchronization target, the synchronization correction unit SY1 performs the initial setting of the module function (S201). The synchronization correction unit SY1 determines whether the initial setting has been completed (S202). If the result of the determination is that the initial setting has not been completed (S202: "No"), the process is put on standby. If the result of the determination is that the initial setting has been completed (S202: "Yes"), the synchronization correction unit SY1 notifies the substrate B1 of the synchronization start request (SY_RQ1) (S203).
同步校正部SY1判定是否从基板B1的同步控制部BSY1接收到同步开始信号(SY_EXE)(S204)。在未从同步控制部BSY1接收到同步开始信号(SY_EXE)的情况下(S204:“否”),在接收到同步开始信号(SY_EXE)之前的期间使处理待机。The synchronization correction unit SY1 determines whether the synchronization start signal (SY_EXE) is received from the synchronization control unit BSY1 of the substrate B1 (S204). If the synchronization start signal (SY_EXE) is not received from the synchronization control unit BSY1 (S204: No), the process is put on standby until the synchronization start signal (SY_EXE) is received.
在从同步控制部BSY1接收到同步开始信号(SY_EXE)的情况下(S204:“是”),同步校正部SY1基于计算出的同步基准偏移幅度满足(1)式和(2)式中的哪一个,来设定校正方向(S205)。When receiving the synchronization start signal (SY_EXE) from the synchronization control unit BSY1 (S204: YES), the synchronization correction unit SY1 sets the correction direction based on whether the calculated synchronization reference shift width satisfies equation (1) or equation (2) (S205).
同步校正部SY1将同步基准偏移幅度的值和从自模块周期减去同步基准偏移幅度所得到的值中的较少(小)一方的值设定为同步校正目标时间(S206)。同步校正部SY1将进行同步校正时的任意的单位时间作为同步校正幅度设定到同步校正幅度寄存器中(S207)。The synchronization correction unit SY1 sets the smaller value between the value of the synchronization reference offset width and the value obtained by subtracting the synchronization reference offset width from the self-module period as the synchronization correction target time (S206). The synchronization correction unit SY1 sets an arbitrary unit time when performing synchronization correction as the synchronization correction width in the synchronization correction width register (S207).
同步校正部SY1判定是否从处理器P1接收到同步校正执行请求(S208)。在未从处理器P1接收到同步校正执行请求的情况下(S208:“否”),在从处理器P1接收到同步校正执行请求之前的期间使处理待机。在从处理器P1接收到同步校正执行请求的情况下(S208:“是”),进行后述的同步校正执行处理(S209)。The synchronization correction unit SY1 determines whether a synchronization correction execution request is received from the processor P1 (S208). If a synchronization correction execution request is not received from the processor P1 (S208: No), the process is put on standby until a synchronization correction execution request is received from the processor P1. If a synchronization correction execution request is received from the processor P1 (S208: Yes), the synchronization correction execution process described later is performed (S209).
图7是示出同步校正执行处理的一例的流程图。首先,同步校正部SY1判定在图6的S206中设定的同步校正目标时间是否大于0(S301)。在同步校正目标时间为0以下的情况下(S301:“否”),同步校正执行处理结束。Fig. 7 is a flowchart showing an example of synchronization correction execution processing. First, the synchronization correction unit SY1 determines whether the synchronization correction target time set in S206 of Fig. 6 is greater than 0 (S301). When the synchronization correction target time is less than 0 (S301: No), the synchronization correction execution processing ends.
在同步校正目标时间大于0的情况下(S301:“是”),同步校正部SY1判定同步校正目标时间是否为在图6的S207中设定的同步校正幅度以下(S302)。When the synchronization correction target time is greater than 0 ( S301 : Yes), the synchronization correction unit SY1 determines whether the synchronization correction target time is equal to or less than the synchronization correction width set in S207 of FIG. 6 ( S302 ).
在同步校正目标时间为同步校正幅度以下的情况下(S302:“是”),同步校正部SY1将同步校正目标时间设定为实际校正时间(S303)。当该处理结束时,处理进入S305。在同步校正目标时间大于同步校正幅度的情况下(S302:“否”),同步校正部SY1将同步校正幅度设定为实际校正时间(S304)。当该处理结束时,处理进入S305。When the synchronization correction target time is less than the synchronization correction width (S302: Yes), the synchronization correction unit SY1 sets the synchronization correction target time as the actual correction time (S303). When this process is completed, the process proceeds to S305. When the synchronization correction target time is greater than the synchronization correction width (S302: No), the synchronization correction unit SY1 sets the synchronization correction width as the actual correction time (S304). When this process is completed, the process proceeds to S305.
在S305中,同步校正部SY1判定在图6的S205中设定的校正方向(S305)。在所设定的校正方向为+(正)方向的情况下,同步校正部SY1将对自模块周期加上实际校正时间所得到的时间设定为下一周期(S306)。当该处理结束时,处理进入S308。在所设定的校正方向为-(负)方向的情况下,同步校正部SY1将从自模块周期减去实际校正时间所得到的时间设定为下一周期(S306)。当该处理结束时,处理进入S308。In S305, the synchronization correction unit SY1 determines the correction direction set in S205 of FIG. 6 (S305). When the correction direction set is the + (positive) direction, the synchronization correction unit SY1 sets the time obtained by adding the actual correction time to the self-module cycle as the next cycle (S306). When this process is completed, the process proceeds to S308. When the correction direction set is the - (negative) direction, the synchronization correction unit SY1 sets the time obtained by subtracting the actual correction time from the self-module cycle as the next cycle (S306). When this process is completed, the process proceeds to S308.
同步校正部SY1将从同步校正目标时间减去实际校正时间所得到的值设定为同步校正目标时间(S308)。同步校正部SY1判定同步校正目标时间是否大于0(S309)。The synchronization correction unit SY1 sets the value obtained by subtracting the actual correction time from the synchronization correction target time as the synchronization correction target time (S308). The synchronization correction unit SY1 determines whether the synchronization correction target time is greater than 0 (S309).
在同步校正目标时间大于0的情况下(S309:“是”),处理返回到S302,在同步校正目标时间变为0之前的期间重复执行S302、S304~S309的处理。在同步校正目标时间为0以下的情况下(S309:“否”),同步校正部SY1将同步开始请求(SY_RQ1)设为关闭(S310),结束同步校正执行处理。When the synchronization correction target time is greater than 0 (S309: Yes), the process returns to S302, and the processes of S302, S304 to S309 are repeatedly executed until the synchronization correction target time becomes 0. When the synchronization correction target time is less than 0 (S309: No), the synchronization correction unit SY1 turns off the synchronization start request (SY_RQ1) (S310), and ends the synchronization correction execution process.
此外,本发明不限定于上述实施方式,能够进行各种变更来实施。在上述实施方式中,附图中图示的构成要素的大小、形状、功能等不限定于此,能够在发挥本发明的效果的范围内适当地进行变更。此外,只要不脱离本发明的目的的范围,则能够适当地进行变更来实施。In addition, the present invention is not limited to the above-mentioned embodiment, and various changes can be made to implement. In the above-mentioned embodiment, the size, shape, function, etc. of the constituent elements illustrated in the accompanying drawings are not limited thereto, and can be appropriately changed within the scope of the effect of the present invention. In addition, as long as it does not depart from the scope of the purpose of the present invention, it can be appropriately changed to implement.
产业上的可利用性Industrial Applicability
如以上说明的那样,本发明能够使构成可编程控制器系统的各模块的自模块周期同步,应用于使用可编程控制器系统的设备是较佳的。As described above, the present invention can synchronize the module cycles of the modules constituting the programmable controller system, and is preferably applied to equipment using the programmable controller system.
Claims (9)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019212503A JP7439474B2 (en) | 2019-11-25 | 2019-11-25 | Programmable controller systems and modules |
JP2019-212503 | 2019-11-25 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112835321A CN112835321A (en) | 2021-05-25 |
CN112835321B true CN112835321B (en) | 2024-05-14 |
Family
ID=75923457
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011031198.1A Active CN112835321B (en) | 2019-11-25 | 2020-09-27 | Programmable controller systems and modules |
Country Status (4)
Country | Link |
---|---|
JP (1) | JP7439474B2 (en) |
KR (1) | KR102494296B1 (en) |
CN (1) | CN112835321B (en) |
TW (1) | TWI764300B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009157913A (en) * | 2007-12-07 | 2009-07-16 | Omron Corp | Industrial controller |
WO2012081115A1 (en) * | 2010-12-16 | 2012-06-21 | 三菱電機株式会社 | Sequencer system and control method therefor |
CN103389914A (en) * | 2013-07-03 | 2013-11-13 | 浙江大学 | Satellite-borne triple modular redundancy system based on clock synchronization technology |
WO2014108999A1 (en) * | 2013-01-08 | 2014-07-17 | 富士電機株式会社 | Control system, master programmable controller, slave programmable controller, and control method |
JP2017069809A (en) * | 2015-09-30 | 2017-04-06 | 住友電気工業株式会社 | Communication device |
WO2017080274A1 (en) * | 2015-11-13 | 2017-05-18 | 华为技术有限公司 | Multiprocessor system and clock synchronization method |
CN108592715A (en) * | 2018-05-02 | 2018-09-28 | 南京雷芯聚力电子科技有限公司 | A kind of programmable electronic detonator control chip and its control flow |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7072432B2 (en) | 2002-07-05 | 2006-07-04 | Meshnetworks, Inc. | System and method for correcting the clock drift and maintaining the synchronization of low quality clocks in wireless networks |
JP2011123688A (en) | 2009-12-11 | 2011-06-23 | Fuji Electric Systems Co Ltd | Synchronizing programmable controller and synchronizing programmable controller system |
KR101869357B1 (en) * | 2010-12-10 | 2018-06-21 | 선 페이턴트 트러스트 | Signal generation method and signal generation device |
WO2014037684A1 (en) * | 2012-09-04 | 2014-03-13 | Khalifa University of Science, Technology, and Research | Methods and devices for clock synchronization |
US9973036B2 (en) * | 2013-12-31 | 2018-05-15 | Schneider Electric It Corporation | Automatic sub-millisecond clock synchronization |
WO2015128981A1 (en) | 2014-02-27 | 2015-09-03 | 富士電機株式会社 | Programmable controller system and controller therefor |
EP3231110B1 (en) * | 2014-12-11 | 2023-05-17 | Khalifa University of Science and Technology | Method and devices for time transfer using end to end transparent clocks |
JP6820851B2 (en) | 2014-12-16 | 2021-01-27 | ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツングRobert Bosch Gmbh | How to synchronize the clocks of network devices |
DE112015003343B4 (en) * | 2015-07-08 | 2022-08-11 | Mitsubishi Electric Corporation | Network system, time master station and time slave station |
US10135606B2 (en) * | 2016-10-27 | 2018-11-20 | Macom Connectivity Solutions, Llc | Mitigating interaction between adaptive equalization and timing recovery |
US10014026B1 (en) * | 2017-06-20 | 2018-07-03 | Seagate Technology Llc | Head delay calibration and tracking in MSMR systems |
CN110291821A (en) * | 2018-01-19 | 2019-09-27 | 深圳市大疆创新科技有限公司 | The time synchronization control method of positioning system and positioning system, device |
-
2019
- 2019-11-25 JP JP2019212503A patent/JP7439474B2/en active Active
-
2020
- 2020-09-25 KR KR1020200124879A patent/KR102494296B1/en active Active
- 2020-09-26 TW TW109133454A patent/TWI764300B/en active
- 2020-09-27 CN CN202011031198.1A patent/CN112835321B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009157913A (en) * | 2007-12-07 | 2009-07-16 | Omron Corp | Industrial controller |
WO2012081115A1 (en) * | 2010-12-16 | 2012-06-21 | 三菱電機株式会社 | Sequencer system and control method therefor |
WO2014108999A1 (en) * | 2013-01-08 | 2014-07-17 | 富士電機株式会社 | Control system, master programmable controller, slave programmable controller, and control method |
CN103389914A (en) * | 2013-07-03 | 2013-11-13 | 浙江大学 | Satellite-borne triple modular redundancy system based on clock synchronization technology |
JP2017069809A (en) * | 2015-09-30 | 2017-04-06 | 住友電気工業株式会社 | Communication device |
WO2017080274A1 (en) * | 2015-11-13 | 2017-05-18 | 华为技术有限公司 | Multiprocessor system and clock synchronization method |
CN106708168A (en) * | 2015-11-13 | 2017-05-24 | 华为技术有限公司 | Multi-processor system and clock synchronization method |
CN108592715A (en) * | 2018-05-02 | 2018-09-28 | 南京雷芯聚力电子科技有限公司 | A kind of programmable electronic detonator control chip and its control flow |
Non-Patent Citations (1)
Title |
---|
基于现场可编程门阵列的硬件时钟同步方法;李正斌;郭丽霞;;电工电气(08);全文 * |
Also Published As
Publication number | Publication date |
---|---|
KR20210064039A (en) | 2021-06-02 |
TWI764300B (en) | 2022-05-11 |
KR102494296B1 (en) | 2023-01-31 |
JP7439474B2 (en) | 2024-02-28 |
JP2021086211A (en) | 2021-06-03 |
TW202121084A (en) | 2021-06-01 |
CN112835321A (en) | 2021-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10110367B2 (en) | High precision timer in CPU cluster | |
US8280559B2 (en) | Apparatus and method for providing cooling to multiple components | |
JP2002049605A (en) | Timer adjustment system | |
TW201603493A (en) | Clock generator, communication device and sequential clock gating circuit | |
US6809556B1 (en) | Self-compensating glitch free clock switch | |
US20120223749A1 (en) | Clock synchronization circuit and semiconductor integrated circuit | |
CN112835321B (en) | Programmable controller systems and modules | |
JP2013206472A (en) | Method of forming timestamp in real-time system, data processing device, computer program product, and digital storage medium | |
US9747246B2 (en) | Electronic device for communicating between a microcontroller unit (MCU) and a host processor and related methods | |
CN108988832B (en) | Method for detecting a delay associated with an electronic device and corresponding electronic device | |
KR20140036284A (en) | Frequency divider and method for dividing frequency of frequency divider | |
JP2005157883A (en) | Reset circuit | |
US5045715A (en) | Circuit for generating stretched clock phases on a cycle by cycle basis | |
KR101689279B1 (en) | Timer and integrated circuit device including the same | |
JP2007188213A (en) | Semiconductor integrated circuit device | |
CN104391817A (en) | Electronic system synchronous with peripheral equipment | |
CN109918336B (en) | Periodic processing execution system and system on chip | |
CN111158758B (en) | Method and device for waking up central processing unit | |
US9941865B2 (en) | Method and circuitry for generating trigger signal and associated non-transitory computer program product | |
KR100734521B1 (en) | IP Module for System-on-Chip | |
US6760798B1 (en) | Interface mechanism and method for interfacing a real-time clock with a data processing circuit | |
KR101418519B1 (en) | Dividing method of dispenser and dispenser | |
JP3709355B2 (en) | Clock synchronization system and method | |
JP5724772B2 (en) | Test condition setting method, current fluctuation test method, and information processing apparatus | |
JP5413367B2 (en) | Semiconductor device and communication method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |