Support device and recording medium
By providing support devices, including operation acceptance, monitor, editor and code conversion section, the problem of inefficient logical code development in sequence program development is solved, and more efficient serial program development and management is achieved.
Patent Information
- Application Number
- CN202080039322.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-07
- Filing Date
- 2020-03-10
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2040-03-10
AI Technical Summary
The prior art is difficult to effectively assist in the development of logical codes in functional blocks in serial program development, resulting in low development efficiency.
A support device is provided, including an operation acceptance unit, a monitor unit, an editor unit and a code conversion unit, which can expand and display call commands of the unit program in the sequence program, allow the user to change the sequence logic and convert the sequence program into executable code.
With the assistance of the support device, users can develop and manage sequence programs more effectively, improve development efficiency, and achieve flexible changes and management of sequence logic.
Smart Images

Figure CN113892065B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a support device that assists in developing a control program executed by a control device that controls a control object and a support program for realizing the support device. Background Art
[0002] Control devices such as PLC (Programmable Logic Controller) are introduced in various manufacturing sites. Such a control device is a computer that executes a control program included in a user program designed according to a manufacturing device, manufacturing equipment, etc. Such a control program is generated in a development environment prepared separately from the control device. The following device is also called a support device: the device provides a development environment and provides a function of uploading a control program to a control device or downloading a control program to a control device. The control program includes a sequence program that represents a control sequence.
[0003] In a sequence program, a common sequence logic is prepared as a function block that describes the logic. By describing a call command of the function block in the sequence program, componentization and reuse of the function block can be achieved, thereby improving program development efficiency.
[0004] For example, Japanese Patent Application Laid-Open No. 2001-5517 (Patent Document 1) discloses a device that displays a control logic diagram using function blocks, which is the basis of a program being executed by a controller, in association with the execution status of the program in the controller.
[0005] Japanese Patent Application Laid-Open No. 2004-295872 (Patent Document 2) discloses a method for editing a user program by online editing, regardless of where the editing target of the user program is located or whether the editing locations are increased (including function block editing).
[0006] Prior art literature
[0007] Patent Literature
[0008] Patent Document 1: Japanese Patent Application Publication No. 2001-5517
[0009] Patent Document 2: Japanese Patent Application Publication No. 2004-295872 Summary of the invention
[0010] Problems to be solved by the invention
[0011] By componentizing the function blocks as described above, the instruction code for calling the components can be recorded in the sequence program, which has the advantage of making it easy to understand the structure of the sequence program. On the other hand, in the program development scene, it is expected to enrich the environment for developing the logic code actually recorded in the function blocks.
[0012] An object of the present disclosure is to provide an environment that can effectively assist sequence program development.
[0013] Means for solving problems
[0014] One example of the present disclosure is a support device that assists in developing a sequence program executed by a control device that controls a control object, wherein the sequence program includes a call command for a unit program that constitutes the sequence program, and the support device comprises: an operation receiving unit that receives an operation on the support device; a monitor unit that, when displaying the sequence program, expands the call command of the unit program and displays it as a circuit represented by a sequence logic defined by the unit program; an editor unit that changes the sequence logic to a sequence logic representing the changed circuit in accordance with the operation of changing the displayed circuit; and a code conversion unit that converts the sequence program into an executable code, and the code conversion unit performs the conversion by assigning a code of the changed sequence logic and a call command code to the call command in the sequence program in accordance with a switching option.
[0015] According to the present disclosure, when the call commands for calling the same unit program are recorded in multiple locations in a sequence program, the call command of one location is assigned the sequence logic changed by the editor unit, and the call commands of other locations keep the original call command code unchanged, thereby being able to be converted into executable code.
[0016] In the above disclosure, the support device has a setting unit, which sets a switching option in the call command of the sequence program according to a setting operation. When the monitor unit displays the sequence program, if the switch option is set in the call command, the call command is expanded and displayed as a circuit.
[0017] According to the present disclosure, when displaying a sequence program, in a call-up command in which a switching option is set in the sequence program, the call-up command is not displayed, but a circuit based on the sequence logic defined in the unit program to be called is displayed.
[0018] In the above disclosure, the control device includes a library storing the code of the sequence logic of the unit program in a callable manner, and the code of the sequence logic stored in the library is changed using the code of the sequence logic after the change.
[0019] According to the present disclosure, the code of the sequence logic after the change in the sequence program by the editor unit can be used to edit the code of the sequence logic of the corresponding unit program in the library of the control device.
[0020] In the above disclosure, the control device has a library that stores the code of the sequence logic of the unit program in a callable manner, and the sequence program contains one or more of the above-mentioned call commands. According to a selection operation, a call command of the changed sequence logic used in the change of the code of the sequence logic in the library is selected from among the one or more call commands.
[0021] According to the present disclosure, it is possible to select a code used for editing the code of the sequence logic of the corresponding unit program in the library from the code of the sequence logic corresponding to each changed call-up instruction in the sequence program.
[0022] In the above disclosure, a list of call-up commands in which sequence logic has been changed by the editor unit among one or more call-up commands is displayed.
[0023] According to the present disclosure, the user can select a call-up command used for editing the code of the sequence logic of the corresponding unit program in the library (that is, a call-up command for which the sequence logic is changed by the editor unit) from the displayed list of call-up commands.
[0024] In the above disclosure, the monitoring unit obtains the circuit output status representing the execution status of the sequential logic defined by the unit program from the control device, and visualizes the execution status of the sequential logic in the control device in the expanded circuit based on the circuit represented by the sequential logic defined by the unit program and the obtained circuit output status.
[0025] According to the present disclosure, in the portion of the call command displayed by the support device, the execution status of the sequence program being executed in the control device can be visualized and presented in the expanded circuit.
[0026] One example of the present disclosure is a support program for assisting in the development of a sequence program executed by a control device that controls a control object, wherein the sequence program includes a call command for a unit program that constitutes the sequence program, and the support program has the following steps in a computer: accepting operations on the computer; when displaying the sequence program, expanding the call command of the unit program and displaying it as a circuit represented by the sequence logic defined by the unit program; changing the sequence logic to a sequence logic representing the changed circuit in accordance with the operation of changing the displayed circuit; and converting the sequence program into an executable code, the step of converting into an executable code including the following steps: according to a switching option, assigning the call command in the sequence program to one of the code of the changed sequence logic and the call command code to implement the conversion.
[0027] According to the present disclosure, by executing a support program, when the calling commands for calling the same unit program in a sequence program are recorded in multiple locations, the calling command of one location is assigned the sequence logic changed by the editor unit, and the calling commands of other locations keep the original calling command codes unchanged, thereby being able to be converted into executable codes.
[0028] Effects of the Invention
[0029] According to an example of the present disclosure, an environment capable of effectively assisting the development of a sequence program is provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 1 is a schematic diagram showing a configuration example of a PLC system 1 to which a support device 200 according to an embodiment of the present invention can be applied.
[0031] Figure 2 It means composition Figure 1 Schematic diagram of a hardware configuration example of a PLC 100 of the PLC system shown.
[0032] Figure 3 2 is a schematic diagram showing a hardware configuration example of the support device 200 according to the embodiment of the present invention.
[0033] Figure 4 It is a schematic diagram showing an example of the software configuration of the PLC 100 according to the embodiment of the present invention.
[0034] Figure 5 This is a diagram for explaining an example of data reference between the user program 112 and the variable table in the PLC 100 according to the embodiment of the present invention.
[0035] Figure 6 It is a schematic diagram showing an example of the software configuration of the support device 200 according to the embodiment of the present invention.
[0036] Figure 7 This is a diagram schematically showing an example of the local flag table 273 according to the embodiment of the present invention.
[0037] Figure 8 This is a diagram schematically showing an example of the definition flag table 274 according to the embodiment of the present invention.
[0038] Fig. 9 This is a diagram schematically showing an example of editing of the sequence logic according to the embodiment of the present invention.
[0039] Fig.10 This is a diagram schematically showing a part of the FUN / FB definition 276 according to the embodiment of the present invention.
[0040] Fig.11This is a diagram schematically showing a part of the sequence program 271 according to the embodiment of the present invention.
[0041] Fig.12 This is a diagram schematically showing an example of a sequence program 271 using a call instruction of a FUN / FB definition 276 according to an embodiment of the present invention.
[0042] Fig.13 This is a flowchart showing an outline of processing according to an embodiment of the present invention.
[0043] Fig.14 1 is a flowchart illustrating an online editing process according to an embodiment of the present invention.
[0044] Fig.15 is a flowchart illustrating the construction process of an embodiment of the present invention.
[0045] Fig.16 This is a diagram for explaining the execution start timing of a control program transferred by the online editing function according to the embodiment of the present invention.
[0046] Fig.17 This is a diagram for explaining the advantages achieved by the development support environment according to the embodiment of the present invention.
[0047] Fig.18 This is a diagram for explaining the advantages achieved by the development support environment according to the embodiment of the present invention.
[0048] Fig.19 This is a diagram for explaining the advantages achieved by the development support environment according to the embodiment of the present invention.
[0049] Fig. 20 This is a diagram schematically showing an example of sequence circuit information according to the present embodiment.
[0050] Fig.21 It is a diagram for schematically explaining an application example of the present disclosure. DETAILED DESCRIPTION
[0051] The embodiments of the present invention will be described in detail with reference to the accompanying drawings. In addition, the same or corresponding parts in the drawings are denoted by the same reference numerals and their description will not be repeated.
[0052] [§.Application Examples]
[0053] First, an example of a scenario in which the present invention is applied will be described. Fig.21 Schematically illustrates an application example of the present disclosure. Fig.21The support device 200 of the present disclosure can be connected to a control device that controls objects such as manufacturing equipment at a manufacturing site. The two communicate, for example, via a USB (Universal Serial Bus). The support device 200 provides an environment that assists the development of a control program executed by the control device. In the following description, a PLC 100 is shown as a typical example of a control device, but it is not limited to a PLC.
[0054] The support device 200 provides an environment for developing various user programs including control programs. The program to be developed may include, for example, a program in accordance with the international standard IEC61131-3. In the international standard IEC61131-3, five programming languages are specified as programming languages for PLC applications including control programs: ladder diagram (LD: Ladder Diagram), function block diagram (FBD: Function Block Diagram), sequence function chart (SFC: Sequential Function Chart), instruction list (IL: Instrution List), and structured text (ST: Structured Text). The control program of the present embodiment is a sequence program 271, and it may also be a sequence program 271 described in any programming language. As a typical example, the sequence program 271 described in a ladder diagram is described below.
[0055] The PLC 100 has a library 275 that stores executable codes of a plurality of unit programs including functions and function blocks. The sequence program 271 includes a call command for calling one or more unit programs constituting the sequence program 271. Therefore, in the PLC 100, during the execution of the sequence program 271, the corresponding unit program is called and executed from the library 275 by executing the call command.
[0056] 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. When the monitor 224 displays the sequence program 271 on the display 214, the call command of the unit program is expanded and displayed as a circuit represented 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. When converting the sequence program 271 into a code that can be executed in the PLC 100, the builder 223 implements the conversion while allocating the code of the changed sequence logic and the call command code to the call command in the sequence program 271 according to the switching option.
[0057] Thus, for example, when editing the sequence program 271, the called unit program can be expanded and displayed as a circuit represented by the sequence logic defined by the unit program. This enables the sequence logic code actually written in the unit program called by the call command to be understood through the sequence circuit at the development site such as when editing the sequence program 271.
[0058] Furthermore, by performing an operation to change the displayed sequential circuit, the user can change the original sequential logic of the circuit to the sequential logic represented by the changed circuit.
[0059] When converting the code that can execute the sequence program 271, by switching options, it is possible to convert the code to the executable code while allocating the changed sequence logic code and the call command code to each call command. In this way, by setting the switching option, it is possible to obtain the executable code to which the changed sequence logic code is allocated only for the desired call command. Therefore, in the PLC 100, when executing the sequence program 271 converted into the executable code, even if there are multiple command codes that originally call the same unit program, the sequence logic code changed by the user can be executed in one of the call command codes, and the sequence logic code read from the library 275 can be executed in another command code. In this way, the unit program as a common component can be changed for each use part of the sequence program 271.
[0060] In addition, the support device 200 uses the changed sequence logic code to change the sequence logic code of the unit program stored in the library 275 of the PLC 100. Thus, when it can be confirmed that the execution result of the changed sequence logic code executed as one of the above-mentioned call command codes is appropriate, the user can change (update) the sequence logic code of the corresponding unit program stored in the library 275 to the changed sequence logic code that has been confirmed to be appropriate. Thus, even if the unit program as a common component in the sequence program 271 is called at multiple locations, the sequence program 271 can be executed at only one location so that the executed sequence logic code is different from that at other locations, and the sequence logic code of the unit program in the library 275 can be changed based on the result obtained.
[0061] Hereinafter, as a more specific application example of the present invention, a more detailed structure and processing of the support device 200 according to the present embodiment will be described.
[0062] <A. Software Structure>
[0063] The software configuration for realizing the above-described application example will be described. Figure 6 It is a schematic diagram showing an example of the software configuration of the support device 200 according to the embodiment of the present invention.
[0064] In this software structure, an "online monitor" is provided, which is a function for checking the execution status of a user program (sequence program 271) arbitrarily created according to a control object in a control device. The online monitor is a concept including the power flow display described below.
[0065] In addition, an “online editor” is provided, which is a function of editing and updating the sequence program 271 executed by the control device of the user program (sequence program 271).
[0066] In this embodiment, the support device 200 is configured to provide two environments, an "online editor" and an "online monitor" including a power flow display, but may provide either environment. For example, the support device 200 may be configured to provide only an "online editor" without an "online monitor".
[0067] exist Figure 6 , the software structure of the support device 200 is shown in association with data exchange with the PLC 100. Figure 6 , the support device 200 generates an intermediate code 272 based on the sequence program 271 and transmits it to the PLC 100. The PLC 100 converts the intermediate code 272 received from the support device 200 into a local code. The operation processing unit of the PLC 100 executes the local code. The control of the control object is realized by executing the local code. The sequence program 271 includes a call command unit, which calls the unit program constituting the sequence program 271. In this embodiment, as a unit program, a FUN / FB definition as a definition of a function (FUN: function) or a function block (FB: Function Block) is exemplified. The FUN / FB definition is a common component for making the description of the sequence program 271 efficient, and is registered in the library of the PLC 100, etc. When the sequence program 271 is executed, the sequence logic defined by calling from the library is appropriately executed. In addition, the definition content of the unit program depends on the specification of the program language that describes the unit block, and in this embodiment, a circuit structure based on the sequence logic according to the above-mentioned ladder diagram is specified. This circuit structure mainly includes a logical circuit structure.
[0068] In addition, the support device 200 stores the object code 2788 for realizing the screen display of the monitor 224 in the support device 200 in the storage unit 201. The storage unit 201 of the support device 200 also stores sequence circuit information 279 and definition circuit information 280 that are generated based on the user program for the PLC 100 and define the circuit structure of the sequence program. The definition circuit information 280 indicates the circuit structure defined by the above-mentioned FUN / FB definition.
[0069] The support device 200 has an editor 222 for creating a sequence program 271. During editing, the option setting module 2311 of the editor 222 selects one or more call commands from the call commands of the unit programs of the sequence program 271 according to the user operation accepted by the operation accepting unit 221 from the operation unit 203, and sets a display mode switching option in the selected call command.
[0070] Therefore, during editing, the command code is added, deleted, changed, etc. while the sequence program 271 is displayed on the monitor 224, and in this case, one or more call commands are switched to an image of the circuit structure represented by the sequence logic defined by the corresponding unit program based on the set options. Thus, as a call command of a unit program, the circuit structure specified by the unit program is expanded and displayed inline. In this way, through user operation, options are selectively set in one or more call command sections, thereby visualizing the circuit structure specified by the corresponding unit program in one or more call command sections.
[0071] Such visualization is also implemented during online editing. The local editor 233 of the online editor 232 edits (changes) the sequence program 271 according to the change operation on the image of the circuit structure expanded inline of the sequence program 271. In addition, 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 on the image of the circuit structure expanded inline.
[0072] In addition, the support device 200 has an online monitoring module 238 for providing online monitoring. The online monitoring module 238 obtains the circuit output status 156 (described later) indicating the execution status of the native code from the PLC 100. That is, the circuit output status 156 is exchanged between the support device 200 (online monitoring module 238) and the PLC 100. Then, the online monitoring module 238 of the support device 200 visualizes the execution status of the sequence program in the PLC 100 (that is, provides online monitoring) based on the sequence circuit information 279, the definition circuit information 280, and the obtained circuit output status 156. Through the visualization of the execution status, information is provided to assist the user in determining whether to edit (change) the sequence logic.
[0073] An editor having such an inline expansion option and an online monitor that visualizes the execution status in the PLC 100 provide an environment that assists in efficient development of unit programs, sequence programs, and the like.
[0074] Hereinafter, as a more specific application example of the present invention, a more detailed structure and processing of the support device 200 according to the present embodiment will be described.
[0075] <B. System structure>
[0076] Figure 1 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.
[0077] Reference Figure 1 , the PLC system 1 includes a plurality of PLCs 100-1, 100-2, 100-3, 100-4, ... (hereinafter, collectively referred to as "PLC 100"). PLC 100 is an example of a control device that controls field devices such as relays and sensors, i.e., control objects. The support device 200 can be connected to the PLC 100 to provide an environment that assists the PLC 100 in developing control programs. The PLC system 1 can also be a structure that includes one PLC 100. In the following, in order to simplify the description, the development environment for one PLC 100 is described.
[0078] Typically, the PLC 100 includes a CPU unit 10 that is a main body for executing various programs including a control program, a power supply unit 12 that supplies power to the CPU unit 10, etc., and an I / O (Input / Output) unit 14 that exchanges signals from the field. The I / O unit 14 is connected to the CPU unit 10 via a system bus 11.
[0079] The development support environment provided by the support device 200 may include an editor (editing), a debugger, a simulator for controlling the program, 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 obtaining the state value of the PLC 100 in operation and outputting it to a monitor such as a display.
[0080] By installing the application program stored in the recording medium 250, i.e., the support program, in the support device 200, various functions for developing the auxiliary environment as described above are realized. The support program may also be downloaded from an external server device or the like via a network instead of the recording medium 250. As an example, 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 realized by a personal computer.
[0081] <C. Example of hardware configuration of PLC 100>
[0082] Next, a hardware configuration example of the PLC 100 will be described. Figure 2 It means composition Figure 1Schematic diagram of a hardware configuration example of PLC 100 of the PLC system shown.
[0083] Reference Figure 2 , the PLC 100 controls the controlled object by executing a pre-installed program through a processor. More specifically, the PLC 100 includes a processor 102 such as a CPU (Central Processing Unit) or an MPU (Micro-Processing Unit), a chipset 104, a main memory 106, a flash memory 108, a USB interface 116, a memory card interface 118, an internal bus controller 122, and a field bus controller 124. The flash memory 108 stores a system program 110 and a user program 112.
[0084] The processor 102 reads the system program 110 and the user program 112 stored in the flash memory 108, expands and executes them in the main memory 106, thereby realizing control of the control object. In this specification, the "control program" is a kind of program arbitrarily designed according to the control object, and is a concept that includes the system program 110 and the user program 112. However, in the installation method, the control program may only include the user program 112.
[0085] The system program 110 includes command codes for providing basic functions of the PLC 100, such as data input and output processing and execution timing control. The user program 112 includes a sequence program 112A (corresponding to the sequence program 271) for executing sequence control and a library 275. The library 275 includes various functions that can be called from the sequence program 112A when the sequence program 112A is executed, and one or more FUN / FB definitions 276.
[0086] In addition, the user program 112 may include other programs such as motion programs, but in this embodiment, the sequence program 112A is mainly described for the purpose of explanation. In addition, in this embodiment, as the sequence program 112A, for example, a "ladder program" is included, and the "ladder program" describes the command code of the operation represented by the ladder logic circuit (logic circuit) or the combination of ladder logic circuits using the ladder language specified by IEC61131-3, etc.
[0087] The FUN / FB definition 276 of the library 275 indicates the definition content of FUN or FB. The FUN or FB defined by the FUN / FB definition 276 is equivalent to a unit program (hereinafter also referred to as POU (Program Organization Unit)) constituting a sequence program. The code of the sequence logic defined by the 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.
[0088] The chipset 104 realizes processing of the PLC 100 as a whole by controlling each component.
[0089] The internal bus controller 122 is an interface for exchanging data with the I / O unit 14, and the I / O unit 14 is connected to the PLC 100 via the internal bus. The field bus controller 124 is an interface for exchanging data with the I / O unit 16, and the I / O unit 16 is connected to the PLC 100 via a field bus (not shown). The internal bus controller 122 and the field bus controller 124 obtain the state values input to the corresponding I / O units 14 and 16, respectively, and output the calculation results in the processor 102 from the corresponding I / O units 14 and 16 as instruction values, respectively.
[0090] The USB (Universal Serial Bus) interface 116 controls data exchange via USB. The support device 200 communicates with the PLC 100 via the USB interface 116. The memory card interface 118 is configured to allow the memory card 120 to be removable, and to allow data to be written to and read from the memory card 120.
[0091] exist Figure 2 In the figure, a structural example is shown in which the required functions are provided by executing a program by the processor 102, but a dedicated hardware circuit (for example, an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array) etc.) may be used to install part or all of these provided functions. Alternatively, the main part of the PLC 100 may be implemented using hardware that follows a general architecture (for example, an industrial personal computer based on a general-purpose personal computer). In this case, virtualization technology may also be used to execute multiple OS (Operating System) with different purposes in parallel, and the required applications may be executed on each OS.
[0092] <D. Hardware Configuration Example of Support Device 200>
[0093] Figure 3 FIG. 2 is a schematic diagram showing an example of a hardware configuration of a support device 200 according to an embodiment of the present invention. Figure 3 The support device 200 is typically composed of a general-purpose computer. In addition, from the perspective of maintainability at a manufacturing site where the PLC 100 is installed, a notebook-type personal computer with excellent portability is preferred.
[0094] The support device 200 has 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 that stores BIOS and various data, a RAM (Random Access Memory) 206 that provides a work area for storing data required for program execution in the CPU 202, and a hard disk (HDD) 208 that stores programs executed by the CPU 202 in a non-volatile manner.
[0095] The support device 200 further includes: an operation unit 203 including a keyboard 210 and a mouse 212 operated by a 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 for communicating with the USB interface 116.
[0096] The support device 200 includes an optical recording medium reading device 216 for reading, from the recording medium 250 , a support program for providing a development support environment stored therein.
[0097] exist Figure 3 , a configuration example is shown in which a processor such as CPU 202 executes a program to provide the required functions, but a dedicated hardware circuit (such as ASIC or FPGA, etc.) may be used to implement part or all of the provided functions. In this case, virtualization technology may be used to execute multiple OSs with different purposes in parallel, and the required applications may be executed on each OS.
[0098] <E.PLC software configuration example>
[0099] Figure 4 It is a schematic diagram showing an example of the software configuration of the PLC 100 according to the embodiment of the present invention.
[0100] Reference Figure 4 In the PLC 100, 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 mediating, thereby executing the real-time OS 114 and the general-purpose OS 1161 independently of each other on the common hardware resources. That is, the hypervisor 111 is used to realize a virtualized environment for executing multiple different OSes. The real-time OS 114 and the general-purpose OS 1161 form a logical network via the hypervisor 111.
[0101] The user program 112 including the sequence program is executed in the real-time OS 114. When the user program 112 is executed, the task scheduler 1142, the program manager 1144, and the I / O (Input / Output) control program 1146 are associated. The user program 112 is converted into an executable format in advance, and the code of the executable format cooperates with the task scheduler 1142, the program manager 1144, and the I / O control program 1146, and repeatedly obtains signals from the control object, executes the control logic, and reflects the execution results (control of the actuator).
[0102] The I / O control program 1146 is responsible for processing various signals exchanged with the control object. The task scheduler 1142 controls the execution cycle or execution timing for each task included in the user program 112. In the present embodiment, the task scheduler 1142 executes the task when the timing of the start of the execution cycle of the task arrives and the timing signal is received from the program manager 1144. The details of the execution control using the timing signal of the program manager 1144 will be described later.
[0103] In the general-purpose OS 1161 , arbitrary user applications 1164 and general-purpose applications 1162 are executed.
[0104] Typically, the user application 1164 is an application created by a developer or the like of the user program 112 executed in the real-time OS 114 , and performs processing to obtain and / or provide data related to processing results of the user program 112 and / or data required for processing.
[0105] The general-purpose application 1162 is a standard application that can be executed in the general-purpose OS 1161 , and by cooperating with the user application 1164 , it is possible to use general-purpose processing and functions, thereby building a system with less man-hours.
[0106] <F. PLC 100 software reference example>
[0107] Figure 5 This is a diagram for explaining an example of data reference between the user program 112 and the variable table in the PLC 100 according to the embodiment of the present invention.
[0108] Reference Figure 5 In the PLC 100, when the control program is executed, the system program 110 and the user program 112 are executed. The system program 110 has an I / O module 160 as part of its function. The I / O module 160 associates the data exchanged between the I / O unit and the field side where the controlled object device is installed with the global variable table 150.
[0109] In the PLC 100 , variable programming is possible, and the user program 112 can execute various processes using variable values associated with field data defined in the global variable table 150 .
[0110] The sequence program 112A of the user program 112 is mainly composed of the ladder diagram section 130 and the library 275. The user program 112 represents the native code 154 in a form that can be executed by the processor 102.
[0111] The ladder section 130 includes a ladder program written in a ladder language. When a call command 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.
[0112] <G. Software Configuration Example of Support Device 200>
[0113] Figure 6 FIG. 2 is a schematic diagram showing an example of the software structure of the support device 200 according to the embodiment of the present invention. Figure 6 , an example of information stored in the storage unit 201 is shown in association with the software configuration of the support device 200 . Figure 7 This is a diagram schematically showing an example of the local flag table 273 according to the embodiment of the present invention. Figure 8 This is a diagram schematically showing an example of the definition flag table 274 according to the embodiment of the present invention. Fig. 9 This is a diagram schematically showing an example of editing of the sequence logic according to the embodiment of the present invention.
[0114] (g1. Information stored in the support device 200)
[0115] The information stored in the storage unit 201 includes a sequence program 271 as a program source code, an intermediate code 272 generated based on the sequence program 271 , a local flag table 273 , a definition flag table 274 , an object code 2788 , sequence circuit information 279 , and definition circuit information 280 .
[0116] Reference Figure 7 In the local flag table 273, information is registered for each FUN / FB definition 276 that is called by a call command in the sequence program 271 and whose sequence logic (sequence circuit) is expanded (hereinafter also referred to as inline expansion) in the sequence program 271. The information corresponding to each FUN / FB definition 276 includes a name (POU name, etc.) identifying the FUN / FB definition 276, that is, a call name 2731, a position 2732 of a line (line) where the call command of the FUN / FB definition 276 appears in the sequence program 271, and an asynchronous flag 2733.
[0117] Reference Figure 8 The definition flag table 274 registers, for each FUN / FB definition 276 of the library 275 , a definition name 2741 that is an identifier (POU name, etc.) of the FUN / FB definition 276 and a definition asynchronous flag 2742 in association with each other.
[0118] Here, the asynchronous flag 2733 and the definition asynchronous flag 2742 are explained. The support device 200 changes the sequence logic expanded inline in the sequence program 271 according to the user operation (hereinafter referred to as local editing). In addition, the support device 200 changes the definition content of the corresponding FUN / FB definition 276 of the library 275 (hereinafter referred to as definition editing). By performing such local editing or definition editing, a state in which the sequence logic of the FUN / FB definition 276 expanded inline in the sequence program 271 and the sequence logic of the corresponding FUN / FB definition 276 of the library 275 are inconsistent (hereinafter also referred to as asynchronous), and the sequence logic of the two is consistent by resolving the asynchronous state (hereinafter also referred to as synchronous). Originally, the sequence logic of the two is synchronized. Therefore, the asynchronous flag 2733 is set to "1" when the sequence logic expanded inline in the sequence program 271 is asynchronous, and is set to "0" when it is synchronized. Likewise, the definition asynchronous flag 2742 is set to "1" when the sequence logic defined by the corresponding FUN / FB definition 276 is asynchronous, and is set to "0" when it is synchronous.
[0119] In addition, refer to Figure 8 The definition name 2741 of the FUN / FB definition 276 of the definition flag table 274 is associated with the option 277 described later set in the call command in the sequence program 271 .
[0120] 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 as a control program on the display 214. Specifically, the object code 2788 represents the object code for realizing the screen display of the sequence logic circuit. The sequence circuit information 279 specifies the sequence logic circuit structure of the sequence program 271. The definition circuit information 280 is generated based on the definition content of the FUN / FB definition 276 of the library 275, that is, the sequence logic 2761 (described later), and specifies the circuit structure represented by the sequence logic 2761.
[0121] (g2. Module used to provide development support environment)
[0122] Reference Figure 6, the support program for providing the development support environment includes: a support program 700, which realizes online monitoring including inline expansion by being executed; and a support program 710, which realizes online editing by being executed. The support program 700 includes a program that realizes the operation receiving unit 221 and the monitor 224 for accepting user operations via the operation unit 203. The support program 710 includes a program that realizes the operation receiving unit 221 and the monitor 224. These modules are composed of programs or circuits, or a combination of programs and circuits.
[0123] The editor 222 implements the editing (creation) of the user program including the sequence program 271 according to the user operation. The editor 222 includes an online editor 232. The online editor 232 provides an environment for editing the control program of the PLC 100 without stopping the control object of the PLC 100. That is, in manufacturing sites where the PLC 100 is used, it is not easy to stop the control object in most cases. Based on such a background, even if you want to change a part of the control program executed by the PLC 100, if you cannot change the control program without temporarily stopping the PLC 100, the convenience of use is poor. Therefore, the online editor 232 can rewrite (edit) a part of the control program executed during the operation of the PLC 100 while cooperating with the PLC 100.
[0124] The editor 222 is different from the online editor 232, and can also edit the control program (also called offline editing) independently of the PLC 100 (or the operating state of the PLC 100). During offline editing, the editor 222 creates a user program including the sequence program 271 according to the operation content accepted by the operation accepting unit 221. The created program is stored in the storage unit 201 as a source program, i.e., the sequence program 271. In addition, during offline editing, the option setting module 2311 sets the option 277 indicating the switching of the display mode for one or more selected from the call command in the sequence program 271 according to the user operation content.
[0125] The online editor 232 includes a local editor 233 for implementing local editing and a definition editor 234 for implementing definition editing.
[0126] Fig. 9 FIG. 1 is a diagram schematically showing an example of editing according to an embodiment of the present invention. Fig. 9 , the sequence logic of the sequence program 271 or the sequence logic 2761 (described later) of the FUN / FB definition 276 specifies, for example Fig. 9 In this case, an image representing the circuit structure of sequential logic is displayed on the display 214. The user can manipulate the image by using the editor 222 to change the circuit structure of the sequential logic to the image of the sequential logic. Fig. 9The sequence logic 2761 of the circuit (A) is changed to, for example Fig. 9 (B) or Fig. 9 As in (C), new circuit logic is added.
[0127] As an application example, for example, when the user determines that an error has occurred in a part of the circuit due to a failure of the controlled object as a result of monitoring the circuit output state 156 displayed by the online monitor, Fig. 9 As shown in (C), the display image is changed so as to add a bypass circuit of the circuit component related to the failure. In addition, the application example of editing by the online editor 232 is not limited to handling errors such as failures.
[0128] The builder 223 is an embodiment of a "code conversion unit". The builder 223 performs build processing (including analysis, optimization, compilation, etc.) on the sequence program 271 to generate an 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 local code 154 based on the intermediate code while referring to the definition content of the FUN / FB definition 276 of the library 275. The local code 154 is an executable code that the PLC 100 can directly interpret and execute. In addition, the intermediate code 272 is also a code in a form that the PLC 100 can execute. When the PLC 100 executes the intermediate code 272, for example, it executes it while interpreting each line in an interpreter manner. In this embodiment, the case where the PLC 100 executes the local code 154 is described.
[0129] The monitor 224 displays the information of the execution results of each module in the development support environment and the sequence program 271 on the display 214. When the sequence program 271 is displayed on the display 214, the monitor 224 displays the image of the sequence circuit after inline expansion in the portion of the call command with option 277 set, and only displays the previous call command in the portion of the call command without option 277 set. In this way, the user can expand and display the FUN / FB definition 276 called by the call command inline when the sequence program 271 is displayed by selecting one or more call commands of the sequence program 271 and setting option 277 for the selected call command. Therefore, in the display screen of the logic of the sequence program 271, in the portion of the call command of the sequence program 271 where the user desires one or more call commands, the sequence logic (for example, Fig. 9 Such a circuit structure) is visualized.
[0130] In addition, the monitor 224 includes an online monitoring module 238 for monitoring the execution state of the PLC 100 through the sequence logic (sequence circuit) of the sequence program 271 .
[0131] Specifically, the online monitoring module 238 obtains the circuit output state 156 indicating the execution state of the native code 154 from the PLC 100. That is, the circuit output state 156 is exchanged between the online monitoring module 238 and the PLC 100. Then, the online monitoring module 238 visualizes the execution state of the sequence program 271 in the PLC 100 via the display 214 (that is, provides online monitoring) based on the sequence circuit information 279, the defined circuit information 280, and the obtained circuit output state 156. In the online monitoring, when the sequence program 271 has a circuit structure after inline expansion, the execution state of the sequence logic is also visualized in the sequence circuit after inline expansion.
[0132] By adopting such a configuration, the user can monitor the execution status of the user program including the sequence program 271 executed by the PLC 100 in real time in the support device 200 .
[0133] <H.FUN / FB definition and call command>
[0134] Fig.10 FIG. 2 is a diagram schematically showing a portion of the FUN / FB definition 276 according to the embodiment of the present invention. Fig.10 The FUN / FB definition 276 includes the variable names such as the independent variables used for the operation of the FUN or FB, the definition of the types and data types of the input and output, and the sequence logic 2761. When the FUN / FB definition 276 (unit program) is called and executed, the operation according to the sequence logic 2761 is performed using the values assigned to the defined variables. The execution result is output as a return value from the unit program.
[0135] Fig.11 This is a diagram schematically showing a part of the sequence program 271 according to the embodiment of the present invention. Fig.12 2 is a diagram schematically showing an example of a sequence program 271 using a call instruction of a FUN / FB definition 276 according to an embodiment of the present invention. Fig.11 The sequence program 271 includes, for example, commands 0, 1, and 2. Commands 0 and 1 record the same sequence logic, so commands 0 and 1 can use the common components that define the sequence logic, i.e. Fig.10 FUN / FB definition 276 is replaced by calling instruction 278 (refer to Fig.12 ).
[0136] In addition, Fig.12In the sequence program 271, option 277 is set for command 0 and command 1 by the option setting module 2311, but option 277 is not set for command 2. In this case, the monitor 224 performs inline expansion on the call command 278 of command 0 and command 1 in which option 277 is set. As a result, an image of the circuit structure of the sequence logic 2761 according to the corresponding FUN / FB definition 276 is displayed in the call command 278 of command 0 and command 1.
[0137] <I. Overall treatment>
[0138] Fig.13 1 is a flowchart showing an overview of the processing of an embodiment of the present invention. Fig.13 In the flowchart of FIG. 1 , the processing of the support device 200 and the processing of the PLC 100 are shown in association with each other.
[0139] Reference Fig.13 , the user operates the support device 200 to create a user program including a sequence program 271 for the PLC corresponding to the control object (step S1). Specifically, the editor 222 edits the sequence program 271 according to the user operation through offline editing, and saves the edited sequence program 271 in the storage unit 201. During the offline editing, the option setting module 2311 sets the option 277 for one or more selected call commands of the sequence program 271 according to the user operation.
[0140] During editing, the monitor 224 displays the sequence program 271 on the display 214 (step S3). The monitor 224 performs inline expansion on the call command set with option 277. Therefore, during offline editing, in the portion of the call command set with option 277, the corresponding sequence logic 2761 (sequence circuit structure) is visualized by an image. Here, the variable names of the input and output declared by the inline expanded FUN / FB definition 276 are displayed using the parameter names specified in the call command portion.
[0141] In addition, when the sequence program 271 is displayed, the call command with option 277 set is expanded inline, but in this embodiment, the option setting module 2311 also enables or disables the option 277 set in the call command according to the user operation. Thus, according to the user's selection operation, in the portion of the call command with option 277 set, it is possible to switch whether to display the sequence logic 2761 (sequence circuit structure) by inline expansion (enable option 277) or to directly display the call command (disable option 277).
[0142] In addition, for the inline expanded FUN, the user can specify the instance name (or not specify the instance name) for monitoring. In addition, since the FB has an instance name, it does not need to be specified. When the user specifies the instance name for the inline expanded FUN, the instance name is retained in the sequence program 271. In addition, when the instance name is not specified, an arbitrary unique instance name is assigned at the time of construction.
[0143] When the creation of the sequence program 271 is completed, the builder 223 is started according to the user operation and the build process is performed (step T1). In the build process, the builder 223 generates the intermediate code 272 and the object code 2788 corresponding to the sequence program 271. At this time, the support device 200 also generates the sequence circuit information 279 based on the sequence program 271. The sequence circuit information 279 is information for displaying the online monitoring. The details of the sequence circuit information 279 will be described later.
[0144] The support device 200 transmits the intermediate code 272 corresponding to the sequence program 271 to the PLC 100 (step T2 ).
[0145] The PLC 100 receives and stores the intermediate code 272 from the support device 200 (step U1). The PLC 100 performs startup processing using the received intermediate code 272 (step U2). At this time, the PLC 100 generates an option table 1165 based on the intermediate code 272. The option table 1165 stores the lines of each call command with the option set and the set of definition names.
[0146] The PLC 100 executes the native code 154 (sequence program 271) (step U3). When the control process of the control object is realized by executing the sequence program 271 in the PLC 100, the process related to the online monitoring shown below is executed.
[0147] That is, the user instructs the support device 200 to execute online monitoring. In response to the execution command accepted via the operation accepting unit 221, the online monitoring module 238 is activated. The online monitoring module 238 executes the online monitoring process (step P1).
[0148] The online monitoring module 238 requests the PLC 100 for the circuit output state 156 (step P11). In response to the request, the user application 1164 of the PLC 100 searches the global variable table 150 based on the input and output variables of the sequence circuit specified by the sequence program 271. Through the search, the circuit output state 156 indicating the execution state of the sequence program 271 (native code 154) being executed is obtained from the global variable table 150. The user application 1164 sends the obtained circuit output state 156 to the support device 200 (step U31).
[0149] 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 (i.e., the sequence circuit after inline expansion) specified by the sequence logic 2761 of each FUN / FB definition 276 for which the option 277 is set in the sequence program 271 being executed. The inline circuit state 1166 includes, for each line (line) in which the FUN / FB definition 276 is called as shown in the option table 1165, the line number and the value of the circuit output state of the sequence circuit specified by the FUN / FB definition 276 called in the line.
[0150] The online monitoring module 238 visualizes the sequence of the sequence program 271 including the sequence circuit after inline expansion on the display 214 based on the sequence circuit information, the circuit output state 156 and the inline circuit state 1166 from the PLC 100 (step P12). As a result, it is possible to realize the display of the power flow reflecting the value of the circuit output state in the sequence circuit of the entire sequence program 271 including the sequence circuit after inline expansion.
[0151] The user can check the status of the execution of the sequence program 271 in the PLC 100 based on the screen of the display 214 provided by the online monitoring module 238 .
[0152] In this embodiment, the sequence logic is displayed as (local variable name within FUN / FB definition) instead of (instance name.local variable name within FUN / FB definition) in the call command after inline expansion in the sequence program 271. Therefore, the online monitoring module 238 obtains the current value under the inline circuit state 1166 corresponding to (instance name.local variable name within FUN / FB definition) from the PLC 100 based on the combination of (local variable name within FUN / FB definition) and the instance name, and displays the power flow in the sequence circuit image after inline expansion.
[0153] In addition, when the online monitoring module 238 implements power flow display in the sequence program 271, an observation window can also be displayed in the display 214, and (instance name. Local variable name in FUN / FB definition) and its current value can be output in the observation window.
[0154] Furthermore, the support device 200 may also request only the inline circuit state 1166 from the PLC 100 so that the power flow is displayed only in the sequence circuit image after inline expansion.
[0155] In addition, the online monitoring module 238 may switch between a mode for displaying the power flow of the entire sequence program 271 and a mode for displaying the power flow of only the sequence circuit image after inline expansion. This switching may be performed, for example, according to a user operation.
[0156] When the control process of the control object is realized by executing the sequence program 271 in the PLC 100, the following process related to online editing can be performed.
[0157] That is, during the execution of the sequence program 271 in the PLC 100, the operation accepting unit 221 starts the online editor 232 according to the execution instruction accepted from the user (step Q1). The online editor 232 edits the sequence program 271 according to the user operation accepted by the operation accepting unit 221. At this time, the circuit output state value of the sequence circuit provided by the online monitor can become a visual auxiliary information for the user to judge the part where the sequence logic should be changed. Based on the visualized circuit output state value, the user can judge, for example, Fig. 9 The (A) sequence of circuit failures, and as Fig. 9 The determined fault location is changed as in (B) or (C). The online editor 232 changes (edits) the sequence program 271 according to the user operation received from the operation receiving unit 221. The changed sequence program 271 is stored in the storage unit 201.
[0158] According to the user operation, the builder 223 is started. The builder 223 executes the construction process of the sequence program 271 subjected to the online editing process (step R1). The builder 223 stores the intermediate code 272 obtained by the construction process in the storage unit 201 and transmits it to the PLC 100 (step R2).
[0159] After the transfer, the support device 200 determines whether to end the process according to the user operation (step R3), and ends the process if it is determined to be ended ("Yes" in step R3). If it is determined not to be ended ("No" in step R3), the process moves to the next process such as step P1.
[0160] The PLC 100 determines whether the intermediate code 272 after online editing is received from the support device 200 (step U4). When the PLC 100 receives the intermediate code 272 from the support device 200 ("Yes" in step U4), it saves the received intermediate code 272 (step U5) and then transfers to step U2. Thus, the control of the control object according to the sequence program 271 after online editing and the online monitoring process can be implemented.
[0161] In addition, when the intermediate code 272 is not received ("No" in step U4), the processing is terminated.
[0162] (i1. Online editing and processing)
[0163] Fig.141 is a flowchart illustrating an online editing process according to an embodiment of the present invention. Fig.14 , detailed description Fig.13 Online editing processing (step Q1). In addition, it is assumed that the object of online editing is the sequence logic or FUN / FB definition 276 of the library 275 that has been inline expanded in the call command part. Online editing of the sequence logic or FUN / FB definition 276 that has been inline expanded includes the creation or editing (addition, change, deletion, etc.) of the logic circuit structure or input / output variables.
[0164] First, after being started, the online editor 232 determines whether the editing object is a part (portion) of the sequence logic after inline expansion or the definition content of the FUN / FB definition 276 according to the user operation accepted by the operation accepting unit 221 (step Q11).
[0165] When it is determined to be partial (in step Q11 (partial)), the online editor 232 edits the sequence logic that is inline expanded in one or more call command parts according to the user operation (step Q13), and sets "1" to the asynchronous flag 2733 of the local flag table 273 (step Q17). Specifically, the online editor 232 associates the name of the called FUN / FB definition 276, i.e., the call name 2731, the position 2732 of the line (line) in which the call command is described, and the asynchronous flag 2733 with each other for the part of each call command edited in step Q13, and registers them in the local flag table 273. When registering, the online editor 232 sets "1" to the asynchronous flag 2733.
[0166] The editor 222 instructs the monitor 224 to display the asynchronous call command portion in the sequence program 271 at a glance according to the user operation (step Q19). Specifically, the editor 222 scans the sequence program 271 and outputs the position information indicating the position 2732 of the call command whose corresponding asynchronous flag is "1" among the call commands indicated by the position 2732 of the local flag table 273 to the monitor 224. The monitor 224 changes the call command portion of each line indicated by the position information from the editor 222 in the sequence program 271 being displayed on the display 214 to a predetermined display mode (for example, inverted display, etc.).
[0167] The above-mentioned overview display provides auxiliary information for the user to determine the sequence logic that has been inline expanded in the sequence program 271 and to reflect the sequence logic in the content of the corresponding FUN / FB definition 276 .
[0168] The online editor 232 determines whether to change the content of the FUN / FB definition 276 based on the user operation accepted by the operation accepting unit 221 (step Q21). When the online editor 232 determines that the definition content of the FUN / FB definition 276 is not to be changed (No in step Q21), the processing ends.
[0169] On the other hand, when the online editor 232 determines that the definition content of the FUN / FB definition 276 is to be changed ("Yes" in step Q21), the FUN / FB definition 276 of the library 275 of the PLC 100 is changed (step Q23). Specifically, 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. Through the search, the FUN / FB definition 276 corresponding to the call name 2731 is determined, and the definition content of the determined FUN / FB definition 276 is changed using the edited content accepted in step Q13. The change may also include making the definition content of the FUN / FB definition 276 consistent with the edited (changed) content of the inline expanded sequence logic (copying). The online editor 232 changes the asynchronous flag 2733 corresponding to the portion of the call command that has been changed from "1" to "0".
[0170] Return to step Q11. On the other hand, when the online editor 232 determines that the FUN / FB definition 276 is to be edited ((Define) in step Q11), the online editor 232 changes the definition content of one or more FUN / FB definitions 276 in the library 275 by editing according to the user operation (step Q25), and sets "1" to the definition asynchronous flag 2742 of the definition flag table 274 (step Q27). Specifically, the online editor 232 associates the name of the FUN / FB definition 276 edited in step Q25, that is, the definition name 2741, with the definition asynchronous flag 2742, and registers them in the definition flag table 274. When registering, the online editor 232 sets the definition asynchronous flag 2742 to "1".
[0171] The online editor 232 determines whether to change the sequence logic of the corresponding inline expansion part of the sequence program 271 using the changed definition content of the FUN / FB definition 276 according to the user operation (step Q29). If the online editor 232 determines that it is not to be changed (No in step Q29), the processing ends.
[0172] On the other hand, when the online editor 232 determines that the sequence logic of the inline expansion part is to be changed ("Yes" in step SQ29), the online editor 232 updates the circuit of the sequence logic after the inline expansion of the sequence program 271 to be consistent with the changed definition content of the corresponding FUN / FB definition 276 (step Q31). Specifically, the online editor 232 uses the changed definition content of the FUN / FB definition 276 to change the definition circuit information 280. As a result, the definition circuit information 280 is updated to information indicating the following sequence circuit structure, which indicates the changed definition content of the FUN / FB definition 276. In addition, the online editor 232 instructs the monitor 224 to update the display of the inline expansion part. According to the instruction, the monitor 224 uses the updated definition circuit information 280 to update the image of the sequence circuit structure of the inline expansion part of the sequence program 271. In step Q31, the online editor 232 sets all the asynchronous flags 2733 registered in the local flag table 273 to "0".
[0173] In this way, the online editor 232 and the monitor 224 update the image of the sequence circuit structure of the inline expansion part of the sequence program 271 displayed on the display 214 to the image of the circuit structure specified by the sequence logic of the changed FUN / FB definition 276. As a result, the image of the circuit structure of the sequence logic of the inline expansion part is updated to represent the definition content after the change (editing) of the FUN / FB definition 276. When performing this update, the following visualization information can also be provided, and the visualization information can also be used to confirm the correlation between the peripheral circuit of the sequence program 271 and the sequence logic circuit.
[0174] (i1-1. Specific example of partial editing)
[0175] exist Fig.14 In step Q23, one of two cases can be implemented regarding the change of the definition content of the FUN / FB definition 276. In the first case, when there are multiple call-up command parts that are asynchronous with the sequence program 271, the definition content of the corresponding FUN / FB definition 276 is changed for all of the multiple call-up command parts. In the second case, the definition content is not changed for all of the multiple call-up command parts, but for one or more call-up command parts selected by the user operation among the multiple call-up command parts, and the definition content of the corresponding FUN / FB definition 276 is changed.
[0176] In the second case, the following case is described: the definition content of the corresponding FUN / FB definition 276 is changed for the part of the selected one or more call commands. In this case, the FUN / FB definition 276 corresponding to the call command part not selected by the user operation is not updated, and only the sequence logic expanded inline in the call command part of the sequence program 271 is changed. At this time, the online editor 232 newly saves (overwrites, etc.) the sequence logic changed by the user in the sequence program 271. In addition, the corresponding asynchronous flag 2733 of the local flag table 273 is kept at "1" indicating the asynchronous state.
[0177] The builder 223 performs a construction process on the sequence program 271 having the changed sequence logic. In the construction process, the builder 223 constructs the local variable name of the sequence logic of the inline expansion part of the corresponding FUN / FB definition 276 that has not been updated as (instance name. local variable name in the FUN / FB definition). The intermediate code 272 obtained by construction is transmitted to the PLC 100. In the PLC 100, the local code 154 based on the intermediate code 272 received from the support device 200 is generated, and the PLC 100 executes the sequence program 271 (local code 154). The online monitoring 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 implement a power line display in the sequence logic of the inline expansion part of the asynchronous state. The user can obtain auxiliary information for determining whether to update the corresponding FUN / FB definition 276 using the sequence logic of the inline expansion part of the asynchronous state based on the visualized circuit output state 156.
[0178] In addition, as the main use case of local editing, the present embodiment describes the case applied to online editing, but the use case is not limited to online editing. Specifically, when the content after inline expansion is consistent with the definition content of the corresponding FUN / FB definition 276, if the user does not want to reflect the changes of the FUN / FB definition 276 during online editing, it can be set to an asynchronous state by performing a predetermined operation.
[0179] (i2. Build process)
[0180] Fig.15 1 is a flowchart illustrating the construction process of an embodiment of the present invention. Fig.15 , detailed description Fig.13 Construction processing after online editing (step R1). Fig.15 The construction process of is mainly explained with the processing of the call command part as the main body.
[0181] The builder 223 scans the sequence program 271 line by line from the beginning (step R11). If a call command portion is detected by scanning ("Yes" in step R13), the process moves to step R15. If a call command portion is not detected ("No" in step R13), the process moves to step R23.
[0182] In step R15, the builder 223 determines whether option 277 is set in the call command unit (step R15). When it is determined that option 277 is not set in the call command unit ("no" in step R15), the process moves to step R21. When it is determined that option 277 is set ("yes" in step R15), the builder 223 determines whether the FUN / FB definition 276 called by the call command unit is in online editing based on whether the corresponding definition asynchronous flag 2742 of the definition flag table 274 is "1" (step R17).
[0183] When the asynchronous flag 2742 is defined as "1" and it is determined to be in online editing ("Yes" in step R17), transfer to step R21. In step R21, the builder 223 assigns the code of the predetermined (normal) call command to the call command part. When the asynchronous flag 2742 is defined as "0", that is, it is determined not to be in online editing ("No" in step R17), the builder 223 assigns the code of the sequence logic 2761 of the corresponding FUN / FB definition 276 to the call command part (step R19). In the assigned code, the local variable name defined by the FUN / FB definition 276 is assigned (instance name.local variable name in the FUN / FB definition).
[0184] The builder 223 determines whether the scanning of all the lines of the sequence program 271 has been completed. If it is determined that the scanning has not been completed ("No" in step R23), the process returns to step R11. On the other hand, when the builder 223 determines that the scanning has been completed ("Yes" in step R23), the builder 223 generates the intermediate code 272 based on the sequence program 271 (step R25).
[0185] Steps R17 and R21 in the above-mentioned construction process are further described. In step R17, when the builder 223 determines that the corresponding definition asynchronous flag 2742 of the FUN / FB definition 276 called by the call command part is "1" ("Yes" in step R17), the code of the normal call command is assigned to the call command part (step R21), and the construction process is performed. In this way, the sequence logic that has been online edited for the FUN / FB definition 276 can be executed by the normal call command. In addition, changes based on online editing can also be applied to the sequence logic of inline expansion (the call command part with option 277 set).
[0186] (i3. Sequence circuit information)
[0187] Fig. 20 FIG. 1 is a diagram schematically showing an example of sequence circuit information according to the present embodiment. Fig. 20 , for example, information about circuit components included in each circuit as specified by the user program for the PLC.
[0188] Fig. 20 An example of a circuit composed of one contact 2781 and one coil 2791 is shown. In this example, the circuit definition 2811 of the sequence circuit information 279 includes category information 2821 indicating a category such as "circuit" and circuit component information 2831 and 2841 indicating information on circuit components included in each circuit. Fig. 20 The circuit definition 2811 shown repeats the number of circuits specified by the sequencer 271.
[0189] Similarly, the circuit definition information 280 also repeats the circuit definition by the number of circuit configurations specified by the sequence logic 2761 of the FUN / FB definition 276. Fig. 20 The example of describing the circuit definition 2811 shown is just an example, and any format may be used.
[0190] <J. Program execution start timing in PLC>
[0191] In the present embodiment, when the modified sequence program 271 (intermediate code 272 ) by online editing is transferred to the PLC 100 and the PLC 100 executes the modified sequence program 271 , the timing of starting execution can be appropriately set.
[0192] Fig.16 This is a diagram for explaining the execution start timing of the control program transmitted by the online editing function according to the embodiment of the present invention. The control program is a concept including the sequence program 271. Fig.16 This shows a processing example when the three sequence programs 271 indicated by SA, SB, and SC are transmitted.
[0193] exist Fig.16 In FIG. 1 , when the transfer of each sequence program 271 is completed, an example is shown in which the execution of the sequence program 271 that has been transferred is started. Fig.16 In FIG. 1 , an arrow (→) indicates one execution cycle of a task of the task scheduler 1142. In addition, Fig.16 The “check” step is performed by program manager 1144.
[0194] In the "check" step, the program manager 1144 Fig.13In steps T2 and R2, it is determined whether the reception of the sequence program 271 transmitted from the support device 200 is completed. That is, due to various factors such as the variable size of the edited sequence program 271, the time consumed for the transmission is deviated. In order to maintain the execution cycle of the task according to the sequence program 271 in the PLC 100 even if there is such a time deviation, the program manager 1144 outputs a timing signal of reception completion to the task scheduler 1142 when the reception of the transmitted sequence program 271 is completed. The task scheduler 1142 receives the timing signal from the program manager 1144, and when the execution cycle arrives, it transfers the transmitted sequence program 271 to a state where it can be executed.
[0195] exist Fig.16 In the above description, the case of transferring the sequence program 271 is described. However, the same is true when the FUN / FB definition 276 of the library 275 is edited online in the support device 200 and then transferred to the PLC 100. Fig.16 Likewise, the program manager 1144 detects that the reception is complete and outputs a timing signal. The task scheduler 1142 receives the timing signal from the program manager 1144 and, when the execution cycle arrives, transitions to a state in which the transferred FUN / FB definition 276 can be called.
[0196] <K. Procedure>
[0197] A support program for providing a development support environment for executing the processes of the flowcharts described in this embodiment is stored in the storage unit 201 of the support device 200. The CPU 202 reads the support programs 700 and 710 from the storage unit 201 and executes them, thereby realizing each part described in this embodiment.
[0198] The support programs 700 and 710 may also be recorded in a computer-readable recording medium such as a floppy disk, a CD-ROM (Compact Disk-Read Only Memory), a ROM, a RAM, or a recording medium 250 attached to the support device 200, and provided as a program product. The recording medium 250 is a medium that stores information such as a program by electrical, magnetic, optical, mechanical, or chemical action in a manner that enables a computer or other device or machine to read the recorded information such as a program.
[0199] The support programs 700 and 710 can also be provided by recording them in a recording medium such as the HDD 208 built into the support device 200. The programs can also be provided by downloading them from a network (not shown) via a communication interface.
[0200] <L. Advantages>
[0201] Fig.17 , Fig.18 as well as Fig.19 This is a diagram for explaining the advantages achieved by the development support environment according to the embodiment of the present invention. Figure 17 to Figure 19 is an example of a sequence program 271 that outputs the same execution result when executed. Figure 17 to Figure 19 In FIG. 1 , the power flow display output as the execution result is indicated by a thick line.
[0202] Specifically, in Fig.17 In the example, since the sequence logic is described in command 0 and command 1, it is easy to understand the power flow, but in terms of program development efficiency, there is a desire to componentize such a same sequence logic. Fig.18 In order to meet this requirement, in command 0 and command 1, the FUN / FB definition 276 (component) that defines the sequence logic is replaced with a call command that calls and executes from the library 275. Fig.18 By editing the FUN / FB definition 276 (component) of the library 275, the edited contents can be simultaneously reflected in the FUN / FB definition 276 (component) called by the instruction 0 and the instruction 1 of the sequence program 271.
[0203] However, for Fig.18 Although the common call command is displayed as a component image without recording the internal sequence logic, there is a desire to confirm the power line representing the execution result of the sequence logic in the component. In addition, there is a desire not to change the sequence logic of command 1 even if the sequence logic of command 0 is changed. Fig.19 The sequence program 271 can be created using the development support environment of this embodiment that meets both requirements.
[0204] exist Fig.19 In the example, command 0 and command 1 represent call commands for calling the same FUN / FB definition 276, but in the call command portion, the sequence logic 2761 of the FUN / FB definition 276 is inline expanded. The online monitoring module 238 implements a power line display indicating the execution result of the inline expanded sequence logic. In addition, as described in (i1-1. Specific example of partial editing), even if the inline expanded sequence logic of command 0 is edited by the online editor 232, the sequence logic of command 1 can be kept unchanged by the edited content.
[0205] <M. Modification>
[0206] Modifications of the embodiment of the present invention will be described.
[0207] In this embodiment, the support device 200 compares the asynchronous sequence logic inline-expanded in the sequence program 271 as a source program with the definition content (sequence logic 2761, etc.) of the corresponding FUN / FB definition 276 of the library 275, and outputs information indicating the difference.
[0208] In addition, in the present embodiment, when the sequence logic expanded inline is changed by editing, the changed sequence logic is added to the sequence program 271 as a complete local logic independent of the corresponding FUN / FB definition 276 of the library 275. At this time, the support device 200 merges the local variables of the corresponding FUN / FB definition 276 into the variable table of the call instruction code portion of the FUN / FB definition 276.
[0209] The development support environment of this embodiment may include the monitor 224, but the monitor 224 is not an essential component. That is, the development support environment may include at least the editor 222 (more specifically, the local editor 233).
[0210] In the local editor 233, the components (FUN / FB definitions 276) that are inline expanded in the sequence program 271 are processed as objects. On the other hand, if the number of components expanded inline increases, the number of variables described in the sequence program 271 increases, and with such an increase in variables, the amount of memory used increases. In order to cope with such an increase in memory usage, the variable name is not described as (instance name.local variable name in FUN / FB definition), but is shortened to (local variable name in FUN / FB definition), thereby reducing the amount of memory used with the increase in variables. In addition, the builder 223 does not use inline expansion in synchronization, and only performs inline expansion and construction processing when local changes are made by the local editor 233, thereby reducing the number of steps in the sequence program 271 that is the object of construction processing.
[0211] <N. Notes>
[0212] The present embodiment described above includes the following technical ideas.
[0213] [Structure 1]
[0214] A support device (200) assists in developing a sequence program (271) executed by a control device (100) for controlling a control object, wherein:
[0215] The sequence program includes a call command for a unit program (276) constituting the sequence program.
[0216] The supporting device comprises:
[0217] an operation accepting unit (221) for accepting an operation on the supporting device;
[0218] A monitor unit (224) which, when displaying the sequence program, expands the call command of the unit program and displays the circuit represented by the sequence logic defined by the unit program;
[0219] an editor unit (222) for changing the sequence logic to a sequence logic representing a circuit after the change in accordance with the operation of changing the displayed circuit; and
[0220] A code conversion unit (223) converts the sequence program into executable code.
[0221] The code conversion unit performs the conversion by assigning one of the code of the sequence logic after the change and the code of the call command to the call command in the sequence program according to the switching option.
[0222] [Structure 2]
[0223] In the supporting device described in structure 1,
[0224] The support device further comprises a setting unit (2311), wherein the setting unit (2311) sets the switching option in the calling command of the sequence program according to a setting operation.
[0225] When the monitor unit displays the sequence program, if the switch option is set in the call-up command, the monitor unit expands and displays the call-up command as the circuit.
[0226] [Structure 3]
[0227] In the supporting device described in structure 1 or 2,
[0228] The control device has a library (275) storing the code of the sequence logic of the unit program in a callable manner.
[0229] The code of the sequence logic stored in the library is changed using the changed code of the sequence logic.
[0230] [Structure 4]
[0231] In the supporting device described in any one of Structures 1 to 3,
[0232] The control device has a library (275) storing the code of the sequence logic of the unit program in a callable manner.
[0233] The sequence program includes more than one calling command.
[0234] According to the selection operation, a call-up command having the changed sequence logic used in the change of the code of the sequence logic of the library is selected from the one or more call-up commands.
[0235] [Structure 5]
[0236] In the supporting device described in Structure 4,
[0237] A list of call-up commands among the one or more call-up commands, in which the sequence logic has been changed by the editor unit, is displayed.
[0238] [Structure 6]
[0239] In the supporting device described in any one of Structures 1 to 5,
[0240] The monitoring unit obtains a circuit output state (156; 1166) representing an execution state of the sequence logic defined by the unit program from the control device, and visualizes the execution state of the sequence logic in the control device in the expanded circuit based on the circuit represented by the sequence logic defined by the unit program and the obtained circuit output state.
[0241] [Structure 7]
[0242] A support program (710) for assisting in developing a sequence program (271) executed by a control device (100) for controlling a control object, wherein:
[0243] The sequence program includes a call command for a unit program (276) constituting the sequence program.
[0244] The support program has the following steps in the computer (200):
[0245] accepting operations on the computer;
[0246] When displaying the sequence program, the calling command of the unit program is expanded and displayed as a circuit represented by the sequence logic defined by the unit program;
[0247] According to the operation of the circuit shown in the change, changing the sequential logic to a sequential logic representing the circuit after the change; and
[0248] converting the sequence program into executable code,
[0249] The step of converting into the executable code includes the step of allocating one of the changed sequence logic code and the call command code to the call command in the sequence program according to the switching option to implement the conversion.
[0250] The embodiments disclosed this time should be considered as illustrative in all aspects and not restrictive. The scope of the present invention is indicated by the claims rather than the above description, and is intended to include all modifications within the meaning and scope equivalent to the claims.
[0251] Description of symbols
[0252] 100: PLC; 112A, 271: sequence program; 130: ladder diagram section; 150: global variable table; 154: local code; 156: circuit output status; 279: sequence circuit information; 200: support device; 221: operation acceptance unit; 222: editor; 223: builder; 224: monitor; 277: option; 232: online editor; 233: local editor; 234: definition editor; 238: online monitoring module; 272: intermediate code; 273: local flag table; 274: definition flag table; 275: library; 276: FUN / FB definition; 278: call command; 280: definition circuit information; 1142: task scheduler; 1144: program manager; 1165: option table; 2761: sequence logic.
Claims
1. A support device for assisting development of a sequence program executed by a control device for controlling a control object, wherein: The sequence program includes a call command for a unit program constituting the sequence program. The supporting device comprises: an operation accepting unit that accepts an operation on the supporting device; a monitor section which, when displaying the sequence program, expands the call command of the unit program and displays the circuit represented by the sequence logic defined by the unit program; an editor section that changes the sequence logic to a sequence logic representing a circuit after the change in accordance with an operation of changing the displayed circuit; as well as a code conversion unit that converts the sequence program into executable code, The control device has a library storing the code of the sequence logic of the unit program in a callable manner, The code conversion unit scans the sequence program, and when a call command is detected by scanning, (i) when the detected call command has a switch option set, (i-1) when the definition asynchronous flag of the unit program of the library corresponding to the call command is "0", the code conversion unit assigns the code of the sequence logic changed by the editor unit to the call command, and (i-2) when the definition asynchronous flag of the unit program of the library corresponding to the call command is "1", the code conversion unit assigns a predetermined call command code to the call command, wherein the call command code is used to call the code of the sequence logic defined by the unit program from the library, (ii) when the switch option is not set in the detected call command, the code conversion unit assigns a predetermined call command code to the call command, wherein the call command code is used to call a code of a sequence logic defined by a unit program from the library, The code conversion unit determines whether the scan is completed. If it is determined that the scan is completed, the code conversion unit converts the sequence program assigned with the call command code into an executable code. The support device determines, based on the operation received from the operation receiving unit, whether to use the code of the sequence logic after the change performed by the editor unit to change the code of the sequence logic stored in the library. Based on the determination, when the code of the sequence logic stored in the library is changed by using the code of the sequence logic after the change, the asynchronous flag corresponding to the part of the call command that has been changed is changed from "1" to "0", and the asynchronous flag is not changed when the change is not performed.
2. The support device according to claim 1, wherein: The support device includes a setting unit, which sets the switching option in the calling command of the sequence program according to a setting operation. When the monitor unit displays the sequence program, if the switch option is set in the call-up command, the monitor unit expands and displays the call-up command as the circuit.
3. The support device according to claim 1 or 2, wherein: The sequence program includes more than one calling command. According to the selection operation, a call-up command having the changed sequence logic used in the change of the code of the sequence logic of the library is selected from the one or more call-up commands.
4. The support device according to claim 3, wherein: A list of call-up commands among the one or more call-up commands, in which the sequence logic has been changed by the editor unit, is displayed.
5. The support device according to claim 1 or 2, wherein: The monitoring unit obtains a circuit output state representing an execution state of the sequence logic defined by the unit program from the control device, and visualizes the execution state of the sequence logic in the control device in the expanded circuit based on the circuit represented by the sequence logic defined by the unit program and the obtained circuit output state.
6. A recording medium having a support program recorded thereon, the support program being used to assist in developing a sequence program executed by a control device for controlling a control object, wherein: The sequence program includes a call command for a unit program constituting the sequence program. The control device has a library storing the code of the sequence logic of the unit program in a callable manner, The support program has the following steps in the computer: accepting operations on the computer; When displaying the sequence program, the calling command of the unit program is expanded and displayed as a circuit represented by the sequence logic defined by the unit program; According to the operation of the circuit shown in the change, changing the sequential logic to a sequential logic representing the circuit after the change; and converting the sequence program into executable code, The step of converting into executable code comprises the following steps: Scanning the sequence program, when a call command is detected by scanning, (i) when the detected call command has a switch option set, (i-1) when the definition asynchronous flag of the unit program of the library corresponding to the call command is "0", a code of the sequence logic after the change is assigned to the call command, and (i-2) when the definition asynchronous flag of the unit program of the library corresponding to the call command is "1", a predetermined call command code is assigned to the call command, wherein the call command code is used to call the code of the sequence logic defined by the unit program from the library, (ii) when the switch option is not set in the detected call command, assigning a predetermined call command code to the call command, wherein the call command code is used to call a code of a sequence logic defined by a unit program from the library, Determine whether the scan has ended. If it is determined that the scan has ended, convert the sequence program assigned with the call command code into an executable code. In the support program, according to the accepted operation, it is determined whether to use the code of the changed sequence logic to change the code of the sequence logic stored in the library. According to the determination, when the code of the changed sequence logic is used to change the code of the sequence logic stored in the library, the asynchronous flag corresponding to the part of the call command that has been changed is changed from "1" to "0", and the asynchronous flag is not changed when the change is not made.
Citation Information
Patent Citations
Monitor method for control program and its device
JP2001005517A
Control device, CPU, user program editing method for programmable controller, and processing method for programmable controller in on-line editing
JP2004295872A
Ladder program editing assistance device and ladder program editing method
CN109690426A
Safety-oriented programmable logic controller with automatic program generation and monitoring
EP2009529A2
multi-mode editor for configuring process control blocks including both logical functions and arithmetic computations
US20090327942A1