PLC device

The PLC device addresses inconsistencies in shared variables and common data types by using a reference determination unit and outputting a list with definition identifiers, preventing malfunctions and simplifying reference status understanding.

WO2026042169A1PCT designated stage Publication Date: 2026-02-26FANUC LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/029459
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2026-02-26

Smart Images

  • Figure JP2024029459_26022026_PF_FP_ABST
    Figure JP2024029459_26022026_PF_FP_ABST
Patent Text Reader

Abstract

A PLC device according to the present disclosure comprises: a reference determination part that determines the presence or absence of reference by a plurality of program modules to shared variables and / or common data types in scope units; and a reference state output part that outputs, on the basis of the determination of the presence or absence of the reference, a list of the shared variables and / or common data types in scope units that is referred to by each of the program modules.
Need to check novelty before this filing date? Find Prior Art

Description

PLC device

[0001] The present disclosure relates to PLC devices.

[0002] A PLC (Programmable Logic Controller) device controls industrial machinery by executing a sequence program (see, for example, Patent Document 1). A PLC can modularize sequence programs and manage them separately. A sequence program can define shared variables and commonly used data types and share them between program modules. The effective range of each shared variable and common data type can be defined as a scope.

[0003] Scopes can be defined hierarchically. For example, each program module can use variables shared within the scope that includes that program module (hereafter referred to as shared variables) and data types that can be used in common (hereafter referred to as common data types), as well as shared variables and common data types defined in the scope that includes that scope (parent scope). It is also possible to define new data types using data types defined in parent scopes.

[0004] JP 2024-023867 A

[0005] PLC devices load each program module as different binary data. Therefore, if shared variables or common data types are inconsistent between program modules, running them as is can lead to industrial machinery malfunctioning. When multiple scopes are used, the reference patterns for shared variables and common data types become complex, making it difficult to understand which program modules are referencing which scope's shared variables or common data types, or whether the reference definitions differ between program modules. In the field, there is a demand for technology that can easily understand the reference status of shared variables and common data types in multiple program modules.

[0006] The PLC device according to the present disclosure solves the above problem by outputting information related to at least one of the shared variables and the common data types referenced by each program module.

[0007] One aspect of the present disclosure is a PLC device that includes a reference determination unit that determines whether or not multiple program modules reference at least one of a shared variable and a common data type in a scope unit, and a reference status output unit that outputs a list of at least one of the shared variables and the common data type in a scope unit referenced by each program module based on the determination of whether or not the reference exists.

[0008] 1 is a schematic hardware configuration diagram of a PLC device according to an embodiment of the present disclosure; FIG. 1 is a block diagram showing the schematic functions of a PLC device according to a first embodiment; FIG. 2 is an explanatory diagram illustrating shared variables and common data types shared between program modules; FIG. 3 is a screen diagram showing an example of a list display of identification information of shared variables and common data types referenced by program modules; FIG. 4 is a block diagram showing the schematic functions of a PLC device according to a second embodiment; FIG. 5 is a screen diagram showing an example of a list display of shared variables and common data types displayed by a reference state display unit according to the second embodiment; FIG. 6 is a block diagram showing the schematic functions of a PLC device according to a third embodiment; FIG. 7 is a screen diagram showing an example of an output of a comparison result displayed by a comparison result output unit according to the third embodiment; FIG. 8 is a screen diagram showing an example of an output of differences in shared variables or common data types displayed by a comparison result output unit according to the third embodiment; FIG. 9 is a block diagram showing the schematic functions of a PLC device according to a fourth embodiment; FIG. 10 is a screen diagram showing an example of a list display of identification information of shared variables and common data types referenced by program modules before and after editing; FIG. 11 is a block diagram showing the schematic functions of a PLC device according to a fifth embodiment; FIG. 12 is a screen diagram showing an example of a list display of shared variables and common data types displayed by a reference state display unit according to the fifth embodiment; 13A and 13B are screen diagrams showing an example of an output of a matching result displayed by a matching result output unit according to the sixth embodiment, and an example of an output of differences between shared variables or common data types displayed by a matching result output unit according to the sixth embodiment.

[0009] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. In the following description, components having the same or similar functions will be denoted by the same reference numerals. Duplicate descriptions of those components may be omitted.

[0010] In this application, "based on XX" means "based on at least XX," and includes cases where it is based on other elements in addition to XX. Furthermore, "based on XX" is not limited to cases where XX is used directly, but also includes cases where it is based on XX that has been calculated or processed. "XX" is any element (for example, any information).

