PLC device and recording medium

The PLC device synchronizes execution times or cycles of redundant PLCs with different performance levels, addressing performance discrepancies and reducing user burden in functional safety systems.

JP7538341B2Active Publication Date: 2024-08-21FANUC LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2023516009
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-04-23
Publication Date
2024-08-21
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

Existing redundant safety PLC systems with different parts and designs face performance discrepancies due to varying execution speeds, leading to potential common cause failures and increased design burdens for users.

Method used

A PLC device that measures and adjusts execution times or cycles of sequence programs in multiple PLCs to synchronize their operations, eliminating the need for modifying the sequence program and reducing performance differences.

Benefits of technology

The solution allows for synchronized operation of PLCs with different performance levels without modifying the sequence program, thereby reducing user burden and enhancing functional safety system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007538341000010
    Figure 0007538341000010
  • Figure 0007538341000004
    Figure 0007538341000004
  • Figure 0007538341000013
    Figure 0007538341000013
Patent Text Reader

Abstract

The present invention sets a parameter in a PLC device without modifying a sequence program to remove a difference in execution speed, to thereby enable a difference in performance between two PLCs to be absorbed and remove a load on a user who designs a functional safety system. Provided is a PLC device having a first PLC and a second PLC, the PLC device comprising: a measurement unit that causes PLC execution units of the first PLC and the second PLC to execute test run of a sequence program and measures a period between start and end of the sequence program for each of the first PLC and the second PLC; a timing adjustment information calculation unit that uses the measured periods to calculate timing adjustment information including at least one of an execution time and execution cycle in cyclic execution of the sequence program by the first PLC and the second PLC; and a timing adjustment information setting unit that sets the timing adjustment information calculated by the timing adjustment information calculation unit in at least any one of the first PLC and the second PLC.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a PLC device and a recording medium. [Background technology]

[0002] For functional safety, a technology has been proposed for detecting faults by mutually comparing signals in a redundant safety PLC (see, for example, Patent Document 1). [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2019-219894 A Summary of the Invention [Problem to be solved by the invention]

[0004] FIG. 13 is a diagram showing an example of a PLC 520 without functional safety. As shown in FIG. 13, in the case of a PLC 520 without functional safety, if there is a problem such as a malfunction in any of the IO unit 510, PLC 520, IO unit 530, or circuit breaker 540 between the time when the user presses the emergency stop button 500 and inputs the emergency stop, and the time when power to the motor 550 is actually cut off, it can lead to a serious accident. FIG. 14 is a diagram illustrating an example of PLCs 520a, 520b with functional safety. 14, there are two systems of PLCs 520a and 520b, so that even if there is a problem with the IO unit 510, the PLC 520a (or 520b), the IO unit 530, or the circuit breaker 540 of one system, an emergency stop is performed by the other system. In addition, the PLCs 520a and 520b of each system monitor each other, so that they can detect a failure (different calculation results, no response, etc.). However, if the duplicated PLCs 520a and 520b are configured with the same parts and the same design, there is a risk that they will stop working at the same time due to a common defect or part failure (this is called a "common cause failure" in the functional safety standard). Therefore, in order to avoid the risk of common cause failure, measures may be taken to provide diversity and increase the reliability of functional safety by constructing each system using PLCs 520a and 520b with different components and designs. However, the two PLCs 520a and 520b, which use different components and designs, have differences in performance such as processing speed.

[0005] For example, FIG. 15 shows a schematic time series of processing operations in the two PLCs 520a and 520b when PLC 520a is equipped with a CPU made by company A and PLC 520b is equipped with a CPU made by company B, and the same sequence program is executed using a fixed-cycle timer, with execution being completed in three cycles on the CPU made by company A and taking four cycles on the CPU made by company B. 15, in the fourth cycle, PLC 520b finishes the scan process while PLC 520a starts the next scan process. In this case, if PLC 520a starts the scan process before the program of PLC 520b has finished, a discrepancy will occur in the counters and calculation results between PLC 520a and PLC 520b.

[0006] FIG. 16 is a diagram showing an example of a method for synchronizing two PLCs 520a, 520b. As shown in FIG. 16, in a sequence program for PLC 520a, which has a fast CPU execution speed, the sequence program is modified so that no processing is performed in the fourth cycle, as indicated by the dashed rectangle, so that PLC 520a does not start a new execution process (scanning process) until execution of PLC 520b is completed.

[0007] However, although the performance difference between the two PLCs 520a and 520b can be roughly calculated from the CPU specifications and the PLC manufacturer's benchmarks, it is difficult to estimate the actual processing time because it depends on the configuration and contents of the sequence programs that run on each PLC 520a and 520b.In addition, the sequence programs must be designed carefully to prevent malfunctions due to differences in sequence program execution speed resulting from performance differences, which places a burden on users such as engineers who design functional safety systems.

[0008] Therefore, it is desirable to make it possible to absorb the performance difference between two PLCs by simply setting parameters in the PLC device, for example, without having to modify the sequence program to eliminate the difference in execution speed, thereby reducing the burden on users who design functional safety systems. [Means for solving the problem]

[0009] (1) One aspect of a PLC device of the present disclosure includes a PLC device including a first PLC and a second PLC, the PLC device including a measurement unit that causes a PLC execution unit of each of the first PLC and the second PLC to test execute a sequence program and measures a time taken from the start to the end of the sequence program in each of the PLC execution units of the first PLC and the second PLC, a timing adjustment information calculation unit that calculates timing adjustment information including at least one of an execution time and an execution period in periodic execution of the sequence program in the first PLC and the second PLC based on the measurement time measured by the measurement unit, and a timing adjustment information setting unit that sets the timing adjustment information calculated by the timing adjustment information calculation unit for at least one of the first PLC and the second PLC.

[0010] (2) One aspect of a recording medium of the present disclosure is a computer-readable recording medium having recorded thereon a program to cause a computer including a first PLC and a second PLC to test-execute a sequence program in the PLC execution units of each of the first PLC and the second PLC, the computer being configured to function as a measurement unit that measures the time taken from the start to the end of the sequence program in each of the PLC execution units of the first PLC and the second PLC during the test execution, a timing adjustment information calculation unit that calculates timing adjustment information including at least one of an execution time and an execution period in periodic execution of the sequence program in the first PLC and the second PLC based on the measured measurement time, and a timing adjustment information setting unit that sets the calculated timing adjustment information for at least one of the first PLC and the second PLC. Effect of the Invention

[0011] According to one embodiment, it is possible to absorb the performance difference between two PLCs by, for example, setting parameters in the PLC device without modifying the sequence program to eliminate the difference in execution speed, thereby reducing the burden on users who design functional safety systems. [Brief description of the drawings]

[0012] [Figure 1] 1 is a diagram showing an example of the configuration of a functional safety system according to a first embodiment. FIG. [Diagram 2] FIG. 2 is a block diagram showing the configuration of a PLC. [Diagram 3] FIG. 13 is a diagram showing an example of a user interface screen for timing adjustment information. [Figure 4] FIG. 13 is a diagram illustrating an example of a sequence program for executing a process X when a failure occurs. [Diagram 5] 11 is a flowchart illustrating a process in a test execution mode of the PLC. [Figure 6] 11 is a flowchart illustrating a process in a periodic execution mode of the PLC. [Figure 7]10 is a flowchart illustrating adjustment and setting processing of the PLC programming device. [Figure 8] 11 is a diagram illustrating an example of an operation of a PLC in a periodic execution mode when the execution time of the PLC is adjusted. [Figure 9] FIG. 2 is a block diagram showing the configuration of a PLC. [Figure 10] 11 is a flowchart illustrating a process in a test execution mode of the PLC. [Figure 11] 11 is a flowchart illustrating a process in a periodic execution mode of the PLC. [Figure 12] 11 is a diagram illustrating an example of an operation of a PLC in a periodic execution mode when the execution period of the PLC is adjusted. FIG. [Figure 13] FIG. 1 is a diagram illustrating an example of a PLC without functional safety. [Figure 14] FIG. 1 is a diagram illustrating an example of a PLC with functional safety. [Figure 15] FIG. 2 is a diagram illustrating a time series of processing operations in two PLCs. [Figure 16] FIG. 1 is a diagram illustrating an example of a method for synchronizing two PLCs. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] First Embodiment First, an outline of this embodiment will be described. In this embodiment, a safety PLC device including a first PLC and a second PLC causes the first PLC and the second PLC to test execute a sequence program, and measures the time taken from the start to the end of the sequence program in each of the first PLC and the second PLC. The safety PLC device calculates timing adjustment information related to the execution time in the periodic execution of the sequence program in the first PLC and the second PLC based on the measured time. The safety PLC device transmits the calculated timing adjustment information to an external PLC programming device, and sets it for at least one of the first PLC and the second PLC based on a setting instruction from the PLC programming device.

