WO2021065033A1 - プログラム開発装置およびプログラム開発装置を実現するためのプログラム - Google Patents

プログラム開発装置およびプログラム開発装置を実現するためのプログラム Download PDF

Info

Publication number
WO2021065033A1
WO2021065033A1 PCT/JP2020/008950 JP2020008950W WO2021065033A1 WO 2021065033 A1 WO2021065033 A1 WO 2021065033A1 JP 2020008950 W JP2020008950 W JP 2020008950W WO 2021065033 A1 WO2021065033 A1 WO 2021065033A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
variable
variables
module
programs
Prior art date
Application number
PCT/JP2020/008950
Other languages
English (en)
French (fr)
Inventor
健 陣川
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Priority to CN202080067892.0A priority Critical patent/CN114556242A/zh
Priority to EP20872802.2A priority patent/EP4040242A4/en
Priority to US17/765,303 priority patent/US20220365864A1/en
Publication of WO2021065033A1 publication Critical patent/WO2021065033A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0426Programming the control sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3616Software analysis for verifying properties of programs using software metrics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Definitions

  • the present invention relates to a program development device and a program for realizing the program development device.
  • the control device Since the user program executed by the control device includes an instruction for referring to a signal (IO signal) exchanged with the field device group, the instruction for referring to the IO signal is appropriately modified when reusing. There is a need to.
  • Patent Document 1 Japanese Patent Application Laid-Open No. 4-205355
  • Patent Document 1 analyzes variable usage restriction information for common variables in a source program, accumulates the restriction information, and accumulates the restriction information.
  • Patent Document 1 merely focuses on common variables used in a source program, and can achieve the purpose of improving the design efficiency and reusability of a program in a control device such as a PLC. Can not.
  • One object of the present invention is to provide a new mechanism capable of improving the design efficiency and reusability of a user program executed by a control device.
  • a program development device for providing a development environment for a user program executed by a control device.
  • the program development device includes setting means for accepting the setting of attributes related to reference from the program for each of one or more variables used in the user program including the first and second programs having a calling relationship.
  • the set attribute includes a first attribute referred to by either the first or second program and a second attribute referred to by either the first or second program.
  • the program development device includes an evaluation means that analyzes the user program and evaluates the consistency based on the attributes of the reference from the set program for each of the variables.
  • the attributes of the variables referenced from the first and second programs in the calling relationship can be set in advance, and it can be ensured that the usage pattern conforms to the set attributes.
  • a highly reusable user program can be created.
  • the evaluation of consistency by the evaluation means may include whether or not the variable in which the first attribute is set is referenced by a program different from the program that is the reference source. According to this configuration, it is possible to prevent a variable that is defined to be referenced by a specific program from being referenced by another program.
  • the evaluation of consistency by the evaluation means may include whether or not the variable in which the second attribute is set is referred to by both the first and second programs. According to this configuration, it is possible to prevent variables that are defined to be referenced by a plurality of programs from being referenced only by some programs.
  • the program development device may further include a result presentation means for presenting the consistency evaluation result by the evaluation means. According to this configuration, the user can appropriately modify the user program or the like by referring to the consistency evaluation result.
  • the result presenting means may display the variables evaluated as not satisfying the consistency by the evaluation means in a manner different from other variables. With this configuration, variables that do not meet the consistency can be grasped at a glance.
  • the result presenting means may present which type of input or output each of the one or more variables is used in the user program. According to this configuration, it can be determined whether or not the variable is properly used for each usage type of the variable.
  • the variable for which the first attribute is set may be associated with a specific IO unit. According to this configuration, it is possible to set a variable that refers to the value of the IO unit.
  • the setting means may accept the setting of the program to be used for each of one or a plurality of variables. According to this configuration, appropriate attributes can be set simply by setting the program to be used without being aware of the difference in attributes.
  • Each of the first and second programs may be modularized, including the variables used and the attributes set for those variables. According to this configuration, reuse can be facilitated in modular units.
  • a program for realizing a program development device for providing a development environment for a user program executed by the control device causes the computer to perform a step of accepting the setting of attributes related to references from the program for each of the one or more variables used in the user program, including the first and second programs in a calling relationship.
  • the set attribute includes a first attribute referred to by either the first or second program and a second attribute referred to by either the first or second program.
  • the program causes the computer to perform a step of parsing the user program and evaluating for each of the variables one or more variables the attribute-based integrity of the reference from the program being set.
  • the attributes of the variables referenced from the first and second programs in the calling relationship can be set in advance, and it can be ensured that the usage pattern conforms to the set attributes.
  • a highly reusable user program can be created.
  • FIG. 7 It is a schematic diagram which shows an example of the data structure of the project created in the modularized programming according to this embodiment. It is a figure for demonstrating the handling of a variable in modular programming according to this embodiment. It is a schematic diagram which shows the whole structure example of the control system according to this embodiment. It is a block diagram which shows the hardware configuration example of the control device which comprises the control system according to this embodiment. It is a block diagram which shows the hardware configuration example of the program development apparatus which comprises the control system according to this embodiment. It is a flowchart which shows the whole processing procedure of modularized programming according to this embodiment. It is a figure which shows an example of the project created according to the modular programming according to this embodiment. It is a figure which shows the example which contains some errors in the project shown in FIG. 7.
  • Modular programming> First, an example of a situation in which the present invention is applied will be described. Specifically, modular programming according to the present embodiment will be outlined.
  • the term "modular programming" is used because programs and settings are defined as modules and are planned to be reused in module units, as will be described later.
  • the technical idea of the present invention is not applied only to modular programming, but can be applied to a user program including a plurality of programs.
  • POUs Program Organization Units
  • a POU corresponds to a unit of a group of program elements.
  • a calling relationship between POUs hereinafter, also referred to as "parent-child relationship" or "Parent-Child"
  • the parent-child relationship between the modules can be expressed, but the control device or control system acquires the input signal from the input device via the IO unit and follows the control calculation based on the acquired input signal. It controls the output device. Therefore, the number of IO signals is much larger than that of a general-purpose computer, and the global variables (indicating the value of IO signals) assigned to IO units can be accessed from POUs of any layer. ing. Therefore, an IO-program interface (IO-program I / F) that enables each program to access the global variables assigned to the IO unit is prepared.
  • IO-program I / F an IO-program interface
  • FIG. 1 is a schematic diagram showing an example of the data structure of the project created in the modular programming according to the present embodiment.
  • the project 50 includes the user program 52, the IO unit definition 54, the IO-program I / F56, and the interprogram I / F58 as elements.
  • IO-program I / F56 global variables indicating the IO signals exchanged by the IO unit are defined.
  • the variables set in the IO-program I / F56 are associated with a particular IO unit.
  • global variables that can be referred to by each program are defined in the interprogram I / F58.
  • modules are defined according to the characteristics of the controlled object. More specifically, project 50 includes equipment module 60 and process modules 62 and 66.
  • the process module 62 further includes in-process modules 63 and 64 corresponding to each function in the process.
  • Each module contains program elements belonging to each of a user program 52, an IO unit definition 54, an IO-program I / F56, and an interprogram I / F58. That is, each program included in the project 50 is modularized including the variables used and the attributes set for the variables.
  • the device module 60 includes a device program 53 for controlling a device included in the control target as a user program 52, and includes a global variable definition 59 as an interprogram I / F 58.
  • the global variable definition 59 includes definitions of available global variable names and data types of each global variable name (hereinafter, the same applies to other global variables and local variables).
  • local variable means a variable that can be referred only in the program that defines the local variable
  • global variable means a variable other than "local variable”.
  • global variable is a term that includes variables that can be referenced by one or more programs or IO units, and the modifier “global” should not be interpreted in a strict sense. ..
  • the process module 62 includes a program 531 for coordinating and overall controlling the functions of the process as a user program 52 and a local variable definition 539, and includes a global variable definition 59 as an interprogram I / F 58.
  • the in-process module 63 included in the process module 62 includes a function block 533 called from the function program 532 and the function program 532 as a user program 52, and includes a global variable definition 59 as an interprogram I / F 58. Further, the in-process module 63 includes the global variable definition 57 as the IO-program I / F56 and the IO unit setting 55 as the IO unit definition 54.
  • the in-process module 64 included in the process module 62 includes the function program 534 and the function block 535 called from the function program 534 as the user program 52, and also includes the global variable definition 59 as the interprogram I / F 58. .. Further, the in-process module 64 includes the global variable definition 57 as the IO-program I / F56 and the IO unit setting 55 as the IO unit definition 54.
  • the process module 66 includes a program 536 that controls the entire process as a user program 52, and includes a global variable definition 59 as an interprogram I / F 58.
  • the in-process module 67 included in the process module 66 includes the function program 537 and the function block 538 called from the function program 537 as the user program 52, and also includes the global variable definition 59 as the interprogram I / F 58. Further, the in-process module 67 includes the global variable definition 57 as the IO-program I / F56 and the IO unit setting 55 as the IO unit definition 54.
  • Variables included in the user program 52 that are referenced only by a specific program will exist as global variables of the IO-program I / F56, and variables that are mutually referenced between a plurality of programs are the variables of the interprogram I / F58. It will exist as a global variable. However, since there is no information related to such a difference in the handling of variables in the definition of variables in IEC61131-3, there is a possibility that proper handling cannot be performed at the design stage of the user program.
  • FIG. 2 is a diagram for explaining the handling of variables in modular programming according to the present embodiment.
  • the global variables belonging to the IO-program I / F56 are allowed to be referenced only by a specific program, and the global variables belonging to the interprogram I / F58 are allowed to be referred to by a plurality of programs. ..
  • the global variables belonging to the inter-program I / F58 are referenced by a plurality of target programs. That is, it can be determined that the program is inconsistent if it is not referenced by any of the plurality of target programs.
  • Control system configuration example> Next, a configuration example of the control system 1 in which the user program created by the program development device 200 according to the present embodiment is executed will be described.
  • FIG. 3 is a schematic diagram showing an overall configuration example of the control system 1 according to the present embodiment.
  • the control system 1 includes one or more control devices 100.
  • FIG. 3 illustrates the control system 1 including the two control devices 100, the configuration may include one control device 100.
  • Each of the control devices 100 executes a control calculation for controlling the control target, and also executes an abnormality detection process for detecting any abnormality that may occur in the monitoring target included in the control target.
  • the control device 100 may be embodied as a kind of computer such as a PLC (programmable controller).
  • the control device 100 is connected to the field device group 10 via the field bus 2. Further, the control devices 100 are connected to each other via the local network 4. A program development device 200 may be connected to the control device 100.
  • EtherCAT registered trademark
  • networks that perform such constant-period communication.
  • the control device 100 collects data (hereinafter, also referred to as “input value”) acquired by the field device group 10 and transferred to the control device 100.
  • the field device group 10 includes a device that collects a state value of a controlled object or a manufacturing device or a production line related to control (hereinafter, also collectively referred to as a “field”) as an input value.
  • state value is a term including a value that can be observed by an arbitrary control target (including: monitoring target), and is, for example, a physical value that can be measured by an arbitrary sensor, a relay, a switch, or the like. It may include an ON / OFF state, a command value such as a position, a speed, and a torque given to the servo driver by the PLC, and a variable value used by the PLC for calculation.
  • the field device group 10 further includes a device that gives some action to the field based on a command value (hereinafter, also referred to as “output value”) generated by the control device 100.
  • a command value hereinafter, also referred to as “output value”
  • an output relay, a contactor, a servo driver and a servo motor, and any other actuator are assumed.
  • These field device groups 10 exchange data including input values and output values with and from the control device 100 via the field bus 2.
  • the field device group 10 includes a remote IO (Input / Output) device 12, a relay group 14, an image sensor 18, a camera 20, a servo driver 22, and a servo motor 24.
  • IO Input / Output
  • relay group 14 an image sensor 18, a camera 20, a servo driver 22, and a servo motor 24.
  • the remote IO device 12 includes a communication unit that communicates via the fieldbus 2 and an input / output unit (hereinafter, also referred to as “IO unit”) for collecting input values and outputting output values. Input values and output values are exchanged between the control device 100 and the field via such an IO unit.
  • FIG. 3 shows an example in which digital signals are exchanged as input values and output values via the relay group 14.
  • the IO unit may be directly connected to the fieldbus.
  • FIG. 3 shows an example in which the IO unit 16 is directly connected to the fieldbus 2.
  • the image sensor 18 performs image measurement processing such as pattern matching on the image data captured by the camera 20, and transmits the processing result to the control device 100.
  • the servo driver 22 drives the servomotor 24 according to an output value (for example, a position command) from the control device 100.
  • the program development device 200 provides a development environment for a user program executed by the control device 100.
  • the user operates the program development device 200 to create a user program to be executed by the control device 100.
  • the program development device 200 sets the development environment (program creation / editing tool, parser, compiler, etc.) of the user program executed by the control device 100, the control device 100, and various devices connected to the control device 100. It provides a function for determining parameters (configuration), a function for transmitting a created user program to the control device 100, a function for modifying / changing a user program executed on the control device 100, and the like online.
  • the program development device 200 can not only improve the reusability in the user program executed by the single control device 100, but also between the user programs executed by the plurality of control devices 100, respectively. It is also possible to improve the reusability in.
  • FIG. 4 is a block diagram showing a hardware configuration example of the control device 100 constituting the control system 1 according to the present embodiment.
  • the control device 100 includes a processor 102 such as a CPU (Central Processing Unit) and an MPU (Micro-Processing Unit), a chip set 104, a main storage device 106, a secondary storage device 108, and the like. It includes a local network controller 110, a USB (Universal Serial Bus) controller 112, a memory card interface 114, a field bus controller 120, an internal bus controller 122, and IO units 124-1, 124-2, ....
  • a processor 102 such as a CPU (Central Processing Unit) and an MPU (Micro-Processing Unit)
  • a chip set 104 such as a main storage device 106, a secondary storage device 108, and the like.
  • It includes a local network controller 110, a USB (Universal Serial Bus) controller 112, a memory card interface 114, a field bus controller 120, an internal
  • the processor 102 reads various programs stored in the secondary storage device 108, expands them in the main storage device 106, and executes them to realize control according to the control target and various processes as described later. ..
  • the chipset 104 together with the processor 102, controls each component to realize the processing of the control device 100 as a whole.
  • an execution format user program 126 (corresponding to a control program) created by the program development device 200 is stored.
  • the local network controller 110 controls the exchange of data with other devices via the local network 4.
  • the USB controller 112 controls the exchange of data with the program development device 200 via the USB connection.
  • the memory card interface 114 is configured so that the memory card 116 can be attached and detached, data can be written to the memory card 116, and various data (user programs, trace data, etc.) can be read from the memory card 116. There is.
  • the fieldbus controller 120 controls the exchange of data with other devices via the fieldbus 2.
  • the internal bus controller 122 is an interface for exchanging data with the IO units 124-1, 124-2, ... Mounted on the control device 100.
  • FIG. 4 shows a configuration example in which the necessary functions are provided by the processor 102 executing the program code, and some or all of these provided functions are provided by a dedicated hardware circuit (for example,). It may be implemented using ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array). Alternatively, the main part of the control device 100 may be realized by using hardware that follows a general-purpose architecture (for example, an industrial personal computer based on a general-purpose personal computer).
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • FIG. 5 is a block diagram showing a hardware configuration example of the program development device 200 constituting the control system 1 according to the present embodiment.
  • the program development device 200 may be realized by executing a program using hardware (for example, a general-purpose personal computer) that follows a general-purpose architecture.
  • the program development device 200 includes a processor 202 such as a CPU and an MPU, a drive 204, a main storage device 206, a secondary storage device 208, a USB controller 212, a local network controller 214, and the like.
  • the input unit 216 and the display unit 218 are included. These components are connected via bus 220.
  • the processor 202 realizes various processes as described later by reading various programs stored in the secondary storage device 208, expanding them in the main storage device 206, and executing the programs.
  • the secondary storage device 208 is composed of, for example, an HDD (Hard Disk Drive) or an SSD (Solid State Drive).
  • the secondary storage device 208 stores a development tool 250 for realizing various functions as described later.
  • the secondary storage device 208 may store the OS and other necessary system programs.
  • the drive 204 can write data to the storage medium 205 and read various data (user programs and various data) from the storage medium 205.
  • the storage medium 205 includes, for example, a storage medium 205 (for example, an optical storage medium such as a DVD (Digital Versatile Disc)) that non-transiently stores a computer-readable program.
  • the development tool 250 executed by the program development device 200 may be installed via a computer-readable storage medium 205, or may be installed by downloading from a server device or the like on the network. Further, the function provided by the program development device 200 according to the present embodiment may be realized by using a part of the module provided by the OS.
  • the USB controller 212 controls the exchange of data with the control device 100 via the USB connection.
  • the local network controller 214 controls the exchange of data with other devices via an arbitrary network.
  • the input unit 216 is composed of a keyboard, a mouse, and the like, and accepts user operations.
  • the display unit 218 is composed of a display, various indicators, and the like, and outputs a processing result from the processor 202 and the like.
  • a printer may be connected to the program development device 200.
  • FIG. 5 shows a configuration example in which the processor 202 provides the necessary functions by executing the program code, and some or all of these provided functions are provided by a dedicated hardware circuit (for example,). It may be implemented using ASIC or FPGA).
  • FIG. 6 is a flowchart showing an overall processing procedure of modular programming according to the present embodiment.
  • the user operates the program development device 200 to define variables to be used in the user program to be created (step S2). Then, the user operates the program development device 200 to create a user program (step S4).
  • steps S2 and S4 are iteratively executed until the creation of the user program is completed (NO in step S6).
  • step S6 When the creation of the user program is completed (YES in step S6), the user executes the consistency evaluation for the created user program (step S8). If the consistency is not satisfied (NO in step S10), the user reviews the user program and variable definitions (step S12). Then, the user executes the process of step S8 or less again.
  • step S10 If the consistency is satisfied (YES in step S10), the user builds the created user program and transfers it to the control device 100 (step S14). Then, the process of creating the user program is completed.
  • FIG. 7 is a diagram showing an example of a project 50 created according to modular programming according to the present embodiment.
  • the project 50 shown in FIG. 7 includes two modules (parent module 70 (Parent) and child module 80 (Child)) in a calling relationship (parent-child relationship).
  • the parent module 70 includes an instruction to start the child module 80 in response to an input signal from the input unit A.
  • the child module 80 includes a command to receive an activation command from the parent module 70, execute a process, and then output the process result to an output unit.
  • the user program includes a plurality of programs in a calling relationship.
  • variable "InA_Bit00" indicating the input signal of the input unit A is defined in the IO program inter-program I / F 58 of the parent module 70
  • the input of the input unit B is defined in the inter-program I / F 58 of the child module 80.
  • a variable "InB_Bit00” indicating a signal and a variable "OutC_Bit00” indicating an output signal of the output unit are defined.
  • FIG. 8 is a diagram showing an example in which the project 50 shown in FIG. 7 contains some errors. In the project 50 shown in FIG. 8, it is assumed that the project 50 shown in FIG. 7 should be originally created, but includes the following two errors.
  • the instruction 71 that refers to the variable "Child_ACK” should be included in the program, but the description is omitted.
  • the variable "Child_ACK” specified in the interprogram I / F58 is not referenced ((1) is not referenced).
  • variable "InA_Bit00" of the input unit A defined in the IO-program I / F56 should be referenced only from the parent module 70, but includes an instruction 81 referenced from the child module 80.
  • the variable "InA_Bit00" defined in the IO-program I / F56 is referred to by a module different from the original module ((2) Reference from outside the definition).
  • the project 50 shown in FIG. 8 does not comply with the rules regarding IO-program I / F56 and inter-program I / F58.
  • Modular programming according to this embodiment can evaluate consistency with such rules regarding IO-program I / F56 and interprogram I / F58.
  • FIG. 9 is a diagram showing an example of a global variable definition 90 used in modular programming according to the present embodiment.
  • the global variable definition 90 shown in FIG. 9 may be created by the user-defined operation shown in step S2 shown in FIG. That is, the program development device 200 executes a process of accepting the setting of the attribute related to the reference from the program for each of the variables used in the user program including the plurality of programs (parent module 70 and child module 80) having a calling relationship. To do.
  • the global variable definition 90 includes a variable definition unit 93 including a variable name 91 that specifies the variable name of each global variable and a data type 92 that defines the corresponding data type, and each global variable and IO unit. It includes an IO unit allocation definition unit 94 showing a correspondence relationship with the above, and a reference module unit 96 that defines a reference destination module.
  • the global variable definition 90 may further include a comment unit 95 for storing a comment (arbitrary) for each global variable.
  • each global variable is IO according to the setting of such a reference source program (that is, the presence / absence of a module specified in the reference module section 96 in association with each global variable and the number of modules). -Whether it belongs to the program I / F56 or the interprogram I / F58 is determined.
  • the program development device 200 sets attributes (or rules) related to reference from the program for each of one or a plurality of variables used in a user program including a plurality of programs having a calling relationship. Accept. Variables belonging to IO-program I / F56 have the attribute of being referenced by any one program. Further, the variable belonging to the interprogram I / F58 has an attribute that it is referred to by any of a plurality of related programs.
  • the program development device 200 analyzes the user program, and for each of the variables included in the user program, belongs to either the attribute (IO-program I / F56 or interprogram I / F58) related to the reference from the set program. Evaluate the consistency based on (?). As an example of the consistency evaluation of the user program based on the global variable definition 90, a process of analyzing the variable usage status for each module will be described.
  • FIG. 10 is a flowchart showing a processing procedure of consistency evaluation in modularized programming according to the present embodiment.
  • Each step shown in FIG. 10 is typically realized by the processor 202 of the program development apparatus 200 executing the development tool 250.
  • the development tool 250 is a program for realizing a program development device 200 for providing a development environment for a user program executed by the control device 100.
  • the program development device 200 analyzes the user program and executes a process as described below for evaluating the consistency of each of the variables based on the attributes related to the reference from the set program. ..
  • the program development apparatus 200 extracts the module name to be analyzed with reference to the global variable definition 90 shown in FIG. 9 (step S100).
  • the program development device 200 sets a program having any of the extracted module names as a search target (step S102).
  • the program development device 200 reads one line of the program set as the search target (step S104), and determines whether or not any variable is used (step S106). If any variable is used (YES in step S106), the variable name, the place of use, the type of input / output, the purpose, etc. of the variable used are extracted (step S108). Each of the extracted information is output as the variable usage status for each module (see FIG. 11 described later). If no variable is used (NO in step S106), the process of step S108 is skipped.
  • the program development device 200 determines whether or not the last line of the program to be searched has been reached (step S110). If the last line of the program to be searched has not been reached (NO in step S110), the program development device 200 reads the next line of the program set to be searched (step S112), and processes in step S106 and thereafter. Is executed again.
  • step S110 the program development device 200 determines whether or not the search process has been completed for all the programs having the extracted module names (YES in step S110). Step S114). If there is a program having the extracted module name whose search process is incomplete (NO in step S114), the program development device 200 sets the program whose search process is incomplete as a new search target (step S116). .. Then, the program development device 200 re-executes the processes of step S102 and subsequent steps.
  • step S114 If the search process is completed for all the programs having the extracted module names (YES in step S114), the program development device 200 executes the process of step S120 or less.
  • FIG. 11 is a diagram showing an example of the variable usage status 350 for each module generated by the consistency evaluation process shown in FIG. With reference to FIG. 11, the variable usage status 350 for each module includes a list of global variables used in the program included in the target module.
  • variable usage status 350 for each module includes a module name 351 indicating a module in which the corresponding variable is used, a variable name 352 of the variable used, and a usage location 353 of the corresponding variable. It includes an input / output type 354 of the corresponding variable, a use 355 of the corresponding variable, and an undefined use 356 that stores a flag indicating that the corresponding variable is used in a module other than the one in which it is defined.
  • the usage location of the corresponding variable is specified by using the step number of the corresponding program or the like.
  • the input / output type 354 indicates whether the corresponding variable is used as a contact (input variable) or the corresponding variable is used as a coil (output variable).
  • step S108 of FIG. 10 the same variable may be extracted a plurality of times from the same program, but the same variable extracted a plurality of times is merged and the variable usage status for each module is 350. The same variable is not registered twice for the same program. Further, among the variables extracted in step S108 of FIG. 10, those for which the corresponding module name does not exist may be deleted.
  • variable usage status 350 for each module as shown in FIG. 11 is referred to, and the process of step S120 or less shown in FIG. 10 is executed.
  • the program development apparatus 200 deletes the variables included in the global variable definition 90 (FIG. 9) for which the corresponding referenced module (reference module section 96) is not specified.
  • Generate a target global variable definition 90A consisting of only variables to be evaluated for consistency step S120).
  • FIG. 12 is a diagram showing an example of the target global variable definition 90A generated in the modular programming according to the present embodiment.
  • the target global variable definition 90A includes only the global variable associated with the reference module.
  • a flag for evaluating the presence / absence of use can be set for each module that refers to each global variable (reference module unit 97).
  • the program development device 200 reads the first entry of the variable usage status 350 (FIG. 11) for each module (step S122), and uses the variable name 352 of the read entry as a key to define the target global variable.
  • An entry having the same variable name 91 included in 90A is searched (step S124). Then, in the searched entry of the target global variable definition 90A, a flag (reference module portion 97 in FIG. 12) indicating that the module name is the same as the module name 351 of the read entry is set (step S126). ).
  • the program development device 200 determines whether or not the read module name 351 is included in the reference module unit 97 in the entry of the target global variable definition 90A corresponding to the variable name 352 of the read entry (step). S128). If the read module name 351 is not included in the reference module unit 97 (NO in step S128), the program development device 200 indicates that the read entry is used by an undefined module (NO). Undefined use 356) in FIG. 11 is set (step S130). On the other hand, if the read module name 351 is included in the reference module unit 97 (YES in step S128), the program development device 200 skips the process of step S130.
  • the consistency evaluation includes determination of whether or not the variable belonging to the IO-program I / F56 is referenced by a program different from the program to which the reference source is used.
  • the program development device 200 determines whether or not the processing is completed up to the last entry of the variable usage status 350 for each module (step S132). If the process is not completed up to the last entry of the variable usage status 350 for each module (NO in step S132), the program development device 200 reads the next entry of the variable usage status 350 for each module (FIG. 11) (step). S134), the process of step S124 and the like is executed again.
  • the program development apparatus 200 sets the variable for which the flag is not set in the reference module portion 97 of the target global variable definition 90A. It is extracted as an unused variable (step S136), and the result of the consistency evaluation is displayed based on the variable usage status 350 for each module and the target global variable definition 90A (step S138).
  • the consistency evaluation includes a determination as to whether or not the variables belonging to the inter-program I / F 58 are referred to by any of the associated programs.
  • the consistency evaluation process is completed.
  • a process for making some modification to the user program may be executed.
  • the program development device 200 has a function of presenting the result of the consistency evaluation as described above.
  • FIG. 13 is a schematic diagram showing an example of the result of the consistency evaluation provided by the program development device 200 according to the present embodiment.
  • the result display screen 300 shows the consistency evaluation result of the variable usage status for each module based on the variable usage status 350 for each module (FIG. 11).
  • the result display screen 300 includes a used variable list 310 indicating variables that are appropriately used and an unused variable list 320 that indicates unused variables.
  • the variable list 310 uses the module name 311 indicating the target module, the variable name 312 indicating the target variable, the data type 313 indicating the data type of the target variable, and the correspondence between the target variable and the IO unit. It includes an IO unit allocation 314 shown, a comment 315 (optional) about the variable of interest, a use 316 of the variable of interest, and an evaluation result 317 showing the result of consistency evaluation for the subject.
  • the unused variable list 320 includes a module name 321 indicating the target module, a variable name 322 indicating the target variable, a data type 323 indicating the data type of the target variable, and a target variable and an IO unit. It includes an IO unit allocation 324 showing the correspondence between the above, a comment 325 (optional) about the target variable, a usage 326 of the target variable, and an evaluation result 327 showing the result of the consistency evaluation for the target. Since the target variable is unused, valid values cannot be set for IO unit allocation 324 and usage 326.
  • FIG. 14 is a schematic diagram showing another result example of the consistency evaluation provided by the program development apparatus 200 according to the present embodiment.
  • the result display screen 330 shows the consistency evaluation result of the usage status for each variable based on the target global variable definition 90A (FIG. 12).
  • the result display screen 330 includes a variable list 340 corresponding to the target global variable definition 90A (FIG. 12).
  • the variable list 340 used includes a variable name 341 indicating the target variable, a data type 342 indicating the data type of the target variable, an IO unit allocation 343 indicating the correspondence between the target variable and the IO unit, and the target variable. 344 (optional), a module-by-module usage state 345 indicating the usage state of the target variable in the module, and an evaluation result 348 indicating the result of the consistency evaluation for the target.
  • the usage state 345 for each module includes a definition 346 indicating whether or not the usage is defined in each module and a usage 347 indicating whether or not the usage is actually used in each module.
  • Definition 346 displays an evaluation mark if the use of the variable of interest is defined in the corresponding module.
  • use 347 information indicating in what form the target variable in the corresponding module is used is displayed.
  • the program development device 200 presents which type (input / output) of input or output each variable is used in the user program.
  • the program development device 200 displays the variables evaluated as not satisfying the consistency in the consistency evaluation in a mode different from other variables.
  • FIG. 15 is a diagram showing an example of an inter-module interface in modular programming according to a modified example of the present embodiment.
  • a parent-child relationship is set in which two child modules 80A and 80B (Child) are called from the parent module 70 (Parent).
  • Child modules 80A and 80B Choild
  • parent module 70 Parent module 70
  • Child module 80B the relationship between the parent module 70 and the child module 80B
  • the relationship between the child module 80A and the child module 80B can exist.
  • the information on the parent-child relationship between modules may be used to evaluate the consistency of whether or not a variable as an interface between modules exists other than between parent and child.
  • IF_Parent_Child1 is defined as the inter-module interface between the parent module 70 and the child module 80A
  • IF_Parent_Child 2 is defined as the inter-module interface between the parent module 70 and the child module 80B
  • IF_Child1_Child2 can be specified as an inter-module interface between the child module 80A and the child module 80B.
  • Whether or not to specify a relationship other than the parent-child relationship between modules may depend on the user's module design rules. In this case, the user may arbitrarily select (that is, enable / disable switching) whether or not to specify a relationship other than the parent-child relationship between the modules.
  • a setting means (90; S2) for accepting the setting of the attribute related to the reference from the program is provided, and the setting is provided.
  • the attributes to be referred to are the first attribute (56) referred to by either the first or second program and the second attribute (56) referred to by either the first or second program.
  • a program development apparatus comprising an evaluation means (S100 to S138) for analyzing the user program and evaluating consistency based on attributes related to a reference from a set program for each of the one or a plurality of variables.
  • the program development according to the configuration 1 includes whether or not the evaluation of consistency by the evaluation means is referred to by a program different from the program referred to as the reference source for the variable in which the first attribute is set. apparatus.
  • the evaluation of consistency by the evaluation means according to the configuration 1 or 2 including whether or not the variable in which the second attribute is set is referred to by either the first or second program. Program development equipment.
  • the step (S2) of accepting the setting of the attribute related to the reference from the program is executed, and the set attribute is the first and the first and the above.
  • the program comprises a first attribute (56) referenced by either one of the second programs and a second attribute (58) referenced by both the first and second programs.
  • a program development device that causes a computer to analyze the user program and perform steps (S100 to S138) for evaluating the consistency based on the attributes related to the reference from the set program for each of the one or a plurality of variables.