[0011] 1 is a schematic hardware configuration diagram showing a main part of a PLC device according to a first embodiment of the present disclosure. The PLC device 1 according to this embodiment may be, for example, a device that controls industrial machinery. Furthermore, the PLC device 1 may be connected to a control device that controls the industrial machinery via an interface or the like.

[0012] The CPU 11 included in the PLC device 1 according to this embodiment is a processor that controls the entire PLC device 1. The CPU 11 reads a system program stored in the ROM 12 via the bus 22 and controls the entire PLC device 1 in accordance with the system program. The RAM 13 temporarily stores temporary calculation data, display data, various data acquired from the outside, and the like.

[0013] The nonvolatile memory 14 is configured, for example, by a battery-backed memory (not shown) or an SSD (Solid State Drive), and maintains its stored state even when the power to the PLC device 1 is turned off. The nonvolatile memory 14 stores programs and data read from the external device 72 via the interface 15, sequence programs and data input via the input device 71, and sequence programs and data acquired from the control device 4 via the interface 20. The sequence programs and data stored in the nonvolatile memory 14 may be expanded into the RAM 13 when executed / used. In addition, various known system programs and the like are written in the ROM 12 in advance.

[0014] The interface 15 is an interface for connecting the CPU 11 of the PLC device 1 to an external device 72 such as a USB device. For example, system programs, setting data, etc. are read from the external device 72. In addition, programs and setting data created and edited within the PLC device 1 can be stored in external storage means via the external device 72.

[0015] The interface 20 is an interface for connecting the CPU 11 of the PLC device 1 and the control device 4. The control device 4 is connected to a fog computer 6, a cloud server 7, industrial machinery 8, etc. via a network 5. The network 5 may be one that communicates using technologies such as serial communication such as RS-485, Ethernet (registered trademark), optical communication, wireless LAN, Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.

[0016] The PLC device 1 executes a sequence program to output signals to industrial machines (not shown) controlled by the control device 4 and peripheral devices of the industrial machines (for example, tool changers, actuators such as robots, sensors attached to the industrial machines 3, etc.) via the I / O unit 21 to control them. The PLC device 1 also receives signals from various switches on an operation panel provided on the main body of the industrial machines and peripheral devices, and after performing the necessary signal processing, processes the signals in the CPU 11 according to the sequence program.

[0017] The display device 70 displays various data read into the memory, data obtained as a result of executing a sequence program, etc., output via the interface 17. An input device 71, which is comprised of a keyboard, pointing device, voice input device, etc., passes instructions, data, etc. based on operations by an operator to the CPU 11 via the interface 18.

[0018] 2 is a schematic block diagram illustrating functions of the PLC device 1 according to the first embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0019] The PLC device 1 of this embodiment includes a reading unit 100 , a reference determining unit 110 , and a reference state output unit 120 .

[0020] The reading unit 100 reads multiple programs 200 and deploys each of them as a program module 210 in the RAM 13. The reading unit 100 may read the program 200 stored in the RAM 13 or the non-volatile memory 14 in accordance with a user's operation. Alternatively, the reading unit 100 may read the program 200 from an external device 72. Furthermore, the reading unit 100 may read a program 200 managed by the control device 4. The program 200 may be, for example, a sequence program written in a programming language defined in JIS B 3503 or the like. The program 200 may include function blocks, functions, and subprograms. The program 200 defines shared variables and common data types that can be shared and used among the programs 200. In this disclosure, shared data, such as shared variables and common data types, that are shared among multiple program modules within the same scope are referred to as shared data. Shared data, including shared variables and common data types, can be used within the respective defined scopes. By loading the program 200, at least one program module 210, shared variables, and common data types are deployed in the RAM 13. The program modules 210 are binary data executable on the PLC device 1, and are expanded on the RAM 13 based on the contents of the program 200. Shared variables and common data types are shared between the respective program modules 210 within the range of the defined scope based on the definitions in the program 200.

