You are on page 1of 3

on frSymbol Page 1 of 3

Topic search

on frSymbol
CAPL Functions » FlexRay » on frSymbol

Syntax on frSymbol
Function The event procedure is called whenever a symbol (wake-up, CAS, MTS) is received.
Parameters —
Selectors Time (data type dword)
The symbol time stamp that has been synchronized with the global time base in the
PC (CAN hardware or PC system clock).
The time stamp must be used if time relations should be regarded with events from
other sources. This time stamp is also output in the Trace Window when receiving a
symbol..
Unit:10 microseconds
Write-protected!
msgChannel
Channel in the tool that the FlexRay CC determines.
Write-protected!
FR_ChannelMask
Identifies the FlexRay channel of the CC. With 1 the symbol was received on channel
A, with 2 on channel B.
Write-protected!
FR_Symbol
Identifies the symbol type (data type: WORD)

0 unknown
1 CAS
2 MTS
3 Wakeup
4 Undefined (used with VN interfaces in asynchronous mode)

Caution!

Any wake-up symbol will only be received, if the wake-up was initiated
externally. Thus, if CANoe initiates a wake-up procedure, then use the
handler on frPocState in order to observe the wake-up pattern
transmission!

Write-protected!
FR_Length
Indicates the length (data type: WORD) of the symbol in bit times.
Write-protected!
FR_Cycle
Current FlexRay cycle number.

mk:@MSITStore:C:\Program%20Files\Vector%20CANoe%2011.0\Help01\CANoeCANal... 2/16/2023
on frSymbol Page 2 of 3

Write-protected!
Availability Since Version Restricted To Measurement Setup Simulation / Test Setup
6.1 SP2 FlexRay • •
Example

The following program reacts on received symbols and prints them in the Write
Window, Trace Window, and logging.
variables
{
const int cWriteTextSize = 512;
char writeTxt[cWriteTextSize];
const int cWriteTextSize2 = 40;
char writeTxt2[cWriteTextSize2];
const int writeSink_Trace = -3;
const int writeSink_Logging = -2;
const int writeSeverity_Information = 1;
}
on frSymbol
{
getFRSymbolName(this.FR_Symbol, cWriteTextSize2, writeTxt2);
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRSymbol %2d (%-
32s) in cycle %3d on channel %2d with Mask %d, Length %d.", getTime(0),
this.FR_Symbol, writeTxt2, this.FR_Cycle, (int)this.MsgChannel,
this.FR_ChannelMask, this.FR_Length);
myprint(writeTxt);
output(this); // only required in Measurement Setup
}
float getTime (float time)
{
return TimeNowNS() / 1000000000.0;
}
void myprint(char text[])
{
write("%s", text);
writeLineEx(writeSink_Trace, writeSeverity_Information, "%s",
text);
writeLineEx(writeSink_Logging, writeSeverity_Information, "%s",
text);
}
int getFRSymbolName (word symbol, word nameSize, char name[])
{
int r = -1;
if (symbol == 0) {
snprintf(name, nameSize, "Unknown");
r = symbol;
} else if (symbol == 1) {
snprintf(name, nameSize, "CAS");
r = symbol;
} else if (symbol == 2) {
snprintf(name, nameSize, "MTS");
r = symbol;
} else if (symbol == 3) {
snprintf(name, nameSize, "Wakeup Symbol");
r = symbol;
} else {
snprintf(name, nameSize, "Unspecified");
r = -1;
}
return r;

mk:@MSITStore:C:\Program%20Files\Vector%20CANoe%2011.0\Help01\CANoeCANal... 2/16/2023
on frSymbol Page 3 of 3

Version 11.0 SP3


© Vector Informatik GmbH

mk:@MSITStore:C:\Program%20Files\Vector%20CANoe%2011.0\Help01\CANoeCANal... 2/16/2023

You might also like