Abstract

制御装置で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置が提供される。プログラム開発装置は、呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付ける設定手段を含む。当該設定される属性は、第1および第2のプログラムのいずれか一方から参照される第1の属性と、第1および第2のプログラムのいずれからも参照される第2の属性とを含む。プログラム開発装置は、ユーザプログラムを解析して、1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価する評価手段を含む。

Description

プログラム開発装置およびプログラム開発装置を実現するためのプログラム
 本発明は、プログラム開発装置およびプログラム開発装置を実現するためのプログラムに関する。
 FA(Factory Automation)の根幹をなすPLC(プログラマブルロジックコントローラ)などの制御装置の高機能化に伴って、ユーザプログラムと称されるアプリケーションプログラムも大規模化している。プログラムの大規模化にともなって、プログラムの設計効率および再利用性を高めたいというニーズもある。
 制御装置で実行されるユーザプログラムは、フィールド装置群との間で遣り取りされる信号(IO信号)を参照する命令を含むため、再利用にあたっては、IO信号を参照するための命令などを適宜修正する必要がある。
 例えば、特開平4-205355号公報(特許文献1)は、制御装置に向けられたものではないが、ソースプログラムにおける共通変数に対する変数使用制限情報を解析し、その制限情報を蓄積し、その蓄積された制限情報を参照しながらソースプログラム中の変数の使用を検査することにより、ソースプログラムの段階で共通変数に対する誤った使用を発見する技術を開示する。