[0021] FIG. 3 is an explanatory diagram illustrating shared variables and common data types shared between program modules. In the example of FIG. 3, program modules 211 and 212 are arranged in scope 241. Program modules 217 and 218 are arranged in scope 242. Scopes 241 and 242 are arranged in scope 240. As shown, the scopes have a hierarchical structure. Scopes 241 and 242 are arranged in the same hierarchy. Scope 240 can be considered the parent hierarchy of scopes 241 and 242, and conversely, scopes 241 and 242 can be considered the child hierarchy of scope 240. A variable 251, which is a shared variable, and a data type 252, which is a common data type, are defined in scope 241. A variable 253, which is a shared variable, and a data type 254, which is a common data type, are defined in scope 242. A variable 255, which is a shared variable, and a data type 256, which is a common data type, are defined in scope 240. With such definitions, each program module can use local variables and local data types defined within its own program module. It can also use shared variables and common data types defined within the scope in which it is located. On the other hand, it cannot use local variables and local data types defined in other program modules or shared variables and common data types outside the scope in which it is located. For example, program module 211 can use variable 213, which is a local variable, and data type 214, which is a local data type. It can also use variable 251, which is a shared variable, and data type 252, which is a common data type, defined in scope 241 in which it is located. It can also use variable 255, which is a shared variable, and data type 256, which is a common data type, defined in scope 240, which is the parent scope of the scope in which it is located.On the other hand, it is not possible to use variable 215, which is a local variable, and data type 216, which is a local data type, defined in another program module, or variable 253, which is a shared variable, and data type 254, which is a common data type, defined in scope 242, which is neither the scope in which it is placed nor the scope in the parent hierarchy of the scope in which it is placed. This is because, although scope 241 and scope 242 are placed in the same hierarchy, the effective ranges of each scope are different. Thus, depending on the scope in which program module 210 is placed, there are shared variables and common data types that can be used and shared variables and common data types that cannot be used.

[0022] The reference determination unit 110 determines which shared variables and common data types each program module references. The reference determination unit 110 references each program module and obtains information identifying shared variables and common data types used within the program modules. The reference determination unit 110 may use, for example, the name and data type of the shared variable as identification information for the shared variable. The reference determination unit 110 can determine that shared variables with the same name and the same data type are the same shared variable. Furthermore, for example, the name of the common data type and the names and data types of members included in the common data type may be used as identification information for the common data type. This allows the reference determination unit 110 to determine that common data types including the same name and the same members are the same common data type. The reference determination unit 110 outputs the identification information of the shared variables and the identification information of the common data type determined to be used within the program modules to the reference state output unit 120 as the determination results.

[0023] The reference state output unit 120 outputs a list of identification information of at least one of the shared variables and common data types that are determined to be referenced by each program module. For example, the reference state output unit 120 may display the list of identification information of the shared variables and common data types referenced by each program module on the display device 70.

[0024] FIG. 4 is a screen diagram showing an example of a list display by the reference state output unit 120 of identification information for shared variables and common data types referenced by program modules. In the example of FIG. 4, a list of identification information for shared variables and common data types referenced in program modules a to c is displayed. As illustrated in FIG. 4, the reference state output unit 120 may output the reference state on a scope-by-scope basis. In the example of FIG. 4, program module a references shared variable varS1 (SINT type) defined within scope 1-A. It can also be seen that program module b, like program module a, references shared variable varS1 (SINT type). Meanwhile, program module a and program module c each reference a common data type named TYPE1. However, while the common data type TYPE1 referenced by program module a includes mem1 (SINT type) and mem2 (SINT type) as its members, the common data type TYPE1 referenced by program module c includes mem1 (DINT type) and mem2 (DINT type) as its members. This means that although the names are the same, different common data types are referenced. In this way, by looking at the list of shared variables and common data types referenced by each program module output by the reference status output unit 120, it becomes easy to understand which program modules are referencing which shared variables and common data types of which scopes.

[0025] The PLC device 1 according to this embodiment, which has the above configuration, can prevent machine malfunctions caused by operation when shared variables or common data types do not match between program modules. Furthermore, even when multiple scopes are used and the reference patterns of shared variables and common data types are complex, it is possible to easily determine which program modules are referencing shared variables or common data types of which scopes. It is also possible to easily determine whether the shared variables and common data types referenced between program modules are the same or different.

[0026] Second Embodiment A PLC device according to a second embodiment of the present disclosure will be described below. The PLC device 1 according to this embodiment has the same hardware configuration as the PLC device 1 according to the first embodiment.

[0027] 5 is a schematic block diagram illustrating functions of the PLC device 1 according to the second embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0028] The PLC device 1 of this embodiment includes a reading unit 100, a reference determining unit 110, a reference state output unit 120, and further includes an identifier obtaining unit 130.

