WO2022230611A1 - 情報処理装置、方法およびプログラム - Google Patents

情報処理装置、方法およびプログラム Download PDF

Info

Publication number
WO2022230611A1
WO2022230611A1 PCT/JP2022/016759 JP2022016759W WO2022230611A1 WO 2022230611 A1 WO2022230611 A1 WO 2022230611A1 JP 2022016759 W JP2022016759 W JP 2022016759W WO 2022230611 A1 WO2022230611 A1 WO 2022230611A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
unit
control
communication
message
Prior art date
Application number
PCT/JP2022/016759
Other languages
English (en)
French (fr)
Inventor
徳幸 真木
仁太郎 出来
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Publication of WO2022230611A1 publication Critical patent/WO2022230611A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Definitions

  • the present disclosure relates to an information processing device, method and program, and to an information processing device, method and program directed to development of an application program for controlling an object.
  • a PLC Programmable Logic Controller
  • An object of the present disclosure is to provide an efficient development environment for application programs including publish/subscribe type communication programs executed by a control device that controls an object.
  • An information processing device comprising a library storing unit programs constituting an application program executed by a control device that controls an object according to an example of the present disclosure, wherein the control device is network-connected to a server, and unit programs in the library includes a unit program that constitutes a publish/subscribe communication program included in the application program, and the unit program that constitutes the communication program is a publisher unit program that outputs a request to send a publish message of control-related data; A subscriber unit program that outputs a request to send a subscribe message for control-related data, a connection monitoring unit program that outputs a request to send a ping command message that monitors network connections, and a request to send a message from each unit program.
  • the information processing apparatus further includes operation accepting means for accepting a user operation on the information processing apparatus, and based on the user operation accepted by the operation accepting means , means for creating an application program including a call instruction for each unit program constituting the communication program.
  • the communication program of the control device can be provided as a library of unit programs corresponding to each function provided by publish/subscribe communication.
  • the connection monitoring unit program has the function of establishing network connection and communication, thereby making it relatively easy to develop other unit programs.
  • the information processing apparatus further comprises means for setting the priority of executing each unit program of the communication program with priority over other unit programs in the control cycle.
  • At least the client unit program is set higher in priority than the other unit programs.
  • a client unit program that communicates with a server via a network is executed with high priority, so that messages can be transferred to the network within the control cycle.
  • the priority of the connection monitoring unit program indicates that the unit program is executed every N control cycles.
  • connection monitoring unit program is executed not every control cycle but every N control cycles. It can suppress the rise.
  • the client unit program includes instruction code for monitoring network connections.
  • the client unit program can cooperate with the connection monitoring unit program to perform the function of monitoring the network connection.
  • the server includes an MQTT (Message Queuing Telemetry Transport) message delivery server.
  • MQTT Message Queuing Telemetry Transport
  • This disclosure enables publish/subscribe communication using the MQTT protocol.
  • a plurality of the above controllers are networked to a server, and the plurality of controllers are configured to control objects through distributed control. Therefore, the above characteristics can be applied to the communication with the server of each control device that constitutes the target distributed control.
  • connection monitoring unit program measures the time from outputting a request to send a ping command message to receiving a response. Therefore, the connection monitoring unit program can measure the time required from the output of the ping command message transmission request to the reception of the response, and monitor the soundness of the traffic on the network from the required time.
  • a program development support method in an information processing device including a library storing unit programs constituting an application program executed by a control device that controls an object, wherein the control device connects to a server via a network.
  • the unit programs of the connected library include unit programs that constitute a publish/subscribe communication program included in the application program, and the unit programs that constitute the communication program output a request to send a publish message of control-related data.
  • a publisher unit program that outputs a request to send a subscribe message for control-related data
  • a connection monitoring unit program that outputs a request to send a ping command message that monitors network connections; and each unit program.
  • a client unit program that transmits a request to send a message from to a server via a network
  • the program development support method comprises a step of accepting a user operation, and constructing a communication program based on the accepted user operation and creating an application program containing a call instruction for each unit program.
  • the communication program of the control device can be provided as a library of unit programs corresponding to each function provided by publish/subscribe communication.
  • the connection monitoring unit program has the function of establishing network connection and communication, thereby making it relatively easy to develop other unit programs.
  • Another example of this disclosure provides a development support program for causing a processor to execute the program development support method described above.
  • an efficient development environment for application programs including a publish/subscribe type communication program executed by a control device that controls an object.
  • FIG. 1 is a schematic diagram showing a system according to an embodiment; FIG. It is a schematic diagram which shows the hardware constitutions of the processing unit of PLC which concerns on this Embodiment.
  • 1 is a schematic diagram showing an example of a hardware configuration of a support device according to an embodiment;
  • FIG. It is a schematic diagram which shows an example of the software configuration implemented in the processing unit of PLC which concerns on this Embodiment.
  • FIG. 2 is a diagram schematically showing an example of a program development environment in a support device according to the present embodiment;
  • FIG. 4 is a flow chart showing an example of a schematic process of program development according to the present embodiment;
  • FIG. 4 is a diagram showing an example of task control information according to the embodiment;
  • FIG. 1 is a diagram showing a model of Pub/Sub communication according to the present embodiment
  • FIG. FIG. 3 is a diagram showing an example of a Pub/Sub communication model configured in the PLC according to the present embodiment
  • FIG. 2 is a diagram showing the basic configuration of a message packet according to the present embodiment
  • FIG. 4 is a diagram showing the configuration of a published packet according to the embodiment
  • FIG. FIG. 4 is a diagram showing the structure of a subscribed packet according to the present embodiment
  • FIG. FIG. 4 is a diagram showing the structure of a message packet of a PING command according to this embodiment
  • 1 shows an example of a Client-FB according to this embodiment.
  • FIG. 15 is a timing chart of Client-FB in FIG. 14
  • FIG. 15 is a timing chart of Client-FB in FIG.
  • FIG. 14; 1 shows an example of a Sub-FB according to this embodiment.
  • FIG. 18 is a timing chart of CSub-FB in FIG. 17; 1 shows an example of Pub-FB according to the present embodiment.
  • FIG. 20 is a timing chart of Pub-FB in FIG. 19;
  • FIG. 1 shows an example of Ping-FB according to the present embodiment.
  • FIG. 22 is a timing chart of Ping-FB in FIG. 21;
  • FIG. 22 is a timing chart of Ping-FB in FIG. 21;
  • FIG. 2 is a diagram schematically showing an excerpt from a communication program in an application program according to the embodiment;
  • FIG. FIG. 2 is a diagram schematically showing an excerpt from a communication program in an application program according to the embodiment;
  • FIG. FIG. 4 is a diagram schematically showing a task execution cycle in the PLC according to the embodiment;
  • FIG. 5 is a diagram schematically showing an example of a program development environment in support device 200 according to the present embodiment.
  • the support device 200 provides an environment for supporting development of application programs.
  • the application program constitutes a user program including a control program for the PLC.
  • Application programs to be developed may include, for example, programs conforming to the international standard IEC61131-3. In the international standard IEC61131-3, as programming languages for PLC applications including control programs, ladder diagrams (LD), function block diagrams (FBD), sequential function charts (SFC) , Instruction List (IL), and Structured Text (ST).
  • LD ladder diagrams
  • BBD function block diagrams
  • SFC sequential function charts
  • IL Instruction List
  • ST Structured Text
  • the application program according to the present embodiment includes a ladder diagram program, but may be a program written in any programming language.
  • a program written in a ladder diagram will be described below as a typical example.
  • the support device 200 includes, for example, a notebook or desktop PC (Personal Computer), tablet terminal, smart phone, or other information processing device.
  • a notebook or desktop PC Personal Computer
  • tablet terminal tablet terminal
  • smart phone smart phone
  • a PLC application program includes a control program that controls an object and a communication program that allows the PLC to communicate with other devices including other PLCs.
  • the PLC communicates with other devices according to a publish/subscribe type communication scheme.
  • MQTT Message Queuing Telemetry Transport
  • Pub/Sub communication publish/subscribe type communication is abbreviated as Pub/Sub communication.
  • a development support program 250 is installed in the support device 200 .
  • the development support program 250 is an application for supporting development of control programs for PLC.
  • a user can design an application program for the PLC and install the designed application program in the PLC by operating various tools provided by the development support program 250 .
  • the application program includes a cyclic execution type control program.
  • the periodic execution type refers to an execution form in which the control program is repeatedly executed from the first line to the last line at predetermined intervals. That is, in the periodic execution type control program, the execution period of the program is guaranteed.
  • Cyclic execution type programming languages typically include ladder diagrams, structured text languages, and the like.
  • the development support program 250 generates application programs while manipulating various data in the data storage unit 270, which is composed of RAM (Random Access Memory), HDD (Hard Disc Drive), and the like.
  • the data storage unit 270 includes a library 245 that forms an area in which FBs (Function Blocks) and FUNs (Functions), which are examples of unit programs that form an application program, are stored.
  • Library 245 includes MQTT library 26 that stores FBs for realizing Pub/Sub communication according to the MQTT communication protocol.
  • the MQTT library 26 includes Client-FB31, Sub-FB32, Pub-FB33, and Ping-FB34 in association with various functions provided by Pub/Sub communication.
  • the Client-FB 31 has a client instruction code responsible for establishing a network connection between the PLC and another device (another PLC) that exchanges control-related data.
  • the Sub-FB 32 has a publisher instruction code that functions to output to the client a request to send a publish message of control-related data to the network.
  • Pub-FB 33 has a subscriber instruction code that functions to output to the client a request to send a subscribe message of control-related data to the network.
  • the Ping-FB 34 has an instruction code for a connection monitoring unit responsible for outputting to the client a request to send a ping (PING) command message for monitoring the network connection status to the network.
  • PING ping
  • the development support program 250 has an editor 252 that edits a source program 271 written in source code 272 according to user operations on the support device 200, and a compiler 212 that compiles the source program 271 and converts it into an executable program 273.
  • the development support program 250 further includes a debugger 213 for debugging the program, a simulator 214 for verifying the operation of the program, a builder 215, and a GUI tool 216 for providing a GUI (Graphical User Interface) environment for program development.
  • GUI Graphic User Interface
  • the editor 252 includes a code editor 254 for editing the code of the application program, a variable editor 253 for editing variables used in the program and generating variable data 274, and a task setting editor 255.
  • the task setting editor 255 is a task that, when the source program 271 is executed in the PLC, indicates the degree to which the task is executed with priority over other tasks for each of one or more tasks configured by the program.
  • Control information 275 is set based on user operations.
  • the task control information 275 includes priority 133 for each task, as will be described later.
  • the code editor 254 edits the code of the source program 271, which is an application program, and writes a call instruction code for calling the FB of the library 245 in the source program 271 according to user's operation.
  • the compiler 212 compiles the source code 272 of the edited source program 271 to generate an executable program 273 .
  • the builder 215 links the executable program 273 with the FB in the library 245 called by the source program 271 of the library 245 to generate the executable application program 170, and the transfer module 211 transfers the PLC 100 transfer (install) to
  • the PLC executes the installed executable application program 170 .
  • the control program and communication program 171 (Client-FB31, Sub-FB32, Pub-FB33, and Ping-FB34) are executed.
  • the PLC can exchange data with other devices (other PLCs) by performing Pub/Sub communication according to the MQTT protocol during periodic execution of the control program.
  • the support device 200 converts the PLC communication program 171 into unit programs (Client-FB31, Sub-FB32, Pub-FB33, and Ping-FB 34) is provided as MQTT library 26. Also, by assigning only the Client-FB 31 of these four FBs the function of establishing network connection and communication, it becomes relatively easy to develop other FBs.
  • FIG. 1 is a schematic diagram showing a system 1 according to this embodiment.
  • a system 1 according to this embodiment includes a plurality of PLCs (PLC1, PLC2, PLC3) network-connected via a network 410 .
  • Multiple PLCs communicate with server 300 via network 400 .
  • Server 300 includes cloud-based external servers or on-premise servers.
  • the system 1 has three PLCs, but the number of PLCs is not limited to three as long as the number of PLCs is plural.
  • Each PLC of the system 1 corresponds to an industrial controller that controls arbitrary controlled objects (for example, objects such as FA manufacturing equipment and facilities).
  • One or more field devices are connected to the PLC.
  • Each of the one or more field devices exchanges information between an actuator 7 that exerts some physical action on a production line including a production process (hereinafter also collectively referred to as "field") and the field.
  • It includes an input/output device 6 including a sensor for
  • the system 1 in FIG. 1 includes, for example, multiple types of processes (eg, screw tightening process, soldering process, assembly process, etc.), and a PLC is provided for each of these processes.
  • the work flowing through the production line is manufactured by flowing through the processes in this order. In the process, a plurality of types of work are performed on the work by field devices.
  • the types and number of processes provided by the system 1 are not limited to these, and may vary according to the type of product to be produced or the specifications of the product.
  • the system 1 thus constitutes a distributed control system in which a PLC is provided for each process.
  • the PLCs in each process are connected to networks 400 and 4102 to exchange control-related data with other PLCs.
  • Each PLC includes a processing unit 10 that executes programs, a power supply unit 12 that supplies power to the processing unit 10 and the like, and an IO (Input/Output) unit 14 that exchanges signals from the field.
  • the IO unit 14 is connected to the processing unit 10 via the system bus 11 .
  • the IO unit 14 acquires an input signal from the input/output device 6, which is a field device, and drives the actuator 7, which is a field device, according to the execution result of the program in the processing unit 10.
  • the input/output device 6 detects, for example, the control amount of the actuator.
  • the input/output device 6 and the actuator 7 constitute a "target" device controlled by the PLC.
  • the support device 200 provides an environment for developing application programs to be executed by the PLC, and has a function of monitoring the operating state of the connected PLC and various data values.
  • FIG. 2 is a schematic diagram showing the hardware configuration of the processing unit 10 of the PLC according to this embodiment.
  • processing unit 10 includes processor 100, chipset 102, main memory 104, nonvolatile memory 106, system timer 108, system bus controller 120, network controller 149, and USB connector. 110.
  • Chipset 102 and other components are each coupled via various buses.
  • the processor 100 and chipset 102 are typically configured according to general computer architecture. That is, the processor 100 interprets and executes instruction codes sequentially supplied from the chipset 102 according to the internal clock. The chipset 102 exchanges internal data with various connected components and generates instruction codes necessary for the processor 100 . Furthermore, the chipset 102 has a function of caching data obtained as a result of arithmetic processing executed by the processor 100 .
  • the processing unit 10 has a main memory 104 and a nonvolatile memory 106 as memories.
  • the main memory 104 is a volatile storage area and stores various programs to be executed by the processor 100 after the processing unit 10 is powered on.
  • the main memory 104 is also used as a work memory when various programs are executed by the processor 100 .
  • main memory 104 devices such as DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory) are used.
  • the nonvolatile memory 106 nonvolatilely stores a real-time OS (Operating System), system programs, application programs installed from the support device 200, and various types of information.
  • OS Operating System
  • the processing unit 10 has a system bus controller 120 and a network controller 149 as communication interfaces. These communication interfaces transmit output data and receive input data.
  • the system bus controller 120 controls data exchange via the system bus 11 . More specifically, the system bus controller 120 includes a DMA (Dynamic Memory Access) control circuit 122 , a system bus control circuit 124 and a buffer memory 126 . System bus controller 120 is internally connected to system bus 11 via system bus connector 130 .
  • DMA Dynamic Memory Access
  • the network controller 149 includes a DMA (Dynamic Memory Access) control circuit 148, a network control circuit 147, and a buffer memory 146 to control data exchange with other PLCs via the network 410.
  • DMA Dynamic Memory Access
  • the network control circuit 147 performs processing for transmitting output data of the buffer memory 146 and processing for receiving and storing input data in the buffer memory 146 with other PLCs connected to the network 410 .
  • the USB connector 110 is a communication interface for connecting the support device 200 and the processing unit 10.
  • a program or the like that is executable by the processor 100 of the processing unit 10 and transferred from the support device 200 is loaded into the PLC via the USB connector 110 .
  • FIG. 3 is a schematic diagram showing an example of the hardware configuration of the support device 200 according to this embodiment.
  • support device 200 is typically composed of a general-purpose computer. From the standpoint of maintainability, a notebook personal computer with excellent portability may be used.
  • support device 200 includes CPU 201 that executes various programs including an OS, ROM (Read Only Memory) 202 that stores BIOS and various data, and data necessary for CPU 201 to execute programs. It includes a memory RAM 203 that provides a work area for storing, and a hard disk (HDD) 204 that stores programs executed by the CPU 201 in a non-volatile manner.
  • OS operating system
  • ROM Read Only Memory
  • HDD hard disk
  • the HDD 204 constitutes a data storage unit 270.
  • the HDD 204 stores a development support program 250 and a developed source program 271 .
  • the HDD 204 also stores a library 245 including the MQTT library 26 .
  • the support device 200 further includes a keyboard 205 and a mouse 206 corresponding to operation units for receiving operations from the user, and a monitor 207 for displaying information to the user.
  • the support device 200 includes a communication interface (IF) 209 for communicating with a PLC (processing unit 10) or the like.
  • IF communication interface
  • CD-ROM 301 Various programs executed by the support device 200 are stored in the CD-ROM 301 and distributed.
  • a program stored in this CD-ROM 301 is read by a CD-ROM (Compact Disk-Read Only Memory) drive 208 and stored in a hard disk (HDD) 204 or the like.
  • the program may be configured to be downloaded via the network 400 or 410 from a higher host computer or the like.
  • FIG. 4 is a schematic diagram showing an example of the software configuration implemented in the processing unit 10 of the PLC according to this embodiment. Instruction codes included in the software shown in FIG. 4 are read at appropriate timing, provided to processor 100 of processing unit 10, and executed.
  • a program necessary for PLC processing is installed on the real-time OS 190.
  • the real-time OS 190 is designed according to the computer architecture of the processing unit 10, and provides a basic execution environment for the processor 100 to execute programs necessary for processing in the PLC. More specifically, the real-time OS 190 cooperates with the scheduler 160 to implement the multitask execution unit 191 .
  • the multitask execution unit 191 provides an environment for switching and executing tasks realized by a plurality of programs as time elapses.
  • the scheduler 160 switches tasks to be assigned to the processor 100 according to the task priority or period indicated by the task control information 275 . Thereby, the processor 100 executes the task according to the task priority or period indicated by the task control information 275 .
  • the processing unit 10 includes a scheduler 160, an application program 170, an input processing module 172, an output processing module 174, a communication processing module 176, other system modules 178, and an instruction execution module 180. and a memory manager 184 are implemented.
  • Memory manager 184 manages data stored in main memory 104 . More specifically, it manages reading and writing by the application program 170 of variable data 274 that defines various variables used by the application program 170 .
  • the scheduler 160 controls execution start timing and processing interruption according to the task control information 275 for the application program 170, the input processing module 172, the output processing module 174, and the communication processing module 176 in relation to multitask control.
  • the application program 170 is created by the user according to the control purpose. That is, it is a program arbitrarily designed according to the line (process) to be controlled using the system 1 .
  • the application program 170 corresponds to an executable program module generated by the support device 200 and includes a communication program 171 .
  • the application program 170 may include control programs such as sequence processing and motion calculation.
  • the application program 170 is executed by the instruction execution module 180 to realize Pub/Sub communication according to various control processes and the MQTT protocol.
  • the input processing module 172 rearranges input data received by the system bus controller 120 into a form suitable for use by the application program 170 .
  • Output processing module 174 rearranges output data generated by execution of application program 170 into a form suitable for transfer to system bus controller 120 .
  • the communication processing module 176 controls communication processing with other PLCs by the network controller 149 or communication with the support device 200 . Communication processing with other PLCs is realized in cooperation with execution of the communication program 171 .
  • the other system module 178 collectively shows one or more modules for realizing various functions of the PLC 1 other than the programs individually shown in FIG.
  • FIG. 6 is a flow chart showing an example of a schematic process of program development according to the present embodiment.
  • editor 252 edits source program 271 in accordance with the content of a user's operation received via keyboard 205 or mouse 206. Edit (edit) (step S1).
  • the editor 252 writes an instruction code for calling each FB for Pub/Sub communication of the communication program 171 in the source program 271 based on the user's operation. More specifically, an instruction code for calling Client-FB31, Sub-FB32, Pub-FB33, and Ping-FB34 is described (steps S12, S13, S14, S15).
  • pub/sub communication connections are set for the number of other PLCs with which the PLC communicates. In the system 1 of FIG. 1, two connections are set up for each PLC.
  • the user identifies the number of connections from the configuration information of the system 1 (step S11), increments the variable N by 1 by the number of acquired connections (NO in step S16, step S17), and then steps S12. to repeat the processing of step S15.
  • steps S12 to S15 is completed for all connections (YES in step S16)
  • the editing processing of the source program 271 is completed and the source program 271 is stored (step S18).
  • the compiler 212 compiles the source program 271 (more specifically, the source code 272) to generate an executable program 273 (step S2).
  • the builder 215 builds the executable program 273 and the FB of the library 245 to generate the executable application program 170 (step S3).
  • the task control information 275 is also created (step S4), and the transfer module 211 transfers the executable application program 170 and the task control information 275 to the PLC (step S5).
  • the application program development environment is configured in the support device 200, which is an independent device from the PLC, but the application program development environment may be implemented in the PLC.
  • the PLC is equipped with a real-time OS for executing control programs and a general-purpose OS for application program development environment, and configures an application program development environment under the general-purpose OS.
  • a "task” is a unit of processing executed by the processor 100, and a task includes one or more programs.
  • the "real-timeness" of a task indicates that the execution of the task will be completed within a predetermined period of time after the start of execution of the task.
  • a “control task” is a task for real-time control of an object to be controlled among field devices.
  • a “non-control task” is a task that does not directly participate in real-time control, unlike a "control task”, but is a task that requires real-time control, and is a task for performing processing related to the above-mentioned real-time control. .
  • a task's "priority” indicates the relative order in which that task is executed by the processor before other tasks. If the priority is high, the execution order is first, and if the priority is low, the execution order is later.
  • a PLC realizes real-time control of equipment by executing control tasks such as control programs that control the equipment provided at the production site at predetermined intervals.
  • control tasks such as control programs that control the equipment provided at the production site at predetermined intervals.
  • the predetermined cycle is called "control cycle”.
  • control devices such as PLCs are required to execute non-control tasks that are not directly involved in the control of the equipment while maintaining the above-mentioned real-time control (fixed periodicity).
  • control devices such as PLCs are required to execute non-control tasks that are not directly involved in the control of the equipment while maintaining the above-mentioned real-time control (fixed periodicity).
  • tasks of Client-FB31, Sub-FB32, Pub-FB33 and Ping-FB34 which are tasks of the communication program 171, are included as such additional function tasks.
  • FIG. 7 is a diagram showing an example of the task control information 275 according to this embodiment. Referring to FIG. 7, the user sets task priority in task control information 275 when developing a PLC application program.
  • task control information 275 includes task name 132 and priority information (priority 133 and execution condition 134) corresponding to each task.
  • the task name 132 is the task name of the control program and the name of the unit program, that is, the FB that constitutes the communication program 171, and corresponds to each of Client-FB31, Sub-FB32, Pub-FB33 and Ping-FB34. , Client, Sub, Pub and Ping.
  • the control task has the highest priority and is set to "1".
  • the priority of Clent is set to be the highest, and the priorities 133 of the tasks of Client, Sub, and Pub are set to, for example, "2", “4", and “6", and the task of Ping is set to The priority 133 is lower than those, and is set to "15", for example.
  • Client and Sub are set as "resident type" which is unconditionally executed in each control cycle, and Ping is executed when a predetermined condition is satisfied. It is a "start-up type” that can be executed once every N (where N ⁇ 1) control cycles, for example.
  • Task Pub is started in each control cycle, but is configured to execute the subscribing process only when a predetermined publish condition is satisfied when executed. is indicated as "resident/startup type".
  • Clent is set to have the highest priority among the tasks of the communication program 171, but the setting method is not limited to this. may be set.
  • the priority 133 and execution conditions can be individually set for each of the four tasks that constitute the functions of Pub/Sub communication that are not directly related to device control, so Pub/Sub communication is added. Even if it is done, it is easy to maintain the constant periodicity of the control described above.
  • the scheduler 160 When executing the application program 170 , the scheduler 160 controls the execution cycle of each task of Client, Sub, Pub and Ping of the communication program 171 according to the task control information 275 .
  • FIG. 8 is a diagram showing a model of Pub/Sub communication according to this embodiment.
  • a Pub/Sub communication model for the connection between PLC1 and PLC2 will be described with reference to FIG.
  • Data published by the publisher PLC1 is provided to the subscriber PLC2 via the server 300 responsible for message delivery as an MQTT broker.
  • the publisher sends data to the topic of server 300 as the destination.
  • Publishers define topics as destinations in the form of messages with control-related data and send them to server 300 .
  • a subscriber applies to the server 300 for distribution of information on a topic, and receives from the server 300 the distribution of messages registered in the topic for which the distribution has been applied. Subscribers may, for example, execute application programs 170, including control programs, using control-related data sent from publishers.
  • the server 300 mediates the exchange of data between publishers and subscribers.
  • a subscriber registers with the server 300 to request topic data.
  • Publishers also send messages to server 300 that include topics and data.
  • the server 300 manages topics for which subscribers have applied for delivery. For example, upon receiving a message containing a topic and data from a publisher, the server 300 stores the topic message and delivers the topic data to subscribers requesting it.
  • FIG. 8 The description of FIG. 8 can also be applied to the case where data published by PLC2 is provided to PLC1, which is a subscriber, via server 300.
  • FIG. 8 The description of FIG. 8 can also be applied to the case where data published by PLC2 is provided to PLC1, which is a subscriber, via server 300.
  • FIG. 9 is a diagram showing an example of a Pub/Sub communication model configured in the PLC according to this embodiment. In the figure, exchange of data between Client-FB31, Sub-FB32, Pub-FB33 and Ping-FB34 is shown.
  • Client-FB31 retains transmitted data and client status, and also accepts data transmission requests SR1, SR2 and SR3 from Sub-FB32, Ping-FB34 and Pub-FB33.
  • Sub-FB32, Ping-FB34 and Pub-FB33 obtain received data RD1, RD2 and RD3 and client states SD1, SD2 and SD3 from Client-FB31 in response to data transmission requests SR1, SR2 and SR3.
  • Client-FB31 among Sub-FB32, Ping-FB34 and Pub-FB33, sets data transmission request SR0, reception data RD and client state SD as variables set in common among FBs, such as structure variables exchange through
  • the Client-FB 31 implements secure socket communication with the server 300, for example. It manages the IP address and port number of the Client-FB31 server 300 (see FIG. 8). Therefore, Sub-FB32, Pub-FB33, and Ping-FB34 can publish data, subscribe to data, and transmit PING commands by data transmission request SR without identification information of server 300 serving as a broker. can be done.
  • the basic structure 70 of a packet of a message includes a fixed header 71, a variable header 72 and a payload 73.
  • the fixed header 71 contains information about the packet type and packet length
  • the variable header 72 contains the packet ID
  • the payload 73 contains the message such as the data to be communicated.
  • a published packet 70A includes a topic name in a variable header 72 and a message such as data to be published in a payload 73.
  • subscribed packet 70B includes a packet ID in variable header 72 and a topic filter indicated by a topic name in payload 73 .
  • a PING command message packet (hereinafter also referred to as a PING packet) includes the PING command packet type in a fixed header 71 .
  • the Client-FB 31 controls connection with the server 300 , and transmits messages generated by the Sub-FB 32 , Pub-FB 33 and Ping-FB 34 to the server 300 and receives messages from the server 300 .
  • FIG. 14 shows an example of the Client-FB 31 according to this embodiment.
  • 15 and 16 are timing charts of Client-FB 31 in FIG.
  • the Client-FB 31 has, as input variables, an execution trigger input variable Enable, a connection setting variable Settings, a keep alive timer variable KeepAlive, and a timeout variable Timeout. Also, as output variables, it has a variable Connected indicating that the MQTT is connected to the server 300, a variable Busy indicating that it is being executed, a variable Error indicating an error, an error code variable ErrorID, and an extended error code variable ErrorIDEx.
  • the scheduler 160 sets the input of the variable Enable to High (rising) every control cycle so that the Client-FB 31 is executed in a resident mode.
  • the Client-FB 31 differentiates the "Enable” (execution) signal while “Busy” (execution) is FALSE, and when detecting a rising edge, "Busy” (execution) is set to TRUE. set to After that, when the connection with the server 300 is established, the Client-FB 31 sets “Connected” (connected to the server) to TRUE, and continues to set “Busy” (executing) to TRUE even after the connection with the server 300 is established. .
  • Client-FB 31 monitors the health of the network connection with server 300 . More specifically, when the value of the variable “Enable” rises from FALSE to TRUE, the Client-FB 31 issues a connection request to the server 300 according to the settings specified in the variable “Settings”.
  • Client-FB 31 After Client-FB 31 establishes a connection with Server 300 by means of a connection request, it sends messages generated by Sub-FB 32, Pub-FB 33 and Ping-FB 34 and receives messages from Server 300.
  • Client-FB31 contains command codes for monitoring network connections. That is, the Client-FB 31 monitors the connection while establishing the connection with the server 300 . More specifically, a keep-alive is performed to confirm whether or not the server 300 is connected.
  • Client-FB31 When Client-FB31 detects that there is no message transmission from the client within the time specified by the variable KeepAlive while connecting to server 300, Client-FB31 itself transmits a PING packet. After the PING packet is sent, the elapsed time is measured until the PINGRESP packet containing the response is received, and if the PINGRESP packet cannot be received even if the measured elapsed time exceeds the predetermined time, The connection with the server 300 is cut. When the variable KeepAlive is set to 0, the Client-FB 31 does not send PING packets.
  • FIG. 17 shows an example of the Sub-FB 32 according to this embodiment.
  • FIG. 18 is a timing chart of CSub-FB 32 in FIG.
  • the Sub-FB 32 subscribes to (receives) the specified topic and reads the message part from the received publish message of the specified topic.
  • Sub-FB 32 includes, as input variables, an execution trigger input variable Enable, a variable Topic specifying a topic for which a subscription is requested, and a variable Message of the message part of a published message of the specified topic. Also, as output variables, a flag variable Subscribed indicating whether subscribing is in progress, a variable Status indicating numerically the execution status of the Sub-FB 32, a variable Received indicating completion of reception, a variable Error indicating an error occurrence, and an error code. It has a variable ErrorID, a variable ErrorIDEx indicating an extended error code, a variable Message indicating a received message, and a variable Topic indicating a topic to which the received message belongs.
  • Sub-FB 32 in FIG. 17 will be described with reference to the timing chart in FIG.
  • the Sub-FB 32 is activated by the scheduler 160 in accordance with the task control information 275 in each control cycle.
  • Sub-FB 32 differentiates the rise of "Enable”. Detected by processing and set “Status” (execution status) to 1 (requesting subscription). Sub-FB 32 is thereby activated.
  • the Sub-FB 32 sets "Status” (execution state) to 2 (subscribing) and "Subscribed” (subscription request completed) to TRUE.
  • Sub-FB 32 When Sub-FB 32 detects that it has received a publish message belonging to a topic that matches "Topic” with "Status” (execution status) of 2 (subscribing), it sets Received to TRUE.
  • the Sub-FB 32 sets "Status" (execution status) to 0 (execution stopped).
  • the Sub-FB 32 detects that the connection with the server 300 is disconnected, and changes the "Status” (execution status) to 4 ( Waiting for reconnection) and set "Subscribed” (subscription request completed) to FALSE.
  • Sub-FB 32 detects an error in the FB itself during execution, it sets "Error” to TRUE and specifies the error in "ErrorID” (error code) and "ErrorIDEx” (extended error code). set the value to
  • FIG. 19 shows an example of Pub-FB 33 according to this embodiment.
  • FIG. 20 is a timing chart of Pub-FB 33 in FIG. Pub-FB 33 generates a message to be published and transmits it to server 300 via Client-FB 31 .
  • Pub-FB 33 has, as input variables, a variable Execute for receiving an activation trigger, a variable Topic specifying a topic name to be published, a variable Message indicating a message to be published to the specified topic, and a publish It has a setting variable Settings. Also, as output variables, the variable Done that indicates the end of processing execution, the variable Busy that indicates processing is in progress, the variable Message that indicates the message to be published, the variable Error that indicates an error occurrence, the variable ErrorID that indicates the error code, and the extended error It has a variable ErrorIDEx that indicates the code.
  • Pub-FB 33 When the variable "Execute” (activation) is set to True by the output from the control program being executed, that is, when the publishing condition is satisfied, the Pub-FB 33 detects the rise of the variable "Execute” by differential processing or the like. Detect and set "Busy” to TRUE if detected. Pub-FB 33 sets the packet of the publish message specified by the input variable Settings to the output variable Message. As a result, the published message is output to Client-FB31.
  • Pub-FB 33 sets "Done” (completed) to TRUE and "Busy” (executing) to FALSE.
  • the Pub-FB 33 sets "Error” to TRUE and "Busy” (executing) to FALSE. "ErrorID” (error code) and “ErrorIDEx” (extended error code) are set with values corresponding to the error.
  • FIG. 21 shows an example of Ping-FB 34 according to this embodiment.
  • 21 and 23 are timing charts of the Ping-FB 34 of FIG. Ping-FB34 transmits the PING packet of FIG. It has an instruction code that measures the time until a response is returned.
  • the Ping-FB 34 in FIG. 21 has, as input variables, Execute, which accepts the activation trigger, and Timeout, which indicates the threshold time for waiting for a response from the server 300 . Also, as output variables, the variable Done indicates that processing has finished, the variable Busy indicates that processing is in progress, the variable Error indicates that an error has occurred, the variable ErrorID indicates an error code, the variable ErrorIDEx indicates an extended error code, and the PINGREQ message It measures the time from sending a PING packet to receiving a PINGRESP message in response, and has a variable ElapseTime in which the measurement time is set.
  • the PINGRESP message also has the packet structure shown in FIG.
  • Ping-FB 34 sets "Busy” (executing) to TRUE when the variable "Execute” (activation) is set to TRUE while Client-FB 31 is connected to server 300. . That is, in response to the scheduler 160 setting the variable "Execute” to TRUE every N control cycles, the Ping-FB 34 executes the logic in the FB to generate the PINGREQ packet 70C and 70C, and receives a PINGRESP packet as a response to the PINGREQ packet 70C. Further, the Ping-FB 34 executes the logic in the FB to measure the time required from outputting the transmission request of the PINGREQ packet 70C to receiving the PINGRESP packet, and stores the measured required time in the variable ElapseTime. set. When the process is finished, set the variable Done to TRUE.
  • the Ping-FB 34 indicates the required time from outputting the transmission request of the PINGREQ packet 70C to receiving the PINGRESP packet, that is, the measurement time set in the variable ElapseTime by the input variable Timeout.
  • timeout is detected and the variable Error is set to TRUE.
  • the Ping-FB 34 sets timeout information to "ErrorID” (error code) and "ErrorIDEx” (extended error code).
  • the Ping-FB 34 measures the time required from outputting a ping command message transmission request to receiving a response, and monitors the soundness of traffic on the network, etc. from the measured required time. , monitoring results can be output.
  • Example of communication program> 24 and 25 are diagrams schematically showing an excerpt from the communication program 171 in the application program 170 according to this embodiment.
  • 24 and 25 are ladder programs, for example, communication program 171 displayed on monitor 207 by GUI tool 216.
  • FIG. 24 and 25 are ladder programs, for example, communication program 171 displayed on monitor 207 by GUI tool 216.
  • the communication program 171 changes the call instruction 310 of the Client-FB 31, the call instruction 340 of the Ping-FB 34, and the call instruction 330 of the Pub-FB 33 to the program based on the user's operation.
  • an FB corresponding to the call instruction is placed at the position of each call instruction.
  • the Client-FB 31 is connected to a block 311 that sets a value to the input variable Enable
  • the Ping-FB 34 is connected to blocks 311 and 341 that set a value to the input variable Execute
  • the Pub-FB 33 is connected to the input variable Execute. Connected are blocks 311 and 331 which set a value in the variable Execute.
  • the block 331 is turned on by the scheduler 160 every control cycle.
  • the block 331 is set to ON, the variable Enable of the Client-FB 31 that receives the output of the block 331 rises to High, and the Client-FB 31 starts processing accordingly.
  • the block 341 is set on by the scheduler 160 every N control cycles. Therefore, at the timing when the block 331 is set to ON and the block 341 is set to ON, that is, every N control cycles, the trigger of the variable Execute of the Ping-FB 34 which receives the output of the block 341 is set, and the Ping- The FB 34 is activated in response to the input of the trigger and starts processing the Ping command.
  • a block 331 is set on when an output of the control program, for example a request to publish control data, is output. Therefore, when the publish condition is satisfied in this way, the block 331 is turned on, and at the timing when the block 331 is set on, that is, when a publish request is output from the control program in each control cycle, the block 331 is turned on.
  • a trigger for the variable Execute of the Pub-FB 33 that receives the output of 331 is set, and the Pub-FB 33 is activated in response to the input of the trigger to start publishing processing.
  • step S1 of communication program 171 a call instruction 310 for Client-FB 31, a call instruction 340 for Ping-FB 34, and a call instruction 320 for Sub-FB 32 are being programmed based on user operations. , and an FB corresponding to each call instruction is placed at the position of each call instruction.
  • the Sub-FB 32 is connected to blocks 311 and 321 that set a value to the input variable Enable.
  • Block 321 is turned on by the scheduler 160 every control cycle. Therefore, at the timing when the block 311 is set to ON and the block 321 is set to ON, the variable Enable of Sub-FB 32 is set to High, and Pub-FB 33 starts subscribe processing.
  • FIG. 26 is a diagram schematically showing a task execution cycle in the PLC according to this embodiment.
  • the scheduler 160 causes the CPU 110 to execute tasks according to the task control information 275 as shown in FIG.
  • task 141 of the control program is executed in each control cycle T. This maintains the constant periodicity of the control program.
  • tasks 141 and 142 of Client-FB31 and Sub-FB32 of the communication program 171 are executed.
  • the task 143 of the Pub-FB 33 is also activated in the idle time of each control cycle, and is executed only when the publishing conditions are satisfied.
  • FIG. 26 shows that task 143 is not executed in period (n+2) because the publish condition is not satisfied.
  • the task 144 of the Ping-FB 34 is executed once every two control cycles T, for example, in idle time, based on the fact that its priority 133 is low. In FIG. 26, it is executed only in period (n+2) out of period n to period n+3. Since the task 144 is executed every two control cycles T, even if the task 144 of the Ping-FB 34 for monitoring network connection for Pub/Sub communication is executed, the control program, Client-FB 31, Sub - The constant periodicity of FB32 and Pub-FB33 can be maintained.
  • the network connection monitoring process is performed by the task of the Client-FB 31 executed in each control cycle T, even if the monitoring process of the Ping-FB 34 is executed once per N control cycles T, In each control cycle T, it is possible to guarantee that the monitoring process is performed.
  • the user program may be configured to activate the Ping-FB 34 when publishing is requested by the user program, including the control program. After this activation, the user program is configured to activate Pub-FB 33 so as to transmit a publish message when it is determined that the soundness of the network is ensured based on the output variable Error of Ping-FB 34.
  • the Ping-FB 34 detects timeout and sets the variable Error to TRUE.
  • the above publishing conditions may include the condition that the network is detected to be healthy based on the value of the Ping-FB 34 variable Error.
  • User programs can trigger Pub-FB 33 to send publish messages when publish conditions, including network health, are met, thus providing flexibility in timing choices that enable reliable message delivery. .
  • this advantage can be obtained because the Ping-FB 34 of the activated type provides a monitoring function independent of the network connection monitoring function of the Client-FB 31 .
  • a development support program 250 that provides a development support environment for the application program 170 including the communication program 171 shown in this embodiment is stored in the storage unit 201 of the support device 200 .
  • CPU 202 can realize the development environment shown in the present embodiment.
  • the development support program 250 is recorded in a computer-readable recording medium including recording media such as a flexible disk attached to the support device 200, CD-ROM (Compact Disk-Read Only Memory) 300, ROM, RAM, etc. It can also be provided as a product. Recording media store information such as programs by electrical, magnetic, optical, mechanical or chemical action so that computers, other devices, machines, etc. can read the information such as programs. is a medium.
  • the development support program 250 can be recorded in a recording medium such as the HDD 204 built in the support device 200 and provided as a program.
  • the program can be provided by downloading from a network via a communication interface.
  • An information processing device (200) comprising a library (245) storing unit programs constituting an application program (170) executed by a control device (PLC) that controls objects (6, 7), The controller is networked to a server (300),
  • the unit programs of the library include unit programs (31, 32, 33, 34) constituting a publish/subscribe communication program (171) included in the application program,
  • a unit program that constitutes the communication program includes: a publisher unit program (33) for outputting a request to send a publish message of data relating to said control; a unit program (32) of a subscriber that outputs a request to send a subscribe message for the control-related data; a connection monitoring unit program (34) for outputting a transmission request for a ping command message for monitoring the network connection; a client unit program (31) that transmits a request to send the message from each unit program to the server via the network;
  • the information processing device further includes: operation receiving means (205, 206)
  • the information processing apparatus according to any one of configurations 1 to 5, wherein the server includes an MQTT (Message Queuing Telemetry Transport) message distribution server.
  • MQTT Message Queuing Telemetry Transport
  • a plurality of said controllers PLC1, PLC2, PLC3 networked to said server; 7.
  • the information processing device according to any one of configurations 1 to 6, wherein the plurality of control devices are configured to control the target by distributed control.
  • the connection monitoring unit program measures a time from outputting the transmission request of the ping command message to receiving a response.
  • a program development support method in an information processing device (200) comprising a library (245) storing unit programs constituting an application program (170) executed by a control device (PLC) that controls an object (6, 7).
  • the controller is networked to a server (300)
  • the unit program of the library includes a unit program constituting a publish/subscribe communication program (171) included in the application program
  • a unit program that constitutes the communication program includes: a publisher unit program (33) for outputting a request to send a publish message of data relating to said control; a unit program of a subscriber that outputs a request to send a subscribe message for the control-related data; a connection monitoring unit program (34) for outputting a transmission request for a ping command message for monitoring the network connection; a client unit program (31) that transmits a request to send the message from each unit program to the server via the network;
  • the program development support method includes: receiving a user operation; and creating the application program including a call instruction for each unit program constituting the communication program