[0014] As a result, according to this embodiment, it is possible to solve the problem mentioned in the section [Problem to be solved by the invention], which is that "it is possible to absorb the performance difference between two PLCs by setting parameters, for example, in the PLC device without modifying the sequence program to eliminate the difference in execution speed, thereby relieving the burden on the user who designs the functional safety system." The above is an outline of this embodiment.

[0015] Next, the configuration of this embodiment will be described in detail with reference to the drawings. Here, a case is illustrated in which the execution speed of the first PLC is faster than that of the second PLC, and the execution time of the timing adjustment information of the first PLC is adjusted. Note that the present invention is also applicable to a case in which the execution speed of the second PLC is faster than that of the first PLC, and the execution time of the timing adjustment information of the second PLC is adjusted, or the execution time of the timing adjustment information of the first PLC and the execution time of the timing adjustment information of the second PLC are adjusted to a predetermined execution time. Fig. 1 is a diagram showing an example of the configuration of a functional safety system according to the first embodiment. As shown in Fig. 1, the functional safety system 1 includes IO input / output devices 10a and 10b, a safety PLC device 20, and a PLC programming device 30 as an external device. Note that Fig. 1 does not show devices such as circuit breakers connected to the IO input / output devices 10a and 10b.

[0016] The IO input / output devices 10a and 10b, the safety PLC device 20 as a PLC device, and the PLC programming device 30 may be directly connected to each other via a connection interface (not shown). The IO input / output devices 10a and 10b, the safety PLC device 20, and the PLC programming device 30 may be connected to each other via a network such as a LAN (Local Area Network). In this case, the IO input / output devices 10a and 10b, the safety PLC device 20, and the PLC programming device 30 may include a communication unit (not shown) for communicating with each other through such connection.

[0017] The IO input / output devices 10a and 10b are, for example, known switches, actuators, etc., and control the operations of circuit breakers (not shown) based on signals from the safety PLC device 20 described later.

