WO2020246096A1 - サポート装置およびサポートプログラム - Google Patents

サポート装置およびサポートプログラム Download PDF

Info

Publication number
WO2020246096A1
WO2020246096A1 PCT/JP2020/010351 JP2020010351W WO2020246096A1 WO 2020246096 A1 WO2020246096 A1 WO 2020246096A1 JP 2020010351 W JP2020010351 W JP 2020010351W WO 2020246096 A1 WO2020246096 A1 WO 2020246096A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
sequence
unit
code
circuit
Prior art date
Application number
PCT/JP2020/010351
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 CN202080039322.0A priority Critical patent/CN113892065A/zh
Priority to EP20818200.6A priority patent/EP3982214A4/en
Priority to US17/616,109 priority patent/US20220317977A1/en
Publication of WO2020246096A1 publication Critical patent/WO2020246096A1/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/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/056Programming the PLC
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4441Reducing the execution time required by the program code
    • G06F8/4443Inlining

Definitions

  • This disclosure relates to a support device that supports the development of a control program executed by a control device that controls a controlled object, and a support program for realizing the support device.
  • Control devices such as PLC (Programmable Logic Controller) have been introduced at various manufacturing sites.
  • a control device is a kind of computer, and a control program included in a user program designed according to a manufacturing device, a manufacturing facility, or the like is executed.
  • Such a control program is created in a development environment prepared separately from the control device.
  • a device that provides a development environment and a function of uploading a control program to a control device or downloading a control program to the control device is also called a support device.
  • the control program includes a sequence program that represents a control sequence.
  • a common sequence logic is prepared as a function block that describes the logic, and by describing a function block call instruction in the sequence program, the function block can be made into parts and reused. Development efficiency can be improved.
  • Patent Document 1 a control logic diagram described using a function block, which is the basis of a program being executed by a controller, is associated with the execution status of the program in the controller. Disclose the device to be displayed.
  • Patent Document 2 Japanese Patent Application Laid-Open No. 2004-295872
  • Patent Document 2 Japanese Patent Application Laid-Open No. 2004-295872
  • One purpose of this disclosure is to provide an environment that can effectively support the development of sequence programs.
  • An example of the present disclosure is a support device that supports the development of a sequence program executed by a control device that controls a controlled object, and the sequence program includes a call instruction of a unit program that constitutes the sequence program, and is a support device. Is displayed as an operation reception unit that accepts operations on the support device, and a monitor unit that expands and displays a unit program call instruction in a circuit indicated by the sequence logic defined by the unit program when the sequence program is displayed.
  • the code conversion unit includes an editor unit that changes the sequence logic to the sequence logic that represents the changed circuit according to the operation of changing the circuit, and a code conversion unit that converts the sequence program into executable code.
  • the code conversion unit is a switching option. According to this, one of the changed sequence logic code and the call instruction code is assigned to the call instruction in the sequence program to perform conversion.
  • the calling instruction in one place assigns the sequence logic changed by the editor part to the other places.
  • the call instruction of can be converted into an executable code while keeping the original call instruction code.
  • the support device includes a setting unit that sets a switching option to the calling instruction of the sequence program according to the setting operation, and the monitor unit sets the switching option to the calling instruction when displaying the sequence program.
  • the calling instruction is expanded and displayed on the circuit.
  • a circuit based on the sequence logic defined by the unit program to be called is displayed in place of the call instruction in the call instruction for which the switching option is set in the sequence program. ..
  • control device includes a library for callably storing the sequence logic code of the unit program, and the sequence logic code stored in the library is changed by using the changed sequence logic code.
  • the modified sequence logic code in the sequence program can be used by the editor section to edit the sequence logic code of the corresponding unit program in the library of the control device.
  • control device includes a library for callably storing the code of the sequence logic of the unit program, and the sequence program includes one or more of the above-mentioned calling instructions, and according to a selection operation, 1 Among one or more call instructions, the call instruction having the modified sequence logic used to change the code of the sequence logic of the library is selected.
  • the code used for editing the sequence logic code of the corresponding unit program in the above library is selected from the sequence logic codes corresponding to each changed invocation instruction in the sequence program. Can be done.
  • the user can change the sequence logic from the displayed list of call instructions to be used for editing the sequence logic code of the corresponding unit program in the above library (that is, the editor section changes the sequence logic.
  • the called command issued) can be selected.
  • the monitoring unit acquires the circuit output state indicating the execution state of the sequence logic defined by the unit program from the control device, and is based on the circuit indicated by the sequence logic defined by the unit program and the acquired circuit output state. Then, the execution state of the sequence logic in the control device is visualized in the expanded circuit.
  • the execution status of the sequence program being executed by the control device can be visualized and presented in the circuit developed by the part of the calling instruction displayed on the support device.
  • An example of the present disclosure is a support program directed to support the development of a sequence program executed by a control device that controls a controlled object, and the sequence program includes a call instruction of a unit program constituting the sequence program.
  • the support program is displayed on the computer as a step of accepting an operation on the computer and a step of expanding and displaying the call instruction of the unit program in the circuit indicated by the sequence logic defined by the unit program when the sequence program is displayed.
  • the step of changing the sequence logic to the sequence logic representing the changed circuit and the step of converting the sequence program into the executable code are provided, and the step of converting the sequence program into the executable code is switched.
  • the calling instruction in the sequence program includes a step of assigning one of the modified sequence logic code and the calling instruction code to perform conversion.
  • the call instruction in one place is changed by the editor part.
  • the call instructions in other places can be converted into executable code while keeping the original call instruction code.
  • an environment capable of effectively supporting the development of a sequence program is provided.
  • FIG. 1 It is a schematic diagram which shows the structural example of the PLC system 1 to which the support device 200 which concerns on embodiment of this invention can apply. It is a schematic diagram which shows the hardware configuration example of PLC100 which constitutes the PLC system shown in FIG. It is a schematic diagram which shows the hardware configuration example of the support device 200 which concerns on embodiment of this invention. It is a schematic diagram which shows an example of the software structure of PLC100 which concerns on embodiment of this invention. It is a figure explaining the reference example of the data between the user program 112 and the variable table in PLC100 which concerns on embodiment of this invention. It is a schematic diagram which shows an example of the software structure of the support device 200 which concerns on embodiment of this invention.
  • FIG. 21 is a diagram for schematically explaining an application example of the present disclosure.
  • the support device 200 may be connected to a control device that controls an object such as a manufacturing facility at a manufacturing site. Both communicate by, for example, USB (Universal Serial Bus).
  • the support device 200 provides an environment that supports the development of a control program executed by the control device.
  • PLC100 is shown as a typical example of the control device, but the PLC is not limited to PLC.
  • the support device 200 provides an environment for developing various user programs including a control program.
  • the program to be developed may include, for example, a program according to the international standard IEC61131-3.
  • ladder diagrams (LD: Ladder Diagram), function block diagrams (FBD: Function Block Diagram), and sequential function charts (SFC: Sequential Function Chart) are used as programming languages for PLC applications including control programs.
  • Instruction list (IL: Instruction List)
  • Structured text (ST: Structured Text) are specified.
  • the control program according to the present embodiment is a sequence program 271, and may be a sequence program 271 written in any programming language. In the following, as a typical example, the sequence program 271 described by the ladder diagram will be described.
  • the PLC 100 includes a library 275 that stores the executable code of a plurality of unit programs including functions and function blocks.
  • the sequence program 271 includes a calling instruction that calls one or a plurality of unit programs constituting the sequence program 271. Therefore, in the PLC 100, the corresponding unit program is called and executed from the library 275 by executing the calling instruction while the sequence program 271 is being executed.
  • the support device 200 provides an environment for developing a sequence program 271 executed by the PLC 100.
  • the development environment includes a monitor 224, an editor 222, a builder 223, and the like.
  • the monitor 224 expands and displays the unit program call instruction in the circuit indicated by the sequence logic defined by the unit program.
  • the editor 222 changes the sequence logic of the circuit according to the operation of changing the circuit displayed on the display 214.
  • the builder 223 assigns one of the changed sequence logic code and the call instruction code to the call instruction in the sequence program 271 according to the switching option. Perform the conversion.
  • the unit program to be called can be expanded and displayed in the circuit represented by the sequence logic defined by the unit program. This makes it possible for the sequence circuit to grasp the sequence logic code actually described in the unit program called by the call instruction at the development site such as when editing the sequence program 271.
  • the user can change the original sequence logic of the circuit to the sequence logic indicated by the changed circuit.
  • the support device 200 changes the sequence logic code of the unit program stored in the library 275 of the PLC 100 by using the changed sequence logic code.
  • the user can use the sequence of the corresponding unit program stored in the library 275.
  • the logic code can be changed (updated) to the modified sequence logic code that has been confirmed to be appropriate.
  • the unit program which is a common component in the sequence program 271
  • the sequence logic code to be executed is different from the other parts in only one place, and the sequence program is executed. After executing 271 and obtaining the result, it is possible to change the code of the sequence logic of the unit program of the library 275.
  • FIG. 6 is a schematic view showing an example of the software configuration of the support device 200 according to the embodiment of the present invention.
  • an “online monitor” is provided, which is a function of checking the execution status of a user program (sequence program 271) arbitrarily created according to a control target in the control device.
  • An online monitor is a concept that includes the power flow display described above.
  • sequence program 271 executed by the control device of the user program.
  • the support device 200 is configured to provide both an "online editor” and an “online monitor” environment including a power flow display, but it is assumed that the support device 200 provides one of the environments. May be good.
  • the support device 200 may be configured to provide only an "online editor” without an “online monitor”.
  • FIG. 6 shows the software configuration of the support device 200 in relation to the exchange of data with the PLC 100.
  • the support device 200 generates the intermediate code 272 from the sequence program 271 and transfers it to the PLC 100.
  • the PLC 100 converts the intermediate code 272 received from the support device 200 into a native code.
  • the arithmetic processing unit of the PLC 100 executes the native code. By executing the native code, control over the controlled object is realized.
  • the sequence program 271 includes a calling instruction unit that calls a unit program constituting the sequence program 271.
  • the FUN / FB definition which is the definition of a function (FUN: function) or a function block (FB: Function Block), is exemplified as a unit program.
  • the FUN / FB definition is registered in the library of PLC100 or the like as a common component for streamlining the description of the sequence program 271, and when the sequence program 271 is executed, the sequence logic defined by being called from the library is executed as appropriate. Will be done.
  • the definition content of the unit program depends on the specifications of the programming language that describes the unit block, but in the present embodiment, the circuit configuration by the sequence logic according to the above ladder diagram is defined. This circuit configuration mainly includes a logical circuit configuration.
  • the support device 200 stores the object code 2788 for realizing the screen display by the monitor 224 in the support device 200 in the storage unit 201.
  • the storage unit 201 of the support device 200 further stores sequence circuit information 279 and definition circuit information 280, which are generated from the user program for the PLC 100 and define the circuit configuration of the sequence program.
  • the definition circuit information 280 indicates the circuit configuration defined by the above FUN / FB definition.
  • the support device 200 includes an editor 222 for creating a sequence program 271.
  • the option setting module 2311 included in the editor 222 selects one or more of the unit program call instructions in the sequence program 271 according to the user operation received by the operation reception unit 221 from the operation unit 203, and is selected. Set the display mode switching option in the call command.
  • the instruction code is added, deleted, changed, etc. while the sequence program 271 is displayed on the monitor 224, but in that case, one or more calling instructions are based on the above options set. It is switched to the image of the circuit configuration shown by the sequence logic defined by the corresponding unit program. As a result, the circuit configuration defined by the unit program is inlined and displayed as a call instruction of the unit program. In this way, by selectively setting options in one or more call command units by user operation, the circuit configuration defined by the corresponding unit program in one or more call command units is visualized.
  • Such visualization is also performed during online editing.
  • the local editor 233 of the online editor 232 edits (changes) the sequence program 271 according to the operation of changing the image of the circuit configuration expanded inline by the sequence program 271.
  • the definition editor 234 edits (changes) the definition content (sequence logic) of the FUN / FB definition registered in the library of the PLC 100 according to the change operation of the image of the circuit configuration expanded inline.
  • the support device 200 has an online monitor module 238 for providing an online monitor.
  • the online monitor module 238 acquires the circuit output state 156 (described later) indicating the execution state of the native code from the PLC 100. That is, the support device 200 (online monitor module 238) exchanges the circuit output state 156 with the PLC 100. Then, the online monitor module 238 of the support device 200 visualizes the execution state of the sequence program in the PLC 100 based on the sequence circuit information 279, the definition circuit information 280, and the acquired circuit output state 156 (that is, provides an online monitor). To do).
  • This execution state visualization provides information that helps the user make decisions about editing (modifying) sequence logic.
  • Such an editor with an option for inline expansion and an online monitor that visualizes the execution state with the PLC100 provide an environment that supports efficient development of unit programs, sequence programs, and the like.
  • FIG. 1 is a schematic diagram showing a configuration example of a PLC system 1 to which a support device 200 according to the present embodiment can be applied.
  • the PLC system 1 includes a plurality of PLCs 100-1, 100-2, 100-3, 100-4, ... (Hereinafter, also collectively referred to as "PLC100").
  • PLC100 is an example of a control device that controls a control target that is a field device such as a relay and a sensor.
  • the support device 200 can be connected to the PLC 100 and provides an environment for supporting the development of the control program of the PLC 100.
  • the PLC system 1 may be configured to include one PLC 100. In the following, for the sake of simplicity, a development environment for one PLC100 will be described.
  • the PLC 100 typically exchanges signals from a field with a CPU unit 10 that executes various programs including a control program, a power supply unit 12 that supplies electric power to the CPU unit 10 and the like, and I / O (I / O). Input / Output) unit 14 and the like.
  • the I / O unit 14 is connected to the CPU unit 10 via the system bus 11.
  • the development support environment provided by the support device 200 may have a control program editor (editing), a debugger, a simulator, and a monitor function for outputting these output information to a monitor such as a display.
  • the support device 200 also has a function of acquiring the state value of the PLC 100 during operation and outputting it to a monitor such as a display.
  • the support program which is an application program stored in the recording medium 250
  • the support program may be downloaded from an external server device or the like via a network.
  • the support device 200 is connected to the CPU unit 10 of the PLC 100 via a connection cable.
  • the support device 200 is typically implemented in a personal computer.
  • FIG. 2 is a schematic diagram showing a hardware configuration example of the PLC 100 constituting the PLC system shown in FIG.
  • the PLC 100 realizes control over a controlled object by executing a pre-installed program by the processor. More specifically, the PLC 100 includes a processor 102 such as a CPU (Central Processing Unit) and an MPU (Micro-Processing Unit), a chipset 104, a main memory 106, a flash memory 108, a USB interface 116, and a memory. It includes a card interface 118, an internal bus controller 122, and a field bus controller 124. The flash memory 108 stores the system program 110 and the user program 112.
  • the processor 102 reads the system program 110 and the user program 112 stored in the flash memory 108, expands them in the main memory 106, and executes them to realize control of the controlled object.
  • the "control program” is a kind of program arbitrarily designed according to a target, and is a concept including a system program 110 and a user program 112.
  • the control program may include only the user program 112.
  • the system program 110 includes an instruction code for providing basic functions of the PLC 100 such as data input / output processing and execution timing control.
  • the user program 112 includes a sequence program 112A (corresponding to the sequence program 271) and a library 275 for executing sequence control.
  • Library 275 includes various functions that can be called from sequence program 112A when execution of sequence program 112A and one or more FUN / FB definitions 276.
  • the user program 112 may include other programs such as a motion program, but in the present embodiment, the sequence program 112A will be mainly described for the sake of explanation. Further, in the present embodiment, as the sequence program 112A, the instruction code of the operation represented by the ladder logic circuit (logic circuit) or the combination of the ladder logic circuits is described in the ladder language defined by, for example, IEC61131-3. Includes "ladder program”.
  • the FUN / FB definition 276 of the library 275 represents the definition contents of FUN or FB.
  • the FUN or FB defined by the FUN / FB definition 276 corresponds to a unit program (hereinafter, also referred to as a POU (Program Organization Unit)) that constitutes a sequence program.
  • the code of the sequence logic defined by FUN or FB represents a sequence logic circuit (for example, a ladder logic circuit) composed of a logic circuit or a combination of logic circuits.
  • the chipset 104 realizes the processing of the PLC100 as a whole by controlling each component.
  • the internal bus controller 122 is an interface for exchanging data between the PLC 100 and the I / O unit 14 connected through the internal bus.
  • the fieldbus controller 124 is an interface for exchanging data between the PLC 100 and the I / O unit 16 connected through a fieldbus (not shown).
  • the internal bus controller 122 and the fieldbus controller 124 acquire the state values input to the corresponding I / O units 14 and 16, respectively, and command the calculation result in the processor 102 from the corresponding I / O units 14 and 16. Output as a value respectively.
  • the USB (Universal Serial Bus) interface 116 controls the exchange of data by USB.
  • the support device 200 communicates with the PLC 100 via the USB interface 116.
  • the memory card interface 118 is configured so that the memory card 120 can be attached and detached, and data can be written to and read from the memory card 120.
  • FIG. 2 shows a configuration example in which the necessary functions are provided by the processor 102 executing the program, and some or all of these provided functions are provided by a dedicated hardware circuit (for example, ASIC). It may be implemented using (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array). Alternatively, the main part of the PLC 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). In this case, the virtualization technology may be used to execute a plurality of OSs (Operating Systems) having different uses in parallel, and to execute necessary applications on each OS.
  • OSs Operating Systems
  • FIG. 3 is a schematic view showing a hardware configuration example of the support device 200 according to the embodiment of the present invention.
  • the support device 200 typically comprises a general purpose computer. From the viewpoint of maintainability at the manufacturing site where the PLC100 is arranged, a notebook-type personal computer having excellent portability is preferable.
  • the support device 200 includes a storage unit 201 and a CPU 202 that executes various programs including an operating system (OS).
  • the storage unit 201 includes a ROM (Read Only Memory) 204 for storing the BIOS and various data, and a memory RAM (Random Access Memory) 206 for providing a work area for storing data necessary for executing a program on the CPU 202.
  • a hard disk (HDD) 208 that non-volatilely stores programs and the like executed by the CPU 202.
  • the support device 200 further includes an operation unit 203 including a keyboard 210 and a mouse 212 operated by the user to input instructions to the support device 200, and a display 214 for presenting information to the user.
  • the support device 200 includes a communication interface 218 for communicating with the PLC 100 (CPU unit 10) and the like.
  • the communication interface 218 may include a USB communication module to communicate with the USB interface 116.
  • the support device 200 includes an optical recording medium reading device 216 for reading a support program for providing a development support environment stored in the recording medium 250 from the recording medium 250.
  • FIG. 3 shows a configuration example in which necessary functions are provided by a processor such as a CPU 202 executing a program, and some or all of these provided functions are provided by a dedicated hardware circuit (for example,). , ASIC, FPGA, etc.).
  • a dedicated hardware circuit for example, ASIC, FPGA, etc.
  • virtualization technology may be used to execute a plurality of OSs having different uses in parallel, and to execute necessary applications on each OS.
  • FIG. 4 is a schematic view showing an example of the software configuration of the PLC 100 according to the embodiment of the present invention.
  • the hypervisor 111 manages the hardware resources of the PLC 100, and allocates these hardware resources to the real-time OS 114 and the general-purpose OS 1161 while arbitrating the common hardware.
  • Real-time OS 114 and general-purpose OS 1161 independent of each other are executed on the hardware resource. That is, the hypervisor 111 is used to realize a virtual environment in which a plurality of different OSs are executed.
  • a logical network is configured between the real-time OS 114 and the general-purpose OS 1161 via the hypervisor 111.
  • the user program 112 including the sequence program is executed.
  • the task scheduler 1142, the program manager 1144, and the I / O (Input / Output) control process 1146 are linked.
  • the user program 112 is converted into an execution format in advance, and the code of this execution format acquires a signal from the control target and controls logic while coordinating with the task scheduler 1142, the program manager 1144, and the I / O control process 1146. Execution and reflection of the execution result (actuator control) are repeated.
  • the I / O control process 1146 controls the process of exchanging various signals with the controlled object.
  • the task scheduler 1142 controls the execution cycle or the execution timing for each task included in the user program 112. In the present embodiment, the task scheduler 1142 executes the task when the start timing according to the execution cycle of the task arrives and the timing signal is received from the program manager 1144. Details of execution control using the timing signal of the program manager 1144 will be described later.
  • any user application 1164 and general-purpose application 1162 are executed.
  • the user application 1164 is typically an application created by a development vendor of the user program 112 executed by the real-time OS 114, and acquires data related to the processing result of the user program 112 and / or data necessary for processing. And / or perform the processing as provided.
  • the general-purpose application 1162 is a standard application that can be executed by the general-purpose OS 1161, and by linking with the user application 1164, a system can be constructed with less man-hours by using general-purpose processing and functions.
  • FIG. 5 is a diagram illustrating a reference example of data between the user program 112 and the variable table in the PLC 100 according to the embodiment of the present invention.
  • the system program 110 and the user program 112 are executed when the control program is executed.
  • the system program 110 has an I / O module 160 as part of its function.
  • the I / O module 160 associates the data that the I / O unit exchanges with the field side where the device to be controlled is provided with the global variable table 150.
  • Variable programming is possible in the PLC 100, and the user program 112 can execute various processes using the variable values associated with the field data defined in the global variable table 150.
  • the sequence program 112A of the user program 112 is mainly composed of a ladder section 130 and a library 275.
  • the user program 112 represents native code 154 in a format that can be executed by the processor 102.
  • the ladder section 130 includes a ladder program written in the ladder language.
  • the call instruction included in the ladder program is executed, the FUN / FB definition 276 included in the library 275 is called and executed, and the execution result is returned to the calling ladder program.
  • FIG. 6 is a schematic view showing an example of the software configuration of the support device 200 according to the embodiment of the present invention.
  • FIG. 6 shows an example of information stored in the storage unit 201 in association with the software configuration of the support device 200.
  • FIG. 7 is a diagram schematically showing an example of the local flag table 273 according to the embodiment of the present invention.
  • FIG. 8 is a diagram schematically showing an example of the definition flag table 274 according to the embodiment of the present invention.
  • FIG. 9 is a diagram schematically showing an example of editing the sequence logic according to the embodiment of the present invention.
  • the information stored in the storage unit 201 includes the sequence program 271 which is the program source code, the intermediate code 272 generated from the sequence program 271, the local flag table 273, the definition flag table 274, the object code 2788, the sequence circuit information 279, and the definition. Includes circuit information 280.
  • the FUN / FB definition 276 called by the call instruction in the sequence program 271 is expanded (sequence circuit) in the sequence program 271.
  • Information is registered for each of the FUN / FB definitions 276 (hereinafter, also referred to as inline expansion).
  • the information corresponding to each of the FUN / FB definition 276 is a call name 2731 which is a name (POU name or the like) for identifying the FUN / FB definition 276, and a call instruction of the FUN / FB definition 276 appears in the sequence program 271.
  • the position 2732 of the line to be used and the asynchronous flag 2733 are included in association with each other.
  • the definition flag table 274 associates the definition name 2741, which is an identifier (POU name, etc.) of the FUN / FB definition 276, and the definition asynchronous flag 2742 for each FUN / FB definition 276 of the library 275. To register.
  • the support device 200 changes the sequence logic inlined in the sequence program 271 according to the user operation (hereinafter, referred to as local edit). Further, the support device 200 changes the definition contents of the corresponding FUN / FB definition 276 of the library 275 (hereinafter, referred to as definition edit). As a result of such local editing or definition editing, the sequence logic of the FUN / FB definition 276 expanded inline by the sequence program 271 does not match the sequence logic of the corresponding FUN / FB definition 276 of the library 275.
  • asynchronous flag 2733 is set to "1" when the sequence logic expanded inline by the sequence program 271 is asynchronous, and "0" is set when the sequence logic is synchronized.
  • the definition asynchronous flag 2742 is set to "1" when the sequence logic defined by the corresponding FUN / FB definition 276 is asynchronous, and "0" when it is synchronized.
  • the definition name 2741 of the FUN / FB definition 276 in the definition flag table 274 is associated with the option 277 set in the calling instruction in the sequence program 271 which will be described later.
  • the object code 2788, the sequence circuit information 279, and the definition circuit information 280 are used to display the sequence logic circuit represented by the sequence program 271 which is a control program on the display 214. Specifically, the object code 2788 indicates an object code for realizing the screen display of the sequence logic circuit.
  • the sequence circuit information 279 defines the sequence logic circuit configuration of the sequence program 271.
  • the definition circuit information 280 is generated from the sequence logic 2761 (described later) which is the definition content of the FUN / FB definition 276 of the library 275, and defines the circuit configuration represented by the sequence logic 2761.
  • the support programs for providing the development support environment are the support program 700 that realizes online monitoring including inline expansion by being executed, and the support program that realizes online editing by being executed. Includes 710.
  • the support program 700 includes a program that realizes an operation reception unit 221 and a monitor 224 for receiving a user operation via the operation unit 203.
  • the support program 710 includes a program that realizes an operation reception unit 221 and a monitor 224.
  • These modules consist of a program or circuit, or a combination of program and circuit.
  • the editor 222 edits (creates) the user program including the sequence program 271 according to the user operation.
  • Editor 222 includes online editor 232.
  • the online editor 232 provides an environment for editing the control program of the PLC 100 and the like without stopping the control target of the PLC 100. That is, in many cases, it is not easy to stop the control target at the manufacturing site where the PLC 100 is operated. Against this background, even if you want to partially change the control program executed by the PLC100, if you cannot change the control program unless you stop the PLC100 once, it is not easy to use. .. Therefore, the online editor 232 makes it possible to rewrite (edit) a part of the control program executed during the operation of the PLC 100 in cooperation with the PLC 100.
  • the editor 222 can edit the control program without depending on the PLC100 (or the operating state of the PLC100) (also referred to as offline editing).
  • the editor 222 creates a user program including the sequence program 271 according to the operation content received by the operation reception unit 221.
  • the created program is stored in the storage unit 201 as a sequence program 271 which is a source program.
  • the option setting module 2311 sets the option 277 for instructing the switching of the display mode to one or more selected from the call instructions in the sequence program 271 according to the user operation content.
  • the online editor 232 includes a local editor 233 that performs local editing and a definition editor 234 that performs definition editing.
  • FIG. 9 is a diagram schematically showing an example of editing according to the embodiment of the present invention.
  • a case where the sequence logic of the sequence program 271 or the sequence logic 2761 (described later) of the FUN / FB definition 276 defines a circuit configuration as shown in FIG. 9A will be described with reference to FIG.
  • an image showing the circuit configuration of the sequence logic is displayed on the display 214.
  • the user By manipulating the image using the editor 222, the user adds the sequence logic 2761 of the circuit of FIG. 9 (A), for example, as shown in FIG. 9 (B) or FIG. 9 (C). It can be changed to the logic.
  • the online editor 232 As an application example, for example, as a result of monitoring the circuit output state 156 displayed by the online monitor, when the user determines that an error has occurred in a part of the circuit due to a failure of the controlled object, as shown in FIG. 9C.
  • the display image is changed to add a circuit that bypasses the circuit components related to the failure.
  • the application example of editing by the online editor 232 is not limited to handling errors such as failures.
  • the Builder 223 is an example of a "code conversion unit".
  • the builder 223 builds the sequence program 271 (including parsing, optimization, compilation, etc.) to generate the intermediate code 272.
  • the support device 200 loads the intermediate code 272 into the PLC 100.
  • the processor 102 of the PLC 100 generates the native code 154 from the intermediate code while referring to the definition contents of the FUN / FB definition 276 of the library 275.
  • Native code 154 is executable code that PLC100 can directly interpret and execute.
  • the intermediate code 272 is also a code in a format that the PLC 100 can execute. When executing the intermediate code 272, the PLC 100 executes the intermediate code 272 while interpreting it line by line according to, for example, an interpreter method. In this embodiment, the PLC 100 describes the case where the native code 154 is executed.
  • the monitor 224 displays information on the execution result of each module in the development support environment and the sequence program 271 on the display 214.
  • the monitor 224 displays an image of the sequence circuit expanded inline in the part of the call instruction in which option 277 is set, and the part of the call instruction in which option 277 is not set. In, only the conventional call instruction is displayed. In this way, the user selects one or more calling instructions of the sequence program 271 and sets option 277 to the selected calling instruction. Therefore, when the sequence program 271 is displayed, the FUN / called by the calling instruction is displayed.
  • the FB definition 276 can be expanded inline and displayed.
  • the sequence logic of the FUN / FB definition 276 called by the call instruction in the portion of one or more call instructions desired by the user among the call instructions of the sequence program 271.
  • the circuit configuration as shown in FIG. 9 can be visualized.
  • monitor 224 includes an online monitor module 238 for monitoring the execution state of the PLC 100 with the sequence logic (sequence circuit) of the sequence program 271.
  • the online monitor module 238 acquires the circuit output state 156 indicating the execution state of the native code 154 from the PLC 100. That is, the online monitor module 238 exchanges the circuit output state 156 with the PLC 100. Then, the online monitor module 238 visualizes the execution state of the sequence program 271 in the PLC 100 via the display 214 based on the sequence circuit information 279, the definition circuit information 280, and the acquired circuit output state 156 (that is, the online monitor). I will provide a). In the online monitor, when the sequence program 271 has an inline-expanded circuit configuration, the execution state of the sequence logic is visualized and shown even in the inline-expanded sequence circuit.
  • the user can monitor the execution state of the user program including the sequence program 271 executed by the PLC 100 in real time on the support device 200.
  • FIG. 10 is a diagram schematically showing a part of the FUN / FB definition 276 according to the embodiment of the present invention.
  • the FUN / FB definition 276 includes variable names such as arguments used in FUN or FB operations, input / output distinctions and data type definitions, and sequence logic 2761.
  • the operation according to the sequence logic 2761 is executed using the values assigned to the defined variables. The execution result is output as a return value from the unit program.
  • FIG. 11 is a diagram schematically showing a part of the sequence program 271 according to the embodiment of the present invention.
  • FIG. 12 is a diagram schematically showing an example of a sequence program 271 using a call instruction of the FUN / FB definition 276 according to the embodiment of the present invention.
  • the sequence program 271 includes, for example, instructions 0, 1 and 2. Since instruction 0 and instruction 1 describe the same sequence logic, instructions 0 and 1 can be replaced with the call instruction 278 of FUN / FB definition 276 of FIG. 10, which is a common component that defines the sequence logic (FIG. 10). 12).
  • option 277 is set for instruction 0 and instruction 1 by the option setting module 2311, but option 277 is not set for instruction 2.
  • the monitor 224 performs inline expansion for the call instruction 278 of instruction 0 and instruction 1 for which option 277 is set.
  • an image of the circuit configuration according to the sequence logic 2761 of the corresponding FUN / FB definition 276 is displayed in the portion of the call instruction 278 of the instruction 0 and the instruction 1.
  • FIG. 13 is a flowchart showing an outline of the process according to the embodiment of the present invention. In the flowchart of FIG. 13, the processing of the support device 200 and the PLC 100 is shown in association with each other.
  • the user operates the support device 200 to create a user program including the sequence program 271 for PLC according to the control target (step S1). Specifically, the editor 222 edits the sequence program 271 according to the user operation by offline editing, and stores the edited sequence program 271 in the storage unit 201. In offline editing, option setting module 2311 sets option 277 to one or more selected call instructions of sequence program 271 according to user operation.
  • the monitor 224 displays the sequence program 271 on the display 214 (step S3).
  • the monitor 224 performs inline expansion for the call instruction for which option 277 is set. Therefore, at the time of offline editing, the corresponding sequence logic 2761 (sequence circuit configuration) is visualized as an image in the part of the call instruction for which option 277 is set.
  • the input and output variable names declared in the inline-expanded FUN / FB definition 276 are displayed using the parameter names specified in the call instruction part.
  • the call instruction for which option 277 is set is expanded inline, but in the present embodiment, the option setting module 2311 is already set in the call instruction according to the user operation. Enables or disables option 277.
  • inline expansion is performed to display the sequence logic 2761 (sequence circuit configuration) in the part of the call instruction in which option 277 is already set (option 277 is enabled), or the call instruction remains as it is. It is possible to switch between displaying (disable option 277).
  • the user can perform an instance name specification operation (no need to specify operation) for monitoring. Since FB has an instance name, it is not necessary to specify it.
  • the instance name is retained in the sequence program 271. If no instance name is specified, an arbitrary unique instance name will be assigned at build time.
  • the builder 223 When the creation of the sequence program 271 is completed, the builder 223 is started according to the user operation, and the build process (step T1) is executed.
  • the builder 223 generates the intermediate code 272 and the object code 2788 corresponding to the sequence program 271 in the build process.
  • the support device 200 also generates sequence circuit information 279 from the sequence program 271.
  • the sequence circuit information 279 is display information used to provide an online monitor. Details of the sequence circuit information 279 will be described later.
  • the support device 200 transfers the intermediate code 272 corresponding to the sequence program 271 to the PLC 100 (step T2).
  • the PLC 100 receives and stores the intermediate code 272 from the support device 200 (step U1).
  • the PLC 100 performs a start-up process using the received intermediate code 272 (step U2).
  • the PLC 100 generates an option table 1165 that stores a line of each call instruction in which the option is set and a set of definition names from the intermediate code 272.
  • the PLC100 executes the native code 154 (sequence program 271) (step U3).
  • sequence program 271 sequence program 271
  • the online monitor module 238 is activated by the execution instruction received via the operation reception unit 221.
  • the online monitor module 238 performs the online monitor process (step P1).
  • the online monitor module 238 requests the circuit output state 156 from the PLC 100 (step P11).
  • the user application 1164 of the PLC 100 searches the global variable table 150 based on the input / output variables of the sequence circuit defined in the sequence program 271. By this search, the circuit output state 156 indicating the execution state of the sequence program 271 (native code 154) being executed is acquired from the global variable table 150.
  • the user application 1164 transmits the acquired circuit output state 156 to the support device 200 (step U31).
  • the value of the circuit output state 156 includes the value of the inline circuit state 1166.
  • the inline circuit state 1166 indicates the value of the state of the sequence circuit (that is, the inline-expanded sequence circuit) defined by the sequence logic 2761 of each FUN / FB definition 276 in which the option 277 is set in the running sequence program 271.
  • the in-line circuit state 1166 indicates the line number and the circuit output of the sequence circuit defined by the FUN / FB definition 276 called in the line for each line (line) in which the FUN / FB definition 276 is called as shown in the option table 1165. Includes the value of the state.
  • the online monitor module 238 visualizes the sequence of the sequence program 271 including the inline-expanded sequence circuit on the display 214 based on the sequence circuit information from the PLC 100, the circuit output state 156, and the inline circuit state 1166 (step P12). .. As a result, it is possible to realize a power flow display that reflects the value of the circuit output state in the sequence circuit of the entire sequence program 271 including the sequence circuit expanded inline.
  • the user can confirm the running state of the sequence program 271 on the PLC 100 from the screen of the display 214 provided by the online monitor module 238.
  • the inline-expanded call instruction in the sequence program 271 is not as (instance name.local variable name in FUN / FB definition) but as (local variable name in FUN / FB definition). Is displayed. Therefore, the online monitor module 238 has an inline circuit state 1166 corresponding to (instance name.local variable name in FUN / FB definition) from PLC100 based on the combination of (local variable name in FUN / FB definition) and instance name. The current value is acquired by, and the power flow is displayed in the sequence circuit image expanded inline.
  • the online monitor module 238 when the online monitor module 238 performs the power flow display in the sequence program 271, it displays a watch window on the display 214, and in the watch window (instance name.local variable name in the FUN / FB definition) and its current state. You may output the value.
  • the support device 200 may request only the inline circuit state 1166 from the PLC 100 so that the power flow is displayed only in the sequence circuit image expanded inline.
  • the online monitor module 238 may switch between a mode for displaying the power flow and a mode for displaying the power flow only in the sequence circuit image expanded inline for the entire sequence program 271. This switching can be performed, for example, according to a user operation.
  • the operation reception unit 221 starts the online editor 232 according to the execution instruction received from the user (step Q1).
  • the online editor 232 edits the sequence program 271 according to the user operation received via the operation reception unit 221.
  • the circuit output state value of the sequence circuit provided by the online monitor can be visualized support information for the user to determine where the sequence logic should be changed. From the visualized circuit output state value, for example, the user determines a failure of the sequence circuit of FIG. 9A, and changes the determined failure location as shown in FIGS. 9B or 9C. Can be done.
  • the online editor 232 changes (edits) the sequence program 271 according to the user operation received from the operation reception unit 221.
  • the modified sequence program 271 is stored in the storage unit 201.
  • the builder 223 is started.
  • the builder 223 executes the build process of the sequence program 271 that has been subjected to the online edit process (step R1).
  • the builder 223 stores the intermediate code 272 obtained by the build process in the storage unit 201 and transfers it to the PLC 100 (step R2).
  • the support device 200 determines whether or not to end the process according to, for example, a user operation (step R3), and if it determines that the process ends (YES in step R3), ends the process. If it is determined that the process is not completed (NO in step R3), the process proceeds to the next process such as step P1.
  • the PLC 100 determines whether to receive the intermediate code 272 after online editing from the support device 200 (step U4).
  • the PLC 100 receives the intermediate code 272 from the support device 200 (YES in step U4)
  • the PLC 100 stores the received intermediate code 272 (step U5), and then proceeds to step U2.
  • step U4 it is possible to control the controlled object according to the sequence program 271 after the online edit and perform the online monitor process.
  • step U4 If the intermediate code 272 is not received (NO in step U4), the process ends.
  • FIG. 14 is a flowchart illustrating an online editing process according to an embodiment of the present invention.
  • the online editing process (step Q1) of FIG. 13 will be described in detail with reference to FIG. It is assumed that the target of online editing is the sequence logic expanded inline in the call instruction part or the FUN / FB definition 276 of the library 275.
  • Online editing of inline-expanded sequence logic or FUN / FB definition 276 includes creating or editing (adding, modifying, deleting, etc.) logic circuit configurations or input / output variables.
  • the edit target is a local (part) of the sequence logic expanded inline based on the user operation received by the operation reception unit 221, or the definition content of the FUN / FB definition 276. It is determined whether or not (step Q11).
  • the online editor 232 edits the inline-expanded sequence logic in one or more call instruction portions according to the user operation (step Q13), and the local flag table 273.
  • the asynchronous flag 2733 of is set to "1" (step Q17).
  • the online editor 232 uses the call name 2731, which is the name of the FUN / FB definition 276 that was called in the part of the call instruction, for each part of the call instruction edited in step Q13.
  • the position 2732 of the line in which the instruction is described and the asynchronous flag 2733 are associated and registered in the local flag table 273. At the time of this registration, the online editor 232 sets the asynchronous flag 2733 to "1".
  • the editor 222 instructs the monitor 224 to display a list of asynchronous call instruction parts in the sequence program 271 according to the user operation (step Q19). Specifically, the editor 222 scans the sequence program 271 to indicate the position 2732 of the call instruction whose corresponding asynchronous flag is "1" among the call instructions shown at the position 2732 of the local flag table 273. The information is output to the monitor 224. In the sequence program 271 displayed on the display 214, the monitor 224 changes the call instruction unit of each line indicated by the position information from the editor 222 to a predetermined display mode (for example, reverse display).
  • a predetermined display mode for example, reverse display
  • the above list display provides support information for the user to determine which sequence logic is expanded inline in the sequence program 271 and reflects the sequence logic in the content of the corresponding FUN / FB definition 276.
  • the online editor 232 determines whether or not to change the contents of the FUN / FB definition 276 according to the user operation received by the operation reception unit 221 (step Q21). When the online editor 232 determines that the definition content of the FUN / FB definition 276 is not changed (NO in step Q21), the online editor 232 ends the process.
  • the online editor 232 determines that the definition content of the FUN / FB definition 276 is changed (YES in step Q21)
  • the online editor 232 changes the FUN / FB definition 276 of the library 275 of the PLC100 (step Q23).
  • the online editor 232 extracts the call name 2731 whose asynchronous flag 2733 is "1" from the local flag table 273.
  • the online editor 232 searches the library 275 based on the extracted call name 2731. By the search, the FUN / FB definition 276 corresponding to the call name 2731 is specified, and the definition content of the specified FUN / FB definition 276 is changed by using the edit content received in step Q13.
  • This change may also include matching (copying) the defined contents of the FUN / FB definition 276 with the edited (changed) contents of the inline-expanded sequence logic.
  • the online editor 232 changes the asynchronous flag 2733 corresponding to the changed part of the calling instruction from "1" to "0".
  • step Q11 when the online editor 232 determines that the FUN / FB definition 276 is being edited ((definition) in step Q11), the online editor 232 follows the user operation and follows the user operation of one or more FUN / FB definitions 276 of the library 275.
  • the definition content is changed by editing (step Q25), and "1" is set in the definition asynchronous flag 2742 of the definition flag table 274 (step Q27).
  • the online editor 232 associates the definition name 2741, which is the name of the FUN / FB definition 276 edited in step Q25, with the definition asynchronous flag 2742, and registers the definition flag table 274. At the time of this registration, the online editor 232 sets the definition asynchronous flag 2742 to "1".
  • the online editor 232 determines whether or not to change the sequence logic of the corresponding inline expansion unit of the sequence program 271 by using the changed definition contents of the FUN / FB definition 276 according to the user operation (step Q29). When the online editor 232 determines that the change is not made (NO in step Q29), the process ends.
  • the online editor 232 determines that the sequence logic of the inline expansion unit is changed (YES in step SQ29)
  • the online editor 232 defines the circuit of the inline expansion sequence logic of the sequence program 271 as the corresponding FUN / FB definition. It is updated so as to match the changed definition contents of 276 (step Q31).
  • the online editor 232 changes the definition circuit information 280 by using the changed definition contents of the FUN / FB definition 276.
  • the definition circuit information 280 is updated with information indicating the sequence circuit configuration indicating the changed definition contents of the FUN / FB definition 276.
  • the online editor 232 instructs the monitor 224 to update the display of the inline expansion unit.
  • the monitor 224 updates the image of the sequence circuit configuration of the inline expansion unit of the sequence program 271 using the updated definition circuit information 280 in response to an instruction.
  • the online editor 232 sets all asynchronous flags 2733 registered in the local flag table 273 to "0".
  • the online editor 232 and the monitor 224 have the circuit configuration defined by the sequence logic of the changed FUN / FB definition 276 in the image of the sequence circuit configuration of the inline expansion unit of the sequence program 271 displayed on the display 214.
  • Update to the image at once As a result, the image of the circuit configuration of the sequence logic of the inline expansion unit is updated so as to show the definition contents after the change (edit) of the FUN / FB definition 276.
  • this update it is possible to provide visualization information that enables confirmation of the relationship between the peripheral circuit of the sequence program 271 and the circuit of the sequence logic.
  • one of the two cases can be implemented for changing the definition contents of the FUN / FB definition 276.
  • the definition contents of the corresponding FUN / FB definition 276 are applied to all of the plurality of call instruction parts. Make changes.
  • the definition contents of the corresponding FUN / FB definition 276 are changed for the part of.
  • the definition contents of the corresponding FUN / FB definition 276 are changed for one or more selected call instruction parts.
  • the FUN / FB definition 276 corresponding to the call instruction portion not selected by the user operation is not updated, and only the sequence logic expanded inline in the call instruction portion of the sequence program 271 is changed.
  • the online editor 232 newly saves (overwrites, etc.) the sequence logic after the user change in the sequence program 271.
  • the corresponding asynchronous flag 2733 of the local flag table 273 is left as "1" indicating the asynchronous state.
  • the builder 223 builds the sequence program 271 having the changed sequence logic.
  • the builder 223 builds the corresponding FUN / FB definition 276 as the local variable name of the sequence logic of the inline expansion unit (instance name.local variable name in the FUN / FB definition).
  • the intermediate code 272 obtained by building is transferred to the PLC100.
  • the PLC 100 generates a native code 154 based on the intermediate code 272 received from the support device 200, and the PLC 100 executes the sequence program 271 (native code 154).
  • the online monitor module 238 of the support device 200 receives the circuit output state 156 from the PLC 100, and uses the received circuit output state 156 to perform power line display in the sequence logic of the inline expansion unit in the asynchronous state. From the circuit output state 156 visualized in this way, the user can use the sequence logic of the inline expansion unit in the asynchronous state to provide support information for determining whether to update the corresponding FUN / FB definition 276. Obtainable.
  • FIG. 15 is a flowchart illustrating a build process according to an embodiment of the present invention.
  • the build process (step R1) after the online edit of FIG. 13 will be described in detail with reference to FIG.
  • the build process of FIG. 15 will be mainly described with the process of the call command unit.
  • the builder 223 scans the sequence program 271 line by line from the beginning (step R11). If the calling command unit is detected by scanning (YES in step R13), the process proceeds to step R15, but if the calling command unit is not detected (NO in step R13), the process proceeds to step R23.
  • step R15 the builder 223 determines whether or not option 277 of the call command unit is set (step R15). If it is determined that the option 277 is not set in the call command unit (nothing in step R15), the process proceeds to step R21. When it is determined that the option 277 is set (in step R15), the builder 223 determines whether the FUN / FB definition 276 called by the calling command unit is in the online editing of the definition flag table 274. Correspondence definition Judgment is made based on whether or not the asynchronous flag 2742 is "1" (step R17).
  • step R21 the builder 223 assigns a predetermined (normal) call instruction code to the call instruction unit. If the definition asynchronous flag 2742 is determined to be "0", i.e. not in online editing (NO in step R17), the builder 223 tells this calling commander a code that follows the sequence logic 2761 of the corresponding FUN / FB definition 276. Is assigned (step R19). In this assigned code, (instance name.local variable name in the FUN / FB definition) is assigned to the local variable name defined by the FUN / FB definition 276.
  • the builder 223 determines whether or not the scanning of all the lines of the sequence program 271 has been completed, and if it is determined that the scanning has not been completed (NO in step R23), the builder returns to step R11. On the other hand, when the builder 223 determines that the scanning is completed (YES in step R23), the builder 223 generates the intermediate code 272 from the sequence program 271 (step R25).
  • Steps R17 and R21 in the above build process will be further described.
  • step R17 when the builder 223 determines that the corresponding definition asynchronous flag 2742 of the FUN / FB definition 276 called by the calling command unit is "1" (YES in step R17), the calling command unit is normally used.
  • the code of the call instruction is assigned (step R21), and the build process is executed.
  • the online-edited sequence logic of the FUN / FB definition 276 can be executed by a normal calling instruction.
  • the sequence logic (of the calling command unit in which option 277 is set) expanded inline can also be changed by online editing.
  • FIG. 20 is a diagram schematically showing an example of sequence circuit information according to the present embodiment. With reference to FIG. 20, for example, information on circuit components included in each circuit defined by a user program for PLC is described.
  • FIG. 20 shows an example of a circuit including one contact 2781 and one coil 2791.
  • the circuit definition 2811 of the sequence circuit information 279 includes type information 2821 indicating a type such as "circuit" and circuit component information 2831,2841 indicating information of circuit components included in each circuit.
  • the circuit definition 2811 shown in FIG. 20 is repeated by the number of circuits specified in the sequence program 271.
  • circuit definition circuit information 280 the circuit definition is repeated as many as the number of circuit configurations defined by the sequence logic 2761 of the FUN / FB definition 276.
  • the description example of the circuit definition 2811 shown in FIG. 20 is an example, and any format may be followed.
  • FIG. 16 is a diagram for explaining the execution start timing of the control program transferred by the online editing function according to the embodiment of the present invention.
  • This control program is a concept including a sequence program 271.
  • FIG. 16 shows a processing example in the case of transferring the three sequence programs 271 shown by SA, SB, and SC.
  • FIG. 16 shows an example in which when the transfer of each sequence program 271 is completed, the execution of the sequence program 271 for which the transfer is completed is started.
  • one arrow ( ⁇ ) indicates one task execution cycle by the task scheduler 1142. Further, the "check" step of FIG. 16 is executed by the program manager 1144.
  • the program manager 1144 determines whether or not the reception of the sequence program 271 transferred from the support device 200 is completed in steps T2 and R2 of FIG. That is, the time related to the transfer varies due to various factors such as the size of the edited sequence program 271 being variable. Even if there is such a time variation, the program manager 1144 maintains the reception completion timing signal when the reception of the sequence program 271 by the transfer is completed so that the execution cycle of the task according to the sequence program 271 is maintained in the PLC 100. Is output to the task scheduler 1142. The task scheduler 1142 receives the timing signal from the program manager 1144 and shifts the transferred sequence program 271 to an executable state when the execution cycle is reached.
  • the program manager is also used in the same manner as in FIG.
  • the 1144 detects that the reception is completed and outputs a timing signal.
  • the task scheduler 1142 receives the timing signal from the program manager 1144, and when the execution cycle arrives, shifts the transferred FUN / FB definition 276 to a callable state.
  • a support program that provides a development support environment for executing the processing of each flowchart shown in the present embodiment is stored in the storage unit 201 of the support device 200.
  • the support programs 700 and 710 are recorded on a computer-readable recording medium such as a flexible disk, a CD-ROM (Compact Disk-Read Only Memory), a ROM, a RAM, and a recording medium 250 attached to the support device 200. It can also be provided as a product.
  • the recording medium 250 stores the information of the program or the like by electrical, magnetic, optical, mechanical or chemical action so that the computer or other device, the machine or the like can read the information of the recorded program or the like. It is a medium to do.
  • the support programs 700 and 710 can be recorded by a recording medium such as HDD 208 built in the support device 200 to provide the program.
  • the program can also be provided by downloading from a network (not shown) via a communication interface.
  • FIGS. 17 to 19 are diagrams illustrating the advantages of the development support environment according to the embodiment of the present invention.
  • 17 to 19 are examples of a sequence program 271 that outputs the same execution result when executed.
  • the power flow display which is the output of the execution result, is shown by a thick line. Has been done.
  • FIG. 17 shows a case in which this request is met.
  • the FUN / FB definition 276 (part) that defines the sequence logic is replaced with a call instruction that is called and executed from the library 275.
  • the edited contents are simultaneously reflected in the FUN / FB definition 276 (part) called by instruction 0 and instruction 1 of the sequence program 271. be able to.
  • FIG. 19 is a sequence program 271 that can be created by the development support environment according to the present embodiment in response to both of these requests.
  • instruction 0 and instruction 1 indicate a calling instruction that calls the same FUN / FB definition 276, but the sequence logic 2761 of the FUN / FB definition 276 is inlined in the calling instruction unit.
  • the online monitor module 238 implements a power line display indicating the execution result in the sequence logic expanded inline. Further, as described in (i1-1. Specific example of local editing), even if the inline-expanded sequence logic of instruction 0 is edited by the online editor 232, the sequence logic of instruction 1 is still edited. It is also possible not to change the content.
  • the support device 200 compares the asynchronous sequence logic inlined in the sequence program 271 with the definition contents (sequence logic 2761, etc.) of the corresponding FUN / FB definition 276 of the library 275 as a source program. Then, the information indicating the difference is output.
  • the changed sequence logic is used as a complete local logic independent of the corresponding FUN / FB definition 276 of the library 275.
  • the support device 200 merges the local variable of the corresponding FUN / FB definition 276 into the variable table of the call instruction code part of the FUN / FB definition 276.
  • the monitor 224 may be a development support environment including the monitor 224, which is not an essential configuration requirement. That is, it may be provided as a development support environment including at least an editor 222 (more specifically, a local editor 233).
  • the sequence program includes a call instruction of a unit program (276) constituting the sequence program.
  • the support device is An operation reception unit (221) that receives operations on the support device, and A monitor unit (224) that expands and displays a call instruction of the unit program in a circuit indicated by the sequence logic defined by the unit program when the sequence program is displayed.
  • An editor unit (222) that changes the sequence logic to a sequence logic that represents the changed circuit according to the displayed operation of changing the circuit.
  • a code conversion unit (223) that converts the sequence program into executable code is provided.
  • the code conversion unit A support device that performs the conversion by allocating one of the changed sequence logic code and the calling instruction code to the calling instruction in the sequence program according to the switching option.
  • a setting unit (2311) for setting the switching option in the calling instruction of the sequence program according to the setting operation is further provided.
  • the monitor unit The support device according to configuration 1, wherein when the sequence program is displayed, when the switching option is set in the calling instruction, the calling instruction is expanded and displayed in the circuit.
  • the control device includes a library (275) for callably storing the sequence logic code of the unit program.
  • the control device includes a library (275) for callably storing the sequence logic code of the unit program.
  • the sequence program includes one or more of the calling instructions. 4.
  • Support device [Structure 5] The support device according to configuration 4, which displays a list of call instructions whose sequence logic has been changed by the editor unit among the one or more call instructions.
  • the monitor unit A circuit output state (156; 1166) indicating an execution state of the sequence logic defined by the unit program is acquired from the control device, and based on the circuit indicated by the sequence logic defined by the unit program and the acquired circuit output state.
  • the support device according to any one of configurations 1 to 5, which visualizes the execution state of the sequence logic in the control device in the expanded circuit.
  • It is a support program (710) directed to support the development of a sequence program (271) executed by a control device (100) that controls a controlled object.
  • the sequence program includes a call instruction of a unit program (276) constituting the sequence program.
  • the support program is provided on the computer (200).
  • the step of converting to the executable code is A support program comprising a step of assigning one of the modified sequence logic code and the calling instruction code to the calling instruction in the sequence program according to a switching option to perform the conversion.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