Landscapes

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

Abstract

通信プログラムを含むアプリケーションプログラムの開発環境を提供する。ライブラリ(245)に、通信プログラムのための、制御に関するデータの送信要求を出力するパブリッシャの単位プログラムと、制御に関するデータのサブスクライブを要求する単位プログラムと、ネットワーク接続監視のピングコマンド送信要求を出力する単位プログラムと、各単位プログラムからの要求を、ネットワークを介してサーバに送信する単位プログラムとが格納される。装置は、ユーザ操作に基づき、通信プログラム(171)の各単位プログラムの呼出命令を含むアプリケーションプログラム(170)を作成する。

Description

情報処理装置、方法およびプログラム
 本開示は情報処理装置、方法およびプログラムに関し、対象を制御するアプリケーションプログラムの開発に向けられた情報処理装置、方法およびプログラムに関する。
 FA(Factory Automation:ファクトリオートメーション)の生産現場において、ネットワーク接続された複数の制御装置間で、制御に関するデータをパブリッシュ/サブスクライブ(publish-subscribe)型の通信プロトコルに従い遣り取りする環境が提供される。例えば、特開2019-080164号公報(特許文献1)では、PLC(Programmable logic Controller)がパブリッシャ部とサブスクライバ部を備え、PLC間でデータを互いに遣り取りする。