[0018] <PLC programming device 30> The PLC programming device 30 is a computer or the like known to those skilled in the art, creates a sequence program such as a ladder program to be executed by the safety PLC device 20 described later, and transmits the created sequence program to the safety PLC device 20. In addition, the PLC programming device 30 includes a display unit (not shown) such as a liquid crystal display, and an input device (not shown) such as a touch panel arranged on a keyboard or a display device (not shown). For example, when one of a mode (non-safe state) (hereinafter also referred to as "test execution mode") for performing test execution based on a user input operation via an input device (not shown) and a mode (hereinafter also referred to as "periodic execution mode") for performing periodic execution applying set timing adjustment information is selected, an execution instruction for the selected mode may be transmitted to the safety PLC device 20 described later. Here, the non-safe state is a state in which functional safety is not operating, such as during setup or device startup. In addition, as will be described later, when the PLC programming device 30 transmits an execution instruction for the test execution mode to the safety PLC device 20, the PLC programming device 30 receives the timing adjustment information of the PLC 21a as the first PLC and the PLC 21b as the second PLC included in the safety PLC device 20 calculated by the safety PLC device 20 in the test execution mode from the safety PLC device 20, and may display the received timing adjustment information of the PLCs 21a and 21b on a display device (not shown). The PLC programming device 30 may transmit a setting instruction for the displayed timing adjustment information to the safety PLC device 20 based on a user input operation via an input device (not shown).

[0019] <Safety PLC device 20> 1, the safety PLC device 20 includes a PLC 21a as a first PLC, a PLC 21b as a second PLC, and a communication unit 22. The PLCs 21a and 21b and the communication unit 22 are connected to each other via a bus 23. The bus 23 may operate as a shared data bus for mutually checking data between the PLC 21a and the PLC 21b.

[0020] The communication unit 22 receives a sequence program generated by the PLC programming device 30 and outputs the received sequence program to the PLCs 21a and 21b. The communication unit 22 may also receive, from the PLC programming device 30, an instruction to execute a test to adjust timing adjustment information of the PLCs 21a and 21b, and transmit a result of the execution of the test to the PLC programming device 30.

[0021] <PLC21a、21b> The PLCs 21a and 21b are PLCs known to those skilled in the art that execute sequence programs such as ladder programs and perform various controls, arithmetic processing, input / output processing of signals, and the like in accordance with the sequence programs. Fig. 2 is a block diagram showing the configuration of PLC 21a. The configuration of PLC 21b is similar to that of PLC 21a, and a description thereof will be omitted. However, the difference between PLC 21a and PLC 21b is the performance difference in the processing speed, etc. between the CPU included in PLC 21a and the CPU included in PLC 21b, as in the case of Fig. 9. As described above, for example, it is assumed that the execution speed of PLC 21a as the first PLC is faster than the execution speed of PLC 21b as the second PLC. 2, the PLC 21a includes a control unit 200 and a storage unit 230. The control unit 200 also includes a PLC execution unit 210 and an execution time adjustment unit 220. The execution time adjustment unit 220 also includes a measurement unit 221, a timing adjustment information calculation unit 222, a timing adjustment information setting unit 223, a switching unit 224, and a rewriting unit 225. The storage unit 230 also includes a signal state 231, timing adjustment information 232, a sequence program 233, and a program variable 234.

[0022] <Storage section 230> The storage unit 230 is, for example, a read only memory (ROM) or a hard disk drive (HDD), and stores a system program and a sequence program executed by the control unit 200 (described later). The storage unit 230 may also store a signal state 231, timing adjustment information 232, a sequence program 233, and a program variable 234. The signal status 231 stores, for example, log information indicating the status of signals output by the control unit 200, the PLC execution unit 210, and the execution time adjustment unit 220, which will be described later. Note that the log information stored in the signal status 231 may include, in addition to the status of each signal, information indicating the operation status of the PLC 21a when each signal was output (whether normal or abnormal such as a failure), time information, and the like. The timing adjustment information 232 stores, for example, timing adjustment information including an execution time or execution period set by the PLC programming device 30 . The sequence program 233 stores sequence programs such as a safety ladder program created by the PLC programming device 30. The program variables 234 store, for example, clock values, count values, times, etc. output by a CPU built-in clock, a hardware timer, etc. (not shown) included in the control unit 200 described later.

[0023] <Control unit 200> The control unit 200 includes a CPU, a ROM, a RAM, a CMOS (Complementary Metal-Oxide-Semiconductor) memory, and the like, which are configured to be able to communicate with each other via a bus, and are well known to those skilled in the art. The CPU is a processor that controls the PLC 21a as a whole. The CPU reads out the system program and application program stored in the ROM via the bus, and controls the entire PLC 21a according to the system program and application program. As a result, as shown in FIG. 2, the control unit 200 is configured to realize the functions of the PLC execution unit 210 and the execution time adjustment unit 220, and the execution time adjustment unit 220 is configured to realize the functions of the measurement unit 221, the timing adjustment information calculation unit 222, the timing adjustment information setting unit 223, the switching unit 224, and the rewriting unit 225. Various data such as temporary calculation data and display data are stored in the RAM. In addition, the CMOS memory is backed up by a battery (not shown) and is configured as a non-volatile memory that retains its memory state even when the power supply of the safety PLC device 20 is turned off.

[0024] The PLC execution unit 210 reads out a sequence program, such as a safety ladder program, from the sequence program 233 in the storage unit 230 in response to an execution instruction in a test execution mode or a periodic execution mode from the PLC programming device 30, and executes the read sequence program. Note that the operation of the PLC execution unit 210 can be performed using a known method, and detailed description thereof will be omitted.