シーケンスプログラム開発を効果的に支援することが可能な環境を提供する。シーケンスプログラムの開発を支援するサポート装置は、シーケンスプログラムの表示時に、シーケンスプログラムを構成する単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示し、当該回路を変更する操作に従い、当該回路のシーケンスロジックを変更し、シーケンスプログラムを実行可能コードに変換する場合に、切替えオプションに従い、シーケンスプログラム中の呼出し命令に、変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てる。

Description

サポート装置およびサポートプログラム
 本開示は、制御対象を制御する制御装置で実行される制御プログラムの開発を支援するサポート装置およびそれを実現するためのサポートプログラムに関する。
 様々な製造現場において、PLC(Programmable Logic Controller)などの制御装置が導入されている。このような制御装置は、一種のコンピュータであり、製造装置や製造設備などに応じて設計されたユーザープログラムに含まれる制御プログラムが実行される。このような制御プログラムは、制御装置とは別に用意された開発環境にて作成される。開発環境を提供するとともに、制御装置に対して制御プログラムをアップロードし、あるいは、制御装置に対して制御プログラムをダウンロードする機能を提供する装置は、サポート装置とも称される。制御プログラムは、制御シーケンスを表すシーケンスプログラムを含む。
 シーケンスプログラムにおいては、共通したシーケンスロジックを、当該ロジックを記述するファンクションブロックとして準備し、シーケンスプログラム中でファンクションブロックの呼出し命令を記述することで、ファンクションブロックの部品化および再利用が可能となり、プログラムの開発効率を高めることができる。
 例えば、特開2001-5517号公報(特許文献1)では、コントローラで実行中のプログラムのもととなった、ファンクションブロックを用いて記述した制御ロジック図と、コントローラにおけるプログラムの実行状況を関連付けて表示する装置を開示する。
 また、特開2004-295872号公報(特許文献2)は、ユーザープログラムの編集対象がどこであっても、また編集箇所が多くなっても(ファンクションブロック編集を含む)、オンラインエディットによる編集処理が行えるユーザープログラムの編集方法を開示する。
