The present invention relates to a method and a device for padding segments for transmitting data on a bus system and a corresponding bus system.
The networking of control devices, sensors, and actuators with the aid of a communication system, a bus system, has drastically increased in recent years in the construction of modem motor vehicles or even in mechanical engineering, in particular in the field of machine tools and in automation. Synergistic effects may be achieved in this case by distributing functions to multiple control devices. These are referred to as distributed systems. Different stations communicate increasingly via a bus or a bus system. The communication traffic on the bus system, access and receiving mechanisms, and error management are regulated via a protocol.
The CAN (controller area network) is established as the protocol in the field of motor vehicles. This is an event-controlled protocol, i.e., protocol activities such as the transmission of a message are initiated by events having their origin outside the communication system itself. The unique access to the communication system or bus system is triggered via priority-based bit arbitration. A requirement for this is that every message is assigned a unique priority. The CAN protocol is very flexible. Adding further nodes and messages is therefore possible without problems as long as there are still free priorities.
An alternative approach to such an event-controlled, spontaneous communication is the purely time-controlled approach. All communication activities on the bus are strictly periodic. Protocol activities such as the transmission of a message are triggered only by the progression of a time that is valid for the entire bus system. Access to the medium is based on the assignment of time ranges or time slots in which a transmitter has the exclusive transmission right. Adding new nodes is possible when the corresponding time slots were previously left free. This circumstance requires the message sequence to be established even before startup, an operating plan being prepared that must fulfill the requirements of the messages in regard to repetition rate, redundancy, deadlines, etc.
In addition to the event-controlled approach and the purely time-controlled approach, a time-controlled CAN approach, the TTCAN (time triggered controller area network), is also known. This fulfills the requirements described above for time-controlled communication and the requirements for a certain degree of flexibility. The TTCAN fulfills these requirements through the construction of the communication cycle (basic cycle) in exclusive time windows or time slots for periodic messages of specific communication users and in arbitrating time windows or time slots for spontaneous messages of multiple communication users.
In addition to the cited bus systems, a plurality of bus or communication systems for connecting users in distributed systems are known. In the framework of the cited bus systems and other bus systems, for example, before the background of the flexibility, the width of the time slots or of the segment provided for data transmission is selectable in each case through the total number of bits transmitted therein. However, if the width of the data segment or shorter segment or time slot is selected or preset, particularly during configuration, the length of the message transmitted therein is fixed by this selected total number of bits or the selected width. This means that longer messages must be distributed over multiple such segments and shorter messages must be padded in order to reach the total number of bits in the segment. This is referred to as padding. Such padding of missing data in a segment is described in regard to a bus system in U.S. Pat. No. 5,598,579. U.S. Pat. No. 6,349,348 also shows padding, i.e., the padding of missing data with a filling pattern if the data size is smaller than a predetermined size.
However, in this case, the actual data content is first copied into a memory or buffer, for example, and subsequently supplemented with the padding pattern or filling pattern in order to obtain the predetermined total number of bits or the total size of the segment. The following types of error may arise in this case, however:
Therefore, it has been shown that the cited related art is not capable of providing optimal results in every aspect, from which the object results of improving the situation, in particular of controlling the described sources and types of error.
The present invention describes a method and a device for padding segments for transmission of data on a bus system, the segments having a predetermined total number of binary information pieces, particularly bytes, and the data being transmitted in segments, in the event of a transmission of data including less binary information, bytes in particular, than the predetermined total number of the segment, the missing binary information, bytes in particular, of the data being padded to the total number of the segment through a filling pattern corresponding to the number of binary information pieces, bytes in particular, a filling pattern whose number of binary information pieces, bytes in particular, corresponds to the total number of the segment first being written into the segment and the binary information, bytes in particular, of the data subsequently being written into the same segment, the particular binary information, bytes in particular, of the filling pattern being overwritten by the binary information, bytes in particular, of the data. Therefore, the above-mentioned error sources may advantageously be prevented, since the filling pattern is overwritten with the regular data and not vice versa.
Advantageously, in regard to a bus system according to the present invention, the binary information, bytes in particular, of the filling pattern and the binary information, bytes in particular, of the data is written in a buffer memory into the segment, and this segment is then transmitted out of the buffer memory to the bus system in the framework of the access and receiving mechanisms, i.e., at the instant provided.
This is advantageously a time-controlled bus system in this case, the segments corresponding directly to time slots on the bus system, the data being transmitted in the corresponding time slots. A bus system according to the present invention divides a communication cycle into a static segment and a dynamic segment in this case, a preset of the total number of bits of the segment that may be selected freely during configuration being made possible in the static segment in particular.
Therefore, users 101 to 103 also represent three variants of user structures, further variants being immediately obvious and also usable via combination, but are not shown for reasons of clarity. User 101 shows an interface 104 to bus 100 having a processing unit 113, which contains a buffer memory 107 and a control unit or a microcomputer or a processor 110, which is shown separately from interface unit 104 in the first example. This means that communication is controlled in the user itself, for example. User 102 again shows an interface unit 105, which contains buffer memory 108 in this case. Processing unit 114 therefore does not contain the buffer memory, but merely control unit 111, i.e., the control may be performed by the user itself here, the buffering occurring in interface unit 105. Interface unit 104 or 105 itself may also be internally or externally located in relation to the user in this case. As a further example, user 103 shows an interface unit 106 which, in addition to buffer memory 109, also contains a processing unit, in particular a control unit such as a bus controller 112. In this case, the entire communication is therefore processed and controlled by interface unit 106. Interface unit 106 may also be positioned internally or externally in relation to user 103 in this instance. The processing units, in particular 110 and 111, are also able to process further tasks in addition to controlling communication.
In the exemplary bus system shown in
Furthermore, the length of a segment S1 through S10 is selected as 16 bytes and shown, for example, in first segment S1 from T1 through T17. Since interframe gap IG may be arbitrary, in particular even 0, only the data-carrying segment is identified as a segment in this example. However, the duration of the segment is actually the data-carrying segment plus the associated interframe gap, i.e., S1+IG1 in this case, which is followed by the next segment. This means that longer messages, i.e., in this example greater than 16 bytes in particular, must be distributed over a plurality of segments by a higher application layer, as this is performed in the course of message segmenting, e.g., by the FTCom Layer in OSEKtime. Shorter messages, i.e., shorter than 16 bytes in particular in this case, must be expanded or supplemented according to the specification, i.e., protocol guideline, i.e., the missing bytes must be padded to the greatest possible message length, also 16 bytes in this case, the padding cited. This means that the messages are transmitted in binary information in particular, i.e., bits or bytes, the size of the message segments being selectable arbitrarily, 16 bytes in this case.
Therefore, in the example cited here a selected division of the communication cycles occurs, i.e., a division into 10 segments or slots. In this case, the duration of a slot is the length of the 16-byte message plus associated interframe gap IG. Due to the possibility of the interframe gap being 0, segment and data segment are equivalent and are designated as S1 in this example. Therefore, the communication cycle is composed of 10×16 bytes plus the interframe gap, shown here from T29 through 30, a time period in which no message may be transmitted, known as network idle time NIT. This is optional, but shown herewith as a possible feature of the bus protocol. In this communication cycle, a configuration including only one static segment is assumed as an example. For reasons of clarity, a possible dynamic segment between the static segment and the network idle time, i.e., at T29, is not shown.
User 103 is, for example, a simple angle sensor in the motor vehicle, which only has a 2-byte message to transmit. Therefore, a message memory assigned to this sensor is also only tailored, specified, and implemented for this data width, for reasons of cost in particular. Nonetheless, this angle sensor must also behave on the presented bus system according to the specification, i.e., the bus protocol, and transmit a 16-byte message in its assigned segment, i.e., its transmission slot. For example, this slot is segment S1 plus associated interframe gap IG1 in this case. This means that shortly before transmission, the actual prepared message, for example, of exactly 2 bytes, i.e., from T1 through T3 in this case, i.e., bytes S1, S12, and S13, would be stored in the transmission buffer or transmission memory, this data content, i.e., the sensor value, then having to be padded or expanded by a further 14 bytes. In this case, according to the current procedure, the bytes would typically be placed left or right in the frame, i.e., by most significant bits, MSB, or least significant bits, LSB, which facilitates the further padding according to the current procedure. These used filling bytes, i.e., from S14 through S116 in the example, are referred to as padding bytes or also as the padding pattern or filling pattern, meaning a selected character segment that uniquely identifies the padding pattern or filling pattern, e.g., O×FF in hexadecimal representation. In the present case, sensor value 0×8005, corresponding to the angle information minus 0.5 degree in hexadecimal coding with a negative prefix, for example, would be supplemented using most significant bit, MSB (set for a negative number) to
0×80/05/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF, supplemented in transmission memory or transmission buffer 109 in particular.
According to the current procedure if, as described above, the actual data content is copied into transmission buffer 109 and then supplemented with the padding pattern, incorrect padding may occur in case of error.
A) In this case, for example, the message content will be partially overwritten. In this example, an incorrect message content,
0×80/0F/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF, arises. This means that the incorrect message content arising in this case will then be erroneously transmitted as sensor information, and the CRC, i.e., the cyclic redundancy check, calculated during transmission may not uncover this error. A plausibility test in the application may possibly uncover this error, but this is subject to great uncertainty.
B) Furthermore, the message content may also be completely overwritten, which then leads to 0×FF/F/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF, through which an incorrect message content would again arise. The cyclic redundancy check calculated during transmission may not uncover this error and even a plausibility test in the application may not uncover this error.
C) Furthermore, it is possible that the message length will be supplemented beyond the permissible length. In this case, data contents or message contents of undefined content arise, such as 0×80/05/77/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF/FF, i.e., an incorrect message content also arises here. The cyclic redundancy check calculation merely occurs over the 16 bytes and may not uncover the error. The plausibility test may uncover this error, but only when the application checks beyond the actual message, i.e., the two bytes.
To achieve the object, the present invention suggests that the segment, i.e., the transmission buffer in particular in this case, be padded, and padded completely, with the filling pattern or padding pattern before each transmission procedure. In this context, of course, the predefined message or data width, i.e., 16 bytes in this case for example, must be maintained. This means that transmission slot or segment S1 of sensor 103 is now padded with a filling pattern or padding pattern, i.e., bytes S11 through S116. Only then will the message content, i.e., the sensor value of 2 bytes in this case, be copied at the correct point in the segment, i.e., in the transmission buffer in particular, thereby overwriting the padding or filling pattern at these points. Above-mentioned error cases A through C are therefore prevented. In addition, any arbitrary position may be predetermined for the data content, i.e., the actual sensor value to be transmitted, since the filling pattern is written first and a complicated subsequent padding with bytes in the course of the padding is no longer necessary.
Therefore, the simple method cited according to the present invention allows high reliability to be produced via a simple measure, in particular by design, the efficiency of the protocol execution not being endangered.
Number | Date | Country | Kind |
---|---|---|---|
102 16 921.7 | Apr 2002 | DE | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/DE03/01245 | 4/14/2003 | WO | 6/9/2005 |