[0029] The reading unit 100 and the reference determination unit 110 according to this embodiment have the same functions as those according to the first embodiment. The identifier acquisition unit 130 acquires definition identifiers for at least one of the shared variables and common data types for each scope referenced by each program module. The definition identifiers are identifiers that can uniquely identify variables and data types defined or referenced within a program. The definition identifiers are generally generated by a predetermined system program when a program is compiled to generate a program module, or when the program 200 is loaded and the program modules, shared variables, and common data types are expanded on the RAM 13. The definition identifiers are hash values ​​such as MD5, CRC, and SHA1, and the same definition identifier is generated for the same variables and the same data types within the same scope. The identifier acquisition unit 130 references the program modules expanded in memory and acquires definition identifiers for each shared variable and common data type. The identifier acquisition unit 130 outputs the acquired definition identifiers to the reference state output unit 120.

[0030] The reference state output unit 120 according to this embodiment assigns the definition identifier acquired by the identifier acquisition unit 130 to a list of at least one of the shared variables and common data types referenced by each program module, and outputs the list.

[0031] FIG. 6 is a screen diagram illustrating an example of a list display of shared variables and common data types displayed by the reference status output unit 120 according to this embodiment. As illustrated in FIG. 6 , each shared variable and common data type is assigned a definition identifier. For example, the shared variable varS1 (SINT type) referenced by program module a is assigned the definition identifier "2f35f8c3" and output. The definition identifier is the same for the same variable and the same data type within the same scope. However, even variables and data types with similar names and types often have significantly different definition identifiers. For example, in FIG. 6 , the common data type TYPE2 referenced by program module a and the common data type TYPE2 referenced by program module c appear similar at first glance. However, the definition identifier for the common data type TYPE2 referenced by program module a is "eb993d32," while the definition identifier for the common data type TYPE2 referenced by program module c is "24146b4e," which are significantly different. Therefore, by comparing these definition identifiers, it is possible to more easily determine whether the shared variables are the same and have the same common data type, or whether the shared variables are different and have different common data types.

[0032] The PLC device 1 according to this embodiment, which has the above configuration, can prevent machine malfunctions caused by operation when shared variables or common data types do not match between program modules. Furthermore, even when multiple scopes are used and the reference patterns of shared variables and common data types are complex, it is possible to easily determine which program modules are referencing shared variables or common data types of which scopes. It is also possible to easily determine whether the shared variables and common data types referenced between program modules are the same or different.

[0033] Third Embodiment A PLC device according to a third embodiment of the present disclosure will be described below. The PLC device 1 according to this embodiment has the same hardware configuration as the PLC device 1 according to the first embodiment.

[0034] 7 is a schematic block diagram illustrating functions of the PLC device 1 according to the third embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0035] The PLC device 1 of this embodiment includes a reading unit 100, a reference determining unit 110, a reference state output unit 120, an identifier acquiring unit 130, and further includes a matching unit 140 and a matching result output unit 150.

[0036] The reading unit 100, reference determination unit 110, reference status output unit 120, and identifier acquisition unit 130 of this embodiment have the same functions as those of the second embodiment. The comparison unit 140 compares the definition identifiers of at least one of shared variables and common data types referenced by two or more program modules within the same scope. For example, the comparison unit 140 may compare between groups whether the definition identifiers of shared variables and common data types referenced in each program module match within the same scope. For example, if the definition identifier of a shared variable referenced by a program module does not exist in the list of definition identifiers of shared variables referenced by other program modules within the same scope, this is detected as a mismatch. Since each program module embeds all definition identifiers of shared variables and common data types within its respective scope, if a shared variable or common data type with a mismatched definition identifier is found during this comparison process, this indicates a mismatch between the program modules. The comparison result is then output to the comparison result output unit 150, indicating whether the definition identifiers match or mismatch.

[0037] As another matching method, the matching unit 140 may determine whether there are two or more program modules that use the same shared variable name in the same scope. If there are such program modules, the matching unit 140 may obtain the definition identifiers assigned to the shared variables in each program module and match them. This process may be performed for each shared variable and each common data type.

[0038] The matching result output unit 150 outputs a matching result indicating whether or not the definition identifiers of at least one of the shared variables and the common data type match, based on the result of the matching by the matching unit 140. The matching result output unit 150 may output the matching result together with the output by the reference state output unit 120. The matching result output unit 150 may output the matching result for each shared variable and each common data type. Furthermore, the matching result output unit 150 may further display differences between the shared variables and the common data types.