特開2001-5517号公報 特開2004-295872号公報
 上記のようにファンクションブロックを部品化されることで、シーケンスプログラムでは部品を呼出す命令コードを記載することでよくなり、シーケンスプログラムの構造が把握しやすくなるとの利点がある。その一方で、プログラムの開発シーンでは、ファンクションブロック内で実際に記述されるロジックコードを開発する環境の充実化が望まれていた。
 本開示の一つの目的は、シーケンスプログラム開発を効果的に支援することが可能な環境を提供することである。
 本開示の一例は、制御対象を制御する制御装置で実行されるシーケンスプログラムの開発を支援するサポート装置であって、シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラムの呼出し命令を含み、サポート装置は、サポート装置に対する操作を受付ける操作受付部と、シーケンスプログラムの表示時に、単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するモニタ部と、表示される前記回路を変更する操作に従い、シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するエディタ部と、シーケンスプログラムを実行可能コードに変換するコード変換部と、を備え、コード変換部は、切替えオプションに従い、シーケンスプログラム中の呼出し命令に、変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて変換を実施する。
 この開示によれば、シーケンスプログラム中で同じ単位プログラムを呼出す呼出し命令が複数箇所に記述される場合に、ある1つ箇所の呼出し命令はエディタ部による変更後のシーケンスロジックを割当てて、他の箇所の呼出し命令は元の呼出し命令コードのままとして、実行可能なコードに変換することができる。
 上述の開示において、サポート装置は、設定操作に従い、シーケンスプログラムの呼出し命令に切替えオプションを設定する設定部と、を備え、モニタ部は、シーケンスプログラムを表示する場合に、呼出し命令に切替えオプションが設定されているとき、当該呼出し命令を回路に展開して表示する。
 この開示によれば、シーケンスプログラムの表示時には、シーケンスプログラム中の切替えオプションを設定された呼出し命令において、当該呼出し命令に代えて、呼出されるべき単位プログラムが定義するシーケンスロジックによる回路が表示される。
 上述の開示において、制御装置は、単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリを備え、ライブラリに格納されるシーケンスロジックのコードを、変更後のシーケンスロジックのコードを用いて変更する。
 この開示によれば、エディタ部による、シーケンスプログラム中の変更後のシーケンスロジックのコードを、制御装置のライブラリ中の対応の単位プログラムのシーケンスロジックのコードの編集に用いることができる。
 上述の開示において、上述の開示において、制御装置は、単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリを備え、シーケンスプログラムは、1つ以上の前記呼出し命令を含み、選択操作に従い、1つ以上の呼出し命令のうち、ライブラリのシーケンスロジックのコードの変更に用いる変更後のシーケンスロジックを有する呼出し命令を選択する。
 この開示によれば、シーケンスプログラム中の変更後の各呼出し命令に対応のシーケンスロジックのコードのうちから、上記のライブラリ中の対応の単位プログラムのシーケンスロジックのコードの編集に用いるコードを選択することができる。
 上述の開示において、1つ以上の呼出し命令のうちエディタ部によりシーケンスロジックの変更がなされた呼出し命令の一覧を表示する。
 この開示によれば、ユーザーは、表示される呼出し命令の一覧のうちから、上記のライブラリ中の対応の単位プログラムのシーケンスロジックのコードの編集に用いる呼出し命令(すなわち、エディタ部によりシーケンスロジックの変更がなされた呼出し命令)を選択することができる。
 上述の開示において、モニタ部は、制御装置から単位プログラムが定義するシーケンスロジックの実行状態を示す回路出力状態を取得するとともに、単位プログラムが定義するシーケンスロジックが示す回路および取得した回路出力状態に基づいて、制御装置における当該シーケンスロジックの実行状態を、展開された回路において視覚化する。
 この開示によれば、制御装置で実行中のシーケンスプログラムの実行状態を、サポート装置で表示される呼出し命令の部分で展開される回路において視覚化して提示することができる。
 本開示の一例は、制御対象を制御する制御装置で実行されるシーケンスプログラムの開発の支援に向けられたサポートプログラムであって、シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラムの呼出し命令を含み、サポートプログラムはコンピュータに、コンピュータに対する操作を受付けるステップと、シーケンスプログラムの表示時に、単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するステップと、表示される回路を変更する操作に従い、シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するステップと、シーケンスプログラムを実行可能コードに変換するステップと、を備え、実行可能コードに変換するステップは、切替えオプションに従い、シーケンスプログラム中の呼出し命令に、変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて変換を実施するステップを含む。
 この開示によれば、サポートプログラムが実行されることにより、シーケンスプログラム中で同じ単位プログラムを呼出す呼出し命令が複数箇所に記述される場合に、ある1つ箇所の呼出し命令はエディタ部による変更後のシーケンスロジックを割当てて、他の箇所の呼出し命令は元の呼出し命令コードのままとして、実行可能なコードに変換することができる。
 本開示の一例によれば、シーケンスプログラム開発を効果的に支援することが可能な環境が提供される。
