METHOD AND APPARATUS FOR ACCESSING DATA OR FUNCTIONS OF A PROGRAMMABLE CONTROLLER VIA A NETWORK PROTOCOL

20170223144 · 2017-08-03

Assignee

Inventors

Cpc classification

International classification

Abstract

A method and a programmable controller for accessing data or functions, the data being stored in a database of the programmable controller and the database being assigned to an application program of the programmable controller, and a web server of the programmable controller being accessed by a client via the network protocol, where at least one program module of the automation program of the programmable controller is assigned to a web service of the web server, and where execution of the program module is initiated by the web service such that flexible and simply implementable access to data or functions of the programmable controller is therefore possible, and the access to the data or functions can be controlled load-dependently.

Claims

1. A method for accessing data or functions of a programmable controller via a network protocol, the method comprising: storing the data in a database of the programmable controller; assigning the database to an application program of the programmable controller; accessing a web server of the programmable controller by a client via the network protocol; assigning at least one program module of an automation program of the programmable controller to a web service of the web server; and initiating execution of the program module by the web service.

2. The method as claimed in patent claim 1, wherein access to the data of the programmable controller is performed by the at least one program module, and one of (i) at least one parameter provided by the web service being written into the database as describing the data and (ii) the data are read out from the database and transmitted as a parameter to the web service, or both.

3. The method as claimed in patent claim 1, wherein a decision is made by an administration device of the programmable controller as to whether an initiated call of the at least one program module occurs or does not occur.

4. The method as claimed in patent claim 2, wherein a decision is made by an administration device of the programmable controller as to whether an initiated call of the at least one program module occurs or does not occur.

5. The method as claimed in patent claim 3, wherein the decision is made aided by a workload of the programmable controller.

6. The method as claimed in patent claim 1, wherein the execution of the at least one program module is performed in the event of an initiation as soon as a run of the automation program has reached a checkpoint or a defined state comprising a cycle start or a cycle end.

7. The method as claimed in patent claim 1, wherein a part of the automation program running at this time is interrupted to execute the at least one program module.

8. The method as claimed in patent claim 1, wherein the client comprises a web browser or an application of a mobile terminal or a cloud-based service.

9. The method as claimed in patent claim 1, wherein a data module of the automation program is used as the database.

10. A programmable controller having access to its data or functions via a network protocol, the programmable controller comprising: a processor; a database which stores the data; and a web server for access to the data or functions; wherein the programmable controller is configured to assign at least one program module of an automation program to a web service of the web server; and wherein the web service is configured to initiate execution of the at least one program module.

11. The programmable controller as claimed in patent claim 10, wherein the at least one program module is configured to provide access to the data; and wherein one of (i) at least one parameter provided by the web service is written into the database as describing the data and (ii) at least some of the data are read out from the database and transmitted as the at least one parameter to the web service, or both.

12. The programmable controller as claimed in patent claim 10, further comprising: an administration device configured to carry out or enable an initiated call of the program module, or not.

13. The programmable controller as claimed in patent claim 11, further comprising: an administration device configured to perform or enable an initiated call of the program module, or not.

14. The programmable controller as claimed in patent claim 12, wherein the administration device is configured to render a decision with respect to a call of the at least one program module aided by a workload of the programmable controller.

15. The programmable controller as claimed in patent claim 10, wherein the programmable controller is configured to initiate execution of the program module as soon as a run of the automation program has reached a checkpoint or a cycle of the automation program has reached a defined state comprising a cycle start or a cycle end.

16. The programmable controller as claimed in patent claim 11, wherein the programmable controller is configured to initiate execution of the program module, as soon as a run of the automation program has reached a checkpoint or a cycle of the automation program has reached a defined state comprising a cycle start or a cycle end.

17. The programmable controller as claimed in patent claim 12, wherein the programmable controller is configured to initiate execution of the program module as soon as a run of the automation program has reached a checkpoint or a cycle of the automation program has reached a defined state comprising a cycle start or a cycle end.

