Method for outputting data from a programmable logic controller
The method decouples real-time PLC execution using a messaging system to maintain real-time capability and enable data communication with IT devices, addressing the challenge of integrating PLCs with IT systems in industrial environments.
Patent Information
- Application Number
- DE102023135201
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-18
AI Technical Summary
Existing programmable logic controllers (PLCs) face challenges in meeting real-time requirements while enabling communication with other IT devices due to insufficient capabilities in executing programs that adhere to communication standards, particularly in industrial environments.
A method utilizing a messaging system to temporally decouple the execution of real-time programs on PLCs, allowing data output via a server without compromising real-time capability, using OPC UA communication standards and ensuring data integrity through variable setting and mapping processes.
Enables data communication with IT devices while maintaining strict real-time program execution, ensuring data integrity and compatibility with various IT entities, thus facilitating seamless integration in industrial environments.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
The invention relates to a method for outputting data from a programmable logic controller (PLC).Programmable logic controllers of the type in question are used for controlling technical devices, such as machines and / or installations. In this case, modern programmable logic controllers are controlled, similar to other computers, by means of programs which can be executed on the programmable logic controller.Programmable logic controllers must usually be able to meet comparatively hard real-time requirements. Accordingly, real-time programs are executed on the programmable logic controllers. In this context, real-time programs are understood to mean, in particular, programs which are capable of satisfying hard real-time requirements placed on the operation of an PLC for controlling a machine and / or installation.This is made possible in particular by specific procedures during the processing of the real-time programs. In addition, certain programming languages exist that have been specifically developed for programming programmable logic controllers and that have arrived at meeting real-time requirements in terms of their nature.However, in particular in the course of the increasing networking of programmable logic controllers with other information technology devices, there is also an increasing interest in enabling communication between the programmable logic controller and other information technology devices. These requirements arise in particular within the scope of industry 4.0, but simple cases in which, for example for checking or maintenance purposes, a programmable logic controller is connected via a data connection to an information-related device, such as a tablet computer, can also be challenging with regard to technical feasibility.This is often because, while there are communication standards for data communication in industrial environments, the use of these communication standards typically requires execution of programs on programmable logic controllers whose capabilities to meet real-time requirements are not sufficient to meet, for example, the hard real-time requirements imposed on a real-time program to control a machine.The invention is therefore based on the object of demonstrating a method for outputting data from a programmable logic controller, which method makes it possible to output the data in conformity with a specific communication standard and at the same time to ensure that the processing of a real-time program is not impaired while satisfying the real-time requirements imposed on this program.The object is achieved by a method having the features of claim 1.The method is for outputting data from a programmable logic controller. Data from variables of a real-time program executed on the controller are read out by a server likewise executed on the controller. In this case, the real-time program is processed in particular cyclically. A real-time program is therefore to be understood in particular as a program which can be reliably executed by the programmable logic controller within a predetermined cycle time. For example, the real-time program can be a program written in one of the programming languages defined in the standard EN 61131-3:2014-06.The data is further sent from the server to a client via a data connection in notifications of at least one notification type. In this case, the notification type defines in particular the selection of the variables from which the data contained in a notification of the respective notification type is read.The object is achieved in particular in that the reading out of the data and the sending thereof are triggered in a notification by the transmission of a message from the real-time program via a message system to the server.Message systems make it possible for different information-technology entities to communicate with one another by exchanging data packets, which are also referred to as telegrams or datagrams. These are normally predominantly used in distributed systems, that is to say when programs executed on different computers which are networked via data lines are intended to communicate with one another.In the present case, such a communication system is used to enable communication between two programs which are executed on the same programmable logic controller, i.e. on the same computer. The message system can be, in particular, a message passing system. It has been found in connection with the present invention that this advantageously brings about a temporal decoupling of the sequences of the two programs, which has a particularly positive effect on the retention of the real-time capability of the real-time program.Servers of the type in question which serve to enable data communication via sent notifications according to a defined communication standard in an industrial environment are typically not able to meet such severe real-time requirements as the real-time programs in question of programmable logic controllers. It has been found that, owing to the time decoupling by using the message system as a "trigger", it is nevertheless possible to use such a server for the shipment of the notifications without jeopardizing the real-time capability of the real-time program.The real-time program is processed in particular in a prioritized manner by the programmable logic controller. This means in particular that other programs, such as in particular the server, are only available the computing time of the programmable logic controller which remains after the timely processing of the real-time program is ensured.The use of the message system makes it possible that only one message is sent at a specific point of the program sequence during the processing of the real-time program. The real-time program is then further processed. Within the computing time available to it, the server which receives the message can fulfil its tasks for reading out the data and sending it in the notification, without this affecting the further processing of the real-time program in a manner which would lead to a delay in the processing of the real-time program.In this way, it is made possible to output data from the real-time program to a client in a defined communication protocol without the server required for using the communication protocol impairing the real-time capability of the real-time program.The real-time program can be organized in particular into function blocks. Function blocks are program organization units. A real-time program organized in function blocks is to be understood in particular as a function module language defined in the standard EN 61131-3:2014-06, which is also referred to in particular as FBS / C+.The real-time program may comprise at least one function block containing variables which contain data to be read out from the server and to be transmitted to the client by means of the notification. This initially allows convenient handling of the functionality for sending the notifications when creating the real-time program.The real-time program may include a plurality of different function blocks each including variables that include data to be read from the server and transmitted to the client by way of a notification. In this case, the method can provide that the server sends notifications of different types of notification to the client. In this case, in particular each of the different function blocks is assigned a notification type in such a way that, when a notification of a specific notification type is sent, data is read out from variables of the function block assigned to this specific notification type and sent with the notification.The server can be, in particular, an OPC-UA server. The client can be, in particular, an OPC-UA client. The notification can be, in particular, an OPC-UA event. The notification type can be, in particular, an OPC-UA event type. OPC-UA is a communication standard which has significant distribution in industrial environments. Accordingly, the use of the communication standard OPC-UA makes it possible to establish compatibility between the programmable logic controller on which the described method is carried out and a multiplicity of existing informational entities or existing types of informational entities. The entities can be entities from the hardware domain and / or from the software domain.The OPC-UA events are standardized OPC-UA functionality for transmitting event messages. The OPC-UA events are data structures which, in addition to data specified in the standard and relating to specific basic information, can also contain data which can be defined within the scope of the application of the method described. By defining this definable data, different OPC UA event types can be created. OPC-UA events of different OPC-UA event types correspondingly differ, in particular on the basis of the definitions of these definable data.The method can provide that the server accesses the variables of the real-time program via a data access layer of the real-time program. Such a data access layer is also referred to in particular as a data access layer. The data access layer enables and / or simplifies the server to access variables of the real-time program which are enabled in particular for a corresponding access by the server.In this case, the method can provide, in particular, that the server accesses the same physical memory area as the real-time program itself when accessing the variables of the real-time program. In this way, it is not necessary for the data to be transferred from the variables from the execution of the real-time program, for example by being sent to the server in a message and / or by copies of the data being written to a special memory area designated for the joint use of server and real-time program. Rather, the server can read the data itself directly from the memory area of the real-time program. In this way, despite the time decoupling between the server and the real-time program, with regard to the processing thereof, a high integration between the server and the real-time program nevertheless results. This results in high efficiency in overall observation.The method can provide that the sending of the message from the real-time program to the server is triggered by setting a first variable of the real-time program to a specific value.The variable can be, in particular, a Boolean variable. In particular, the method provides in this context that the sending of the message from the real-time program to the server is triggered by setting a first variable of the respective function block to a specific value.Setting such a variable to a certain value when sending the message makes it possible to easily realize "handshake" between the real-time program and the server. The setting of a specific variable for the respective function block to a specific value makes it possible in particular to distinguish between different types of notification and the respective associated function blocks when controlling this "handshake".In the context of the present method, this distinction results in particular in the sending of a notification of a specific notification type according to the described method not influencing the sending of notifications of other notification types insofar as the sending of notifications of other notification types is not hindered by the sending of a notification of a specific notification type that is triggered and is still in progress.The method can provide that setting the first variable of the real-time program, in particular the first variable of the respective function block, to the specific value prevents the change of the values of further variables of the real-time program to be read out for sending the respective notification. In other words, by setting the first variable, the variables from which data to be read out with the notification are to be sent from the server are no longer changed after setting the first variable to the specific value.In particular, if the real-time program is executed with higher priority, the server may read out the data with a significant time delay. This can even mean that, during a cyclical execution of the real-time program, the server reads out the data only in a later execution cycle of the real-time program than the execution cycle in which the message has been sent and the first variable has been set to the specific value.By setting the variable to the specific value, it can therefore be ensured that, when further variables of the real-time program or of the function block are read out by the server, the latter still have the same values or contain the same data as at the time of sending the message to the server. In this way, the data integrity can be ensured if, after the sending of the notification by sending the message to the server has been triggered, a certain time first passes until the server reads out the data from the real-time program.The method can provide, in particular, that a second variable of the real-time program is set by the server to a specific value when the notification is sent. In this case, the method can provide, in particular, that a second variable of the respective function block of the real-time program is set by the server to a specific value when the notification of the notification type assigned to the function block is sent.By performing the method in this way, it is possible to complete the "handshake" between server and real-time program, which was already described above in the approach. By setting the second variable to the specific value, it is possible to signal to the real-time program in a simple manner that the triggered process of sending a notification is complete. For the real-time program, this can mean that certain functionalities of the real-time program are executed depending on the value of the second variable which are to be executed depending on the question whether the notification has been sent.For example, the method may provide that after the respective notification is sent, the respective first and / or the respective second variable are reset to a starting value. In this case, the value of the second variable can be used as a trigger, in particular, for the resetting. In this way, it is possible to implement a control of the "handshake" between the real-time program and the server, which provides that after the transmission of the notification is triggered, the first variable is first set to a specific value. This first prevents the values of variables from which data to be sent in the notification are to be read from being changed. After the transmission of the notification and thus also after the reading out of the data from these variables, the corresponding second variable is set to a specific value. This value of the second variable is in turn used as a trigger in order to reset the first and the second variable to their starting value and thus to enable a change of the values of the variables whose change was initially prevented. Furthermore, renewed processing of the real-time program makes it possible to resend a notification with values of the variables updated in the meantime.In this way, it is possible to bring about an asynchrony between the cyclic execution of the real-time program and the time cycle of the sending of the notifications by the server. While the real-time program is executed cyclically while satisfying hard real-time specifications, the frequency at which the server sends the notifications can fluctuate, in particular depending on which resources are available to the server.The notifications may be generated from data read from the server via a mapping. The mapping describes in particular the relations between the data types of the read variables of the real-time program and the data types of the respective notification type. The mapping can be based here on an information model in which the assignment information required for the mapping is stored. If the notification types are OPC-UA event types, the data types of the respective notification type are in particular the properties of the respective OPC-UA event type.In this case, the method can provide that variables which are the subject of the mapping are variables of structured data types. Structured data types each include a plurality of member variables of particular data types. The data types of the member variables can be, in particular, data types selected from a closed standardized pool of possible data types.The method can provide that only the assignment information of the structured data types required for the mapping is stored in the information model on which the mapping is based, that is to say the information as to which variable of the real-time program with a structured data type is to be assigned to which structured data type of the respective notification type.In this case, the method can provide that the server, in particular via the data access layer, accesses variables of the real-time program which can be accessed by the server in order to obtain a type model of said variables which describes the data types of variables of the real-time program. The type model describes in particular which member variables of which data types are contained in the variables of structured data types in each case.The respective data types of the member variables of the structured data types to be associated with one another can then be associated with one another at runtime by means of a stored assignment table which describes the relations of the data types of the real-time program, on the one hand, and of the notification types, on the other hand, contained in the completed standardized pool of possible data types, and the type model from which data types of the member variables of the structured data types used in the real-time program are derived.The real-time program and the server may be executed on the programmable logic controller together in the same runtime environment. Executing the server in the same runtime environment as the real-time program brings performance advantages, particularly when accessing the data.The transmission of the notifications from the server to the client can take place according to a subscription model.Data to be output from the programmable logic controller can relate in particular to measured values which have been obtained by means of sensors through measurements in the physical world.Thus, the measured values can be, for example, measured values of at least one operating variable of an electric drive system. The at least one operating variable can be, in particular, one or a plurality of the operating variables position, speed, acceleration, rotational speed, angular position, angular speed, angular acceleration, voltage, current, electrical power, mechanical power, torque, and / or temperature.Further practical embodiments and advantages of the invention are described below in connection with the drawings.FIG. 1 shows a process diagram of an example method.In a first method step 12, the example method 10 can provide that the server firstly loads an information model in which mapping information required for the mapping is stored.In a further method step 14, the server can access the variables of the real-time program in order to create a type model that describes the data types of variables of the real-time program.Method 10 may provide that, in a further method step 16, the server connects to a communication system and waits for messages that trigger the sending of a notification.In a further method step 18, the method 10 can provide that the client subscribes to notifications of the server according to a subscription model.In a further method step 20, the method 10 can provide that the sending of a message from the real-time program to the server is triggered by setting a first variable of a function block of the real-time program to a specific value.In a further method step 22, the method 10 can provide that, by receiving the message sent in the method step 20, the server receives the information as to which function block the notification type of the notification, the sending of which is triggered by the receiving of the message, is assigned.In a further method step 24, the method 10 can provide that the server generates a mapping by means of the information model from method step 12 and by means of the type model from method step 14 and, if appropriate, a predefined assignment table for the assignment of the data types of member variables of structured data types, and reads out data from variables of the function block identified in method step 22.In a further method step 26, the method 10 can provide that the server generates and sends a notification by means of the mapping and the read-out data.In a further method step 28, method 10 may provide that the client receives the notification.In a further method step 30, the method 10 can provide that the server signals to the real-time program that the notification is sent by setting a second variable of the function block of the real-time program to a specific value.The features of the invention disclosed in the present description, in the drawing and in the claims can be essential, both individually and in any combinations, for the realization of the invention in its various embodiments. The invention is not limited to the described embodiments. It can be varied within the scope of the claims and taking into account the knowledge of the responsible person skilled in the art.List of reference characters10 Method step 12 Method step 14 Method step 16 Method step 18 Method step 20 Method step 22 Method step 24 Method step 26 Method step 28 Method step 30 Method stepReferences included in the specificationThis list of documents cited by the applicant has been produced in an automated manner and is only included for the better information of the reader. The list is not part of the German patent application or utility model application. The DPMA does not take any adhesion for any faults or omissions.Cited Non-Patent LiteratureStandard EN 61131-3:2014-06 [0009, 0018]
Claims
Method (10) for outputting data from a programmable logic controller, wherein data from variables of a real-time program executed on the controller and executed in particular cyclically are read out by a server likewise executed on the controller and are sent to a client via a data connection in notifications of at least one notification type which correspond to a defined communication standard, characterized in that the reading out of the data and the sending thereof are triggered in a notification by the sending of a message from the real-time program via a communication system to the server.Method (10) according to Claim 1, characterized in that the real-time program is organized in function blocks and comprises at least one function block containing variables containing data to be read from the server and transmitted to the client by means of the notification.Method (10) according to Claim 1 or 2, characterized in that the real-time program has a plurality of different function blocks, each of which contains variables which contain data which are to be read out from the server and are to be transmitted to the client by means of a notification, and the server transmits notifications of different types of notification to the client, wherein each of the different function blocks is assigned a respective type of notification in such a way that, when a notification of a specific type of notification is transmitted, data are read out from variables of the function block assigned to this specific type of notification and are transmitted with the notification.Method (10) according to one of the preceding claims, characterized in that the server is an OPC-UA server, the client is an OPC-UA client, the notification is an OPC-UA event and / or the notification type is an OPC-UA event type.Method (10) according to one of the preceding claims, characterized in that the server accesses the variables of the real-time program via a data access layer (data access layer) of the real-time program.Method (10) according to one of the preceding claims, characterized in that the server accesses the same physical memory area as the real-time program itself when accessing the variables of the real-time program.Method (10) according to one of the preceding claims, characterized in that the sending of the message from the real-time program to the server is triggered by setting a first variable of the real-time program, in particular a first variable of the respective function block of the real-time program, to a specific value.Method (10) according to Claim 7, characterized in that the setting of the first variable of the real-time program to the determined value prevents the values of further variables of the real-time program to be read out for sending the respective notification, in particular further variables of the respective function block, from being changed.Method (10) according to one of the preceding claims, characterized in that a second variable of the real-time program, in particular a second variable of the respective function block of the real-time program, is set by the server to a specific value when the notification is sent.Method (10) according to one of the preceding claims, characterized in that after the respective notification has been sent, the first and / or the second variable are reset to a starting value, wherein in particular the value of the second variable is used as a trigger for the reset.Method (10) according to one of the preceding claims, characterized in that the notifications are generated from data read out by the server by means of a mapping, wherein the mapping describes the relations between the data types of the read-out variables of the real-time program and the data types of the respective notification type.Method (10) according to one of the preceding claims, characterized in that the real-time program and the server are executed jointly on the programmable logic controller in the same runtime environment.Method (10) according to one of the preceding claims, characterized in that data to be output from the programmable logic controller relate to measured values which have been obtained by means of sensors by measurements in the physical world.Method (10) according to one of the preceding claims, characterized in that the measured values are measured values of at least one operating variable of an electric drive system.Method (10) according to one of the preceding claims, characterized in that the at least one operating variable is one or a plurality of the operating variables position, speed, acceleration, rotational speed, angular position, angular speed, angular acceleration, voltage, current, electrical power, mechanical power, torque, and / or temperature.
Citation Information
Patent Citations
process control device and method for controlling a process
DE102007046964A1
Method for processing process state data and / or machine state data of a machine tool
DE102009024101A1