特開2019-080164号公報
 PLCのアプリケーションプログラムの開発環境では、アプリケーションプログラムを機能毎に部品化、すなわち単位プログラム化することで、プログラムの開発を効率化したいとの要望がある。
 本開示は、対象を制御する制御装置で実行されるパブリッシュ/サブスクライブ型の通信プログラムを含むアプリケーションプログラムの効率的な開発環境の提供を目的とする。
 本開示の一例に係る対象を制御する制御装置で実行されるアプリケーションプログラムを構成する単位プログラムを格納するライブラリを備える情報処理装置であって、制御装置は、サーバにネットワーク接続され、ライブラリの単位プログラムは、アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラムを構成する単位プログラムを含み、通信プログラムを構成する単位プログラムは、制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラムと、制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラムと、ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラムと、各単位プログラムからのメッセージの送信要求を、ネットワークを介してサーバに送信するクライアントの単位プログラムと、を含み、情報処理装置は、さらに、当該情報処理装置に対するユーザ操作を受付ける操作受付手段と、操作受付手段によって受付けられたユーザ操作に基づき、通信プログラムを構成する各単位プログラムの呼出命令を含むアプリケーションプログラムを作成する手段を備える。
 この開示によれば、制御装置の通信プログラムを、パブリッシュ/サブスクライブ通信が提供する各機能に対応した単位プログラムをライブラリとして提供できる。また、これら単位プログラムのうち、接続監視の単位プログラムにのみネットワーク接続確立と通信の機能を担わせることで、他の単位プログラムの開発が比較的容易となる。
 これにより、ユーザは、情報処理装置を操作して、制御を通信と連携させるアプリケーションプログラムを開発(作成)する場合に、パブリッシュ/サブスクライブ通信が提供する機能を4つの機能に細分化して扱うことができる。したがって、パブリッシュ/サブスクライブ通信の機能が細分化されずに一体的に提供される場合に比較して、ユーザは、アプリケーションプログラムを効率的に開発できる。
 上述の開示において、情報処理装置は、通信プログラムの各単位プログラムについて、制御周期において、他の単位プログラムよりも優先して実行される優先度を設定する手段を、さらに備える。
 この開示によれば、通信プログラムを構成する上記に述べた各単位プログラムについて、制御装置で実行される場合の優先度を設定できる。
 上述の開示において、上記の通信プログラムのうち、少なくともクライアントの単位プログラムは、他の単位プログラムよりも優先度を高く設定する。
 この開示によれば、ネットワークを介してサーバと通信するクライアントの単位プログラムが高い優先度を実行されることで、メッセージを制御周期内でネットワークに転送することができる。
 上述の開示において、接続監視の単位プログラムの優先度は、当該単位プログラムはN回の制御周期毎に実行されることを示す。
 この開示によれば、接続監視の単位プログラムは制御周期毎ではなくN回の制御周期毎に実行されるので、接続監視の単位プログラムによってピングコマンドメッセージがネットワークに転送されるとしても、ネットワークの負荷上昇を抑制できる。
 上述の開示において、クライアントの単位プログラムは、ネットワーク接続を監視するための命令コードを含む。
 この開示によれば、クライアントの単位プログラムは、接続監視の単位プログラムと協働して、ネットワーク接続を監視する機能を担うことができる。
 上述の開示において、サーバは、MQTT(Message Queuing Telemetry Transport)のメッセージ配信サーバを含む。この開示によれば、MQTTプロトコルを利用したパブリッシュ/サブスクライブ通信が可能になる。
 この開示において、複数の上記の制御装置がサーバにネットワーク接続され、複数の制御装置は、分散制御により対象を制御するよう構成される。したがって、対象の分散制御を構成する各制御装置のサーバとの通信に上記の特徴を適用することができる。
 上述の開示において、接続監視の単位プログラムは、ピングコマンドメッセージの送信要求を出力してから応答を受信するまでの時間を計測する。したがって、接続監視の単位プログラムは、ピングコマンドメッセージの送信要求の出力からその応答を受信するまでの所要時間を計測し、所要時間から、ネットワーク上のトラフィック等の健全性を監視できる。
 本開示の一例によれば、対象を制御する制御装置で実行されるアプリケーションプログラムを構成する単位プログラムを格納するライブラリを備える情報処理装置おけるプログラム開発支援方法であって、制御装置は、サーバにネットワーク接続され、ライブラリの単位プログラムは、アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラムを構成する単位プログラムを含み、通信プログラムを構成する単位プログラムは、制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラムと、制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラムと、ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラムと、各単位プログラムからメッセージの送信要求を、ネットワークを介してサーバに送信するクライアントの単位プログラムと、を含み、プログラム開発支援方法は、ユーザ操作を受付けるステップと、受付けられたユーザ操作に基づき、通信プログラムを構成する各単位プログラムの呼出命令を含むアプリケーションプログラムを作成するステップと、を備える。
 この開示に従う方法が実施されることにより、制御装置の通信プログラムを、パブリッシュ/サブスクライブ通信が提供する各機能に対応した単位プログラムをライブラリとして提供できる。また、これら単位プログラムのうち、接続監視の単位プログラムにのみネットワーク接続確立と通信の機能を担わせることで、他の単位プログラムの開発が比較的容易となる。
 これにより、ユーザは、情報処理装置を操作して、制御を通信と連携させるアプリケーションプログラムを開発(作成)する場合に、パブリッシュ/サブスクライブ通信が提供する機能を4つの機能に細分化して扱うことができる。したがって、パブリッシュ/サブスクライブ通信の機能が細分化されずに一体的に提供される場合に比較して、ユーザは、アプリケーションプログラムを効率的に開発できる。
 この開示の他の例では、上記のプログラム開発支援方法をプロセッサに実行させるための開発支援プログラムが提供される。
 本開示の一例によれば、対象を制御する制御装置で実行されるパブリッシュ/サブスクライブ型の通信プログラムを含むアプリケーションプログラムの効率的な開発環境を提供することができる。