18. The programmable controller as claimed in patent claim 14, wherein the programmable controller is configured to initiate execution of the program module as soon as a run of the automation program has reached a checkpoint or a cycle of the automation program has reached a defined state comprising a cycle start or a cycle end.

19. The programmable controller as claimed in patent claim 10, wherein the programmable controller is configured to interrupt a part of the automation program running at this time to execute the at least one program module.

20. The programmable controller as claimed in patent claim 10, wherein the web server is configured to communicate with a web browser or an application of a mobile terminal or of a cloud-based service as a client.

21. The programmable controller as claimed in patent claim 10, wherein the database is a data module of the automation program.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0018] An exemplary embodiment of the method according to the invention and of the programmable controller according to the invention will be explained below with the aid of the drawings, in which:

[0019] FIG. 1 shows a schematic block diagram of the data exchange of essential modules of an architecture in accordance with the invention; and

[0020] FIG. 2 is a flowchart of the method in accordance with the invention.

DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

[0021] FIG. 1 schematically represents an arrangement consisting of a programmable controller SPS and a client CL, which exchange data with one another via a network NW with the aid of an Internet protocol (for example, HTTP). The client CL may be a computer with a web browser, a mobile unit (Tablet PC, smartphone, laptop computer, or the like) having an application (“App”), a cloud-based service or another entity exchanging data via an Internet protocol, such as an operation and observation unit for an industrial application.

[0022] The programmable controller SPS is a microprocessor-controlled component, which is used, for example, in an industrial automation arrangement, a controlled industrial process, in building automation or in another control task. The programmable controller SPS is equipped with a web server WS, which exchanges data with the client CL via the network NW and via an Internet protocol. The web server WS is connected inside the programmable controller SPS to an administration device VE that coordinates the data exchange between the web server WS and an automation program; because of its time coordination function, the administration device VE may also be referred to as a “scheduler”.

[0023] Various modules of an industrial automation program, with the aid of which data access of the client CL via the network NW and the web server WS, or the administration device VE, will be explained below, are represented in the left-hand part of the programmable controller SPS.

[0024] An automation program is generally executed in a cycle-based manner, i.e., the program components important for a control task are processed in a cyclically repetitive manner in a fixed time framework. A program module OB1 (organization module 1), which is processed in the framework of the cycle and by which other program components, such as functions, function modules and calls for the functions or function components, i.e., “function calls” (FC) are driven, may be responsible for the cycle control. An automation program furthermore generally comprises “data modules” (DB), in which variables and parameters of the automation program may be combined, a single data module DB1 being shown by way of example in the representation shown here.

[0025] A read access of the client CL to data of the data module DB1 is discussed below; a write access or a mixed read and write access may, however, be performed in a similar way in accordance with the invention.

[0026] During a planning phase of an industrial automation arrangement, or during programming of the programmable controller SPS, individual program modules FC1, FC2 or calls for such program modules as functions, which may, for example, contain or be methods, are enabled for calling by the web server, i.e., these program modules or function calls FC1, FC2 can be called (for example, started) by an instance that does not itself belong to the automation program. This instance is, in the present case, the web server WS, in which case the calls, initiated by the web server WS, of the functions for direct access DZM, i.e., here the program modules FC1, FC2, may optionally be allowed, denied or time-controlled, or delayed, by the administration device VE. Thus, in principle, although implemented asynchronously with the respective cycle of the automation program, the call of the program modules FC1, FC2 may nevertheless, for example, be suppressed by the administration device VE when the functionality of the automation program would otherwise be endangered, or such a call may be delayed until the cycle of the automation program has reached a corresponding state, such as a cycle start, cycle end or the reaching of a checkpoint, i.e., of a predefined execution state of the automation program.