特開平4-205355号公報
 上述の特許文献1に開示される技術は、ソースプログラムで使用される共通変数に着目するにすぎず、PLCなどの制御装置においてプログラムの設計効率および再利用性を高めるという目的を達成することはできない。
 本発明の一つの目的は、制御装置で実行されるユーザプログラムの設計効率および再利用性を向上させることのできる新たな仕組みを提供することである。
 本発明のある実施の形態によれば、制御装置で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置が提供される。プログラム開発装置は、呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付ける設定手段を含む。当該設定される属性は、第1および第2のプログラムのいずれか一方から参照される第1の属性と、第1および第2のプログラムのいずれからも参照される第2の属性とを含む。プログラム開発装置は、ユーザプログラムを解析して、1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価する評価手段を含む。
 この構成によれば、呼び出し関係にある第1および第2のプログラムからそれぞれ参照される変数の属性を予め設定し、その設定された属性に適合した使用形態になっていることを確保できる。それによって、再利用性の高いユーザプログラムを作成できる。
 評価手段による整合性の評価は、第1の属性が設定されている変数が参照元とされているプログラムとは異なるプログラムから参照されているか否かを含んでいてもよい。この構成によれば、特定のプログラムから参照されることが定められた変数が別のプログラムから参照されることを防止できる。
 評価手段による整合性の評価は、第2の属性が設定されている変数が第1および第2のプログラムのいずれからも参照されているか否かを含んでいてもよい。この構成によれば、複数のプログラムから参照されることが定められた変数が一部のプログラムからのみ参照されることを防止できる。
 プログラム開発装置は、評価手段による整合性の評価結果を提示する結果提示手段をさらに含んでいてもよい。この構成によれば、ユーザは、整合性の評価結果を参照して、ユーザプログラムなどを適切に修正できる。
 結果提示手段は、評価手段により整合性を満たしていないと評価された変数を他の変数とは異なる態様で表示してもよい。この構成によれば、整合性を満たしていない変数を一見して把握できる。
 結果提示手段は、1または複数の変数の各々が入力および出力のいずれの種別でユーザプログラムにおいて使用されているのかを提示するようにしてもよい。この構成によれば、変数の使用種別毎に適切に使用されているか否かを判断できる。
 第1の属性が設定される変数は、特定のIOユニットと対応付けられてもよい。この構成によれば、IOユニットの値を参照する変数に適した設定が可能となる。
 設定手段は、1または複数の変数の各々について、使用されるプログラムの設定を受け付けてもよい。この構成によれば、属性の違いを意識することなく、使用されるプログラムを設定するだけで、適切な属性を設定できる。
 第1および第2のプログラムの各々は、使用される変数および当該変数に対して設定される属性を含めて、モジュール化されていてもよい。この構成によれば、モジュール化された単位で再利用を容易化できる。
 本発明の別の実施の形態によれば、制御装置で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置を実現するためのプログラムが提供される。プログラムはコンピュータに、呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付けるステップを実行させる。当該設定される属性は、第1および第2のプログラムのいずれか一方から参照される第1の属性と、第1および第2のプログラムのいずれからも参照される第2の属性とを含む。プログラムはコンピュータに、ユーザプログラムを解析して、1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価するステップを実行させる。
 この構成によれば、呼び出し関係にある第1および第2のプログラムからそれぞれ参照される変数の属性を予め設定し、その設定された属性に適合した使用形態になっていることを確保できる。それによって、再利用性の高いユーザプログラムを作成できる。
 本発明によれば、制御装置で実行されるユーザプログラムの設計効率および再利用性を向上させることのできる新たな仕組みを実現できる。