本発明の実施の形態に係るサポート装置200を適用可能なPLCシステム1の構成例を示す模式図である。 図1に示すPLCシステムを構成するPLC100のハードウェア構成例を示す模式図である。 本発明の実施の形態に係るサポート装置200のハードウェア構成例を示す模式図である。 本発明の実施の形態に係るPLC100のソフトウェア構成の一例を示す模式図である。 本発明の実施の形態に係るPLC100におけるユーザープログラム112と変数テーブル間のデータの参照例を説明する図である。 本発明の実施の形態に係るサポート装置200のソフトウェア構成の一例を示す模式図である。 本発明の実施の形態に係る局所フラグテーブル273の一例を模式的に示す図である。 本発明の実施の形態に係る定義フラグテーブル274の一例を模式的に示す図である。 本発明の実施の形態に係るシーケンスロジックの編集の一例を模式的に示す図である。 本発明の実施の形態に係るFUN/FB定義276の一部を模式的に示す図である。 本発明の実施の形態に係るシーケンスプログラム271の一部を模式的に示す図である。 本発明の実施の形態に係るFUN/FB定義276の呼出し命令を用いたシーケンスプログラム271の一例を模式的に示す図である。 本発明の実施の形態に係る処理の概要を示すフローチャートである。 本発明の実施の形態に係るオンラインエディット処理を説明するフローチャートである。 本発明の実施の形態に係るビルド処理を説明するフローチャートである。 本発明の実施の形態に従うオンラインエディット機能によって転送された制御プログラムの実行開始タイミングを説明するための図である。 本発明の実施の形態に係る開発支援環境により奏される利点を説明する図である。 本発明の実施の形態に係る開発支援環境により奏される利点を説明する図である。 本発明の実施の形態に係る開発支援環境により奏される利点を説明する図である。 本実施の形態に係るシーケンス回路情報の一例を模式的に示す図である。 本開示の適用例を模式的に説明するための図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。
 [§.適用例]
 まず、本発明が適用される場面の一例について説明する。図21は、本開示の適用例を模式的に説明するための図である。図21を参照して、本開示に係るサポート装置200は、製造現場の製造設備等の対象を制御する制御装置と接続され得る。両者は、例えばUSB(Universal Serial Bus)により通信する。サポート装置200は、制御装置で実行される制御プログラムの開発を支援する環境を提供する。以下の説明においては、制御装置の典型例としてPLC100を示すが、PLCに限定されない。
 サポート装置200は、制御プログラムを含む各種ユーザープログラムを開発する環境を提供する。開発対象のプログラムは、例えば国際規格IEC61131-3に従うプログラムを含み得る。国際規格IEC61131-3おいては、制御プログラムを含むPLCアプリケーションのプログラミング言語として、ラダーダイアグラム(LD:Ladder Diagram)、ファンクションブロックダイアグラム(FBD:Function Block Diagram)、シーケンシャルファンクションチャート(SFC:Sequential Function Chart)、インストラクションリスト(IL:Instruction List)、ストラクチャードテキスト(ST:Structured Text)の5種類を規定する。本実施の形態に係る制御プログラムは、シーケンスプログラム271であって、いずれのプログラミング言語で記述されたシーケンスプログラム271であってもよい。以下では、典型例として、ラダーダイアグラムで記述されたシーケンスプログラム271について説明する。
 PLC100は、関数およびファンクションブロックを含む複数の単位プログラムの実行可能コードを格納するライブラリ275を備える。シーケンスプログラム271は、当該シーケンスプログラム271を構成する1または複数の単位プログラムを呼出す呼出し命令を含む。したがって、PLC100で、シーケンスプログラム271が実行中に、呼出し命令が実行されることにより、ライブラリ275から対応の単位プログラムが呼出されて実行される。
 サポート装置200は、PLC100で実行されるシーケンスプログラム271を開発する環境を提供する。開発環境は、モニタ224、エディタ222、ビルダ223などを備える。モニタ224は、シーケンスプログラム271をディスプレイ214に表示する時に、単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示する。エディタ222は、ディスプレイ214に表示される回路を変更する操作に従い、回路のシーケンスロジックを変更する。ビルダ223は、シーケンスプログラム271をPLC100で実行可能なコードに変換する場合に、切替えオプションに従い、シーケンスプログラム271中の呼出し命令に、変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てながら当該変換を実施する。
 これにより、例えばシーケンスプログラム271の編集時には、呼出される単位プログラムを、当該単位プログラムが定義するシーケンスロジックが表す回路に展開して表示することができる。このことは、シーケンスプログラム271の編集時など開発現場において、呼出し命令で呼出される単位プログラム内で実際に記述されるシーケンスロジックコードをシーケンス回路で把握することを可能にする。
 また、表示されたシーケンス回路を変更する操作をすることにより、ユーザーは、当該回路の元のシーケンスロジックを、変更後の回路が示すシーケンスロジックに変更することができる。
 シーケンスプログラム271を実行可能なコードを変換する場合は、切替えオプションにより、各呼出し命令に、変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てながら実行可能なコードに変換することができる。このことは、切替えオプションの設定により、所望する呼出し命令についてのみ、変更後のシーケンスロジックのコードが割当てられた実行可能コードの取得を可能にする。したがって、PLC100において、当該実行可能コードに変換後のシーケンスプログラム271が実行される場合は、元は同じ単位プログラムを呼出す命令コードが複数記述されていた場合でも、ある1の呼出し命令コードではユーザーによる変更後のシーケンスロジックコードが実行させながら、他の1の命令コードでは、ライブラリ275から読出されたシーケンスロジックコードが実行させることができる。これにより、共通化した部品である単位プログラムを、シーケンスプログラム271の使用箇所毎に変更することができる。
 また、サポート装置200は、PLC100のライブラリ275に格納される単位プログラムのシーケンスロジックのコードを、変更後のシーケンスロジックのコードを用いて変更する。これにより、上記のある1の呼出し命令コードとして実行された変更後のシーケンスロジックコードの実行結果が適切であると確認できたときは、ユーザーは、ライブラリ275に格納される対応の単位プログラムのシーケンスロジックのコードを、適切と確認できた変更後のシーケンスロジックコードに変更(更新)することができる。これにより、シーケンスプログラム271において共通化した部品である単位プログラムが複数箇所で呼出される場合であっても、1箇所だけを、実行されるシーケンスロジックコードを他の箇所を異ならせて、シーケンスプログラム271を実行させて、その結果を得た上で、ライブラリ275の単位プログラムのシーケンスロジックのコードを変更することが可能となる。
 以下、本発明のより具体的な応用例として、本実施の形態に係るサポート装置200のより詳細な構成および処理について説明する。
 <A.ソフトウェア構成>
 上記に述べた適用例を実現するためのソフトウェア構成を説明する。図6は、本発明の実施の形態に係るサポート装置200のソフトウェア構成の一例を示す模式図である。
 このソフトウェア構成においては、制御対象に応じて任意に作成されるユーザープログラム(シーケンスプログラム271)の制御装置における実行状態を確認する機能である「オンラインモニタ」が提供される。オンラインモニタは、上記に述べたパワーフロー表示を含む概念である。
 また、ユーザープログラム(シーケンスプログラム271)の制御装置で実行されるシーケンスプログラム271を編集して更新する機能である「オンラインエディタ」も提供される。
 本実施の形態では、サポート装置200は、「オンライエディタ」と、パワーフロー表示を含む「オンラインモニタ」の両方の環境を提供するように構成されるが、いずれか1方の環境を提供するとしてもよい。例えば、サポート装置200は、「オンラインモニタ」は備えずに「オンライエディタ」のみを提供するよう構成されてもよい。
 図6では、PLC100とのデータの遣り取りと関連づけて、サポート装置200のソフトウェア構成が示される。図6を参照して、サポート装置200は、シーケンスプログラム271から中間コード272を生成し、PLC100に転送する。PLC100は、サポート装置200から受信した中間コード272をネイティブコードに変換する。PLC100の演算処理部は、ネイティブコードを実行する。ネイティブコードの実行により、制御対象に対する制御が実現される。シーケンスプログラム271は、当該シーケンスプログラム271を構成する単位プログラムを呼出す呼出し命令部を含む。本実施の形態では、単位プログラムとして、ファンクション(FUN:function)またはファンクションブロック(FB:Function Block)の定義であるFUN/FB定義を例示する。FUN/FB定義は、シーケンスプログラム271の記述を効率化するための共通部品として、PLC100のライブラリ等に登録されて、シーケンスプログラム271の実行時には適宜、ライブラリから呼出されて定義されたシーケンスロジックが実行される。なお、単位プログラムの定義内容は、当該単位ブロックを記述するプログラム言語の仕様に依存するが、本実施の形態では、上記のラダーダイアグラムに従うシーケンスロジックによる回路構成を規定する。この回路構成は、主に、論理的な回路構成を含む。
 また、サポート装置200は、サポート装置200においてモニタ224による画面表示を実現するためのオブジェクトコード2788を記憶部201に格納する。サポート装置200の記憶部201には、さらに、PLC100用のユーザープログラムから生成され、シーケンスプログラムの回路構成を規定するシーケンス回路情報279および定義回路情報280が格納される。定義回路情報280は、上記のFUN/FB定義により規定される回路構成を示す。
 サポート装置200は、シーケンスプログラム271を作成するためのエディタ222を備える。エディット時には、エディタ222が有するオプション設定モジュール2311は、操作部203から操作受付部221が受付けたユーザー操作に従い、シーケンスプログラム271における単位プログラムの呼出し命令のうちから1つ以上を選択し、選択された呼出し命令に、表示態様の切替えオプションを設定する。
 したがって、エディット時は、モニタ224によりシーケンスプログラム271が表示されながら命令コードの追加、削除、変更等がなされるが、その場合に、1つ以上の呼出し命令は、設定された上記のオプションに基づき対応の単位プログラムが定義するシーケンスロジックが示す回路構成の画像に切替えられる。これにより、単位プログラムの呼出し命令として、当該単位プログラムが規定する回路構成がインライン展開されて表示される。このように、ユーザー操作により、1つ以上の呼出し命令部に選択的にオプションが設定されることにより、1つ以上の呼出し命令部において対応の単位プログラムが規定する回路構成が視覚化される。
 このような視覚化は、オンラインエディット時にも実施される。オンラインエディタ232の局所エディタ233は、シーケンスプログラム271のインライン展開された回路構成の画像に対する変更の操作に従い、シーケンスプログラム271を編集(変更)する。また、定義エディタ234は、インライン展開された回路構成の画像を変更操作に従い、PLC100のライブラリに登録されたFUN/FB定義の定義内容(シーケンスロジック)を編集(変更)する。
 また、サポート装置200は、オンラインモニタを提供するためのオンラインモニタモジュール238を有している。オンラインモニタモジュール238は、PLC100からネイティブコードの実行状態を示す回路出力状態156(後述する)を取得する。すなわち、サポート装置200(オンラインモニタモジュール238)は、PLC100との間で、回路出力状態156を遣り取りする。そして、サポート装置200のオンラインモニタモジュール238は、シーケンス回路情報279、定義回路情報280および取得した回路出力状態156に基づいて、PLC100におけるシーケンスプログラムの実行状態を視覚化する(すなわち、オンラインモニタを提供する)。この実行状態の視覚化によって、ユーザーが、シーケンスロジックを編集(変更)するための判断を支援する情報が提供される。
 このような、インライン展開のオプションを備えるエディタおよびPLC100で実行状態を視覚化するオンラインモニタにより、単位プログラムおよびシーケンスプログラム等の効率的な開発を支援する環境が提供される。
 以下、本発明のより具体的な応用例として、本実施の形態に係るサポート装置200のより詳細な構成および処理について説明する。
 <B.システム構成>
 図1は、本実施の形態に従うサポート装置200を適用可能なPLCシステム1の構成例を示す模式図である。
 図1を参照して、PLCシステム1は、複数のPLC100-1,100-2,100-3,100-4,…(以下、「PLC100」とも総称する。)を含んでいる。PLC100の各々は、リレー,センサー等のフィールド機器である制御対象を制御する制御装置の一例である。サポート装置200は、PLC100に接続可能であり、PLC100の制御プログラムの開発を支援する環境を提供する。PLCシステム1は、1台のPLC100を含む構成であってもよい。以下では、説明を簡単にするために、1台のPLC100を対象にした開発環境を説明する。
 PLC100は、典型的には、制御プログラムを含む各種プログラムを実行する主体であるCPUユニット10と、CPUユニット10などへ電力を供給する電源ユニット12と、フィールドからの信号を遣り取りするI/O(Input/Output)ユニット14とを含む。I/Oユニット14は、CPUユニット10とシステムバス11を介して接続されている。
 サポート装置200が提供する開発支援環境は、制御プログラムのエディタ(編集)、デバッカ、シミュレータおよびこれらの出力情報をディスプレイ等のモニタに出力するためのモニタ機能等を有し得る。サポート装置200は、さらに、運転中のPLC100の状態値を取得し、ディスプレイ等のモニタに出力する機能なども備える。
 記録媒体250に格納されたアプリケーションプログラムであるサポートプログラムがサポート装置200にインストールされることで、上述したような開発支援環境のための各種機能が実現される。記録媒体250に代えて、外部のサーバ装置などからネットワークを介して、サポートプログラムをダウンロードするようにしてもよい。サポート装置200は、一例として、接続ケーブルを介してPLC100のCPUユニット10と接続される。サポート装置200は、典型的には、パーソナルコンピュータで実現される。
 <C.PLC100のハードウェア構成例>
 次に、PLC100のハードウェア構成例について説明する。図2は、図1に示すPLCシステムを構成するPLC100のハードウェア構成例を示す模式図である。
 図2を参照して、PLC100は、予めインストールされたプログラムをプロセッサが実行することで、制御対象に対する制御を実現する。より具体的には、PLC100は、CPU(Central Processing Unit)やMPU(Micro-Processing Unit)などのプロセッサ102と、チップセット104と、メインメモリ106と、フラッシュメモリ108と、USBインターフェイス116と、メモリカードインターフェイス118と、内部バスコントローラ122と、フィールドバスコントローラ124とを含む。フラッシュメモリ108は、システムプログラム110およびユーザープログラム112を格納する。
 プロセッサ102は、フラッシュメモリ108に格納されたシステムプログラム110およびユーザープログラム112を読み出して、メインメモリ106に展開して実行することで、制御対象に対する制御を実現する。本明細書において、「制御プログラム」は、御対象に応じて任意に設計されるプログラムの一種であり、システムプログラム110およびユーザープログラム112を包含する概念である。但し、実装方式においては、制御プログラムは、ユーザープログラム112のみを含む場合もある。
 システムプログラム110は、データの入出力処理や実行タイミング制御などの、PLC100の基本的な機能を提供するための命令コードを含む。ユーザープログラム112は、シーケンス制御を実行するためのシーケンスプログラム112A(シーケンスプログラム271に対応)およびライブラリ275を含む。ライブラリ275は、シーケンスプログラム112Aの実行時にシーケンスプログラム112Aから呼出し可能な各種関数および1または複数のFUN/FB定義276を含む。
 なお、ユーザープログラム112は、モーションプログラム等の他のプログラムを含み得るが、本実施の形態では、説明のためにシーケンスプログラム112Aを主体に説明する。また、本実施の形態では、シーケンスプログラム112Aとして、例えばIEC61131-3等で規定されるラダー言語により、ラダーロジック回路(論理回路)またはラダーロジック回路の組合せにより表される演算の命令コードを記述する「ラダープログラム」を含む。
 ライブラリ275のFUN/FB定義276は、FUNまたはFBの定義内容を表す。FUN/FB定義276が定義するFUNまたはFBは、シーケンスプログラムを構成する単位プログラム(以下、POU(Program Organization Unit)とも称する)に相当する。FUNまたはFBにより定義されるシーケンスロジックのコードは、論理回路または論理回路の組合せからなるシーケンスロジック回路(例えば、ラダーロジック回路)を表す。
 チップセット104は、各コンポーネントを制御することで、PLC100全体としての処理を実現する。
 内部バスコントローラ122は、PLC100と内部バスを通じて連結されるI/Oユニット14との間でデータを遣り取りするインターフェイスである。フィールドバスコントローラ124は、PLC100と図示しないフィールドバスを通じて連結されるI/Oユニット16との間でデータを遣り取りするインターフェイスである。内部バスコントローラ122およびフィールドバスコントローラ124は、対応のI/Oユニット14および16にそれぞれ入力される状態値を取得するとともに、プロセッサ102での演算結果を対応のI/Oユニット14および16から指令値としてそれぞれ出力する。
 USB(Universal Serial Bus)インターフェイス116は、USBによりデータの遣り取りを制御する。サポート装置200は、USBインターフェイス116を介してPLC100と通信する。メモリカードインターフェイス118は、メモリカード120を着脱可能に構成されており、メモリカード120に対してデータを書込み、メモリカード120からデータを読出すことが可能になっている。
 図2には、プロセッサ102がプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASIC(Application Specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)など)を用いて実装してもよい。あるいは、PLC100の主要部を、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコンをベースとした産業用パソコン)を用いて実現してもよい。この場合には、仮想化技術を用いて、用途の異なる複数のOS(Operating System)を並列的に実行させるとともに、各OS上で必要なアプリケーションを実行させるようにしてもよい。
 <D.サポート装置200のハードウェア構成例>
 図3は、本発明の実施の形態に係るサポート装置200のハードウェア構成例を示す模式図である。図3を参照して、サポート装置200は、典型的には、汎用のコンピュータで構成される。なお、PLC100が配置される製造現場における保守性の観点からは、可搬性に優れたノート型のパーソナルコンピュータが好ましい。
 サポート装置200は、記憶部201と、オペレーティングシステム(OS)を含む各種プログラムを実行するCPU202とを備える。記憶部201は、BIOSや各種データを格納するROM(Read Only Memory)204と、CPU202でのプログラムの実行に必要なデータを格納するための作業領域を提供するメモリRAM(Random Access Memory)206と、CPU202で実行されるプログラムなどを不揮発的に格納するハードディスク(HDD)208とを含む。
 サポート装置200は、さらに、サポート装置200に指示を入力するためにユーザーが操作するキーボード210およびマウス212を含む操作部203、および情報をユーザーに提示するためのディスプレイ214を含む。サポート装置200は、PLC100(CPUユニット10)などと通信するための通信インターフェイス218を含む。通信インターフェイス218は、USBインターフェイス116と通信するためにUSB通信モジュールを含み得る。
 サポート装置200は、記録媒体250からそれに格納されている開発支援環境を提供するためのサポートプログラムを読み取るための光学記録媒体読取装置216を含む。
 図3には、CPU202等のプロセッサがプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASICまたはFPGAなど)を用いて実装してもよい。この場合には、仮想化技術を用いて、用途の異なる複数のOSを並列的に実行させるとともに、各OS上で必要なアプリケーションを実行させるようにしてもよい。
 <E.PLCのソフトウェア構成例>
 図4は、本発明の実施の形態に係るPLC100のソフトウェア構成の一例を示す模式図である。
 図4を参照して、PLC100においては、ハイパーバイザ111がPLC100のハードウェアリソースを管理するとともに、リアルタイムOS114および汎用OS1161に対して、これらのハードウェアリソースを調停しながら割当てることで、共通のハードウェアリソース上で、互いに独立したリアルタイムOS114および汎用OS1161を実行させる。すなわち、ハイパーバイザ111を用いて、複数の異なるOSを実行する仮想化環境を実現する。リアルタイムOS114と汎用OS1161との間は、ハイパーバイザ111を介して、論理的なネットワークが構成されている。
 リアルタイムOS114では、シーケンスプログラムを含むユーザープログラム112が実行される。ユーザープログラム112の実行にあたって、タスクスケジューラ1142と、プログラムマネージャ1144と、I/O(Input/Output)制御プロセス1146とが連係する。ユーザープログラム112は、予め実行形式に変換されており、この実行形式のコードが、タスクスケジューラ1142、プログラムマネージャ1144、I/O制御プロセス1146と連係しつつ、制御対象からの信号の取得、制御ロジックの実行、実行結果の反映(アクチュエータの制御)を繰返す。
 I/O制御プロセス1146は、制御対象との間で各種信号を遣り取りする処理を司る。タスクスケジューラ1142は、ユーザープログラム112に含まれるタスク毎に、実行周期または実行タイミングを制御する。本実施の形態では、タスクスケジューラ1142は、タスクの実行周期に従う開始タイミングが到来した場合に、プログラムマネージャ1144からタイミング信号を受付けたとき、当該タスクを実行する。プログラムマネージャ1144のタイミング信号を用いた実行制御の詳細は後述する。
 汎用OS1161では、任意のユーザーアプリケーション1164および汎用アプリケーション1162が実行される。
 ユーザーアプリケーション1164は、典型的には、リアルタイムOS114で実行されるユーザープログラム112の開発ベンダなどによって作成されるアプリケーションであり、ユーザープログラム112の処理結果に係るデータおよび/または処理に必要なデータを取得および/または提供するような処理を実行する。
 汎用アプリケーション1162は、汎用OS1161で実行可能な標準的なアプリケーションであり、ユーザーアプリケーション1164と連係することで、汎用的な処理や機能を用いて、より少ない工数でシステムを構築することができる。
 <F.PLC100のソフトウェア間の参照例>
 図5は、本発明の実施の形態に係るPLC100におけるユーザープログラム112と変数テーブル間のデータの参照例を説明する図である。
 図5を参照して、PLC100では、制御プログラムを実行する場合に、システムプログラム110およびユーザープログラム112が実行される。システムプログラム110は、その機能の一部として、I/Oモジュール160を有する。I/Oモジュール160は、I/Oユニットが制御対象の装置が設けられたフィールド側と遣り取りするデータをグローバル変数テーブル150と関連付ける。
 PLC100では、変数プログラミングが可能になっており、ユーザープログラム112は、グローバル変数テーブル150において定義されたフィールドデータに関連付けられた変数値を用いて、各種処理が実行可能になっている。
 ユーザープログラム112のシーケンスプログラム112Aは、主として、ラダーセクション130と、ライブラリ275とから構成される。ユーザープログラム112は、プロセッサ102により実行可能な形式のネイティブコード154を表す。
 ラダーセクション130は、ラダー言語で記述されたラダープログラムを含む。ラダープログラムに含まれた呼出し命令が実行されると、ライブラリ275に含まれるFUN/FB定義276が呼び出されて実行され、その実行結果は呼び出し元のラダープログラムに戻される。
 <G.サポート装置200のソフトウェア構成例>
 図6は、本発明の実施の形態に係るサポート装置200のソフトウェア構成の一例を示す模式図である。図6では、サポート装置200のソフトウェア構成に関連付けて、記憶部201に格納される情報の一例が示される。図7は、本発明の実施の形態に係る局所フラグテーブル273の一例を模式的に示す図である。図8は、本発明の実施の形態に係る定義フラグテーブル274の一例を模式的に示す図である。図9は、本発明の実施の形態に係るシーケンスロジックの編集の一例を模式的に示す図である。
 (g1.サポート装置200に格納される情報)
 記憶部201に格納される情報は、プログラムソースコードであるシーケンスプログラム271、シーケンスプログラム271から生成される中間コード272、局所フラグテーブル273、定義フラグテーブル274、オブジェクトコード2788、シーケンス回路情報279および定義回路情報280を含む。
 図7を参照して、局所フラグテーブル273では、シーケンスプログラム271中の呼出し命令により呼出されるFUN/FB定義276であって、シーケンスプログラム271の中で、そのシーケンスロジック(シーケンス回路)が展開(以下、インライン展開ともいう)されるFUN/FB定義276のそれぞれについて、情報が登録される。このFUN/FB定義276のそれぞれに対応する情報は、当該FUN/FB定義276を識別する名称(POU名等)である呼出名前2731、シーケンスプログラム271において当該FUN/FB定義276の呼出し命令が出現する行(ライン)の位置2732、および非同期フラグ2733を関連付けて含む。
 図8を参照して、定義フラグテーブル274は、ライブラリ275のFUN/FB定義276毎に、当該FUN/FB定義276の識別子(POU名等)である定義名2741、および定義非同期フラグ2742を関連付けて登録する。
 ここで、非同期フラグ2733および定義非同期フラグ2742について説明する。サポート装置200は、ユーザー操作に従い、シーケンスプログラム271においてインライン展開されたシーケンスロジックを変更する(以下、局所エディットという)。また、サポート装置200は、ライブラリ275の対応のFUN/FB定義276の定義内容を変更する(以下、定義エディットという)。このような局所エディットまたは定義エディットがなされることにより、シーケンスプログラム271でインライン展開されるFUN/FB定義276のシーケンスロジックと、ライブラリ275の対応のFUN/FB定義276のシーケンスロジックとが一致しない状態(以下、非同期ともいう)が生じ得て、非同期が解消されることで両者のシーケンスロジックが一致する状態(以下、同期ともいう)となる。本来は、両者のシーケンスロジックは同期している。したがって、非同期フラグ2733は、シーケンスプログラム271でインライン展開されたシーケンスロジックが非同期であるとき「1」がセットされて、同期しているとき「0」がセットされる。同様に、定義非同期フラグ2742は、対応のFUN/FB定義276が定義するシーケンスロジックが非同期であるとき「1」がセットされて、同期しているとき「0」がセットされる。
 また、図8を参照して、定義フラグテーブル274のFUN/FB定義276の定義名2741は、シーケンスプログラム271中の呼出し命令に設定された後述するオプション277と紐付けされている。
 オブジェクトコード2788、シーケンス回路情報279および定義回路情報280は、制御プログラムであるシーケンスプログラム271が表すシーケンスロジック回路をディスプレイ214に表示するために用いられる。具体的には、オブジェクトコード2788は、シーケンスロジック回路の画面表示を実現するためのオブジェクトコードを示す。シーケンス回路情報279は、シーケンスプログラム271のシーケンスロジック回路構成を規定する。定義回路情報280は、ライブラリ275のFUN/FB定義276の定義内容であるシーケンスロジック2761(後述する)から生成されて、シーケンスロジック2761が表す回路構成を規定する。
 (g2.開発支援環境を提供するためのモジュール)
 図6を参照して、開発支援環境を提供するためのサポートプログラムは、実行されることによりインライン展開を含むオンラインモニタを実現するサポートプログラム700と、実行されることによりオンラインエディットを実現するサポートプログラム710を含む。サポートプログラム700は、操作部203を介したユーザー操作を受付けるための操作受付部221およびモニタ224などを実現するプログラムを含む。サポートプログラム710は、操作受付部221およびモニタ224などを実現するプログラムを含む。これらモジュールは、プログラムまたは回路、またはプログラムと回路の組合せからなる。
 エディタ222は、ユーザー操作に従いシーケンスプログラム271を含むユーザープログラムの編集(作成)を実施する。エディタ222は、オンラインエディタ232を含む。オンラインエディタ232は、PLC100の制御プログラム等をPLC100の制御対象を停止させることなくエディットする環境を提供する。つまり、PLC100が運用される製造現場等では、制御対象を停止させることが容易ではない場合も多い。このような背景のもと、PLC100で実行される制御プログラムを一部変更したいような場合であっても、PLC100を一旦停止させなければ、制御プログラムを変更できないということであれば、使い勝手が悪い。そのため、オンラインエディタ232は、PLC100と連携しながら、PLC100の運転中に実行される制御プログラムの一部を書き換える(編集する)ことを可能にする。
 エディタ222は、オンラインエディタ232とは異なり、PLC100(またはPLC100の運転状態)に依存せずに、制御プログラムを編集することもできる(オフラインエディットともいう)。オフラインエディット時は、エディタ222は、操作受付部221が受付けた操作内容に従い、シーケンスプログラム271を含むユーザープログラムを作成する。作成されたプログラムは、ソースプログラムであるシーケンスプログラム271として記憶部201に格納される。また、オフラインエディット時は、オプション設定モジュール2311は、ユーザー操作内容に従い、シーケンスプログラム271における呼出し命令のうちから選択される1つ以上に、表示態様の切替えを指示するオプション277を設定する。
 オンラインエディタ232は、局所エディットを実施する局所エディタ233および定義エディットを実施する定義エディタ234を含む。
 図9は、本発明の実施の形態に係るエディットの一例を模式的に示す図である。図9を参照して、シーケンスプログラム271のシーケンスロジックまたはFUN/FB定義276のシーケンスロジック2761(後述する)が、例えば図9(A)のような回路構成を規定するケースを説明する。このケースでは、シーケンスロジックの回路構成を示す画像がディスプレイ214に表示される。ユーザーは、エディタ222を用いて、画像を操作することで、図9(A)の回路のシーケンスロジック2761を、例えば図9(B)または図9(C)のように、新たな回路が追加されたロジックに変更することができる。
 適用例として、例えば、オンラインモニタにより表示される回路出力状態156をモニタした結果、ユーザーは制御対象の故障で回路の一部にエラーが生じたと判断した場合は、図9(C)に示すように、故障に関係する回路部品をバイパスする回路を追加するように表示画像を変更する。なお、オンラインエディタ232による編集の適用例は、故障等のエラー対応に限定されない。
 ビルダ223は、「コード変換部」の一実施例である。ビルダ223は、シーケンスプログラム271をビルド処理(パース、最適化、コンパイルなどを含む)して中間コード272を生成する。サポート装置200は、中間コード272を、PLC100にロードする。PLC100のプロセッサ102は、中間コードから、ライブラリ275のFUN/FB定義276の定義内容を参照しながら、ネイティブコード154を生成する。ネイティブコード154は、PLC100が直接解釈して実行することができる実行可能コードである。また、中間コード272も、PLC100が実行可能な形式のコードである。PLC100は、中間コード272を実行する場合は、例えばインタプリタ方式に従い1行毎に解釈しながら実行する。本実施の形態では、PLC100は、ネイティブコード154を実行する場合を説明する。
 モニタ224は、開発支援環境における各モジュールの実行結果の情報およびシーケンスプログラム271をディスプレイ214に表示する。シーケンスプログラム271がディスプレイ214に表示される場合、モニタ224は、オプション277が設定された呼出し命令の部分ではインライン展開されたシーケンス回路の画像を表示し、オプション277が設定されていない呼出し命令の部分においては、従来の呼出し命令のみが表示される。このように、ユーザーは、シーケンスプログラム271の1つ以上の呼出し命令を選択し、選択した呼出し命令にオプション277を設定することにより、シーケンスプログラム271の表示時には、当該呼出し命令により呼出されるFUN/FB定義276をインライン展開して表示させることができる。したがって、シーケンスプログラム271のロジックの表示画面において、当該シーケンスプログラム271の呼出し命令のうちユーザーが所望する1つ以上の呼出し命令の部分では、当該呼出し命令で呼出されるFUN/FB定義276のシーケンスロジック(例えば図9のような回路構成)を視覚化することができる。
 また、モニタ224は、PLC100の実行状態をシーケンスプログラム271のシーケンスロジック(シーケンス回路)でモニタするためのオンラインモニタモジュール238を含む。
 具体的には、オンラインモニタモジュール238は、PLC100からネイティブコード154の実行状態を示す回路出力状態156を取得する。すなわち、オンラインモニタモジュール238は、PLC100との間で、回路出力状態156を遣り取りする。そして、オンラインモニタモジュール238は、シーケンス回路情報279、定義回路情報280および取得した回路出力状態156に基づいて、PLC100におけるシーケンスプログラム271の実行状態を、ディスプレイ214を介し視覚化する(すなわち、オンラインモニタを提供する)。オンラインモニタにおいては、シーケンスプログラム271がインライン展開された回路構成を有する場合は、インライン展開されたシーケンス回路においても、シーケンスロジックの実行状態が視覚化して示される。
 このような構成を採用することで、ユーザーは、PLC100で実行されるシーケンスプログラム271を含むユーザープログラムの実行状態を、サポート装置200においてリアルタイムにモニタすることできる。
 <H.FUN/FB定義と呼出し命令>
 図10は、本発明の実施の形態に係るFUN/FB定義276の一部を模式的に示す図である。図10を参照して、FUN/FB定義276は、FUNまたはFBの演算に用いる引数等の変数名、入出力の別およびデータ型の定義と、シーケンスロジック2761とを含む。FUN/FB定義276(単位プログラム)が呼出されて実行される場合、シーケンスロジック2761に従う演算が、定義された変数に割当てられた値を用いて実行される。実行結果は、単位プログラムからの戻り値として出力される。
 図11は、本発明の実施の形態に係るシーケンスプログラム271の一部を模式的に示す図である。図12は、本発明の実施の形態に係るFUN/FB定義276の呼出し命令を用いたシーケンスプログラム271の一例を模式的に示す図である。図11を参照して、シーケンスプログラム271は、例えば命令0、1および2を含む。命令0と命令1は、同じシーケンスロジックを記載するので、命令0,1は、当該シーケンスロジックを定義する共通部品である図10のFUN/FB定義276の呼出し命令278で置き換えることができる(図12参照)。
 また、図12のシーケンスプログラム271には、オプション設定モジュール2311により、命令0と命令1にオプション277が設定されているが、命令2には、オプション277は未設定である。この場合、モニタ224は、オプション277が設定された命令0と命令1の呼出し命令278についてインライン展開を実施する。これにより、命令0と命令1の呼出し命令278の部分において、対応のFUN/FB定義276のシーケンスロジック2761に従う回路構成の画像が表示される。
 <I.全体処理>
 図13は、本発明の実施の形態に係る処理の概要を示すフローチャートである。図13のフローチャートでは、サポート装置200とPLC100との処理が関連付けて示されている。
 図13を参照して、ユーザーは、サポート装置200を操作して、制御対象に応じたPLC用のシーケンスプログラム271を含むユーザープログラムを作成する(ステップS1)。具体的には、エディタ222は、オフラインエディットにより、ユーザー操作に従いシーケンスプログラム271を編集し、編集されたシーケンスプログラム271を記憶部201に格納する。オフライン編集において、オプション設定モジュール2311は、ユーザー操作に従い、シーケンスプログラム271の選択された1つ以上の呼出し命令に、オプション277を設定する。
 エディット時には、モニタ224は、シーケンスプログラム271をディスプレイ214に表示する(ステップS3)。モニタ224は、オプション277が設定された呼出し命令に対しては、インライン展開を実施する。したがって、オフラインエディット時に、オプション277を設定した呼出し命令の部分においては、対応のシーケンスロジック2761(シーケンス回路構成)が画像で視覚化される。ここでは、インライン展開されたFUN/FB定義276で宣言された入力および出力の変数名は、呼出し命令部分で指定されたパラメータ名を用いて表示される。
 なお、シーケンスプログラム271が表示される場合、オプション277が設定された呼出し命令はインライン展開がなされるが、本実施の形態では、オプション設定モジュール2311は、さらに、ユーザー操作に従い、呼出し命令に既に設定されたオプション277を有効化または無効化する。これにより、ユーザーの選択操作に従い、オプション277が既に設定された呼出し命令の部分において、インライン展開してシーケンスロジック2761(シーケンス回路構成)を表示する(オプション277を有効化)、または呼出し命令のまま表示する(オプション277を無効化)かの切替えが可能である。
 また、インライン展開されるFUNに対しては、ユーザーはモニタ用に、インスタンス名の指定操作(指定操作しなくてもよい)をすることができる。なお、FBは、インスタンス名を有するので、指定は不要である。ユーザーがインライン展開されたFUNに対してインスタンス名の指定操作をすると、シーケンスプログラム271にインスタンス名が保持される。なお、インスタンス名が指定されていない場合、任意のユニークなインスタンス名がビルド時に割り当てられる。
 シーケンスプログラム271の作成が完了すると、ユーザー操作に従い、ビルダ223が起動されて、ビルド処理(ステップT1)が実施される。ビルダ223は、ビルド処理において、シーケンスプログラム271に対応の中間コード272およびオブジェクトコード2788を生成する。このとき、サポート装置200は、シーケンスプログラム271からシーケンス回路情報279を併せて生成する。シーケンス回路情報279は、オンラインモニタを提供するために用いられる表示用の情報である。シーケンス回路情報279の詳細については、後述する。
 サポート装置200は、シーケンスプログラム271に対応する中間コード272をPLC100へ転送する(ステップT2)。
 PLC100は、サポート装置200から中間コード272を受信し格納する(ステップU1)。PLC100は、受信した中間コード272を用いて起動処理を実施する(ステップU2)。このとき、PLC100は、中間コード272から、オプションが設定された各呼出し命令の行と、定義名の組を格納したオプションテーブル1165を生成する。
 PLC100は、ネイティブコード154(シーケンスプログラム271)を実行する(ステップU3)。PLC100においてシーケンスプログラム271が実行されることにより、制御対象の制御処理が実現されると、以下に示すようなオンラインモニタに係る処理が実行される。
 すなわち、ユーザーがサポート装置200に対してオンラインモニタの実行を指示する。操作受付部221を介して受付けた実行指示により、オンラインモニタモジュール238が起動される。オンラインモニタモジュール238は、オンラインモニタ処理を実施する(ステップP1)。
 オンラインモニタモジュール238は、PLC100に対して、回路出力状態156を要求する(ステップP11)。この要求に応答して、PLC100のユーザーアプリケーション1164は、シーケンスプログラム271に規定されているシーケンス回路の入出力変数に基づき、グローバル変数テーブル150を検索する。この検索により、実行中のシーケンスプログラム271(ネイティブコード154)の実行状態を示す回路出力状態156は、グローバル変数テーブル150から取得される。ユーザーアプリケーション1164は、取得された回路出力状態156をサポート装置200へ送信する(ステップU31)。
 回路出力状態156の値はインライン回路状態1166の値を含む。インライン回路状態1166は、実行中のシーケンスプログラム271においてオプション277が設定された各FUN/FB定義276のシーケンスロジック2761が規定するシーケンス回路(すなわちインライン展開されたシーケンス回路)の状態の値を示す。インライン回路状態1166は、オプションテーブル1165が示す当該FUN/FB定義276が呼出された各行(ライン)について、行番号と、当該行で呼出されるFUN/FB定義276が規定するシーケンス回路の回路出力状態の値とを含む。
 オンラインモニタモジュール238は、PLC100からのシーケンス回路情報、回路出力状態156およびインライン回路状態1166に基づいて、インライン展開されたシーケンス回路を含むシーケンスプログラム271のシーケンスをディスプレイ214において視覚化する(ステップP12)。これにより、インライン展開されたシーケンス回路を含むシーケンスプログラム271全体のシーケンス回路に、回路出力状態の値を反映するパワーフロー表示を実現することができる。
 ユーザーは、オンラインモニタモジュール238が提供するディスプレイ214の画面から、PLC100でのシーケンスプログラム271の実行中の状態を確認することができる。
 本実施の形態では、シーケンスプログラム271においてインライン展開された呼出し命令は、(インスタンス名.FUN/FB定義内のローカル変数名)としてではなく、(FUN/FB定義内のローカル変数名)としてシーケンスロジックが表示される。したがって、オンラインモニタモジュール238は、(FUN/FB定義内のローカル変数名)とインスタンス名の組合せに基づき、PLC100から(インスタンス名.FUN/FB定義内のローカル変数名)に対応するインライン回路状態1166による現在値の取得を行い、インライン展開されたシーケンス回路画像においてパワーフロー表示を行う。
 また、オンラインモニタモジュール238は、シーケンスプログラム271においてパワーフロー表示を実施する場合、ディスプレイ214にウォッチウィンドウを表示して、ウォッチウィンドウにおいて(インスタンス名.FUN/FB定義内のローカル変数名)とその現在値を出力してもよい。
 また、サポート装置200は、インライン展開されたシーケンス回路画像においてのみパワーフロー表示をするように、PLC100に対して、インライン回路状態1166のみを要求してもよい。
 また、オンラインモニタモジュール238は、シーケンスプログラム271の全体について、パワーフロー表示するモードと、インライン展開されたシーケンス回路画像においてのみパワーフロー表示をするモードとの切替えを実施してもよい。この切替えは、たとえばユーザー操作に従い実施され得る。
 PLC100においてシーケンスプログラム271が実行されることにより、制御対象の制御処理が実現されると、以下に示すようなオンラインエディットに係る処理を実施することができる。
 すなわち、PLC100においてシーケンスプログラム271を実行中において、操作受付部221はユーザーから受付ける実行指示により、オンラインエディタ232を起動する(ステップQ1)。オンラインエディタ232は、操作受付部221を介して受付けるユーザー操作に従い、シーケンスプログラム271を編集する。このとき、オンラインモニタが提供するシーケンス回路の回路出力状態値は、ユーザーが、シーケンスロジックを変更すべき箇所を判断するための視覚化された支援情報となり得る。視覚化された回路出力状態値から、例えば、ユーザーは、図9(A)のシーケンス回路の故障を判断し、判断した故障箇所を、図9(B)または(C)のように変更することができる。オンラインエディタ232は、操作受付部221から受付けたユーザー操作に従い、シーケンスプログラム271を変更(編集)する。変更後のシーケンスプログラム271は、記憶部201に格納される。
 ユーザー操作に従い、ビルダ223が起動される。ビルダ223は、オンラインエディット処理がなされたシーケンスプログラム271のビルド処理を実行する(ステップR1)。ビルダ223は、ビルド処理により得られた中間コード272を記憶部201に格納するとともに、PLC100に転送する(ステップR2)。
 転送後は、サポート装置200は、例えばユーザー操作に従い処理を終了するか否かを判断し(ステップR3)、終了すると判断した場合は(ステップR3でYES)、処理を終了する。終了しないと判断した場合は(ステップR3でNO)、ステップP1等の次の処理に移行する。
 PLC100は、サポート装置200からオンラインエディット後の中間コード272を受信するかを判断する(ステップU4)。PLC100は、サポート装置200から中間コード272を受信した場合(ステップU4でYES)、受信した中間コード272を格納し(ステップU5)、その後、ステップU2に移行する。これにより、オンラインエディット後のシーケンスプログラム271に従う制御対象の制御、およびオンラインモニタ処理を実施することができる。
 なお、中間コード272を受信しなかった場合(ステップU4でNO)、処理を終了する。
 (i1.オンラインエディット処理)
 図14は、本発明の実施の形態に係るオンラインエディット処理を説明するフローチャートである。図14を参照して、図13のオンラインエディット処理(ステップQ1)を詳細に説明する。なお、オンラインエディットの対象は、呼出し命令部分においてインライン展開されたシーケンスロジックまたはライブラリ275のFUN/FB定義276であるとする。インライン展開されたシーケンスロジックまたはFUN/FB定義276のオンラインエディットは、ロジック回路構成または入出力変数の作成または編集(追加、変更、削除など)を含む。
 まず、オンラインエディタ232は、起動されると、操作受付部221が受付けたユーザー操作に基づき、エディット対象はインライン展開されたシーケンスロジックの局所(部分)であるか、FUN/FB定義276の定義内容であるかを判断する(ステップQ11)。
 局所であると判断すると(ステップQ11で(局所))、オンラインエディタ232は、ユーザー操作に従い、1つ以上の呼出し命令部分においてインライン展開されたシーケンスロジックを編集し(ステップQ13)、局所フラグテーブル273の非同期フラグ2733に「1」を設定する(ステップQ17)。具体的には、オンラインエディタ232は、ステップQ13で編集がなされた各呼出し命令の部分について、当該呼出し命令の部分で、呼出されていたFUN/FB定義276の名称である呼出名前2731、当該呼出し命令が記述されていた行(ライン)の位置2732および非同期フラグ2733を関連付けて、局所フラグテーブル273に登録する。この登録時に、オンラインエディタ232は、非同期フラグ2733に「1」を設定する。
 エディタ222は、ユーザー操作に従い、シーケンスプログラム271における非同期である呼出し命令の部分を一覧表示するようモニタ224に指示する(ステップQ19)。具体的には、エディタ222は、シーケンスプログラム271を走査することにより、局所フラグテーブル273の位置2732で示す呼出し命令のうち、対応の非同期フラグが「1」である呼出し命令の位置2732を示す位置情報をモニタ224に出力する。モニタ224は、ディスプレイ214に表示中のシーケンスプログラム271において、エディタ222からの位置情報が示す各行の呼出し命令部を予め定められた表示態様(例えば、反転表示等)に変更する。
 上記の一覧表示は、シーケンスプログラム271においてインライン展開されシーケンスロジックのうち、当該シーケンスロジックを対応のFUN/FB定義276の内容に反映するものをユーザーが判断するための支援情報を提供する。
 オンラインエディタ232は、操作受付部221が受付けるユーザー操作に従い、FUN/FB定義276の内容を変更するか否かを判断する(ステップQ21)。オンラインエディタ232は、FUN/FB定義276の定義内容を変更しないと判断すると(ステップQ21でNO)、処理を終了する。
 一方、オンラインエディタ232は、FUN/FB定義276の定義内容を変更すると判断すると(ステップQ21でYES)、PLC100のライブラリ275のFUN/FB定義276を変更する(ステップQ23)。具体的には、オンラインエディタ232は、局所フラグテーブル273から、非同期フラグ2733が「1」である呼出名前2731を抽出する。オンラインエディタ232は、抽出した呼出名前2731に基づき、ライブラリ275を検索する。検索により、呼出名前2731に対応するFUN/FB定義276を特定し、特定したFUN/FB定義276の定義内容を、ステップQ13で受付けた編集内容を用いて変更する。この変更は、FUN/FB定義276の定義内容を、インライン展開されたシーケンスロジックの編集(変更)後の内容に一致させる(コピーする)ことも含み得る。オンラインエディタ232は、変更がなされた呼出し命令の部分に対応した非同期フラグ2733を「1」から「0」に変更する。
 ステップQ11に戻る。一方、オンラインエディタ232は、FUN/FB定義276の編集であると判断すると(ステップQ11で(定義))、オンラインエディタ232は、ユーザー操作に従い、ライブラリ275の1つ以上のFUN/FB定義276の定義内容を編集することにより変更し(ステップQ25)、定義フラグテーブル274の定義非同期フラグ2742に「1」を設定する(ステップQ27)。具体的には、オンラインエディタ232は、ステップQ25で編集がなされたFUN/FB定義276の名称である定義名2741および定義非同期フラグ2742を関連付けて、定義フラグテーブル274に登録する。この登録時に、オンラインエディタ232は、定義非同期フラグ2742を「1」に設定する。
 オンラインエディタ232は、ユーザー操作に従い、シーケンスプログラム271の対応するインライン展開部のシーケンスロジックを、FUN/FB定義276の変更後の定義内容を用いて変更するか否かを判断する(ステップQ29)。オンラインエディタ232は、変更しないと判断した場合(ステップQ29でNO)、処理は終了する。
 一方、オンラインエディタ232は、インライン展開部のシーケンスロジックを変更すると判断すると(ステップSQ29でYES)、オンラインエディタ232は、シーケンスプログラム271のインライン展開されたシーケンスロジックの回路を、対応のFUN/FB定義276の変更後の定義内容に一致するように更新する(ステップQ31)。具体的には、オンラインエディタ232は、定義回路情報280を、FUN/FB定義276の変更後の定義内容を用いて変更する。これにより、定義回路情報280は、FUN/FB定義276の変更後の定義内容を示すシーケンス回路構成を表す情報に更新される。また、オンラインエディタ232は、モニタ224に、インライン展開部の表示更新を指示する。モニタ224は、指示に応じて、シーケンスプログラム271のインライン展開部のシーケンス回路構成の画像を、更新後の定義回路情報280を用いて更新する。ステップQ31では、オンラインエディタ232は、局所フラグテーブル273に登録されている全ての非同期フラグ2733を「0」にセットする。
 このように、オンラインエディタ232およびモニタ224は、ディスプレイ214に表示中のシーケンスプログラム271のインライン展開部のシーケンス回路構成の画像を、変更後のFUN/FB定義276のシーケンスロジックが規定する回路構成の画像に、一括して更新する。これにより、インライン展開部のシーケンスロジックの回路構成の画像が、FUN/FB定義276の変更(編集)後の定義内容を示すように更新される。この更新がなされる場合に、シーケンスプログラム271の周辺回路と当該シーケンスロジックの回路との関連性の確認も可能とするような視覚化情報の提供も可能となる。
 (i1-1.局所エディットの具体例)
 図14のステップQ23では、FUN/FB定義276の定義内容の変更について、2つのケースのいずれかを実施することができる。1つ目のケースでは、シーケンスプログラム271に非同期である呼出し命令の部分が複数個あった場合に、複数個の呼出し命令の部分の全てを対象に、対応のFUN/FB定義276の定義内容の変更を実施する。2つ目のケースでは、複数個の呼出し命令の部分の全てを対象に定義内容の変更を実施するのではなく、複数個の呼出し命令の部分のうちユーザー操作により選択され1つ以上の呼出し命令の部分を対象に、対応のFUN/FB定義276の定義内容の変更を実施する。
 2つ目のケースにおいて、選択された1以上の呼出し命令の部分を対象に、対応のFUN/FB定義276の定義内容の変更を実施する場合を説明する。このケースでは、ユーザー操作により選択されなかった呼出し命令部分に対応のFUN/FB定義276は更新されず、シーケンスプログラム271の呼出し命令部分でインライン展開されたシーケンスロジックのみが変更される。この際、オンラインエディタ232はユーザー変更後のシーケンスロジックを、シーケンスプログラム271に新しく保存(上書き等)する。また、局所フラグテーブル273の対応の非同期フラグ2733を、非同期状態を示す「1」のままとする。
 ビルダ223は、変更後のシーケンスロジックを有するシーケンスプログラム271をビルド処理する。ビルド処理では、ビルダ223は、対応のFUN/FB定義276は更新されなかったインライン展開部のシーケンスロジックのローカル変数名は(インスタンス名.FUN/FB定義内のローカル変数名)としてビルドする。ビルドして得られた中間コード272はPLC100に転送される。PLC100では、サポート装置200から受信する中間コード272に基づくネイティブコード154を生成し、PLC100はシーケンスプログラム271(ネイティブコード154)を実行する。サポート装置200のオンラインモニタモジュール238は、PLC100から、回路出力状態156を受信し、受信した回路出力状態156を用いて、上記の非同期状態のインライン展開部のシーケンスロジックにおいてパワーライン表示を実施する。ユーザーは、このように視覚化された回路出力状態156から、非同期状態のインライン展開部のシーケンスロジックを用いて、対応のFUN/FB定義276を更新するか否かを判断するための支援情報を得ることができる。
 なお、局所エディットのメインユースケースとして、本実施の形態では、オンラインエディット時に適用するケースを記載するが、ユースケースはオンラインエディットに限定されない。具体的には、インライン展開された内容と対応のFUN/FB定義276の定義内容とが一致している場合において、ユーザーは、オンラインエディット時にFUN/FB定義276の変更を反映させたくない場合は、予め定められた操作をすることにより、非同期状態とすることができる。
 (i2.ビルド処理)
 図15は、本発明の実施の形態に係るビルド処理を説明するフローチャートである。図15を参照して、図13のオンラインエディット後のビルド処理(ステップR1)を詳細に説明する。図15のビルド処理は、主に、呼出し命令部の処理を主体に説明する。
 ビルダ223は、シーケンスプログラム271を先頭から1行ごとに走査する(ステップR11)。走査により呼出し命令部を検出すると(ステップR13でYES)、ステップR15に移行するが、呼出し命令部を検出しない場合は(ステップR13でNO)、ステップR23に移行する。
 ステップR15では、ビルダ223は、呼出し命令部のオプション277の設定の有無を判断する(ステップR15)。呼出し命令部にオプション277が設定されていないと判断されると(ステップR15で無)、ステップR21に移行する。オプション277が設定されていると判断されると(ステップR15で有)、ビルダ223は、当該呼出し命令部で呼出されるFUN/FB定義276がオンラインエディット中であるかを、定義フラグテーブル274の対応の定義非同期フラグ2742が「1」であるか否かに基づき判断する(ステップR17)。
 定義非同期フラグ2742が「1」であり、オンラインエディット中であると判断すると(ステップR17でYES)、ステップR21に移行する。ステップR21では、ビルダ223は、当該呼出し命令部に、予め定められた(通常の)呼出し命令のコードを割当てる。定義非同期フラグ2742が「0」である、すなわちオンラインエディット中ではないと判断すると(ステップR17でNO)、ビルダ223は、この呼出し命令部に、対応のFUN/FB定義276のシーケンスロジック2761に従うコードを割当てる(ステップR19)。この割当られたコードでは、FUN/FB定義276により定義されるローカル変数名は、(インスタンス名.FUN/FB定義内のローカル変数名)が割当られる。
 ビルダ223は、シーケンスプログラム271の全ての行の走査が終了したか否かを判断し、走査終了していないと判断すると(ステップR23でNO)、ステップR11に戻る。一方、ビルダ223は、走査終了と判断すると(ステップR23でYES)、ビルダ223は、シーケンスプログラム271から中間コード272を生成する(ステップR25)。
 上記のビルド処理におけるステップR17,R21についてさらに説明する。ステップR17で、ビルダ223は、呼出し命令部で呼出されるFUN/FB定義276の対応の定義非同期フラグ2742が「1」であると判断すると(ステップR17でYES)、当該呼出し命令部に通常の呼出し命令のコードを割当て(ステップR21)、ビルド処理を実施する。これにより、通常の呼出し命令により、FUN/FB定義276のオンラインエディットがされたシーケンスロジックを実行することができる。また、インライン展開される(オプション277が設定された呼出し命令部の)シーケンスロジックにもオンラインエディットによる変更を加えることができる。
 (i3.シーケンス回路情報)
 図20は、本実施の形態に係るシーケンス回路情報の一例を模式的に示す図である。図20を参照して、例えば、PLC用のユーザープログラムで規定される回路毎に含まれる回路部品の情報が記述される。
 図20には、1つの接点2781と1つのコイル2791とからなる回路の例を示す。この例において、シーケンス回路情報279の回路定義2811は、「回路」などの種別を示す種別情報2821と、各回路に含まれる回路部品の情報を示す回路部品情報2831,2841とを含む。図20に示される回路定義2811が、シーケンスプログラム271に規定される回路の数だけ繰返されることになる。
 同様に、定義回路情報280も、FUN/FB定義276のシーケンスロジック2761で規定される回路構成の数だけ回路定義が繰返されている。なお、図20に示す回路定義2811の記載例は一例であり、どのようなフォーマットに従ってもよい。
 <J.PLCでのプログラム実行開始タイミング>
 本実施の形態では、オンラインエディットによる変更後のシーケンスプログラム271(中間コード272)をPLC100へ転送し、PLC100が変更後のシーケンスプログラム271の実行をする場合、実行開始のタイミングを適宜設定することができる。
 図16は、本発明の実施の形態に従うオンラインエディット機能によって転送された制御プログラムの実行開始タイミングを説明するための図である。この制御プログラムは、シーケンスプログラム271を含む概念である。図16には、S-A,S-B,S-Cで示す3つのシーケンスプログラム271を転送する場合の処理例を示す。
 図16には、それぞれのシーケンスプログラム271の転送が完了されると、当該転送が完了したシーケンスプログラム271の実行が開始される例を示す。図16において、矢印(→)の1個分が、タスクスケジューラ1142によるタスクの実行周期の1回分を示す。また、図16の「チェック」のステップは、プログラムマネージャ1144により実行される。
 プログラムマネージャ1144は、「チェック」のステップにおいて、図13のステップT2,R2において、サポート装置200から転送されたシーケンスプログラム271の受信が完了するか否かを判断する。すなわち、エディットされたシーケンスプログラム271のサイズは可変である等様々な要因により、当該転送に係る時間はばらつく。このような時間のばらつきがあるとしても、PLC100においてシーケンスプログラム271に従うタスクの実行サイクルが維持されるように、プログラムマネージャ1144は、転送によるシーケンスプログラム271の受信を完了したときに受信完了のタイミング信号を、タスクスケジューラ1142に出力する。タスクスケジューラ1142は、プログラムマネージャ1144からタイミング信号を受信し、且つ実行周期が到来したとき、転送されたシーケンスプログラム271を実行可能な状態に移行させる。
 図16では、シーケンスプログラム271を転送するケースを説明したが、ライブラリ275のFUN/FB定義276をサポート装置200においてオンラインエディットし、その後、PLC100に転送する場合も、図16と同様に、プログラムマネージャ1144は受信が完了したことを検知し、タイミング信号を出力する。タスクスケジューラ1142は、プログラムマネージャ1144からタイミング信号を受信し、且つ実行周期が到来したとき、転送されたFUN/FB定義276を呼出し可能な状態に移行させる。
 <K.プログラム>
 本実施の形態に示した各フローチャートの処理を実行するための開発支援環境を提供するサポートプログラムは、サポート装置200の記憶部201に格納されている。CPU202は、記憶部201からサポートプログラム700,710を読出し、実行することにより、本実施の形態で説明した各部を実現することが可能となる。
 サポートプログラム700,710は、サポート装置200に付属するフレキシブルディスク、CD-ROM(Compact Disk-Read Only Memory)、ROM、RAMおよび記録媒体250などのコンピュータ読取り可能な記録媒体にて記録させて、プログラム製品として提供することもできる。記録媒体250は、コンピュータその他装置、機械等が記録されたプログラム等の情報を読み取り可能なように、当該プログラム等の情報を、電気的、磁気的、光学的、機械的または化学的作用によって蓄積する媒体である。
 また、サポートプログラム700,710は、サポート装置200に内蔵するHDD208などの記録媒体にて記録させて、プログラムを提供することもできる。また、図示しないネットワークから通信インターフェイスを介したダウンロードによって、プログラムを提供することもできる。
 <L.利点>
 図17、図18および図19は、本発明の実施の形態に係る開発支援環境により奏される利点を説明する図である。図17~図19は、実行された場合に、いずれも同じ実行結果を出力するシーケンスプログラム271の一例である、図17~図19では、実行結果の出力であるパワーフロー表示が太いラインで示されている。
 具体的には、図17では命令0と命令1において、シーケンスロジックが記述されているので、パワーフローが把握し易いが、プログラムの開発効率の点では、このような同じシーケンスロジックは部品化したいとの要望がある。図18は、この要望に応えたケースであり、命令0と命令1では、当該シーケンスロジックを定義したFUN/FB定義276(部品)はライブラリ275から呼出し実行する呼出し命令に置換されている。図18では、ライブラリ275のFUN/FB定義276(部品)を編集することで、シーケンスプログラム271の命令0と命令1で呼出されるFUN/FB定義276(部品)に当該編集内容を同時に反映することができる。
 しかしながら、図18の命令0と命令1は、共通の呼出し命令が、内部のシーケンスロジックを記載しない部品画像で表示されるが、部品中のシーケンスロジックの実行結果を示すパワーラインを確認したいとの要望がある。また、命令0のシーケンスロジックを変更しても、命令1のシーケンスロジックは変更したくないとの要望もある。図19はこの両方の要望に応えた本実施の形態に係る開発支援環境により作成可能なシーケンスプログラム271である。
 図19では、命令0と命令1は、同じFUN/FB定義276を呼出す呼出し命令を示すが、呼出し命令部ではFUN/FB定義276のシーケンスロジック2761がインライン展開されている。オンラインモニタモジュール238は、インライン展開されたシーケンスロジックにおいて、その実行結果を示すパワーライン表示を実施する。また、(i1-1.局所エディットの具体例)で説明したように、オンラインエディタ232により、命令0のインライン展開されたシーケンスロジックを編集したとしても、命令1のシーケンスロジックには当該編集後の内容で変更しないことも可能となる。
 <M.変形例>
 本発明の実施の形態に係る変形例を説明する。
 本実施の形態では、サポート装置200は、シーケンスプログラム271にインライン展開された非同期のシーケンスロジックを、ライブラリ275の対応のFUN/FB定義276の定義内容(シーケンスロジック2761等)と、ソースプログラムとして比較し、その差異を示す情報を出力する。
 また、本実施の形態では、インライン展開されたシーケンスロジックを、エディットにより変更した場合、変更後のシーケンスロジックを、ライブラリ275の対応のFUN/FB定義276からは独立した完全なローカルロジックとして、シーケンスプログラム271に追加する。この際、サポート装置200は、対応のFUN/FB定義276のローカル変数を、当該FUN/FB定義276の呼出し命令コード部の変数テーブルにマージする。
 また、本実施の形態に係る開発支援環境では、モニタ224を備える、モニタ224は必須の構成要件としない開発支援環境であってもよい。すなわち、少なくともエディタ222(より特定的には、局所エディタ233)を備える開発支援環境として提供されてもよい。
 局所エディタ233では、シーケンスプログラム271にインライン展開された部品(FUN/FB定義276)を対象に処理を実施する。その一方で、インライン展開される部品が増加すると、当該シーケンスプログラム271に記述される変数が増加し、このような変数増加に伴い、メモリの使用量が増加する。このようなメモリ使用量の増加に対処するために、当該変数名は、(インスタンス名.FUN/FB定義内のローカル変数名)として記述するのではなく、(FUN/FB定義内のローカル変数名)として短縮化することで、変数増加に伴うメモリの使用量を減らすことが可能になる。また、ビルダ223は、同期中はインライン展開を利用せずに、局所エディタ233で局所変更する場合のみにインライン展開化してビルド処理を実施することで、ビルド処理対象のシーケンスプログラム271のステップ数を減らすことが可能となる。
 <N.付記>
 上述したような本実施の形態は、以下のような技術思想を含む。