本実施の形態に係るシステムを示す模式図である。 本実施の形態に係るPLCの処理ユニットのハードウェア構成を示す模式図である。 本実施の形態に係るサポート装置のハードウェア構成の一例を示す模式図である。 本実施の形態に係るPLCの処理ユニットに実装されるソフトウェア構成の一例を示す模式図である。 本実施の形態に係るサポート装置におけるプログラムの開発環境の一例を概略的に示す図である。 本実施の形態に係るプログラム開発の概略処理の一例を示すフローチャートである。 本実施の形態に係るタスク制御情報の一例を示す図である。 本実施の形態に係るPub/Sub通信のモデルを示す図である。 本実施の形態に係るPLCにおいて構成されるPub/Sub通信のモデルの一例を示す図である。 本実施の形態に係るメッセージのパケットの基本構成を示す図である。 本実施の形態に係るパブリッシュされるパケットの構成を示す図である。 本実施の形態に係るサブスクライブされるパケットの構成を示す図である。 本実施の形態に係るPINGコマンドのメッセージパケットの構成を示す図である。 本実施の形態に係るClient-FBの一例を示す。 図14のClient-FBのタイミングチャートである。 図14のClient-FBのタイミングチャートである。 本実施の形態に係るSub-FBの一例を示す。 図17のCSub-FBのタイミングチャートである。 本実施の形態に係るPub-FBの一例を示す。 図19のPub-FBのタイミングチャートである。 本実施の形態に係るPing-FBの一例を示す。 図21のPing-FBのタイミングチャートである。 図21のPing-FBのタイミングチャートである。 本実施の形態に係るアプリケーションプログラム中の通信プログラムの一部を抜粋して模式的に示す図である。 本実施の形態に係るアプリケーションプログラム中の通信プログラムの一部を抜粋して模式的に示す図である。 本実施の形態に係るPLCにおけるタスクの実行周期を模式的に示す図である。
 本実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。
 <A.適用例>
 まず、図5を参照して、本発明が適用される場面の一例について説明する。図5は、本実施の形態に係るサポート装置200におけるプログラムの開発環境の一例を概略的に示す図である。サポート装置200は、アプリケーションプログラムの開発を支援する環境を提供する。アプリケーションプログラムは、PLC向けの制御プログラムを含むユーザプログラムを構成する。開発対象のアプリケーションプログラムは、例えば国際規格IEC61131-3に従うプログラムを含み得る。国際規格IEC61131-3おいては、制御プログラムを含むPLCアプリケーションのプログラミング言語として、ラダーダイアグラム(LD:Ladder Diagram)、ファンクションブロックダイアグラム(FBD:Function Block Diagram)、シーケンシャルファンクションチャート(SFC:Sequential Function Chart)、インストラクションリスト(IL:Instruction List)、およびストラクチャードテキスト(ST:Structured Text)の5種類を規定する。
 本実施の形態に係るアプリケーションプログラムは、ラダーダイアグラムのプログラムを含むが、いずれのプログラミング言語で記述されたプログラムであってもよい。以下では、典型例として、ラダーダイアグラムで記述されたプログラムについて説明する。
 サポート装置200は、たとえば、ノート型またはデスクトップ型のPC(Personal Computer)、タブレット端末、スマートフォン、または、その他の情報処理装置を含む。
 PLCのアプリケーションプログラムは、対象を制御する制御プログラムと、当該PLCが他のPLCを含む他の装置と通信するための通信プログラムを含む。本実施の形態では、PLCはパブリッシュ/サブスクライブ型の通信方式に従い他の装置と通信する。このパブリッシュ/サブスクライブ型の通信モデルを実現するデータ配信のための通信プロトコルとして、本実施の形態では、MQTT(Message Queuing Telemetry Transport)通信プロトコルを利用する。以下では、パブリッシュ/サブスクライブ型の通信を、Pub/Sub通信と略称する。
 サポート装置200には、開発支援プログラム250がインストールされている。開発支援プログラム250は、PLC用の制御プログラムの開発を支援するためのアプリケーションである。ユーザは、開発支援プログラム250によって提供される各種ツールを操作することにより、PLC用のアプリケーションプログラムを設計し、設計したアプリケーションプログラムをPLCにインストールすることができる。
 アプリケーションプログラムは、周期実行型の制御プログラムを含む。周期実行型とは、制御プログラムの先頭行から最終行までが予め定められた周期ごとに繰り返し実行される実行形態をいう。すなわち、周期実行型の制御プログラムにおいては、プログラムの実行周期が保障されている。周期実行型のプログラミング言語としては、典型的にはラダーダイアグラム、ストラクチャードテキストの言語などが挙げられる。
 開発支援プログラム250は、RAM(Random Access Memory),HDD(Hard Disc Drive)などにより構成されるデータ格納部270の各種データを操作しながら、アプリケーションプログラムを生成する。データ格納部270は、アプリケーションプログラムを構成する単位プログラムの一例であるFB(Function Block)およびFUN(Function)が格納される領域を構成するライブラリ245を含む。ライブラリ245は、MQTT通信プロトコルに従うPub/Sub通信を実現するためのFBを格納するMQTTライブラリ26を含む。
 MQTTライブラリ26は、Pub/Sub通信が提供する各種機能に対応付けてClient-FB31と、Sub-FB32と、Pub-FB33と、Ping-FB34とを含む。Client-FB31は、PLCと、制御に関するデータを遣り取りする他の装置(他のPLC)との間でネットワーク接続を確立する機能を担うクライアントの命令コードを有する。
 Sub-FB32は、制御に関するデータのパブリッシュメッセージのネットワークへの送信要求を、クライアントに出力する機能を担うパブリッシャの命令コードを有する。Pub-FB33は、制御に関するデータのサブスクライブメッセージのネットワークへの送信要求を、クライアントに出力する機能を担うサブスクライバの命令コードを有する。
 Ping-FB34は、ネットワーク接続の状態を監視するピング(PING)コマンドのメッセージをネットワークへ送信する要求を、クライアントに出力する機能を担う接続監視部の命令コードを有する。
 開発支援プログラム250は、ソースコード272で記述されるソースプログラム271を、サポート装置200に対するユーザ操作に従い編集するエディタ252と、ソースプログラム271をコンパイルして実行可能プログラム273に変換するコンパイラ212を有する。開発支援プログラム250は、さらに、プログラムをデバッグするためのデバッガ213と、プログラムの動作を検証するシミュレータ214と、ビルダ215と、プログラム開発のためのGUI(Graphical User Interface)環境を提供するGUIツール216を有する。
 エディタ252は、アプリケーションプログラムのコードを編集するためのコードエディタ254と、プログラム中で使用される変数を編集し変数データ274を生成するための変数エディタ253と、タスク設定エディタ255とを含む。タスク設定エディタ255は、ソースプログラム271が、PLCにおいて実行される場合に、当該プログラムにより構成される1つ以上のタスクそれぞれについて、当該タスクが他のタスクに優先して実行される度合いを示すタスク制御情報275を、ユーザ操作に基づき設定する。タスク制御情報275は、後述するように、タスク毎の優先度133を含む。
 コードエディタ254は、アプリケーションプログラムであるソースプログラム271のコードを編集するとともに、ユーザ操作に従い、ソースプログラム271にライブラリ245のFBを呼出す(call)ための呼出命令コードを記述する。
 ソースプログラム271が編集されると、コンパイラ212は、編集後のソースプログラム271のソースコード272をコンパイルし実行可能プログラム273を生成する。ビルダ215は、実行可能プログラム273と、ライブラリ245の当該ソースプログラム271で呼出されているライブラリ245中のFBとをリンクさせて、実行可能形式のアプリケーションプログラム170を生成し、転送モジュール211によって、PLC100に転送(インストール)する。
 PLCでは、インストールされた実行可能形式のアプリケーションプログラム170を実行する。この実行時に、制御プログラムと通信プログラム171(Client-FB31、Sub-FB32、Pub-FB33、およびPing-FB34)が実行される。これにより、PLCは、制御プログラムの周期実行中に、MQTTプロトコルに従うPub/Sub通信を実施して他の装置(他のPLC)とデータを遣り取りできる。
 上記に述べたように、サポート装置200は、PLCの通信プログラム171を、MQTTプロトコルに従うPub/Sub通信が提供する各機能に対応した単位プログラム(Client-FB31、Sub-FB32、Pub-FB33、およびPing-FB34)をMQTTライブラリ26として提供する。また、この4つのFBのうち、Client-FB31にのみネットワーク接続確立と通信の機能を担わせることで、他のFBの開発が比較的容易となる。
 これにより、ユーザは、サポート装置200を操作して、制御を通信と連携させるアプリケーションプログラム170を開発(作成)する場合に、Pub/Sub通信が提供する機能を4つの機能に細分化して扱うことができる。したがって、Pub/Sub通信の機能が細分化されずに一体的に提供される場合に比較して、ユーザは、PLCのアプリケーションプログラム170を効率的に開発できる。
 以下、本発明のより具体的な応用例として、本実施の形態に係るサポート装置200のより詳細な構成および処理について説明する。
 <B.システム構成>
 まず、本実施の形態に係るサポート装置200が使用および運用を支援するPLCを含むシステムについて説明する。
 図1は、本実施の形態に係るシステム1を示す模式図である。本実施の形態に係るシステム1は、ネットワーク410を介してネットワーク接続された複数のPLC(PLC1,PLC2,PLC3)を含む。複数のPLCは、ネットワーク400を介してサーバ300と通信する。サーバ300は、クラウドベースの外部サーバまたはオンプレミスサーバを含む。図1では、システム1が有するPLCは3台としているが複数台であればよく、3台に限定されない。
 システム1の各PLCは、任意の制御対象(例えば、FAの製造装置や設備などの対象)を制御する産業用コントローラに相当する。PLCには、1または複数のフィールド機器が接続される。1または複数のフィールド機器の各々は、生産工程を含む生産ラインなど(以下、「フィールド」とも総称する。)に対して何らかの物理的な作用を与えるアクチュエータ7、およびフィールドとの間で情報を遣り取りするセンサを含む入出力装置6などを含む。
 図1のシステム1は、例えば、複数種類の工程(例えば、ねじ締め工程、はんだ付工程および組立工程など)を含み、これら各工程についてPLCが設けられる。生産ラインを流れるワークは、この順番で工程を流れることで製品が製造される。工程では、ワークに対してフィールド機器により複数種類の作業が実施される。なお、システム1が備える工程の種類および数は、これらに限定されず、生産する製品の種類または製品の仕様に従って変化し得る。
 システム1は、このように各工程についてPLCを設ける分散制御システムを構成する。各工程のPLCは、ネットワーク400、4102に接続されて制御に関するデータを他のPLCと遣り取りする。
 各PLCは、プログラムを実行する主体である処理ユニット10と、処理ユニット10などへ電力を供給する電源ユニット12と、フィールドからの信号を遣り取りするIO(Input/Output)ユニット14とを含む。IOユニット14は、処理ユニット10とシステムバス11を介して接続されている。典型的には、IOユニット14は、フィールド機器である入出力装置6から入力信号を取得し、また処理ユニット10でのプログラムの実行結果に応じてフィールド機器であるアクチュエータ7を駆動する。入出力装置6は例えばアクチュエータの制御量を検出する。入出力装置6およびアクチュエータ7は、PLCが制御する「対象」となるデバイスを構成する。
 サポート装置200は、PLCで実行されるアプリケーションプログラムを開発する環境を提供するとともに、接続先のPLCの運転状態や各種データの値などをモニタする機能を有する。
 <C.ハードウェア構成>
 次に、図1に示すシステム1を構成するPLCおよびサポート装置200のハードウェア構成について説明する。
 (c1:PLCのハードウェア構成)
 図2は、本実施の形態に係るPLCの処理ユニット10のハードウェア構成を示す模式図である。図2を参照して、処理ユニット10は、プロセッサ100と、チップセット102と、メインメモリ104と、不揮発性メモリ106と、システムタイマ108と、システムバスコントローラ120と、ネットワークコントローラ149と、USBコネクタ110とを含む。チップセット102と他のコンポーネントとの間は、各種のバスを介してそれぞれ結合されている。
 プロセッサ100およびチップセット102は、典型的には、汎用的なコンピュータアーキテクチャに準じて構成される。すなわち、プロセッサ100は、チップセット102から内部クロックに従って順次供給される命令コードを解釈して実行する。チップセット102は、接続されている各種コンポーネントとの間で内部的なデータを遣り取りするとともに、プロセッサ100に必要な命令コードを生成する。さらに、チップセット102は、プロセッサ100での演算処理の実行の結果得られたデータなどをキャッシュする機能を有する。
 処理ユニット10は、メモリとして、メインメモリ104および不揮発性メモリ106を有する。
 メインメモリ104は、揮発性の記憶領域であり、処理ユニット10への電源投入後にプロセッサ100で実行されるべき各種プログラムを格納する。メインメモリ104は、プロセッサ100による各種プログラムの実行時の作業用メモリとしても使用される。このようなメインメモリ104としては、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)といったデバイスが用いられる。
 不揮発性メモリ106は、リアルタイムOS(Operating System)、システムプログラム、サポート装置200からインストールされたアプリケーションプログラムおよび各種情報を不揮発的に格納する。
 これらのプログラムやデータは、必要に応じて、プロセッサ100がアクセスできるようにメインメモリ104にコピーされる。
 処理ユニット10は、通信インターフェイスとして、システムバスコントローラ120およびネットワークコントローラ149を有する。これらの通信インターフェイスは、出力データの送信および入力データの受信を行う。
 システムバスコントローラ120は、システムバス11を介したデータの遣り取りを制御する。より具体的には、システムバスコントローラ120は、DMA(Dynamic Memory Access)制御回路122と、システムバス制御回路124と、バッファメモリ126とを含む。システムバスコントローラ120は、システムバスコネクタ130を介してシステムバス11と内部的に接続される。
 ネットワークコントローラ149は、ネットワーク410を介した他のPLCとの間のデータの遣り取りを制御するために、DMA(Dynamic Memory Access)制御回路148と、ネットワーク制御回路147と、バッファメモリ146とを含む。
 ネットワーク制御回路147は、ネットワーク410に接続される他のPLCとの間で、バッファメモリ146の出力データを送信する処理および入力データを受信してバッファメモリ146に格納する処理を行う。
 USBコネクタ110は、サポート装置200と処理ユニット10とを接続するための通信インターフェイスである。典型的には、サポート装置200から転送される、処理ユニット10のプロセッサ100で実行可能なプログラムなどは、USBコネクタ110を介してPLCに取込まれる。
 (c2:サポート装置のハードウェア構成)
 図3は、本実施の形態に係るサポート装置200のハードウェア構成の一例を示す模式図である。図3を参照して、サポート装置200は、典型的には、汎用のコンピュータで構成される。なお、メンテナンス性の観点からは、可搬性に優れたノート型のパーソナルコンピュータであってもよい。
 図3を参照して、サポート装置200は、OSを含む各種プログラムを実行するCPU201と、BIOSや各種データを格納するROM(Read Only Memory)202と、CPU201でのプログラムの実行に必要なデータを格納するための作業領域を提供するメモリRAM203と、CPU201で実行されるプログラムなどを不揮発的に格納するハードディスク(HDD)204とを含む。
 HDD204は、データ格納部270を構成する。HDD204には、開発支援プログラム250を格納されるとともに、開発されたソースプログラム271が格納される。また、HDD204には、MQTTライブラリ26を含むライブラリ245が格納される。
 サポート装置200は、さらに、ユーザからの操作を受け付ける操作部に相当するキーボード205およびマウス206と、情報をユーザに表示するためのモニタ207とを含む。サポート装置200は、PLC(処理ユニット10)などと通信するための通信インターフェイス(IF)209を含む。
 サポート装置200で実行される各種プログラムは、CD-ROM301に格納されて流通する。このCD-ROM301に格納されたプログラムは、CD-ROM(Compact Disk-Read Only Memory)ドライブ208によって読取られ、ハードディスク(HDD)204などへ格納される。あるいは、上位のホストコンピュータなどからネットワーク400または410を通じてプログラムをダウンロードするように構成してもよい。
 <D.ソフトウェア構成>
 次に、PLC(処理ユニット10)が各種機能を提供するためのソフトウェア構成について説明する。
 図4は、本実施の形態に係るPLCの処理ユニット10に実装されるソフトウェア構成の一例を示す模式図である。図4に示すソフトウェアに含まれる命令コードは、適切なタイミングで読出され、処理ユニット10のプロセッサ100へ提供されて実行される。
 図4を参照して、処理ユニット10には、リアルタイムOS190上にPLCでの処理に必要なプログラムが実装される。
 リアルタイムOS190は、処理ユニット10のコンピュータアーキテクチャに応じて設計されており、プロセッサ100がPLCでの処理に必要なプログラムを実行するための基本的な実行環境を提供する。より具体的には、リアルタイムOS190は、スケジューラ160と協働してマルチタスク実行部191を実現する。マルチタスク実行部191は、複数のプログラムにより実現されるタスクを時間の経過に従い切り替えて実行するための環境を提供する。スケジューラ160は、タスク制御情報275が示すタスクの優先度または周期に従い、プロセッサ100に割当てるタスクを切替える。これにより、プロセッサ100は、タスク制御情報275が示すタスクの優先度または周期に従いタスクを実行する。
 より具体的には、処理ユニット10には、スケジューラ160と、アプリケーションプログラム170と、入力処理モジュール172と、出力処理モジュール174と、通信処理モジュール176と、その他のシステムモジュール178と、命令実行モジュール180と、メモリマネジャー184とが実装される。メモリマネジャー184は、メインメモリ104に格納されるデータを管理する。より具体的には、アプリケーションプログラム170で用いる各種変数を定義した変数データ274について、アプリケーションプログラム170による読み書きを管理する。
 スケジューラ160は、マルチタスク制御に関連して、アプリケーションプログラム170、入力処理モジュール172、出力処理モジュール174、および通信処理モジュール176について、タスク制御情報275に従い実行開始タイミングや処理中断を制御する。
 アプリケーションプログラム170は、ユーザがその制御目的に応じて作成する。すなわち、システム1を用いて制御する対象のライン(プロセス)などに応じて、任意に設計されるプログラムである。アプリケーションプログラム170には、サポート装置200で生成される実行可能な形式のプログラムモジュールに相当し、通信プログラム171を含む。
 アプリケーションプログラム170は、シーケンス処理およびモーション演算などの制御プログラムを含み得る。アプリケーションプログラム170は、命令実行モジュール180により実行されることで、各種の制御処理およびMQTTプロトコルに従いPub/Sub通信を実現する。
 入力処理モジュール172は、システムバスコントローラ120によって受信された入力データを、アプリケーションプログラム170が使用するのに適した形式に再配置する。出力処理モジュール174は、アプリケーションプログラム170の実行によって生成された出力データを、システムバスコントローラ120へ転送するのに適した形式に再配置する。
 通信処理モジュール176は、ネットワークコントローラ149による他のPLCとの間の通信処理またはサポート装置200との通信を制御する。他のPLCとの間の通信処理は、通信プログラム171の実行と協働して実現される。
 その他のシステムモジュール178は、図5に個別に示したプログラム以外の、PLC1の各種機能を実現するための1つまたは複数のモジュールをまとめて示したものである。
 <E.プログラム開発の処理>
 図6は、本実施の形態に係るプログラム開発の概略処理の一例を示すフローチャートである。図6を参照して、サポート装置200では、ソースプログラム271からアプリケーションプログラム170を生成(変更)する場合に、エディタ252は、キーボード205またはマウス206を介して受付けるユーザ操作内容に従い、ソースプログラム271のエディット(編集)する(ステップS1)。
 エディットでは、エディタ252は、ユーザ操作に基づき、ソースプログラム271に通信プログラム171のPub/Sub通信の各FBを呼出す命令コードを記述する。より、具体的には、Client-FB31、Sub-FB32、Pub-FB33、およびPing-FB34を呼出す命令コードを記述する(ステップS12、ステップS13、ステップS14、ステップS15)。本実施の形態では、PLCが通信する相手となる他のPLCの数だけPub/Sub通信のコネクションが設定される。図1のシステム1の場合、各PLCについて、2つのコネクションが設定される。図6では、ユーザは、システム1のコンフィグ情報からコネクションの数を特定し(ステップS11)、取得したコネクションの数だけ変数Nを1カウントアップ(ステップS16でNO、ステップS17)しながら、ステップS12~ステップS15の処理を繰り返す。全てのコネクションについて、ステップS12~ステップS15の処理が終了すると(ステップS16でYES)、ソースプログラム271のエディト処理は終了し、ソースプログラム271は格納される(ステップS18)。
 コンパイラ212は、ソースプログラム271(より特定的にはソースコード272)をコンパイルし、実行可能プログラム273を生成する(ステップS2)。ビルダ215は、実行可能プログラム273とライブラリ245のFBとをビルド処理して、実行可能形式のアプリケーションプログラム170を生成する(ステップS3)。このときタスク制御情報275も作成されて、(ステップS4)、転送モジュール211は、実行可能形式のアプリケーションプログラム170およびタスク制御情報275を、PLCに転送する(ステップS5)。
 本実施の形態では、アプリケーションプログラムの開発環境を、PLCとは独立装置であるサポート装置200において構成されたが、アプリケーションプログラムの開発環境は、PLCにおいて実装されてもよい。例えば、PLCは、制御プログラムを実行するためのリアルタイムOSと、アプリケーションプログラムの開発環境のための汎用OSとを搭載し、汎用OSのもとでアプリケーションプログラムの開発環境を構成する。
 <F.タスク制御情報>
 「タスク」は、プロセッサ100により実行される処理の単位であって、タスクは1つ以上のプログラムを含む。タスクの「リアルタイム性」は、タスクが実行開始されてから、予め定められた時間内に実行が終了することを示す。「制御タスク」は、フィールド装置群のうちの制御すべき対象をリアルタイム制御するためのタスクである。「非制御タスク」は、「制御タスク」とは異なり直接にリアルタイム制御に関与しないが、リアルタイム性が要求されるタスクであって、上記のリアルタイム制御に関連する処理を実施するためのタスクである。タスクの「優先度」は、当該タスクが他のタスクよりも先にプロセッサにより実行される相対的な順序を示す。優先度が高ければ実行順序は先となり、優先度が低ければ実行順序は後となる。
 PLCは、生産現場に設けられた機器を制御する制御プログラムなど機器を制御する制御タスクを、予め定められた周期毎に実行することで、機器のリアルタイム制御を実現している。ここでは、予め定められた周期を「制御周期」と呼ぶ。
 PLCなどの制御装置においては、各種の機能の追加に伴い、機器の制御に直接的には関与しない非制御タスクを上記のリアルタイム制御(定周期性)を維持しながら実行させることが要求される。本実施の形態では、このような追加機能のタスクとして通信プログラム171のタスクである、Client-FB31、Sub-FB32,Pub-FB33およびPing-FB34のタスクを含む。
 図7は、本実施の形態に係るタスク制御情報275の一例を示す図である。図7を参照して、ユーザは、PLCのアプリケーションプログラムの開発時に、タスクの優先度を、タスク制御情報275に設定する。
 図7を参照して、タスク制御情報275は、各タスクに対応してタスク名132、優先度情報(優先度133および実行条件134)を含む。タスク名132は、制御プログラムのタスク名と、通信プログラム171を構成する単位プログラム、すなわちFBの名称であって、Client-FB31、Sub-FB32,Pub-FB33およびPing-FB34のそれぞれに対応して、Client、Sub,PubおよびPingを含む。本実施の形態では、制御タスクの優先度は最も高く“1”に設定される。通信プログラム171のタスクのうちClentの優先度が最も高く設定され、ClientとSubとPubのタスクの優先度133は例えば“2”、“4”、“6”に設定されて、Pingのタスクはそれらよりも優先度133は低く、例えば“15”と設定される。また、優先度情報の実行条件134について、ClientとSubは、各制御周期で無条件に実行される“常駐型”と設定されて、Pingは、予め定められた条件が満たされたとき実行される“起動型”であって、例えばN(但し、N≧1)回の制御周期に1回実行される。また、タスクPubは、各制御周期で起動されるが、実行されたときに予め定められたパブリッシュ条件が満たされた場合のみ、サブスクライブの処理を実行するよう構成されているので、実行条件134は、“常駐/起動型”と示されている。本実施の形態では、通信プログラム171のタスクのうちClentが最も高い優先度に設定されるが、設定方法はこれに限定されず、通信プログラム171の複数のタスク、例えば全タスクが同じ優先度に設定されてもよい。
 タスク制御情報275によれば、機器の制御には直接関係しないPub/Sub通信の機能を構成する4つの各タスクについて、個別に優先度133および実行条件を設定できるので、Pub/Sub通信が追加されるとしても、上記に述べた制御の定周期性を維持し易い。
 スケジューラ160は、アプリケーションプログラム170を実行する場合は、タスク制御情報275に従って、通信プログラム171のClient、Sub,PubおよびPingの各タスクの実行周期を制御する。
 <G.Pub/Sub通信のモデルの一例>
 図8は、本実施の形態に係るPub/Sub通信のモデルを示す図である。図8を参照して、PLC1とPLC2の間のコネクションを対象に、Pub/Sub通信のモデルを説明する。パブリッシャであるPLC1がパブリッシュしたデータは、MQTTのブローカとしてメッセージ配信を担うサーバ300を介してサブスクライバであるPLC2に提供される。
 パブリッシャは、サーバ300のトピックを送信先としてデータを送信する。パブリッシャは、制御に関するデータを有するメッセージ形式の送信先としてトピックを定義して、サーバ300に送信する。
 サブスクライバは、サーバ300にトピックの情報の配信を申し込んで、配信を申し込んだトピックに登録されるメッセージの配信をサーバ300から受ける。サブスクライバは、例えば、パブリッシャから送信された制御に関するデータを用いて、制御プログラムを含むアプリケーションプログラム170を実行することができる。
 サーバ300は、パブリッシャとサブスクライバとの間でのデータのやり取りを仲介する。サブスクライバは、サーバ300対して、トピックのデータを要求する登録を行う。また、パブリッシャは、トピックとデータとを含むメッセージをサーバ300に送信する。
 サーバ300は、サブスクライバが配信を申し込んだトピックを管理する。サーバ300は、例えば、パブリッシャからのトピックとデータとを含むメッセージを受け付けると、トピックのメッセージを格納し、そして、当該トピックのデータを要求しているサブスクライバ宛に配信する。
 なお、図8の説明は、PLC2がパブリッシュしたデータを、サーバ300を介しサブスクライバであるPLC1に提供するケースについても適用できる。
 <H.MQTTに従うPub/Sub通信のモデル>
 図9は、本実施の形態に係るPLCにおいて構成されるPub/Sub通信のモデルの一例を示す図である。図中では、Client-FB31と、Sub-FB32、Pub-FB33およびPing-FB34との間でのデータの遣り取りが示される。
 Client-FB31は、送受信データおよびクライアント状態を保持するとともに、Sub-FB32、Ping-FB34、およびPub-FB33からのデータ送信要求SR1、SR2およびSR3を受付ける。Sub-FB32、Ping-FB34およびPub-FB33は、データ送信要求SR1、SR2およびSR3に応じて、Client-FB31から、受信データRD1、RD2およびRD3、ならびにクライアント状態SD1、SD2およびSD3を取得する。Client-FB31は、Sub-FB32、Ping-FB34およびPub-FB33との間で、データ送信要求SR0、受信データRDおよびクライアント状態SDを、FB間で共通して設定された変数、例えば構造体変数を介して遣り取りする。
 Client-FB31は、サーバ300との間で、例えばセキュアソケット通信を実施する。Client-FB31サーバ300のIPアドレスおよびポート番号(図8参照)を管理する。したがって、Sub-FB32、Pub-FB33およびPing-FB34は、ブローカとなるサーバ300の識別情報なしに、データ送信要求SRによって、データのパブリッシュ、データのサブスクライブ、およびPINGコマンドの送信を実施することができる。
 (h1.パケットのフォーマット)
 MQTTライブラリ26のFBが互いに遣り取りするメッセージのフォーマットを説明する。図10を参照して、メッセージのパケットの基本構成70は、固定ヘッダ71、可変ヘッダ72およびペイロード73を含む。固定ヘッダ71は、当該パケットのタイプとパケットの長さの情報を含み、可変ヘッダ72はパケットIDを含み、ペイロード73は、通信するべきデータ等のメッセージを含む。
 図11を参照して、パブリッシュされるパケット70Aは、可変ヘッダ72にトピック名を含み、ペイロード73にパブリッシュされるデータ等のメッセージを含む。図12を参照して、サブスクライブされるパケット70Bは、可変ヘッダ72にパケットIDを含み、ペイロード73にトピック名で示されるトピックフィルタを含む。
 図13を参照して、PINGコマンドのメッセージパケット(以下では、PINGパケットともいう)は、固定ヘッダ71にPINGコマンドのパケットのタイプを含む。
 <I.MQTTライブラリのFBの構成>
 MQTTライブラリの各FBについて説明する。
 (i1.Client-FBの構成)
 Client-FB31は、サーバ300との接続を制御し、Sub-FB32、Pub-FB33およびPing-FB34において生成したメッセージをサーバ300への送信およびサーバ300からのメッセージの受信を実行する。
 図14は、本実施の形態に係るClient-FB31の一例を示す。図15と図16は、図14のClient-FB31のタイミングチャートである。
 図14を参照して、Client-FB31は、入力変数として、実行のトリガの入力変数Enable、接続設定の変数Settings、キープアライブタイマの変数KeepAlive、およびタイムアウトの変数Timeoutを有する。また、出力変数として、MQTTのサーバ300への接続中を示す変数Connected、実行中を表す変数Busy、エラーを示す変数Error、エラーコードの変数ErrorID、および拡張エラーコードを示す変数ErrorIDExを有する。
 図15と図16は、図14のClient-FB31の動作を示すタイミングチャートを示す。スケジューラ160は、タスク制御情報275に従い、Client-FB31を常駐型で実行されるように、変数Enableの入力を制御周期毎にHigh(立ち上がり)に設定する。
 図15を参照して、Client-FB31は「Busy」(実行中)がFALSEの間に「Enable」(実行)の信号を微分処理して立ち上がりを検出すると、「Busy」(実行中)をTRUEに設定する。その後、サーバ300との接続が確立すると、Client-FB31は「Connected」(サーバ接続中)にTRUEを設定し、サーバ300との接続確立後も「Busy」(実行中)にTRUEを設定し続ける。
 図16を参照して、「Connected」(サーバ接続中)がTRUEである接続処理中に「Enable」(実行)がFALSEになると、サーバ300との切断処理が開始されて、「Connected」(サーバ接続中)はFALSEに設定される。その後、サーバ300との切断処理が終了すると、Client-FB31は「Busy」(実行中)をFALSEに設定する。
 なお、「Connected」(サーバ接続中)がFALSEで「Busy」(実行中)がTRUEの間に「Enable」(実行)が立ち下がっても、「Busy」(実行中)は直ちにFALSEにならずTRUEを継続する。MQTTサーバとの切断処理が終了すると、「Busy」(実行中)はFALSが設定される。
 エラー処理に関しては、「Connected」(サーバ接続中)がTRUEの間に異常が検出されると、Client-FB31は、「Connected」(サーバ接続中)をFALSEに設定し、サーバ300との切断処理終了後に「Error」(エラー)をTRUEに設定するとともに、「ErrorID」(エラーコード)、「ErrorIDEx」(拡張エラーコード)に異常の原因を示す値を設定する。
 (i1-1.ネットワーク接続と接続監視)
 Client-FB31は、サーバ300とのネットワーク接続の健全性を監視する。より具体的には、変数「Enable」の値がFALSEからTRUEに立ち上がると、Client-FB31は、変数「Settings」において指定された設定に従ってサーバ300へ接続要求を実施する。
 接続要求によってClient-FB31はサーバ300と接続確立をした後、Sub-FB32、Pub-FB33およびPing-FB34で生成したメッセージの送信とサーバ300からのメッセージの受信を実施する。
 Client-FB31は、ネットワーク接続を監視するための命令コードを含む。すなわち、Client-FB31は、サーバ300との接続確立中は、接続を監視する。より具体的には、サーバ300と接続されているか否かを確認するキープアライブを実施する。
 Client-FB31は、サーバ300との接続中に変数KeepAliveで指定された時間内に当該クライアントからのメッセージ送信がないと検出すると、Client-FB31は、自身がPINGパケットを送信する。PINGパケット送信してから、その応答を格納したPINGRESPパケットを受信するまでの経過時間を測定し、測定される経過時間が予め定められた時間を超えてもPINGRESPパケットを受信できないことを検出すると、サーバ300との接続を切断する。変数KeepAliveに0が設定されると、Client-FB31は、PINGパケットを送信しない。
 (i2.Sub-FB32の構成)
 図17は、本実施の形態に係るSub-FB32の一例を示す。図18は、図17のCSub-FB32のタイミングチャートである。Sub-FB32は、指定されたトピックをサブスクライブ(受信)し、受信した指定トピックのパブリッシュメッセージからメッセージ部分を読み出す。
 図17を参照して、Sub-FB32は、入力変数として、実行のトリガの入力変数Enable、サブスクライブ要求するトピックを指定する変数Topic、指定したトピックのパブリッシュメッセージのメッセージ部の変数Messageを含む。また、出力変数として、サブスクライブ中か否かを示すフラグの変数Subscribed、Sub-FB32の実行状態を数値で示す変数Status、受信完了を示す変数Received、エラー発生を示す変数Error、エラーコードを示す変数ErrorID、拡張エラーコードを示す変数ErrorIDEx、受信したメッセージを示す変数Message、および受信したメッセージが属するトピックを示す変数Topicを有する。
 図18のタイミングチャートを参照して、図17のSub-FB32の動作を説明する。Sub-FB32は、スケジューラ160によって、タスク制御情報275に従い、制御周期毎に起動される。
 図18を参照して、「Status」(実行状態)が0(実行停止)のときに、スケジューラ160によって「Enable」がFALSEからTRUEに立ち上がると、Sub-FB32は、「Enable」の立ち上がりを微分処理により検出して、「Status」(実行状態)を1(サブスクライブ要求中)に設定する。これにより、Sub-FB32は起動される。
 その後サブスクライブに成功すると、Sub-FB32は「Status」(実行状態)を2(サブスクライブ中)に設定するとともに、「Subscribed」(サブスクライブ要求完了)をTRUEに設定する。
 Sub-FB32は、「Status」(実行状態)が2(サブスクライブ中)において「Topic」と一致するトピックに属するパブリッシュメッセージを受信したことを検出すると、受信完了(Received)をTRUEに設定する。
 Sub-FB32は、「Status」(実行状態)が1(サブスクライブ要求中)または2(サブスクライブ中)を示すときに「Enable」がTRUEからFALSEに立ち下がったことを検出すると、「Status」(実行状態)を3(サブスクライブ解除中)に設定するとともに「Subscribed」(サブスクライブ要求完了)をFALSEに設定する。
 その後、サブスクライブ解除が完了すると、Sub-FB32は、「Status」(実行状態)を0(実行停止)に設定する。
 また、「Status」(実行状態)が2(サブスクライブ中)を示すときに、Sub-FB32は、サーバ300との接続が切断されたことを検出すると、「Status」(実行状態)を4(再接続待ち)に設定して「Subscribed」(サブスクライブ要求完了)をFALSEに設定する。
 Sub-FB32は、実行中にFB自体の異常を検出した場合、「Error」(エラー)をTRUEに設定するともに、「ErrorID」(エラーコード)、「ErrorIDEx」(拡張エラーコード)に異常を特定する値を設定する。
 (i3.Pub-FBの構成)
 図19は、本実施の形態に係るPub-FB33の一例を示す。図20は、図19のPub-FB33のタイミングチャートである。Pub-FB33は、パブリッシュするべきメッセージを生成し、Client-FB31を介して、サーバ300に送信する。
 図19を参照して、Pub-FB33は、入力変数として、起動のトリガを受付ける変数Execute、パブリッシュするトピック名を指定する変数Topic、指定したトピックにパブリッシュされるべきメッセージを示す変数Message、およびパブリッシュ設定の変数Settingsを有する。また、出力変数として、処理の実行終了を示す変数Done、処理実行中を示す変数Busy、パブリッシュされるべきメッセージを示す変数Message、エラー発生を示す変数Error、エラーコードを示す変数ErrorID、および拡張エラーコードを示す変数ErrorIDExを有する。
 図20を参照して、Pub-FB33の動作を説明する。例えば、実行中の制御プログラムからの出力によって変数「Execute」(起動)がTrueに設定されると、すなわちパブリッシュ条件が満たされると、Pub-FB33は、変数「Execute」の立ち上がりを微分処理などにより検出し、検出したことに応じて「Busy」(実行中)をTRUEに設定する。Pub-FB33は、入力変数Settingsで指定されたパブリッシュメッセージのパケットを、出力変数Messageに設定する。これにより、パブリッシュされるメッセージはClient-FB31に出力される。
 パブリッシュされるメッセージはClient-FB31に出力されてメッセージ交換が完了すると、Pub-FB33は「Done」(完了)をTRUEに設定するとともに、「Busy」(実行中)をFALSEに設定する。
 Pub-FB33の実行中にFBの処理自体に異常を検出した場合、Pub-FB33は「Error」(エラー)をTRUEに設定し、「Busy」(実行中)をFALSEに設定する。「ErrorID」(エラーコード)、「ErrorIDEx」(拡張エラーコード)には、異常に応じた値が設定される。
 (i4.Ping-FBの構成)
 図21は、本実施の形態に係るPing-FB34の一例を示す。図21と図23は、図21のPing-FB34のタイミングチャートである。Ping-FB34は、Client-FB31とサーバ300との間で確立されたネットワーク接続の健全性を確認するため、Client-FB31を介してピングコマンドメッセージの図13のPINGパケットを送信し、サーバ300からレスポンスが返ってくるまでの時間を計測する命令コードを有する。
 図21をPing-FB34は、入力変数として、起動のトリガを受付けるExecute、サーバ300からのレスポンスの待機時間の閾値時間を示す変数Timeoutを有する。また、出力変数として、処理の実行終了を示す変数Done、処理実行中を示す変数Busy、エラー発生を示す変数Error、エラーコードを示す変数ErrorID、および拡張エラーコードを示す変数ErrorIDEx、およびPINGREQメッセージのPINGパケットを送信してから、応答のPINGRESPメッセージを受信するまでの時間を計測し、計測時間が設定される変数ElapseTimeを有する。PINGRESPメッセージも図13のパケット構成を有する。
 図22を参照して、Ping-FB34は、Client-FB31がサーバ300と接続中に、変数「Execute」(起動)がTRUEに設定されると、「Busy」(実行中)をTRUEに設定する。すなわち、スケジューラ160によって、N制御周期毎に変数「Execute」がTRUEに設定されることに応じて、Ping-FB34は当該FB内のロジックを実行することにより、PINGREQパケット70Cを生成し、PINGREQパケット70Cの送信要求を出して、PINGREQパケット70Cの応答であるPINGRESPパケットを受信する。また、Ping-FB34は当該FB内のロジックを実行することにより、PINGREQパケット70Cの送信要求を出力してからPINGRESPパケットを受信するまでの所要時間を計測し、計測される所要時間を変数ElapseTimeに設定する。処理が終了すると変数DoneをTRUEに設定する。
 図23を参照して、Ping-FB34は、PINGREQパケット70Cの送信要求を出力してからPINGRESPパケットを受信するまでの所要時間、すなわち変数ElapseTimeに設定される計測時間を、入力変数Timeoutで示される閾値時間と比較し、比較の結果に基づき(計測時間>閾値時間)の条件が満たされることを判定すると、タイムアウトを検出し、変数ErrorをTRUEに設定する。Ping-FB34は、タイムアウトの情報を「ErrorID」(エラーコード)および「ErrorIDEx」(拡張エラーコード)に設定する。
 このように、Ping-FB34は、ピングコマンドメッセージの送信要求を出力してから応答を受信するまでの所要時間を計測し、計測された所要時間から、ネットワーク上のトラフィック等の健全性を監視し、監視結果を出力できる。
 <J.通信プログラムの一例>
 図24と図25は、本実施の形態に係るアプリケーションプログラム170中の通信プログラム171の一部を抜粋して模式的に示す図である。図24と図25はラダープログラムであって、例えば、GUIツール216によって、モニタ207に表示される通信プログラム171を示す。
 図24を参照して、通信プログラム171は、エディタ処理(ステップS1)では、ユーザ操作に基づきClient-FB31の呼出命令310、Ping-FB34の呼出命令340、およびPub-FB33の呼出命令330がプログラム中に記述され、また、各呼出命令の位置に、当該呼出命令に対応のFBが配置される。
 通信プログラム171では、Client-FB31は入力変数Enableに値を設定するブロック311が接続されて、Ping-FB34は入力変数Executeに値を設定するブロック311および341が接続されて、Pub-FB33は入力変数Executeに値を設定するブロック311および331が接続される。
 ブロック331は、スケジューラ160によって制御周期毎にオンに設定される。ブロック331がオンに設定されると、ブロック331の出力を受けるClient-FB31の変数EnableはHighに立ち上げり、応じてClient-FB31は処理を開始する。
 ブロック341は、スケジューラ160によって、N制御周期毎にオンに設定される。したがって、ブロック331がオンに設定されて、且つブロック341がオンに設定されるタイミング、すなわちN制御周期毎に、ブロック341の出力を受けるPing-FB34の変数Executeのトリガが設定されて、Ping-FB34は当該トリガの入力に応じて起動されて、Pingコマンドの処理を開始する。
 ブロック331は、制御プログラムの出力、例えば制御データのパブリッシュの要求が出力されるとオンに設定される。したがって、このようにパブリッシュ条件が満たされると、ブロック331がオンに設定されて、且つブロック331がオンに設定されるタイミング、すなわち毎制御周期において制御プログラムからパブリッシュ要求が出力されたときに、ブロック331の出力を受けるPub-FB33の変数Executeのトリガが設定されて、Pub-FB33は当該トリガの入力に応じて起動されて、パブリッシュ処理を開始する。
 図25の通信プログラム171は、図24の通信プログラム171のPub-FB33をSub-FB32に変更しているが、他のプログラムは図24と同様なので説明は繰り返さない。図25を参照して、通信プログラム171のエディタ処理(ステップS1)では、ユーザ操作に基づきClient-FB31の呼出命令310、Ping-FB34の呼出命令340、およびSub-FB32の呼出命令320がプログラム中に記述され、また、各呼出命令の位置に、当該呼出命令に対応のFBが配置される。
 図25の通信プログラム171では、Sub-FB32は、入力変数Enableに値を設定するブロック311および321が接続される。ブロック321は、スケジューラ160によって制御周期毎にオンに設定される。したがって、ブロック311がオンに設定されて、且つブロック321がオンに設定されるタイミングで、Sub-FB32の変数EnableがHighに設定されて、Pub-FB33はサブスクライブ処理を開始する。
 <K.タスクの実行周期の一例>
 図26は、本実施の形態に係るPLCにおけるタスクの実行周期を模式的に示す図である。スケジューラ160は、タスク制御情報275に従い、図26に示すようにCPU110にタスクを実行させる。図26では、各制御周期Tにおいて、制御プログラムのタスク141が実行される。これにより、制御プログラムの定周期性は維持される。また、制御周期Tの空き時間において、通信プログラム171のClient-FB31とSub-FB32のタスク141と142は実行される。また、Pub-FB33にタスク143も毎制御周期の空き時間で起動されて、パブリッシュ条件が満たされたときのみ実行される。図26では、周期(n+2)においては、パブリッシュ条件は満たされていないので、タスク143は実行されないことが示される。
 また、スケジューラ160によって、Ping-FB34のタスク144は、その優先度133は低いことに基づき、たとえば2回の制御周期T毎に空き時間で1回実行される。図26では、周期n~周期n+3のうち周期(n+2)においてのみ実行されている。タスク144は、2回の制御周期T毎に実行されるので、Pub/Sub通信のためのネットワーク接続の監視処理のPing-FB34のタスク144を実行するとしても、制御プログラム、Client-FB31、Sub-FB32およびPub-FB33の定周期性は維持することができる。
 また、各制御周期Tで実行されるClient-FB31のタスクによってネットワーク接続の監視処理が実施されるので、Ping-FB34の監視処理が、N回の制御周期Tあたり1回実行されるとしても、各制御周期Tにおいて、当該監視処理を実施することを保証できる。
 また、制御プログラムを含むユーザプログラムによってパブリッシュが要求されるときは、ユーザプログラムは、Ping-FB34を起動するよう構成されてもよい。この起動後、ユーザプログラムは、Ping-FB34の出力変数Errorに基づき、ネットワークの健全性が担保されていると判定したとき、パブリッシュのメッセージを送信するように、Pub-FB33を起動するよう構成されてもよい。例えば、ネットワークのトラフィックが多量である場合はPing-FB34はタイムアウトを検出し、変数ErrorにTRUEを設定する。
 上記のパブリッシュ条件は、Ping-FB34の変数Errorの値に基づき、ネットワークが健全であることが検出されたとの条件を含み得る。ネットワークの健全性を含むパブリッシュ条件が満たされるとき、ユーザプログラムは、パブリッシュのメッセージを送信するようPub-FB33を起動できるから、確実なメッセージ送信を可能にするタイミング選択の自由度を得ることができる。本実施の形態では、この利点は、起動型のPing-FB34が、Client-FB31のネットワークの接続監視機能とは独立した当該監視機能を提供していることにより取得され得る。
 <L.プログラムおよび記録媒体>
 本実施の形態に示した通信プログラム171を含むアプリケーションプログラム170の開発支援環境を提供する開発支援プログラム250は、サポート装置200の記憶部201に格納されている。CPU202は、記憶部201から開発支援プログラム250を読出し、実行することにより、本実施の形態に示す開発環境を実現することが可能となる。
 開発支援プログラム250は、サポート装置200に付属するフレキシブルディスク、CD-ROM(Compact Disk-Read Only Memory)300、ROM、RAMなどの記録媒体を含むコンピュータ読取り可能な記録媒体にて記録させて、プログラム製品として提供することもできる。記録媒体は、コンピュータその他装置、機械等が記録されたプログラム等の情報を読み取り可能なように、当該プログラム等の情報を、電気的、磁気的、光学的、機械的または化学的作用によって蓄積する媒体である。
 また、開発支援プログラム250は、サポート装置200に内蔵するHDD204などの記録媒体にて記録させて、プログラムを提供することもできる。また、ネットワークから通信インターフェイスを介したダウンロードによって、プログラムを提供することもできる。
 <M.付記>
 上述したような本実施の形態は、以下のような技術思想を含む。