[0039] FIG. 8 is a screen diagram showing an example of the output of the matching result displayed by the matching result output unit 150 according to this embodiment. In the example of FIG. 8, the matching result is displayed together with a list of shared variables and common data types displayed by the reference state output unit 120. For example, the shared variable varS1 (SINT type) referenced by program module a and the shared variable varS1 (SINT type) referenced by program module b are assigned the same definition identifier, "2f35f8c3." Therefore, the matching result output unit 150 outputs a matching result of "match." In contrast, the common data type TYPE1 referenced by program module a and the common data type TYPE1 referenced by program module c have the same name but different definition identifiers. Therefore, the matching result output unit 150 outputs a matching result of "mismatch."

[0040] FIG. 9 is a screen diagram showing an example of the output of differences between shared variables or common data types displayed by the comparison result output unit 150. The example in FIG. 9 displays differences related to the common data type TYPE2 in the example in FIG. 8. To transition to such a screen, for example, an interface for displaying differences between the mismatched shared variables or common data types in the example in FIG. 8 (a button labeled "Show Differences" in the example in FIG. 8) can be provided, and the screen can be displayed when the user operates the interface. In FIG. 9, the common data type TYPE2 referenced by program modules a and b has mem1 (SINT type) and mem2 (SINT type) as members. On the other hand, the common data type TYPE2 referenced by program module c has mem1 (DINT type) and mem2 (SINT type) as members. As such, although the name TYPE2 is the same for both programs, the data type of member mem1 is different. Therefore, FIG. 9 displays a comparison so that this difference can be grasped. Any display method may be used as long as it allows the difference between the two to be clearly understood.

[0041] The PLC device 1 according to this embodiment, which has the above configuration, can prevent machine malfunctions caused by shared variables or common data types not matching between program modules. Since the results of comparing definition identifiers for shared variables and common data types referenced between program modules are also output, it is easy to determine whether the respective shared variables and common data types are the same or different.

[0042] As a modification of the PLC device 1 according to this embodiment, the comparison result output unit 150 may instruct each unit to stop the operation of a program module when there is a mismatch in the comparison results. By doing so, when there is a mismatch in the shared variables or common data types between the program modules, the operation of the program modules is stopped, thereby preventing malfunction of the program modules.

[0043] Fourth Embodiment A PLC device according to a fourth embodiment of the present disclosure will be described below. The PLC device 1 according to this embodiment has the same hardware configuration as the PLC device 1 according to the first embodiment.

[0044] 10 is a schematic block diagram illustrating functions of the PLC device 1 according to the fourth embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0045] The PLC device 1 of this embodiment includes an editing unit 160 in addition to the reading unit 100, the reference determination unit 110, and the reference state output unit 120. The RAM 13 to the nonvolatile memory 14 of the PLC device 1 are also provided with a shared data history storage unit 220, which is an area for storing information related to shared data before the program 200 is edited as a history.

[0046] The reading unit 100 and the reference determination unit 110 according to this embodiment have the same functions as those according to the first embodiment. The editing unit 160 according to this embodiment accepts an editing operation related to the program 200 by a user and edits the program 200. Note that this editing operation may edit a program module 210 loaded in memory, common variables, or shared data types. When editing the program 200, the editing unit 160 stores information related to the shared data, such as the shared variables and common data types before editing, as shared data history in the shared data history storage unit 220. This information related to the shared data may include the names and data types of the shared variables, information related to the names and members of the common data types, definition identifiers of the shared variables, definition identifiers of the common data types, etc.

[0047] The reference state output unit 120 according to this embodiment outputs a list of identification information for at least one of the shared variables and the common data type before and after editing for each program module. For example, when a program module is edited, the reference state output unit 120 may output a list of identification information for the shared variables and the common data type referenced by the program module and the identification information stored in the shared data history storage unit 220, and display this list on the display device 70.

[0048] FIG. 11 is a screen diagram showing an example in which the reference state output unit 120 according to this embodiment displays a list of identification information for the shared variables and common data types referenced by program modules before and after editing. In the example of FIG. 11, a list of identification information for the shared variables and common data types referenced by program module a before and after editing is displayed. In the example of FIG. 11, program module a before editing references the shared variable varS1 (SINT type) defined within Scope 1-A. On the other hand, it can be seen that program module a after editing references the shared variable varS1 (DINT type). Furthermore, program module a before and after editing each reference a common data type named TYPE2 within Scope 2-A. However, while the common data type TYPE2 referenced by program module a before editing includes mem1 (SINT type) and mem2 (SINT type) as its members, the common data type TYPE2 referenced by program module a after editing includes mem1 (DINT type) and mem2 (DINT type) as its members. This means that although the names are the same, different common data types are referenced. In this way, by looking at the list of shared variables and common data types referenced by program modules before and after editing output by the reference state output unit 120, it becomes easy to understand the scope of shared variables and common data types referenced by each program module before and after editing.