[構成1]
 制御対象を制御する制御装置(100)で実行されるシーケンスプログラム(271)の開発を支援するサポート装置(200)であって、
 前記シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラム(276)の呼出し命令を含み、
 前記サポート装置は、
 前記サポート装置に対する操作を受付ける操作受付部(221)と、
 前記シーケンスプログラムの表示時に、前記単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するモニタ部(224)と、
 表示される前記回路を変更する操作に従い、前記シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するエディタ部(222)と、
 前記シーケンスプログラムを実行可能コードに変換するコード変換部(223)と、を備え、
 前記コード変換部は、
 切替えオプションに従い、前記シーケンスプログラム中の呼出し命令に、前記変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて前記変換を実施する、サポート装置。
[構成2]
 設定操作に従い、前記シーケンスプログラムの呼出し命令に前記切替えオプションを設定する設定部(2311)をさらに備え、
 前記モニタ部は、
 前記シーケンスプログラムを表示する場合に、前記呼出し命令に前記切替えオプションが設定されているとき、当該呼出し命令を前記回路に展開して表示する、構成1に記載のサポート装置。
[構成3]
 前記制御装置は、前記単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリ(275)を備え、
 前記ライブラリに格納される前記シーケンスロジックのコードを、前記変更後のシーケンスロジックのコードを用いて変更する、構成1または2に記載のサポート装置。