本実施の形態に従うモジュール化プログラミングにおいて作成されるプロジェクトのデータ構造の一例を示す模式図である。 本実施の形態に従うモジュール化プログラミングにおける変数の取り扱いを説明するための図である。 本実施の形態に従う制御システムの全体構成例を示す模式図である。 本実施の形態に従う制御システムを構成する制御装置のハードウェア構成例を示すブロック図である。 本実施の形態に従う制御システムを構成するプログラム開発装置のハードウェア構成例を示すブロック図である。 本実施の形態に従うモジュール化プログラミングの全体処理手順を示すフローチャートである。 本実施の形態に従うモジュール化プログラミングに従って作成されるプロジェクトの一例を示す図である。 図7に示すプロジェクトにいくつかの誤りが含まれる例を示す図である。 本実施の形態に従うモジュール化プログラミングにおいて使用されるグローバル変数定義の一例を示す図である。 本実施の形態に従うモジュール化プログラミングにおける整合性評価の処理手順を示すフローチャートである。 図10に示す整合性評価の処理によって生成されるモジュール毎変数使用状況の一例を示す図である。 本実施の形態に従うモジュール化プログラミングにおいて生成される対象グローバル変数定義の一例を示す図である。 本実施の形態に従うプログラム開発装置が提供する整合性評価の結果例を示す模式図である。 本実施の形態に従うプログラム開発装置が提供する整合性評価の別の結果例を示す模式図である。 本実施の形態の変形例に従うモジュール化プログラミングにおけるモジュール間インターフェイスの一例を示す図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。
 <A.適用例:モジュール化プログラミング>
 まず、本発明が適用される場面の一例について説明する。具体的には、本実施の形態に従うモジュール化プログラミングについて概略する。なお、「モジュール化プログラミング」との用語は、後述するように、プログラムおよび設定がモジュールとして規定されており、モジュール単位で再利用することが予定されているためである。但し、本発明の技術思想は、モジュール化プログラミングだけに適用されるものではなく、複数のプログラムを含むユーザプログラムに適用可能である。
 国際電気標準会議(IEC:International Electrotechnical Commission)が定めたIEC61131-3においては、プログラムやプロジェクトを構成するブロックは、POU(Program Organization Units)と称される。POUは、プログラム要素のまとまりの単位に相当する。ユーザプログラム内においては、あるPOUから別のPOUを呼び出すといった、POU間の呼び出し関係(以下、「親子関係」あるいは「Parent-Child」などとも称す。)を規定できる。
 POUをモジュールの単位とすることで、モジュール間の親子関係は表現できるが、制御装置あるいは制御システムは、IOユニットを介して入力機器から入力信号を取得し、取得した入力信号に基づく制御演算に従って出力機器を制御するものである。そのため、IO信号の数は、汎用的なコンピュータに比較してずっと多く、また、IOユニットに割り当てられるグローバル変数(IO信号の値を示す)は、いずれの階層のPOUからもアクセスできるようになっている。そのため、各プログラムからIOユニットに割り当てられるグローバル変数へのアクセスを可能にするIO-プログラムインターフェイス(IO-プログラムI/F)が用意される。
 また、POU間のインターフェイスについても、厳格な呼び出し関係だけを許容する(すなわち、各POUが管理する入力変数および出力変数だけで呼び出し関係を規定する)プログラム構造を採用した場合には、プログラムの再利用性が低下するため、各POUがアクセス可能なグローバル変数を規定するモジュール間のインターフェイス(プログラム間インターフェイス(プログラム間I/F))が用意される。
 図1は、本実施の形態に従うモジュール化プログラミングにおいて作成されるプロジェクトのデータ構造の一例を示す模式図である。図1を参照して、プロジェクト50は、要素として、ユーザプログラム52と、IOユニット定義54と、IO-プログラムI/F56と、プログラム間I/F58とを含む。
 一般的に、IO-プログラムI/F56には、IOユニットが遣り取りするIO信号を示すグローバル変数が定義される。典型的には、IO-プログラムI/F56に設定される変数は、特定のIOユニットと対応付けられる。一方、プログラム間I/F58には、各プログラムが参照可能なグローバル変数が定義される。
 図1に示すプロジェクト50においては、制御対象の特性に応じたモジュールが規定されている。より具体的には、プロジェクト50は、装置モジュール60と、工程モジュール62および66とを含む。工程モジュール62は、さらに工程内の各機能に対応する工程内モジュール63および64を含む。各モジュールは、ユーザプログラム52、IOユニット定義54、IO-プログラムI/F56、および、プログラム間I/F58の各々に属するプログラム要素を含む。すなわち、プロジェクト50に含まれる各プログラムは、使用される変数および当該変数に対して設定される属性を含めて、モジュール化されている。
 より具体的には、装置モジュール60は、ユーザプログラム52として、制御対象に含まれる装置を制御するための装置プログラム53を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。グローバル変数定義59は、使用可能なグローバル変数名の定義および各グローバル変数名のデータ型の定義を含む(以下、他のグローバル変数およびローカル変数についても同様である。)。
 なお、本明細書において、「ローカル変数」は当該ローカル変数を定義するプログラム内でのみ参照可能な変数を意味し、「グローバル変数」は「ローカル変数」以外の変数を意味する。以下の説明において「グローバル変数」は、1または複数のプログラムあるいはIOユニットからの参照が可能な変数を包含するような用語であり、「グローバル」という修飾語を厳密な意味に解釈すべきではない。
 工程モジュール62は、ユーザプログラム52として、工程の機能を協調および全体制御するプログラム531およびローカル変数定義539を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。
 工程モジュール62に含まれる工程内モジュール63は、ユーザプログラム52として、機能プログラム532および機能プログラム532から呼び出されるファンクションブロック533を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。さらに、工程内モジュール63は、IO-プログラムI/F56として、グローバル変数定義57を含むとともに、IOユニット定義54として、IOユニット設定55を含む。
 同様に、工程モジュール62に含まれる工程内モジュール64は、ユーザプログラム52として、機能プログラム534および機能プログラム534から呼び出されるファンクションブロック535を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。さらに、工程内モジュール64は、IO-プログラムI/F56として、グローバル変数定義57を含むとともに、IOユニット定義54として、IOユニット設定55を含む。
 工程モジュール66は、ユーザプログラム52として、工程の全体制御するプログラム536を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。
 工程モジュール66に含まれる工程内モジュール67は、ユーザプログラム52として、機能プログラム537および機能プログラム537から呼び出されるファンクションブロック538を含むとともに、プログラム間I/F58として、グローバル変数定義59を含む。さらに、工程内モジュール67は、IO-プログラムI/F56として、グローバル変数定義57を含むとともに、IOユニット定義54として、IOユニット設定55を含む。
 なお、グローバル変数定義57および59については、後述の図9などを参照されたい。
 例えば、図1に示すプロジェクト50に含まれる特定のモジュール(特定の工程についてのプログラム、変数定義およびIO定義)を再利用する場合を想定すると、ユーザプログラム52に含まれるプログラムだけではなく、IOユニット定義54、IO-プログラムI/F56およびプログラム間I/F58に含まれる要素も再利用の際に考慮しなければならない。
 ユーザプログラム52に含まれる特定のプログラムだけが参照する変数は、IO-プログラムI/F56のグローバル変数として存在することになり、複数のプログラム間で相互参照される変数は、プログラム間I/F58のグローバル変数として存在することになる。しかしながら、IEC61131-3における変数の定義には、このような変数の取り扱いの相違に係る情報が存在しないため、ユーザプログラムの設計段階において、適切な取り扱いができない可能性がある。
 そこで、本実施の形態に従うモジュール化プログラミングにおいては、変数に対して、特定のプログラムのみが参照する、および、複数のプログラム間で参照する、のいずれかの属性(あるいは規則)を設定することができるとともに、当該設定された属性に基づく整合性を評価できるようになっている。なお、これらの属性とは異なる属性を変数に設定できるようにしてもよい。
 図2は、本実施の形態に従うモジュール化プログラミングにおける変数の取り扱いを説明するための図である。図2を参照して、IO-プログラムI/F56に属するグローバル変数は、特定のプログラムからのみ参照が許可され、プログラム間I/F58に属するグローバル変数は、複数のプログラムからの参照が許可される。
 本実施の形態に従うモジュール化プログラミングにおいては、各グローバル変数がいずれの属性であるのかが予め設定されており、この設定された属性に整合するか否かが評価される。
 さらに、プログラム間I/F58に属するグローバル変数は、対象の複数のプログラムから参照していることを要求することもできる。すなわち、対象となる複数のプログラムのうちいずれかのプログラムから参照されていないことを不整合であると判定することもできる。
 このような変数に対する属性の設定および整合性評価を行うことで、ユーザプログラムの設計効率および再利用性を向上させることのできる新たな仕組みを実現できる。
 <B.制御システム構成例>
 次に、本実施の形態に従うプログラム開発装置200によって作成されるユーザプログラムが実行される制御システム1の構成例について説明する。
 図3は、本実施の形態に従う制御システム1の全体構成例を示す模式図である。図3を参照して、制御システム1は、1または複数の制御装置100を含む。なお、図3には、2つの制御装置100を含む制御システム1を例示するが、1つの制御装置100からなる構成であってもよい。
 制御装置100の各々は、制御対象に対する制御を行うための制御演算を実行するとともに、制御対象に含まれる監視対象に生じ得る何らかの異常を検知するための異常検知処理を実行する。制御装置100は、PLC(プログラマブルコントローラ)などの、一種のコンピュータとして具現化されてもよい。
 制御装置100は、フィールドバス2を介してフィールド装置群10と接続されている。さらに、制御装置100同士は、ローカルネットワーク4を介して互いに接続されている。制御装置100には、プログラム開発装置200が接続されることもある。
 フィールドバス2としては、データの到達時間が保証される、定周期通信を行うネットワークを採用することが好ましい。このような定周期通信を行うネットワークとしては、EtherCAT(登録商標)などが知られている。
 制御装置100は、フィールド装置群10にて取得され、制御装置100へ転送されるデータ(以下、「入力値」とも称す。)を収集する。フィールド装置群10は、制御対象または制御に関連する製造装置や生産ラインなど(以下、「フィールド」とも総称する。)の状態値を入力値として収集する装置を含む。
 本明細書において、「状態値」は、任意の制御対象(含む:監視対象)にて観測できる値を包含する用語であり、例えば、任意のセンサにより測定できる物理値や、リレーやスイッチなどのON/OFF状態、PLCがサーボドライバに与える位置、速度、トルクなどの指令値、PLCが演算に用いる変数値などを含み得る。
 このような状態値を収集する装置としては、入力リレーや各種センサなどが想定される。フィールド装置群10は、さらに、制御装置100にて生成される指令値(以下、「出力値」とも称す。)に基づいて、フィールドに対して何らかの作用を与える装置を含む。このようなフィールドに対して何らかの作用を与える装置としては、出力リレー、コンタクタ、サーボドライバおよびサーボモータ、その他任意のアクチュエータが想定される。これらのフィールド装置群10は、フィールドバス2を介して、制御装置100との間で、入力値および出力値を含むデータを遣り取りする。
 図3に示す構成例においては、フィールド装置群10は、リモートIO(Input/Output)装置12と、リレー群14と、画像センサ18およびカメラ20と、サーボドライバ22およびサーボモータ24とを含む。
 リモートIO装置12は、フィールドバス2を介して通信を行う通信部と、入力値の収集および出力値の出力を行うための入出力部(以下、「IOユニット」とも称す。)とを含む。このようなIOユニットを介して、制御装置100とフィールドとの間で入力値および出力値が遣り取りされる。図3には、リレー群14を介して、入力値および出力値として、デジタル信号が遣り取りされる例が示されている。
 IOユニットは、フィールドバスに直接接続されるようにしてもよい。図3には、フィールドバス2にIOユニット16が直接接続されている例を示す。
 画像センサ18は、カメラ20によって撮像された画像データに対して、パターンマッチングなどの画像計測処理を行って、その処理結果を制御装置100へ送信する。
 サーボドライバ22は、制御装置100からの出力値(例えば、位置指令など)に従って、サーボモータ24を駆動する。
 プログラム開発装置200は、制御装置100で実行されるユーザプログラムの開発環境を提供する。ユーザは、プログラム開発装置200を操作して、制御装置100で実行されるユーザプログラムを作成する。具体的には、プログラム開発装置200は、制御装置100で実行されるユーザプログラムの開発環境(プログラム作成編集ツール、パーサ、コンパイラなど)、制御装置100および制御装置100に接続される各種デバイスの設定パラメータ(コンフィギュレーション)を決定するための機能、作成したユーザプログラムを制御装置100へ送信する機能、制御装置100上で実行されるユーザプログラムなどをオンラインで修正・変更する機能、などを提供する。
 本実施の形態に従うプログラム開発装置200は、単一の制御装置100で実行されるユーザプログラム内での再利用性を高めることができるだけではなく、複数の制御装置100でそれぞれ実行されるユーザプログラム間での再利用性も高めることができる。
 <C.ハードウェア構成例>
 次に、本実施の形態に従う制御システム1を構成する制御装置100およびプログラム開発装置200のハードウェア構成例について説明する。
 (c1:制御装置100のハードウェア構成例)
 図4は、本実施の形態に従う制御システム1を構成する制御装置100のハードウェア構成例を示すブロック図である。図4を参照して、制御装置100は、CPU(Central Processing Unit)やMPU(Micro-Processing Unit)などのプロセッサ102と、チップセット104と、主記憶装置106と、二次記憶装置108と、ローカルネットワークコントローラ110と、USB(Universal Serial Bus)コントローラ112と、メモリカードインターフェイス114と、フィールドバスコントローラ120と、内部バスコントローラ122と、IOユニット124-1,124-2,…とを含む。
 プロセッサ102は、二次記憶装置108に格納された各種プログラムを読み出して、主記憶装置106に展開して実行することで、制御対象に応じた制御、および、後述するような各種処理を実現する。チップセット104は、プロセッサ102とともに、各コンポーネントを制御することで、制御装置100全体としての処理を実現する。
 二次記憶装置108には、図示しないシステムプログラムに加えて、プログラム開発装置200において作成された実行形式のユーザプログラム126(制御プログラムに相当)が格納される。
 ローカルネットワークコントローラ110は、ローカルネットワーク4を介した他の装置との間のデータの遣り取りを制御する。USBコントローラ112は、USB接続を介してプログラム開発装置200との間のデータの遣り取りを制御する。
 メモリカードインターフェイス114は、メモリカード116を着脱可能に構成されており、メモリカード116に対してデータを書き込み、メモリカード116から各種データ(ユーザプログラムやトレースデータなど)を読み出すことが可能になっている。
 フィールドバスコントローラ120は、フィールドバス2を介した他の装置との間のデータの遣り取りを制御する。内部バスコントローラ122は、制御装置100に搭載されるIOユニット124-1,124-2,…との間でデータを遣り取りするインターフェイスである。
 図4には、プロセッサ102がプログラムコードを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASIC(Application Specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)など)を用いて実装してもよい。あるいは、制御装置100の主要部を、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコンをベースとした産業用パソコン)を用いて実現してもよい。
 (c2:プログラム開発装置200のハードウェア構成例)
 図5は、本実施の形態に従う制御システム1を構成するプログラム開発装置200のハードウェア構成例を示すブロック図である。プログラム開発装置200は、一例として、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコン)を用いてプログラムを実行することで実現されてもよい。
 図5を参照して、プログラム開発装置200は、CPUやMPUなどのプロセッサ202と、ドライブ204と、主記憶装置206と、二次記憶装置208と、USBコントローラ212と、ローカルネットワークコントローラ214と、入力部216と、表示部218とを含む。これらのコンポーネントはバス220を介して接続される。
 プロセッサ202は、二次記憶装置208に格納された各種プログラムを読み出して、主記憶装置206に展開して実行することで、後述するような各種処理を実現する。
 二次記憶装置208は、例えば、HDD(Hard Disk Drive)やSSD(Solid State Drive)などで構成される。二次記憶装置208には、後述するような各種機能を実現するための開発ツール250が格納される。二次記憶装置208には、OSおよび他の必要なシステムプログラムが格納されていてもよい。
 ドライブ204は、記憶媒体205に対してデータを書き込み、記憶媒体205から各種データ(ユーザプログラムおよび各種データ)を読み出すことが可能になっている。記憶媒体205は、例えばコンピュータ読取可能なプログラムを非一過的に格納する記憶媒体205(例えば、DVD(Digital Versatile Disc)などの光学記憶媒体)を含む。
 プログラム開発装置200で実行される開発ツール250は、コンピュータ読取可能な記憶媒体205を介してインストールされてもよいが、ネットワーク上のサーバ装置などからダウンロードする形でインストールするようにしてもよい。また、本実施の形態に従うプログラム開発装置200が提供する機能は、OSが提供するモジュールの一部を使用する形で実現される場合もある。
 USBコントローラ212は、USB接続を介して制御装置100との間のデータの遣り取りを制御する。ローカルネットワークコントローラ214は、任意ネットワークを介した他の装置との間のデータの遣り取りを制御する。
 入力部216は、キーボードやマウスなどで構成され、ユーザ操作を受け付ける。表示部218は、ディスプレイ、各種インジケータなどで構成され、プロセッサ202からの処理結果などを出力する。プログラム開発装置200には、プリンタが接続されてもよい。
 図5には、プロセッサ202がプログラムコードを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASICまたはFPGAなど)を用いて実装してもよい。
 <D.ユーザプログラミングの設計および整合性評価>
 次に、本実施の形態に従うモジュール化プログラミングに従うユーザプログラムの設計例および整合性評価について説明する。
 (d1:全体処理手順)
 図6は、本実施の形態に従うモジュール化プログラミングの全体処理手順を示すフローチャートである。図6を参照して、ユーザは、プログラム開発装置200を操作して、作成予定のユーザプログラムで使用する予定の変数を定義する(ステップS2)。そして、ユーザは、プログラム開発装置200を操作して、ユーザプログラムを作成する(ステップS4)。
 ユーザプログラムの作成が完了するまで(ステップS6においてNO)、ステップS2およびS4の処理は反復的に実行される。
 ユーザプログラムの作成が完了すると(ステップS6においてYES)、ユーザは、作成したユーザプログラムに対して整合性評価を実行する(ステップS8)。整合性を満たしていない場合(ステップS10においてNO)には、ユーザは、ユーザプログラムおよび変数の定義を見直す(ステップS12)。そして、ユーザは、ステップS8以下の処理を再度実行する。
 整合性を満たしている場合(ステップS10においてYES)には、ユーザは、作成したユーザプログラムをビルドして制御装置100へ転送する(ステップS14)。そして、ユーザプログラムの作成処理は完了する。
 (d2:プロジェクト50の設計例)
 図7は、本実施の形態に従うモジュール化プログラミングに従って作成されるプロジェクト50の一例を示す図である。図7に示すプロジェクト50は、呼び出し関係(親子関係)にある2つのモジュール(親モジュール70(Parent)および子モジュール80(Child))を含む。親モジュール70は、入力ユニットAからの入力信号を受け、子モジュール80を起動する命令を含む。子モジュール80は、親モジュール70からの起動指令を受け、処理を実行した後、その処理結果を出力ユニットに出力する命令を含む。このように、ユーザプログラムは、呼び出し関係にある複数のプログラムを含む。
 プログラム間I/F58には、親モジュール70および子モジュール80のいずれからも参照可能な2つの変数「Child_REQ」および「Child_ACK」が規定されている。これらの変数は、親モジュール70から子モジュール80への起動および終了のために受け渡し72,82に用いられる。
 また、親モジュール70のIOプログラム間I/F58には、入力ユニットAの入力信号を示す変数「InA_Bit00」が規定されており、子モジュール80のプログラム間I/F58には、入力ユニットBの入力信号を示す変数「InB_Bit00」、および、出力ユニットの出力信号を示す変数「OutC_Bit00」が規定されている。
 図8は、図7に示すプロジェクト50にいくつかの誤りが含まれる例を示す図である。図8に示すプロジェクト50においては、本来図7に示すプロジェクト50を作成すべきであるところ、以下の2つの誤りを含むものと仮定する。
 親モジュール70において、変数「Child_ACK」を参照する命令71をプログラムに含めるべきであるが、記載が漏れている。この結果、プログラム間I/F58に規定された変数「Child_ACK」が参照されていない((1)参照されず)。
 また、IO-プログラムI/F56に規定された、入力ユニットAの変数「InA_Bit00」は、親モジュール70からのみ参照されるべきであるが、子モジュール80から参照する命令81を含む。この結果、IO-プログラムI/F56に規定された変数「InA_Bit00」が本来のモジュールとは異なるモジュールから参照されることになる((2)定義外からの参照)。
 このように、図8に示すプロジェクト50は、IO-プログラムI/F56およびプログラム間I/F58についての規則を遵守できていない。
 本実施の形態に従うモジュール化プログラミングは、このようなIO-プログラムI/F56およびプログラム間I/F58に関する規則への整合性を評価できる。
 このような変数に対する属性の設定および整合性評価を行うことで、ユーザプログラムの設計効率および再利用性を向上させることのできる新たな仕組みを実現できる。
 (d3:グローバル変数定義90)
 図9は、本実施の形態に従うモジュール化プログラミングにおいて使用されるグローバル変数定義90の一例を示す図である。図9に示されるグローバル変数定義90は、図6に示すステップS2に示すユーザによる定義の操作によって作成されてもよい。すなわち、プログラム開発装置200は、呼び出し関係にある複数のプログラム(親モジュール70および子モジュール80)を含むユーザプログラムにおいて使用される変数の各々について、プログラムからの参照に関する属性の設定を受け付ける処理を実行する。
 図9を参照して、グローバル変数定義90は、各グローバル変数の変数名を指定する変数名91および対応するデータ型を定義するデータ型92を含む変数定義部93と、各グローバル変数とIOユニットとの対応関係を示すIOユニット割り当て定義部94と、参照先のモジュールを規定する参照モジュール部96とを含む。グローバル変数定義90は、各グローバル変数についてのコメント(任意)を格納するコメント部95をさらに含んでいてもよい。
 このように、グローバル変数定義90においては、各変数について、使用(参照)されるプログラムが設定される。グローバル変数定義90においては、このような参照元のプログラムの設定(すなわち、各グローバル変数に関連付けて参照モジュール部96に規定されるモジュールの有無およびモジュールの数)に応じて、各グローバル変数がIO-プログラムI/F56に属するのか、プログラム間I/F58に属するのかが決定される。
 図9に示すように、プログラム開発装置200は、呼び出し関係にある複数のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性(あるいは規則)の設定を受け付ける。IO-プログラムI/F56に属する変数は、いずれか一つのプログラムから参照されるという属性を有する。また、プログラム間I/F58に属する変数は、関連する複数のプログラムのいずれからも参照されるという属性を有する。
 (d4:整合性評価)
 プログラム開発装置200は、ユーザプログラムを解析して、ユーザプログラムに含まれる変数の各々について、設定されているプログラムからの参照に関する属性(IO-プログラムI/F56およびプログラム間I/F58のいずれに属するのか)に基づく整合性を評価する。このような、グローバル変数定義90に基づくユーザプログラムの整合性評価の一例として、モジュール毎に変数使用状況を解析する処理について説明する。
 図10は、本実施の形態に従うモジュール化プログラミングにおける整合性評価の処理手順を示すフローチャートである。図10に示す各ステップは、典型的には、プログラム開発装置200のプロセッサ202が開発ツール250を実行することで実現される。すなわち、開発ツール250は、制御装置100で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置200を実現するためのプログラムである。そして、プログラム開発装置200は、ユーザプログラムを解析して、変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価するための、以下に説明するような処理を実行する。
 図10を参照して、プログラム開発装置200は、図9に示すグローバル変数定義90を参照して、解析対象のモジュール名を抽出する(ステップS100)。プログラム開発装置200は、抽出されたいずれかのモジュール名をもつプログラムを検索対象に設定する(ステップS102)。プログラム開発装置200は、検索対象に設定されたプログラムの1行を読み込み(ステップS104)、何らかの変数が使用されているか否かを判断する(ステップS106)。何らかの変数が使用されていれば(ステップS106においてYES)、使用されている変数の変数名、使用箇所、入力/出力の種別、用途などを抽出する(ステップS108)。抽出された各情報は、モジュール毎変数使用状況(後述の図11参照)として出力される。なお、何らかの変数も使用されていなければ(ステップS106においてNO)、ステップS108の処理はスキップされる。
 プログラム開発装置200は、検索対象のプログラムの最終行に到達しているか否かを判断する(ステップS110)。検索対象のプログラムの最終行に到達していなければ(ステップS110においてNO)、プログラム開発装置200は、検索対象に設定されたプログラムの次の1行を読み込み(ステップS112)、ステップS106以下の処理を再度実行する。
 検索対象のプログラムの最終行に到達していれば(ステップS110においてYES)、プログラム開発装置200は、抽出されたモジュール名をもつプログラムのすべてについて検索処理が完了しているか否かを判断する(ステップS114)。抽出されたモジュール名をもつプログラムのうち検索処理が未完のものがあれば(ステップS114においてNO)、プログラム開発装置200は、検索処理が未完のプログラムを新たな検索対象に設定する(ステップS116)。そして、プログラム開発装置200は、ステップS102以下の処理を再度実行する。
 抽出されたモジュール名をもつプログラムのすべてについて検索処理が完了していれば(ステップS114においてYES)、プログラム開発装置200は、ステップS120以下の処理を実行する。
 図11は、図10に示す整合性評価の処理によって生成されるモジュール毎変数使用状況350の一例を示す図である。図11を参照して、モジュール毎変数使用状況350は、対象のモジュールに含まれるプログラムで使用されるグローバル変数の一覧を含む。
 より具体的には、モジュール毎変数使用状況350は、対応する変数が使用されているモジュールを示すモジュール名351と、使用されている変数の変数名352と、対応する変数の使用箇所353と、対応する変数の入力/出力の種別354と、対応する変数の用途355と、対応する変数が定義されたモジュール以外で使用されていることを示すフラグが格納される定義外使用356とを含む。
 使用箇所353は、対応するプログラムのステップ番号などを用いて対応する変数の使用箇所が特定される。入力/出力の種別354は、対応する変数が接点(入力変数)として使用されているのか、対応する変数がコイル(出力変数)として使用されているのかを示す。
 なお、図10のステップS108においては、同一のプログラムから同一の変数が複数回抽出される場合があるが、このような複数回抽出された同一の変数はマージされて、モジュール毎変数使用状況350には、同一のプログラムについて同一の変数が重複して登録されることはない。また、図10のステップS108において抽出された変数のうち、対応するモジュール名が存在しないものを削除してもよい。
 図11に示すようなモジュール毎変数使用状況350が参照されて、図10に示すステップS120以下の処理が実行される。再度図10を参照して、プログラム開発装置200は、グローバル変数定義90(図9)に含まれる変数のうち対応する参照先のモジュール(参照モジュール部96)が規定されていないものを削除して、整合性評価の対象となる変数のみからなる対象グローバル変数定義90Aを生成する(ステップS120)。
 図12は、本実施の形態に従うモジュール化プログラミングにおいて生成される対象グローバル変数定義90Aの一例を示す図である。図12を参照して、対象グローバル変数定義90Aは、参照モジュールと対応付けられたグローバル変数のみが含まれることになる。対象グローバル変数定義90Aにおいては、各グローバル変数を参照するモジュール毎に使用の有無を評価するためのフラグをセットできるようになっている(参照モジュール部97)。
 次に、図11に示されるモジュール毎変数使用状況350と、図12に示される対象グローバル変数定義90Aとを比較して、一致および相違を評価する処理が実行される。
 より具体的には、プログラム開発装置200は、モジュール毎変数使用状況350(図11)のうち最初のエントリを読み込み(ステップS122)、読み込んだエントリの変数名352をキーにして、対象グローバル変数定義90Aに含まれる同一の変数名91をもつエントリを検索する(ステップS124)。そして、対象グローバル変数定義90Aの検索されたエントリにおいて、読み込んだエントリのモジュール名351と同一のモジュール名に使用済であることを示すフラグ(図12の参照モジュール部97)をセットする(ステップS126)。
 続いて、プログラム開発装置200は、読み込んだエントリの変数名352に対応する対象グローバル変数定義90Aのエントリにおいて、読み込んだモジュール名351が参照モジュール部97に含まれているか否かを判断する(ステップS128)。読み込んだモジュール名351が参照モジュール部97に含まれていなければ(ステップS128においてNO)、プログラム開発装置200は、読み込んだエントリに対して、定義外のモジュールで使用されていることを示すフラグ(図11の定義外使用356)をセットする(ステップS130)。一方、読み込んだモジュール名351が参照モジュール部97に含まれていれば(ステップS128においてYES)、プログラム開発装置200は、ステップS130の処理をスキップする。
 すなわち、ステップS128およびS130においては、注目している変数について、対象グローバル変数定義90Aの参照モジュール部97にモジュール毎変数使用状況350のモジュール名351が含まれていれば、当該注目している変数は適切に使用されていると判断される。一方、対象グローバル変数定義90Aの参照モジュール部97にモジュール毎変数使用状況350のモジュール名351が含まれていれば、当該注目している変数の使用が正しくない(定義されていないモジュールでの使用)と判断される。このように、整合性評価としては、IO-プログラムI/F56に属する変数が参照元とされているプログラムとは異なるプログラムから参照されているか否かの判断を含む。
 プログラム開発装置200は、モジュール毎変数使用状況350の最後のエントリまで処理が完了しているか否かを判断する(ステップS132)。モジュール毎変数使用状況350の最後のエントリまで処理が完了していなければ(ステップS132においてNO)、プログラム開発装置200は、モジュール毎変数使用状況350(図11)のうち次のエントリを読み込み(ステップS134)、ステップS124以下の処理を再度実行する。
 モジュール毎変数使用状況350の最後のエントリまで処理が完了していれば(ステップS132においてYES)、プログラム開発装置200は、対象グローバル変数定義90Aの参照モジュール部97においてフラグがセットされていない変数を使用されていない変数として抽出し(ステップS136)、モジュール毎変数使用状況350および対象グローバル変数定義90Aに基づいて、整合性評価の結果を表示する(ステップS138)。このように、整合性評価としては、プログラム間I/F58に属する変数が関連付けられたプログラムのいずれからも参照されているか否かの判断を含む。
 そして、整合性評価の処理は終了する。なお、整合性評価の結果に基づいて、ユーザプログラムに対して、何らかの修正を行うための処理を実行してもよい。
 (d5:整合性評価の結果例)
 プログラム開発装置200は、上述したような整合性評価の結果を提示する機能を有している。
 図13は、本実施の形態に従うプログラム開発装置200が提供する整合性評価の結果例を示す模式図である。図13を参照して、結果表示画面300は、モジュール毎変数使用状況350(図11)をベースにした、モジュール毎に変数の使用状況の整合性評価結果を示すものである。
 結果表示画面300は、適切に使用されている変数を示す使用変数一覧310と、使用されていない変数を示す未使用変数一覧320とを含む。
 使用変数一覧310は、対象のモジュールを示すモジュール名311と、対象の変数を示す変数名312と、対象の変数のデータ型を示すデータ型313と、対象の変数とIOユニットとの対応関係を示すIOユニット割り当て314と、対象の変数についてのコメント315(任意)と、対象の変数の用途316と、対象に対する整合性評価の結果を示す評価結果317とを含む。
 評価結果317においては、使用先として定義されたモジュール以外のモジュールで使用されている変数(モジュール毎変数使用状況350の定義外使用356にフラグがセットされている変数)については、「モジュールの定義にない使用です」といったエラーメッセージ318が対応付けて表示される。
 同様に、未使用変数一覧320は、対象のモジュールを示すモジュール名321と、対象の変数を示す変数名322と、対象の変数のデータ型を示すデータ型323と、対象の変数とIOユニットとの対応関係を示すIOユニット割り当て324と、対象の変数についてのコメント325(任意)と、対象の変数の用途326と、対象に対する整合性評価の結果を示す評価結果327とを含む。なお、対象の変数が未使用であるので、IOユニット割り当て324および用途326については有効な値が設定できない。
 評価結果327においては、定義されているモジュールで使用されていない変数(対象グローバル変数定義90Aの参照モジュール部97のフラグがセットされていない変数)については、「定義されているジュールで使用されていません」といったエラーメッセージ328が対応付けて表示される。
 図13に示すような整合性評価の結果例をユーザへ提示することで、予め定められた変数に関する規則に整合しない変数を一見して把握できる。
 図14は、本実施の形態に従うプログラム開発装置200が提供する整合性評価の別の結果例を示す模式図である。図14を参照して、結果表示画面330は、対象グローバル変数定義90A(図12)をベースにした、変数毎に使用状況の整合性評価結果を示すものである。
 結果表示画面330は、対象グローバル変数定義90A(図12)に対応する使用変数一覧340を含む。
 使用変数一覧340は、対象の変数を示す変数名341と、対象の変数のデータ型を示すデータ型342と、対象の変数とIOユニットとの対応関係を示すIOユニット割り当て343と、対象の変数についてのコメント344(任意)と、対象の変数のモジュールでの使用状態を示すモジュール毎使用状態345と、対象に対する整合性評価の結果を示す評価結果348とを含む。
 モジュール毎使用状態345は、各モジュールにおける使用の定義の有無を示す定義346と、各モジュールにおいて実際に使用されているか否かを示す使用347とを含む。定義346には、対応するモジュールにおいて対象の変数の使用が定義されている場合には、評価マークが表示される。また、使用347においては、対応するモジュールにおける対象の変数がどのような形態で使用されているかを示す情報が表示される。対応する変数が接点(入力変数)として使用されている場合には[R]と表示され、対応する変数がコイル(出力変数)として使用されている場合には[W]と表示される。すなわち、プログラム開発装置200は、各変数が入力および出力のいずれの種別(入力/出力)でユーザプログラムにおいて使用されているのかを提示する。
 モジュール毎使用状態345において、変数の使用に関する予め定められた規則に整合しないものは、他とは異なる表示態様で協調表示される。図14に示す例においては、変数「InA_Bit00」および「Child_ACK」について使用に関する規則に整合していないことを示されている。
 評価結果348においては、規則に整合していない詳細が表示される。図14に示す例では、変数「InA_Bit00」に対応付けて、「モジュールの定義にない使用です」「複数のモジュールでユニットのアクセスがあります」といったエラーメッセージが表示されている。また、変数「Child_ACK」に対応付けて、「定義されているモジュールで使用されていません」といったエラーメッセージが表示されている。
 このように、プログラム開発装置200は、整合性評価において整合性を満たしていないと評価された変数を他の変数とは異なる態様で表示する。
 図14に示すような整合性評価の結果例をユーザへ提示することで、予め定められた変数に関する規則に整合しない変数を一見して把握できる。
 <E.変形例>
 上述の説明においては、各プログラムからIOユニットへのアクセスに参照されるグローバル変数を規定するIO-プログラムI/F56、および、プログラム間でアクセス可能なグローバル変数を規定するプログラム間I/F58に着目して説明した。プログラム間I/F58は、プログラム(モジュール)間で参照可能なグローバル変数であることを規定するのみであったが、プログラム(モジュール)間の呼び出し関係(親子関係)を考慮して、さらにプログラム(モジュール)間で参照可能なグローバル変数の属性(あるいは規則)を設定するようにしてもよい。
 図15は、本実施の形態の変形例に従うモジュール化プログラミングにおけるモジュール間インターフェイスの一例を示す図である。図15(A)を参照して、親モジュール70(Parent)から2つの子モジュール80Aおよび80B(Child)を呼び出す親子関係が設定されているとする。このような3つのモジュールについては、親モジュール70と子モジュール80Aとの関係、親モジュール70と子モジュール80Bとの関係、および、子モジュール80Aと子モジュール80Bとの関係の3種類のモジュール間インターフェイスが存在し得る。
 このようなモジュール間の親子関係の情報を利用して、親子間以外でモジュール間のインターフェイスとしての変数が存在しているか否かの整合性を評価するようにしてもよい。
 例えば、図15(B)に示すように、親モジュール70と子モジュール80Aとの間のモジュール間インターフェイスとしてIF_Parent_Child1を規定し、親モジュール70と子モジュール80Bとの間のモジュール間インターフェイスとしてIF_Parent_Child2を規定し、子モジュール80Aと子モジュール80Bとの間のモジュール間インターフェイスとしてIF_Child1_Child2を規定することができる。
 すなわち、モジュール間の親子関係を参照して、IF_Child1_Child2という子モジュール間のインターフェイスに属する変数の定義を可能にすることで、子モジュール同士の変数参照の整合性を評価できる。そして、このような変数の属性(あるいは規則)に整合しない変数をユーザに通知することができる。
 なお、モジュール間の親子関係以外の関係(すなわち、子モジュール同士のインターフェイス)を規定するか否かについは、ユーザのモジュール設計のルールに依存させてもよい。この場合には、モジュール間の親子関係以外の関係を規定するか否かについて、ユーザが任意に選択(すなわち、有効/無効の切り替え)を行えるようにしてもよい。
 <F.付記>
 上述したような本実施の形態は、以下のような技術思想を含む。