[0049] The PLC device 1 of this embodiment, which has the above configuration, can easily determine whether the shared variables and common data types referenced by program modules have changed before and after editing, and is therefore expected to contribute to preventing machine malfunctions caused by operation when the shared variables and common data types do not match between program modules.

[0050] Fifth Embodiment A PLC device according to a fifth embodiment of the present disclosure will be described below. The PLC device 1 according to this embodiment has the same hardware configuration as the PLC device 1 according to the first embodiment.

[0051] 12 is a schematic block diagram illustrating functions of the PLC device 1 according to the fifth embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0052] The PLC device 1 of this embodiment includes a reading unit 100, a reference determination unit 110, a reference state output unit 120, an identifier acquisition unit 130, and an editing unit 160. The RAM 13 to the nonvolatile memory 14 of the PLC device 1 are also provided with a shared data history storage unit 220, which is an area for storing information related to shared data before the program 200 is edited as a history.

[0053] The reading unit 100, the reference determining unit 110, and the editing unit 160 according to this embodiment have the same functions as those according to the fourth embodiment. The identifier obtaining unit 130 according to this embodiment has the same functions as those according to the second embodiment.

[0054] The reference state output unit 120 according to this embodiment assigns the definition identifier acquired by the identifier acquisition unit 130 to a list of at least one of the shared variables and common data types referenced by the program modules before and after editing, and outputs the list.

[0055] FIG. 13 is a screen diagram showing an example of a list display of shared variables and common data types displayed by the reference state output unit 120 according to this embodiment. As illustrated in FIG. 13, a definition identifier is assigned to each shared variable and common data type. For example, the shared variable varS1 (SINT type) referenced by program module a before editing is assigned the definition identifier "2f35f8c3" and output. On the other hand, the shared variable varS1 (DINT type) referenced by program module a after editing is assigned the definition identifier "e2fb97e5" and output. This makes it easier to determine whether each shared variable and common data type has been edited before and after editing by comparing the definition identifiers.

[0056] The PLC device 1 of this embodiment, which has the above configuration, can easily determine whether the shared variables and common data types referenced by program modules have changed before and after editing, and is therefore expected to contribute to preventing machine malfunctions caused by operation when the shared variables and common data types do not match between program modules.

[0057] Sixth Embodiment A PLC device according to a sixth embodiment of the present disclosure will be described below. The PLC device 1 according to this embodiment has the same hardware configuration as the PLC device 1 according to the first embodiment.

[0058] 14 is a schematic block diagram illustrating functions of the PLC device 1 according to the sixth embodiment of the present disclosure. Each function of the PLC device 1 according to this embodiment is realized by the CPU 11 included in the PLC device 1 shown in FIG. 1 executing a system program and controlling the operation of each part of the PLC device 1.

[0059] The PLC device 1 of this embodiment includes a reading unit 100, a reference determination unit 110, a reference state output unit 120, an identifier acquisition unit 130, a matching unit 140, a matching result output unit 150, and an editing unit 160. The RAM 13 to the nonvolatile memory 14 of the PLC device 1 are also provided with a shared data history storage unit 220, which is an area for storing information related to shared data before the program 200 is edited as a history.

[0060] The reading unit 100, the reference determination unit 110, the reference state output unit 120, and the editing unit 160 according to this embodiment have the same functions as those according to the fifth embodiment. The identifier acquisition unit 130 according to this embodiment has the same functions as those according to the second embodiment.

[0061] The collation unit 140 according to this embodiment compares the definition identifiers of at least one of the shared variables and common data types with the same name that are referenced by program modules before and after editing in the same scope range, and outputs information indicating whether the comparison results match or mismatch to the collation result output unit 150. This process may be performed for each shared variable and each common data type.

[0062] The matching result output unit 150 according to this embodiment outputs a matching result indicating whether or not the definition identifiers of at least one of the shared variables and the common data type match for the program modules before and after editing, based on the result of the matching by the matching unit 140. The matching result output unit 150 may output the matching result together with the output by the reference state output unit 120. The matching result output unit 150 may output the matching result for each shared variable and each common data type. Furthermore, the matching result output unit 150 may further display differences between the shared variables and the common data types.