[0025] For example, when the PLC execution unit 210 receives an execution instruction from the PLC programming device 30 and executes a sequence program, the measurement unit 221 measures the time taken by the PLC execution unit 210 from the start to the end of the sequence program. Specifically, the measurement unit 221 stores a clock value output by a CPU built-in clock (not shown) or the like when the PLC execution unit 210 starts executing a sequence program, and measures the elapsed time from the difference between the clock value output by the CPU built-in clock (not shown) or the like and the stored clock value. The measurement unit 221 calculates the time T taken from the start to the end of execution of the sequence program by the PLC execution unit 210 from the difference between the clock value output by the CPU built-in clock (not shown) or the like when the PLC execution unit 210 finishes executing the sequence program and the clock value stored at the start.m1 Measure.

[0026] Based on the time taken from the start to the end of the execution of the sequence program measured by the measurement unit 221, the timing adjustment information calculation unit 222 calculates timing adjustment information including the execution time of the sequence program in the cyclic execution mode in the PLC 21a. Specifically, the timing adjustment information calculation unit 222 receives, via the bus 23, for example, a time T m2 As described above, since the execution speed of the PLC 21a is faster than that of the PLC 21b, T m1 ≦T m2 When the maximum execution time per cycle is Td, the timing adjustment information calculation unit 222 calculates the execution time T cycle1 T m1 / T m2 × Td. The timing adjustment information calculation unit 222 calculates the execution time T cycle1 The timing adjustment information including the above is transmitted to the PLC programming device 30 via the communication unit 22. On the other hand, since the execution speed of the PLC 21b is slower than that of the PLC 21a, the timing adjustment information calculation unit 222 of the PLC 21b transmits the execution time measured by the measurement unit 221 to the PLC programming device 30 as timing adjustment information of the PLC 21b.

[0027] The PLC programming device 30 receives the timing adjustment information of the PLCs 21a and 21b from the safety PLC device 20, and displays the received timing adjustment information of the PLCs 21a and 21b on a display device (not shown). FIG. 3 is a diagram showing an example of a user interface screen for timing adjustment information. The "Execution time" in the first row of the user interface screen in FIG. 3 is the maximum execution time Td per cycle, which is indicated as "2 ms." The second row of the user interface screen indicates the execution time Tm1 , the ratio of the execution time allocated to the PLC 21a to the execution time Td, and the allocated execution time T cycle1 The third row of the user interface screen shows the execution time T m2 , the ratio of execution time allocated to the PLC 21b to the execution time Td, the allocated execution time T cycle2 Shows. 3, the PLC programming device 30 can adjust the ratio of the execution time allocated to the PLCs 21a and 21b with respect to the execution time Td based on an input operation by a user via an input device (not shown). In this embodiment, as described above, since the execution speed of the PLC 21a is faster than that of the PLC 21b, the execution time Td of the PLC 21a is adjusted based on the input operation by a user via an input device (not shown). cycle1 is adjusted to 50% of the execution time Td, and the execution time T cycle2 is adjusted so that 100% of the execution time Td is allocated. After the adjustment, when a user presses a SET button via an input device (not shown), the PLC programming device 30 transmits a setting instruction for the adjusted timing adjustment information to the safety PLC device 20.

[0028] When the timing adjustment information setting unit 223 receives a setting instruction from the PLC programming device 30, it sets the adjusted timing adjustment information in the PLC 21a. Specifically, the timing adjustment information setting unit 223 stores the timing adjustment information received from the PLC programming device 30 in the timing adjustment information 232 of the storage unit 230 .

[0029] The switching unit 224 switches between the test execution mode and the periodic execution mode based on an instruction from the PLC programming device 30 .

[0030] In order to reproduce a predetermined situation in the test execution mode, the rewriting unit 225 executes rewriting of the sequence program, rewriting of the signal state in the safety PLC device 20, or rewriting of the program variable 234 based on an instruction from the PLC programming device 30 via the communication unit 22. FIG. 4 is a diagram showing an example of a sequence program for executing process X at the time of a failure. As shown in FIG. 4, in order for the PLC execution unit 210 to execute process X in the test execution mode, it depends on the signal states of A, B, and C ((A OR B) AND C). For this reason, if this condition is not satisfied unless either of PLCs 21a and 21b fails or the like as a predetermined situation, the maximum value of the execution time cannot be measured. Therefore, the rewriting unit 225 rewrites the signal state to the actual state in the signal state 231 and rewrites it to the signal states of A, B, and C for which ((A OR B) AND C) such as a failure holds, based on an instruction from the PLC programming device 30, for example. Thereby, the PLC execution unit 210 can execute process X in the test execution mode. Further, if the rewriting unit 225 does not rewrite the counter value or time stored in the program variable 234, the maximum value of the processing time of the sequence program may not be estimated, and the counter value, time, etc. of the program variable 234 may be rewritten. Further, instead of rewriting the signal state 231 and the program variable 234, the rewriting unit 225 may rewrite the sequence program itself in order to cope with measurement using a ladder program in which a test program is embedded, for example.

[0031] <Processing in the test execution mode of PLC21a> Next, with reference to FIG. 5, the processing flow in the test execution mode of PLC21a will be described. Note that the same processing as that of PLC21a is executed for PLC21b. FIG. 5 is a flowchart for explaining the processing in the test execution mode of PLC21a. The flow shown here is executed each time a test execution mode is received from the PLC programming device 30.