[構成4]
 前記制御装置は、前記単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリ(275)を備え、
 前記シーケンスプログラムは、1つ以上の前記呼出し命令を含み、
 選択操作に従い、前記1つ以上の呼出し命令のうち、前記ライブラリのシーケンスロジックのコードの変更に用いる前記変更後のシーケンスロジックを有する呼出し命令を選択する、構成1から3のいずれか1に記載のサポート装置。
[構成5]
 前記1つ以上の呼出し命令のうち前記エディタ部によりシーケンスロジックの変更がなされた呼出し命令の一覧を表示する、構成4に記載のサポート装置。
[構成6]
 前記モニタ部は、
 前記制御装置から前記単位プログラムが定義するシーケンスロジックの実行状態を示す回路出力状態(156;1166)を取得するとともに、前記単位プログラムが定義するシーケンスロジックが示す回路および取得した前記回路出力状態に基づいて、前記制御装置における当該シーケンスロジックの実行状態を、前記展開された回路において視覚化する、構成1から5のいずれか1に記載のサポート装置。
[構成7]
 制御対象を制御する制御装置(100)で実行されるシーケンスプログラム(271)の開発の支援に向けられたサポートプログラム(710)であって、
 前記シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラム(276)の呼出し命令を含み、
 前記サポートプログラムはコンピュータ(200)に、
 前記コンピュータに対する操作を受付けるステップと、
 前記シーケンスプログラムの表示時に、前記単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するステップと、
 表示される前記回路を変更する操作に従い、前記シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するステップと、
 前記シーケンスプログラムを実行可能コードに変換するステップと、を備え、
 前記実行可能コードに変換するステップは、
 切替えオプションに従い、前記シーケンスプログラム中の呼出し命令に、前記変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて前記変換を実施するステップを含む、サポートプログラム。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 100 PLC、112A,271 シーケンスプログラム、130 ラダーセクション、150 グローバル変数テーブル、154 ネイティブコード、156 回路出力状態、279 シーケンス回路情報、200 サポート装置、221 操作受付部、222 エディタ、223 ビルダ、224 モニタ、277 オプション、232 オンラインエディタ、233 局所エディタ、234 定義エディタ、238 オンラインモニタモジュール、272 中間コード、273 局所フラグテーブル、274 定義フラグテーブル、275 ライブラリ、276 FUN/FB定義、278 呼出し命令、280 定義回路情報、1142 タスクスケジューラ、1144 プログラムマネージャ、1165 オプションテーブル、2761 シーケンスロジック。