[0063] FIG. 15 is a screen diagram showing an example of the output of the matching result displayed by the matching result output unit 150 according to this embodiment. In the example of FIG. 15, the matching result is displayed together with a list of shared variables and common data types displayed by the reference state output unit 120. For example, the shared variable varS1 (SINT type) referenced by the pre-editing program module a is assigned the definition identifier "2f35f8c3." Furthermore, the shared variable varS1 (DINT type) referenced by the edited program module a is assigned the definition identifier "e2fb97e5." Therefore, the matching result output unit 150 outputs a matching result of "mismatch." In contrast, the common data type TYPE1 referenced by the pre-editing program module a and the common data type TYPE1 referenced by the edited program module a are assigned the same definition identifier "580d10f1." Therefore, the matching result output unit 150 outputs a matching result of "match."

[0064] FIG. 16 is a screen diagram showing an example of the output of differences between shared variables or common data types displayed by the comparison result output unit 150. The example of FIG. 16 displays the differences related to the common data type TYPE2 in the example of FIG. 15. In FIG. 16, the common data type TYPE2 referenced by program module a before editing has mem1 (SINT type) and mem2 (SINT type) as members. On the other hand, the common data type TYPE2 referenced by program module a after editing has mem1 (DINT type) and mem2 (DINT type) as members. As such, although the name TYPE2 of both programs is the same, the data types of members mem1 and mem2 are different. Therefore, FIG. 16 displays a comparison so that this difference can be grasped. Any display method may be used as long as it clearly shows the differences between the two programs.

[0065] The PLC device 1 of this embodiment, which has the above configuration, can easily determine whether the shared variables and common data types referenced by program modules have changed before and after editing, and is therefore expected to contribute to preventing machine malfunctions caused by operation when the shared variables and common data types do not match between program modules.

[0066] As a modification of the PLC device 1 according to this embodiment, the comparison result output unit 150 may instruct each unit to stop the operation of a program module if there is a mismatch in the comparison results. By doing so, if there is a mismatch in the shared variables or common data types between the program modules, the operation of the program modules is stopped, which is expected to prevent malfunctions of the program modules. At this time, a message may be displayed asking the user whether there are any problems with the changed shared variables and common data types, and the operation of the program modules may be resumed when the user indicates that there are no problems.

[0067] Although the embodiments of the present disclosure have been described in detail above, the present disclosure is not limited to the individual embodiments described above. Various additions, substitutions, modifications, partial deletions, etc. are possible in these embodiments without departing from the gist of the invention or the idea and intent of the present disclosure derived from the content described in the claims and their equivalents. For example, in the above-described embodiments, the order of each operation and the order of each process are shown as examples and are not limited to these. The same applies when numerical values ​​or mathematical expressions are used in the description of the above-described embodiments.

[0068] The following are supplementary notes related to embodiments of the present disclosure: (Supplementary Note 1) A PLC device (1) according to one aspect of the present disclosure includes a reference determination unit (110) that determines whether or not a plurality of program modules (210) reference at least one of a shared variable and a common data type in a scope unit, and a reference status output unit (120) that outputs a list of at least one of the shared variables and the common data type in a scope unit referenced by each program module (210) based on the determination of the presence or absence of the reference.

[0069] (Supplementary Note 2) A PLC device (1) according to another aspect of the present disclosure further includes an identifier acquisition unit (130) that acquires definition identifiers of at least one of the shared variables and the common data type for each scope referenced by the program module (210), and the reference state output unit (120) assigns definition identifiers to a list of the shared variables or the common data type for each scope referenced by each program module and outputs the list. (Supplementary Note 3) A PLC device (1) according to another aspect of the present disclosure includes a comparison unit (140) that compares definition identifiers of at least one of the shared variables and the common data type referenced by multiple program modules in the same scope, and a comparison result output unit (150) that outputs a comparison result indicating whether or not the definition identifiers of at least one of the shared variables and the common data type match based on the result of the comparison.