[構成1]
 対象(6,7)を制御する制御装置(PLC)で実行されるアプリケーションプログラム(170)を構成する単位プログラムを格納するライブラリ(245)を備える情報処理装置(200)であって、
 前記制御装置は、サーバ(300)にネットワーク接続され、
 前記ライブラリの前記単位プログラムは、前記アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラム(171)を構成する単位プログラム(31,32,33,34)を含み、
 前記通信プログラムを構成する単位プログラムは、
 前記制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラム(33)と、
 前記制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラム(32)と、
 前記ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラム(34)と、
 各前記単位プログラムからの前記メッセージの送信要求を、前記ネットワークを介して前記サーバに送信するクライアントの単位プログラム(31)と、を含み、
 前記情報処理装置は、さらに、
 当該情報処理装置に対するユーザ操作を受付ける操作受付手段(205、206)と、
 前記操作受付手段によって受付けられたユーザ操作に基づき、前記通信プログラムを構成する各単位プログラムの呼出命令を含む前記アプリケーションプログラムを作成する手段(252)を備える、情報処理装置。
[構成2]
 前記通信プログラムの各単位プログラムについて、制御周期において、他の単位プログラムよりも優先して実行される優先度(132)を設定する手段(255)を、さらに備える、構成1に記載の情報処理装置。