Claims (7)

  1.  制御対象を制御する制御装置で実行されるシーケンスプログラムの開発を支援するサポート装置であって、
     前記シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラムの呼出し命令を含み、
     前記サポート装置は、
     前記サポート装置に対する操作を受付ける操作受付部と、
     前記シーケンスプログラムの表示時に、前記単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するモニタ部と、
     表示される前記回路を変更する操作に従い、前記シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するエディタ部と、
     前記シーケンスプログラムを実行可能コードに変換するコード変換部と、を備え、
     前記コード変換部は、
     切替えオプションに従い、前記シーケンスプログラム中の呼出し命令に、前記変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて前記変換を実施する、サポート装置。
  2.  設定操作に従い、前記シーケンスプログラムの呼出し命令に前記切替えオプションを設定する設定部と、を備え、
     前記モニタ部は、
     前記シーケンスプログラムを表示する場合に、前記呼出し命令に前記切替えオプションが設定されているとき、当該呼出し命令を前記回路に展開して表示する、請求項1に記載のサポート装置。
  3.  前記制御装置は、前記単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリを備え、
     前記ライブラリに格納される前記シーケンスロジックのコードを、前記変更後のシーケンスロジックのコードを用いて変更する、請求項1または2に記載のサポート装置。
  4.  前記制御装置は、前記単位プログラムのシーケンスロジックのコードを呼出し可能に格納するライブラリを備え、
     前記シーケンスプログラムは、1つ以上の前記呼出し命令を含み、
     選択操作に従い、前記1つ以上の呼出し命令のうち、前記ライブラリのシーケンスロジックのコードの変更に用いる前記変更後のシーケンスロジックを有する呼出し命令を選択する、請求項1から3のいずれか1項に記載のサポート装置。
  5.  前記1つ以上の呼出し命令のうち前記エディタによりシーケンスロジックの変更がなされた呼出し命令の一覧を表示する、請求項4に記載のサポート装置。
  6.  前記モニタ部は、
     前記制御装置から前記単位プログラムが定義するシーケンスロジックの実行状態を示す回路出力状態を取得するとともに、前記単位プログラムが定義するシーケンスロジックが示す回路および取得した前記回路出力状態に基づいて、前記制御装置における当該シーケンスロジックの実行状態を、前記展開された回路において視覚化する、請求項1から5のいずれか1項に記載のサポート装置。
  7.  制御対象を制御する制御装置で実行されるシーケンスプログラムの開発の支援に向けられたサポートプログラムであって、
     前記シーケンスプログラムは、当該シーケンスプログラムを構成する単位プログラムの呼出し命令を含み、
     前記サポートプログラムはコンピュータに、
     前記コンピュータに対する操作を受付けるステップと、
     前記シーケンスプログラムの表示時に、前記単位プログラムの呼出し命令を、当該単位プログラムが定義するシーケンスロジックが示す回路に展開して表示するステップと、
     表示される前記回路を変更する操作に従い、前記シーケンスロジックを変更後の回路を表すシーケンスロジックに変更するステップと、
     前記シーケンスプログラムを実行可能コードに変換するステップと、を備え、
     前記実行可能コードに変換するステップは、
     切替えオプションに従い、前記シーケンスプログラム中の呼出し命令に、前記変更後のシーケンスロジックのコードおよび呼出し命令コードの一方を割当てて前記変換を実施するステップを含む、サポートプログラム。
