CANoe DENoe - KEMT FEI TUKE
CANoe DENoe - KEMT FEI TUKE
CANoe DENoe - KEMT FEI TUKE
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
26<br />
compilation the CAPL compiler replaces the symbolic name by the corresponding<br />
identifier 0x64.<br />
Now you only need to define which actions should be performed when the event occurs.<br />
Since the program is to count messages, the variable counter must be must<br />
be incremented whenever a message is registered. The complete procedure appears<br />
as follows:<br />
on message EngineData<br />
{<br />
}<br />
counter++;<br />
As a last step, the output to the Write window must still be implemented. Finally, the<br />
program should not just count messages, but also keep track of how many messages<br />
have been counted.<br />
The output to the Write window should occur when the ‘a’ key is pressed. Therefore,<br />
you must define another event procedure for the event "Press key 'a'". In the Browser<br />
tree you select the type Keyboard. This causes the previously defined on message<br />
procedure to disappear, since it belongs to a different event type. Of course it still<br />
remains a component of the CAPL program and will appear again as soon as you<br />
select the Messages event type again.<br />
Now insert a Keyboard event in the CAPL program from the popup menu. A new<br />
procedure template will appear in the Procedures Text Editor, which you fill out as<br />
follows:<br />
on key 'a'<br />
{<br />
}<br />
write("%d EngineData messages counted",counter);<br />
The format entry %d refers to the integer variable counter, which is entered after<br />
the comma. For the most part, this format string conforms to the C function<br />
printf().<br />
That completes the program. Save it and then start the compiler either with the F9<br />
key, or the main menu command Compiler│Compile or by the lightning icon button<br />
on the toolbar. If you have made an error in creating the program, a message window<br />
will open showing you the error. Double click this error message to go to the location<br />
where the error occurred. After you have corrected it and saved the program file<br />
again, recompile the program. Once the program has compiled without errors, the<br />
message Compiled appears in the status bar at the bottom of Browser's main window.<br />
Now start the measurement. The generator block in the transmit branch begins to<br />
cyclically transmit messages of the type EngineData, which are now counted by your<br />
program. Whenever you press the 'a' key the text "n EngineData messages<br />
counted" can be seen in the Write window, whereby n represents the number of<br />
messages counted.<br />
© Vector Informatik GmbH <strong>CANoe</strong>/<strong>DENoe</strong> Manual Version 4.1.1