13.02.2013 Views

Evaluation Environment for AUTOSAR-Autocode in Motor Control ...

Evaluation Environment for AUTOSAR-Autocode in Motor Control ...

Evaluation Environment for AUTOSAR-Autocode in Motor Control ...

SHOW MORE
SHOW LESS

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

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

2.8 Example<br />

the RTE and should clarify how components can be implemented and how the API<br />

can be used.<br />

2.8.1 Configuration of the Example<br />

The example is based on a system with two SWCs, which are shown <strong>in</strong> figure 2.8. This<br />

section just conta<strong>in</strong>s an extract of the configuration and some parts of the source code<br />

<strong>for</strong> SWC1. To whole configuration of the system can be found <strong>in</strong> appendix A. The<br />

configuration of the ECU is not shown.<br />

SWC1<br />

run11 run12<br />

SWC2<br />

run21 run22<br />

Virtual Functional Bus<br />

Figure 2.8: Visualization of the example<br />

Task1<br />

Task2<br />

Every SWC uses two ports and has two runnables, which are shown as boxes <strong>in</strong>side<br />

of the components. The l<strong>in</strong>es to the ports show an access to this ports. The runnable<br />

run11 is triggered by a tim<strong>in</strong>g event which occurs every 100ms. Runnable run12 is<br />

triggered by another tim<strong>in</strong>g event which occurs every 50ms. The two runnables of<br />

SWC1 are mapped to the same task Task1. In more detail the events trigger<strong>in</strong>g a<br />

runnable are mapped to a task, but here every runnable is just triggered by one event<br />

and so they only run <strong>in</strong> the context of one Task. The runnable run22 of SWC2 is<br />

also triggered by an tim<strong>in</strong>g event every 50ms and runs <strong>in</strong> the context of Task2. The<br />

other runnable run21 is triggered by the <strong>in</strong>vocation of a server call at the server port.<br />

This runnable is not mapped to a task, but is has the option set, that it can be<br />

<strong>in</strong>voked concurrently. This is one special case, where an event must not be mapped<br />

to a task. Instead a direct call to the runnable should be per<strong>for</strong>med to provide a<br />

better per<strong>for</strong>mance. Both SWCs are mapped to the same ECU. All this <strong>in</strong><strong>for</strong>mation<br />

is reflected by the configuration files.<br />

List<strong>in</strong>g 2.1 shows the def<strong>in</strong>ition of the data elements which are used <strong>for</strong> this example.<br />

The first is the <strong>in</strong>teger type Int16 with a specified range of valid values. The second<br />

type is a str<strong>in</strong>g type, which has a length of 8 characters and the symbol Str<strong>in</strong>g8. To<br />

reference a type, the names of the packages have to be used as path. This means <strong>for</strong><br />

the <strong>in</strong>teger type, that it can be referenced by the path /types/Int16.<br />

The description of the <strong>in</strong>terface of the sender–receiver port used <strong>in</strong> the example is<br />

shown <strong>in</strong> list<strong>in</strong>g 2.2. The <strong>in</strong>terface SR Int16 consists of two data elements <strong>in</strong>tValue1<br />

and <strong>in</strong>tValue2, which are both of type Int16, and it provides a not queued communication.<br />

Here it is shown, how the reference to the data types are used multiple times.<br />

The package names specified <strong>in</strong> the list<strong>in</strong>gs are arbitrary. There is no need to call<br />

17

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

Saved successfully!

Ooh no, something went wrong!