[0032] In step S11, when the PLC execution unit 210 receives an execution instruction for the test execution mode from the PLC programming device 30, it starts executing the sequence program, and the measurement unit 221 acquires the clock value output by a CPU built-in clock (not shown) at the start of execution.

[0033] In step S12, the PLC execution unit 210 determines whether the execution of the sequence program has ended. If the execution of the sequence program has ended, the process proceeds to step S13. On the other hand, if the execution of the sequence program has not ended, the process waits until the execution of the sequence program ends.

[0034] In step S13, the measurement unit 221 acquires the clock value output by a CPU built-in clock (not shown) at the end of the sequence program, and obtains the execution time T m1 in PLC21a from the difference between the acquired clock value and the start clock value acquired in step S11.

[0035] In step S14, based on the execution time T m1 acquired in step S13, the timing adjustment information calculation unit 222 calculates timing adjustment information including the execution time T cycle1 of PLC21a in the periodic execution mode of the sequence program. The timing adjustment information calculation unit 222 transmits the calculated timing adjustment information to the PLC programming device 30.

[0036] In step S15, when the timing adjustment information setting unit 223 receives a setting instruction for the adjusted timing adjustment information from the PLC programming device 30 for the timing adjustment information transmitted in step S14, it stores and sets the received timing adjustment information in the timing adjustment information 232.

[0037] <Processing in the periodic execution mode of PLC21a> Next, with reference to FIG. 6, the processing flow in the periodic execution mode of the PLC 21a will be described. Note that the same processing as that of the PLC 21a is also executed for the PLC 21b. FIG. 6 is a flowchart for explaining the processing in the periodic execution mode of the PLC 21a. The flow shown here is executed for each cycle of the PLC 21a.

[0038] In step S21, when the PLC execution unit 210 receives an execution instruction for the periodic execution mode from the PLC programming device 30, it starts executing the sequence program, and the measurement unit 221 acquires the clock value output by a CPU built-in clock (not shown) at the start of execution.

[0039] In step S22, the PLC execution unit 210 determines whether the execution of the sequence program has ended. If the execution of the sequence program has ended, the processing for the current cycle ends and proceeds to the next cycle. On the other hand, if the execution of the sequence program has not ended, the processing proceeds to step S23.

[0040] In step S23, the measurement unit 221 measures the elapsed time from the difference between the clock value output from a CPU built-in clock (not shown) and the clock value acquired in step S21, and the PLC execution unit 210 determines whether the measured elapsed time has timed out exceeding the execution time T cycle1 If the measured elapsed time has timed out exceeding the execution time T cycle1 the processing proceeds to step S24. On the other hand, if the measured elapsed time has not timed out within the execution time T cycle1 the processing returns to step S22.

[0041] In step S24, the PLC execution unit 210 stops the execution of the sequence program in the current cycle and proceeds to the next cycle.

[0042] <Adjustment / Setting Processing of the PLC Programming Device 30> Next, the flow of the adjustment and setting process (safety function setup mode) of the PLC programming device 30 will be described with reference to FIG. 7 is a flowchart for explaining the adjustment and setting process of the PLC programming device 30. The flow shown here is executed every time a sequence program of a safety ladder program created by a user such as a functional safety designer is input to the PLC programming device 30.

[0043] In step S31, the PLC programming device 30 inputs a safety ladder program created by a user via an input device (not shown).

[0044] In step S32, the PLC programming device 30 transmits an instruction to execute the test execution mode to the safety PLC device 20 based on an input operation by the user via an input device (not shown).

[0045] In step S33, the PLC programming device 30 receives the results of the test execution in response to the execution instruction sent in step S32 from the safety PLC device 20, and displays the user interface screen of FIG. 3 showing the received results of the test execution on a display device (not shown).

[0046] In step S34, the PLC programming device 30 adjusts the timing adjustment information on the user interface screen displayed in step S33, and transmits to the safety PLC device 20 a setting instruction for setting the adjusted timing adjustment information.

[0047] In step S35, the PLC programming device 30 registers the safety ladder program input in step S31 in the safety PLC device 20.

[0048] FIG. 8 is a diagram showing an example of the operation of the PLCs 21a and 21b in the periodic execution mode when the execution time of the PLC 21a is adjusted. As shown in FIG. 8, the PLC 21a, whose CPU has a fast execution speed and whose execution time has been adjusted, has the maximum execution time allocated per cycle shortened by the timing adjustment information, and is adjusted to be completed in four cycles, like the PLC 21b.

[0049] As described above, the safety PLC device 20 of the first embodiment makes it possible to absorb the performance difference between the two PLCs 21a, 21b by setting parameters, for example, in the safety PLC device 20, without modifying the sequence program to eliminate the difference in execution speed, by having each of the PLCs 21a, 21b calculate timing adjustment information in the test execution mode, thereby reducing the burden on the user who designs the functional safety system 1. Furthermore, the safety PLC device 20 calculates the setting of parameters related to the PLC execution timing adjustment from the actual execution time, not from an estimate, so that it is possible to set highly accurate timing adjustment information. The first embodiment has been described above.

[0050] <Second embodiment> Next, a second embodiment will be described. In the first embodiment, the safety PLC device 20 adjusts the execution time of the PLC 21a. In contrast, in the second embodiment, the safety PLC device 20 adjusts the execution period of the PLC 21a, which is different from the first embodiment. As a result, the safety PLC device 20 of the second embodiment makes it possible to absorb the performance difference between the two PLCs 21a, 21b by, for example, setting parameters in the safety PLC device 20 without modifying the sequence program to eliminate the difference in execution speed, thereby reducing the burden on the user who designs the functional safety system. The second embodiment will be described below.