PCT/JP2020/010351 2019-06-07 2020-03-10 サポート装置およびサポートプログラム WO2020246096A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202080039322.0A CN113892065A (zh) 2019-06-07 2020-03-10 支持装置以及支持程序
EP20818200.6A EP3982214A4 (en) 2019-06-07 2020-03-10 CARE DEVICE AND CARE PROGRAM
US17/616,109 US20220317977A1 (en) 2019-06-07 2020-03-10 Support device and computer-readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019-106981 2019-06-07
JP2019106981A JP7234810B2 (ja) 2019-06-07 2019-06-07 サポート装置およびサポートプログラム

Publications (1)

Publication Number Publication Date
WO2020246096A1 true WO2020246096A1 (ja) 2020-12-10

Family

ID=73653049

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/010351 WO2020246096A1 (ja) 2019-06-07 2020-03-10 サポート装置およびサポートプログラム

Country Status (5)

Country Link
US (1) US20220317977A1 (ja)
EP (1) EP3982214A4 (ja)
JP (1) JP7234810B2 (ja)
CN (1) CN113892065A (ja)
WO (1) WO2020246096A1 (ja)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08166807A (ja) * 1994-12-15 1996-06-25 Omron Corp 制御プログラム作成装置
JP2001005517A (ja) 1999-06-24 2001-01-12 Hitachi Ltd 制御プログラムのモニター方法および装置
JP2004280341A (ja) * 2003-03-14 2004-10-07 Omron Corp ファンクションブロック呼び出し命令を含むラダープログラムの表示切替方法及びプログラミング装置
JP2004295872A (ja) 2003-03-13 2004-10-21 Omron Corp 制御装置、cpuユニット、プログラマブルコントローラのユーザプログラム編集方法、及びオンラインエディットされる際のプログラマブルコントローラの処理方法
JP2009122936A (ja) * 2007-11-14 2009-06-04 Fanuc Ltd 異常調査用表示機能を備えたシーケンスプログラムモニタ装置およびプログラマブルコントローラ
WO2010089862A1 (ja) * 2009-02-04 2010-08-12 三菱電機株式会社 ラダープログラム編集装置
WO2018051441A1 (ja) * 2016-09-14 2018-03-22 三菱電機株式会社 ラダープログラム編集支援装置およびラダープログラムの編集方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4952401B2 (ja) * 2007-06-29 2012-06-13 株式会社ジェイテクト Plc
US8782599B2 (en) * 2008-06-26 2014-07-15 Invensys Systems, Inc. Multi-mode editor for configuring process control blocks including both logical functions and arithmetic computations
US8935670B2 (en) * 2010-10-25 2015-01-13 Sap Se System and method for business function reversibility
US9727442B2 (en) * 2014-05-08 2017-08-08 Mitsubishi Electric Corporation Engineering tool, program editing device, and program editing system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08166807A (ja) * 1994-12-15 1996-06-25 Omron Corp 制御プログラム作成装置
JP2001005517A (ja) 1999-06-24 2001-01-12 Hitachi Ltd 制御プログラムのモニター方法および装置
JP2004295872A (ja) 2003-03-13 2004-10-21 Omron Corp 制御装置、cpuユニット、プログラマブルコントローラのユーザプログラム編集方法、及びオンラインエディットされる際のプログラマブルコントローラの処理方法
JP2004280341A (ja) * 2003-03-14 2004-10-07 Omron Corp ファンクションブロック呼び出し命令を含むラダープログラムの表示切替方法及びプログラミング装置
JP2009122936A (ja) * 2007-11-14 2009-06-04 Fanuc Ltd 異常調査用表示機能を備えたシーケンスプログラムモニタ装置およびプログラマブルコントローラ
WO2010089862A1 (ja) * 2009-02-04 2010-08-12 三菱電機株式会社 ラダープログラム編集装置
WO2018051441A1 (ja) * 2016-09-14 2018-03-22 三菱電機株式会社 ラダープログラム編集支援装置およびラダープログラムの編集方法

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
JP7234810B2 (ja) 2023-03-08
EP3982214A4 (en) 2023-04-05
US20220317977A1 (en) 2022-10-06
EP3982214A1 (en) 2022-04-13
CN113892065A (zh) 2022-01-04
JP2020201636A (ja) 2020-12-17

Similar Documents

Publication Publication Date Title
JP2018185772A (ja) 産業用コントローラ及び産業用コントローラにおけるデータ共有方法
WO2020246097A1 (ja) サポート装置およびサポートプログラム
JP2003108220A (ja) 制御プログラム開発支援方法及び装置
JP2016224558A (ja) プログラム作成支援装置、制御方法およびプログラム
WO2020039900A1 (ja) 情報処理装置およびプログラム
JP5849592B2 (ja) プログラマブルコントローラシステム、そのプログラミング装置、プログラマブルコントローラ、プログラム、デバッグ方法
WO2020246096A1 (ja) サポート装置およびサポートプログラム
JP7024679B2 (ja) 開発支援プログラム、開発支援装置、および開発支援方法
JP2006172128A (ja) プログラム連携システムの処理方法および情報処理装置
WO2020179581A1 (ja) 制御装置およびソフトウェアのデプロイ方法
JP7001012B2 (ja) サポート装置およびサポートプログラム
WO2020021993A1 (ja) 情報処理装置および表示プログラム
CN116490830A (zh) 控制系统以及控制方法
JP4877257B2 (ja) プログラマブルコントローラ、プログラマブルコントローラ支援装置、及びプログラマブルコントローラシステム
JP7238678B2 (ja) 情報処理装置、サポートプログラムおよびサポートシステム
JP7070223B2 (ja) サポート装置およびサポートプログラム
US11640153B2 (en) Control system, support device, and recording medium
JP7091986B2 (ja) 制御システム、制御方法、および開発支援プログラム
WO2022249713A1 (ja) 制御システム、システムプログラムおよびデバッグ方法
JP7052620B2 (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: 20818200

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2020818200

Country of ref document: EP