Processing method, program, and processing system
Patent Information
- Application Number
- PCT/JP2024/027508
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-05
- Filing Date
- 2024-08-01
- Publication Date
- 2025-03-13
Smart Images

Figure JP2024027508_13032025_PF_FP_ABST
Abstract
Description
Processing method, program, and processing system
[0001] The present disclosure relates to a processing method, a program, and a processing system, and more particularly to a processing method, a program, and a processing system for inputting and outputting data to and from an external device.
[0002] Japanese Patent Laid-Open No. 2006-129994 discloses a control device including a processor that executes multiple tasks and a multitasking execution unit that causes the processor to execute the tasks in an order based on the priority of each task. The control device is connected to a group of field devices via a first field network. The control device periodically performs an I / O refresh process (data update process) that includes a process of acquiring input data from the group of field devices (input process) and a process of outputting output data to the group of field devices (output process).
[0003] The control device described in Patent Document 1 performs I / O refresh processing at predetermined intervals, which has the problem of low flexibility in the timing of executing I / O refresh processing (data update processing).
[0004] Japanese Patent Application Laid-Open No. 2018-181315
[0005] An object of the present disclosure is to provide a processing method, a program, and a processing system that can increase the degree of freedom in the timing of executing data update processing.
[0006] A processing method according to one aspect of the present disclosure is a processing method for a processing system including an interface unit that performs at least one of data input and output, and a processing unit. The processing method includes task processing for executing multiple types of tasks and data update processing. The multiple types of tasks include tasks that process data stored in input variables and store the processing results in output variables. The data update processing executes at least one of input processing for storing data input to the interface unit in the input variables and output processing for outputting data of the output variables to the interface unit. The processing method executes the data update processing at least either before or after execution of a target task to which the data update processing is assigned from the multiple types of tasks, based on assignment information related to the target task.
[0007] A program according to one aspect of the present disclosure is a program for causing a computer system to execute the processing method.
[0008] A processing system according to one aspect of the present disclosure includes an interface unit that performs at least one of data input and output, and a processing unit. The processing unit executes task processing for executing a plurality of types of tasks and data update processing. The plurality of types of tasks includes a task for processing data stored in input variables and storing the processing results in output variables. The data update processing executes at least one of input processing for storing data input to the interface unit in input variables and output processing for outputting data of output variables from the interface unit to an external device. The processing unit executes the data update processing at least one of before and after execution of a target task to which the data update processing is assigned from the plurality of types of tasks, based on assignment information related to the target task.
[0009] FIG. 1 is a schematic system configuration diagram of a processing system according to an embodiment of the present disclosure. FIG. 2 is a time chart showing an operation example 1 of the processing system according to the embodiment. FIG. 3 is a time chart showing an operation example 2 of the processing system according to the embodiment. FIG. 4 is a time chart showing an operation example 3 of the processing system according to the embodiment. FIG. 5 is a time chart showing an operation example 1 of the processing system according to Modification 1. FIG. 6 is a time chart showing an operation example 2 of the processing system according to Modification 1. FIG. 7 is a time chart showing an operation example 3 of the processing system according to Modification 1. FIG. 8 is a time chart showing an operation example of the processing system according to Modification 2. FIG. 9 is a time chart showing an operation example of the processing system according to Modification 2. FIG. 10 is a time chart showing an operation example of the processing system according to Modification 2. FIG. 11 is a time chart showing an operation example of the processing system according to Modification 3.
[0010] Hereinafter, a processing system and a processing method thereof according to an embodiment will be described in detail with reference to the drawings. However, the configurations described in the following embodiments are merely examples of the present disclosure. The present disclosure is not limited to the following embodiments, and various modifications are possible depending on the design, etc., as long as the effects of the present disclosure can be achieved.
[0011] (Embodiment) (1) Overview The processing system 1 according to this embodiment includes an interface unit (in this embodiment, for example, an I / O unit 70 including an input / output unit 20 and a remote I / O unit 30, and a communication unit 40) and a processing unit 11.
[0012] The interface unit performs at least one of input and output of data.
[0013] The processing unit 11 executes task processing for executing a plurality of types of tasks and data update processing (so-called I / O refresh processing).
[0014] The multiple types of tasks include a task that processes data stored in an input variable and stores the processing result in an output variable.
[0015] The data update process includes at least one of an input process (so-called IN refresh process) in which data input to the interface unit is stored in an input variable, and an output process (so-called OUT refresh process) in which data of an output variable is output to the interface unit.
[0016] The processing unit 11 executes the data update processing at least either before or after the execution of the target task based on assignment information relating to the target task to which the data update processing is assigned from among a plurality of types of tasks.
[0017] Here, the data update process executes at least one of an input process for fetching data input to the interface unit into input variables and an output process for outputting data of output variables to the interface unit. The interface unit includes, for example, at least one of an I / O unit 70 having a plurality of terminals and performing at least one of inputting and outputting data via the plurality of terminals, and a communication unit 40 performing at least one of inputting and outputting data by performing data communication with an external device using a predetermined communication method.
[0018] In the processing system 1 of this embodiment, the processing unit 11 executes the data update processing at least either before or after the execution of a target task to which the data update processing is assigned based on the allocation information. Therefore, in the processing system 1 of this embodiment, the data update processing can be executed at least either before or after the execution of a desired task, thereby increasing the degree of freedom in the timing of executing the data update processing. For example, the processing unit 11 preferably executes the data update processing at least either immediately before the execution of the target task or immediately after the execution of the target task, and the target task and the data update processing are executed consecutively.
[0019] (2) Details The processing system 1 according to the embodiment and the processing method thereof will be described in detail below with reference to the drawings.
[0020] (2.1) Configuration The processing system 1 of this embodiment is applied to a control system using a PLC (Programmable Logic Controller) that controls equipment to be controlled (e.g., a motor) in accordance with a control program created in advance, for example, in a factory.
[0021] 1, the processing system 1 includes a CPU unit 10, a plurality of (e.g., three) input / output units 20, an HLS master unit 31, and a communication unit 40. The CPU unit 10, the plurality of input / output units 20 each having a plurality of terminals, the HLS master unit 31, and the communication unit 40 are configured to be connectable, for example, side-by-side. When the CPU unit 10, the plurality of input / output units 20, the HLS master unit 31, and the communication unit 40 are connected, the units are connected via an internal bus BS1. The CPU unit 10, the plurality of input / output units 20, the HLS master unit 31, and the communication unit 40 are configured to be able to communicate with each other via the internal bus BS1.
[0022] Furthermore, a plurality of (e.g., three) HLS slave units 32 are connected to the HLS master unit 31 via a communication line L1. Each of the plurality of HLS slave units 32 includes an input terminal section 322 having a plurality of input terminals and an output terminal section 323 having a plurality of output terminals. The HLS master unit 31 communicates with each of the plurality of HLS slave units 32, thereby performing input processing of the input terminal section 322 and output processing of the output terminal section 323 of each of the plurality of HLS slave units 32. Here, the HLS master unit 31 and the plurality of HLS slave units 32 constitute a remote I / O unit 30. The HLS master unit 31 has the function of remotely performing input processing and output processing of the input terminal section 322 and output terminal section 323 of each of the plurality of HLS slave units 32.
[0023] The processing system 1 of this embodiment includes, as the I / O unit 70, an input / output unit 20 connected to the CPU unit 10 directly or via another unit, and a remote I / O unit 30 configured of an HLS master unit 31 and an HLS slave unit 32. It is not essential that the processing system 1 includes both the input / output unit 20 and the remote I / O unit 30 as the I / O unit 70, and the processing system 1 may include only one of the input / output unit 20 and the remote I / O unit 30.
[0024] A scanner 41 and an adapter 42 are also connected to the communication unit 40 via a communication line L2. By communicating with each of the scanner 41 and the adapter 42, the communication unit 40 can perform at least one of the following processes: acquiring data from each of the scanner 41 and the adapter 42, and transmitting data to each of the scanner 41 and the adapter 42. The scanner 41 is a communication device that functions as a master in a master-slave system, and the adapter 42 is a communication device that functions as a scanner in the master-slave system.
[0025] The processing system 1 of this embodiment includes an I / O unit 70 (including, for example, an input / output unit 20 and a remote I / O unit 30) and a communication unit 40 as an interface section that performs at least one of inputting and outputting data.
[0026] Furthermore, a setting terminal 50 used to create a control program to be stored in the CPU unit 10 is detachably connected to the CPU unit 10 via a communication line L3.
[0027] The configuration of each part of the processing system 1 will be described below with reference to the drawings, etc. In the following description, when the multiple input / output units 20 are described separately, they will be referred to as input / output units 20A, 20B, 20C, etc. In addition, when the multiple HLS slave units 32 are described separately, they will be referred to as HLS slave units 32A, 32B, 32C, etc. In addition, multiple adapters 42 are connected to the communication unit 40 via communication line L2, and when the multiple adapters 42 are described separately, they will be referred to as adapters 42A, 42B, etc. In addition, although only one scanner 41 is connected to the communication unit 40 via communication line L2 in FIG. 1, multiple scanners 41 may be connected.
[0028] (2.1.1) CPU Unit The CPU unit 10 includes a processing unit 11 , a storage unit 12 , and a communication unit 13 .
[0029] The storage unit 12 includes a nonvolatile memory such as an EEPROM (Electrically Erasable and Programmable Read-Only Memory). The storage unit 12 stores, for example, a ladder program created by the setting terminal 50 and a control program obtained by compiling the ladder program. The storage unit 12 also has storage areas for a plurality of input variables that store data acquired by input processing (also referred to as input data) and a plurality of output variables that store data output from the interface unit to the outside (also referred to as output data). The input variables are assigned variable names such as WIn (n is a natural number), and the output variables are assigned variable names such as WOm (m is a natural number).
[0030] The setting terminal 50 is detachably connected to the communication unit 13 via a communication line L3. The communication unit 13 has a communication module that communicates using a serial communication method such as RS485 or USB, and exchanges data with the setting terminal 50.
[0031] The processing unit 11 mainly comprises, for example, a computer system having one or more processors and a memory. The processor of the computer system executes a program recorded in the memory of the computer system, thereby realizing the functions of the processing unit 11. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0032] The processing unit 11 can exchange data with the input / output units 20A, 20B, and 20C, the HLS master unit 31, and the communication unit 40 via the internal bus BS1. The processing unit 11 can also exchange data with the setting terminal 50 via the communication unit 13.
[0033] The processing unit 11 executes task processing and data update processing.
[0034] The data update process includes at least one of an input process and an output process. In the input process, data input from an external device to the interface unit is stored in the input variable WIn. In the output process, data of the output variable WOm is output from the interface unit to the external device. As described above, the processing system 1 of this embodiment includes, as interface units, input / output units 20A, 20B, and 20C, a remote I / O unit 30, and a communication unit 40. Therefore, the storage unit 12 is provided with storage areas for a plurality of input variables WIn that respectively store data acquired from a plurality of input terminals provided in the input terminal units 22 of the plurality of input / output units 20 and a plurality of input terminals provided in the input terminal units 322 of the plurality of HLS slave units 32, as well as received data received by the communication unit 40 from the scanner 41 or the adapter 42. In addition, the memory unit 12 has memory areas for a plurality of output variables WOm that respectively store data to be output to a plurality of output terminals provided by the output terminal sections 23 of a plurality of input / output units 20, and a plurality of output terminals provided by the output terminal sections 323 of a plurality of HLS slave units 32, as well as transmission data that the communication unit 40 sends to the scanner 41 and adapter 42.
[0035] Task processing is processing that executes multiple types of tasks. The processing unit 11 is capable of multitasking processing, which executes multiple types of tasks in parallel. The multiple types of tasks include, for example, at least one task that reads data stored in an input variable WIn by input processing, performs predetermined processing, and then stores the processing result in an output variable WOm. The data stored in the output variable WOm is output from the interface unit to an external device by performing output processing.
[0036] Here, the tasks executed by the processing unit 11 are classified into four types, for example, a primary task, a periodic task, an event task, and a system task.
[0037] The primary task is a basic task among a plurality of types of tasks executed by the processing unit 11. The processing unit 11 executes the primary task at regular intervals or repeatedly without interruption.
[0038] The periodic task is a process that the processing unit 11 repeatedly executes at a preset period.
[0039] An event task is a task that is executed by the processing unit 11 when a predetermined event occurs.
[0040] The system task is a task that is executed when the CPU unit 10 is started up or when an error occurs in the CPU unit 10 .
[0041] Thus, in this embodiment, task processing is processing for executing a plurality of types of tasks, and assignment information for assigning a target task for executing data update processing from the plurality of types of tasks is input to the CPU unit 10 by the setting terminal 50. If the task to be executed in task processing is a target task assigned to execute data update processing, the processing unit 11 of the CPU unit 10 executes the data update processing at least either before or after execution of the target task.
[0042] Priorities may be set for multiple types of tasks, and when an execution request to execute multiple tasks simultaneously occurs, the processing unit 11 executes the multiple tasks in descending order of priority.
[0043] (2.1.2) Input / Output Units Since the input / output units 20A to 20C have the same configuration, the input / output unit 20A will be used as an example for explanation, and illustration and explanation of the input / output units 20B and 20C will be omitted.
[0044] The input / output unit 20A includes a processing unit 21, an input terminal unit 22, and an output terminal unit 23.
[0045] The input terminal unit 22 includes multiple input terminals (e.g., 32 terminals). Each of the multiple input terminals of the input terminal unit 22 can receive an input signal from an external device. The multiple input terminals of the input terminal unit 22 are divided into multiple input terminal groups, for example, in units of one word, and each of the multiple input terminal groups is assigned a terminal number, for example, WXn (n is a natural number). When the processing unit 11 is configured to perform a predetermined process using data from multiple input variables corresponding to a predetermined input terminal group and store the process results in multiple output variables corresponding to a predetermined output terminal group, the processing unit 11 simply performs input processing to import data from the predetermined input terminal group and performs output processing to output data from multiple output variables that store the process results to the predetermined output terminal group. For example, when the processing unit 11 performs a predetermined process using data from one word of input variables and stores the process results in one word of output variables, the processing unit 11 stores the data input to the input terminal group in one word of input variables and outputs data from one word of output variables to the output terminal group. This eliminates data update processing for unnecessary terminals and reduces the processing load of the data update processing.
[0046] The output terminal unit 23 includes a plurality of output terminals (e.g., 32 terminals). The output format of the output terminal unit 23 is, for example, a transistor output system. Each of the plurality of output terminals included in the output terminal unit 23 can be connected to an external device, and output signals are output from the plurality of output terminals to the external device. The plurality of output terminals included in the output terminal unit 23 are divided into a plurality of output terminal groups, for example, in units of one word, and each of the plurality of output terminal groups is assigned a terminal number, for example, WYm (m is a natural number).
[0047] The processing unit 21 mainly comprises, for example, a computer system having one or more processors and a memory. The functions of the processing unit 21 are realized by the processor of the computer system executing a program recorded in the memory of the computer system. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0048] The processing unit 21 can send and receive commands and data to and from the processing unit 11 of the CPU unit 10 via the internal bus BS1.
[0049] In response to a data input request from the CPU unit 10, the processing unit 21 performs processing to output data input to multiple input terminals of the input terminal unit 22 to the CPU unit 10. The CPU unit 10 stores data input from the input / output unit 20A in input variables WIn corresponding to the input terminals of the input terminal unit 22. In response to a data input request from the CPU unit 10, the processing unit 21 may output data from all input terminals of the input terminal unit 22 to the CPU unit 10, or may output data from only a portion (e.g., word-by-word or bit-by-bit) of the input terminals to the CPU unit 10. The processing unit 21 simply performs input processing to import data from input terminals with a number of bits corresponding to the input variables used in the target task, and output processing to output data to output terminals with a number of bits corresponding to the output variables that store the processing results of the target task, thereby reducing the processing load required for data update processing. For example, when the CPU unit 10 inputs a data input request to the processing unit 21 requesting data from a specific input terminal group WXn, the processing unit 21 simply performs processing to output the data from the specified input terminal group WXn to the CPU unit 10.
[0050] In response to a data output request from the CPU unit 10, the processing unit 21 performs processing to output data of the output variable WOm to the output terminal of the output terminal unit 23 corresponding to the output variable WOm. Note that in response to a data output request from the CPU unit 10, the processing unit 21 may output data of the output variable WOm corresponding to all output terminals provided in the output terminal unit 23, or may output data of the output variable WOm corresponding to a portion (for example, word-by-word or bit-by-bit) of the output terminals. For example, when a data output request to output data to a specific output terminal group WYm is input from the CPU unit 10 to the processing unit 21, the processing unit 21 may perform processing to output the data of the output variable WOm to the specific output terminal group WYm.
[0051] (2.1.3) Remote I / O Unit The remote I / O unit 30 includes an HLS master unit 31 connected to the CPU unit 10 via an internal bus BS1, and one or more HLS slave units 32 connected to the HLS master unit 31 via a communication line L1 in a multi-drop system. In the example of Fig. 1, three HLS slave units 32A, 32B, and 32C are connected to the HLS master unit 31.
[0052] <HLS Slave Unit> The HLS slave unit 32 includes a processing unit 321 , an input terminal unit 322 , an output terminal unit 323 , and a communication unit 324 .
[0053] The input terminal unit 322 includes a plurality of input terminals (e.g., 32 terminals). Input signals from external devices can be input to each of the plurality of input terminals included in the input terminal unit 322. The plurality of input terminals included in the input terminal unit 322 are divided into a plurality of input terminal groups, for example, in units of one word, and each of the plurality of input terminal groups is assigned a terminal number, for example, WXn (n is a natural number). Here, the plurality of input terminal groups included in the input terminal unit 322 and the plurality of input terminal groups included in the input terminal unit 22 of the input / output unit 20 are assigned a unique terminal number WXn.
[0054] The output terminal unit 323 includes multiple (e.g., 32) output terminals. The output format of the output terminal unit 323 is, for example, relay contact output. Each of the multiple output terminals included in the output terminal unit 323 can be connected to an external device, and output signals are output from the multiple output terminals to the external device. The multiple output terminals included in the output terminal unit 323 are divided into multiple output terminal groups, for example, in units of one word, and each of the multiple output terminal groups is assigned a terminal number, for example, WYm (m is a natural number). Here, the multiple input terminal groups included in the output terminal unit 323 and the multiple output terminal groups included in the output terminal unit 23 of the input / output unit 20 are assigned a unique terminal number WYm.
[0055] The communication unit 324 communicates with the HLS master unit 31 using a communication method conforming to the High-Speed Link System (HLS) method, for example. The HLS master unit 31 and the HLS slave unit 32 communicate using a master-slave method, with the HLS master unit 31 acting as the master and the HLS slave unit 32 acting as the slave.
[0056] The processing unit 321 is mainly composed of, for example, a computer system having one or more processors and a memory. The functions of the processing unit 321 are realized by the processor of the computer system executing a program recorded in the memory of the computer system. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0057] When the communication unit 324 receives an input request from the HLS master unit 31, the processing unit 321 causes the communication unit 324 to transmit data of an input terminal specified in the input request from among the multiple input terminals of the input terminal unit 322 to the HLS master unit 31. In response to the input request from the HLS master unit 31, the processing unit 321 may output data of all input terminals of the input terminal unit 322 to the HLS master unit 31, or may output data of some (for example, word-by-word or bit-by-bit) of the input terminals to the HLS master unit 31. For example, when an input request requesting data of a specific input terminal group WXn is input from the HLS master unit 31 to the HLS slave unit 32, the processing unit 321 may perform processing to output the data of the specified input terminal group WXn to the HLS master unit 31 from the communication unit 324.
[0058] When the communication unit 324 receives an output request from the HLS master unit 31, the processing unit 321 performs processing to output data from the output terminal of the output terminal unit 323. Here, the output request from the HLS master unit 31 includes data of the output variable WOm. In response to the output request from the HLS master unit 31, the processing unit 321 performs processing to output the data of the output variable WOm from the corresponding output terminal. In response to the output request from the HLS master unit 31, the processing unit 321 may output the data of the output variable WOm corresponding to all output terminals of the output terminal unit 323, or may output the data of the output variable WOm corresponding to a portion of the output terminals (for example, word-by-word or bit-by-bit). For example, when an output request to output data to a specific output terminal group WYm is input from the HLS master unit 31 to the HLS slave unit 32, the processing unit 321 may perform processing to output the data of the output variable WOm corresponding to the specified output terminal group WYm.
[0059] <HLS Master Unit> The HLS master unit 31 includes a processing unit 311 and a communication unit 312 .
[0060] The communication unit 312 communicates with the HLS slave unit 32 in a master-slave manner, for example, using a communication method conforming to the HLS method.
[0061] The processing unit 311 is mainly composed of, for example, a computer system having one or more processors and a memory. The functions of the processing unit 311 are realized by the processor of the computer system executing a program recorded in the memory of the computer system. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0062] The processing unit 311 can send and receive commands and data to and from the processing unit 11 of the CPU unit 10 via the internal bus BS1.
[0063] In response to a data input request from the CPU unit 10, the processing unit 311 outputs an input request to the HLS slave unit 32 requesting the transmission of data input to the input terminal unit 322. The data input request from the CPU unit 10 includes information on the input terminal from which data is to be acquired. In response to the data input request from the CPU unit 10, the processing unit 311 causes the communication unit 312 to transmit the input request to the HLS slave unit 32 having the input terminal from which data is to be acquired. When the communication unit 312 receives data transmitted from the HLS slave unit 32 in response to the input request, the processing unit 311 outputs the data received from the HLS slave unit 32 to the CPU unit 10. The CPU unit 10 stores the data input from the HLS master unit 31 in an input variable WIn corresponding to the input terminal of the input terminal unit 322. In response to a data input request from the CPU unit 10, the processing unit 311 may request the HLS slave unit 32 to transmit data from all of the input terminals of the input terminal unit 322, or may request the HLS slave unit 32 to transmit data from a portion of the input terminals (for example, in word units or bit units).
[0064] Furthermore, in response to a data output request from the CPU unit 10, the processing unit 311 outputs an output request to output data from an output terminal of the output terminal unit 323 included in the HLS slave unit 32. The data output request from the CPU unit 10 includes the output variable WOm to be output and the data stored in the output variable WOm. In response to the data output request from the CPU unit 10, the processing unit 311 causes the communication unit 312 to transmit the output request to the HLS slave unit 32 having the output terminal corresponding to the output variable WOm to be output. When the communication unit 324 of the HLS slave unit 32 receives the output request, the processing unit 321 controls the output transistor corresponding to the output variable WOm to be output, turning on or off, to output the output data stored in the output variable WOm. Note that in response to a data output request from the CPU unit 10, the processing unit 311 may output data from all output terminals included in the output terminal unit 323, or may output data from some of the output terminals (for example, in word units or bit units).
[0065] (2.1.4) Communication Unit The communication unit 40 includes a processing unit 401 and a communication unit 402 .
[0066] The communication unit 402 is connected to the scanner 41 and the adapter 42 via a communication line L2. The communication unit 402 performs communication using a communication method that complies with the Ethernet (registered trademark) standard, for example.
[0067] In communication between the communication unit 402 and the adapter 42, the adapter 42 operates as a slave in a master-slave system, and the communication unit 402 operates as a master in the master-slave system. The communication unit 402 transmits commands to the adapter 42 periodically or irregularly. When the adapter 42 receives a command from the communication unit 402, it transmits a response signal to the communication unit 402.
[0068] In communication between the communication unit 402 and the scanner 41, the scanner 41 operates as the master in a master-slave system, and the communication unit 402 operates as the slave in the master-slave system. The scanner 41 periodically or irregularly transmits commands to the communication unit 402. When the communication unit 402 receives a command from the scanner 41, it transmits a response signal to the scanner 41.
[0069] The processing unit 401 mainly comprises, for example, a computer system having one or more processors and a memory. The functions of the processing unit 401 are realized by the processor of the computer system executing a program recorded in the memory of the computer system. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0070] The processing unit 401 can send and receive commands and data to and from the processing unit 11 of the CPU unit 10 via the internal bus BS1.
[0071] When the processing unit 401 receives a data input request from the CPU unit 10, it outputs an input request from the communication unit 402 to the scanner 41 or the adapter 42 to request transmission of data.
[0072] When an input request is sent from the communication unit 402 to the scanner 41, upon receiving a command from the scanner 41, the communication unit 402 sends the input request to the scanner 41 in the form of a response to the command. Upon receiving the input request from the communication unit 402, the scanner 41 sends the data requested in the input request to the communication unit 402. When the communication unit 402 receives data from the scanner 41, the processing unit 401 outputs the received data to the CPU unit 10, and the CPU unit 10 stores the data input from the communication unit 402 in the corresponding input variable WIn.
[0073] When an input request is sent from the communication unit 402 to the adapter 42, the processing unit 401 causes the communication unit 402 to send the input request at a predetermined transmission timing to the adapter 42. When the adapter 42 receives the input request from the communication unit 402, it sends the data requested in the input request to the communication unit 402 in response to the input request. When the communication unit 402 receives data from the adapter 42, the processing unit 401 outputs the received data to the CPU unit 10, and the CPU unit 10 stores the data input from the communication unit 402 in the corresponding input variable WIn.
[0074] Furthermore, the processing unit 401 causes the communication unit 402 to transmit output data to the scanner 41 or the adapter 42 in response to a data output request from the CPU unit 10. When transmitting output data from the communication unit 402 to the scanner 41, upon receiving a command from the scanner 41, the communication unit 402 transmits the output data to the scanner 41 in response to this command. When transmitting output data from the communication unit 402 to the adapter 42, the processing unit 401 causes the communication unit 402 to transmit the output data to the adapter 42 at a predetermined transmission timing.
[0075] (2.1.5) Setting Terminal The setting terminal 50 is a computer terminal used to set, for example, a ladder program in the CPU unit 10. The setting terminal 50 may be a notebook-type personal computer or a tablet-type computer terminal.
[0076] Application software for creating programs such as ladder programs to be set in the CPU unit 10 is pre-installed on the setting terminal 50. A user can use the application software installed on the setting terminal 50 to create programs to be set in the CPU unit 10.
[0077] The setting terminal 50 includes a processing unit 51, a communication unit 52, a display unit 53, an input unit 54, a storage unit 55, and the like.
[0078] The processing unit 51 mainly comprises, for example, a computer system having one or more processors and a memory. The functions of the processing unit 51 are realized by the processor of the computer system executing a program recorded in the memory of the computer system. The program may be recorded in the memory, or may be provided via a telecommunications line such as the Internet, or may be recorded on a non-transitory recording medium such as a memory card and provided.
[0079] The communication unit 52 communicates with the communication unit 13 via the communication line L3.
[0080] The display unit 53 has a display device such as a liquid crystal display.
[0081] The input unit 54 includes input devices such as a keyboard, a mouse, a touchpad, etc. The display unit 53 and the input unit 54 may be realized by a touch panel display.
[0082] The storage unit 55 includes memories such as a read-only memory (ROM) and a random access memory (RAM). The storage unit 55 may also include an external storage device such as a solid-state drive (SSD). The storage unit 55 stores data such as ladder program data created by the user.
[0083] A user can create a program, such as a ladder program, to be set in the CPU unit 10 using application software installed on the setting terminal 50. When the setting terminal 50 and the CPU unit 10 are connected via communication line L3 and the user issues a transfer command on the setting terminal 50, the created ladder program is transferred from the setting terminal 50 to the CPU unit 10 and stored in the storage unit 12 of the CPU unit 10. When the processing unit 11 in the CPU unit 10 executes a compilation process for the ladder program, a control program is created by compiling the ladder program, and the created control program is stored in the storage unit 12. The processing unit 11 can execute the control program stored in the storage unit 12 to perform the above-described task processing and data update processing. After compiling the ladder program on the setting terminal 50, the compiled control program may be transferred from the setting terminal 50 to the CPU unit 10.
[0084] (2.2) Description of Operation The operation of the processing system 1 of this embodiment will be described with reference to Figures 2 to 4, etc. Note that Figures 2 to 4 are schematic timing charts of the tasks and data update processing executed by the processing unit 11 of the CPU unit 10, and the duration of the tasks and data update processing do not necessarily reflect the actual processing time. Note that when explaining the data update processing of the I / O unit 70 below, the input / output unit 20 will be used as an example. The data update processing of the remote I / O unit 30 is similar to the data update processing of the input / output unit 20 except that the HLS master unit 31 is interposed between the CPU unit 10 and the HLS slave unit 32, and therefore a description thereof will be omitted.
[0085] (2.2.1) Operation Example 1 An operation example 1 of the processing system 1 when allocating a target task that performs data update processing in units (for example, units such as the input / output unit 20 and the HLS slave unit 32) will be described with reference to FIG.
[0086] The CPU unit 10 executes a primary task PT at a fixed cycle T1, and executes an event task IT when a predetermined event occurs. In the example of Figure 2, the primary task PT is executed at times t1, t3, and t5, and the event task IT is executed at times t2 and t4 when the predetermined event occurs. Note that since the event task IT is executed when the predetermined event occurs, it is not guaranteed that it will be executed within one cycle of executing the primary task PT.
[0087] Here, the primary task PT is assumed to be created as a task that uses input data input to the group of input terminals WX0-WX9 of the input / output unit 20A and outputs the processing results to the group of output terminals WY0-WY9 of the input / output unit 20A. Also, the event task IT is assumed to be created as a task that uses input data input to the group of input terminals WX10-WX19 of the input / output unit 20B and outputs the processing results to the group of output terminals WY10-WY19 of the input / output unit 20B.
[0088] Therefore, the user uses the setting terminal 50 to set in the CPU unit 10 allocation information that assigns to the primary task PT an input process IN1 that reads input data from the group of input terminals WX0-WX9 of the input / output unit 20A and an output process OUT1 that outputs output data to the group of output terminals WY0-WY9. The user also uses the setting terminal 50 to set in the CPU unit 10 allocation information that assigns to the event task IT an input process IN2 that reads input data from the group of input terminals WX10-WX19 of the input / output unit 20B and an output process OUT2 that outputs output data to the group of output terminals WY10-WY19. Table 1 shows the allocation information for the data update processes that are assigned to the input / output units 20A and 20B.
[0089]
[0090] At this time, when executing the primary task PT, the processing unit 11 of the CPU unit 10 executes an input process IN1 that reads input data from the group of input terminals WX0-WX9 of the input / output unit 20A and stores the input data in the corresponding input variable WIn before executing the primary task PT. Then, after executing the primary task PT, the processing unit 11 executes an output process OUT1 that outputs data of the corresponding output variable WOm to the group of output terminals WY0-WY9 of the input / output unit 20A based on the processing result of the primary task PT.
[0091] Furthermore, when a predetermined event occurs, the processing unit 11 executes an event task IT, but before executing the event task IT, it executes an input process IN2 that reads input data from the input terminal group WX10-WX19 of the input / output unit 20B and stores the input data in the corresponding input variable WIn. After executing the event task IT, the processing unit 11 executes an output process OUT2 that outputs data of the corresponding output variable WOm to the output terminal group WY10-WY19 of the input / output unit 20B based on the processing result of the event task IT.
[0092] In this way, the input data of the input terminal group WX0-WX9 of the input / output unit 20A used by the primary task PT is acquired immediately before the primary task PT is executed, thereby improving the real-time performance of the data update process. Furthermore, when the primary task PT is executed, input processing of the input terminal group WX10-WX19 of the input / output unit 20B that is not used by the primary task PT is not performed, thereby reducing the time required for input processing.
[0093] Furthermore, the input data of the input terminal group WX10-WX19 of the input / output unit 20B used in the event task IT is acquired immediately before the event task IT is executed, thereby improving the real-time nature of the data update process. Furthermore, when the event task IT is executed, input processing of the input terminal group WX0-WX9 of the input / output unit 20A that is not used in the event task IT is not performed, thereby reducing the time required for input processing.
[0094] As described above, in this embodiment, the data update process includes both input processing and output processing, and the allocation information includes information regarding the target tasks to which each of the input processing and output processing is assigned. That is, the allocation information includes information regarding the target tasks to which the input processing is assigned and information regarding the target tasks to which the output processing is assigned. Note that the target tasks to which the input processing is assigned and the target tasks to which the output processing is assigned may be the same task or different tasks. In this embodiment, the allocation information can be used to set the target tasks to perform the input processing and the target tasks to perform the output processing, thereby increasing the degree of freedom in the timing at which the input processing and the output processing are each executed.
[0095] In this embodiment, the interface unit includes an I / O unit 70 having a plurality of terminals. The data update process related to the I / O unit 70 includes at least one of an input process for storing data input to at least some of the plurality of terminals in an input variable WIn, and an output process for outputting data of an output variable WOm to at least some of the plurality of terminals. Therefore, according to this embodiment, the input process for taking in data from the terminals of the I / O unit 70 and the output process for outputting data to the terminals of the I / O unit 70 can be executed at desired timing, thereby increasing the degree of freedom in the timing at which the input process and the output process are executed.
[0096] Furthermore, in this embodiment, the interface unit includes a plurality of I / O units 70, and the allocation information includes information for allocating a target task for executing data update processing to each of the plurality of I / O units 70. Therefore, a target task for executing data update processing can be set for each of the plurality of I / O units 70, so that data update processing can be executed at a desired timing for each I / O unit 70, thereby increasing the degree of freedom in the timing for executing data update processing.
[0097] In this embodiment, the multiple terminals of the I / O unit 70 are divided into multiple terminal groups (input terminal groups and output terminal groups) in units of a predetermined number of bits, and the assignment information includes information for assigning a target task for executing a data update process to each of the multiple terminal groups. Therefore, the data update process for each of the multiple terminal groups can be executed at a desired timing, increasing the degree of freedom in the timing for executing the data update process.
[0098] (2.2.2) Operation Example 2 An operation example 2 of the processing system 1 will be described with reference to Fig. 3. In operation example 2, when data input processing is assigned to a target task, a target task that performs input processing is assigned for each input terminal in a predetermined unit (for example, word unit). Also, in operation example 2, when data output processing is assigned to a target task, a target task that performs output processing is assigned for each output terminal in a predetermined unit (for example, word unit).
[0099] The processing unit 11 of the CPU unit 10 executes a primary task PT at a fixed cycle T1, and executes an event task IT when a predetermined event occurs. In the example of Figure 3, the primary task PT is executed at time t11, and the event task IT is executed at time t12 when the predetermined event occurs.
[0100] Here, the primary task PT is created to execute processing using input data from the input terminal group WX0 and WX1 of the input / output unit 20A, input data from the input terminal group WX10 of the input / output unit 20B, and input data from the input terminal group WX20, WX21, and WX22 of the input / output unit 20C. The primary task PT is also created to output the processing results to the output terminal group WY0 and WY1 of the input / output unit 20A, the output terminal group WY10, WY11, and WY12 of the input / output unit 20B, and the output terminal group WY22 of the input / output unit 20C, respectively.
[0101] Therefore, the user uses the setting terminal 50 to set in the CPU unit 10 allocation information that assigns to the primary task PT the input processes IN(WX0) and IN(WX1) that take in input data from the input terminal group WX0 and WX1 of the input / output unit 20A, the input process IN(WX10) that takes in input data from the input terminal group WX10 of the input / output unit 20B, and the input processes IN(WX20), IN(WX21), and IN(WX22) that take in input data from the input terminal group WX20, WX21, and WX22 of the input / output unit 20C. In addition, the user sets, using the setting terminal 50, allocation information in the CPU unit 10 that allocates to the primary task PT output processes OUT(WY0) and OUT(WY1) that output output data to the output terminal groups WY0 and WY1 of the input / output unit 20A, output processes OUT(WY10), OUT(WY11), and OUT(WY12) that output output data to the output terminal groups WY10, WY21, and WY22 of the input / output unit 20B, and output process OUT(WY22) that output output data to the output terminal group WY22 of the input / output unit 20C. Table 2 shows the allocation information for the data update processes allocated to the input / output units 20A, 20B, and 20C.
[0102]
[0103] At this time, when the processing unit 11 of the CPU unit 10 executes the primary task PT, before executing the primary task PT, it executes input processes IN(WX0) and IN(WX1) that take in input data from the input terminal group WX0 and WX1 of the input / output unit 20A, input process IN(WX10) that takes in input data from the input terminal group WX10 of the input / output unit 20B, and input processes IN(WX20), IN(WX21), and IN(WX22) that take in input data from the input terminal group WX20, WX21, and WX22 of the input / output unit 20C. Then, after executing the primary task PT, the processing unit 11 executes, based on the processing results of the primary task PT, output processes OUT(WY0) and OUT(WY1) that output output data to the output terminal group WY0 and WY1 of the input / output unit 20A, output processes OUT(WY10), OUT(WY11), and OUT(WY12) that output output data to the output terminal group WY10, WY11, and WY12 of the input / output unit 20B, and output process OUT(WY22) that output output data to the output terminal group WY22 of the input / output unit 20C.
[0104] Furthermore, when a predetermined event occurs, the processing unit 11 executes the event task IT, but in this case, the event task IT is designed as an internal processing task that does not involve input processing or output processing, so it is not a target task for input processing or output processing, and no data update processing is executed before or after the execution of the event task IT. Note that at least one of the input processing and the output processing may be assigned to the event task IT, and at least one of the input processing and the output processing assigned by the assignment information may be executed before or after the execution of the event task IT.
[0105] In this way, in operation example 2, among the multiple input terminals provided in input / output units 20A to 20C, input processing of the input terminal that uses input data in the target task is assigned to the target task on a word-by-word basis and executed, so the time required for input processing can be shortened compared to when input data is read from all input terminals, and the execution time of the control program can be shortened. Also, in operation example 2, among the multiple output terminals provided in input / output units 20A to 20C, output terminals that output output data based on the processing results of the target task are assigned to the target task on a word-by-word basis and executed, so the time required for output processing can be shortened compared to when output data is output to all output terminals.
[0106] In operation example 2, the input terminal for performing input processing in the target task is set in word units, but it may be set in bit units. Also, in operation example 2, the output terminal for performing output processing in the target task is set in word units, but it may be set in bit units or in units of a predetermined number of bits.
[0107] (2.2.3) Operation Example 3 An operation example 3 of the processing system 1 will be described with reference to FIG. 4 . The interface unit described above includes a communication unit 40 that communicates with a communication device. The communication device includes, for example, a scanner 41 that operates as a master in master-slave communication and an adapter 42 that operates as a slave in master-slave communication. Here, the data update process related to the communication unit 40 includes at least one of an input process in which the communication unit 40 stores data received from the communication device in an input variable WIn, and an output process in which the communication unit 40 transmits data of an output variable WOm to the communication device. The allocation information includes communication allocation information related to a target task to which the data update process of the communication unit 40 is assigned, among multiple types of tasks. The communication unit 40 executes the data update process at least before or after the execution of the target task to which the data update process of the communication unit 40 is assigned by the communication allocation information. This allows the communication unit 40 to execute the data update process at least before or after the execution of the target task assigned by the communication allocation information, thereby increasing the flexibility of the timing at which the communication unit 40 executes the data update process.
[0108] In the third operation example, a case will be described in which three scanners 41A, 41B, and 41C and an adapter 42 are connected to the communication unit 40.
[0109] The processing unit 11 of the CPU unit 10 executes a primary task PT at a fixed cycle T1, and executes an event task IT when a predetermined event occurs. In the example of Figure 4, the primary task PT is executed at times t21 and t23, and the event task IT is executed at time t22 when the predetermined event occurs.
[0110] Here, the primary task PT is created so as to execute processing using input data from the scanners 41A and 41B and input data from the adapter 42. The event task IT is created so as to execute processing using input data from the scanner 41C.
[0111] Therefore, the user sets, in the CPU unit 10, assignment information that assigns, to the primary task PT, communication processes SC1 and SC2 that communicate with the scanners 41A and 41B, and communication process AD that communicates with the adapter 42, using the setting terminal 50. The user also sets, in the CPU unit 10, assignment information that assigns, to the event task IT, communication process SC3 that communicates with the scanner 41C, using the setting terminal 50.
[0112] Table 3 shows the allocation information (communication allocation information) for the communication processes assigned to the primary task PT and the event task IT. In this embodiment, the communication unit 40 is capable of communicating with multiple communication devices (scanner 41 and adapter 42), and the communication allocation information may further include information regarding the communication device among the multiple communication devices to which the data update process is assigned. In other words, the communication allocation information includes information specifying the communication device that will perform the data update process at the timing of executing the target task. Therefore, the communication unit 40 executes the data update process for the communication device assigned by the communication allocation information at least either before or after the execution of the target task to which the data update process of the communication unit 40 is assigned by the communication allocation information. This allows the data update process to be executed at the desired timing for each of the multiple communication devices, thereby increasing the flexibility in the timing of executing the data update process.
[0113]
[0114] At this time, when the processing unit 11 of the CPU unit 10 executes the primary task PT, before executing the primary task PT, it causes the communication unit 40 to execute a communication process SC1 for communicating with the scanner 41A, a communication process SC2 for communicating with the scanner 41B, and a communication process AD for communicating with the adapter 42, and then executes the primary task PT.
[0115] Furthermore, when a predetermined event occurs, the processing unit 11 executes the event task IT, but before executing the event task IT, it causes the communication unit 40 to execute a communication process SC3 to communicate with the scanner 41C, and then executes the event task IT.
[0116] In variant example 3, the communication unit 40 performs communication processing with the communication device before executing the target task, and then the CPU unit 10 executes the target task. However, the communication processing may be performed after the target task is executed, or the communication processing may be performed both before and after the target task is executed.
[0117] (3) Modifications The above embodiment is merely one of various embodiments of the present disclosure. Various modifications to the above embodiment are possible depending on the design, etc., as long as the object of the present disclosure can be achieved. Furthermore, functions similar to those of the processing system 1 may be embodied as a processing method for the processing system 1, a computer program, a non-transitory recording medium on which a program is recorded, or the like. A processing method according to one aspect is a processing method for a processing system 1 including an interface unit that performs at least one of data input and output, and a processing unit 11. This processing method includes task processing for executing multiple types of tasks and data update processing. The multiple types of tasks include tasks that process data stored in input variables and store the processing results in output variables. The data update processing executes at least one of input processing for storing data input to the interface unit in input variables and output processing for outputting data of output variables to the interface unit. This processing method executes the data update processing at least before and after the execution of a target task to which the data update processing is assigned from the multiple types of tasks, based on assignment information for the target task. A (computer) program according to one aspect is a program for causing a computer system to execute the above processing method.
[0118] Modifications of the above embodiment are listed below. The modifications described below can be applied in appropriate combinations. Note that the above embodiment may also be referred to as the basic configuration below.
[0119] The processing system 1 or the executing entity of the processing method in the present disclosure includes a computer system. The computer system is primarily composed of a processor and memory as hardware. The processor executes a program stored in the memory of the computer system to realize the functions of the processing system 1 or the executing entity of the processing method in the present disclosure. The program may be pre-recorded in the memory of the computer system, provided via a telecommunications line, or provided in a non-transitory recording medium readable by the computer system, such as a memory card, optical disk, or hard disk drive. The processor of the computer system is composed of one or more electronic circuits including a semiconductor integrated circuit (IC) or a large-scale integrated circuit (LSI). The integrated circuits, such as ICs or LSIs, are referred to by different names depending on the degree of integration, and include integrated circuits called system LSIs, very large-scale integrations (VLSIs), or ultra-large-scale integrations (ULSIs). Furthermore, field-programmable gate arrays (FPGAs), which are programmed after the LSI is manufactured, or logic devices that allow the reconfiguration of internal connections or internal circuit partitions of the LSI, can also be used as processors. The electronic circuits may be integrated into one chip or distributed across multiple chips. The chips may be integrated into one device or distributed across multiple devices. The computer system referred to here includes a microcontroller having one or more processors and one or more memories. Therefore, the microcontroller is also composed of one or more electronic circuits including a semiconductor integrated circuit or a large-scale integrated circuit.
[0120] Furthermore, it is not essential for the processing system 1 that multiple functions are concentrated in one housing, and the components of the processing system 1 may be distributed across multiple housings. Also, in the above embodiment, the functions of the interface unit are distributed across multiple housings, but some or all of the interface unit may be concentrated in one housing together with the processing unit 11. Furthermore, at least some of the functions of the processing system 1 (for example, the functions of the processing unit 11) may be realized by the cloud (cloud computing) or the like.
[0121] (3.1) Modification 1 The operation of the processing system 1 according to Modification 1 will be described with reference to Figures 5 to 7. Figures 5 to 7 are schematic timing charts of the tasks and data update processes executed by the processing unit 11 of the CPU unit 10, and the durations of the tasks and data update processes do not necessarily reflect the actual processing times.
[0122] In the above-described operation example 1, the processing unit 11 performs input processing before the execution of the target task and performs output processing after the execution of the target task, but the timing of executing the input processing and output processing can be changed as appropriate depending on the processing content of the target task, etc.
[0123] For example, the processing unit 11 may perform input processing and output processing successively after executing a target task. In the example of Fig. 5, the processing unit 11 performs input processing IN1 and output processing OUT1 successively after executing a primary task PT, and performs input processing IN2 and output processing OUT2 successively after executing an event task IT. Note that the processing unit 11 may perform output processing and then input processing after executing a target task (primary task PT, event task IT, etc.).
[0124] Furthermore, the processing unit 11 may perform input processing and output processing consecutively before executing the target task. That is, the processing unit 11 may execute the target task after performing input processing and output processing. In the example of FIG. 6 , the processing unit 11 executes the primary task PT after performing input processing IN1 and output processing OUT1. Furthermore, the processing unit 11 executes the event task IT after performing input processing IN2 and output processing OUT2. Note that the processing unit 11 may execute the target task after sequentially performing output processing and input processing.
[0125] Alternatively, the processing unit 11 may perform output processing before executing a target task and perform input processing after executing the target task. In the example of Fig. 7, the processing unit 11 performs output processing OUT1 before executing a primary task PT and performs input processing IN1 after executing the primary task PT. Furthermore, the processing unit 11 performs output processing OUT2 before executing an event task IT and performs input processing IN2 after executing the event task IT.
[0126] In this way, the timing of executing the input processing and output processing can be either before or after the execution of the target task, and can be changed as appropriate depending on the processing content of the target task, etc., thereby increasing the flexibility of the timing of executing the input processing and output processing.
[0127] (3.2) Modification 2 The operation of the processing system 1 according to Modification 2 will be described with reference to Figures 8 to 10. Note that Figures 8 to 10 are schematic timing charts of the tasks and data update processes executed by the processing unit 11 of the CPU unit 10, and the durations of the tasks and data update processes do not necessarily reflect the actual processing times.
[0128] In the above-described operational example 2, when performing data update processing for three I / O units 20A to 20C, the data update processing (at least one of input processing and output processing) for the I / O units 20A, 20B, and 20C is performed in ascending order of the unit numbers, but this order can be changed as appropriate. That is, when data update processing for two or more I / O units 70 is assigned to one target task, the assignment information may further include execution order information regarding the order in which the data update processing is executed for the two or more I / O units 70 assigned to one target task. The processing unit 11 executes the data update processing for the two or more I / O units 70 assigned to one target task in the order based on the execution order information. This allows the data update processing for the two or more I / O units 70 assigned to one target task to be executed in a desired order, thereby increasing the flexibility in the timing of executing the data update processing.
[0129] Furthermore, in the second operational example, when data update processing is performed for multiple terminal groups (input terminal groups and output terminal groups) included in each of the input / output units 20A to 20C, the data update processing for the multiple terminal groups is performed in ascending order of terminal number, but this order can be changed as appropriate. That is, when data update processing for two or more terminal groups (input terminal group WXn or output terminal group WYm) is assigned to one target task, the assignment information may further include execution order information regarding the order in which the data update processing is performed for the two or more terminal groups assigned to one target task. The processing unit 11 executes the data update processing for the two or more terminal groups assigned to one target task in the order based on the execution order information. This allows the data update processing for the two or more terminal groups (input terminal group WXn or output terminal group WYm) assigned to one target task to be executed in a desired order, thereby increasing the flexibility in the timing of executing the data update processing.
[0130] Here, the operation when the processing unit 11 performs data update processing for the three input / output units 20A to 20C will be described.
[0131] For example, using the setting terminal 50, the user sets in the CPU unit 10 allocation information that assigns input processes IN(WX0), IN(WX1), IN(WX2) that take in input data from the input terminal group WX0, WX1, WX2 of the input / output unit 20A, and output processes OUT(WY0), OUT(WY1), OUT(WY2) that output output data to the output terminal group WY0, WY1, WY2 of the input / output unit 20A to the primary task PT. In addition, the user uses the setting terminal 50 to set in the CPU unit 10 allocation information that assigns to the primary task PT input processes IN(WX10), IN(WX11), IN(WX12) that take in input data from the input terminal group WX10, WX11, WX12 of the input / output unit 20B, and output processes OUT(WY10), OUT(WY11), OUT(WY12) that output output data to the output terminal group WY10, WY11, WY12 of the input / output unit 20B. In addition, the user sets, using the setting terminal 50, assignment information in the CPU unit 10 that assigns to the event task IT input processes IN(WX20), IN(WX21), IN(WX22) that take in input data from the input terminal group WX20, WX21, WX22 of the input / output unit 20C, and output processes OUT(WY20), OUT(WY21), OUT(WY22) that output output data to the output terminal group WY20, WY21, WY22 of the input / output unit 20C. Table 4 shows the assignment information for the data update processes assigned to the input / output units 20A, 20B, and 20C.
[0132]
[0133] It is also assumed that the allocation information includes execution order information for executing data update processing in the order of the input / output units 20A, 20B, which are allocated to the primary task PT.
[0134] In this case, as shown in FIG. 8, before executing the primary task PT, the processing unit 11, based on allocation information including execution order information, sequentially executes input processes IN(WX10), IN(WX11), IN(WX12) that take in input data from the input terminal group WX10, WX11, WX12 of the input / output unit 20B, and input processes IN(WX0), IN(WX1), IN(WX2) that take in input data from the input terminal group WX0, WX1, WX2 of the input / output unit 20A. Then, after executing the primary task PT, the processing unit 11 sequentially executes output processes OUT(WY10), OUT(WY11), OUT(WY12) that output output data to the output terminal groups WY10, WY11, WY12 of the input / output unit 20B, and output processes OUT(WY0), OUT(WY1), OUT(WY2) that output output data to the output terminal groups WY0, WY1, WY2 of the input / output unit 20A, based on allocation information including execution order information.
[0135] Furthermore, when executing the event task IT, the processing unit 11 executes input processes IN(WX20), IN(WX21), and IN(WX22) in order, which take in input data from the input terminal groups WX20, WX21, and WX22 of the input / output unit 20C, based on the allocation information including the execution order information, before executing the event task IT. Then, after executing the event task IT, the processing unit 11 executes output processes OUT(WY20), OUT(WY21), and OUT(WY22) in order, which output output data to the output terminal groups WY20, WY21, and WY20 of the input / output unit 20C, based on the allocation information including the execution order information.
[0136] The execution order information included in the allocation information can be changed as appropriate depending on the processing content of the task, etc. For example, if data update processing of two or more input / output units 20 is assigned to the target task, the data update processing may be performed in ascending order of the numbers assigned to the input / output units 20, and the order in which data update processing is performed for multiple terminals provided in each input / output unit 20 may be changeable, for example, on a word-by-word basis.
[0137] For example, as shown in FIG. 9, before executing the primary task PT, the processing unit 11 sequentially executes input processes IN(WX0), IN(WX2), and IN(WX1) that take in input data from the input terminal groups WX0, WX2, and WX1 of the input / output unit 20A, and then sequentially executes input processes IN(WX11), IN(WX10), and IN(WX12) that take in input data from the input terminal groups WX11, WX10, and WX12 of the input / output unit 20B.
[0138] After executing the primary task PT, the processing unit 11 sequentially executes output processes OUT(WY1), OUT(WY2), and OUT(WY0) that output output data to the output terminal group WY1, WY2, and WY0 of the input / output unit 20A, and then sequentially executes output processes OUT(WY12), OUT(WY10), and OUT(WY11) that output output data to the output terminal group WY12, WY10, and WY11 of the input / output unit 20B.
[0139] Furthermore, when executing the event task IT, the processing unit 11 sequentially executes input processes IN(WX22), IN(WX21), and IN(WX20) that take in input data from the input terminal groups WX22, WX21, and WX20 of the input / output unit 20C before executing the event task IT. Then, after executing the event task IT, the processing unit 11 sequentially executes output processes OUT(WY20), OUT(WY21), and OUT(WY22) that output output data to the output terminal groups WY20, WY21, and WY22 of the input / output unit 20C.
[0140] In addition, the execution order information included in the allocation information may include information specifying both the order in which data update processing is executed for two or more input / output units 20 assigned to the target task, and the order in which data update processing is executed for multiple terminals provided on each input / output unit 20.
[0141] For example, as shown in FIG. 10, based on allocation information including execution order information, before executing the primary task PT, the processing unit 11 sequentially executes input processes IN(WX10), IN(WX12), IN(WX11) that take in input data from the input terminal groups WX10, WX12, WX11 of the input / output unit 20B, and then sequentially executes input processes IN(WX1), IN(WX0), IN(WX2) that take in input data from the input terminal groups WX1, WX0, WX2 of the input / output unit 20A.
[0142] Then, based on the allocation information including the execution order information, after executing the primary task PT, the processing unit 11 sequentially executes output processes OUT(WY11), OUT(WY12), and OUT(WY10) that output output data to the output terminal groups WY11, WY12, and WY10 of the input / output unit 20B, and then sequentially executes output processes OUT(WY0), OUT(WY1), and OUT(WY2) that output output data to the output terminal groups WY0, WY1, and WY2 of the input / output unit 20A.
[0143] Furthermore, when executing the event task IT, the processing unit 11 executes input processes IN(WX22), IN(WX21), IN(WX20) in order, which take in input data from the input terminal groups WX22, WX21, WX20 of the input / output unit 20C, based on the allocation information including the execution order information, before executing the event task IT. Then, after executing the event task IT, the processing unit 11 executes output processes OUT(WY22), OUT(WY20), OUT(WY21) in order, which output output data to the output terminal groups WY22, WY20, WY21 of the input / output unit 20C, based on the allocation information including the execution order information.
[0144] In this way, based on allocation information including execution order information, the order in which data update processing is performed for two or more input / output units 20 and the order in which data update processing is performed for the multiple terminals provided in each input / output unit 20 can be changed to the desired order, thereby increasing the freedom in the timing of executing the data update processing.
[0145] (3.3) Modification 3 In the basic configuration and modifications 1 and 2, input processing and output processing are executed before or after the execution of the target task, but it is not necessary to execute both input processing and output processing in conjunction with the execution of the target task, and only one of input processing and output processing may be executed.
[0146] Here, the operation when the processing unit 11 performs data update processing on the two input / output units 20A and 20B will be described.
[0147] For example, a user uses the setting terminal 50 to set in the CPU unit 10 assignment information that assigns to the primary task PT an input process that takes in input data from the input terminal groups WX0 to WX3 and WX6 to WX9 of the input / output unit 20A and an output process that outputs output data to the output terminal groups WY0 to WY3 and WY6 to WY9 of the input / output unit 20A. The user also uses the setting terminal 50 to set in the CPU unit 10 assignment information that assigns to the primary task PT an input process that takes in input data from the input terminal group WX10 to WX13 of the input / output unit 20B and an output process that outputs output data to the output terminal groups WY10 to WY11 and WY17 of the input / output unit 20B. The user also uses the setting terminal 50 to set in the CPU unit 10 assignment information that assigns to the event task IT1 an output process that outputs output data to the output terminal group WY4 to WY5 of the input / output unit 20A. The user also uses the setting terminal 50 to set in the CPU unit 10 allocation information that assigns input processing for taking in input data from the group of input terminals WX14 to WX18 of the input / output unit 20B to the event task IT2, and assigns output processing for outputting output data to the group of output terminals WY12 to WY13 and WY18 of the input / output unit 20B to the event task IT1. Table 5 shows the allocation information for data update processing that is assigned to the input / output units 20A, 20B, and 20C.
[0148]
[0149] 11, before executing the primary task PT, the processing unit 11 executes an input process IN1 based on the allocation information to take in input data from the input terminal groups WX0 to WX3, WX6 to WX9 of the input / output unit 20A and the input terminal groups WX10 to WX13 of the input / output unit 20B. Then, after executing the primary task PT, the processing unit 11 executes an output process OUT1 based on the allocation information to output data to the output terminal groups WY0 to WY3, WY6 to WY9 of the input / output unit 20A and the output terminal groups WY10, WY11, and WY17 of the input / output unit 20B.
[0150] In addition, when the processing unit 11 executes the event task IT1, the processing unit 11 executes the output process OUT2, which outputs output data to the output terminal group WY4 to WY5 of the input / output unit 20A and the output terminal groups WY12, WY13, and WY18 of the input / output unit 20B, based on the allocation information, after executing the event task IT1.
[0151] Furthermore, when the processing unit 11 executes the event task IT2, the processing unit 11 executes the input process IN3 to take in input data from the input terminal group WX14 to WX18 of the input / output unit 20B based on the allocation information before executing the event task IT2.
[0152] Since no input process or output process is assigned to the event task IT3, the processing unit 11 does not perform data update process before or after the execution of the event task IT3.
[0153] In this way, only either the input process or the output process may be assigned to the target task, and the desired data update process can be executed before or after the target task is executed, thereby increasing the flexibility in the timing of executing the data update process.
[0154] 1 is an example and can be modified as appropriate. In the basic configuration, a target task for executing data update processing is assigned to each of the multiple input / output units 20 by the assignment information, but a target task for executing data update processing may also be assigned to each of the multiple HLS slave units 32 constituting the remote I / O unit 30 by the assignment information.
[0155] In addition, the basic configuration includes an input / output unit 20, a remote I / O unit 30, and a communication unit 40 as interface sections, but it is not essential to include all of the input / output unit 20, the remote I / O unit 30, and the communication unit 40, and they can be omitted as appropriate.
[0156] In the basic configuration and variations 1 to 3, the case where the data update process is assigned to the primary task PT and the event task IT has been described, but the tasks to which the data update process is assigned are not limited to the primary task PT and the event task IT. The data update process may also be assigned to a task such as a periodic task or a system task.
[0157] Furthermore, in the basic configuration and variants 1 to 3, when the processing unit 11 executes task processing, it refers to the allocation information and executes the data update processing if the data update processing is assigned to the task to be executed. This allows for easy response to changes in the allocation information. The allocation information may also be reflected in the control program executed by the processing unit 11. That is, when the processing unit 11 compiles a program created on the setting terminal 50, the control program may be created so that the data update processing is executed based on the allocation information at least before and after the execution of the target task. This eliminates the need for the processing unit 11 to refer to the allocation information and determine whether to execute the data update processing before executing the task. In this case, the compiled control program is written to execute the data update processing at least before and after the execution of the target task. Therefore, by executing the control program, the processing unit 11 can execute the data update processing in conjunction with the execution of the target task.
[0158] (Summary) The above-described embodiments and the like disclose the following aspects.
[0159] The processing method of the first aspect is a processing method for a processing system (1) including an interface unit (20, 30, 40, 70) that performs at least one of data input and output, and a processing unit (11). The processing method includes task processing that executes multiple types of tasks and data update processing. The multiple types of tasks include tasks that process data stored in input variables and store the processing results in output variables. The data update processing executes at least one of input processing that stores data input to the interface unit (20, 30, 40, 70) in input variables, and output processing that outputs data of output variables to the interface unit (20, 30, 40, 70). The processing method executes the data update processing at least either before or after execution of a target task to which the data update processing is assigned from the multiple types of tasks, based on assignment information related to the target task.
[0160] According to this aspect, it is possible to increase the degree of freedom in the timing at which the data update process is executed.
[0161] In the processing method of the second aspect, the data update process in the first aspect includes both input processing and output processing, and the assignment information includes information on the target tasks to which each of the input processing and the output processing is assigned.
[0162] According to this aspect, a target task that executes input processing and a target task that executes output processing can be set separately, which increases the degree of freedom in the timing at which the input processing and the output processing are executed.
[0163] In the processing method of the third aspect, in the first or second aspect, the interface unit (20, 30, 40, 70) includes an I / O unit (70) having a plurality of terminals. The data update process related to the I / O unit (70) includes at least one of an input process for storing data input to at least some of the plurality of terminals in input variables, and an output process for outputting data of output variables to at least some of the plurality of terminals.
[0164] According to this aspect, input processing for storing data input to a terminal of the I / O unit (70) in an input variable and output processing for outputting data of an output variable to a terminal of the I / O unit (70) can be performed at desired timing, thereby increasing the degree of freedom in the timing at which the input processing and output processing are performed.
[0165] In the processing method of the fourth aspect, in the third aspect, the interface unit (20, 30, 40, 70) includes a plurality of I / O units (70). The allocation information includes information on a target task to which a data update process is to be assigned for each of the plurality of I / O units (70).
[0166] According to this aspect, a target task for executing data update processing can be set for each of the multiple I / O units (70), so that data update processing can be executed at the desired timing for each I / O unit (70), thereby increasing the degree of freedom in the timing for executing the data update processing.
[0167] In the processing method of the fifth aspect, when data update processes of two or more I / O units (70) are assigned to one target task in the fourth aspect, the allocation information further includes execution order information regarding the order in which the data update processes are to be executed for the two or more I / O units (70) assigned to one target task. In the processing method of the fifth aspect, the data update processes of the two or more I / O units (70) assigned to one target task are executed in an order based on the execution order information.
[0168] According to this aspect, the data update processing of two or more I / O units (70) assigned to one target task can be executed in a desired order, thereby increasing the degree of freedom in the timing of executing the data update processing.
[0169] In the processing method of the sixth aspect, the plurality of terminals of the I / O unit (70) in the third aspect are divided into a plurality of terminal groups in units of a predetermined number of bits, and the assignment information includes information on a target task to which a data update process is assigned for each of the plurality of terminal groups.
[0170] According to this aspect, the data update process for each of the plurality of terminal groups can be executed at a desired timing, and the degree of freedom in the timing for executing the data update process can be increased.
[0171] In the processing method of the seventh aspect, when data update processes for two or more terminal groups are assigned to one target task in the sixth aspect, the assignment information further includes execution order information regarding the order in which the data update processes are to be executed for the two or more terminal groups assigned to one target task. In the processing method of the seventh aspect, the data update processes for the two or more terminal groups assigned to one target task are executed in an order based on the execution order information.
[0172] According to this aspect, data update processes of two or more terminal groups assigned to one target task can be executed in a desired order, thereby increasing the degree of freedom in the timing of executing the data update processes.
[0173] In an eighth aspect of the processing method, in any one of the first to seventh aspects, the interface unit (20, 30, 40, 70) includes a communication unit (40) capable of communicating with a communication device (41, 42). The data update processing related to the communication unit (40) includes at least one of an input processing in which the communication unit (40) stores data received from the communication device (41, 42) in an input variable and an output processing in which data of an output variable is transmitted from the communication unit (40) to the communication device (41, 42). The allocation information includes communication allocation information related to a target task to which the data update processing of the communication unit (40) is assigned, among multiple types of tasks. In the eighth aspect of the processing method, the communication unit (40) executes the data update processing at least either before or after execution of the target task to which the data update processing of the communication unit (40) is assigned by the communication allocation information.
[0174] According to this aspect, the communication unit (40) can execute the data update process at least either before or after the execution of the target task assigned by the communication allocation information, thereby increasing the degree of freedom in the timing at which the communication unit (40) executes the data update process.
[0175] In a ninth aspect of the processing method, in the eighth aspect, the communication unit (40) is capable of communicating with a plurality of communication devices (41, 42). The communication allocation information further includes device designation information relating to a communication device (41, 42) among the plurality of communication devices (41, 42) to which a data update process is to be assigned. At least one of before and after execution of a target task to which the data update process of the communication unit (40) is assigned by the communication allocation information, the communication unit (40) executes the data update process of the communication device (41, 42) assigned by the device designation information.
[0176] According to this aspect, the data update process can be executed at a desired timing for each of the plurality of communication devices, and the degree of freedom in the timing for executing the data update process can be increased.
[0177] A program according to a tenth aspect is a program for causing a computer system to execute the processing method according to any one of the first to ninth aspects.
[0178] According to this aspect, it is possible to increase the degree of freedom in the timing at which the data update process is executed.
[0179] A processing system (1) of an eleventh aspect includes an interface unit (20, 30, 40, 70) that performs at least one of data input and output, and a processing unit (11). The processing unit (11) executes task processing for executing a plurality of types of tasks and data update processing. The plurality of types of tasks includes a task for processing data stored in input variables and storing the processing results in output variables. The data update processing executes at least one of input processing for storing data input to the interface unit (20, 30, 40, 70) in input variables, and output processing for outputting data of output variables to the interface unit (20, 30, 40, 70). The processing unit (11) executes the data update processing at least either before or after execution of the target task based on assignment information related to a target task to which the data update processing is assigned from the plurality of types of tasks.
[0180] According to this aspect, it is possible to increase the degree of freedom in the timing at which the data update process is executed.
[0181] Not limited to the above aspects, various configurations (including modified examples) of the processing system (1) according to the above embodiments can be embodied as a processing method of the processing system (1), a (computer) program, or a non-transitory recording medium on which a program is recorded, etc.
[0182] The configurations according to the second to ninth aspects are not essential for the processing method of the processing system (1) and can be omitted as appropriate.
[0183] REFERENCE SIGNS LIST 1 Processing system 11 Processing unit 20 Input / output unit (interface unit) 30 Remote I / O unit (interface unit) 40 Communication unit (interface unit) 41 Scanner (communication device) 42 Adapter (communication device) 70 I / O unit (interface unit)
Claims
1. A processing method of a processing system comprising an interface unit which performs at least one of input and output of data, and a processing unit, the processing method including task processing which executes multiple types of tasks, and data update processing, the multiple types of tasks including tasks which process data stored in input variables and store the processing results in output variables, the data update processing including at least one of input processing which stores data input to the interface unit in the input variables, and output processing which outputs data of the output variables to the interface unit, and the data update processing is executed at least one of before and after execution of the target task based on allocation information relating to a target task to which the data update processing is assigned from the multiple types of tasks.
2. The processing method according to claim 1, wherein the data update process includes both the input process and the output process, and the allocation information includes information regarding the target tasks to which each of the input process and the output process is assigned.
3. The processing method according to claim 1 or 2, wherein the interface section includes an I / O unit having a plurality of terminals, and the data update process relating to the I / O unit includes at least one of the input process of storing data input to at least some of the plurality of terminals in the input variable, and the output process of outputting data of the output variable to at least some of the plurality of terminals.
4. The processing method according to claim 3, wherein the interface unit includes a plurality of the I / O units, and the allocation information includes information regarding the target task to which the data update processing is assigned for each of the plurality of the I / O units.
5. The processing method described in claim 4, wherein, when the data update processing of two or more of the I / O units is assigned to one of the target tasks, the allocation information further includes execution order information regarding the order in which the data update processing is executed for the two or more I / O units assigned to one of the target tasks, and the data update processing of the two or more I / O units assigned to one of the target tasks is executed in an order based on the execution order information.
6. The processing method according to claim 3, wherein the plurality of terminals of the I / O unit are divided into a plurality of terminal groups in units of a predetermined number of bits, and the allocation information includes information regarding the target task to which the data update processing is assigned for each of the plurality of terminal groups.
7. The processing method described in claim 6, wherein, when the data update processing of two or more of the terminal groups is assigned to one of the target tasks, the allocation information further includes execution order information regarding the order in which the data update processing is executed for the two or more terminal groups assigned to one of the target tasks, and the data update processing of the two or more terminal groups assigned to one of the target tasks is executed in an order based on the execution order information.
8. The processing method according to any one of claims 1 to 7, wherein the interface section includes a communication unit capable of communicating with a communication device, and the data update processing related to the communication unit includes at least one of the input processing in which the communication unit stores data received from the communication device by the communication unit in an input variable, and the output processing in which the data of the output variable is transmitted from the communication unit to the communication device, and the allocation information includes communication allocation information related to a target task among the multiple types of tasks to which the data update processing of the communication unit is assigned, and the communication unit executes the data update processing at least either before or after execution of the target task to which the data update processing of the communication unit is assigned by the communication allocation information.
9. The processing method of claim 8, wherein the communication unit is capable of communicating with a plurality of the communication devices, the communication allocation information further includes information regarding a communication device among the plurality of the communication devices to which the data update processing is assigned, and the communication unit executes the data update processing of the communication device assigned by the communication allocation information at least one of before and after execution of the target task to which the data update processing of the communication unit is assigned by the communication allocation information.
10. A program for causing a computer system to execute the processing method according to any one of claims 1 to 9.
11. A processing system comprising: an interface unit that performs at least one of input and output of data; and a processing unit, wherein the processing unit performs task processing for executing multiple types of tasks and data update processing, wherein the multiple types of tasks include a task for processing data stored in input variables and storing the processing results in output variables, and the data update processing performs at least one of input processing for storing data input to the interface unit in the input variables and output processing for outputting data of the output variables to the interface unit, and the processing unit performs the data update processing at least one of before and after execution of the target task based on allocation information regarding a target task to which the data update processing is assigned from the multiple types of tasks.
Citation Information
Patent Citations
Sequence processing method and its sequence controller
JP1999102208A
Control system, master module, and refreshing method
JP2014120187A
PLC system and method for controlling input / output refresh cycle thereof
JP2022529260A
Programmable controller, program execution device, and communication method
WO2022079800A1