[構成1]
 制御装置(100)で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置(200)であって、
 呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付ける設定手段(90;S2)を備え、当該設定される属性は、前記第1および第2のプログラムのいずれか一方から参照される第1の属性(56)と、前記第1および第2のプログラムのいずれからも参照される第2の属性(58)とを含み、
 前記ユーザプログラムを解析して、前記1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価する評価手段(S100~S138)を備える、プログラム開発装置。
[構成2]
 前記評価手段による整合性の評価は、前記第1の属性が設定されている変数が参照元とされているプログラムとは異なるプログラムから参照されているか否かを含む、構成1に記載のプログラム開発装置。
[構成3]
 前記評価手段による整合性の評価は、前記第2の属性が設定されている変数が前記第1および第2のプログラムのいずれからも参照されているか否かを含む、構成1または2に記載のプログラム開発装置。
[構成4]
 前記評価手段による整合性の評価結果を提示する結果提示手段(300;330)をさらに備える、構成1~3のいずれか1項に記載のプログラム開発装置。
[構成5]
 前記結果提示手段は、前記評価手段により整合性を満たしていないと評価された変数を他の変数とは異なる態様で表示する、構成4に記載のプログラム開発装置。
[構成6]
 前記結果提示手段は、前記1または複数の変数の各々が入力および出力のいずれの種別で前記ユーザプログラムにおいて使用されているのかを提示する、構成4または5に記載のプログラム開発装置。