[0051] The safety function system 1 according to the second embodiment includes IO devices 10a and 10b, a safety PLC device 20, and a PLC programming device 30, similar to the first embodiment shown in FIG. The IO input / output devices 10a, 10b and the external device PLC programming device 30 have the same configurations as the IO input / output devices 10a, 10b and the PLC programming device 30 of the first embodiment. Further, the safety PLC device 20 according to the second embodiment includes a PLC 21a as a first PLC, a PLC 21b as a second PLC, and a communication unit 22, similarly to the first embodiment. The communication unit 22 has the same functions as the communication unit 22 in the first embodiment.

[0052] <PLC21a、21b> Fig. 9 is a block diagram showing the configuration of PLC 21a. Elements having the same functions as elements of PLC 21a in Fig. 2 are given the same reference numerals, and detailed description is omitted. The configuration of PLC 21b is similar to that of PLC 21a, and description is omitted. The difference between PLC 21a and PLC 21b is that the execution speed of PLC 21a as the first PLC is faster than the execution speed of PLC 21b as the second PLC, as in the first embodiment. 9, the PLC 21a includes a control unit 200a and a storage unit 230. The control unit 200a also includes a PLC execution unit 210 and an execution time adjustment unit 220a. The execution time adjustment unit 220a also includes a measurement unit 221, a timing adjustment information calculation unit 222a, a timing adjustment information setting unit 223, a switching unit 224, and a rewriting unit 225. The storage unit 230 also includes a signal state 231, timing adjustment information 232, a sequence program 233, and a program variable 234.

[0053] The PLC execution unit 210 has the same functions as the PLC execution unit 210 in the first embodiment. Moreover, the measurement unit 221, the timing adjustment information setting unit 223, the switching unit 224, and the rewriting unit 225 have the same functions as the measurement unit 221, the timing adjustment information setting unit 223, the switching unit 224, and the rewriting unit 225 in the first embodiment. Further, the signal state 231, the timing adjustment information 232, the sequence program 233, and the program variable 234 are the same as the signal state 231, the timing adjustment information 232, the sequence program 233, and the program variable 234 of the first embodiment.

[0054] Based on the time taken from the start to the end of the execution of the sequence program measured by the measurement unit 221, the timing adjustment information calculation unit 222a calculates timing adjustment information including the execution cycle in the cyclic execution mode of the sequence program in the PLC 21a. Specifically, the timing adjustment information calculation unit 222a obtains, via the bus 23, for example, in the same manner as the timing adjustment information calculation unit 222 of the first embodiment, the time T taken from the start to the end of the execution of the sequence program measured by the measurement unit 221 of the PLC 21b. m2 When the maximum execution time per cycle is Td, the timing adjustment information calculation unit 222a calculates the execution cycle P of the CPU of the control unit 200 of the PLC 21a cycle1 as the ceiling integer of T m2 / Td. The timing adjustment information calculation unit 222a transmits the calculated execution cycle P cycle1 including the timing adjustment information via the communication unit 22 to the PLC programming device 30. On the other hand, since the execution speed of the PLC 21b is slower than that of the PLC 21a, the timing adjustment information calculation unit 222a of the PLC 21b transmits the execution cycle of the set timing adjustment information 232 to the PLC programming device 30.

[0055] <Processing in the test execution mode of PLC21a> Next, with reference to FIG. 10, the processing flow in the test execution mode of the PLC 21a will be described. Note that the same processing as that of the PLC 21a is also executed for the PLC 21b. FIG. 10 is a flowchart for explaining the processing in the test execution mode of the PLC 21a. The flow shown here is executed each time the test execution mode is received from the PLC programming device 30. Note that the processes of steps S11 to S13 and step S15 are the same as those of steps S11 to S13 and step S15 in the first embodiment, and thus the description thereof is omitted.

[0056] In step S14a, the timing adjustment information calculation unit 222a calculates timing adjustment information including the execution cycle P of the PLC 21a in the cyclic execution mode of the sequence program based on the execution time T obtained in step S13. The timing adjustment information calculation unit 222a transmits the calculated timing adjustment information to the PLC programming device 30. m1 based on the execution time T obtained in step S13, calculates the execution cycle P of the PLC 21a in the cyclic execution mode of the sequence program cycle1 including the timing adjustment information. The timing adjustment information calculation unit 222a transmits the calculated timing adjustment information to the PLC programming device 30.

[0057] <Processing in the cyclic execution mode of PLC21a> Next, with reference to FIG. 11, the flow of the process in the cyclic execution mode of the PLC 21a will be described. Note that the same process as that of the PLC 21a is also executed for the PLC 21b. FIG. 11 is a flowchart for explaining the process in the cyclic execution mode of the PLC 21a. The flow shown here is executed for each scan of the PLC 21a. Note that the process of step S21 is the same as the process of step S21 in the first embodiment, and thus the description thereof is omitted.

[0058] In step S22a, the PLC execution unit 210 determines whether the execution of the sequence program has ended. If the execution of the sequence program has ended, the process proceeds to step S23a. On the other hand, if the execution of the sequence program has not ended, the process waits at step S22a.

[0059] In step S23a, the measurement unit 221 measures the elapsed time from the difference between the clock value output from the CPU built-in clock (not shown) and the clock value obtained in step S21, and the PLC execution unit 210 determines whether the measured elapsed time has exceeded the execution cycle P cycle1 has exceeded the execution cycle P cycle1If the elapsed time exceeds the execution period P, the execution period (scan) is terminated and the next execution period (scan) begins. cycle1 The process waits in step S23a if:

