23.03.2017 Views

wilamowski-b-m-irwin-j-d-industrial-communication-systems-2011

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SafetyLon 47-9<br />

base. Typically, such a timer is called watchdog timer and realized in hardware. So software functions<br />

are monitored by measuring the execution time. After completion of a function the watchdog is reset by<br />

a software command. If the execution takes too long, the watchdog is triggered and predefined actions<br />

are taken. The type of monitoring is integrated to check if the system is blocked or modified in a way, so<br />

that execution takes much longer than expected.<br />

Logic-based monitoring is used to check if functions have not been bypassed. Therefore, a counter<br />

is implemented that is increased every time the function has been executed. Such a counter is available<br />

for every safety function. The counter values are exchanged within fixed periods of time between the<br />

safety chips to detect a fault in the firmware. If the counter values are not equal on both safety chips,<br />

predefined actions are taken.<br />

The SafetyLon protocol stack incorporates functionality to send and receive sensor/actuator data in a<br />

safe way. Additionally, it supports network management activities such as configuring a node and allows<br />

time synchronization [12]. The message structure used for the different tasks is shown in Figure 47.7.<br />

Every safe message starts with a specific header called ID. It specifies the message type (data or command<br />

message) and the data length n. The ID follows a 3 byte address field. It includes the safe source<br />

address of a node. Every safe node holds a table with a list of valid sources. The safe address (of network<br />

variables that is different from a safe node address mentioned in Section 47.3) guarantees that only<br />

safe devices (valid sources) can exchange safety-related messages. The ID and safe address prevent that<br />

unsafe messages look like safe messages.<br />

The next field consists of the upper 2 bytes of the timestamp in the first part of the message and the<br />

lower 2 bytes in the second part of the message. By checking the timestamp at the destination, a delay,<br />

repetition, wrong sequence, and, in conjunction with safe addresses, an insertion of messages is avoided.<br />

In addition, for detecting data corruption during transmission, two CRCs with different generator<br />

polynomials are used. In case of a payload smaller than 8 bytes a 1-byte CRC, otherwise a 2-byte CRC<br />

is appended. The CRCs and the comparison of the duplicated message parts (i.e., ID, safe address, and<br />

data) finally satisfy the requirements for a safe data transmission sufficiently.<br />

In the case of sending a sensor value, each safety chip builds message part 1 and message part 2 and<br />

calculates the CRC. Safety Chip 1 receives the complete message from the other chip and compares<br />

the whole message. If the CRCs and the two message parts are identical, the message is sent, otherwise<br />

discarded. Consequently, faulty messages due to a node internal failure are not sent. That avoids<br />

wastage of bandwidth and saves computational resources on receiver side since it need not process<br />

the faulty message.<br />

On the receiver side, the message is forwarded from Safety Chip 1 to Safety Chip 2 and processed by<br />

both (two-channel structure): first, the CRC is checked in order to verify integrity; second, the timestamp<br />

is used to check for insertion, repetition, and wrong sequence of a message; third, the payload<br />

field is compared bit by bit to detect other integrity failures not being revealed by the CRC. Results on<br />

the checks are exchanged between both safety chips. Only if both agree on a positive result, the payload<br />

is released for further processing for example by the user-application software.<br />

Safety functions must be called and executed on a regular base. For that reason, a scheduler and<br />

a state machine are included in the firmware. To avoid computational overhead and to ease the integration<br />

of safety requirements, no commercial operating system is used. However, a static scheduling<br />

mechanism is realized with a fixed cycle time and a static sequence of functions, i.e., a single-task<br />

scheduling. Such an approach first of all ensures a deterministic timing behavior. It guarantees that test<br />

pulses are sent or the RAM test is executed in fixed time intervals that cannot be ensured for example by<br />

ID<br />

Safe address<br />

Time stamp<br />

MSWord<br />

Safety-related data:<br />

n byte<br />

CRC<br />

a<br />

ID<br />

Safe address<br />

Time stamp<br />

LSWord<br />

Safety-related data:<br />

n byte<br />

CRC<br />

b<br />

FIGURE 47.7<br />

SafetyLon message structure.<br />

© <strong>2011</strong> by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!