[構成7]
 前記第1の属性が設定される変数は、特定のIOユニットと対応付けられる、構成1~6のいずれか1項に記載のプログラム開発装置。
[構成8]
 前記設定手段は、前記1または複数の変数の各々について、使用されるプログラムの設定を受け付ける、構成1~5のいずれか1項に記載のプログラム開発装置。
[構成9]
 前記第1および第2のプログラムの各々は、使用される変数および当該変数に対して設定される属性を含めて、モジュール化されている、構成1~8のいずれか1項に記載のプログラム開発装置。
[構成10]
 制御装置(100)で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置(200)を実現するためのプログラム(250)であって、前記プログラムはコンピュータに
 呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付けるステップ(S2)を実行させ、当該設定される属性は、前記第1および第2のプログラムのいずれか一方から参照される第1の属性(56)と、前記第1および第2のプログラムのいずれからも参照される第2の属性(58)とを含み、前記プログラムはコンピュータに
 前記ユーザプログラムを解析して、前記1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価するステップ(S100~S138)を実行させる、プログラム開発装置を実現するためのプログラム。
 <G.利点>
 本実施の形態に従うモジュール化プログラミングによれば、ユーザプログラムで使用される変数に対して、IO-プログラムI/F56(いずれか一つのプログラムから参照される)に属する変数であるのか、プログラム間I/F58(関連する複数のプログラムのいずれからも参照される)に属する変数であるのかを明確に規定できるので、その規定された規則に適合した使用形態であるか否かを評価するとともに、適合しない部分を容易に修正できる。
 これによって、品質の高いモジュール化プログラミングを実現できるため、制御装置100で実行されるユーザプログラムの設計効率および再利用性を向上させることができる。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 制御システム、2 フィールドバス、4 ローカルネットワーク、10 フィールド装置群、12 リモートIO装置、14 リレー群、16,124 IOユニット、18 画像センサ、20 カメラ、22 サーボドライバ、24 サーボモータ、50 プロジェクト、52,126 ユーザプログラム、53 装置プログラム、54,346 定義、55 IOユニット設定、56 IO-プログラムI/F、57,59,90 グローバル変数定義、58 プログラム間I/F、60 装置モジュール、62,66 工程モジュール、63,64,67 工程内モジュール、70 親モジュール、71,81 命令、72,82 受け渡し、80,80A,80B 子モジュール、90A 対象グローバル変数定義、91,312,322,341,352 変数名、92,313,323,342 データ型、93 変数定義部、94 割り当て定義部、95 コメント部、96,97 参照モジュール部、100 制御装置、102,202 プロセッサ、104 チップセット、106,206 主記憶装置、108,208 二次記憶装置、110,214 ローカルネットワークコントローラ、112,212 USBコントローラ、114 メモリカードインターフェイス、116 メモリカード、120 フィールドバスコントローラ、122 内部バスコントローラ、200 プログラム開発装置、204 ドライブ、205 記憶媒体、216 入力部、218 表示部、220 バス、250 開発ツール、300,330 結果表示画面、310,340 使用変数一覧、311,321,351 モジュール名、314,324,343 割り当て、315,325,344 コメント、316,326,355 用途、317,327,348 評価結果、318,328 エラーメッセージ、320 未使用変数一覧、345 モジュール毎使用状態、347 使用、350 モジュール毎変数使用状況、353 使用箇所、354 種別、356 定義外使用、531,536 プログラム、532,534,537 機能プログラム、533,535,538 ファンクションブロック、539 ローカル変数定義。

