The invention relates to a method as well as a system for the transmission of cyclic and acyclic data over a transmission channel, taking into account real-time capability.
An industrial communications system, employed in data transmission systems, that connects a multitude of field devices such as measuring heads (sensors), final controlling elements and/or drives (actuators) to a control device is known as a field bus. A multitude of different field bus systems having different characteristics are established on the market, and are largely standardized worldwide.
Topologically, market-relevant field bus systems are currently subdivided, in essence, into two groups; on the one hand, into systems having a linear structure including strand structure or tree structure, such as Profibus, CAN or Ethernet, and on the other hand, into systems having a ring structure, such as Interbus.
Systems having a ring structure customarily are distinguished, in particular, by a high protocol efficiency, which is reflected in a high net data rate for a low transmission frequency. A ring topology implies a synchronous data transfer or data transmission of all users. Consequently, information to be transmitted is relayed from user to user until reaching the respective given user. Additional advantages are the excellent diagnostic characteristics with regard to the transmission link and the omission, to a large extent, of an allocation of device addresses and timings, since peer-to-peer connections are at issue for the transmission links, and consequently, unlike in a client/server or master/slave connection, a communication occurs among equals.
In contrast to this, the field bus systems for a topology based on a linear structure are, as a rule, hotplug-capable, i.e., it is possible to plug in and plug out individual users during running bus operation without much difficulty. In addition, process data and acyclic data, including device diagnosis data, can be transmitted, to nearly any extent, depending on the situation. These topologies are essentially based on a client/server or master/slave communication.
In general, however, it can be emphasized that the advantages connected with a ring structure correspond to the disadvantages of a linear structure and vice versa. In addition, particularly based on today's high complexity and high transmission speeds possessed by the presently established and accordingly market-relevant bus systems, a bus coupling frequently can be realized only by means of special and expensive protocol chips or μControllers.
One purpose of the invention is to identify a way of transmitting data by means of a transmission channel which effectively counteracts disadvantages previously resulting from a ring structure and linear structure and combines advantages of the one topology group with advantages of the other topology group, whereby to be ensured, in particular, are a hotplug capability and a situationally dependent transmission of process data and acyclic data, including diagnosis data, as well as a low protocol overhead and a synchronous data transfer and data transmission of process data to all connected users.
The solution according to the invention is given by means of a method according to Claim 1 and also by means of a transmission system according to Claim 20.
Advantages and/or preferred embodiments and improvements are the object of the respective subclaims.
According to the invention, it is therefore provided to improve a method for data transmission based on a protocol for cyclic data transmission by means of a transmission channel such that data to be transmitted in an impending cycle are checked against corresponding data of a preceding cycle for redundancy and currency, and in the event of recognition of an impending transmission cycle in which only redundant data without new information content is, in effect, to be transmitted, acyclic data is inserted, in lieu of the data without new information content, in the data field provided for said redundant data.
This preserves the equidistance of the sampling itself as well as the deterministic during the transmission of process data, which are particularly important criteria for control applications, without narrowing the user data throughput.
In order to carry out the method according to the invention, the invention proposes, in particular, a transmission system which in order to transmit and receive data is composed of a common data line between one master and at least one slave user. A multitude of linked slave users can, in this connection, form a user station to which the master is connected by means of the data line. The data transmission system is additionally composed of an application specific protocol, on the basis of which data is transmitted in cyclic time intervals between the master and slaves in order to write data in the slaves, and data is exchanged between the slaves and master in order to read out data from the slaves. The master possesses a dedicated test entity to enable checking data provided for an impending cyclic transmission with regard to its redundancy and currency in comparison to data, stored in a memory device, already transmitted during a preceding cyclic transmission, and also a deciding entity, coupled with the test entity, to enable deciding whether—and if yes, which—acyclic data is to be inserted in a data field in which for all intents and purposes only redundant data would be transmitted without new information content.
Advantageously, within each transmission cycle the master device reads out process input data from slave devices during a respective first data cycle, and during a respective subsequent second data cycle transmits process output data or the acyclic data.
In particular, it is provided that acyclic data can be inserted not only for transmission from the master device to slave devices, but also for transmission from slave devices to the master device.
In addition, a preferred improvement provides for cyclic data to be inserted not only for transmission from the master device to slave devices, but also for transmission between individual slave devices and/or from slave devices to the master device.
For this, it is provided that all user devices read information being transmitted at the same time during a data cycle.
For prompt error recognition, it is additionally provided that the user devices form a test sum or check sum by means of respective received or passively-monitored data, and compare this to a test sum or check sum appended to the received or passively-monitored data.
In a preferred improvement it consequently is provided for an error message to be transmitted back upon detection of an error.
In a practical manner, the invention provides for each data transmission during one data cycle to be commenced with the transmission of an address followed by a function code. A CRC generated by the master advantageously forms the closing.
The invention provides, in particular, for inquiry data, response data, or diagnosis data to be transmitted as acyclic data.
It moreover is advantageous if the master device predetermines a respective instant at which one or several slave users are to transmit acyclic data.
For this it is advantageous if, in order to predetermine such respective instants, the master device transmits, during a preceding data cycle within which acyclic data are transmitted, a corresponding function code at the same time.
In order to increase the error protection, in particular for security-critical processes, it is in addition provided that a normal data cycle comprising cyclic data be carried out at least after the transmission of a predetermined maximum number of consecutive data cycles comprising acyclic data.
Alternatively or additionally it is further provided in a preferred manner that if no error-free cyclic data exchange is activated within a predetermined period, an error is recognized and a pre-parameterized error process commenced.
For the transmission of data during each data cycle, the invention advantageously utilizes the constant external structure of a telegram assembled of an address, function code, a given number of user data and a test sum or check sum, with an Inter-Frame-Timeout, within which no data are transmitted, being advantageously provided between two consecutive telegrams.
The invention additionally proposes not performing a repetition of data transmitted in error during a data cycle until a subsequent corresponding data cycle.
In the event of recognition of the non-availability of a slave device during a data cycle of a contemplated data transmission, a particularly advantageous improvement of the invention further provides for the master device to embed a place holder in the corresponding time window assigned to the slave device.
During a data cycle, diagnosis data to be transmitted for evaluation are preferably commenced by means of a transmission request of the master device, whereby during such a diagnosis cycle information of higher priority is transmitted preferentially.
These and additional features as well as accompanying advantages of the invention are yielded from the following description of preferred exemplary embodiments, with reference being made to the enclosed drawings.
In the drawings,
FIG. 1 shows possible bus accesses within bus cycles preferably used for the method according to the invention,
FIG. 2 shows an example of a frame configuration for a telegram used according to the invention
FIG. 3 shows a telegram configuration during a PD-Write access cycle,
FIG. 4 shows a telegram configuration during a PD-Read access cycle.
FIG. 5 shows a telegram configuration during an acyclic embedded diagnosis access,
FIG. 6 shows a possible topology of the transmission system according to the invention,
FIG. 7 shows an integration of the transmission system according to the invention in an existing bus topology.
The method and transmission system according to the invention is based on a common data line for the transmitting and receiving of data, in particular, of process data. For example, operating on the basis of a LIN bus known from automotive technology is a generic transmission system of this type, for which during given data cycles protocol-specific data can be read out by a master from field devices linked to a field station, and during respective subsequent data cycles these data can be written into such [field devices linked to a field station], at approximately 19.2-38 kbd.
The invention embraces the fact that for many applications the deterministic, thus the predeterminedness, and unchangeability are more important in the transmission of process data than the actual transmission speed itself.
In the present invention said deterministic is determined by means of the bus cycle time of the transmission system, which is advantageously adjustable and for example lies in a range between 10 and 100 ms. Accordingly, a default setting of, e.g., 25 ms is sufficient for a transmission of 16 process data values at 16 bits per cycle.
In the method according to the invention, the transmission of process input data and process output data consequently also occurs, as a matter of principle, at a fixed interval, offset in each case by half the bus cycle time.
With reference being made to FIG. 1, the following description starts first from the fact that the transmission protocol for the cyclic transmission of process input data and process output data makes use of two different services, designated in the following as PD-Read and PD-Write. Accordingly, one bus cycle is composed of one data cycle based on a PD-Read service and a subsequent data cycle based on a PD-Write service.
In the transmission of process output data, a master of the transmission system according to the invention thus transmits to a station in the PD-Write service connected to said master, in principle, all data for the field devices linked to the station, and advantageously subsequently identifies a CRC (cyclic redundancy check) that it also transmits. The transmission system is advantageously designed such that all linked field devices read all information transmitted in this way at the same time, and preferably likewise form a CRC that they compare to the received CRC of the master, such that in the event of an error an error message is generated and, for example, the entire station or individual field devices are operated in a secure status.
In the transmission of process input data, the master transmits, with a PD-Read service, e.g., first a broadcast address followed by a function code. The field devices connected to the station thereupon place their data, thus in particular their process input data, bit for bit on the data line in byte spaces provided for this. In a preferred embodiment the linked field devices are in turn enabled, by monitoring the data line at the same time, to detect all data and to likewise calculate a CRC for this purpose.
In addition, the invention capitalizes on the fact that the process output data, as a rule, does not always have to be transmitted, i.e., particularly if the process output data at hand for transmission has undergone no change whatsoever and the field devices linked to a field station are already in possession of the up-to-date process output data. The master includes for this purpose a test entity to enable ascertaining whether any difference exists in the data to be transmitted from one cycle to the next. If the test entity determines in this connection that no difference exists and if in the preceding cycle no error message has occurred, a deciding entity of the master decides whether acyclic data such as an inquiry, response or diagnosis data is to be transmitted in the impending time slot in lieu of the actual redundant data transmission.
In the example illustrated in FIG. 1, the master consequently transmits, according to the invention, an inquiry indicated as “Request 1” within one bus cycle after the closing of a PD-Read service in the time slot actually provided for a PD-Write service. The instant at which the “slave” is hereupon to send a given response, designated as “Response 1” in FIG. 1, is advantageously determined by the master by means of one bit of a function code. Accordingly, in accordance with FIG. 1, a delay of the response until after the next PD-Read service is preset, thus until the time slot actually provided for the next PD-Write service, such that the deterministic continues to be secured, and in addition the slave has more time for processing the inquiry.
Particularly for security-critical processes, use of the method according to the invention additionally provides that the interruption of a PD-Write cycle cannot exceed a maximum number of consecutive data cycles, and otherwise a pre-parametered error processing, e.g., the operation of the field devices in secure status, will be commenced. The interruption of a PD-Write cycle therefore may occur, e.g. a maximum of 15 consecutive data cycles, and in the 16th time slot a PD-Write access must again occur. Alternatively or additionally it can be preset, in order to improve security, such that within a predetermined period, e.g., of 1000 ms, at least one valid, thus error-free, cyclic data exchange must have occurred, and otherwise all linked field devices recognize an error and commence the pre-parametered error processing.
A preferred, yet fundamentally protocol-dependent frame configuration for the method according to the invention during a PD-Write cycle, PD-Read cycle or acyclic data cycle is illustrated in FIG. 2. The respective telegram length comprises 68 characters in this connection, and advantageously is laid out such that there is no excessive memory requirement for the field devices linked as slaves.
Accordingly, the telegram comprises an address of one byte, which identifies a given user, or in the case of a Broadcast-Address, all users, as the receiver. Following afterwards is a function code, comprising in the present case likewise one byte, which defines the intended function of the subsequent user data. The actual user data comprise, in the present example, 64 bytes followed by a CRC comprising 2 bytes. Between the individual characters of such a telegram a maximum pause cannot be exceeded during transmission, since otherwise an error would be detected. This pause is predetermined, e.g., at 1 ms and also is identified as an Inter-Character-Timeout. Between two consecutive telegrams is provided, in addition, an Inter-Frame-Timeout (Inter-Frame-Timeout) (FIG. 1), e.g. of 2 ms, in order for the possibly required error processing to be executed correctly by the receiver.
A transmitting-back of an Error-Exception-Code and of an Error-Code as illustrated in FIG. 2, thus the notification that an error has been detected and what error has been detected by means of the receiver, preferably occurs only upon detection of such an error and expeditiously begins between one and two milliseconds after the CRC of the sender obtained by the receiver.
The aforementioned preferred, yet merely exemplary frame configuration and the time response therefore is compatible with other protocols, e.g., with the Modbus protocol.
Unlike such a Modbus protocol, however, the function code for application of the invention is advantageously limited to the lower seven bits of the function code byte. For an acyclic service the master signals to the slave or slaves, by means of setting the highest-value bit, that it is not anticipating the response to an inquiry until after the next PD-Read access, as illustrated in FIG. 1. However, since this highest value bit is inserted only between the protocol stacks of the transmitter and receiver in the data stream, the commands in Layer 7 of the OSI layer model likewise are Modbus-compatible.
The transmission of data words (16 bit) occurs, e.g., in the Big-Endian format, i.e., the high byte is transmitted first.
As already disclosed, the invention is based on a data exchange of a fundamentally cyclic construction which takes place in a firmly defined grid and advantageously is partitioned in the aforementioned PD-Read and PD-Write access or cycle, as the case may be, so that with the PD-Write access data is transmitted from the master to the slaves, and transmission occurs in the other direction, thus essentially from the slaves to the master, with the PD-Read access. For the following description, reference moreover should be made to the fact that a respective process datum consists of 16 bits and is referred to as a process data channel (PDC).
The PD-Write access consequently comes into use in particular if the master is to transmit cyclic information to a station comprising a multitude of field devices. Accordingly all users linked to the station, thus the field devices, in this case process the data (PDCs) intended for them at the same time, thereby also executing the desired actions nearly synchronously.
Such a PD-Write access is illustrated by example in FIG. 3. If a user, even the master itself, if applicable, locates an error after or during the transmission, it generates the error response, e.g., what is represented in FIG. 3, subsequent to the transmission based on the PD-Write service. Since upon detection of an error said error response is transmitted back, and as referenced above, the linked users read all data at the same time according to a preferred embodiment, the invention provides for all users, in response to a error response read together, to discard the last-transmitted data such that the data from the last valid, thus error-free, cycle continues to possess validity. A repetition of the telegram by the master, rather than occurring immediately, occurs in the next time slot reserved for a PD-Write service.
The number of PDCs to be transmitted is defined, in principle, by means of the master configuration. If it is set to zero, no PD-Write accesses are performed.
Unlike the PD-Write service and corresponding access to the data line, the PD-Read access is not optional. In principle it serves to transmit data from the field devices of the station to the superimposed control system or master.
According to the invention, however, it is provided, with reference to the PD-Read service and corresponding access to the data line, for data to be distributable also within the station, and thus in essence, between the individual field devices. An exemplary protocol frame configuration during a PD-Read access is illustrated in FIG. 4. There exists for each of the PDCs illustrated in FIG. 4 a so-called “producer” which outputs the data word (16 bit) to the bus at the correct instant. According to the invention, not only the slaves but also the master of the system according to the invention are permitted to be data-producing devices. A device can not only release data of a superimposed system, but also its own data, e.g., digital input data.
Each PD-Read access is commenced by the master with the transmission of the corresponding address and function code. At the conclusion of this, the producer of the first PDC has, e.g., a time of 500 μs to start its data transmission. Should the transmission not yet have begun, for example, after 750 μs, the master recognizes that the producer is not ready for operation, or is not available. In this case the master generates a placeholder for the corresponding PDC by embedding a corresponding profile-dependent error code. The subsequent producers notice no difference through said error processing, and begin their transmission in the time window provided for them. If all PDCs are read in, the master generates a check sum CRC. All users likewise compute a check sum and compare it to that generated by the master. If they detect a difference the error response illustrated, e.g., in FIG. 4 is generated, and according to the preferred embodiment, wherein all users read all data at the same time, all users discard the data of said last cycle. For generation of the check sum it is further advantageous for the producers to not carry this out with the data that they read back from the bus, but with the data that they transmit to the bus, since only this ensures a complete monitoring.
An obvious application for such a PD-Read access is, e.g., the visualization of data on a display. Additional practical applications include, among others, the output of an active power value of a field device, comprising, e.g., an Electronic Load Relay-Motor Management (ELR-MM, Electronic Load Relay-Motor Management) on an analog output terminal, or the expansion of an ELR-MM by means of additional digital inputs and outputs.
The configuration of the individual PDCs is preferably carried out according to the following proposal. As already addressed, a PDC is advantageously composed of a 16-bit data word, which for representation is done in two\'s complement form. Consequently, generic consumers can, by means of a defined description, interpret the data, wherein the inquiry of the description also can take place by means of a service. Content of such a description are, alongside a profile, also the scaling boundaries of the process data value and a symbolic name, which may comprise 16 characters.
Consequently a PDC is configured, e.g., according to