[構成3]
 前記通信プログラムのうち、少なくとも前記クライアントの単位プログラムは、他の単位プログラムよりも前記優先度を高く設定する、構成2に記載の情報処理装置。
[構成4]
 前記接続監視の単位プログラムの前記優先度は、当該単位プログラムはN回の制御周期(T)毎に実行されることを示す、構成2または3に記載の情報処理装置。
[構成5]
 前記クライアントの単位プログラムは、前記ネットワーク接続を監視するための命令コードを含む、構成1から4のいずれか1に記載の情報処理装置。
[構成6]
 前記サーバは、MQTT(Message Queuing Telemetry Transport)のメッセージ配信サーバを含む、構成1から5のいずれか1に記載の情報処理装置。
[構成7]
 複数の前記制御装置(PLC1,PLC2,PLC3)が前記サーバにネットワーク接続され、
 前記複数の制御装置は、分散制御により前記対象を制御するよう構成される、構成1から6のいずれか1に記載の情報処理装置。
[構成8]
 前記接続監視の単位プログラムは、前記ピングコマンドメッセージの送信要求を出力してから応答を受信するまでの時間を計測する、構成1から7のいずれか1に記載の情報処理装置。
[構成9]
 対象(6,7)を制御する制御装置(PLC)で実行されるアプリケーションプログラム(170)を構成する単位プログラムを格納するライブラリ(245)を備える情報処理装置(200)おけるプログラム開発支援方法であって、
 前記制御装置は、サーバ(300)にネットワーク接続され、
 前記ライブラリの前記単位プログラムは、前記アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラム(171)を構成する単位プログラムを含み、
 前記通信プログラムを構成する単位プログラムは、
 前記制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラム(33)と、
 前記制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラムと、
 前記ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラム(34)と、
 各前記単位プログラムからの前記メッセージの送信要求を、前記ネットワークを介して前記サーバに送信するクライアントの単位プログラム(31)と、を含み、
 前記プログラム開発支援方法は、
 ユーザ操作を受付けるステップと、
 受付けられたユーザ操作に基づき、前記通信プログラムを構成する各単位プログラムの呼出命令を含む前記アプリケーションプログラムを作成するステップと、を備える、プログラム開発支援方法。
