METHOD AND INDUSTRIAL CONTROLLER FOR THE SYNCHRONIZED CALLING OF A FUNCTION BLOCK IN A CONTROL PROGRAM HAVING OPC UA
20220276641 · 2022-09-01
Inventors
Cpc classification
G05B2219/34263
PHYSICS
G05B19/4183
PHYSICS
International classification
Abstract
A method for calling an industrial controller control program function block having an OPC UA server and using the OPC UA communication protocol to communicate with an OPC UA client, the function block requested from an OPC UA call of the OPC UA client. The method further comprising: a call step directed to the method of the OPC UA server sent from the OPC UA client to the OPC UA server; a stored step, the OPC UA call is stored by the industrial controller OPC UA server; a transfer step, IN Parameters are transferred together with the OPC UA call from the OPC UA client to the OPC UA server, and copied to corresponding control program function block IN parameters; and a called step, the control program function block is called at a previously defined point within a industrial controller control task, and the function block IN parameters are processed.
Claims
1. A method for calling a function block of a control program of an industrial controller, wherein the industrial controller comprises an OPC UA server, the industrial controller communicates with an OPC UA client, in particular by means of the OPC UA communication protocol, and the function block is requested starting from an OPC UA call of the OPC UA client, wherein when the function block is requested in a first step, an OPC UA call directed thereto is sent from the OPC UA client to the OPC UA server of the industrial control in a second step, the OPC UA call is stored by the OPC UA server of the industrial controller, in a third step, (IN1-par) IN parameters transferred together with the OPC UA call are copied (IN2-par) to corresponding IN parameters of the function block of the control program, and in a fourth step, at a previously defined point within a control task of the industrial controller, the function block of the control program is called and the IN parameters of the function block are processed.
2. The method according to claim 1, wherein OUT parameters of the function block obtained by execution of the control task during processing of the IN parameters of the function module of the control program are copied (OUT1-par) to the OPC UA server after execution of the control task.
3. The method according to claim 2, wherein the OUT parameters additionally comprise at least one parameter for signaling a processing status and/or an error during the OPC UA call-based processing of the function block.
4. The method according to claim 1, wherein the OUT-parameters copied to the OPC UA server are returned (OUT2-par) from the OPC UA server to the OPC UA client.
5. The method according to claim 1, wherein the IN parameters comprise a parameter for signaling the presence of an OPC U.A call.
6. The method according to claim 5, wherein at the end of the execution, or prior to the start of the next execution of the control task, at least the IN parameter copied to the function block of the control program is reset to a default value to signal the presence of an OPC UA call.
7. An industrial controller having an OPC UA server, wherein the industrial controller is designed to run a control program, wherein the industrial controller is designed to communicate, in particular by means of the OPC UA communication protocol, with an OPC UA client, as well as furthermore to call a function block of the control program, which function block can be requested starting from an OPC UA call of the OPC UA client, wherein the OPC UA server is designed for receiving an OPC UA call directed to the request from the OPC UA client, as well as for storing the OPC UA call, wherein the industrial controller is further designed for copying IN parameters transferred together with the OPC UA call to corresponding IN parameters of the function block of the control program and for calling the function block of the control program at a previously defined point within a control task of the industrial controller for processing the IN parameters of the function block.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Further advantages and features of the invention in preferred embodiments are described in more detail from the following description, with reference to the attached drawing.
[0023]
DETAILED DESCRIPTION
[0024]
[0025] More specifically, a control task 220 to be processed during a control thread 222 is shown in in the industrial controller 200 of an expedient embodiment, which in turn is designed to process a control program 221.
[0026] The industrial controller 200 may further comprise further control tasks which may be called within the control thread 222 or also other control threads, in particular cyclically for processing further control programs. As is known to one skilled in the art in and of itself, control programs, also referred to as application programs, conventionally serve to control or monitor an application, for example, within an industrial process or industrial manufacturing. Within the scope of these applications, corresponding function blocks, such as the function block 225, can then be called, which are designed to be application-dependent for processing a specific application or even function.
[0027] The control program 221 outlined at
[0028] In particular, in order to avoid inconsistencies between the IN parameters 226 and the OUT parameters 227, the industrial controller 200 is furthermore expediently designed such that the processing of the function block 225 always takes place, in particular takes place cyclically, during the control thread 222 at a previously defined point within the control task 220.
[0029] Furthermore, the industrial controller 200 also comprises, in particular as part of or as an extension of an operating system not shown in more detail, an OPC UA server 210 for communication, which is to say, in particular for the exchange of data, between the industrial controller and a client 100 arranged externally to the industrial controller, wherein, in this respect, an OPC UA client 110 is set up on the client 100 for communication. The communication or alternatively the exchange of data between the industrial controller 200 and the client 100 is thus carried out via the OPC UA server 210 and the OPC UA client 110, expediently by means of an OPC UA communication protocol known per se to the person skilled in the art.
[0030] A method 215 is further defined on the OPC UA server 210, which is preferably directed to the call A215 of the function corresponding to the function block 225 of the control program, and can be called via a call A110 of the OPC UA client 110.
[0031] In particular, within the scope of such a call A110, it is provided that, together with the call A110, certain IN parameters 216, indicated in
[0032] As a consequence, a request of the function block 225, which is to say, the request for a processing of specific IN parameters to OUT parameters can, in particular, ensue spontaneously or at any moment from the industrial process or the industrial production and thus external to the industrial control system.
[0033] Preferably, it is provided that the method 215 called by the call A110 is processed by the OPC UA server 210 within a corresponding UA thread 212. In this case, a call A110 is consequently received by the OPC UA client 110, if present, and expediently the IN parameters 216 received with the call of the method from the OPC UA client are on the one hand stored in the OPC UA server 210 and on the other hand copied to the IN parameters 226 of the function block 225 of the control program 221, indicated in
[0034] The dashed arrows between the components in
[0035] Expediently, the IN parameters 226 additionally contain a parameter for signaling the presence of an OPC UA call. If such an IN parameter is consequently copied to a corresponding parameter input of the function block 225, it signals to the function block that a call from the OPC UA server is pending. This IN parameter signaling a pending call can preferably be reset by the control program 221 or also by the OPC UA server 210, for example, at the end of the execution of the control task, which is to say, in particular, reset to a default value. By means of such a default value, it is thus expediently signaled that no renewed OPC UA call and thus no renewed processing of the function block is pending. Alternatively, the reset could also take place before the start of the next execution of the control task.
[0036] In an alternative or complementary preferred embodiment, the OUT parameters 227 of the function block 225 receive, after processing of the IN parameters 226, at least one further parameter which signals a processing status and/or an error during the processing of the function block based on the OPC UA call.
[0037] In particular, this can consequently signal the function block that the method call A215 for calling the function block has been completely processed and/or an error code relating to the processing can be represented, which can expediently be returned to the OPC UA client 110 in the event of an error.
[0038] Significant advantages of the method according to the invention are consequently to be seen in the fact that, in the case of a call of an OPC UA client for a function block in a control program via a method of an OPC UA server, the function block can be processed in the thread context of the control program, the in-parameters of the method are consistently transferred to the control program, wherein on the basis of the processing of the function block 225 at a previously defined point within a control task 220, a user of the control program always retains complete control over the point in time of the processing of the function block, and the OUT parameters of the method can expediently be transferred in a consistent manner from the control program to the OPC UA server. As a consequence, there is no need for an additional system function, in particular similar to the method described in EP 3 182 235 B1, for verifying whether an OPC UA call is stored, which once again speeds up the overall processing.
[0039] In a practical embodiment, an industrial controller 200 as sketched in