Claims (10)

  1.  制御装置で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置であって、
     呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付ける設定手段を備え、当該設定される属性は、前記第1および第2のプログラムのいずれか一方から参照される第1の属性と、前記第1および第2のプログラムのいずれからも参照される第2の属性とを含み、
     前記ユーザプログラムを解析して、前記1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価する評価手段を備える、プログラム開発装置。
  2.  前記評価手段による整合性の評価は、前記第1の属性が設定されている変数が参照元とされているプログラムとは異なるプログラムから参照されているか否かを含む、請求項1に記載のプログラム開発装置。
  3.  前記評価手段による整合性の評価は、前記第2の属性が設定されている変数が前記第1および第2のプログラムのいずれからも参照されているか否かを含む、請求項1または2に記載のプログラム開発装置。
  4.  前記評価手段による整合性の評価結果を提示する結果提示手段をさらに備える、請求項1~3のいずれか1項に記載のプログラム開発装置。
  5.  前記結果提示手段は、前記評価手段により整合性を満たしていないと評価された変数を他の変数とは異なる態様で表示する、請求項4に記載のプログラム開発装置。
  6.  前記結果提示手段は、前記1または複数の変数の各々が入力および出力のいずれの種別で前記ユーザプログラムにおいて使用されているのかを提示する、請求項4または5に記載のプログラム開発装置。
  7.  前記第1の属性が設定される変数は、特定のIOユニットと対応付けられる、請求項1~6のいずれか1項に記載のプログラム開発装置。
  8.  前記設定手段は、前記1または複数の変数の各々について、使用されるプログラムの設定を受け付ける、請求項1~5のいずれか1項に記載のプログラム開発装置。
  9.  前記第1および第2のプログラムの各々は、使用される変数および当該変数に対して設定される属性を含めて、モジュール化されている、請求項1~8のいずれか1項に記載のプログラム開発装置。
  10.  制御装置で実行されるユーザプログラムの開発環境を提供するためのプログラム開発装置を実現するためのプログラムであって、前記プログラムはコンピュータに
     呼び出し関係にある第1および第2のプログラムを含むユーザプログラムにおいて使用される1または複数の変数の各々について、プログラムからの参照に関する属性の設定を受け付けるステップを実行させ、当該設定される属性は、前記第1および第2のプログラムのいずれか一方から参照される第1の属性と、前記第1および第2のプログラムのいずれからも参照される第2の属性とを含み、前記プログラムはコンピュータに
     前記ユーザプログラムを解析して、前記1または複数の変数の各々について、設定されているプログラムからの参照に関する属性に基づく整合性を評価するステップを実行させる、プログラム開発装置を実現するためのプログラム。