[0070] (Supplementary Note 4) The definition identifier acquired by a PLC device (1) according to another aspect of the present disclosure is a hash value, and the comparison is determined based on whether the hash values ​​match. (Supplementary Note 5) A PLC device (1) according to another aspect of the present disclosure further includes a shared data history storage unit (220) that stores information related to shared variables and common data types in a program module before editing, and the reference state output unit (120) outputs a list of at least any of the shared variables and common data types for each scope referenced by the program modules before and after editing. (Supplementary Note 6) A PLC device (1) according to another aspect of the present disclosure further includes a shared data history storage unit (220) that stores information related to shared variables and common data types in a program module before editing, and the reference state output unit (120) assigns a definition identifier to a list of the shared variables or common data types for each scope referenced by the program modules before and after editing and outputs the list.

[0071] (Supplementary Note 7) A PLC device (1) according to another aspect of the present disclosure further includes a shared data history storage unit (220) that stores information related to shared variables and common data types in a program module before editing, wherein the comparison unit (140) compares definition identifiers of at least one of the shared variables and the common data type referenced by the program modules before and after editing within the same scope, and the comparison result output unit (150) outputs a comparison result indicating whether or not definition identifiers of at least one of the shared variables and the common data type match in the program modules before and after editing, based on the comparison result.

[0072] (Supplementary Note 8) A PLC device (1) according to another aspect of the present disclosure outputs differences in at least one of the shared variables or common data types for which a mismatch has been output by the comparison result output unit (150). (Supplementary Note 9) A PLC device (1) according to another aspect of the present disclosure stops a corresponding program module when a mismatch has been output by the comparison result output unit (150).

[0073] REFERENCE SIGNS LIST 1 PLC device 2 Interactive response device 4 Control device 5 Network 6 Fog computer 7 Cloud server 11 CPU 12 ROM 13 RAM 14 Non-volatile memory 15, 17, 18, 20 Interface 22 Bus 70 Display device 71 Input device 72 External device 100 Reading unit 110 Reference determination unit 120 Reference state output unit 130 Identifier acquisition unit 140 Matching unit 150 Matching result output unit 160 Editing unit 200 Program 210 Program module 220 Shared data history storage unit

Claims

1. A PLC device comprising: a reference determination unit that determines whether or not multiple program modules reference at least one of a shared variable and a common data type in a scope unit; and a reference status output unit that outputs a list of at least one of the shared variables and the common data type in a scope unit referenced by each program module based on the determination of whether or not the reference exists.

2. The PLC device of claim 1, further comprising an identifier acquisition unit that acquires definition identifiers of at least one of the shared variables and the common data types in the scope units referenced by the program modules, and the reference state output unit assigns definition identifiers to a list of the shared variables or the common data types in the scope units referenced by each program module and outputs the list.

3. The PLC device according to claim 2, comprising: a comparison unit that compares the definition identifiers of at least one of the shared variables and the common data type referenced by multiple program modules within the same scope; and a comparison result output unit that outputs a comparison result indicating whether or not the definition identifiers of at least one of the shared variables and the common data type match based on the result of the comparison.

4. The PLC device according to claim 3, wherein the definition identifier is a hash value, and the comparison is determined based on whether the hash values ​​match.

5. The PLC device according to claim 1, further comprising a shared data history memory unit that stores information relating to shared variables and common data types in a program module before editing, and wherein the reference state output unit outputs a list of at least one of the shared variables and common data types in scope units referenced by the program module before and after editing.

6. The PLC device according to claim 2, further comprising a shared data history storage unit that stores information relating to shared variables and common data types in a program module before editing, and the reference state output unit assigns definition identifiers to a list of the shared variables or common data types in scope units referenced by the program modules before and after editing and outputs the list.

7. A PLC device as described in claim 3, further comprising a shared data history memory unit that stores information related to shared variables and common data types in a program module before editing, wherein the comparison unit compares definition identifiers of at least one of the shared variables and common data types referenced by program modules before and after editing within the same scope, and the comparison result output unit outputs a comparison result indicating whether definition identifiers of at least one of the shared variables and common data types match in the program modules before and after editing based on the result of the comparison.

8. The PLC device according to claim 3, wherein the PLC device outputs a difference in at least one of the shared variables or common data types for which the comparison result output unit has output a mismatch.

9. The PLC device according to any one of claims 3, 4 and 7, wherein when the comparison result output unit outputs a mismatch, the corresponding program module is stopped.

Citation Information

Patent Citations

  • Methods and systems for processing references to variables in program code

    CN111158663A

  • File verification method

    JP1999194933A

  • Control program development support device for PLC

    JP2008276525A

  • Programmable controller system, support device thereof and programmable controller

    JP2015215865A

  • Control system, control device, terminal device, and program

    JP2020064399A