[0060] The adjustment and setting process (safety function setup mode) of the PLC programming device 30 is the same as that in FIG. 7, and a description thereof will be omitted. FIG. 12 is a diagram showing an example of the operation of the PLCs 21a and 21b in the periodic execution mode when the execution period of the PLC 21a is adjusted. As shown in FIG. 12, the PLC 21a, whose CPU has a fast execution speed and whose execution cycle has been adjusted, has its execution cycle fixed by timing adjustment information and is adjusted so that the program completes one scan from START to END in four cycles, just like the PLC 21b.

[0061] As described above, in the safety PLC device 20 of the second embodiment, the PLCs 21a, 21b each calculate timing adjustment information in the test execution mode, making it possible to absorb the performance difference between the two PLCs 21a, 21b by setting parameters, for example, in the safety PLC device 20 without modifying the sequence program to eliminate the difference in execution speed, thereby reducing the burden on the user who designs the functional safety system 1. Furthermore, the safety PLC device 20 calculates the setting of parameters related to the PLC execution timing adjustment from the actual execution time, not from an estimate, so that it is possible to set highly accurate timing adjustment information. The second embodiment has been described above.

[0062] Although the first and second embodiments have been described above, the safety PLC device 20 is not limited to the above-described embodiments, and includes modifications and improvements within the scope of achieving the object.

[0063] <Variation 1> In the first and second embodiments, the execution speed of the PLC 21a is faster than that of the PLC 21b, but this is not limiting. For example, the execution speed of the PLC 21b may be faster than that of the PLC 21a. In this case, the timing adjustment information calculation unit 222 of the PLC 21b calculates the execution time T cycle2 T m2 / T m1 ×Td. Also, the timing adjustment information calculation unit 222 of the PLC 21b may calculate the execution period P cycle2 T m1 The timing adjustment information calculation unit 222 may calculate the execution time T cycle2 and execution period P cycle2 The timing adjustment information including at least one of the above may be transmitted to the PLC programming device 30 via the communication unit 22. On the other hand, the timing adjustment information calculation unit 222 of the PLC 21a may transmit the execution time measured by the measurement unit 221 or the execution period set in the timing adjustment information 232 to the PLC programming device 30 as the timing adjustment information of the PLC 21a.

[0064] <Variation 2> Also, for example, in the first and second embodiments, the safety PLC device 20 adjusts the timing adjustment information of the PLC 21a or PLC 21b, which has a fast execution speed, but is not limited to this. For example, the safety PLC device 20 may adjust the execution time or execution period of the PLC 21a and the execution time or execution period of the PLC 21b to a predetermined execution time or a predetermined execution period that is set in advance.

[0065] <Modification 3> Also, for example, in the first and second embodiments, the PLCs 21a and 21b have the execution time adjustment unit 220 and the timing adjustment information 232, but are not limited to this. For example, only the PLC 21a or PLC 21b, which has a fast execution speed, i.e., whose timing adjustment information is adjusted, may have the execution time adjustment unit 220 and the timing adjustment information 232.

[0066] Each function included in the safety PLC device 20 in the first and second embodiments can be realized by hardware, software, or a combination of these. Here, being realized by software means being realized by a computer reading and executing a program.

[0067] All or part of the safety PLC device 20 of the first and second embodiments described above can be realized by hardware, software, or a combination of these. Here, "realized by software" means that it is realized by a computer reading and executing a program. When configured by hardware, all or part of the safety PLC device 20 can be configured by an integrated circuit (IC), such as an LSI (Large Scale Integrated circuit), an ASIC (Application Specific Integrated Circuit), a gate array, or an FPGA (Field Programmable Gate Array).

[0068] When all or part of the safety PLC device 20 is configured from software, it can be realized by storing the information necessary for calculation in the DRAM and running the program on the CPU in a computer configured with a memory unit such as a hard disk or ROM that stores a program describing all or part of the operation of the safety PLC device 20, a DRAM that stores data necessary for calculation, a CPU, and a bus connecting each unit.