PCT/JP2020/008950 2019-10-03 2020-03-03 プログラム開発装置およびプログラム開発装置を実現するためのプログラム WO2021065033A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202080067892.0A CN114556242A (zh) 2019-10-03 2020-03-03 程序开发装置及用于实现程序开发装置的程序
EP20872802.2A EP4040242A4 (en) 2019-10-03 2020-03-03 PROGRAM DEVELOPER APPARATUS AND PROGRAM FOR IMPLEMENTING A PROGRAM DEVELOPER APPARATUS
US17/765,303 US20220365864A1 (en) 2019-10-03 2020-03-03 Program development device, and program for providing program development device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019183181A JP7404748B2 (ja) 2019-10-03 2019-10-03 プログラム開発装置およびプログラム開発装置を実現するためのプログラム
JP2019-183181 2019-10-03

Publications (1)

Publication Number Publication Date
WO2021065033A1 true WO2021065033A1 (ja) 2021-04-08

Family

ID=75336853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/008950 WO2021065033A1 (ja) 2019-10-03 2020-03-03 プログラム開発装置およびプログラム開発装置を実現するためのプログラム

Country Status (5)

Country Link
US (1) US20220365864A1 (ja)
EP (1) EP4040242A4 (ja)
JP (1) JP7404748B2 (ja)
CN (1) CN114556242A (ja)
WO (1) WO2021065033A1 (ja)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04205355A (ja) 1990-11-30 1992-07-27 Mitsubishi Electric Corp プログラム変数の使用検査装置
WO2002042853A1 (en) * 2000-11-24 2002-05-30 Mitsubishi Denki Kabushiki Kaisha Method and apparatus for programming
JP2012194666A (ja) * 2011-03-15 2012-10-11 Omron Corp Plcのcpuユニット、plc用のシステムプログラムおよびplc用のシステムプログラムを格納した記録媒体
WO2013114926A1 (ja) * 2012-02-01 2013-08-08 オムロン株式会社 サポート装置、サポートプログラムを記録した記録媒体、および実行可能プログラムを生成する方法
JP2016091066A (ja) * 2014-10-29 2016-05-23 オムロン株式会社 情報処理装置、情報処理方法、情報処理プログラム、および記録媒体
WO2017026290A1 (ja) * 2015-08-10 2017-02-16 オムロン株式会社 サポート装置、方法およびサポートプログラムを格納した記録媒体

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099639A (ja) * 2004-09-30 2006-04-13 Denso Wave Inc プログラム作成装置,制御装置及びコンピュータプログラム
JP2011186999A (ja) * 2010-03-11 2011-09-22 Cats Kk 浮動小数点表現プログラムの固定小数点表現化支援装置及び支援プログラム
JP5516736B2 (ja) * 2010-07-20 2014-06-11 株式会社日立製作所 ソフトウェア保守支援装置及びそれにより検証した電子制御装置
JP6477553B2 (ja) * 2016-03-14 2019-03-06 オムロン株式会社 プログラム開発支援装置、プログラム開発支援プログラムおよびプログラム開発支援方法
JP6520772B2 (ja) * 2016-03-14 2019-05-29 オムロン株式会社 評価システム、評価プログラムおよび評価方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04205355A (ja) 1990-11-30 1992-07-27 Mitsubishi Electric Corp プログラム変数の使用検査装置
WO2002042853A1 (en) * 2000-11-24 2002-05-30 Mitsubishi Denki Kabushiki Kaisha Method and apparatus for programming
JP2012194666A (ja) * 2011-03-15 2012-10-11 Omron Corp Plcのcpuユニット、plc用のシステムプログラムおよびplc用のシステムプログラムを格納した記録媒体
WO2013114926A1 (ja) * 2012-02-01 2013-08-08 オムロン株式会社 サポート装置、サポートプログラムを記録した記録媒体、および実行可能プログラムを生成する方法
JP2016091066A (ja) * 2014-10-29 2016-05-23 オムロン株式会社 情報処理装置、情報処理方法、情報処理プログラム、および記録媒体
WO2017026290A1 (ja) * 2015-08-10 2017-02-16 オムロン株式会社 サポート装置、方法およびサポートプログラムを格納した記録媒体

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4040242A4

Also Published As

Publication number Publication date
EP4040242A4 (en) 2023-11-01
JP7404748B2 (ja) 2023-12-26
EP4040242A1 (en) 2022-08-10
JP2021060677A (ja) 2021-04-15
CN114556242A (zh) 2022-05-27
US20220365864A1 (en) 2022-11-17

Similar Documents

Publication Publication Date Title
EP3379358B1 (en) Control system, control device, control program, and control method
US8806470B2 (en) System, method, and apparatus for software maintenance of sensor and control systems
JP2019159697A (ja) 制御システムおよび制御方法
JP2018173883A (ja) 制御装置、制御プログラム、制御システム、および制御方法
JP6623856B2 (ja) スレーブ装置、スレーブ装置の制御方法、情報処理プログラム、および記録媒体
JP6442131B2 (ja) 制御システムおよび制御装置
WO2021065033A1 (ja) プログラム開発装置およびプログラム開発装置を実現するためのプログラム
WO2021044650A1 (ja) プログラム開発装置、プロジェクト作成方法およびプログラム開発装置を実現するためのプログラム
US8832670B2 (en) Programmable controller and programming tool for communication with legacy equipment
US20220244695A1 (en) Support device, non-transitory computer-readable recording medium recording support program, and setting method
JP2018200731A (ja) サポート装置およびサポートプログラム
WO2021044654A1 (ja) 情報処理システム、プログラマブル表示器および情報処理装置
EP3506034B1 (en) Control system
US20090241093A1 (en) Method for debugging programmable logic controller
US20190081864A1 (en) Gateway and method of determining machines to be networked at gateway
WO2022249713A1 (ja) 制御システム、システムプログラムおよびデバッグ方法
EP4328681A1 (en) Method and system for managing technical installation during occurrence of error state in a controller
JP7056484B2 (ja) サポート装置、サポートプログラム、およびプログラムの生成方法
US20240069515A1 (en) Information processing device, information processing method, recording medium, and method of manfacturing product
WO2023189257A1 (ja) サーバ装置、情報モデルの提供方法、及び情報モデルの提供プログラム
WO2020017265A1 (ja) 制御システム、監視装置および監視プログラム
CN114253240A (zh) 云化工业系统设备的控制方法、装置、设备及存储介质
JP2023151721A (ja) 情報処理システム、情報処理方法および情報処理プログラム
JP2023151726A (ja) 開発装置、開発プログラムおよび開発方法
JP2019197407A (ja) 制御システム、サポート装置、サポートプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20872802

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020872802

Country of ref document: EP

Effective date: 20220503