[構成10]
 構成9に記載のプログラム開発支援方法をプロセッサに実行させるための開発支援プログラム(250)。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 システム、6 入出力装置、7 アクチュエータ、10 処理ユニット、11 システムバス、12 電源ユニット、26 MQTTライブラリ、70 基本構成、70A,70B,70C,ID パケット、71 固定ヘッダ、72 可変ヘッダ、73 ペイロード、100 プロセッサ、132 タスク名、133 優先度、134 実行条件、141,142,143,144 タスク、160 スケジューラ、170 アプリケーションプログラム、171 通信プログラム、191 マルチタスク実行部、200 サポート装置、211 転送モジュール、212 コンパイラ、213 デバッガ、214 シミュレータ、215 ビルダ、250 開発支援プログラム、252 エディタ、271 ソースプログラム、272 ソースコード、273 実行可能プログラム、275 タスク制御情報、300 サーバ、310,320,330,340 呼出命令、400,410 ネットワーク、SD クライアント状態、SR データ送信要求、T 制御周期。

Claims (10)

  1.  対象を制御する制御装置で実行されるアプリケーションプログラムを構成する単位プログラムを格納するライブラリを備える情報処理装置であって、
     前記制御装置は、サーバにネットワーク接続され、
     前記ライブラリの前記単位プログラムは、前記アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラムを構成する単位プログラムを含み、
     前記通信プログラムを構成する単位プログラムは、
     前記制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラムと、
     前記制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラムと、
     前記ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラムと、
     各前記単位プログラムからの前記メッセージの送信要求を、前記ネットワークを介して前記サーバに送信するクライアントの単位プログラムと、を含み、
     前記情報処理装置は、さらに、
     当該情報処理装置に対するユーザ操作を受付ける操作受付手段と、
     前記操作受付手段によって受付けられたユーザ操作に基づき、前記通信プログラムを構成する各単位プログラムの呼出命令を含む前記アプリケーションプログラムを作成する手段を備える、情報処理装置。
  2.  前記通信プログラムの各単位プログラムについて、制御周期において、他の単位プログラムよりも優先して実行される優先度を設定する手段を、さらに備える、請求項1に記載の情報処理装置。
  3.  前記通信プログラムのうち、少なくとも前記クライアントの単位プログラムは、他の単位プログラムよりも前記優先度を高く設定する、請求項2に記載の情報処理装置。
  4.  前記接続監視の単位プログラムの前記優先度は、当該単位プログラムはN回の制御周期毎に実行されることを示す、請求項2または3に記載の情報処理装置。
  5.  前記クライアントの単位プログラムは、前記ネットワーク接続を監視するための命令コードを含む、請求項1から4のいずれか1項に記載の情報処理装置。
  6.  前記サーバは、MQTT(Message Queuing Telemetry Transport)のメッセージ配信サーバを含む、請求項1から5のいずれか1項に記載の情報処理装置。
  7.  複数の前記制御装置が前記サーバにネットワーク接続され、
     前記複数の制御装置は、分散制御により前記対象を制御するよう構成される、請求項1から6のいずれか1項に記載の情報処理装置。
  8.  前記接続監視の単位プログラムは、前記ピングコマンドメッセージの送信要求を出力してから応答を受信するまでの時間を計測する、請求項1から7のいずれか1項に記載の情報処理装置。
  9.  対象を制御する制御装置で実行されるアプリケーションプログラムを構成する単位プログラムを格納するライブラリを備える情報処理装置おけるプログラム開発支援方法であって、
     前記制御装置は、サーバにネットワーク接続され、
     前記ライブラリの前記単位プログラムは、前記アプリケーションプログラムに含まれるパブリッシュ/サブスクライブ方式の通信プログラムを構成する単位プログラムを含み、
     前記通信プログラムを構成する単位プログラムは、
     前記制御に関するデータのパブリッシュメッセージの送信要求を出力するパブリッシャの単位プログラムと、
     前記制御に関するデータのサブスクライブメッセージの送信要求を出力するサブスクライバの単位プログラムと、
     前記ネットワーク接続を監視するピングコマンドメッセージの送信要求を出力する接続監視の単位プログラムと、
     各前記単位プログラムからの前記メッセージの送信要求を、前記ネットワークを介して前記サーバに送信するクライアントの単位プログラムと、を含み、
     前記プログラム開発支援方法は、
     ユーザ操作を受付けるステップと、
     受付けられたユーザ操作に基づき、前記通信プログラムを構成する各単位プログラムの呼出命令を含む前記アプリケーションプログラムを作成するステップと、を備える、プログラム開発支援方法。
  10.  請求項9に記載のプログラム開発支援方法をプロセッサに実行させるための開発支援プログラム。