[0027] A client CL may encode the program module FC1, FC2 to be addressed with the call or a request, as well as the data (for example, variables) to be addressed in this case, in a URL, so that a defined call path is obtained for the corresponding program module FC1, FC2. Such a URL is, for example, transmitted via the HTTP protocol via the network NW to the web server WS of the programmable controller, and evaluated (“composed”) there. From the information of the URL, the web server WS then generates a call for one of program modules FC1, FC2. In a first example, it will be assumed that the program module FC2 is called. The administration device VE may then enable this call, for example in the case in which a cycle of the automation program has reached the end and sufficient computing time to process the task is still available before the start of the next cycle. By the automation program, the enabled program module FC2, which may, for example, access the data module D1 and read out from there the variables specified by means of the request, is thus then executed. The information then obtained may be transmitted to the web server WS which, for example, converts this information into a desired format (for example JSON, XML) and transmits it to the client CL, which in turn receives the data in a webpage, an application (“App”) or a cloud memory (“cloud persistence”), or vice versa.

[0028] In a second example, by a similar request, the program module FC1 is called, although it does not itself directly access a data module but also a further program module FCn of the automation program, which is not however itself enabled for direct access by the web server and is therefore called indirectly by the module FC1 here. Subsequently, for example, desired actions may be performed by the program module FCn or data may be transmitted back to the called program module FC1, which data may then be forwarded to the web server, or the like. In FIG. 1, it is furthermore represented that the program module FCn may also be called by the “main loop”, i.e., the organization module OB1.

[0029] In summary, it may be stated that, via the mechanisms outlined, asynchronous calling of functions (e.g., program modules, function calls, or methods) of an automation program is possible, in which case the programmable controller SPS may then decide via the administration device VE about the execution, load-dependently or with the aid of other criteria. Parameters from these calls (“requests”) may then be exchanged with the data memory of the programmable controller, together with data modules. What is important in this context is that the “business logic” for execution of the calls is implemented on the side of the automation program, and can therefore be programmed by the programmer of the automation program via a programming language intended for automation programs and therefore familiar to the programmer, and all of the data exchange is therefore also implemented under the control of the automation program. The web server WS integrated in the programmable controller SPS is capable in accordance with the invention of assigning paths (e.g., URL) called via HTTP or other network protocols to the corresponding program modules. Furthermore, access data are advantageously checked. A transferred or requested parameter is forwarded to the respectively called program module FC1 FC2. There, validation and type conversion are optionally performed. Any output parameter (in the case of read access) is sent to the caller, ultimately to the client CL, in accordance with the protocol. This includes values optionally being converted into strings, so that the response is given as JavaScript Object Notation (JSON) or extensible markup language (xml) or in another notation, depending on the request protocol.

[0030] Application examples of such an architecture are, for example, smart home solutions (control of shutters, light, etc. in building automation), packaging lines (change of throughput numbers, etc.) and other applications in which conventional clients CL are intended to be connected in a straightforward way to a programmable controller SPS. Special technologies such as OPC-UA are not required in this case.

[0031] FIG. 2 is a flowchart of a method for accessing data or functions of a programmable controller (SPS) via a network protocol. The method comprises storing the data being stored in a database (DB1) of the programmable controller (SPS), as indicated in step 210.

[0032] Next, the database (DB1) is assigned to an application program of the programmable controller (SPS), as indicated in step 220.

[0033] Next, a web server of the programmable controller (SPS) is accessed by a client (CL) via the network protocol, as indicated in step 230. Next, at least one program module (FC1, FC2) of an automation program of the programmable controller (SPS) is assigned to a web service of the web server (WS), as indicated in step 240.

[0034] Execution of the program module (FC1, FC2) in now initiate by the web service, as indicated in step 250.

[0035] While there have been shown, described and pointed out fundamental novel features of the invention as applied to a preferred embodiment thereof, it will be understood that various omissions and substitutions and changes in the form and details of the methods described and the devices illustrated, and in their operation, may be made by those skilled in the art without departing from the spirit of the invention. For example, it is expressly intended that all combinations of those elements and/or method steps which perform substantially the same function in substantially the same way to achieve the same results are within the scope of the invention. Moreover, it should be recognized that structures and/or elements and/or method steps shown and/or described in connection with any disclosed form or embodiment of the invention may be incorporated in any other disclosed or described or suggested form or embodiment as a general matter of design choice. It is the intention, therefore, to be limited only as indicated by the scope of the claims appended hereto.