[0069] The program can be stored and provided to the computer using various types of non-transitory computer readable media. The non-transitory computer readable media includes various types of tangible storage media. Examples of the non-transitory computer readable media include magnetic recording media (e.g., flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / Ws, and semiconductor memories (e.g., mask ROMs, PROMs (Programmable ROMs), EPROMs (Erasable PROMs), flash ROMs, and RAMs). The program may also be provided to the computer by various types of transitory computer readable media. Examples of the transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The transitory computer readable media can provide the program to the computer via wired communication paths such as electric wires and optical fibers, or wireless communication paths.

[0070] In addition, the steps of writing a program to be recorded on a recording medium include not only processes that are performed chronologically according to the order, but also processes that are not necessarily performed chronologically but are executed in parallel or individually.

[0071] In other words, the PLC device and storage medium of the present disclosure can take on a variety of embodiments having the following configurations.

[0072] (1) The safety PLC device 20 of the present disclosure includes a measurement unit 221 that causes the PLC execution units 210 of PLC 21a and PLC 21b in a PLC device including PLC 21a and PLC 21b to test execute a sequence program and measures the time taken from the start to the end of the sequence program in the PLC execution units 210 of PLC 21a and PLC 21b, a timing adjustment information calculation unit 222 that calculates timing adjustment information including at least one of an execution time and an execution period in the periodic execution of the sequence program in PLC 21a and PLC 21b based on the measurement time measured by the measurement unit 221, and a timing adjustment information setting unit 223 that sets the timing adjustment information calculated by the timing adjustment information calculation unit 222 to at least one of PLC 21a and PLC 21b. According to this safety PLC device 20, it is possible to absorb the performance difference between the two PLCs 21a, 21b by setting parameters, for example, in the safety PLC device 20 without modifying the sequence program to eliminate the difference in execution speed, thereby reducing the burden on the user who designs the functional safety system 1.

[0073] (2) The safety PLC device 20 described in (1) may include a switching unit 224 that switches between a test execution mode and a periodic execution mode using timing adjustment information. In this way, the safety PLC device 20 can achieve the same effect as (1).

[0074] (3) The safety PLC device 20 described in (1) or (2) may further include a communication unit 22 that transmits timing adjustment information of PLC 21a and PLC 21b calculated by the timing adjustment information calculation unit 222 to the PLC programming device 30 and receives a setting instruction for the transmitted timing adjustment information from the PLC programming device 30, and the timing adjustment information setting unit 223 may set the timing adjustment information for at least one of PLC 21a and PLC 21b based on the received setting instruction. In this way, the safety PLC device 20 can set parameters relating to PLC execution timing adjustment based on the actual execution time, not on an estimate, and therefore can set highly accurate timing adjustment information.

[0075] (4) The safety PLC device 20 described in (3) may further include a rewriting unit 225 that rewrites the sequence program, rewrites the signal state in the safety PLC device 20, or rewrites the program variables 234 based on instructions from the PLC programming device 30 via the communication unit 22 in order to reproduce a specified situation during test execution. In this way, the safety PLC device 20 can reproduce a specific situation in the test execution mode.

[0076] (5) The recording medium of the present disclosure is a computer-readable recording medium having recorded thereon a program for causing a computer including PLC 21a and PLC 21b to function as a measurement unit 221 that measures the time taken from the start to the end of a sequence program in the PLC execution units 210 of PLC 21a and PLC 21b during test execution in order to cause the PLC execution units 210 of PLC 21a and PLC 21b to test execute a sequence program, a timing adjustment information calculation unit 222 that calculates timing adjustment information including at least one of an execution time and an execution period in the periodic execution of the sequence program in PLC 21a and PLC 21b based on the measured measurement time, and a timing adjustment information setting unit 223 that sets the calculated timing adjustment information for at least one of PLC 21a and PLC 21b. This recording medium can provide the same effect as (1). [Explanation of symbols]

[0077] 1 Functional Safety System 10a, 10b IO input / output device 20 Safety PLC device 21a, 21b PLC 22 Communications Department 200, 200a Control section 210 PLC Execution Unit 220, 220a Execution time adjustment unit 221 Measurement Division 222, 222a Timing adjustment information calculation unit 223 Timing adjustment information setting unit 224 Switching section 225 Rewrite Department 230 Storage section 231 Signal Status 232 Timing Adjustment Information 233 Sequence Program 234 Program Variables 30 PLC programming device

Claims

1. a measurement unit configured to cause a PLC execution unit of each of the first PLC and the second PLC in a PLC device including the first PLC and the second PLC to test-execute a sequence program and to measure a time required from a start to an end of the sequence program in each of the PLC execution units of the first PLC and the second PLC; a timing adjustment information calculation unit that calculates timing adjustment information including at least one of an execution time and an execution period in periodic execution of the sequence program in the first PLC and the second PLC based on the measurement time measured by the measurement unit; a timing adjustment information setting unit that sets the timing adjustment information calculated by the timing adjustment information calculation unit to at least one of the first PLC and the second PLC; A PLC device comprising:

2. The PLC device according to claim 1 , further comprising a switching unit configured to switch between a mode in which the test is performed and a mode in which the periodic execution is performed to which the timing adjustment information is applied.

3. A communication unit that transmits the timing adjustment information of the first PLC and the second PLC calculated by the timing adjustment information calculation unit to an external device and receives a setting instruction for the transmitted timing adjustment information from the external device, 3. The PLC device according to claim 1, wherein the timing adjustment information setting unit sets the timing adjustment information for at least one of the first PLC and the second PLC based on the received setting instruction.

4. 4. The PLC device according to claim 3, further comprising a rewriting unit that rewrites the sequence program, rewrites a signal state in the PLC device, or rewrites a program variable based on an instruction from the external device via the communication unit in order to reproduce a predetermined situation during test execution.

5. A computer including a first PLC and a second PLC, the computer being configured to cause a PLC execution unit of each of the first PLC and the second PLC to test execute a sequence program, A measurement unit that measures a time taken from a start to an end of the sequence program in each of the PLC execution units of the first PLC and the second PLC during the test execution; a timing adjustment information calculation unit that calculates timing adjustment information including at least one of an execution time and an execution period in periodic execution of the sequence program in the first PLC and the second PLC based on the measured time; a timing adjustment information setting unit that sets the calculated timing adjustment information for at least one of the first PLC and the second PLC; A computer-readable recording medium having a program recorded thereon for causing the device to function as a computer.

Citation Information

Patent Citations

  • Simulation system and simulator and management server and recording medium

    JP2001282327A

  • Simulation system and simulator and managing device and recording medium

    JP2001282328A

  • Programmable controller, central processing unit unit, special function module and duplex processing method

    JP2004062872A

  • Data collection device and data collection system

    JP2004199670A

  • Switching scheme of PLC dual system, switching method of PLC dual system

    JP2019219894A