PCT/JP2022/016759 2021-04-28 2022-03-31 情報処理装置、方法およびプログラム WO2022230611A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021076108A JP2022170173A (ja) 2021-04-28 2021-04-28 情報処理装置、方法およびプログラム
JP2021-076108 2021-04-28

Publications (1)

Publication Number Publication Date
WO2022230611A1 true WO2022230611A1 (ja) 2022-11-03

Family

ID=83847433

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/016759 WO2022230611A1 (ja) 2021-04-28 2022-03-31 情報処理装置、方法およびプログラム

Country Status (2)

Country Link
JP (1) JP2022170173A (ja)
WO (1) WO2022230611A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005202926A (ja) * 2003-10-23 2005-07-28 Microsoft Corp 拡張可能リアルタイムコラボレーションシステムのアーキテクチャ
US20160283256A1 (en) * 2015-03-23 2016-09-29 Societal Innovations Ipco Limited System and method for configuring a platform instance at runtime
JP2019080164A (ja) * 2017-10-24 2019-05-23 オムロン株式会社 通信システム、制御装置、設定装置、設定方法およびプログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005202926A (ja) * 2003-10-23 2005-07-28 Microsoft Corp 拡張可能リアルタイムコラボレーションシステムのアーキテクチャ
US20160283256A1 (en) * 2015-03-23 2016-09-29 Societal Innovations Ipco Limited System and method for configuring a platform instance at runtime
JP2019080164A (ja) * 2017-10-24 2019-05-23 オムロン株式会社 通信システム、制御装置、設定装置、設定方法およびプログラム

Also Published As

Publication number Publication date
JP2022170173A (ja) 2022-11-10

Similar Documents

Publication Publication Date Title
US9618924B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
JP4894961B1 (ja) Plcのcpuユニット、plc用システムプログラムおよびplc用システムプログラムを格納した記録媒体
JP6540166B2 (ja) 制御装置
JP5942446B2 (ja) サポート装置およびサポートプログラム
US7830798B2 (en) Determining of telegram lengths
JP6488830B2 (ja) 制御装置
CN110456707B (zh) 控制装置
WO2015136960A1 (ja) コントローラ
JP6299064B2 (ja) 制御装置、制御方法、およびプログラム
US10877803B2 (en) Control apparatus, control method and non-transitory storage medium
JP7000686B2 (ja) 制御装置
JP6729746B2 (ja) 制御装置
JP6996257B2 (ja) 制御装置、制御方法、およびプログラム
US9568905B2 (en) CPU of PLC, system program for PLC, and recording medium storing system program for PLC
JP6362821B2 (ja) 制御装置、制御方法および命令セット
WO2022230611A1 (ja) 情報処理装置、方法およびプログラム
JP6135247B2 (ja) 情報処理装置および情報処理プログラム
KR101212781B1 (ko) 로봇 통합용접제어 시스템
JP2007221364A (ja) コントローラ、制御システム及び制御装置の拡張方法
CN104076717A (zh) 一种对可编程控制器进行控制和监控的方法
US20210109948A1 (en) Method of visualizing screen content on a data visualization system, and data visualization system for visualizing screen content
WO2022254953A1 (ja) 制御システムおよび制御方法
JP2022180157A (ja) 制御装置、ロギング方法およびプログラム
JP2016157158A (ja) コントローラ
JP2023125352A (ja) シミュレーションシステム、方法およびシミュレーションプログラム

Legal Events

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

Ref document number: 22795527

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22795527

Country of ref document: EP

Kind code of ref document: A1