You are on page 1of 2093

User Manual

CAPL Functions

Version 1.1
Englisch
Imprint

Vector Informatik GmbH


Ingersheimer Straße 24
D-70499 Stuttgart

The information and data given in this user manual can be changed without prior notice. No part of this manual may be reproduced in
any form or by any means without the written permission of the publisher, regardless of which method or which instruments, electronic
or mechanical, are used. All technical information, drafts, etc. are liable to law of copyright protection.
© Copyright 2012, Vector Informatik GmbH
All rights reserved.
User Manual
Topic: Technical Reference: CAPL Functions

Technical Reference: CAPL Functions

General
The CAPL language allows you to write programs for individual applications. For example, in the
development of network nodes, the problem often arises that the remaining bus nodes are not available
yet for tests. The system environment can be emulated with the help of CAPL, e.g. the data traffic of all
remaining stations can be emulated.

With CAPL you can also write programs to analyze data traffic which are adapted to your problem, or
programs for a gateway — a connection element between two buses — so that data can be exchanged
between different buses.

The emphasis in modeling lies in the description of the node‘s bus behavior, for which the language
capabilities of CAPL are normally sufficient.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General Event Procedures

General Event Procedures


CAPL Function Overview » General Event Procedures

CAPL is a procedural language in which the execution of program blocks is controlled by events. These
program blocks are referred to as event procedures. Within an event procedure there may be reactions to
the following events:

Event Event procedure

Receipt of any message on *

Receipt of a CAN message on message

Occurrence of an error frame on errorFrame

Environment variable change (only CANoe) on envVar

System variable change on sysVar


on sysVar_change

Notification of system variable updates without on sysVar_update


value change

Press of a key on key

Elapse of a timer on timer

Response to signal changes

Receipt of a signal on signal_update

Signal change on signal

Events of measurement system

Initialization of measurement (before start) on preStart

Program start on start

Measurement stop has been requested on preStop

End of measurement on stopMeasurement

Events of CAN controller

CAN controller goes to ErrorActive on errorActive

CAN controller goes to ErrorPassive on errorPassive

CAN controller reaches the Warning Limit on warningLimit

CAN controller goes to Bus Off on busOff

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General Event Procedures

The program code that you define in event procedures is executed when the event occurs. For example,
you could send a message onto the bus in response to a key press (on key), track the occurrence of
messages on the bus (on message), or else execute cyclically defined actions (on timer).

Example

Info for using handlers within CAPL test nodes.

Note for preStop handler, event handler and time handler:


If a test is stopped (test module inactive), these handlers will not be executed within the CAPL
test node.

Example:

In a XML test module a CAPL test node is added.


on preStart
{
write ("start");
}

on preStop
{
write ("stop");
deferStop (5000);
}

If the test module is inactive, the on preStart() write is displayed, on preStop will not be
executed.

| LIN Event Procedures | MOST Event Procedures | FlexRay Event Procedures | Unconditional (Boxed) Event Procedures |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on *

Event Procedure: on *
CAPL Function Overview » General Event Procedures » on *

You can access the on * event procedure in measurement setup.

If you add a CAPL program in measurement setup, it will initially act as a filter, as only messages/frames
called explicitly in the CAPL program will be allowed through.

on * enables all messages/frames not executed in the context of a previous procedure to be forwarded in
all bus systems.

You can add the event procedure in the Browser Tree with the All Frames shortcut menu item New.

Example

All messages except the CAN message with the ID 500 are forwarded.
// blocking CAN ID 500
on message 500 {
}
on * {
output(this);
}

In the event procedure, the keyword this can only be used for a call in the output function and to read
out the time stamp.

Example
// counting and viewing all frames (after a filter)
on * {
write("Received frame nr. %d, time %d", ++gFrameCount, this.time);
output(this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on envVar

Event Procedure: on envVar


CAPL Function Overview » General Event Procedures » on envVar

The event procedure type on envVar is provided to react to value changes of environment variables in
CANoe's network node models. In contrast to messages, environment variables are not blocked by CAPL
nodes in a data flow branch of the measurement configuration. Therefore, when there are two CAPL nodes
in series, both react to the same environment variable with the event procedure on envVar. With the
functions getValue and putValue you can query or set the active environment variable value in the
simulation configuration. But please note that you cannot call the function putValue() from the
measurement configuration window.

In the procedure on envVar X { ... } there is a reaction to the event Change of Environment Variable
X. The environment variable can be accessed by the key word this within the event procedure, e.g. to
determine the value of the variable with the function getvalue.

Example

In the following example there is a reaction to a change in the environment variable Switch, and
the value is assigned to the signal Stop of the message Controller:
on envvar Switch {
// Declare a CAN message to be transmitteed
message Controller msg;

// Read out the value of the switch


// Assign to the signal Stop
msg.Stop = getvalue(this);
// Output the message on the bus
output(msg);
}

Info

Starting with CANoe version 7.1 SP4, you can also define handlers for several environment
variables. For this, use the syntax "on envVar (envVar1 | envVar2 | ...)", e.g. "on envVar
(envSwitch1 | envSwitch2)". The handler is called whenever one of the environment
variables changes. The keyword this can only be used in such a handler if all variables have the
same data type. CAPL programs which contain such handlers can not be used with CANoe
versions < 7.1 SP4.

Since version 7.2, you can retrieve the name of the environment variable as a string constant
with this.name.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on errorFrame

Event Procedure: on errorFrame


CAPL Function Overview » General Event Procedures » on errorFrame

This event procedure is called when an error state (Error frame) occurs on the bus.

Use this procedure, for example, to analyze bus errors (frequency, activities during the time frame of the
event, etc.) in a CAPL node in the evaluation branch.

Within this procedure timestamp, channel number and ECC register are available via the this variable.

The access is executed with the following syntax:

• this.time_ns (timestamp, unit: 1 nanosecond, type qword)


• this.time (timestamp, unit: 10 microsecond, type dword)
• this.can (channel number)
• this.ecc (ECC error code, type byte)
• this.sof (start of frame, unit: 1 nanosecond, type qword, only valid for CAN-Core-based interfaces)
• this.ErrorPosition_Bit (bit error position in the frame, only valid for CAN-Core-based interfaces)
• this.ErrorPosition_Time (error position in the frame, unit: 1 nanosecond, Only valid for CAN-Core-
based interfaces)

Example

In the following example it shall be checked if the error frame is a transmission or a reception
error.
This information is set in the 5th bit of the ECC register. A transmission error is indicated by 0, a
reception by 1. To get the 5th bit you have to mask the ECC register with 0x20.
on errorFrame
{
switch (this.ecc & 0x20)
{
case (0x20): // in case of reception error
write ("%d Ch %d RxErr", this.time, this.can);
return;
case (0): // in case of transmission error
write ("%d Ch %d TxErr", this.time, this.can);
return;
};
}

Following information appears in the Write window: 10.123456 Ch 2 RxErr

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on key

Event Procedure: on key


CAPL Function Overview » General Event Procedures » on key

With on key procedure you can execute defined actions with a key press.

E.g. write
message 100 msg;
...
on key 'a' {
output(msg);
}

to transmit message 100 on the bus with every kepress on key 'a'. The code for a key press can be
entered either as a character, a number or a predefined identifier for a function keys. The event
procedure on key * reacts to all key presses.

In on key procedures the key word this serves to determine the active key code. For example, if you wish
to incorporate the handling of keyboard entries in an event procedure you could write it as the following
code:
on key * {
switch(this) {
case 'a' : ... break;
case F10: ... break;
...
}

Info

If for example a CAPL program contains the on key procedures on key 'a' and on key *, the
procedure on key 'a' will be called up, when key 'a' is used. With all other keys the procedure
on key * will be called up.

The keys <ESC>, <F7>, <F8> and <F9> are not supported of on key procedures.

In CAPL the different keys have to be called as follows:

Key CAPL code

<F1> - <F12> (<F7>, <F8> and <F9> are not F1 - F12


supported)

<Shift>+<F1> - <Shift>+<F12> shiftF1 - shiftF12

<Ctrl>+<F1> - <Ctrl>+<F12> ctrlF1 - ctrlF12

<Ctrl>+<Page up> / <Ctrl>+<Page down> ctrlPageUp / ctrlPageDown

<Page up> / <Page down> PageUp / PageDown

<End> End

<Home> Home

<Insert> InsertKey

<Delete> DeleteKey

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on key

< ←>, <→>, <↑>, <↓


> CursorLeft, CursorRight, CursorUp, CursorDown

<Ctrl>+< >,
←>,<Ctrl>+<
<Ctrl>+<→>, ctrlCursorLeft, ctrlCursorRight, ctrlCursorUp,
↓>
ctrlCursorDown

Examples

To react to activation of character keys you would write the particular character, enclosed in
single quotation marks, or enter the character code:

on key 'a' Reacts on pressing key 'a'

on key ' ' Reacts on pressing the spacebar

on key 0x20 Reacts on pressing the spacebar

You would use symbolic identifiers to react to activation of function keys:

on key F1 Reacts on pressing <F1>

on key shiftF3 Reacts on pressing <Shift>+<F3>

on key ctrlF12 Reacts on pressing <Ctrl>+<F12>

on key PageUp Reacts on pressing <Page up>

on key ctrlPageDown Reacts on pressing <Page down>

on key Home Reacts on pressing <Home>

on key End Reacts on pressing <End>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on message

Event Procedure: on message


CAPL Function Overview » General Event Procedures » on message

The event procedure type on message is available to have CAPL nodes react to the receipt of CAN
messages.

To access the control information you would use selectors. The key word this is available within an on
message procedure, to access the data of the message that has just been received.

CAPL programs are by default not transparent to bus events. This means that a CAPL node in the
evaluation branch of the measurement configuration will block the data flow to its right side. You must
explicitly program the passing of messages in CAPL nodes in the evaluation branch.

To make the CAPL node transparent to messages you would write:


on message * {
output(this);
};

However, please note that you are programming a recursive if you are using this code in CANoe's
simulation configuration:
For each message received, the reaction is to immediately resend the same message on the bus, causing
the event procedure on message * to be called, etc.

Info

If for example a CAPL program contains the on message procedures on message 123 and on
message *, the procedure on message 123 will be called up, when a message with the
identifier 123 is received. For all other messages the procedure on message * will be called up.

In contrast to bus events, value changes of environment variables are transparent to CAPL
programs in the evaluation branch. Thus, a new environment variable is also available on the
right side of CAPL nodes, and the user does not need to program this explicitly.

Examples

Gateway example

The gateway should transmit all messages between Bus 1 and Bus 2 in both directions:
on message CAN1.*
{
message CAN2.* msg;
if(this.dir != rx) return; //important!
msg = this;
output(msg);
}

on message CAN2.*
{
message CAN1.* msg;
if(this.dir != rx) return; //important!
msg = this;
output(msg);
}

Further examples

on message 123 React to message 123 (dec, standard identifier), regardless of


receiving chip

on message 123x React to message 123 (dec, extended identifier), regardless of


receiving chip

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on message

on message 0x123 React to message 123 (hex, standard identifier), regardless of


receiving chip

on message 0x123x React to message 123 (hex, extended identifier), regardless of


receiving chip

on message React to message EngineData


EngineData

on message CAN1.123 React to message 123 if it is received by CAN1 chip

on message * React to all messages

on message CAN2.* React to all messages received by CAN2 chip

on message 0,1,10- React to messages 0, 1 and 10 through 20


20

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on sysVar

Event Procedure: on sysVar


CAPL Function Overview » General Event Procedures » on sysVar

The event procedure type on sysVar is provided to react to value changes of system variables in CANoe.
In contrast to messages, system variables are not blocked by CAPL nodes in a data flow branch of the
measurement configuration. Therefore, when there are two CAPL nodes in series, both react to the same
system variable with the event procedure on sysVar.

In the procedure on sysVar X{ ... } there is a reaction to the event change of system variable X. The
system variable can be accessed by the key word this within the event procedure, e.g. to determine the
value of the variable with the ‘@’ syntax or the function sysGetVariable.
The time stamp of the last system variable change (in nanoseconds since measurement start) can be
retrieved with "this.time_ns".

X must be the fully qualified name of the system variable, i.e. the variable name preceded by all name
space names, separated by "::". The system variable must exist at compile time. Please note that the
automatic make mechanism in CANoe currently does not trigger a compile whenever a system variable
definition changes.

The procedure on sysVar is called only when the value of the variable changes. It can also be written as
on sysVar_change. If you want to be notified of value updates to the variable which don’t change the
value, you should use on sysVar_update instead.

Example

In the following example there is a reaction to a change on the I/O input DI_0 (first input port),
and the new value of the I/O signal is assigned to the signal IOValue of a CAN message
transmitted by the node Gateway.
on sysvar IO::DI_0
{
$Gateway::IOValue = @this;
}

Info

Starting with CANoe version 7.1 SP4, you can also define handlers for several system variables.
For this, use the syntax "on sysVar (sysVar1 | sysVar2 | ...)", e.g. "on sysVar
(IO::DI_0 | IO_DI1)". The handler is called whenever one of the system variables changes (or
is updated if you use on sysvar_update). The keyword this can only be used in such a handler
if all variables have the same data type. CAPL programs which contain such handlers can not be
used with CANoe versions < 7.1 SP4.

Since version 7.2, you can retrieve the name of the system variable as a string constant with
this.name and its namespace with this.namespace.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on timer

Event Procedure: on timer


CAPL Function Overview » General Event Procedures » on timer

You can define time events in CAPL. When this event occurs, i.e. when a certain period of time elapses,
the associated on timer procedure is called. You can program cyclic program sequences by resetting the
same time event within the on timer procedure.

The timer variable can be accessed with the key word this within the event procedure.

You would start a previously-defined timer with the function setTimer.

In CAPL exists the following variable types for timer:

• timer - timer based on seconds


• msTimer - timer based on milliseconds

After the timer has elapsed, the associated on timer procedure is called. The maximum time is
2147483647 s (=596523.23h) for variables of the type timer and 2147483647 ms (= 2147483,647 s =
596,52h) for variables of the type msTimer. With the function cancelTimer you can stop a timer which has
already been started and thereby prevent the associated on timer procedure from being called.

Info

If several CAPL timers elapse to the exact same time:

• all timers will be executed


• the event procedures of these timers will be operated in an undefined sequence

Example

In the following example always message 100 is transmitted on the bus 20 milliseconds after
pressing key 'a':
msTimer myTimer;
message 100 msg;
...
on key 'a' {
setTimer(myTimer,20);
}
...
on timer myTimer {
output(msg);
}

Version extensions

• Version 7.2

Since version 7.2, you can retrieve the name of the timer as a string constant with this.name.

• Version 7.5

Since version 7.5 you can save timers in an array.

Example
variables
{
mstimer myTimers[10];
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedure: on timer

You have to set each single timer but the same timer procedure will be called for all timers. For that
the procedure has to contain a parameter (dword type) that indicates the index of the just run out
timer.

Example
on start
{
dword i;
for (i = 0; i < elcount(myTimers); ++i)
myTimers[i].set(100 + 20 * i);
}

on timer myTimers(dword index)


{
// ...
}

In the procedure the keyword this describes the whole array. E.g. if you want to set the just run out
timer, you have to add an index to this.

Example
write("Timer %s with index %d fired", this[index].name, index);
setTimer(this[index], 2000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Events of the CAN Controller

Events of the CAN Controller


CAPL Function Overview » General Event Procedures » Events of CAN Controller

These event procedures are called when the CAN controller's state or one of it’s error counters
(errorCountRX, errorCountTX) changes. You would use this procedure to monitor the error counters (e.g.
output of a warning) or to end the measurement or simulation.

Within these procedures the error counters of the CAN controller are made available by the this variable.
They are accessed with the following syntax:

• this.errorCountRX (Receive error counter)


• this.errorCountTX (Transmit error counter)
• this.can (Assign the channel)

Info

Error counters are supported and thus changed by the complete XL family.

Examples

on errorPassive procedure
on errorPassive {
...
write("CAN Controller is in errorPassive state")
write(" errorCountTX = %d", this.errorCountTX);
write(" errorCountRX = %d", this.errorCountRX);
};

on busOff procedure
on busOff
{
int errRxCnt;
int errTxCnt;
int channel;
double timestamp; // [seconds]
timestamp = (double)timeNow() / (double)100000;
channel = this.can;
errRxCnt = this.errorCountRX;
errTxCnt = this.errorCountTX;
Write("Bus Off: time=%f channel=%d, errRxCnt=%d, errTxCnt=%d",
timestamp, channel, errRxCnt, errTxCnt);

resetCanEx(channel);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Event Procedures: Example

Event Procedures: Example


CAPL Function Overview » General Event Procedures » Example

When one of the following events occurs (Message with ID 100 is received, key a is pressed, or Timer
Clock_1 elapses) then, in this example

• an on message procedure,
• an on key procedure or
• an on timer procedure is called.

In doing so, an appropriate text is always output to the Write window by the write function:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Events of the Measurement System

Events of the Measurement System


CAPL Function Overview » General Event Procedures » Events of Measurement System

These event procedures are called before the start of measurement, at the start, and when the
measurement is ended. For example, you can initialize variables here, output a start report to the Write
window with the write function, start Timer or output statistics after the end of measurement.

The on preStart procedure is only used to initialize variables, to display messages in the write window
and to read in data from files. At the moment the on preStart procedure is executed, not all possibilities
of the system (CANoe) are available. It is not possible for example to send messages on the bus with the
output function.

The on preStop handler is called after a measurement stop has been requested. The on preStop function
can be used to carry out some final actions that must be done before the measurement stop actually takes
effect.
Note that some actions, such as setting environments, would have no effect if they were only initiated in
on StopMeasurement. If more complex pre-stop actions like sending a shutdown message to an attached
ECU and waiting for an acknowledgement message are required, a DeferStop call within the on preStop
function might be useful to further defer the measurement stop. If DeferStop is not called in the CAPL
node, all pre-stop activities are assumed to be completed after the on preStop handler is finished, i.e.
measurement immediately stops unless there are other nodes that are deferring a measurement stop.

Info for CANoe users

At the measurement start it may be necessary, in the network node models, to execute the
same actions that otherwise would be performed during the measurement when environment
variables change. In particular, it may be necessary to initialize environment variables, to start
timers activated in response to changes of environment variables, or to send messages on the
bus with the start values of environment variables.

Since these functions are normally performed in the on envVar event procedures of the model,
the CAPL function CallAllOnEnvVar is provided, with which you can call all of the model‘s on
envVar event procedures. You would execute this function in the on start procedure to
initialize the environment variables of the model.

Examples

on preStart procedure
on preStart
{
write("Measurement started!");
msg_Count = 0;
}

on start procedure
on start
{
write("start Node A");
setTimer(cycTimer,20);
CallAllOnEnvVar(); // CANoe only
}

on preStop procedure
on preStop
{
message ShutdownReq m;

output(m);
DeferStop(1000);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Events of the Measurement System

on stopMeasurement procedure
on stopMeasurement
{
write("Message 0x%x received: %d", msg.id, msg_Count);
}

Info for using handler within CAPL test nodes.

Note for preStop handler, event handler and time handler:


If a test is stopped (test module inactive), these handlers will not be executed within the CAPL
test node.

Example:

In a XML test module a CAPL test node is added.


on preStart
{
write ("start");
}

on preStop
{
write ("stop");
deferStop (5000);
}

If the test module is inactive, the on preStart() write is displayed, on preStop will not be
executed.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Unconditional (Boxed) Event Procedures

Unconditional (Boxed) Event Procedures


CAPL Function Overview » Unconditional (Boxed) Event Procedures

Info

The usage of "boxed" event procedures is not compatible to older versions of CANoe. They can
only be used in CAPL programs with CANoe version 7.0 and higher.

Normally, the generic event procedures (e.g. on message *) are only called if there is no more specific
event procedure in the program for the message which is received.

Example
on message 100
{
write("specific");
}
on message *
{
write("generic");
}

If the message 100 is received, the output in the Write window will be "specific" only.

If you want to implement an event procedure which is called always, regardless of other event
procedures, you can use a "boxed" event procedure signified by [*].

Example
on message 100
{
write("specific");
}
on message [*]
{
write("generic");
}

If the message 100 is received, the output in the Write window will be "generic" followed by
"specific".

The "boxed" event procedures are always called before other, possibly more specific event procedures in
the program.

Info

If you implement a "boxed" event procedure in the measurement setup, you should not call
output(this) because of the danger of transmitting the message two times, once in the
"boxed" event procedure and once in the specific event procedure. Call output(this) only in
specific event procedures and unboxed generic event procedures.

You may use a "boxed" event procedure with the following message types:

• message
• pg
• linmessage

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Unconditional (Boxed) Event Procedures

• frSlot

| General Event Procedures | LIN Event Procedures | MOST Event Procedures | FlexRay Event Procedures |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Keyword this

Keyword this
CAPL Function Overview » General Event Procedures » this

Within an event procedure for receiving a CAN object or an environment variable, the data structure of
the object is designated by the key word this.

For example, you could access the first data byte of message 100 which was just received by means of the
following:
on message 100 {
byte byte_0;
byte_0 = this.byte(0);
...
}

Analogously, you could read the new value of the integer environment variable Switch which has just been
changed by means of the following:
on envVar Switch {
int val;
val = getvalue(this);
...
}

Info

You should not change the value of this within an event procedure. However, to permit the use
of this as a parameter, value changes made to this are not prohibited by the CAPL compiler.
However, please note that these types of write accesses to this are only valid locally (i.e. within
the event procedure). When compiling you will receive an appropriate warning. Thus, if you call
the function output(this) after this has been changed in an on message event procedure, the
unchanged original of this is passed, and not your change.

Special Case: Output of signal values using this


on message 101
{
float a = 0;
a = this.Signal1.phys;
}

Info

For a signal length of more than 32 bit the read out of signal values from a message with
this.<signalName> is not yet supported. In this case the dollar notation must be used, see the
example below.

on message 101
{
float a = 0;
a = $Signal1;
}

| Access to signal values using this |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Classes and Objects in CAPL

Classes and Objects in CAPL


CAPL Function Overview » Classes and Objects

In CAPL predefined data types are available that can be used like classes in object-oriented programming
languages such as C++.

This means that functions in the form of methods can be called on variables (objects) of these data types
(classes), and that under certain circumstances destructors can be called automatically to stop a process
and invalidate the variable.

Classes (predefined data types)

Classes Timer, File Tcp Udp Test Test Diag Diag Associative CAN
Ms Socket Socket Check Stimulus Request Response fields
Timer

Method call

Methods are called on a variable of a class type by writing a point and the method name after the variable
name.

Example

Method call
myTimer.set(long duraton);

Function call
void settimer (timer myTimer, long duration);

Automatic destructors

If you declare the variable of a class type within a function or a test case, but not in the global variables
section, a destructor will be called on this variable as soon as the process leaves the block in which the
variable has been declared.

Example
if (someCondition)
{
File file1("C:\test.txt");
// ...
} // file1 is closed here automatically

If you declare the variable of a class type in the global variables section, the destructor will not be called
automatically. You will need to call it explicitly once the object is no longer needed. The call corresponds
to a call to a standard method.

A renewed call of a destructor on a already destructed object has no effect.

Constructors

Most variables of class types which have destructors have to be initialized explicitly before they can be
used. The initialization functions used for this purpose are called constructors.

There are two types of constructors:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Classes and Objects in CAPL

• simple constructors

Simple constructors can transfer the necessary parameters directly when a variable is declared:

Example
File f("C:\test.txt");

However, this is not permitted if the variable has been declared in the global variables section. In
this case, the constructor has to be called explicitly:

Example
f.open("C:\test.txt");

• constructor functions

Constructor functions are also used for initialization. Their call is class name::method name:

Example
TestCheck c = TestCheck::CreateTimeout(500);

If a constructor is called again on an object which has already been initialized, the destructor of the old
object is called first and then the variable is initialized.

In the case of constructor functions, the function is evaluated before the old object is destroyed.

Example
TestCheck c = TestCheck::CreateTimeout(500));
// Sequence:
// 1. Call CreateTimeout, i.e. build new check
// 2. destruct old check
// 3. initialize c with the new check
c = TestCheck::CreateTimeout(200);

Further information

Variables of the same class type cannot be assigned to one another. However, they can be
transferred to functions as parameters. Please bear in mind that in this case multiple variables
might stand for the same object and that calling a destructor on one variable will invalidate the
other variables.

You can also generate fields from variables of the same class type, but only in the global
variables section. Structures or associative fields cannot contain variables of a class type.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: Associative fields

Class: Associative fields


CAPL Function Overview » Classes and Objects » Associative fields

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor —

Destructor —

Methods clear

containsKey

remove

size

| Associative Fields CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: CAN

Class: CAN
CAPL Function Overview » Classes and Objects » CAN

The CAN objects (CAN1, CAN2, ...) provide access to channel specific statistics.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor —

Destructor —

Methods BusLoad

ChipState

ErrorFrameCount

ErrorFrameRate

ExtendedFrameCount

ExtendedFrameRate

ExtendedRemoteFrameRate

ExtendedRemoteFrameCount

OverloadFrameCount

OverloadFrameRate

PeakLoad

RxChipErrorCount

StandardFrameRate

StandardFrameCount

StandardRemoteFrameRate

StandardRemoteFrameCount

TxChipErrorCount

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: DiagRequest

Class: DiagRequest
CAPL Function Overview » Classes and Objects » DiagRequest

This class represents a diagnostic request.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor Specially with the qualifier, e.g. IDENTIFICATION::Development_Data::Read;

Destructor —

Methods CheckValidNegResCode

CheckValidPrimitive

CheckValidRespPrimitive

GetComplexParameter

GetComplexParameterRaw, SetComplexParameterRaw

GetComplexRespParameter

GetComplexRespParameterRaw

GetLastResponse

GetLastResponseCode

GetObjectName

GetObjectPath

GetParameter

GetParameterName

GetParameterPath, GetRespParameterPath

GetParameterRaw, SetParameterRaw

GetParameterSize

GetParameterType, GetRespParameterType

GetParameterUnit

GetPrimitiveByte

GetPrimitiveData, SetPrimitiveData

GetPrimitiveSize

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: DiagRequest

GetRespParameter

GetRespParameterRaw

GetRespPrimitiveByte

GetRespPrimitiveSize

GetSuppressResp, SetSuppressResp

IsParameterConstant, IsRespParameterConstant

IsParameterDefault

IsRaw

IsRawResp

ResetParameter

Resize | Resize

SendMarked

SendNegativeResponse

SendNetwork

SendRequest

SetComplexParameter

SetParameter

SetPrimitiveByte

SetRespPrimitiveByte

SetSuppressResp

SetTimeoutHandler

| Diagnostics CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: DiagResponse

Class: DiagResponse
CAPL Function Overview » Classes and Objects » DiagResponse

This class represents a diagnostic response.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor Specially with the qualifier, e.g. diagResponse this resp;

Destructor —

Methods CheckValidNegResCode

CheckValidPrimitive

GetComplexParameter

GetComplexParameterRaw, SetComplexParameterRaw

GetComplexRespParameterRaw

GetLastResponse

GetObjectName

GetObjectPath

GetParameter

GetParameterName

GetParameterPath, GetRespParameterPath

GetParameterRaw, SetParameterRaw

GetParameterSize

GetParameterType, GetRespParameterType

GetParameterUnit

GetPrimitiveByte

GetPrimitiveData, SetPrimitiveData

GetPrimitiveSize

GetResponseCode

GetSendingMode

IsNegativeResponse

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: DiagResponse

IsParameterConstant

IsParameterDefault

IsPositiveResponse

IsRaw

ResetParameter

Resize | Resize

SendNegativeResponse

SendPositiveResponse

SendResponse

SetComplexParameter

SetParameter

SetPrimitiveByte

| Diagnostics CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: File

Class: File
CAPL Function Overview » Classes and Objects » File

This class is used to read from a file or write to a file.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor open

Destructor close

Methods getBinaryBlock

getString

getStringSZ

putString

rewind

writeBinaryBlock

writeString

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TcpSocket

Class: TcpSocket
CAPL Function Overview » Classes and Objects » TcpSocket

This class is used to implement TCP network communications.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor functions accept

open

Destructor close

Methods bind

connect

getLastSocketError

getLastSocketErrorAsString

listen

receive

send

setSocketOption

shutdown

| TCP/IP API |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TestCheck

Class: TestCheck
CAPL Function Overview » Classes and Objects » TestCheck

Checks are functions which run parallel to the defined test sequence or simulation node and continuously
check compliance with specific conditions.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor functions CreateAllNodesBabbling, StartAllNodesBabbling

CreateAllNodesDead, StartAllNodesDead

CreateErrorFramesOccured, StartErrorFramesOccured

CreateInconsistentDLC, StartInconsistentDLC

CreateInconsistentRxDLC, StartInconsistentRxDLC

CreateInconsistentTxDLC, StartInconsistentTxDLC

CreateMostCriticalUnlock, StartMostCriticalUnlock

CreateMostErrorMessage, StartMostErrorMessage

CreateMostLightOff, StartMostLightOff

CreateMostMethodProtocolError, StartMostMethodProtocolError

CreateMostNetState, StartMostNetState

CreateMostPropertyProtocolError, StartMostPropertyProtocolError

CreateMostShortUnlock, StartMostShortUnlock

CreateMostStableLock, StartMostStableLock

CreateMsgAbsCycleTimeViolation, StartMsgAbsCycleTimeViolation

CreateMsgDistViolation, StartMsgDistViolation

CreateMsgOccurrenceCount, StartMsgOccurrenceCount

CreateMsgRelCycleTimeViolation, StartMsgRelCycleTimeViolation

CreateMsgRelOccurrenceViolation, StartMsgRelOccurrenceViolation

CreateMsgSignalValueInvalid, StartMsgSignalValueInvalid

CreateMsgSignalValueRangeViolation, StartMsgSignalValueRangeViolation

CreateNodeBabbling, StartNodeBabbling

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TestCheck

CreateNodeDead, StartNodeDead

CreateNodeMsgsRelCycleTimeViolation, StartNodeMsgsRelCycleTimeViolation

CreateNodeMsgsRelOccurrenceViolation, StartNodeMsgsRelOccurrenceViolation

CreateSignalValueChange, StartSignalValueChange

CreateTimeout, StartTimeout

CreateUndefinedMessageReceived, StartUndefinedMessageReceived

StartLINDiagDelayTimesViolation

StartLINETFViolation

StartLINHeaderToleranceViolation

StartLINMasterBaudrateViolation

StartLINMasterInitTimeViolation

StartLINReconfRequestFormatViolation

StartLINRespErrorSignal

StartLINRespToleranceViolation

StartLINSchedTableViolation

StartLINSyncBreakTimingViolation

StartLINSyncDelTimingViolation

StartLINWakeupReqLengthViolation

StartLINWakeupRetryViolation

Destructor destroy

Methods reset

start

stop

QueryEventInterval

QueryEventMessageContents

QueryEventMessageId

QueryEventMessageName

QueryEventNodeName

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TestCheck

QueryEventReason

QueryEventSchedSlotIndex

QueryEventSignalValue

QueryEventStatus

QueryEventStatusToLog

QueryEventStatusToWrite

QueryEventTimestamp

QueryEventTiming

QueryNumEvents

QueryNumRequests

QueryNumTimedoutRequests

QueryPrecision

QueryRequestDstAdr

QueryRequestFBlockId

QueryRequestFunctionId

QueryRequestInstId

QueryRequestOpType

QueryRequestSrcAdr

QueryRequestTimestamp

QueryStatAvResponseTime

QueryStatEventFreePeriodAvg

QueryStatEventFreePeriodMax

QueryStatEventFreePeriodMed

QueryStatEventFreePeriodMin

QueryStatMaxValidResponseTime

QueryStatMinResponseTime

QueryStatNumProbes

QueryStatProbeIntervalAvg

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TestCheck

QueryStatProbeIntervalMax

QueryStatProbeIntervalMin

QueryValid

| Test Service Library Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: TestStimulus

Class: TestStimulus
CAPL Function Overview » Classes and Objects » TestStimulus

This class can be used to generate a specific value pattern for a signal or an environment variable for
stimulating a device.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor CreateCSV (cyclical); CreateCSV (non-cyclical)

CreateEnvVar

CreateRamp (limits taken from database); CreateRamp (limits user defined)

CreateToggle (limits taken from database); CreateToggle (limits user defined)

Destructor destroy

Methods reset

start

stop

QueryValid

| Test Service Library Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: Timer, MsTimer

Class: Timer, MsTimer


CAPL Function Overview » Classes and Objects » Timer, MsTimer

These classes are used to execute a specific function at regular intervals.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor —

Destructor —

Methods set

cancel

timeToElapse

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Class: UdpSocket

Class: UdpSocket
CAPL Function Overview » Classes and Objects » UdpSocket

This class is used to implement UDP network communications.

Note

The methods are linked to the description of the corresponding CAPL function.

Constructor function open

Destructor close

Methods bind

getLastSocketError

getLastSocketErrorAsString

receiveFrom

sendTo

setSocketOption

| TCP/IP API |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

General CAPL Functions


CAPL Function Overview » General CAPL Functions

Access to CAN and Other Hardware

Functions Short description

canSetChannelAcc Sends received messages through to CANoe via an acceptance filter.

canSetChannelMode Activates/deactivates the TxReq of the CAN controller.

canSetChannelOutput Defines the response of the CAN controller to the bus traffic and sets the ACK
bit.

getCardType Determines the type of CAN platform being used.

getCardTypeEx Determines the card type of CAN channel.

getChipType Determines the type of CAN controller used.

InterfaceStatus The callback occurs when the status of the connection to the interface
hardware is changed.
output Outputs a message or an error frame from the program block.

resetCan Resets the CAN controller.

ResetCanEx Resets the CAN controller for one specific CAN channel.

ScanBaudrateActive Determines the baud rate for the given channel.

ScanBaudratePassive Starts the scan and detects the baud rate on the given channel.

setBtr Sets another baud rate.

setCanCabsMode Sets various CANcab modes.

setOcr Sets the Output Control Register.

xlAcquireLED Acquires the specified LEDs of a hardware device.

xlReleaseLED Releases specified LEDs.

xlSetLED Sets specified LEDs.

Access to CANoe Environment Variables and Panels

Functions Short description

callAllOnEnvVar Calls all event procedures for environment variables (on envVar).

ClockControlReset Resets the Clock Control designed as stop watch in the Panel Designer.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

ClockControlStart Starts the Clock control designed as stop watch in the Panel Designer.

ClockControlStop Stops the Clock Control designed as stop watch in the Panel Designer.

closePanel Closes a panel.

enableControl Selective activation and deactivation of special elements.

getValue Determines the value of the environment variable.

getValueSize Returns the size of the environment variable value in bytes.

MakeRGB Calculates the color value from the three primary color components.

openPanel Opens a panel.

putValue Assigns the value to the environment variable.

putValueToControl Assigns the value to the multi display.

SetClockControlTime Sets the time of the Panel Designer clock control.

SetControlBackColor Sets the background color of panel elements.

SetControlColors Sets the background and text color of panel elements.

SetControlForeColor Sets the text (foreground) color of panel elements.

SetControlProperty Sets a property of an ActiveX control.

SetDefaultControlColors Sets the background and text color of panel elements to the default colors
defined in the Panel Designer.
SetMediaFile Replaces the media file of the Panel Designer Media Player element.

SetPictureBoxImage Replaces the image of the Panel Designer Picture Box element.

Byte Swapping (Intel/Motorola)

Functions Short description

swapDWord Swaps bytes of parameters.

swapInt

swapLong

swapWord

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

CANdb Functions

Functions Short description

GetFirstCANdbName Finds out the name of the first assigned database.

getMessageAttrInt Gets the value of a message attribute from the database.

GetMessageID Finds out the message ID.

GetMessageName Finds out the message name.

GetNextCANdbName Finds out the names of the other assigned databases.

setSignalStartValues Sets the values of the signals in the parameter to the start values defined in the
database.

File Functions

Functions Short description

fileClose Closes the specified file.

fileGetBinaryBlock Reads characters from the specified file in binary format.

fileGetString Reads a string from the specified file.

fileGetStringSZ Reads a string from the specified file.

filePutString Writes a string in the specified file.

fileRewind Resets the position pointer to the beginning of the file.

fileWriteBinaryBlock Writes bytes in the specified file.

GetOfflineFileName Returns the complete path of the currently used offline source file.

getAbsFilePath Gets the full path name for a path defined relative to the current configuration.

getProfileArray Reads the value of the given variable from the specified section in the specified
file.
getProfileFloat

getProfileInt

getProfileString

Open This function opens the file named filename.

openFileRead Opens the file for the read access.

openFileWrite Opens the file for the write access.

setFilePath Sets the read and write path to the directory.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

setWritePath Sets the write path for the function openFileWrite.

writeProfileFloat Opens the file, searches the section and writes the variable.

writeProfileInt

writeProfileString

Flow Control

Functions Short description

canOffline Cuts the connection between the node and the bus.

canOnline Restores the connection of the node to the bus.

getStartdelay Determines the value of the start delay configured for this network node in the
Simulation Setup.

isOfflineMode Gets the information if CANoe is in offline mode.

isSimulated Gets the information if CANoe is in simulated mode.

setStartdelay Sets the value of the Start Delay for this network node.

stop Programmed interrupt of the ongoing measurement.

Language Support and Debugging

Functions Short description

elCount Determines the number of elements of an array.

fileName Output of the CAPL program in the Write window.

halt Stops the execution of the simulation.

inspect Causes an update of the variables displayed on the Inspect side of the Write
window.

runError Triggers a run error.

setWriteDbgLevel Sets the priority level for the writeDbgLevel CAPL function.

writeDbgLevel Outputs a message to the Write window with the specified priority.

Logging Functions

Functions Short description

setLogFileName Sets the name of the logfile.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

setPostTrigger Sets the posttrigger of the logging.

setPreTrigger Sets the pretrigger of the logging.

StartLogging Starts all logging blocks immediately bypassing all logging trigger settings.

StopLogging Stops all logging blocks immediately bypassing all logging trigger settings.

trigger Activates/Deactivates logging triggering of all logging and trigger blocks.

triggerEx Activates/Deactivates logging triggering of a special logging or trigger block.

writeToLog Writes an output string to an ASCII logging file.

writeToLogEx Writes an output string to an ASCII logging file.

Other Functions

Functions Short description

CompleteStop Indicates completion of pre-stop activities after a measurement stop has


been deferred.

DeferStop Defers a measurement stop so that activities can be completed before the
stop takes effect.

FDXTriggerDataGroup Triggers the transmission of a data group via CANoe FDX protocol.

GetBusContext Returns the current bus context of the CAPL block.

GetBusNameContext Returns the context of the specified bus.

GetComputerName Retrieves the fully qualified name of the computer.

GetEventSortingStatus Determines the Event Sorting state.

GetIPAddress Retrieves the default (first) IP address of the computer as a string.

gmLanGetPID Gets the parameter ID of the message.

gmLanGetPrio Gets the priority of the message.

gmLanGetSourceId Gets the source address of the message.

gmLanId Creates a message ID for a GMLAN message.

gmLanSetPID Sets the parameter ID of the message.

gmLanSetPrio Sets the priority of the message.

gmLanSetSourceId Sets the source address of the message.

isStatisticAcquisitionRunning Tests whether an acquisition range has already been started.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

SetBusContext Sets the bus context of the CAPL block.

startStatisticAcquisition Starts a new acquisition range.

stopStatisticAcquisition Stops a started acquisition range.

traceSetEventColors Sets the font, and background color for the message display in the Trace
window.

Replay Functions

Functions Short description

ReplayResume Starts the Replay block after it is suspended.

ReplayStart Starts the Replay block.

ReplayState Returns the state of the Replay block.

ReplayStop Stops the Replay block.

ReplaySuspend Suspends the Replay block .

StartMacroFile Starts playing the macro.

StartReplayFile Starts playing the replay file.

StopMacroFile Stops the macro from playing.

StopReplayFile Stops the replay file from playing.

Standard / Extended Identifiers

Functions Short description

isStdId Checks parameter for standard identifier .

isExtId Checks parameter for extended identifier.

mkExtId Returns an extended ID.

valOfId Returns the value of a message identifier independent of its type.

Standalone Mode

Functions Short description

StandaloneConfigOpen Opens the rtcfg file with the given name as standalone configuration.

StandaloneConfigSetDefault Changes the default configuration file.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

String Functions

Functions Short description

_gcvt Converts a number to a string.

atodbl Converts a string into a double number.

atol Converts a string to a LONG number.

ltoa Converts a number to a string.

snprintf Prints a formatted string to character array.

strlen Gets the length of a string.

strncat Appends a string to another string.

strncmp Compares the number of characters of two strings.

strncmp_off

strncpy Copies a string to another string.

strncpy_off

strstr Searches a string in another string.

strstr_off

substr_cpy Copies a substring to another string.

substr_cpy_off

str_match_regex Checks whether a string completely matches a regular expression


pattern.
str_replace Replaces all occurrences of a text in a string with another string.
Replaces a part of a string with another string.
str_replace_regex Replaces all occurrences of pattern in a string with another string.

strstr_regex Searches for a regular expression pattern in a string.

strstr_regex_off

toLower Transforms a character or string to lower case.

toUpper Transforms a character or string to upper case.

Time Management

Functions Short description

cancelTimer Stops an active timer

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

ConvertTimestamp Converts a timestamp to separate parts.

ConvertTimestampNS

EnvVarTimeNS Returns the time stamp of the environment variable envVariable in


nanoseconds.

getDrift Determines the constant deviation when Drift is set.

getJitterMax Determines the upper limit for the allowable deviation when Jitter is set.

getJitterMin Determines the lower limit for the allowable deviation when Jitter is set.

getLocalTime Returns details to the current date and time.

getLocalTimeString Copies a printed representation of the current date and time.

isTimerActive Return value indicates whether a specific timer is active.

MessageTimeNS Returns the time stamp in nanoseconds.

setDrift Sets a constant deviation for the timers of a network node.

setJitter Sets the Jitter interval for the timers of a network node.

setTimer Sets a timer.

timeDiff Time difference between messages or between a message and the current
time in ms.

timeNow Supplies the current simulation time [10 microseconds].

timeNowFloat Supplies the current simulation time [10 microseconds].

timeNowInt64 Supplies the current simulation time [nanoseconds].

timeNowNS Supplies the current simulation time [nanoseconds].

timeToElapse Returns a value indicating how much more time will elapse before an on
timer event procedure is called.

Trigonometric and Mathematical Functions

Functions Short description

arccos Calculates arccosine of a value.

arcsin Calculates arcsine of a value.

arctan Calculates arctangent of a value.

_ceil Calculates the ceiling of a value.

_floor Calculates the floor of a value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

_Log Calculates the natural logarithm.

_Log10 Calculates the logarithm to base 10.

_max Returns the maximum of the parameters.

_min Returns the minimum of the parameters.

_pow Returns x to the power of y.

_round Rounds a number.

abs Returns the absolute value

cos Calculates the cosine.

exp Calculates the exponential function.

random Calculates a random number.

sin Calculates the sine.

sqrt Calculates the square root.

User Interactions

Functions Short description

keypressed Returns the key code of a currently pressed key.

msgBeep Plays back a sound predefined by the Windows system.

sysExec, sysExecCmd Executes an external command.

sysExit Exits the system (CANoe) from within a CAPL program.

sysMinimize Minimizes or restores the application window of CANoe.

write Outputs a text message to the Write window .

writeClear Clears the contents of the specified page in the Write window.

writeConfigure Configures the specified page in the Write window.

writeCreate Generates a new page in the Write window with the specified name.

writeDestroy Removes the specified page from the Write window.

writeEx Writes the text into the last line of the specified window or into a tab of the Write
window without previously creating a new line.

writeLineEX Writes the text into a new line of the specified window or into a tab of the Write
window.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: General CAPL Functions

writeTextBkgColor Sets the color for text background of the specified page in the Write window.

writeTextColor Sets the color for text of the specified page in the Write window.

| File Search Procedure | File Functions | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: abs

abs
CAPL Function Overview » General » abs

Syntax long abs(long x);

double abs(double x);

Function Returns the absolute value.

Parameters Value whose absolute value is to be returned.

Return values Absolute value of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

2.5 — • •

Example
long x;
x = abs(15); // Result: 15

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: arccos

arccos
CAPL Function Overview » General » arccos

Syntax double arccos(double x);

Function Calculates arccosine of x.

Parameters x

Value between –1 and 1 whose arccosine is to be calculated. Values outside this range
cause a CAPL runtime error.

Return values Arcus Cosine of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Example
double x;
x = arccos(0); // result PI/2
x = arccos(1); // result 0

| arcsin | arctan |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: arcsin

arcsin
CAPL Function Overview » General » arcsin

Syntax double arcsin(double x);

Function Calculates arcsine of x.

Parameters x

Value between –1 and 1 whose arcsine is to be calculated. Values outside this range cause
a CAPL runtime error.

Return values Arcus Sine of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Example
double x;
x = arcsin(1); // result PI/2
x = arcsin(0); // result 0

| arccos | arctan |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: arctan

arctan
CAPL Function Overview » General » arctan

Syntax double arctan(double x);

Function Calculates arctangent of x.

Parameters x

Value whose arctangent is to be calculated.

Return values Arcus Tangent of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Example
double x;
x = arctan(0); // result 0
x = arctan(1); // result PI/4

| arccos | arcsin |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: atodbl

atodbl
CAPL Function Overview » General » atodbl

Syntax double atodbl(char s[]);

Function The function converts the string s into a double number. Normally, the base is decimal
and must have the following format:
[Blank space] [Sign] [Digits] [.Digits] [ {d | D | e | E}[Sign]Digits]

String parsing ceases at the first non-compliant character.

If the string cannot be converted into a number, 0.0 is returned.

If the string starts with 0x, the base used is 16. Only integer numbers can be read in.

Parameters Input string to be converted.

Return values Double number, the converted string.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — • •

Example
double d;
d = atodbl(" -3.7"); // -3.7
d = atodbl("0x1F"); // 31.0
d = atodbl("1.3E2"); // 130.0

| atol |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: atol

atol
CAPL Function Overview » General » atol

Syntax long atol(char s[]);

Function This function converts the string s to a LONG number. The number base is decimal.
Starting with string 0x, base 16 is used. Leading blanks are not been read.

Parameters String to be converted.

Return values long integer

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
long z1;
long z2;
z1 = atol("200");
z2 = atol("0xFF");
...

Result:
z1 = 200, z2 = 255

| ltoa |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: callAllOnEnvVar

callAllOnEnvVar
CAPL Function Overview » General » callAllOnEnvVar

Syntax void callAllOnEnvVar();

Function Calls all event procedures for environment variables (on envVar). This can be necessary at
measurement start to initialize environment variables, to start timers activated in
response to changes of environment variables, or to send messages on the bus with the
start values of environment variables.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
on start
{
callAllOnEnvVar();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: cancelTimer

cancelTimer
CAPL Function Overview » General » cancelTimer

Syntax void cancelTimer(msTimer t);

void cancelTimer(timer t);

Method t.cancel();

Function Stops an active timer.

Parameters Timer or msTimer variable.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

7.0 SP5: method — • •

Example
variables {
msTimer takt;
message 100 data = {dlc = 1, byte(0) = 0xFF, dir = Tx};
}
on Timer takt{
output(data);
setTimer(takt, 200);
}
on key F1 {
cancelTimer(takt); // cancel timer
write("canceled");
}
on key F2 {
setTimer(takt, 200); // set timer to 200ms
write("start");
}

| setTimer | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANdelaLibCloseChannel

CANdelaLibCloseChannel
CAPL Function Overview » General » CANdelaLibCloseChannel

Syntax void CANdelaLibCloseChannel(char ECUqualifier[])

Function Closes the communication channel to the control unit, thereby terminating the sending of
'Tester Present' on the selected diagnostics channel for the selected diagnostic
descriptions.

If necessary in the context of sending requests from the Diagnostics Console, the Fault
Memory window and diagnostics test modules which do not implement a dedicated
callback interface for the transport protocol layer, the channel can be restored
automatically.

This function can be used, for example, to ensure that a 'Tester Present' sent cyclically
does not prevent the bus switching to sleep mode in the context of network management
when the Diagnostics Console is in use.

Parameters ECUqualifier

Qualifier associated with the diagnostics description whose channel is to be closed and/or
for which no more 'Tester Present' requests are to be sent.

Return values void

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 SP2 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: canOffline

canOffline
CAPL Function Overview » General » canOffline

Syntax void canOffline(); // Form 1 obsolete

dword canOffline(dword flags); // Form 2

Function Cuts the connection between the node and the bus. Messages send from the node are not
passed through to the bus. The function canOnline() will restore the connection.

If the node is set to offline, output instructions for sending messages in CAPL or
NodeLayer DLL are ignored (refers to a node locally only).
Regardless of the status, all messages are received in the CAPL program/NodeLayer.

Form 1 only has an effect on the CAPL-program.

In Form 2 you can choose between the CAPL-program and/or the Nodelayer-DLL.

Parameters Flags

Indicates the deactivated part of the node.

1 Deactivates the CAPL-program

2 Deactivates the Nodelayer

3 Deactivates the CAPL-program and the Nodelayer

Return values Form 2 returns the part of the node being online before the function call. Equal to the
flags.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
...
canOnline(); // Activates CAPL-Program. Form 1
...
var = canOnline(2); // Activates Nodelayer-DLL

| canOnline |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: canOnline

canOnline
CAPL Function Overview » General » canOnline

Syntax void canOnline(); // Form 1 obsolete

dword canOnline(dword flags); // Form 2

Function Restores the connection of the node to the bus. After a call to the function canOffline()
the node can be connected to the bus with the function canOnline(). Messages send
from the node are passed through to the bus.

If the node is set to offline, output instructions for sending messages in CAPL or
NodeLayer DLL are ignored (refers to a node locally only).
Regardless of the status, all messages are received in the CAPL program/NodeLayer.

Form 1 only has an effect on the CAPL-program.

In Form 2 you can choose between the CAPL-program and/or the Nodelayer-DLL.

Parameters Flags

Indicates the activated part of the node.

1 Activates the CAPL-program

2 Activates the Nodelayer

3 Activates the CAPL-program and the Nodelayer

Return values Form 2 returns the part of the node being online before the function call. Equal to the
flags.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
...
canOnline(); // Activates CAPL-Program. Form 1
...
var = canOnline(2); // Activates Nodelayer-DLL

| canOffline |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: canSetChannelAcc

canSetChannelAcc
CAPL Function Overview » General » canSetChannelAcc

Note

This function can only be used with Vector drivers. The vcndrvms.dll must be at least
Version 4.2.40.

Syntax long canSetChannelAcc(long channel, dword code, dword mask);

Function Via an acceptance filter the CAN controllers control which received messages are sent
through to CANoe.
Some controller chips, such as the SJA 1000, expect partitioning into acceptance mask
and acceptance code.

Parameters CAN channel

Acceptance code for ID filtering


Acceptance mask for ID filtering
Return values 0: ok

!=0: error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example
on key 'a'
{
/*

To distinguish whether the filter is for standard or extended identifiers. For extended
identifiers the MSB of the code and mask are set.

Description:
Different ports may have different filters for a channel. If the CAN hardware cannot
implement the filter, the driver virtualises filtering.
Accept if ((id ^ code) & mask) == 0).
*/
long channel =2;
dword code=0x10;
dword mask=0x10;
canSetChannelAcc(channel,code,mask);
write("channel mask set");
}

| canSetChannelMode | canSetChannelOutput |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: canSetChannelMode

canSetChannelMode
CAPL Function Overview » General » canSetChannelMode

Note

This function can only be used with Vector drivers. The vcndrvms.dll must be at least
Version 4.2.40.

Syntax long canSetChannelMode(long channel, long gtx, long gtxreq);

Function Activates/deactivates the TxReq and Tx of the CAN controller. This function does nothing
with the Ack bit.

Parameters CAN channel

gtx

0 tx off

1 tx on

gtxreq

0 gtxreq off

1 gtxreq on

Return values 0: ok

!=0: error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example
on key 't'
{
long channel =2;
char gtx =1;
char gtxreq =1;
canSetChannelMode(channel,gtx,gtxreq);
Write("Mode set to tx=%d, txreq=%d",gtx,gtxreq);
}

| canSetChannelAcc | canSetChannelOutput |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: canSetChannelOutput

canSetChannelOutput
CAPL Function Overview » General » canSetChannelOutput

Note

This function can only be used with Vector drivers. The vcndrvms.dll must be at least
Version 4.2.40.

Syntax long canSetChannelOutput(long channel, long silent);

Function Defines the response of the CAN controller to the bus traffic and sets the ACK bit.
The CAN transmitter of the channel is switched off. So CANoe does not generate an Ack
bit here, and messages can no longer be sent. It is still possible to receive messages.

Parameters CAN channel

silent

0 silent

1 normal

Return values 0: ok

!=0: error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example
on key 's'
{
long channel =2;
long silent =0;
canSetChannelOutput(channel,silent);
Write("silent set to %d",silent);
}

| canSetChannelAcc | canSetChannelMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _ceil

_ceil
CAPL Function Overview » General » _ceil

Syntax float _ceil(float x);

Function Calculates the ceiling of a value, i.e. the smallest integer larger or equal to the value.

Parameters x

Value of which the ceiling shall be calculated.

Return values Ceiling of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example
float x;
x = _ceil(3.6); // x == 4.0

| _floor | _round |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlReset

ClockControlReset
CAPL Function Overview » General » ClockControlReset

Syntax void ClockControlReset(char[] panel, char[] control);

Function Resets the Clock Control designed as stop watch with the Panel Designer (setting Mode =
StopWatch).

The displayed time is reset to 00:00:00 or 00:00 depending on the Panel Designer setting
Display Seconds.

Info

The stop watch cannot be reset when it is already running.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only access the control by its name. In the property dialog
of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The name
of the environment variable, system variable or signal could be specified as following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Clock Control • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlReset

Example
// Reset the clock control designed as stop watch.
on key 'a'
{
ClockControlReset("ClockControl", "StoppWatch");
}

| ClockControlStart | ClockControlStop | SetClockControlTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlStart

ClockControlStart
CAPL Function Overview » General » ClockControlStart

Syntax void ClockControlStart(char[] panel, char[] control);

Function Starts the Clock Control designed as stop watch in the Panel Designer (setting Mode =
StopWatch).

The stop watch starts with 00:00:00 or 00:00 depending on the Panel Designer setting
Display Seconds. The start time cannot be changed.

The stop watch is updated every second.

Info

The stop watch cannot be started when it is already running.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only access the control by its name. In the property dialog
of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The name
of the environment variable, system variable or signal could be specified as following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlStart

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Clock Control • •

Example
// Start the clock control designed as stop watch.
on key 'a'
{
ClockControlStart("ClockControl", "StoppWatch");
}

| ClockControlStop | ClockControlReset | SetClockControlTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlStop

ClockControlStop
CAPL Function Overview » General » ClockControlStop

Syntax void ClockControlStop(char[] panel, char[] control);

Function Stops the Clock Control designed as stop watch with the Panel Designer (setting Mode =
StopWatch).

The displayed time stays unchanged unless the user starts the stop watch again or resets
it.

If the stop watch is started again without resetting it, the start time is the current
displayed time (not zero).

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only access the control by its name. In the property dialog
of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The
name of the environment variable, system variable or signal could be specified as
following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Clock Control • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ClockControlStop

Example
// Stop the clock control designed as stop watch.
on key 'a'
{
ClockControlStop("ClockControl", "StoppWatch");
}

| ClockControlStart | ClockControlReset | SetClockControlTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: closePanel

closePanel
CAPL Function Overview » General » closePanel

Note

If several panels with the same name exist in the CANoe configuration this command has
an effect on all these panels.

Syntax void closePanel(char panelName[]);

Function Closes a panel.

The panel is accessed by its individual panel name that is entered in the Panel Designer /
Panel Editor.

Parameters panelName

Panel name

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — • •

Example

| openPanel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CompleteStop

CompleteStop
CAPL Function Overview » General » CompleteStop

Syntax void CompleteStop ()

Function Indicates completion of pre-stop actions carried out in a certain node after a
measurement stop has been deferred by DeferStop.

Infos

• If several CAPL nodes or internal components defer a measurement stop,


measurement continues until they have all indicated completion of their
pre-stop actions (either by explicitly calling CompleteStop or implicitly
when the timeout whose interval has been defined in the DeferStop call
has passed).
• CompleteStop may not be called before a stop request has arrived (i.e.
before the on preStop handler is called).

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
on preStop
{
message ShutdownReq m;

output(m);
DeferStop(1000); // measurement is stopped if ACK has not
// yet been received after one second
}
on message ShutdownAck
{
CompleteStop();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ConvertTimestamp, ConvertTimestampNS

ConvertTimestamp, ConvertTimestampNS
CAPL Function Overview » General » ConvertTimestamp, ConvertTimestampNS

Syntax void ConvertTimestamp(dword timestamp, dword& days, byte& hours, byte&


minutes, byte& seconds, word& milliSeconds, word& microSeconds); // form 1

void ConvertTimestampNS(qword timestamp, dword& days, byte& hours, byte&


minutes, byte& seconds, word& milliSeconds, word& microSeconds, word&
nanoSeconds); // form 2

Function Converts a timestamp to separate parts.

Parameters timestamp

timestamp in 10 microseconds (form 1)


timestamp in nanoseconds (form 2)

days

Receives the days of the timestamp

hours

Receives the hours the timestamp (between 0 and 23)

minutes

Receives the minutes of the timestamp (between 0 and 59)

seconds

Receives the seconds of the timestamp (between 0 and 59)

milliseconds

Receives the milliseconds of the timestamp (between 0 and 999)

microseconds

Receives the microseconds of the timestamp (between 0 and 999)

nanoseconds (only form 2)

Receives the nanoseconds of the timestamp (between 0 and 999)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Example
on envVar EnvGearUp
{
dword d;
byte h, m, s;
word ms, us, ns;
convertTimestampNS(timeNowNS(), d, h, m, s, ms, us, ns);
write("Gear up at %d days, %d::%d::%d,%d.%d.%d", d, h, m, s, ms, us,
ns);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ConvertTimestamp, ConvertTimestampNS

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: cos

cos
CAPL Function Overview » General » cos

Syntax double cos(double x);

Function Calculates cosine of x.

Parameters Value in radians whose cosine is to be calculated.

Return values Cosine of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
double x;
x = cos(PI); // result -1

or
double tangens(double x) {
return sin(x) / cos(x);
}

| sin | sqrt | exp |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DeferStop

DeferStop
CAPL Function Overview » General » DeferStop

Syntax void DeferStop(dword maxDeferTime)

Function Defers measurement stop.

The function can be called in the on preStop handler or even at an earlier time instance.
Measurement is deferred until CompleteStop is called in the same node or the simulation
time has advanced by the amount given in parameter maxDeferTime since the arrival of a
stop request (and call of the on preStop handler).

DeferStop enables waiting for completion of activities that have to be carried out before
measurement stop takes effect, e.g. a reset of an attached ECU.

Infos

• If several CAPL nodes or internal components defer a measurement stop,


measurement continues until they have all indicated completion of their
pre-stop actions (either by explicitly calling CompleteStop or implicitly
when the maxDeferTime timeout has occurred).
• DeferStop may not be called after the CAPL node has indicated
completion of pre-stop activities (explicitly or implicitly).
• By calling DeferStop twice within the same node the interval until the
automatic complete timeout occurs can be extended. Reduction of the
timeout interval is not supported.
• If DeferStop is called before a stop request arrives measurement stop
will be deferred even if an on preStop handler is not defined. The timer
whose interval is defined in maxDeferTime refers to the instance of the
stop request arrival.

Parameters maxDeferTime

Indicates the time interval in milliseconds after which completion of pre-stop activities is
indicated automatically if it has not yet been done explicitly via CompleteStop.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
on preStop
{
message ShutdownReq m;
output(m);
DeferStop(1000);
}
on message ShutdownAck
{
CompleteStop();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: elCount

elCount
CAPL Function Overview » General » elCount

Syntax long elCount(...);

Function Determines the number of elements of an array.

Parameters Array of any arbitrary type.

Return values Number of elements.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
void bsp(int ar[]) {
int i;
for(i=0; i < elCount(ar); i++)
...
}

void bsp2(byte ar[][]) {


int i, j;
for(j=0; j < elCount(ar); j++ )
for(i=0; i<= elCount(ar[j]); i++ )
...
}

| runError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: enableControl

enableControl
CAPL Function Overview » General » enableControl

Syntax void enableControl(char panel[], char control[], long enable);

Function Selective activation and deactivation of the following elements:

• control elements
• control and display elements

If a control and display element is configured as a simple display, this command will have
no effect on the element in question.
The turned on or turned off state of an element remains intact at the start/end of the
measurement. Because of this, a defined state should be created for the beginning of the
measurement for the elements involved (for example in the CAPL program under System-
>Start).

Parameters panel

Name of the panel

If an empty string is transferred, the action will affect all open panels.

control

Name of the element. You can only activate/deactivate the control with its name. In the
property dialog of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The name
of the environment variable, system variable or signal could be specified as following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

enable

0: turn off (disable)


1: turn on (enable)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: enableControl

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
on key 'a'
{
enableControl("gateway", "ElemPanelHelp", 1);
// Activates Panel help in the "gateway" panel.

// enable all controls of the panel


enableControl("gateway", "", 1);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: EnvVarTimeNS

EnvVarTimeNS
CAPL Function Overview » General » EnvVarTimeNS

Syntax float EnvVarTimeNS(envvar envVariable);

Function Returns the time stamp of the environment variable envVariable in nanoseconds.

Parameters envVariable

Name of the environment variable.

Return values Time stamp of the environment variable in ns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — • •

Example

| MessageTimeNS | timeNowNS |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: exp

exp
CAPL Function Overview » General » exp

Syntax double exp(double x);

Function Calculates the exponential function.

Parameters Value whose exponent is to be calculated

Return values Exponent to base e.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
double x;
x = exp(5);
write("Exponent of 5: %l",x); // Result: 148.413159

| cos | sin | sqrt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FDXTriggerDataGroup

FDXTriggerDataGroup
CAPL Function Overview » General » FDXTriggerDataGroup

Syntax long FDXTriggerDataGroup (WORD goupID)

Function This function triggers the transmission of a data group via CANoe FDX protocol.

Parameters groupID

ID of the FDX data group that should be transmitted.

Return values 0: Success

-1: The given data group is not configured.

-2: No client is registered to receive this data group.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 — — •

Example
// CANoe FDX data exchange synchronously to FlexRay cycle
// Whenever slot 5 of the FlexRay cycle will be reached, the FDX data group
10 is transmitted one time

on frSlot 5
{
FDXTriggerDataGroup(10);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileClose

fileClose
CAPL Function Overview » General » fileClose

Syntax long fileClose (dword fileHandle)

As Destructor file.close()

Function This function closes the specified file.

Parameters The integer contains the handle to the file.

Return values If an error occurs the return value is 0, else 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: method — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileGetBinaryBlock

fileGetBinaryBlock
CAPL Function Overview » General » fileGetBinaryBlock

Syntax long fileGetBinaryBlock (byte buff[], long buffsize, dword fileHandle)

Method file.GetBinaryBlock(byte buff[], long buffsize)

Function The function reads characters from the specified file in binary format.

The source file must be opened in binary format.

Parameters buff

Buffer

buffsize

Maximum of buffsize characters

fileHandle

Handle to the file

Return values The function returns the number of characters read.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: method — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileGetString

fileGetString
CAPL Function Overview » General » fileGetString

Syntax long fileGetString (char buff[], long buffsize, dword fileHandle);

Method file.GetString(char buff[], long buffsize);

Function The function reads a string from the specified file. The returned string contains a new
line character. See also fileGetStringSZ.

Characters continue to be read out until the end of line is reached or the number of read-
out characters is equal to buffsize -1.

Parameters buff

Buffer for the read-out string

buffsize

Length of the string

fileHandle

Handle to the file

Return values If an error occurs, the return value is 0, else 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: method — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileGetStringSZ

fileGetStringSZ
CAPL Function Overview » General » fileGetStringSZ

Syntax long fileGetStringSZ(char buff[], long buffsize, dword fileHandle);

Method file.GetStringSZ(char buff[], long buffsize);

Function The function reads a string from the specified file. Characters continue to be read out
until the end of line is reached or the number of read-out characters is equal to buffsize-
1. The new line character is not included in the string. See also fileGetString.

Parameters buff

Length of the string

buffsize

Buffer for the read-out string

fileHandle

Handle to the file

Return values If an error occurs, the return value is 0, else 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: method — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileName

fileName
CAPL Function Overview » General » fileName

Syntax void fileName();

Function Output of the CAPL program name in the Write window. Helpful for debugging purposes.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
fileName();
...

Result:

output of actual filename of CAPL program to Write window.

| elCount | runError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: filePutString

filePutString
CAPL Function Overview » General » filePutString

Syntax long filePutString (char buff[], long buffsize, dword fileHandle);

Method file.PutString(char buff[], long buffsize);

Function This function writes a string in the specified file.

Parameters buff

Buffer for the read-in string

buffsize

Number of characters

fileHandle

Handle to the file

Return values If an error occurs, the return value is 0, else 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: method — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileRewind

fileRewind
CAPL Function Overview » General » fileRewind

Syntax long fileRewind (dword fileHandle)

Method file.Rewind()

Function This function resets the position pointer to the beginning of the file.

Parameters The integer indicates the file handle.

Return values If an error occurs, the return value is 0, else 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

7.0 SP5: — • •
method

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: fileWriteBinaryBlock

fileWriteBinaryBlock
CAPL Function Overview » General » fileWriteBinaryBlock

Syntax long fileWriteBinaryBlock (byte buff[], long buffsize, dword fileHandle)

Method file.WriteBinaryBlock(byte buff[], long buffsize)

Function This function writes buffsize bytes in the specified file.

Parameters buff

Buffer, the characters are read-out

buffersize

Number of bytes

fileHandle

Handle to the file

Return values The function returns the number of bytes written.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _floor

_floor
CAPL Function Overview » General » _floor

Syntax float _floor(float x);

Function Calculates the floor of a value, i.e. the largest integer smaller or equal to the value.

Parameters x

Value of which the floor shall be calculated.

Return values Floor of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example
float x;
x = _floor(3.6); // x == 3.0

| _ceil | _round |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _gcvt

_gcvt
CAPL Function Overview » General » _gcvt

Syntax void _gcvt(double val, int digits, char s[]);

Function The number val is converted to a string s containing a decimal point and a possible sign
byte.

Parameters val

Number to be converted.

digits

Number of significant digits.

String, which contains the converted number. If the string size is too small, the string
keeps unchanged.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 — • •

Example
char s[15];

float val1 = 3.1415926535;


float val2 = 271828.18284;
_gcvt(val1, 10, s);
writeToLogEx("val1: %f: s: %s", val1, s);
_gcvt(val2, 9, s);
writeToLogEx("val2: %f: s: %s", val2, s);
_gcvt(val2, 5, s);
writeToLogEx("val2: %f: s: %s", val2, s);
_gcvt(val2, 20, s); // String size too small, string keeps unchanged
writeToLogEx("val2: %f: s: %s", val2, s);
...

Result:
val1: 3.141593: s: 3.141592654
val2: 271828.182840: s: 271828.182
val2: 271828.182840: s: 2.7183e+005
val2: 271828.182840: s: 2.7183e+005

| atol | ltoa |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getAbsFilePath

getAbsFilePath
CAPL Function Overview » General » getAbsFilePath

Info

This function is not available in case of a distributed environment.

Syntax long getAbsFilePath(char relPath[], char absPath[], long absPathLen)

Function Gets the absolute path of a file.

As parameter the file should be defined with the relative path to the current
configuration.

Parameters relPath

A path (with or without a file name) defined relative to the current configuration. If this
parameter is empty, then the full path of the current configuration will simply be
returned.

absPath

Buffer to which the full path name should be copied.

absPathLen

Size of the buffer [in bytes] for the full path name.

Return values On success this function returns length of the full path name, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — • •

Example
on key 'x'
{
char absPath[256];
getAbsFilePath("Nodes\\Test.can", absPath, 256);
write ("absPath: %s ", absPath);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetBusContext

GetBusContext
CAPL Function Overview » General » GetBusContext

Note

The bus context plays a role in modeling gateways and in tests of control units with
several bus connections. In this case, a series of CAPL functions such as canOnline and
canOffline may have more than one meaning in terms of the bus interface (channel) to be
used. A similar type of problem occurs when identical node layer modules are used
simultaneously within a CAPL block. A distinction must be made between the instances of
the node layer, both for calls to CAPL functions that are implemented in the node layers
and for implementing callbacks.

To facilitate this distinction, a bus context is placed in the CAPL program by the runtime
environment while a callback is being executed by the node layer. This context
unambiguously identifies the node layer that is making the call. In a similar manner, the
call of a CAPL function that is implemented in a node layer is forwarded on to the
appropriate node layer, depending on the current bus context. This also applies to the
CAPL functions mentioned above, canOnline and canOffline, as well as to many wait
points of the Test Feature Set.

You should use the functions GetBusNameContext, GetBusContext and SetBusContext to


determine the context of a bus, to query or to change the current bus context.

Syntax dword GetBusContext()

Function Returns the current bus context of the CAPL block.

Parameters —

Return values The current bus context.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

This is an example for a simulation node.


Test nodes should copy the bus context to a CAPL variable in the Main() function because
all global variables are cleared when the test module is started.
variables
{
dword ibus_context = 0;
dword motbus_context = 0;
}

on preStart
{
ibus_context = GetBusNameContext( "ibus");
motbus_context = GetBusNameContext( "motbus");
}

void apCanOn()
{
dword context;

// activate the CAN channel on the "current" context


CanOnline();

// determine the "other" context


context = ibus_context == GetBusContext() ? motbus_context : ibus_context;
// set the context to the "other" bus...

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetBusContext

SetBusContext( context);

// ...and activate its CAN chip as well


CanOnline();
}

| GetBusNameContext | SetBusContext |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetBusNameContext

GetBusNameContext
CAPL Function Overview » General » GetBusNameContext

Note

The bus context plays a role in modeling gateways and in tests of control units with
several bus connections. In this case, a series of CAPL functions such as canOnline and
canOffline may have more than one meaning in terms of the bus interface (channel) to be
used. A similar type of problem occurs when a node layer module is used simultaneously
on multiple busses within a CAPL block. A distinction must be made between the
instances of the node layer, both for calls to CAPL functions that are implemented in the
node layers and for implementing callbacks.

To facilitate this distinction, a bus context is placed in the CAPL program by the runtime
environment while a callback is being executed by the node layer. This context
unambiguously identifies the node layer that is making the call. In a similar manner, the
call of a CAPL function that is implemented in a node layer is forwarded on to the
appropriate node layer, depending on the current bus context. This also applies to the
CAPL functions mentioned above, canOnline and canOffline, as well as to many wait
points of the Test Feature Set.

You should use the functions GetBusNameContext, GetBusContext and SetBusContext to


determine the context of a bus, to query the current bus context, or to change its
context.

Syntax dword GetBusNameContext(char name[])

Function Returns the context of the specified bus.

Parameters name

The name of the bus.

Return values In the case of success, the context of the specified bus is returned.

If the specified bus does not exist, 0 is returned.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

This is an example for a simulation node.


Test nodes should copy the bus context to a CAPL variable in the Main() function because
all global variables are cleared when a test module is started.
variables
{
char ibus[32] = "ibus";
char motbus[32] = "motbus";

dword ibus_context = 0;
dword motbus_context = 0;
}
on preStart
{
ibus_context = GetBusNameContext( ibus);
motbus_context = GetBusNameContext( motbus);

if ( 0 == ibus_context)
{
writeex( 0, 3, "Error: Cannot determine context for bus: %s", ibus);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetBusNameContext

}
if ( 0 == motbus_context)
{
writeex( 0, 3, "Error: Cannot determine context for bus: %s", motbus);
}
}

| GetBusContext | SetBusContext |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getCardType

getCardType
CAPL Function Overview » General » getCardType

Syntax long getCardType();

Function Determines the type of CAN platform being used. Is needed e.g. to program the BTR /
OCR values.

Parameters —

Return values 17: for Vector drivers

For other manufacturer other values will be returned.


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
switch(getCardType()) {
case 6: setOcr(0,0x02);
break;
case ...
default:
write("Unknown driver %d", getCardType());
break;
}
...

| getChipType | getCardTypeEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getCardTypeEx

getCardTypeEx
CAPL Function Overview » General » getCardTypeEx

Syntax int getCardTypeEx(int can);

Function Determines the card type of CAN channel. Is needed e.g. to program the BTR / OCR
values.

Parameters CAN

Channel number

Return values Type of board as one of the following values:

0 DBB196 - Daimler-Benz-Board with FullCAN

1 DBB196B - with BasicCAN

2 CANIB - Bosch CANIB

3 DEMO - Demo driver

6 CANAC2 - Softing AC2/200/ANA

7 CANAC2X - Softing AC 2/527/ANA

8 CPC/PP = EMS wish module

9 INDIGO - Silicon Graphics Indigo2

10 CANCARD - PCMCIA 11 Bit

11 CANCARDX - PCMCIA 29 Bit

12 CANAC2B - Softing AC2/527 11 Bit

15 Peak CAN-Dongle

16 Vector CAN-Dongle

17 Vector PCMCIA CANcardX

18 Virtual CAN driver

20 Softing PCMCIA CANcard SJA1000

25 Vector PCMCIA CANcardXL

27 Vector USB CANcaseXL

28 Vector CANcaseXLLog (USB + memory)

29 Vector CANboardXL PCI

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getCardTypeEx

30 Vector CPCI CANboardXL Compact

31 Vector CANboardXL PCI express

33 Vector VN7600

34 Vector ExpressCard CANcardXLe

Additional types may be added!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example

| getCardType | getChipType |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getChipType

getChipType
CAPL Function Overview » General » getChipType

Syntax long getChipType(long channel);

Function Determines the type of CAN controller used.

Parameters CAN channel

0 both controller

1 Channel 1

2 Channel 2

Return values Type of controller with the following values:

5 NEC 72005

200 Philipps PCA82C200

526 Intel 82526

527 Intel 82527

1000,1001 Philipps SJA1000

Other types may occur. DEMO versions return the result 0 or simulate one of the existing
types. If an attempt is made to access a nonexistent channel (e.g. Channel 2 for CPC/PP)
or if the driver used does not support this function, the functional result is 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
switch(getChipType(0)) {
case 200: setOcr(0,0x02);
break;
case ...
default:
write("Unknown CAN-chip %d", getChipType(0));
break;
}
...

| getCardType | getCardTypeEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetComputerName

GetComputerName
CAPL Function Overview » General » GetComputerName

Syntax long GetComputerName(char buffer[], dword bufferSize)

Function Retrieves the fully qualified name of the computer.

Parameters buffer

Space for the returned name.

bufferSize

Length of the buffer.

Return values 0 if the function completed successfully, else unequal 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 — • •

Example
char buffer[50];
GetComputerName(buffer, elcount(buffer));
write("Computer name: %s", buffer);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getDrift

getDrift
CAPL Function Overview » General » getDrift

Syntax int getDrift()

Function Determines the constant deviation when Drift is set.

Parameters —

Return values Drift in parts per thousand.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int val;
...
// Assign to val the Drift value
val = getDrift();
...

| getJitterMax | getJitterMin | setDrift | setJitter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetEventSortingStatus

GetEventSortingStatus
CAPL Function Overview » General » GetEventSortingStatus

Syntax int GetEventSortingStatus(message msg);

int GetEventSortingStatus(pg msg);

int GetEventSortingStatus(gmLanMessage msg);

int GetEventSortingStatus(linmessage msg);

int GetEventSortingStatus(beanMessage);

int GetEventSortingStatus(mostMessage msg);

int GetEventSortingStatus(mostAmsMessage msg);

int GetEventSortingStatus(mostRawMessage msg);

int GetEventSortingStatus(j1587Param msg);

int GetEventSortingStatus(linBaudrateEvent event);

int GetEventSortingStatus(linCsError event);

int GetEventSortingStatus(linDlcinfo event);

int GetEventSortingStatus(linReceiveError event);

int GetEventSortingStatus(linSchedulerModeChange event);

int GetEventSortingStatus(linSlaveTimeout event);

int GetEventSortingStatus(linSleepModeEvent event);

int GetEventSortingStatus(linSyncError event);

int GetEventSortingStatus(linTransmError event);

int GetEventSortingStatus(linWakeupFrame event);

int GetEventSortingStatus(beanError event);

int GetEventSortingStatus(mostLightLockError event);

int GetEventSortingStatus(FRSlot event);

int GetEventSortingStatus(FRFrame msg);

int GetEventSortingStatus(FrStartCycle event);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetEventSortingStatus

Function Determines the Event Sorting state.

With active Event Sorting the return value indicates if the given event in the simulation
setup of CANoe was processed in correct time sequence.

Parameters Message event variable of type

"message", "pg", "gmLanMessage", "linmessage", "beanMessage", "mostMessage",


"mostAmsMessage", "mostRawMessage", "j1587Param", "linBaudrateEvent", "linCsError",
"linDlcinfo", "linReceiveError", "linSchedulerModeChange", "linSlaveTimeout",
"linSleepModeEvent", "linSyncError", "linTransmError", "linWakeupFrame", "beanError",
"mostLightLockError", "FRSlot", "FRFrame" or "FrStartCycle".

Return values 0: Invalid state

The Event Sorting is inactive or it concerns a program internal event that will never be
sorted (e.g. environment variable).

1: sorted

The Event Sorting is active and the event was processed and sorted in the correct time
sequence.

2: unsorted

The Event Sorting is active but the event arrived too late or too soon so that the event
was processed unsorted.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — • •

Example
on message *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linSlaveTimeout
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linTransmError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linCsError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linReceiveError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetEventSortingStatus

on linSyncError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on pg *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on gmLanMessage *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linMessage *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on mostMessage *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on beanMessage *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on mostRawMessage
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on mostAMSMessage *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on J1587Param *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event", (double)this.msgOrigTime/100000 );
}
}

on linBaudrateEvent
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linDlcInfo
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linSchedulerModeChange
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetEventSortingStatus

if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linSleepModeEvent
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on linWakeupFrame
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on beanError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on mostLightLockError
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on FRSlot *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on FRFrame *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

on FRStartCycle *
{
if ( GetEventSortingStatus(this)==2 ) {
Write("Unsorted Event at time %.6f", (double)this.time/100000 );
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetFirstCANdbName

GetFirstCANdbName
CAPL Function Overview » General » GetFirstCANdbName

Syntax dword GetFirstCANdbName( char buffer[], dword size)

Function Finds out the name of the first assigned database.

Parameters buffer

Buffer in which the database name is written.

size

Size of the buffer in Buyte.

Return values If successful unequal 0, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • —

Example
on start
{
char buffer[256];
dword pos;

pos = GetFirstCANdbName( buffer, elcount( buffer));


//Finds the name of the first database.
//If a database is found, "pos" contains the value 1
//If none is found "pos" contains 0

while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database

on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.

write( "Database position number : %d Database name : %s",pos, buffer);


}

| GetMessageName | GetNextCANdbName |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetIPAddress

GetIPAddress
CAPL Function Overview » General » GetIPAddress

Syntax long GetIPAddress(char buffer[], dword bufferSize)

Function Retrieves the default (first) IP address of the computer as a string.

Parameters buffer

Space for the returned address.

bufferSize

Length of the buffer.

Return values 0 if the function completed successfully, else unequal 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 — • •

Example
char buffer[50];
GetIPAddress(buffer, elcount(buffer));
write("IP Address: %s", buffer);

| IpGetAdapterAddress | IpGetAdapterAddressAsString | IpGetAddressAsNumber |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getJitterMax

getJitterMax
CAPL Function Overview » General » getJitterMax

Syntax int getJitterMax()

Function Determines the upper limit for the allowable deviation when Jitter is set.

Parameters —

Return values Upper deviation in parts per thousand.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int val;
...
// Assign to val the upper value of the Jitter
val = getJitterMax();
...

| getDrift | getJitterMin | setDrift | setJitter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getJitterMin

getJitterMin
CAPL Function Overview » General » getJitterMin

Syntax int getJitterMin()

Function Determines the lower limit for the allowable deviation when Jitter is set.

Parameters —

Return values Lower deviation in parts per thousand.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int val;
...
// Assign to val the lower value of the Jitter
val = getJitterMin();
...

| getDrift | getJitterMax | setDrift | setJitter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getLocalTime

getLocalTime
CAPL Function Overview » General » getLocalTime

Syntax void getLocalTime(long time[]);

Function Returns details to the current date and time in an array of type long.

Parameters An array of type long with at least 9 entries.

The entries of the array will be filled with the following information:

1 Seconds (0 - 60)

2 Minutes (0 - 60)

3 Hours (0 - 24)

4 Day of month (1 - 31)

5 Month (0 - 11)

6 Year (starting with 1900)

7 Day of week (0 - 7)

8 Day of Year (0 - 365)

9 Flag for daylight saving time (0 - 1, 1 = daylight saving time)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
long tm[9];
getLocalTime(tm);
// now tm contains the following entries:
// tm[0] = 3; (seconds)
// tm[1] = 51; (minutes)
// tm[2] = 16; (hours)
// tm[3] = 21; (day of month)
// tm[4] = 7; (month stating with 0)
// tm[5] = 98; (year)
// tm[6] = 5; (weekday)
// tm[7] = 232;(day of year)
// tm[8] = 1; (Summer time)
...

| getLocalTimeString |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getLocalTimeString

getLocalTimeString
CAPL Function Overview » General » getLocalTimeString

Syntax void getLocalTimeString(char timeBuffer[]);

Function Copies a printed representation of the current date and time into the supplied character
buffer. The format of the string is ddd mmm dd hh:mm:ss jjjj (e.g. "Fri Aug 21 15:22:24
1998").

Parameters timeBuffer

The buffer the string will be written in.


This buffer must be at least 26 characters long.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
char timeBuffer[64];

getLocalTimeString(timeBuffer);
// now timeBuffer contains for example. "Fri Aug 21 15:22:24 1998"
...

| getLocalTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getMessageAttrInt

getMessageAttrInt
CAPL Function Overview » General » getMessageAttrInt

Note

This function finds the value of the message attribute in the database again with each
call. If the message is already known when the CAPL program is being written, the
attribute should be found directly by its selector syntax (<Message
variable>.<Attribute name> e.g. absData.msgCycleTime).

Syntax long GetMessageAttrInt(message canMessage, char attributeName[]);

long GetMessageAttrInt(pg parameterGroup, char attributeName[]);

Function Gets the value of a message attribute from the database.

A user-defined attribute with the name specified in the parameter, and of the Integer
type, must be defined in the database. If no such attribute is defined, the function
returns 0. If no attribute value is assigned to the message in the database, the default
value of the attribute definition is returned.

Parameters canMessage

Message variable

attributeName

Attribute name

Return values Value of the attribute (or default value) from the database.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 — • •

Example

This example outputs the value of the message attribute GenMsgCycleTime in the Write
window when the message is received.

The attribute name must be written as defined in the database. You can find the
attribute name in the attribute window of the database.
on message *
{
long cycleTimeValue1;
long cycleTimeValue2;
cycleTimeValue1 = getMessageAttrInt(this, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue1);
message EngineData gMsgEngineData;
cycleTimeValue2 = getMessageAttrInt(gMsgEngineData, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue2);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetMessageID

GetMessageID
CAPL Function Overview » General » GetMessageID

Syntax dword GetMessageID(char messageName[]) // form 1

dword GetMessageID(char messageName[], char dbName[]) // form 2

Function Finds out the message ID

Parameters messageName

Name of the message.

dbName

Name of the database, needed if the message name is used in more than one database.

Return values Message ID, or (dword)-1 if the message is not found

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example
dword id;
id = GetMessageID("LightState");

| GetMessageName |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetMessageName

GetMessageName
CAPL Function Overview » General » GetMessageName

Syntax dword GetMessageName( dword id, dword context, char buffer[], dword size)

Function Finds out the message name.

Parameters id

Id of the message for which the message name should be found.

context

Context of assigned databases.

The low word of context contains the channel number.


The high word of context contains the bus type.

Available bus types:

CAN 1

LIN 5

MOST 6

FlexRay 7

BEAN 8

J1708 9

buffer

Buffer in which the message name is written.

size

Size of the buffer in Byte.

Return values If successful unequal 0, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • —

7.1 — • •

Example
variables
{
DWORD contextCAN = 0x00010000;
DWORD contextLIN = 0x00050000;
DWORD contextMOST = 0x00060000;
DWORD contextFLEXRAY = 0x00070000;
DWORD contextBEAN = 0x00080000;
DWORD contextJ1708 = 0x00090000;
}
on message *

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetMessageName

{
char buffer[64];
if ( GetMessageName( this.ID, contextCAN | this.CAN, buffer, elcount(
buffer)))
{
write( "Message: %s", buffer);
}
}

| GetFirstCANdbName | GetNextCANdbName |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetNextCANdbName

GetNextCANdbName
CAPL Function Overview » General » GetNextCANdbName

Syntax dword GetNextCANdbName( dword pos, char buffer[], dword size)

Function Finds out the names of the other assigned databases with pos.

Parameters pos

Position number of the database to be found.

buffer

Buffer in which the database name is written.

size

Size of the buffer in Byte.

Return values If successful unequal 0, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • —

Example
on start
{
char buffer[256];
dword pos;

pos = GetFirstCANdbName( buffer, elcount( buffer));


//Finds the name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.

while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}

Example to find the third database

on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.

write( "Database position number : %d Database name : %s",pos, buffer);


}

| GetFirstCANdbName | GetMessageName |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GetOfflineFileName

GetOfflineFileName
CAPL Function Overview » General » GetOfflineFileName

Syntax long GetOfflineFileName(char[] buffer, dword bufferSize)

Function Returns the complete path of the currently used offline source file.

Parameters buffer

Space for the returned string.

bufferSize

Size of the buffer.

Return values 0: If no error

1: If buffer is too small

2: For other errors (e.g. not in offline mode)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • —

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getProfileArray

getProfileArray
CAPL Function Overview » General » getProfileArray

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure.

Syntax long getProfileArray(char section[], char entry[],char buff[], long


buffsize, char filename[]);

Function Searches the file under section section for the variable entry. Entry is interpreted as a
list of numerical values, separated by comma, tab, space, semicolon or slash. A 0x prefix
indicates hex values.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

buff

Buffer for the read-in numerical values.

buffsize

Size of buff: Maximum number of read in numerical values (max. 1279 characters).

filename

File path as a string.

Return values Number of numerical values read in.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Note

Using 256 hex values (format 0x??) and int values (format ??? plus signed) respectively as
well as separators the string length is 4 * 256 + 255 = 1279 characters.

The first 1279 characters are read from the ini entry and are converted to numerical
values.

The above mentioned format is sufficiently for 256 numerical values.

Does the string contain figures with only one figure as well as separators (e.g.
3,1,4,1,5,9,2,6,5,3,5...), 640 numerical values can be read.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getProfileInt

getProfileInt
CAPL Function Overview » General » getProfileInt

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure.

Syntax long getProfileInt(char section[], char entry[], long def, char filename[])

Function Searches the file filename under section section for the variable entry. If its value is a
number, this number is returned as the functional result. If the file or entry is not found,
or if entry does not contain a valid number, the default value def is returned as the
functional result.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

def

Default value in case of error as an integer.

filename

File path as a string.

Return values Integer that was read in.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getProfileFloat

getProfileFloat
CAPL Function Overview » General » getProfileFloat

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure.

Syntax float getProfileFloat(char section[], char entry[], long def, char


filename[])

Function Searches the file filename under section section for the variable entry. If its value is a
number, this number is returned as the functional result. If the file or entry is not found,
or if entry does not contain a valid number, the default value def is returned as the
functional result.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

def

Default value in case of error as a float.

filename

File path as a string.

Return values Float that was read in.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getProfileString

getProfileString
CAPL Function Overview » General » getProfileString

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure.

Syntax long getProfileString(char section[], char entry[], char def[], char


buff[], long buffsize, char filename[])

Function Searches the file filename under section section for the variable entry. Its contents
(value) are written to the buffer buff. Its length must be passed correctly in buffsize. If
the file or entry is not found, the default value def is copied to buffer.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

def

Default value in case of error as a string.

buff

Buffer for the read-in character as a string.

buffersize

Size of buff in bytes.

filename

File name as a string.

Return values Number of characters that were read.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getStartdelay

getStartdelay
CAPL Function Overview » General » getStartdelay

Syntax int getStartdelay()

Function Determines the value of the start delay configured for this network node in the Simulation
Setup.

Parameters —

Return values Start delay in ms. If no start delay was set the function returns the value zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int val;
...
// Assign to val the value of the start delay
val = getStartdelay();
...

| setStartdelay |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getValue

getValue
CAPL Function Overview » General » getValue

Syntax int getValue(EnvVarName); // form 1

float getValue(EnvVarName); // form 2

long getValue(EnvVarName, char buffer[]); // form 3

long getValue(EnvVarName, byte buffer[]); // form 4

long getValue(EnvVarName, byte buffer[], long offset); // form 5

float getValue(char name[]); // form 6

long getValue(char name[], char buffer[]); // form 7

long getValue(char name[], byte buffer[]); // form 8

long getValue(char name[], byte buffer[], long offset); // form 9

Function Determines the value of the environment variable with identifier EnvVarName/name. The
type of the return value is based on the type of environment variable (int for discrete
(form 1), float for continuous environment variables (form 2 and 6)). For character string
environment variables (form 3 and 7) and environment variables with data bytes (form 4,
5, 8 and 9) the active value is saved to a buffer which you identify in the function call.

Info

• With forms 6 to 9 the compiler cannot check whether name actually


designates an environment variable of the correct type. If it is not, an
error message will appear in the Write window in runtime.

Parameters EnvVarName

Environment variable name

buffer

Return buffer (form 3, 4 and 5)

offset

Offset of the first data byte copied (form 5)

Return values Form 1 and 2

Active value of the environment variable.

Form 3, 4 and 5

Number of bytes copied.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getValue

Example
int val;
float fval;
char cBuf[25];
byte bBuf[64];
long copiedBytes;
...
// Assign to val the value of the environment variable Switch
val = getValue(Switch);
// Assign to fval the value of the environment variable Temperature
val = getValue(Temperature);
// Read the value of environment variable NodeName
copiedBytes = getValue(NodeName, cBuf);
// Read the value of environment variable DiagData
copiedBytes = getValue(DiagData, bBuf);
// Read the value of environment variable DiagData starting at position 32
copiedBytes = getValue(DiagData, bBuf, 32);
...

| getValueSize | putValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getValueSize

getValueSize
CAPL Function Overview » General » getValueSize

Syntax int getValueSize(EnvVarName);

int getValueSize(char name[]); // Form 2

Function Returns the size of the environment variable value in bytes.

Info

• For environment variables of type string the string length plus the
terminating null character will be returned.
• With form 2 the compiler cannot check whether name actually
designates an environment variable of the correct type. If it is not, an
error message will appear in the Write window in runtime.

Parameters EnvVarName

Environment variable name

name

Environment variable name

Return values Size of the data in bytes.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
int vSize;
...
// Size of the data of an environment variable of type integer
vSize = getValueSize(switch);
// Buffersize of an environment variable of type string
// (with terminating Null character)
vSize = getValueSize(nodename);
// Size of the data byffer of an environment variable of type data
vSize = getValueSize(DiagData);
...

| getValue | putValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: gmLanId

gmLanId
CAPL Function Overview » General » gmLanId

Syntax Dword gmLanId (dbMessage aMessage, dword aSourceId)

Dword gmLanId (dbMessage aMessage, Node aTxNode)

Function This function can be used to create a message ID for a GMLAN message. In addition to the
message, you must specify the transmission node or its source ID.

The message ID returned can be used, for example, to wait for a specific GMLAN message
with the TestWaitForMessage function.

Parameters aMessage

GMLAN message for which a message ID is to be created.

aSourceId

Source ID of the node to be coded as the transmission node in the message ID.

aTxNode

Node to be coded as the transmission node in the message ID.

Return values If the message is a GMLAN message, a GMLAN message ID will be returned containing the
correct source address and priority. Otherwise, the message ID will be returned.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 — — •

Example
dword gmID = 0;
long result = 0;
gmID = gmLanId(Comfort::Console_1, 48);
waitResult = TestWaitForMessage(gmID, 5000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: gmLanSetPID, gmLanSetSourceId, gmLanSetPrio, gmLanGetPID, gmLanGetSourceId, gmLanGetPrio

gmLanSetPID, gmLanSetSourceId, gmLanSetPrio, gmLanGetPID,


gmLanGetSourceId, gmLanGetPrio
CAPL Function Overview » General » gmLanSetPID, gmLanSetSourceId, gmLanSetPrio, gmLanGetPID, gmLanGetSourceId,
gmLanGetPrio

Syntax gmLanSetPID(gmLanMessage msg, long v);

gmLanSetSourceId(gmLanMessage msg, long v);

gmLanSetPrio(gmLanMessage msg, long v);

gmLanGetPID(gmLanMessage msg);

gmLanGetSourceId(gmLanMessage msg);

gmLanGetPrio(gmLanMessage msg);

Function gmLanSetPID sets the parameter ID of the message.

gmLanSetSourceId sets the source address of the message.

gmLanSetPrio sets the priority of the message.

gmLanGetPID gets the parameter ID of the message.

gmLanGetSourceId gets the source address of the message.

gmLanGetPrio gets the priority of the message.

Parameters msg

Message

Parameter ID, source address or priority

Return values gmLanSetPID, gmLanSetSourceId, gmLanSetPrio: —

gmLanGetPID, gmLanGetSourceId, gmLanGetPrio: Parameter ID, source address or priority

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Examples

A GMLAN message is modified and sent with output(msg).


The parameter ID is set with selector gm_pid.
gmLanMessage * msg1 ={SA =0x44, PRIO= 0x7, gm_pid=0x11};
gmLanSetSourceId(msg1,0x55);
gmLanSetPID(msg1,0x11);
gmLanSetPrio(msg1,0x5);

output(msg1);

write("pid: 0x%x, source: 0x%x, prio:


x%x",gmLanGetPID(msg1),gmLanGetSourceId(msg1),gmLanGetPrio(msg1));

Priority and source address are copied from Battery_Voltage message to the new message

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: gmLanSetPID, gmLanSetSourceId, gmLanSetPrio, gmLanGetPID, gmLanGetSourceId, gmLanGetPrio

msg:
on gmlanmessage Battery_Voltage
{
gmlanmessage Battery_Voltage msg;
msg = this; // SA and PRIO are not copied
gmLanSetSourceId(msg, gmLanGetSourceId(this));
// Copy source address from Battery_Voltage to msg
gmLanSetPrio(msg, gmLanGetPrio(this));
// Copy priority from Battery_Voltage to msg
...
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: halt

halt
CAPL Function Overview » General » halt

Syntax void halt();

Function This function stops the execution of the simulation. The simulation can be continued with
<F9>. The halt instruction is ignored in Real mode.
In addition, the halt instruction causes an update of the variables displayed on the Inspect
side of the Write window.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — — •

Example
on key 'h'
{
halt();
// Stops execution of the simulation in Simulation mode
}

| inspect |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: inspect

inspect
CAPL Function Overview » General » inspect

Syntax void inspect();

Function This function causes an update of the variables displayed on the Inspect side of the Write
window.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — — •

Example
on key 'i'
{
inspect();
// Update of the variables displayed on the Inspect side of the Write
window
}

| halt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: InterfaceStatus

InterfaceStatus
CAPL Function Overview » General » InterfaceStatus

Syntax void InterfaceStatus(long time, long channel, long status);

Function The callback can be inserted in the sections callback function or function.

The callback occurs when the status of the connection to the interface hardware is
changed (e.g. when Windows reports a lost connection to a CAN/WLAN gateway or to a
WLAN interface hardware for Car2x communication).

Parameters time

Time, resolution 10us

channel

The channel number

status

Status of the channel

Values:
3015: The connection is lost

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 — • •

Example
void InterfaceStatus(long time, long channel, long status)
{
if(status == 3015)
{
write("Time %f s, channel %d: The connection to the interface is
lost!", ((float)time)/100000.0, channel);
}
else
{
//other status is not yet supported
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: isStatisticAcquisitionRunning

isStatisticAcquisitionRunning
CAPL Function Overview » General » isStatisticAcquisitionRunning

Note

The relevant CAPL block must appear directly before the Frame Histogram window in the
evaluation branch. Otherwise a warning is output in the Write window.
In the Configuration dialog the Statistics report and histogram evaluations check box
must be activated. You open this dialog with the Configuration shortcut menu item of the
Frame Histogram window in the measurement setup.

Syntax int isStatisticAcquisitionRunning()

Function This function is used to test whether an acquisition range has already been started.

Parameters —

Return values The function returns 1 if an evaluation is already running. Otherwise it returns 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • —

Example

tatistical Evaluation (StatisticAcquisition)


...
// Tests for running acquisition range and stops it.
// If no statistical data acquisition is active a new one is started.
if(isStatisticAcquisitionRunning())
{
// Stops the running acquisition range
stopStatisticAcquisition();
}
else
{
// Starts a new acquisition range
startStatisticAcquisition();
}...

| startStatisticAcquisition | stopStatisticAcquisition |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: isOfflineMode

isOfflineMode
CAPL Function Overview » General » isOfflineMode

Syntax long isOfflineMode()

Function This function is used to get the information if CANoe is in offline mode.

Parameters —

Return values 1: True, CANoe / CANalyzer is in offline mode.

0: False, CANoe / CANalyzer is in online mode.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 — • —

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: isSimulated

isSimulated
CAPL Function Overview » General » isSimulated

Syntax long isSimulated()

Function This function is used to get the information if CANoe is in simulated mode.

Parameters —

Return values 1: True, CANoe is in simulated mode.

0: False, CANoe is in real mode.


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

This example checks if CANoe is in simulated mode. Then the test is not executed.
// do not activate test when running in simulated mode
if (isSimulated())
{
Write("Test cannot run in simulated mode!");
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: isStdId, isExtId

isStdId, isExtId
CAPL Function Overview » General » isStdId, isExtId

Syntax long isStdId(dword id);

long isStdId(message m);

long isExtId(dword id);

long isExtId(message m);

Function Checks parameter for extended identifier (29 bit) or standard identifier (11 Bit).

Parameters Variable of type message.

Id part of a message

Return values 1 if check was successful, else 0

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
if(isExtId(this))
write("extended identifier");
else
write("standard identifier");
or
std = isStdId(m100.id);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: isTimerActive

isTimerActive
CAPL Function Overview » General » isTimerActive

Syntax int isTimerActive(timer t)

int isTimerActive(mstimer t)

Function Return value indicates whether a specific timer is active.

This is the case between the call to the setTimer function and the call to the on timer
event procedure.

Parameters timer or mstimer variable

Return values 1, if the timer is active; otherwise 0.

0 is also returned within the on timer event procedure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — • •

Example
timer t;
write("Active? %d", isTimerActive(t)); // writes 0
setTimer(t, 5);
write("Active? %d", isTimerActive(t)); // writes 1

| setTimer | cancelTimer | timeToElapse |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: keypressed

keypressed
CAPL Function Overview » General » keypressed

Syntax dword keypressed();

Function This function returns the key code of a currently pressed key. If no key is being pressed it
returns 0.. For example, pressing of a key can be queried in a timer function. The
reaction can also be to letting go of a key.

Parameters —

Return values Key code of pressed key.

If the 8 lower bits do not equal 0, keypressed returns the ASCII code of the next key in
the keyboard buffer. If the 8 lower bits do not equal 0, the 8 upper bits represent the
extended key code (see IBM PC Technical Reference Manual).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
variables
{
message 0x1A0 msg; // intialises a message with the
// name msg and identifier 0x1A0
msTimer myTimer; // timer with millisecond resolution
int running; // memorises the first keypress to
// bypass the key repeat
int counter; // message counter
}
on timer myTimer
{
if (keypressed()) // if key is pressed ...
{
counter++; // increment counter by 1
msg.byte(0) = counter; // write the counter reading
// into the 1. byte of the message
output(msg); // send the message to the bus
setTimer(myTimer, 100); // set a timer to 100 ms
}
else // if key is released...
{
running = 0; // wait until new keypress
}
}
on key 'r'
{
if (running == 1) return; // inhibit key repeat

setTimer (myTimer,0); // start timer


running = 1; // memorise of first keypress
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _Log

_Log
CAPL Function Overview » General » _Log

Syntax double _log(double x)

Function Calculates the natural logarithm.

Parameters Value of which the logarithm shall be calculated.

Return values Logarithm of x (to base e).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — • •

Example
double x;
x = _log(1.0); // x == 0.0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _Log10

_Log10
CAPL Function Overview » General » _Log10

Syntax double _log10(double x)

Function Calculates the logarithm to base 10.

Parameters Value of which the logarithm shall be calculated.

Return values Logarithm of x (to base 10).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — • •

Example
double x;
x = _log10(100.0); // x == 2.0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ltoa

ltoa
CAPL Function Overview » General » ltoa

Syntax void ltoa(long val, char s[], long base);

Function The number val is converted to a string s. In this case, base indicates a number base
between 2 and 36. s must be large enough to accept the converted number!

Parameters val

Number to be converted.

String, which contains the converted number.

base

Number base.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
char s1[9];
char s2[9];
ltoa(z,s1,2);
ltoa(z,s2,10);
write("z: %d s1= %s",z, s1);
write("z: %d s2= %s",z, s2);
...

Result:
z: 255 s1= 11111111
z: 255 s2= 255

| atol |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MakeRGB

MakeRGB
CAPL Function Overview » General » MakeRGB

Syntax MakeRGB(long Red, long Green, long Blue);

Function Calculates the color value from the three primary color components.

Parameters Red

Red color component (0 - 255)

Green

Green color component (0 - 255)

Blue

Blue color component (0 - 255)

Return values Color value (Type: long)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
MakeRGB(0, 255, 149);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _max

_max
CAPL Function Overview » General » _max

Syntax long _max(long x, long y) // Form 1

dword _max(dword x, dword y) // Form 2

int64 _max(int64 x, int64 y) // Form 3

qword _max(qword x, qword y) // Form 4

float _max(float x, float y) // Form 5

Function Returns the maximum of the parameters.

Parameters x

First operand

Second operand

Return values y>x?y:x

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example
float result;
result = _max(1.0, _max(-3.0, 5.2)); // result == 5.2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MessageTimeNS

MessageTimeNS
CAPL Function Overview » General » MessageTimeNS

Syntax float MessageTimeNS(message msg);

float MessageTimeNS(linmessage msg);

float MessageTimeNS(mostMessage msg);

float MessageTimeNS(mostAmsMessage msg);

float MessageTimeNS(mostRawMessage msg);

Function Returns the time stamp in nanoseconds.

The time stamp that can be polled with this function has a greater precision than the
msg.TIME time stamp, whereby the precision depends on the CAN or LIN hardware that is
being used.

Parameters message

CAN message

linmessage

LIN message

mostMessage, mostAmsMessage, mostRawMessage

MOST message

Return values Time stamp of the message in ns

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — • •

Example

| MessageTimeNS (FlexRay) | EnvVarTimeNS | timeNowNS |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _min

_min
CAPL Function Overview » General » _min

Syntax long _min(long x, long y) // Form 1

dword _min(dword x, dword y) // Form 2

int64 _min(int64 x, int64 y) // Form 3

qword _min(qword x, qword y) // Form 4

float _min(float x, float y) // Form 5

Function Returns the minimum of the parameters.

Parameters x

First operand

Second operand

Return values y<x?y:x

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example
float result;
result = _min(1.0, _min(-3.0, 5.2)); // result == -3.0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mkExtId

mkExtId
CAPL Function Overview » General » mkExtId

Syntax dword mkExtId(dword id);

Function Returns an extended id.

Parameters Id part of a message.

Return values Extended identifier

Example
...
msg.id = mkExtId(this.id);
...

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: msgBeep

msgBeep
CAPL Function Overview » General » msgBeep

Note

If the specified sound type (e.g. MB_ICONHAND) cannot be played, the standard beep (PC
speaker) is used. The beep must be activated on the Windows control panel to do this!

Syntax void msgBeep (long soundType)

Function The msgBeep function plays back a sound predefined by the Windows system. It replaces
the previous beep function.

Parameters soundType

Integer for the predefined sound. Specifically these are:

0 MB_ICONASTERISK SystemAsterisk

1 MB_ICONEXCLAMATION SystemExclamation

2 MB_ICONHAND SystemHand

3 MB_ICONQUESTION SystemQuestion

4 MB_OK SystemDefault

5 Standard beep using the PC speaker (default)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
void sound() {
// Standard signal question
msgBeep (3);
}

| write | writeToLog |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Open

Open
CAPL Function Overview » General » Open

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure. First a search is made to determine whether the given file
is located in a directory of the databases. If the desired file is not found the active
configuration directory is used.

Syntax file(char [] filename, dword access, dword mode)

Method file.open(char [] filename, dword access, dword mode)

Function This function opens the file named filename.

If access = 0, the file is opened for write access;


if access = 1 the file is opened for read access.

If mode = 0 the file is opened in ASCII mode;


if mode = 1 the file is opened in binary mode.

Parameters filename

The name of the file

access

0 for write access, 1 for read access

mode

0 for ASCII mode, 1 for binary mode

Return values — (constructor)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: openFileRead

openFileRead
CAPL Function Overview » General » openFileRead

Note

A filename must be passed to this function. The absolute filename is determined by


means of a search procedure. First a search is made to determine whether the given file
is located in a directory of the databases. If the desired file is not found the active
configuration directory is used.

Syntax dword openFileRead (char filename[], dword mode);

Function This function opens the file named filename for the read access.

If mode=0 the file is opened in ASCII mode;


if mode=1 the file is opened in binary mode.

Parameters filename

file name

mode

Return values The return value is the file handle that must be used for read operations.

If an error occurs, the return value is 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: openFileWrite

openFileWrite
CAPL Function Overview » General » openFileWrite

Note

Before this function can be called the write path must be set by the function
SetWritePath. Otherwise the configuration directory will be used. A relative file name
must be passed to the function.

Syntax dword openFileWrite (char filename[], dword mode);

Function This function opens the file named filename for the write access.

If mode=0 writing can be executed in ASCII mode;


if mode=1 writing can be executed in binary mode. An already existing file will be
overwritten.

mode=2 to append data at the end of the file use for ASCII mode.
mode=3 to append data at the end of the file for binary mode.

Parameters filename

file name

mode

Return values The return value is the file handle that must be used for write operations.

If an error occurs, the return value is 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: openPanel

openPanel
CAPL Function Overview » General » openPanel

Note

If several panels with the same name exist in the CANoe configuration this command has
an effect on all these panels.

Syntax void openPanel(char panelName[]);

Function Opens a panel.

The panel is accessed by its individual panel name that is entered in the Panel
Designer/Panel Editor.

Parameters panelName

Panel name

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — • •

Example

| closePanel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

output
CAPL Function Overview » General » output

Syntax void output(message msg);

void output(errorFrame);

Function Outputs a message or an error frame from the program block.

Parameters Variable of type message or errorFrame.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All CAN • •

Example

output(msg) Example
variables {
message can2.125 msg = { // define CAN-Message
dlc = 1,
byte(0) = 1
};
}
on key F1 {
output (msg); // output Message
}

output(errorFrame) Example
on key F10 {
output(errorFrame); // output error frame on CAN channel 1
}
on CAN2.errorFrame {
output (CAN3.errorFrame); // output error frame on CAN channel 3
}

Except for the first channel for all other channels the key word errorFrame has to be
qualified with the number of the CAN channel.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _pow

_pow
CAPL Function Overview » General » _pow

Syntax double _pow(double x, double y);

Function Returns x to the power of y.

Parameters x – base

y – exponent

Return values x to the power of y.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
double result;
result = _pow(2.0, 3.0); // result == 8.0
result = _pow(4.0, 0.5); // result == 2.0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValue

putValue
CAPL Function Overview » General » putValue

Syntax void putValue(EnvVarName, int val); // form 1

void putValue(EnvVarName, float val); // form 2

void putValue(EnvVarName, char val[]); // form 3

void putValue(EnvVarName, byte val[]); // form 4

void putValue(EnvVarName, byte val[], long vSize); // form 5

void putValue(char name[], int val); // form 6

void putValue(char name[], float val); // form 7

void putValue(char name[], char val[]); // form 8

void putValue(char name[], byte val[]); // form 9

void putValue(char name[], byte val[], long vSize); // form 10

Function Assigns the value val to the environment variable with identifier EnvVarName/name.
Integers are assigned to discrete environment variables (form 1 and 6), floating point
numbers are assigned to continuous environment variables (form 2 and 7). The contents of
a character string is assigned to character string environment variables (form 3 and 8).
For data byte environment variables (form 4, 5, 9 and 10) the bytes of the data buffer are
copied into the environment variable.

Info

• With forms 6 to 10 the compiler cannot check whether name actually


designates an environment variable of the correct type. If it is not, an
error message will appear in the write window in runtime.

Parameters EnvVarName

Environment variable name (form 1-5)

name

Environment variable name (form 6-10)

val

New value of environment variable (form 1 and 2) or buffer with new data (form 3, 4 and
5) and for form 5 the number of bytes to be copied.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
byte dataBuf[64];
...
// Assign the value 0 to environment variable Switch

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValue

putValue(Switch, 0);
// Assign the value 22.5 to environment variable Temperature
putValue(Temperature, 22.5);
// Assign the value Master to environment variable NodeName
putValue(NodeName, "Master");
// Copy 64 bytes of the data buffer into the environment variable DiagData
putValue(DiagData, dataBuf, 64);
...

| getValue | getValueSize |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValueToControl

putValueToControl
CAPL Function Overview » General » putValueToControl

Syntax Value & String Output

void putValueToControl(char panel[], char control[], float val);

void putValueToControl(char panel[], char control[], float val, long


paragraph); 1

void putValueToControl(char panel[], char control[], long val);

void putValueToControl(char panel[], char control[], long val, long


paragraph);1

void putValueToControl(char panel[], char control[], long val, long


paragraph, long dispHex);1

void putValueToControl(char panel[], char control[], char val[]);

Message Output

void putValueToControl(char panel[], char control[], message val);

void putValueToControl(char panel[], char control[], message val, long


paragraph);1

void putValueToControl(char panel[], char control[], message val, long


paragraph, long dispHex);1

PG Output

void putValueToControl(char panel[], char control[], pg val);

void putValueToControl(char panel[], char control[], pg val, long


paragraph);1

void putValueToControl(char panel[], char control[], pg val, long


paragraph, long dispHex);1

LIN Message Output

void putValueToControl(char panel[], char control[], linMessage val);

void putValueToControl(char panel[], char control[], linMessage val,


long paragraph);1

void putValueToControl(char panel[], char control[], linMessage val,


long paragraph, long dispHex);1

MOST Message Output

void putValueToControl(char panel[], char control[], mostMessage val);

void putValueToControl(char panel[], char control[], mostMessage val,


long paragraph);1

void putValueToControl(char panel[], char control[], mostMessage val,

1
This function requires CANoe 7.5 and higher.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValueToControl

long paragraph, long dispHex);1

MOST Raw Message Output

void putValueToControl(char panel[], char control[], mostRawMessage


val);

void putValueToControl(char panel[], char control[], mostRawMessage


val, long paragraph);1

void putValueToControl(char panel[], char control[], mostRawMessage


val, long paragraph, long dispHex);1

GMLAN Message Output

void putValueToControl(char panel[], char control[], gmLanMessage val);

void putValueToControl(char panel[], char control[], gmLanMessage val,


long paragraph);1

void putValueToControl(char panel[], char control[], gmLanMessage val,


long paragraph, long dispHex);1

BEAN Message Output

void putValueToControl(char panel[], char control[], beanMessage val);

void putValueToControl(char panel[], char control[], beanMessage val,


long paragraph);1

void putValueToControl(char panel[], char control[], beanMessage val,


long paragraph, long dispHex);1

Function Assigns the value val to the Multi Display Control or the CAPL Output View with the name
control. The Multi Display Control/ CAPL Output View is located on the panel with the
title panel.

Different contents are displayed with the Multi Display Control/CAPL Output View. In
addition to numbers (float and integer) and texts (char[]), in particular different
messages (CAN, LIN, ... and J1939 PGNs) can also be displayed.

Info

Using a Multi Display Control/CAPL Output View, no environment variable is


necessary.

Parameters panel

Title of the panel.

control

Name of the control.

val

Value to be displayed.

paragraph

Indicates if the output shall be written to a new line.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValueToControl

Info

This parameter is only available with the CAPL Output View.

Parameter Description
Values

0 In this case, no new paragraph is set. The text will be append directly to
the existing output.

This is the default setting. If you want to use the default setting you do
not need to set the parameter when calling the function.

1 In this case, the output is written to a new line.

dispHex

Indicates if the output is formatted hexadecimal.

Info

• This parameter is only available with the CAPL Output View.


• The physical value of a signal cannot be displayed in hexadecimal format.
Then the setting is not considered and will be ignored. Only the raw value
of a signal can be formatted hexadecimal.

Parameter Description
Values

0 In this case, the signal/message/value is written in decimal notation.

For signals this is the default setting. If you want to use the default
setting you do not need to set the parameter when calling the function.

1 In this case, the signal/message/value is written in hexadecimal notation.

For messages this is the default setting. If you want to use the default
setting you do not need to set the parameter when calling the function.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

3.2 — • •

7.5: 1 CAPL Output View • •

Example: Output of a string, a message, a signal - no additional function parameters


used
variables
{
int value;
message EngineData mEngineData;
}
on envVar EnvShowMultiDisplay
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValueToControl

value = getvalue(this);
switch(value)
{
case 1: putValueToControl("Gateway","DisplayControl","This is the
Automot Demo!");
break;
case 2: putValueToControl("Gateway","DisplayControl",mEngineData);
break;
case
3: putValueToControl("Gateway","DisplayControl",mEngineData.EngSpeed.phys);
break;
}
}

Example: Output of a message — optional with function parameters


variables
{
...message MyMessage TestMsg;
}

on key 'a'
{
//Output of a message without additional parameter settings. In this case
parameters have default settings; they are 'no new paragraph' and 'display
message in 'hexadecimal' notation'
putValueToControl("TestPanel","ControlOutput1", TestMsg);
//Output of a message, each time in a new paragraph.
putValueToControl("TestPanel","ControlOutput1", TestMsg, 1);

//Output of a message, each time with a new paragraph and the message is
displayed in decimal notation.
//putValueToControl("TestPanel","ControlOutput1", TestMsg, 1, 0);
}

Example: Output of a signal (raw format) — optional with function parameters


variables
{
...message MyMessage TestMsg;
}

on key 'b'
{
//Output of a signal (raw) without additional parameter settings.
//In this case parameters have default settings;
//they are 'no new paragraph' and display signal in 'decimal' notation.
putValueToControl("TestPanel","ControlOutput1", "\nSignal raw\n");
putValueToControl("TestPanel","ControlOutput1", TestMsg.Signal1);

//Output of a signal (raw), each time in a new paragraph.


putValueToControl("TestPanel","ControlOutput1", TestMsg.Signal1, 1);

//Output of a signal (raw), each time in a new paragraph and in hexadecimal


notation.
putValueToControl("TestPanel","ControlOutput1", TestMsg.Signal1, 1, 1);
}

Example: Output of a signal (physical format) — optional with function parameters


variables
{
...message MyMessage TestMsg;
}

on key 'c'
{
//Output of a signal (physical) without additional parameter settings.
//In this case parameters have default settings;
//they are 'no new paragraph' and display signal in 'decimal' notation.
putValueToControl("TestPanel","ControlOutput1", "\nSignal raw\n");
putValueToControl("TestPanel","ControlOutput1", TestMsg.Signal1.phys);

//Output of a signal (physical), each time in a new paragraph.


putValueToControl("TestPanel","ControlOutput1", TestMsg.Signal1.phys, 1);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: putValueToControl

| putValue | getValue | getValueSize |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: random

random
CAPL Function Overview » General » random

Syntax dword random(dword x);

Function Calculates a random number between 0 and x-1.

Parameters Determines the interval.

Return values Random number between 0 and x-1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
dword x;
// generate random number in the interval [0;100[
x = random(100);

| runError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ReplayResume

ReplayResume
CAPL Function Overview » General » ReplayResume

Syntax dword ReplayResume (char pName[])

Function Starts the Replay block with the name pName after it is suspended by ReplaySuspend.

Parameters pName

Name of the Replay block.

Return values 1: If successful

0: If the Replay block does not exist or cannot be restarted

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ReplayStart

ReplayStart
CAPL Function Overview » General » ReplayStart

Syntax dword ReplayStart (char pName[])

Function Starts the Replay block with the name pName.

Parameters pName

Name of the Replay block.

Return values 1: If successful

0: If the Replay block does not exist or cannot be restarted

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ReplayState

ReplayState
CAPL Function Overview » General » ReplayState

Syntax dword ReplayState (char pName[])

Function Returns the state of the Replay block with the name pName.

Parameters pName

Name of the Replay block

Return values 0: Replay Block is stopped (state: stopped)

1: Execution of the Replay file was started (state: running)

2: Execution of the Replay file was stopped (state: suspended)

(dword)-1: when the Replay block does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ReplayStop

ReplayStop
CAPL Function Overview » General » ReplayStop

Syntax dword ReplayStop (char pName[])

Function Stops the Replay block with the name pName.

Parameters pName

Name of the Replay block.

Return values 1: If successful

0: If the Replay block does not exist or cannot be restarted

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ReplaySuspend

ReplaySuspend
CAPL Function Overview » General » ReplaySuspend

Syntax dword ReplaySuspend (char pName[])

Function Suspends the Replay block with the name pName.

Parameters pName

Name of the Replay block

Return values 1: If successful

0: If the Replay block does not exist or cannot be restarted

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: resetCan

resetCan
CAPL Function Overview » General » resetCan

Syntax void resetCan();

Function Resets the CAN controller. Can be used to reset the CAN controller after a BUSOFF or to
activate configuration changes. Since execution of the function takes some time and the
CAN controller is disconnected from the bus briefly, messages can be lost when this is
performed.

Info

With this function you can reset CAN1 and CAN2. If only one specific CAN
channel is used, resetCan stops with an error and the CAN channels keep
offline. In this case the ResetCanEx function has to be used.
The function resetCanEx can be used for all channels.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
on key 'r' { // Controller is reset after BUSOFF
resetCan();
}

| setOcr | setBtr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetCanEx

ResetCanEx
CAPL Function Overview » General » ResetCanEx

Syntax void ResetCanEx(long channel);

Function Resets the CAN controller for one specific CAN channel. Can be used to reset the CAN
controller after a BUSOFF or to activate configuration changes. Since execution of the
function takes a certain amount of time and the CAN controller is disconnected from the
bus for a brief period messages may be lost.

Parameters channel

CAN channel

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
on key 'r' { // After BUSOFF the controller on Channel 2 is reset
resetCanEx(2);
}

| resetCan |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _round

_round
CAPL Function Overview » General » _round

Syntax long _round(double x);

int64 _round64(double x);

Function Rounds x to the nearest integral number. The rounding method used is symmetric
arithmetic rounding.

Parameters x

Number to be rounded

Return values Nearest integral number.

For very large numbers, you should use _round64, which returns a 64 bit integer.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
long result;
result = _round(2.4); // result == 2
result = _round(2.5); // result == 3
result = _round(-3.5); // result == -4

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: runError

runError
CAPL Function Overview » General » runError

Syntax void runError(long err, long);

Function Triggers a run error. Outputs the error number to the Write window indicating the error
number and the passed number, and then terminates the measurement.

Parameters Numbers that are represented in CANoe as a references for the user.

The values under 1000 are reserved for internal purposes. The second parameter is
reserved for future expansions.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
if(rpm < 0) runError(1001,1);
...

| elCount |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ScanBaudrateActive

ScanBaudrateActive
CAPL Function Overview » General » ScanBaudrateActive

Note

This function is only available with CANcardXL, CANcaseXL and CANboardXL.

Use case The applied baud rate on a real network should be determined on which NO
communication exists. In this case CANoe is an active participant - Transmitter - on the
network.

Syntax long ScanBaudrateActive( DWORD channel, DWORD messageID, double


firstBaudrate, double lastBaudrate, DWORD timeout);

Function The function determines the baud rate for the given channel. Result of the function is
written into the Write window.

The baud rate scanner checks different baud rates and tries to send a message through
the given channel. The function is finished if the message was sent successfully and the
baud rate was determined. If a wrong baud rate is present, the other power supply takers
cannot receive the message. CANoe as the transmitter does not receive an acknowledge
and sends an ErrorFrame. In this case the next baud rate of the baud rate range is
checked.

Info

CAN.ini file settings for the baudrate scanner:


[BaudrateScanner]
Dlc=8
DisplayBaudrateList=0

Dlc:

DLC of the message sent by the scanner.

Default value: 8

DisplayBaudrateList:

If this value is set to 0 the baudrate scanner stops after finding the first
baudrate.

If the value is non-zero the scanner checks all baudrates and displays a list of
values at the end.

Default value: 0

Parameters channel

Channel number. (1,..,32)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ScanBaudrateActive

messageID

ID of the message that the scanner will send to detect the baudrate. The DLC of the
message is always 8.

firstBaudrate / lastBaudrate

Baud rate range to scan.

• If both values are set to zero the scanner checks the most commonly used baudrates:
33.333, 50.0, 83.333, 100.0, 125.0, 250.0, 500.0, 1000.0 [kBaud]
• If both values are the same but not zero the scanner multiplies the baudrate with a
given factor (Value range 0.25-5.0). The factor is changed with steps of 0.25.
• If both values are different, all possible baudrate values in the ranged are scanned.
The incremental step in the range is 1.5%.

timeout

Period of time [ms] the scanner waits when the message is sent.

Return values Returns 0 if the scan function was successfully started. Otherwise the return value is non-
zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 — — •

Example

| ScanBaudratePassive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ScanBaudratePassive

ScanBaudratePassive
CAPL Function Overview » General » ScanBaudratePassive

Note

This function is only available with CANcardXL, CANcaseXL and CANboardXL.

Use case The applied baud rate on a real network should be determined on which communication
exists. In this case CANoe is a passive participant - receiver - on the network and it is
connected about a Y cable to the network.

Syntax long ScanBaudratePassive( DWORD channel, DWORD messageID, double


firstBaudrate, double lastBaudrate, DWORD timeout, DWORD bAcknowledge);

Function Baud rate scanner checks different baud rates and tries to receive a message on the
channel. Function starts the scan and detects the baud rate on the given channel. Result
of the function is written into the Write window.

If a wrong baudrate is present, CANoe cannot receive messages and sends an ErrorFrame,
which can be put on the bus using the parameter bAcknowledge.

Info

CAN.ini file settings for the baudrate scanner:


[BaudrateScanner]
Dlc=8
DisplayBaudrateList=0

Dlc:

DLC of the message sent by the scanner.

Default value: 8

DisplayBaudrateList:

If this value is set to 0 the baudrate scanner stops after finding the first
baudrate.

If the value is non-zero the scanner checks all baudrates and displays a list of
values at the end.

Default value: 0

Parameters channel

Channel number. (1,..,32)

messageID

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ScanBaudratePassive

ID of the message that the scanner will receive to detect the baudrate.

If this value is 0xffff the scanner will receive all the messages on the channel.

firstBaudrate / lastBaudrate

Baudrate range to scan.

• If both values are set to zero the scanner checks the most commonly used baudrates:
33.333, 50.0, 83.333, 100.0, 125.0, 250.0, 500.0, 1000.0 [kBaud]
• If both values are the same but not zero the scanner multiplies the baudrate with a
given factor (Value range 0.25-5.0). The factor is changed with steps of 0.25.
• If both values are different, all possible baudrate values in the ranged are scanned.
The incremental step in the range is 1.5%.

timeout

Period of time [ms] the scanner waits when the message is sent.

bAcknowledge

Acknowledge mode on (1)/off (0).

If a wrong baud rate is present, CANoe cannot receive messages and sends an ErrorFrame,
which can be put on the bus using the parameter bAcknowledge.

The parameter serves for the fact that CANoe - as a passive receiver - can participate
indirectly in the network communication by sending an ErrorFrame.

The parameter does not change the Acknowledge settings of the Hardware Configuration
dialog. The parameter has an effect only during runtime of the function.

Return values Returns 0 if the scan function was successfully started. Otherwise the return value is non-
zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 — — •

Example

| ScanBaudrateActive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setBtr

setBtr
CAPL Function Overview » General » setBtr

Syntax long setBtr(long channel, byte btr0, byte btr1);

Function Sets another baud rate. The values do not become active until the next call of the
function resetCan.

It should be noted that these values depend on the CAN controller used.

Parameters CAN channel

0 Both controllers

1 channel 1

2 channel 2

BTR0

Value of Bit Timing Register 0.

BTR1

Value of Bit Timing Register 1.

Return values Always 1

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
...
setBtr(0, 0x00, 0x3a); // 500 kBaud for 82C200
resetCan(); // aktivate
...

| resetCan | setOcr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetBusContext

SetBusContext
CAPL Function Overview » General » SetBusContext

Note

The bus context plays a role in modeling gateways and in tests of control units with
several bus connections. In this case, a series of CAPL functions such as canOnline and
canOffline may have more than one meaning in terms of the bus interface (channel) to be
used. A similar type of problem occurs when identical node layer modules are used
simultaneously within a CAPL block. A distinction must be made between the instances of
the node layer, both for calls to CAPL functions that are implemented in the node layers
and for implementing callbacks.

To facilitate this distinction, a bus context is placed in the CAPL program by the runtime
environment while a callback is being executed by the node layer. This context
unambiguously identifies the node layer that is making the call. In a similar manner, the
call of a CAPL function that is implemented in a node layer is forwarded on to the
appropriate node layer, depending on the current bus context. This also applies to the
CAPL functions mentioned above, canOnline and canOffline, as well as to many wait
points of the Test Feature Set.

You should use the functions GetBusNameContext, GetBusContext and SetBusContext to


determine the context of a bus, to query the current bus context, or to change the
context.

Syntax dword SetBusContext( dword context)

Function Sets the bus context of the CAPL block.

Parameters context

The new bus context to be set.

Return values The bus context that was valid before the call was made is returned.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

This is an example for a simulation node.


Test nodes should copy the bus context to a CAPL variable in the Main() function because
all global variables are cleared when the test module is started.
variables
{
dword ibus_context = 0;
dword motbus_context = 0;
}
on preStart
{
ibus_context = GetBusNameContext( "ibus");
motbus_context = GetBusNameContext( "motbus");
}
void apCanOn()
{
dword context;
// activate the CAN channel on the "current" context
CanOnline();
// determine the "other" context
context = ibus_context == GetBusContext() ? motbus_context : ibus_context;
// set the context to the "other" bus...

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetBusContext

SetBusContext( context);
// ...and activate its CAN chip as well
CanOnline();
}

| GetBusNameContext | GetBusContext |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setCanCabsMode

setCanCabsMode
CAPL Function Overview » General » setCanCabsMode

Syntax long setCanCabsMode(long ntype,long nchannel,long nmode,long nflags);

Function Various CANcabs modes may be set. Replaces the setPortBits functions.

Parameters ntype

Unused, must be set to 0

nchannel

CAN channel

nmode

Is used for the control of the board lines via a bit pattern.

Mode, valid values:

0 NORMAL

1 SLEEP

2 HIVOLTAGE

3 HISPEED

4 DUAL_WIRE

5 SINGLE_WIRE_LOW

6 SINGLE_WIRE_HIGH

7 is reserved

For CANcab Eva two output lines can be set.

nMode Line 2 Line 1


8 0 0
9 0 1
10 1 0
11 1 1

Example

Call the function with ntype = 0, nchannel = 1, nMode = 11, nflags = 0


setCanCabsMode(0,1,11,0); // sets both lines to 1

nflags

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setCanCabsMode

Is used for the control of the board lines via a bit pattern.

Flag, valid values:

0x01 AUTOWAKEUP, only together with SLEEP

0x02 HIGHPRIO, only CANcab 5790 c, 1=clear tx-buffers

Info

Flags can be ORed, e.g. 0x03 = AUTOWAKE+HIGHPRIO

Info

Not all mode and flag values are valid for all CANcabs!

(see also the hardware description for CANcabs)

Return values 0: ok

!=0: Error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
on key 'n'
{
long ntype, nmode, nchannel, nflags;
ntype = 0;
nmode = 0;
nchannel = 1;
nflags = 0;
setCanCabsMode(ntype, nchannel, nmode, nflags);
write("normal mode");
}

| setPortBits - Single Wire | setPortBits - Lowspeed |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetClockControlTime

SetClockControlTime
CAPL Function Overview » General » SetClockControlTime

Syntax void SetClockControlTime(char[] panel, char[] control, int hours, int


minutes, int seconds);

void SetClockControlTime(char[] panel, char[] control, int time);

Function Sets the time of the Panel Designer clock control element.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only access the control by its name. In the property dialog
of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The name
of the environment variable, system variable or signal could be specified as following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

hours

Defines the hours of the time to be displayed in the clock control.

minutes

Defines the minutes of the time to be displayed in the clock control.

seconds

Defines the seconds of the time to be displayed in the clock control.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetClockControlTime

time

Defines the time in seconds to be displayed in the clock control. The corresponding hours,
minutes and seconds are calculated during runtime.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Clock Control • •

Example
// Set the time in hours, minutes, seconds. It will be displayed
'10:20:30'.
on key 'a'
{
SetClockControlTime("ClockControl1", "ClockCAPL", 10, 20, 30);
}

// Set the time in seconds. It will be displayed '01:00:00'.


on key 'b'
{
SetClockControlTime("ClockControl1", "ClockCAPL", 3600);
}

| SetControlProperty | SetControlForeColor | SetControlBackColor | SetDefaultControlColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlBackColor

SetControlBackColor
CAPL Function Overview » General » SetControlBackColor

Syntax void SetControlBackColor(char[] panel, char[] control, long color);

Function Sets the background color of panel elements.

The panel is accessed by its individual panel name that is entered in the Panel Designer /
Panel Editor.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only activate/deactivate the control with its name. In the
property dialog of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The
name of the environment variable, system variable or signal could be specified as
following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Info for 'CAPL Output View' Control

When changing the background color only the following/future output — using
putValueToControl — is colored with the new one. The existing output stays
unchanged in color.

color

Color value (e.g. calculated by MakeRGB)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlBackColor

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
// Set the background color for a specific control of a panel
SetControlBackColor("motor", "PedalPos", MakeRGB(255,0,0));

// All controls of the panel are set to the same background color
SetControlBackColor("motor", "", MakeRGB(255,0,0));

// All controls of all panels are set to the same background color
SetControlBackColor("", "", MakeRGB(255,0,0));

| SetControlProperty | SetControlForeColor | SetControlColors | SetDefaultControlColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlColors

SetControlColors
CAPL Function Overview » General » SetControlColors

Syntax void SetControlColors(char[] panel, char[] control, long backcolor, long


textcolor);

Function Sets the background and text color of panel elements.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only activate/deactivate the control with its name. In the
property dialog of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The name
of the environment variable, system variable or signal could be specified as following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Info for 'CAPL Output View' Control

When changing the background and text color only the following/future
output — using putValueToControl — is colored with the new one. The
existing output stays unchanged in color.

backcolor

Color value (e.g. calculated by MakeRGB)

textcolor

Color value (e.g. calculated by MakeRGB)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlColors

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Example
//Set the background and text color for a specific control of a panel
SetControlColors("motor", "PedalPos", MakeRGB(255,0,0), MakeRGB(0,0,255));

//All controls of the panel are set to the same background and text color
SetControlColors("motor", "", MakeRGB(255,0,0), MakeRGB(0,0,255));

//All controls of all panels are set to the same background and text color
SetControlColors("", "", MakeRGB(255,0,0), MakeRGB(0,0,255));

| SetControlProperty | SetControlForeColor | SetControlBackColor | SetDefaultControlColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlForeColor

SetControlForeColor
CAPL Function Overview » General » SetControlForeColor

Syntax void SetControlForeColor(char[] panel, char[] control, long color);

Function Sets the foreground color of panel elements.

The panel is accessed by its individual panel name that is entered in the Panel Designer /
Panel Editor.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only activate/deactivate the control with its name. In the
property dialog of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The
name of the environment variable, system variable or signal could be specified as
following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Info for 'CAPL Output View' Control

When changing the text color only the following/future output — using
putValueToControl — is colored with the new one. The existing output stays
unchanged in color.

color

Color value (e.g. calculated by MakeRGB)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlForeColor

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
// Set the foreground color for a specific control of a panel
SetControlForeColor("motor", "PedalPos", MakeRGB(255,0,0));

// All controls of the panel are set to the same foreground color
SetControlForeColor("motor", "", MakeRGB(255,0,0));

// All controls of all panels are set to the same foreground color
SetControlForeColor("", "", MakeRGB(255,0,0));

| SetControlBackColor | SetControlProperty | SetControlColors | SetDefaultControlColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetControlProperty

SetControlProperty
CAPL Function Overview » General » SetControlProperty

Syntax void SetControlProperty(char[] panel, char[] control, char[] property, long


value);

void SetControlProperty(char[] panel, char[] control, char[] property,


float value);

void SetControlProperty(char[] panel, char[] control, char[] property,


char[] value);

Function Sets a property of an ActiveX control.

The panel is accessed by its individual panel name that is entered in the Panel Editor.

It is easier to access color properties by MakeRGB.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the panel element ("" – references all elements on the panel)

property

Name of the property

value

Value to be set (long, float or string value)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
SetControlProperty("Measurements", "StatusIndicator", "Caption",
"running");
SetControlProperty("Measurements", "StatusIndicator", "BackColor",
MakeRGB(0,145,255));

| SetControlBackColor | SetControlForeColor |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetDefaultControlColors

SetDefaultControlColors
CAPL Function Overview » General » SetDefaultControlColors

Syntax void SetDefaultControlColors(char[] panel, char[] control);

Function Sets back the background and text color of panel elements as defined in the Panel
Designer.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the element. You can only activate/deactivate the control with its name. In the
property dialog of the control it's name is assigned/displayed.

If you want to use the name of a symbol (signal or environment/system variable) you have
to ensure that the control has no name instead of the individual control's name. The
name of the environment variable, system variable or signal could be specified as
following.

The form for signals is: "Signal:<signal name>".


The form for environment variables is: "EnvVar:<environment variable name>".
The form for system variables is: "SysVar:<name of system variable>". The name space
must not be used.

Info

• Symbol assignment must not be case sensitive.


• If you want to access all elements of a panel the notation "" is used, see
example below.

Example
"EnvVar:EnvGearLockDsp"
"Signal:SleepInd"
"Signal:easy/MotorState/EngineSpeed"
"SysVar:SysVarTester" (for a system variable defined with name
space TestSysvar in the configuration)
"ElemPanelHelp" (for Panel help)
"ElemPanelRecorder" (for Panel recorder)
"ElemCtrlBN" (for Panel control button)

Info for 'CAPLOutputView' Control

When changing the background and text color only the following/future
output — using putValueToControl — is colored with the new one. The
existing output stays unchanged in color.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetDefaultControlColors

Example
//Set the default background and text color for a specific control of a
panel.
SetDefaultControlColors("motor", "PedalPos");

//All controls of the panel are set to the default background and text
color as defined in the Panel Designer.
SetDefaultControlColors("motor", "");

//All controls of all panels are set to the default background and text
color as defined in the Panel Designer.
SetDefaultControlColors("", "");

| SetControlProperty | SetControlForeColor | SetControlBackColor | SetControlColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setDrift

setDrift
CAPL Function Overview » General » setDrift

Syntax void setDrift(int drift)

Function A constant deviation can be set for the timers of a network node with this function. Inputs
for the two values may lie between –10000 and 10000 (corresponds to –100.00% to
100.00%). If the value does not lie within this range, a message is output in the Write
window.

Info

Setting of a Drift causes any existing Jitter to be reset.

Parameters drift

Integer for the constant deviation.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
...
// Sets the Drift to 35.5 percent
setDrift(3550);
...

| setJitter | getDrift | getJitterMin | getJitterMax |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setFilePath

setFilePath
CAPL Function Overview » General » setFilePath

Info

This function is not available in case of a distributed environment.

Syntax void setFilePath (char Path[],dword mode);

Function This function sets the read and write path to the directory. The path can be given as
absolute or relative to the currently active configuration.

Parameters Path

0 Sets path for read functions

1 Sets path for write functions (same as setWritePath)

2 Sets path for both types of functions

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
//set directory for reading
setFilePath("C:\\Windows\\TEMP", 0);
//set directory for writing
setFilePath("D:\\TEMP", 1);
//set directory for writing and reading
setFilePath("C:\\TEMP", 2);

on key 'i'
{
int defaultPara1;
int returnParaInt;
int counter;
double defaultPara2;
double returnParaFloat;
char buffer [256];
//define symbolic values for read/write access mode
dword FILE_PATH_R = 0;
dword FILE_PATH_W = 1;
dword FILE_PATH_RW = 2;
defaultPara1 = -1;
defaultPara2 = -1;
//set absolute file path for writing
setFilePath("C:\\TEMP" , FILE_PATH_W);
// Write different values into the section "Parameter" of the INI file
"Test.ini"
// If no file path is specified, the path from previous setFilePath command
is used
writeProfileString ("Parameter","String","TestString","Test.ini");
writeProfileFloat ("Parameter","Float", 1.7845,"Test.ini");
writeProfileInt ("Parameter", "Integer", 8, "Test.ini");
// Read different values from the Section "Parameter" of the INI file
"C:\\temp\\Test.ini"
// And display the values in the Write window
//if an absolute path is to be used, this can be coded in the parameter
<filename> directly
returnParaInt =
getProfileInt("Parameter","Integer",defaultPara1,"C:\\TEMP\\Test.ini");
returnParaFloat =

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setFilePath

getProFileFloat("Parameter","Float",defaultPara2,"C:\\TEMP\\Test.ini");
getProFileString("Parameter","String","Default String", buffer,
elcount(buffer), "C:\\TEMP\\Test.ini");
write("Integer: %d", returnParaInt);
write("Float: %f", returnParaFloat);
write("String: %s", buffer);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setJitter

setJitter
CAPL Function Overview » General » setJitter

Syntax setJitter(int min, int max)

Function The Jitter interval for the timers of a network node can be set with this function. The two
values may lie between –10000 and 10000 (corresponds to –100.00% to 100.00%). If one of
the two values does not lie within this range, a message is output in the Write window.

Info

Setting of a Jitter will cause any existing Drift to be reset. To utilize Jitter
and Drift simultaneously please refer to the example.

Parameters min

Integer for the lower interval limit.

max

Integer for the upper interval limit.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
...
// Set a Jitter with +–4 percent
setJitter(-400, 400);
...

...
// Set a Jitter with +–4 percent
// and a Drift of 17 percent
setJitter(1300, 2100);
...

| getJitterMax | getJitterMin | setDrift | getDrift |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setLogFileName

setLogFileName
CAPL Function Overview » General » setLogFileName

Syntax setLogFileName(char fileName[]);

setLogFileName(char strLoggingBlockName[], char fileName[]);

Function Sets the name of the logfile.

Parameters fileName

The name may be an absolute path, a single filename or a relative path. If an absolute
path or a relative path is supplied, all non existing directories of the path will be created.
The logfile will be placed in the directory of the current configuration, if a single
filename is supplied, or in the path relative to the configuration file if a relative path is
supplied. The directories of the path must be separated by a backslash ('\'). The filename
must not contain a file extension. The extension will be set automatically by the system.

Info

Within a string literal a second backslash has to be set (see example).

The new name will only be changed with a new setLogFileName call or by a
corresponding entry in the configuration dialog of the logfile.

If the logging block does not log (logging is not active) the name is changed immediately.

If the logging block logs (logging is active) the new name will be taken over with the next
trigger event or with a new measurement start.

Info

The name set with the setLogFileName function will not be saved when
saving the configuration. Only the name set in the configuration dialog of the
logfile will be taken over.

strLoggingBlockName

Name of the logging block.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

All — • —

7.6 SP3: form 2 — • •

Example
...
setLogFileName("Logging1", "newlog");
...
Sets the name of the logging file to "newlog" in the directory of the
current configuration.

...
setLogFileName("Logging1", "c:\\canw\\demo\\automot\\newlog");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setLogFileName

...
Sets the absolute path of the logging file.

...
setLogFileName("Logging1", "..\\Logging\\newlog");
...
Sets the relative path of the logging file.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetMediaFile

SetMediaFile
CAPL Function Overview » General » SetMediaFile

Syntax SetMediaFile(panel, control, mediafile);

Function Replaces the media file of the Panel Designer Media Player control during runtime.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the panel element ("" – references all controls on the panel)

mediafile

Path and name of the media file.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Media Player • •

Example

Setting media file using absolute path.


on key 'x'
{
SetMediaFile("Movie", "Media Player",
"D:\\Example\\MediaPlayerProject\\Videos\\song.mpg");
}

Setting media file using relative path. The media file is in the Videos folder and this
folder is parallel to the panel folder.
on key 'y'
{
SetMediaFile("Movie", "Media Player", "..\\Videos\\song.mpg");
}

| putValue | SetPictureBoxImage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setOcr

setOcr
CAPL Function Overview » General » setOcr

Syntax setOcr(long channel, byte ocr);

Function Sets the Output Control Register. The values do not become active until the next call of
the function resetCan().

It should be noted that these values depend on the CAN platform used.

Parameters CAN channel

0 all channels

>0 only the given channel

OCR

Value of the Output Control Register

Return values 1: success

0: error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — — •

Example
...
setOcr(0, 0x02); // set
resetCan(); // activate
...

| resetCan | setBtr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPictureBoxImage

SetPictureBoxImage
CAPL Function Overview » General » SetPictureBoxImage

Syntax setPictureBoxImage(panel, control, imagefile);

Function Replaces the image of the Panel Designer Picture Box control during runtime.

The panel is accessed by its individual panel name that is entered in the Panel Designer.

Parameters panel

Panel name ("" – references all opened panels)

control

Name of the panel element ("" – references all controls on the panel)

iamgefile

Path and name of the image file.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Picture Box • •

Example

Setting image file using absolute path.


on key 'x'
{
SetPictureBoxImage("Movie", "Picture Box",
"D:\\Example\\PictureBoxProject\\Images\\Picture.bmp");
}

Setting image file using relative path. The image is in the Images folder and this folder is
parallel to the panel folder.
on key 'y'
{
SetPictureBoxImage("Movie", "Picture Box", "..\\Images\\Picture.bmp");
}

| SetMediaFile |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setPostTrigger

setPostTrigger
CAPL Function Overview » General » setPostTrigger

Syntax setPostTrigger(long preTriggerTime);

Function Sets the posttrigger of the logging. The posttrigger set with this function is valid until the
end of the measurement or until the next call of this function.

Parameters New posttrigger value in milliseconds.

If a value of -1 is supplied, the prosttrigger will be set to infinity.

Return values 1, if the posttrigger is set to the given value, 0 else.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
setPostTrigger(2500);
...
Set the posttrigger time of the logging to 2.5 seconds.

...
setPostTrigger(-1);
...
Set the posttrigger of the logging to infinity.

| setPreTrigger |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setPreTrigger

setPreTrigger
CAPL Function Overview » General » setPreTrigger

Syntax setPreTrigger(long preTriggerTime);

Function Sets the pretrigger of the logging. The pretrigger set with this function is valid until the
end of the measurement or until the next call of this function.

Parameters New pretrigger value in milliseconds.

Return values 1, if the pretrigger is set to the given value, 0 else.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
setPreTrigger(25);
...
Set the pretrigger time of the logging to 25 milliseconds.

| setPostTrigger |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setSignalStartValues

setSignalStartValues
CAPL Function Overview » General » setSignalStartValues

Syntax setSignalStartValues(message msg) // Form 1

setSignalStartValues(multiplexed_message msg) // Form 2

setSignalStartValues(frFrame frame) // Form 3

setSignalStartValues(frFrame frame, byte uninitializedData) // Form 4

setSignalStartValues(frPDU pdu) // Form 5

setSignalStartValues(frPDU pdu, byte uninitializedData) // Form 6

setSignalStartValues(pg paramGroup) // Form 7

setSignalStartValues(j1587Param param) // Form 8

setSignalStartValues(linmessage msg) // Form 9

Function Sets the values of the signals in the parameter to the start values defined in the
database.

Parameters msg, frame, pdu, paramGroup, parameter

Objects where the signals shall be set.

uninitializedData (Form 4, Form 6)

Value to which the bytes in the frame / PDU shall be set which are not used by signals.

Return values 0: function was successful

1: message / frame / PDU / paramGroup wasn't found in the database

2: at least one signal start value didn't fit into the signal in the message

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example
message LightState msg;
setSignalStartValues(msg);

| StartLogging |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setStartdelay

setStartdelay
CAPL Function Overview » General » setStartdelay

Syntax void setStartdelay(int delay)

Function Sets the value of the Start Delay for this network node. This function can only be called in
the preStart event procedure. Afterwards the value of the Start Delay cannot be changed
any more.

Parameters delayText

Integer for the Start Delay ms. This value may lie between 0 and 99999. If the value is
greater or less than the limits of this range a warning appears in the Write window.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
...
on preStart
{
// Set Start Delay to 10 seconds
setStartdelay(10000);
}

| getStartdelay |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setTimer

setTimer
CAPL Function Overview » General » setTimer

Syntax void setTimer(msTimer t, long duration);

void setTimer(timer t, long duration); (Type 1)

void setTimer(timer t, long durationSec, long durationNanoSec); (Type 2)

Info

• The precision of timers in CAPL depends on the hardware used (generally


one millisecond). Nevertheless the event procedures (on message, on
timer, ...) are processed in the correct sequence, i.e. for analysis
purposes (e.g. timeout monitoring) the event's time stamp can be used
instead of the clock signal generated by the hardware.
• The maximum of msTimer is: 2147483647 ms = 2147483,647 s = 596,52h.
The maximum of timer (Type 1) is: 2147483647 s = 596523.23h.
The maximum of timer (Type 2) is: 2147483647 s + 2147483647ns
~2147483649s.

Method t.set(long duration);

t.set(long duration, long durationNanoSec);

Function Sets a timer.

Parameters Timer or msTimer variable and an expression which specifies the duration of the timer.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

All — • •

7.0 SP5: methods — • •

Example
variables {
msTimer t;
Timer t1;
}
on key F1 {
setTimer(t, 200); // set timer t to 200 ms
}
on key F2 {
setTimer (t1, 2); // set timer t1 to 2 sec
}
on key F3 {
setTimer (t1, 0, 1250*1000 ); // set timer t1 to 1.250 milliseconds
}

| cancelTimer | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setTimerCyclic

setTimerCyclic
CAPL Function Overview » General » setTimerCyclic

Syntax void setTimerCyclic(msTimer t, long firstDuration, long period) // Form 1

void setTimerCyclic(msTimer t, long period) // Form 2

Function Sets a cyclical timer.

With form 2, firstDuration is implicitly the same as period, i.e. the timer runs precisely
according to period the first time.

Parameters t

The timer to be set.

firstDuration

Time in milliseconds until the timer runs out for the first time.

period

Time in milliseconds in which the timer is restarted in case of expiration.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example

Starting of a timer that expires the first time 10 ms after the start of measurement and
thereafter every 20 ms (10 ms, 30 ms, 50 ms, 70 ms etc.)
variables {
msTimer t;
}
on start {
setTimerCyclic(t, 10, 20)
}

| cancelTimer | setTimer | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setWriteDbgLevel

setWriteDbgLevel
CAPL Function Overview » General » setWriteDbgLevel

Syntax void setWriteDbgLevel (unsigned int priority);

Function This function sets the priority level for the writeDbgLevel CAPL function. The output
priority must be set for every network node.

Parameters priority

Priority of current CAPL node for output to the Write window.


Rays for priority: 0 to 15

0 Only write output with a priority of 0 are shown in the write window.

5 Write output with a priority ranging from 0 to 5 are shown.

15 All outputs are shown.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int i = 10;
int j = 12;
setWriteDbgLevel(7);
writeDbgLevel (4, "This is shown: h= %lxh",j);
// Output: This is shown: h= 0ch
writeDbgLevel (9, "This is not shown: d= %ld",i);
// No output

| write | writeDbgLevel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: setWritePath

setWritePath
CAPL Function Overview » General » setWritePath

Note

This function is not available in case of a distributed environment.

After drive letters and also between folders you have to enter two "\" e.g.
setWritePath("E:\\testconfiguration\\exercise").

Syntax void setWritePath (char relativeOrAbsolutePath[]);

Function This function sets the write path for the functions openFileWritewriteProfileString
andwriteProfileInt ,writeProfileFloat ,. The path can be given as absolute or relative to
the currently active configuration.

Parameters The file path as a string.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
SetWritePath("C:\\TEMP")– after the drive letter (e.g. "C:") you have to
enter two backslashes "\\"!

| setFilePath |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sin

sin
CAPL Function Overview » General » sin

Syntax double sin(double x);

Function Calculates sine of x.

Parameters Value in radians whose sine is to be calculated.

Return values Sine of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
double x;
x = sin(PI); // Result 0

| cos | exp | sqrt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: snprintf

snprintf
CAPL Function Overview » General » snprintf

Syntax long snprintf(char dest[], long len, char format[], ...);

Function This function corresponds to the C function sprintf. Supplementally, the parameter len
indicates the maximum length of the array dest.

The format string has the same meaning as with the function write and is described there.

Info

CAPL supports a function call with maximum 9 parameters.

Parameters dest

Character buffer to print to.

len

Maximum number of characters printed to buffer.

format

Formatted string printed to buffer.

Return values The number of characters written.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
char buffer[100], str[7] = "Vector";
long i;
i = snprintf(buffer,elcount(buffer),"String: %s\n", str);
write("Output:\n%s : Character count = %d\n", buffer, i);

| write |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sqrt

sqrt
CAPL Function Overview » General » sqrt

Syntax double sqrt(double x);

Function Calculates the square root.

Parameters Value whose square root is to be calculated.

Return values Square root of x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
double x;
x = sqrt(4.0); // Result 2.0

| cos | exp | sin |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandaloneConfigOpen

StandaloneConfigOpen
CAPL Function Overview » General » StandaloneConfigOpen

Syntax DWORD StandaloneConfigOpen(CHAR rtcfgFileName[], DWORD


stopCurrentMeasurement, DWORD startNewMeasurement, DWORD
returnToActiveConfig)

Function Opens the rtcfg file with the given name as standalone configuration.

• The given standalone configuration file must have been downloaded to the device
before.
• The command is only allowed while standalone mode is activated.
• If standalone measurement is currently running the command is deferred until end of
measurement (unless overwritten by another subsequent open command).
• If standalone measurement is not running but standalone mode is activated the file is
loaded (and indicated in the Standalone Manager GUI) but measurement is not started
automatically.
• Basic behavior corresponds to changing the default standalone configuration file (see
Configuration|Standalone Mode… in Remote Files tab.

Parameters rtcfgFileName

Name of the standalone configuration file (without path) to be set as default file.

stopCurrentMeasurement

If this parameter is 1 measurement is stopped immediately (but still waiting for deferred
stop clients). If the parameter value is 0 the request to load another configuration is
queued until end of measurement.

startNewMeasurement

If this parameter is set to 1 measurement will start immediately after the new
configuration has been loaded.

returnToActiveConfig

If this parameter is set to 1 the default configuration (usually a sort of “master


configuration”) will be loaded automatically after measurement based on the new
configuration will have been stopped.

Return values The function returns an error code with 0 representing successful operation.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 Standalone mode — •

Example
// "Config1.rtcfg" (master config.) contains following CAPL code:

on key F2
{
StandaloneConfigOpen("Config2.rtcfg", 1, 1, 1);
}
on key F3
{
StandaloneConfigOpen("Config3.rtcfg", 1, 0, 1);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandaloneConfigOpen

| StandaloneConfigSetDefault |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandaloneConfigSetDefault

StandaloneConfigSetDefault
CAPL Function Overview » General » StandaloneConfigSetDefault

Syntax DWORD StandaloneConfigSetDefault(CHAR rtcfgFileName[])

Function Changes the default configuration file, i.e. the standalone configuration to be loaded
when standalone mode is activated or the runtime kernel is started after reboot. Thus, it
results in a persistent change on the VN8900.

• The given standalone configuration file must have been downloaded to the device
before.
• The command can be used while standalone mode is activated or deactivated.
• Basic behavior corresponds to changing the default standalone configuration file (see
Configuration|Standalone Mode… in Remote Files tab.

Parameters rtcfgFileName

Name of the standalone configuration file (without path) to be set as default


configuration file.

Return values The function returns an error code with 0 representing successful operation.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 Standalone mode — •

Example

| StandaloneConfigOpen |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: startStatisticAcquisition

startStatisticAcquisition
CAPL Function Overview » General » startStatisticAcquisition

Note

The relevant CAPL block must appear directly before the Frame Histogram window in the
evaluation branch. Otherwise a warning is output in the Write window.

Syntax void startStatisticAcquisition()

Function A new acquisition range is started with this function. If an acquisition range has already
been started, the function has no effect since it cannot influence the currently active
range.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • —

Example

Statistical Evaluation (StatisticAcquisition)


...
// Tests for running acquisition range and stops it.
// If no statistical data acquisition is active a new one is started.
if(isStatisticAcquisitionRunning())
{
// Stops the running acquisition range
stopStatisticAcquisition();
}
else
{
// Starts a new acquisition range
startStatisticAcquisition();
}
...

| isStatisticAcquisitionRunning | stopStatisticAcquisition |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StartLogging

StartLogging
CAPL Function Overview » General » StartLogging

Syntax void startLogging();

void startLogging(char strLoggingBlockName[]);

void startLogging(char strLoggingBlockName[], long preTriggerTime);

Function Starts all logging blocks immediately bypassing all logging trigger settings.

Starts a logging block with name strLoggingBlockName immediately bypassing all logging
trigger settings.

Starts a logging block with name strLoggingBlockName bypassing all logging trigger
settings.

Function also sets a pre-trigger time to a value of the preTriggerTime.

Parameters strLoggingBlockName

Name of the logging block.

preTriggerTime

Pre-trigger time interval in ms.

Info

While using the preTriggerTime please pay attention to the fact, that the
buffer size in the trigger configuration dialog of the logging block is set
accordingly, so that all events of the given time interval can be logged.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
startLogging();
// starts all logging blocks
stopLogging();
// stops all logging blocks
startLogging( "Logging 1");
// starts the logging block "Logging 1"
stopLogging( "Logging 1");
// stops the logging block "Logging 1"
startLogging( "Logging 1", 2000);
// starts the logging block "Logging 1" with pre-trigger time 2000
milliseconds.
stopLogging( "Logging 1", 1000);
// stops the logging block "Logging 1" with post-trigger time 1000
milliseconds.

| StopLogging |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StartMacroFile

StartMacroFile
CAPL Function Overview » General » StartMacroFile

Note

Note that a relative path to the configuration directory or an absolute path can be
specified for the macro file.
Just the file name of the macro can also be specified. For this option, the macro file must
be located in the same folder as the configuration.

Syntax dword StartMacroFile(char fileName[]);

Function Starts playing the macro with the fileName file name.

Parameters fileName

Macro file.

Return values The returned handle is required to stop the macro playback.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StartReplayFile

StartReplayFile
CAPL Function Overview » General » StartReplayFile

Note

Note that a relative path to the configuration directory or an absolute path can be used
to specify the replay file.
Just the file name of the replay file can also be specified. For this option, the replay file
must be located in the same folder as the configuration.

Syntax dword StartReplayFile(char fileName[]);

Function Starts playing the replay file with the name fileName.

Parameters fileName

Replay file.

Return values The returned handle is required to stop the replay file.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: stop

stop
CAPL Function Overview » General » stop

Syntax void stop();

Function Programmed interrupt of the ongoing measurement.

In offline mode this function interrupts but does not end the measurement. In offline
mode the measurement can only be ended with <ESC>.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
if( isExtId(this) )
stop();
...

| trigger |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: stopStatisticAcquisition

stopStatisticAcquisition
CAPL Function Overview » General » stopStatisticAcquisition

Note

The relevant CAPL block must appear directly before the Frame Histogram window in the
evaluation branch. Otherwise a warning is output in the Write window.

Syntax void stopStatisticAcquisition()

Function A started acquisition range is stopped with this function. If no acquisition range has been
started yet, this function has no effect.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • —

Example

Statistical Evaluation (StatisticAcquisition)


...
// Tests for running acquisition range and stops it.
// If no statistical data acquisition is active a new one is started.
if(isStatisticAcquisitionRunning())
{
// Stops the running acquisition range
stopStatisticAcquisition();
}
else
{
// Starts a new acquisition range
startStatisticAcquisition();
}
...

| isStatisticAcquisitionRunning | startStatisticAcquisition |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StopLogging

StopLogging
CAPL Function Overview » General » StopLogging

Syntax void stopLogging();

void stopLogging(char strLoggingBlockName[]);

void stopLogging(char strLoggingBlockName[], long postTriggerTime);

Function Stops all logging blocks immediately bypassing all logging trigger settings.

Stops a logging block with name strLoggingBlockName immediately bypassing all logging
trigger settings.

Stops a logging block with name strLoggingBlockName bypassing all logging trigger
settings.

Functions also sets a post-trigger time to a value of the postTriggerTime.

Parameters strLoggingBlockName

Name of the logging block.

postTriggerTime

Post-trigger time interval in ms.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.1 — • •

Example
startLogging();
// starts all logging blocks
stopLogging();
// stops all logging blocks
startLogging( "Logging 1");
// starts the logging block "Logging 1"
stopLogging( "Logging 1");
// stops the logging block "Logging 1"
startLogging( "Logging 1", 2000);
// starts the logging block "Logging 1" with pre-trigger time 2000
milliseconds.
stopLogging( "Logging 1", 1000);
// stops the logging block "Logging 1" with post-trigger time 1000
milliseconds.

| StartLogging |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StopMacroFile

StopMacroFile
CAPL Function Overview » General » StopMacroFile

Syntax void StopMacroFile(dword handle);

Function Stops the macro from playing with the handle handle.

Parameters handle

Handle of the started macro.

The handle is returned from the StartMacroFile function when starting the macro.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StopReplayFile

StopReplayFile
CAPL Function Overview » General » StopReplayFile

Syntax void StopReplayFile(dword handle);

Function Stops the replay file from playing with the handle handle.

Parameters handle

Handle of the started replay file.

The handle is returned from the StartReplayFile function when starting the reply file.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strlen

strlen
CAPL Function Overview » General » strlen

Syntax long strlen(char s[]);

Function The functional result is the length of the string s.

Parameters string

Return values Length of the string.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
long length;
char buffer[100] = "CANalyzer";
length = strlen(buffer);

Result:
length = 9

| strncat | strncmp | strncpy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: str_match_regex

str_match_regex
CAPL Function Overview » General » str_match_regex

Syntax long str_match_regex(char s[], char pattern[])

Function Checks whether a string completely matches a regular expression pattern.

Parameters s

String to be checked.

pattern

Regular expression against which the string is matched. For the regular expression, the
same syntax is used as in the Perl programming language.

Return values 1 if the string matches the pattern, 0 if it doesn’t match the pattern.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 — • •

Example
char buffer[70] = "Vector Informatik";
long res;
res = str_match_regex(buffer, "Vector [A-Za-z]*"); // 1
res = str_match_regex(buffer, "Inf[a-z]*"); // 0

| str_replace | str_replace_regex | strstr_regex |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strncat

strncat
CAPL Function Overview » General » strncat

Syntax void strncat(char dest[], char src[], long len);

Function This function appends src to dest. len indicates the maximum length of the fit string. The
function ensures that there is a terminating "\0". Thus, a maximum of len - strlen(dest) -
1 characters are copied.

Info

Unlike the strncat C-function, rather than the number of characters to be


appended, len indicates the maximum length of the composite string,
including the terminating "\0".

Parameters dest

Target string to which characters are appended.

src

Appended string.

len

Maximum length of composite string.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
char s[20];
strncpy(s, "Vector", 10); // s is "Vector"
strncat(s, " CANoe", 19); // s is "Vector CANoe"
strncpy(s, "Vector", 10); // s is "Vector"
strncat(s, " CANoe", 11); // s is "Vector CAN"

| strlen | strncmp | strncpy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strncmp

strncmp
CAPL Function Overview » General » strncmp

Syntax long strncmp(char s1[], char s2[], long len);

long strncmp(char s1[], char s2[], long s2offset, long len)

Function This function compares s1 with s2 for a maximum of len characters.

If they are identical the functional result is 0.


If s1 is less than s2 the result is -1, else +1.

Form 2 starts the comparison in s2 at the specified offset.

Parameters s1

First string

s2

Second string

s2offset

Offset in s2

len

Maximum number of characters to compare

Return values -1 if s1 is less than s2.

1 if s2 is less than s1.

0 if the strings are equal.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All: form 1 — • •

7.0: form 2 — • •

Example
on key 's'
{
char s1[7] = "Vector";
char s2[7] = "Vector";
if(strncmp(s1,s2,strlen(s1)))
write("not equal");
else
write("equal");
}

| strlen | strncat | strncpy | strncmp_off |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strncmp_off

strncmp_off
CAPL Function Overview » General » strncmp_off

Syntax long strncmp_off(char s1[], long s1offset, char s2[], long s2offset, long
len);

Function This function compares s1 with s2 for a maximum of len characters.

If they are identical the functional result is 0.


If s1 is less than s2 the result is -1, else +1.
Comparison starts in s1 at s1offset and in s2 at s2offset.

Parameters s1

First string

s1offset

Offset in s1

s2

Second string

s2offset

Offset in s2

len

Maximum number of characters to compare

Return values -1 if s1 is less than s2.

1 if s2 is less than s1.

0 if the strings are equal.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
char s1[18] = "Vector Informatik";
char s2[11] = "Informatik";
if (strncmp_off(s1, 7, s2, 0, strlen(s2)) == 0)
write("Equal!");
else
write("Unequal!");

| strlen | strncat | strncpy | strncmp |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strncpy

strncpy
CAPL Function Overview » General » strncpy

Syntax void strncpy(char dest[], char src[], long len);

Function This function copies src to dest. len indicates the maximum length of src and dest. The
function ensures that there is a terminating '\0'. Thus, a maximum of len-1 characters are
copied.

Parameters dest

Destination buffer

src

Source string

len

Maximum number of characters in src and dest

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
variables {
char s1[7] = "Vector";
char s2 [32];
}
on key 'z'
{ Output to the Write-Window:
strncpy (s2,s1,elcount(s2));
write ("Result: %s",s2); Result: Vector
}

| strlen | strncat | strncmp | strncpy_off |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strncpy_off

strncpy_off
CAPL Function Overview » General » strncpy_off

Syntax void strncpy_off(char dest[], long destOffset, char src[], long max);

Function This function copies src to dest. max indicates the maximum length of src and dest.

The function ensures that there is a terminating '\0'. Thus, a maximum of max-1-
destOffset characters are copied. Characters are overwritten in dest starting at
destOffset.

Parameters dest

Destination buffer

destOffset

Offset in destination buffer

src

Source string

max

Maximum number of characters in src and dest

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
char s[6] = "Hallo";
strncpy_off(s, 1, "e", elcount(s)); // s: He

| strlen | strncat | strncmp | strncpy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: str_replace

str_replace
CAPL Function Overview » General » str_replace

Syntax long str_replace(char s[], char searched[], char replacement[]) // form 1

long str_replace(char s[], long startoffset, char replacement[], long


length) // form 2

Function Form 1: Replaces all occurrences of a text in a string with another string.

Form 2: Replaces a part of a string with another string.

Parameters s

String to be modified.

searched

Text which shall be replaced.

startoffset

Offset at which to start replacing characters.

replacement

Text which replaces the original characters.

length

Maximum number of characters to replace.

Return values 1 if successful, 0 if the resulting string would be too long for the buffer s.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 — • •

Example
char buffer[70] = "Vector Informatik";
str_replace(buffer, "Informatik", "CANoe");
write(buffer);
str_replace(buffer, 7, "CANalyzer", 10);
write(buffer);

| str_match_regex | str_replace_regex | strstr_regex |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: str_replace_regex

str_replace_regex
CAPL Function Overview » General » str_replace_regex

Syntax long str_replace_regex(char s[], char pattern[], char replacement[])

Function Replaces all occurrences of pattern in a string with another string.

Parameters s

String to be modified.

pattern

Regular expression which determines the parts in s which shall be replaced. For the
regular expression, the same syntax is used as in the Perl programming language.

replacement

Replacement for the parts which match the pattern.

Return values 1 if successful, 0 if the resulting string would be too long for the buffer s.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 — • •

Example
char buffer[70] = "Vector Informatik";
str_replace_regex(buffer, "Inf[a-z]*", "CANoe");
write(buffer);

| str_match_regex | str_replace | strstr_regex |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strstr, strstr_off

strstr, strstr_off
CAPL Function Overview » General » strstr, strstr_off

Syntax long strstr(char s1[], char s2[]);

long strstr_off(char s1[], long offset, char s2[]);

Function Searches in s1 for s2.

Parameters s1

First string

offset

Offset in s1 at which the search shall be started

s2

Second string

Return values First position of s2 in s1, or -1 if s2 is not found in s1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
long pos;
char s1[18] = "Vector Informatik";
char s2[11] = "Informatik";
pos = strstr(s1, s2); // pos = 7

| strlen | strncat | strncpy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: strstr_regex, strstr_regex_off

strstr_regex, strstr_regex_off
CAPL Function Overview » General » strstr_regex, strstr_regex_off

Syntax long strstr_regex(char s[], char pattern[])

long strstr_regex_off(char s[], long offset, char pattern[])

Function Searches for a regular expression pattern in a string.

Parameters s

String to be searched.

offset

Offset in s at which the search shall be started.

pattern

Regular expression which is searched. For the regular expression, the same syntax is used
as in the Perl programming language.

Return values The position in s where the pattern was found, or -1 if it wasn’t found.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 — • •

Example
char buffer[70] = "Vector Informatik";
long res;
res = strstr_regex(buffer, "Inf[a-z]*"); // 7
res = strstr_regex_off(buffer, res + 1, "Inf[a-z]*"); // -1

| str_match_regex | str_replace | str_replace_regex |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: substr_cpy

substr_cpy
CAPL Function Overview » General » substr_cpy

Syntax void substr_cpy(char dest[], char src[], long srcStart, long len, long
max);

Function This function copies a substring of src to dest. max indicates the maximum length of src
and dest.

The function ensures that there is a terminating '\0'. Thus, a maximum of max-1-
destOffset characters are copied. Characters are overwritten in dest starting at
destOffset.

Parameters dest

Destination buffer

src

Source string

srcStart

Start index in src of substring

len

Length of the substring, or -1 to copy the string until the end

max

Maximum number of characters in src and dest

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
char s1[7];
char s2[18] = "Vector Informatik";
substr_cpy(s1, s2, 0, 6, elcount(s1)); // s1: Vector

| strstr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: substr_cpy_off

substr_cpy_off
CAPL Function Overview » General » substr_cpy_off

Syntax void substr_cpy_off(char dest[], long destOffset, char src[], long


srcStart, long len, long max)

Function This function copies a substring of src to dest. max indicates the maximum length of src
and dest.

The function ensures that there is a terminating ‘\0’. Thus, a maximum of max-1-
destOffset characters are copied.

Parameters dest

Destination buffer

destOffset

Offset in destination buffer

src

Source string

srcStart

Start index in src of substring

len

Length of the substring, or -1 to copy the string until the end

max

Maximum number of characters in src and dest

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example
char s1[9] = "New CAPL";
char s2[18] = "Vector Informatik";
substr_cpy_off(s2, 7, s1, 4, -1, elcount(s2)); // s2: Vector CAPL

| strstr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: swapWord, swapInt, swapDWord, swapLong

swapWord, swapInt, swapDWord, swapLong


CAPL Function Overview » General » swapWord, swapInt, swapDWord, swapLong

Syntax word swapWord(word x);

int swapInt(int x);

dword swapDWord(dword x);

long swapLong(long x);

Function Swaps bytes of parameters. CAPL arithmetics follows the "little-endian-format" (Intel).
The swap-functions serve for swapping bytes for the transition to and from the "big-
endian-format" (Motorola).

Parameters Value whose bits are to be swapped.

Return values Value with swapped bytes.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
bigEndian = swapInt(1234); // create constant 1234 for Motorola processors

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sysExec, sysExecCmd

sysExec, sysExecCmd
CAPL Function Overview » General » sysExec, sysExecCmd

Syntax long sysExec(char cmd[], char params[]);

long sysExec(char cmd[], char params[], char directory[]); // Form 2

long sysExecCmd(char cmd[], char params[]);

long sysExecCmd(char cmd[], char params[], char directory[]); // Form 2

Function Executes an external command. Does not wait until the command has completed its
execution.

sysExec must be given an executable; sysExecCmd calls cmd.exe /K with the first
parameter, which opens a command window where the command is executed as if it was
entered directly.

Parameters cmd

The command to be executed. Either the full absolute path or a path relative to the
current working directory must be given or the command must be in the system path.

params

Parameters to the command. A parameter which contains spaces must be enclosed in " ".

directory (Form 2)

Working directory for the command. Either an absolute path or a path relative to the
current working directory must be given.

Return values 1 if the command was successfully started, else 0.

Info

Note that no return value from the command itself is given because the call
does not wait for the command to finish.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 — • •

Example
char configDir[1024];
getAbsFilePath("", configDir, elcount(configDir));
sysExecCmd("dir", "/O:-D", configDir); // show files in configuration
directory, newest files first

| getAbsFilePath | TestWaitForSyscall |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sysExit

sysExit
CAPL Function Overview » General » sysExit

Syntax void sysExit();

Function Exits the system (CANoe) from within a CAPL program.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
sysExit();
...

| sysMinimize |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sysMinimize

sysMinimize
CAPL Function Overview » General » sysMinimize

Syntax void sysMinimize();

Function The application window of CANoe will be minimized or restored. The first call of the
function minimizes the window, afterwards the window will be restored to normal size
and minimized alternaltly.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • —

Example
...
sysMinimize();
...

| sysExit |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: timeDiff

timeDiff
CAPL Function Overview » General » timeDiff

Syntax long timeDiff(message m1, NOW);

long timeDiff(message m1, message m2);

Function Time difference between messages or between a message and the current time in ms
(msg2 - msg1 or now - msg1). Starting with CANalyzer 2.xx this difference can be
calculated directly (Units of 10 microseconds).

Parameters Variable of type message

Variable of type now

Return values Time difference in ms.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
diff = timeDiff(m100, now); // CANalyzer 1.x & 2.x
diff = this.time - m100.time; // CANalyzer 2.xx

| timeNow | timeNowFlaot |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: timeNow

timeNow
CAPL Function Overview » General » timeNow

Syntax dword timeNow();

Function Supplies the current simulation time.

The simulation time can be correlated with the hardware results of the interface cards
(e.g. CANcardXL).
The resolution of this time is dependent upon the hardware used (usually a millisecond or
better).

Depending on the hardware configuration, the simulation time

• will be the same as the message time calculated by the interface cards
(e.g., system with two CAN channels connected to one CANcardXL)

or

• the message times will have a higher accuracy


(e.g., system with one LIN channel connected to one LINda)

Parameters —

Return values Simulation time in 10 microseconds.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
float x;
x = timeNow()/100000.0; //current time in seconds
...

| timeDiff | timeNowFlaot |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: timeNowFloat

timeNowFloat
CAPL Function Overview » General » timeNowFloat

Syntax float timeNowFloat();

Function Supplies the current simulation time.

The simulation time can be correlated with the hardware results of the interface cards
(e.g. CANcardXL).
The resolution of this time is dependent upon the hardware used (usually a millisecond or
better).

Depending on the hardware configuration, the simulation time

• will be the same as the message time calculated by the interface cards
(e.g., system with two CAN channels connected to one CANcardXL)

or

• the message times will have a higher accuracy


(e.g., system with one LIN channel connected to one LINda)

Parameters —

Return values Simulation time in 10 microseconds.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
...
float x;
x = timeNowFloat()/100000.0; //current time in seconds
...

| timeDiff | timeNow |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: timeNowNS, timeNowInt64

timeNowNS, timeNowInt64
CAPL Function Overview » General » timeNowNS, timeNowInt64

Syntax float TimeNowNS();

int64 timeNowInt64();

Function Supplies the current simulation time.

The simulation time can be correlated with the hardware results of the interface cards
(e.g. CANcardXL).
The resolution of this time is dependent upon the hardware used (usually a millisecond or
better).

Depending on the hardware configuration, the simulation time

• will be the same as the message time calculated by the interface cards
(e.g., system with two CAN channels connected to one CANcardXL)

or

• the message times will have a higher accuracy


(e.g., system with one LIN channel connected to one LINda)

Parameters —

Return values Simulation time in nanoseconds.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example

| EnvVarTimeNS | MessageTimeNS | timeNowFloat |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: timeToElapse

timeToElapse
CAPL Function Overview » General » timeToElapse

Syntax long timeToElapse(timer t) (Form 1)

long timeToElapse(mstimer t) (Form 2)

Method t.timeToElapse();

Function Returns a value indicating how much more time will elapse before an on timer event
procedure is called.

For form 1, the time value is returned in seconds; for form 2, the time value is returned
in milliseconds.

If the timer is not active, -1 is returned. This is also the case in the on timer event
procedure itself.

Parameters timer or mstimer variable

Return values Time to go until the timer elapses and the event procedure is called.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 — • •

Example
timer t;
setTimer(t, 5);
write("Time to elapse: %d", timeToElapse(t)); // writes 5

| setTimer | cancelTimer | isTimerActive | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: toLower

toLower
CAPL Function Overview » General » toLower

Syntax char toLower(char c); // form 1

void toLower(char dest[], char source[], dword bufferSize); // form 2

Function Transforms a character or string to lower case. Only characters a-z and A-Z are
supported.

Parameters c

Character to be transformed.

source

String to be transformed.

dest

Destination buffer for the transformed string.

bufferSize

Size of the destination buffer.

Return values Lower case of the character (form 1).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example
char buffer[20];
toLower(buffer, "Vector", elcount(buffer)); // buffer contains "vector"

| toUpper |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: toUpper

toUpper
CAPL Function Overview » General » toUpper

Syntax char toUpper(char c); // form 1

void toUpper(char dest[], char source[], dword bufferSize); // form 2

Function Transforms a character or string to upper case. Only characters a-z and A-Z are
supported.

Parameters c

Character to be transformed.

source

String to be transformed.

dest

Destination buffer for the transformed string.

bufferSize

Size of the destination buffer.

Return values Upper case of the character (form 1).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example
char buffer[20];
toUpper(buffer, "Vector", elcount(buffer)); // buffer contains "VECTOR"

| toLower |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: traceSetEventColors

traceSetEventColors
CAPL Function Overview » General » traceSetEventColors

Syntax traceSetEventColors(message msg, long font, long bkgnd)

traceSetEventColors(errorFrame msg, long font, long bkgnd)

traceSetEventColors(pg msg, long font, long bkgnd)

traceSetEventColors(linmessage msg, long font, long bkgnd)

traceSetEventColors(mostRawMessage msg, long font, long bkgnd)

traceSetEventColors(mostMessage msg, long font, long bkgnd)

traceSetEventColors(mostAmsMessage msg, long font, long bkgnd)

traceSetEventColors(frFrame msg, long font, long bkgnd)

traceSetEventColors(frError msg, long font, long bkgnd)

Function Sets the text and background color for displaying the message in the Trace window. The
makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters msg

Variable type: message, errorFrame, pg, linMessage, mostRawMessage, mostMessage,


mostAmsMessage, frFrame, frError

font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • —

Example
on message *
{
traceSetEventColors(this, makeRGB(0x00, 0xFF, 0xFF), makeRGB(0x00, 0x00,
0x00));
output(this);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: traceSetEventColors

on message *
{
message * msg;
msg = this;
traceSetEventColors(msg, makeRGB(0x00, 0xFF, 0xFF), makeRGB(0x00, 0x00,
0x00));
output(msg);
}

| MOST Trace Highlighting |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: trigger

trigger
CAPL Function Overview » General » trigger

Syntax void trigger();

Function Activates/Deactivates logging triggering of all logging and trigger blocks.

Info

Please note in CANoe online help the Trigger Condition: CAPL

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
on message 100 {
write("logging start");
trigger(); // start logging
setTimer(logging,1000); // for 1000 ms
}
on timer logging
{
trigger(); // Stop logging
}

| triggerEx | stop |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: triggerEx

triggerEx
CAPL Function Overview » General » triggerEx

Syntax void triggerEx(char name[]);

Function Activates/Deactivates logging triggering of a special logging or trigger block.

If you enter no block name, triggering will be activated/deactivated for all blocks.

Info

Please note in CANoe online help the Trigger Condition: CAPL

Parameters name

Name of the logging or trigger block you want to activate/deactivate triggering.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 — • •

Example

| trigger | stop |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: valOfId

valOfId
CAPL Function Overview » General » valOfId

Syntax long valOfId(dword id);

long valOfId(message m);

Function Returns the value of a message identifier independent of its type.

Identifier as long value.

Parameters Variable of the type message or Id portion of a message.

Return values Identifier as long value.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
on message *
{
long x;
x = valOfId(this);
write("Received Identifier: %d",x);
output(this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: write

write
CAPL Function Overview » General » write

Syntax void write(char format[], ...);

Function Outputs a text message to the Write window. Write is based on the C function printf.

The compiler cannot check the format string. Illegal format entries will lead to undefined
results. Messages output with the write function will be displayed on separate lines.

Parameters Format string, variables or expressions

Legal format expressions:

"%ld","%d" decimal display

"%lx","%x" hexadecimal display

"%lX","%X" hexadecimal display (upper case)

"%lu","%u" unsigned display

"%lo","%o" octal display

"%s" display a string

"%g","%f" floating point display

e.g. %5.3f means, 5 digits in total (decimal point inclusive) and 3 digits
after the decimal point. 5 is the minimum of digits in this case.

"%c" display a character

"%%" display %-character

"%I64d" decimal display of a 64 bit value

"%I64x" hexadecimal display of a 64 bit value

"%I64X" hexadecimal display of a 64 bit value (upper case)

"%I64u" unsigned display of a 64 bit value

Info

The %n format is invalid and it must not be used!

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

2.5 — • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: write

Examples
float f=123.456;
on key 'h'
{
write("Hello World!");
write("f = %5.3f",f);
write("format is not supported for the given variable");
write("f = %7.3f",f);
write("f = %9.3f",f);
}

on key 'q'
{
qword q = 0x1234567890ABCDEFLL;
write("Decimal: %I64u", q);
write("Hexadecimal: %I64X", q);
}

on key 'd'
{
dword d = 0x1234;
write("Decimal: %u", d);
write("Hexadecimal: %X", d);
}

Forward of a 64 bit data byte message from CAN1 to CAN2. The message should be
forwarded as "qword":
variables
{
qword ringbuffer[100][14];
int a = 0;
}

on message CAN1.TestMessage
{
ringbuffer[a][1] = this.qword[0];
}

TestFunction ()
{
message OutputMessage sendMsg;
sendMsg.dlc=8;
sendMsg.qword(0) = ringbuffer[a][1];
sendMsg.CAN =2;
output(sendMsg);
//write("Output ringbuffer=%I64d",ringbuffer[a][1]);
//write("Output a from ringbuffer=%I64d",a);
}

| snprintf | writeToLog | writeToLogEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeClear

writeClear
CAPL Function Overview » General » writeClear

Syntax void writeClear(dword sink)

Function Clears the contents of the specified page in the Write window.
You can use the following constants for the target identifier or type of message:
// write sinks
DWORD WRITE_SYSTEM = 0;
DWORD WRITE_CAPL = 1;

In addition you can use one of the target identifiers returned by the function writeCreate.
The All page can’t be cleared.

Parameters sink

Target identifier for the page to be deleted.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — • •

Example

| write | writeCreate | writeDestroy | writeEx | writeLineEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeConfigure

writeConfigure
CAPL Function Overview » General » writeConfigure

Syntax void writeConfigure( dword sink, dword lines, dword logging, char
filename[]);

Function Configures the specified page in the Write window.

Parameters sink

Target identifier for the page to be configured.

lines

The number of lines of the page.

logging

Enables the logging feature if non-zero.

filename

Name of the logging file.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 — • •

Example

| write |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeCreate

writeCreate
CAPL Function Overview » General » writeCreate

Syntax dword writeCreate(char name[])

Function Generates a new page in the Write window with the specified name.

The page is automatically deleted the next time a measurement starts.

Parameters name

Name of the page to be generated.

Return values Sink identifier that is valid for output to the new page.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — • •

Example

| write | writeClear | writeDestroy | writeEx | writeLineEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeDbgLevel

writeDbgLevel
CAPL Function Overview » General » writeDbgLevel

Syntax long writeDbgLevel(unsigned int priority, char format1[], char format2[],


...);

Function Outputs a message to the write window with the specified priority. This function can be
used for debugging to vary the output to the write window. This function is especially
useful if nodelayer-DLL’s are used. In this case the debug output can be controlled using a
global priority parameter.

In the simulation tree the priority level can be set for every network node using the
setWriteDbgLevel function.

Parameters priority

Output priority from 0 to 15.

format

Format string, variables or expressions

legal format expressions:

"%ld", "%d" decimal display

"%lx", "%x" hexadecimal display

"%lX", "%X" hexadecimal display (upper case)

"%lu", "%u" unsigned display

"%lo", "%o" octal display

"%s" display a string

"%g", "%lf" floating point display

"%c" display a character

"%%" display %-character

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — — •

Example
int i = 10;
int j = 12;
setWriteDbgLevel(7);
writeDbgLevel (4, "This is shown: h= %lxh",j);
// Output: This is shown: h= 0ch
writeDbgLevel (9, "This is not shown: d= %ld",i);
// No output

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeDbgLevel

| setWriteDbgLevel | write | writeDbgLevel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeDestroy

writeDestroy
CAPL Function Overview » General » writeDestroy

Syntax void writeDestroy(dword sink)

Function Removes the specified page from the Write window. Only pages that have been created
with the aid of the writeCreate function can be removed.

Parameters sink

Target identifier for the page to be removed.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — • •

Example

| write | writeClear |writeCreate | writeEx | writeLineEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeEx

writeEx
CAPL Function Overview » General » writeEx

Syntax void writeEx(dword sink, dword severity, char format[], ...)

Function Writes the text into the last line of the specified window, into a tab of the Write window
or into a logging file without previously creating a new line.

Parameters sink

Sink identifier of the page to which the output will take place.

Values:

-3 Trace window

-2 Output to the logging file (only in ASC format and if the CAPL node is inserted in
the measurement setup in front of the logging block)

-1 Reserved

0 Output to the System tab of the Write window

1 Output to the CAPL tab of the Write window

4 Output to the Test tab of the Write window

severity

Constant for the type of message.

Values:

0 Success

1 Information

2 Warning

3 Error

The parameter severity has no meaning for output to the Trace window.

format

Formatting character sequence.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeEx

Example

| write | writeClear | writeCreate | writeDestroy | writeLineEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeLineEX

writeLineEX
CAPL Function Overview » General » writeLineEX

Syntax void writeLineEx(dword sink, dword severity, char format[], ...)

Function Writes the text into a new line of the specified window, into a tab of the Write window or
into a logging file.

Parameters sink

The target identifier of the page to which the output will take place.

Values:

-3 Trace window

-2 Output to the logging file (only in ASC format and if the CAPL node is inserted in
the measurement setup in front of the logging block)

-1 Reserved

0 Output to the System tab of the Write window

1 Output to the CAPL tab of the Write window

4 Output to the Test tab of the Write window

severity

Constant for the type of message.

Values:

0 Success

1 Information

2 Warning

3 Error

The parameter severity has no meaning for output to the Trace window.

For output to a logging file, this parameter specifies whether comments should be output
(severity == 0).
If this is not desired, set severity = 1.

format

Formatting character sequence.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeLineEX

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — • •

Example

| write | writeClear | writeCreate | writeDestroy | writeEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeProfileInt

writeProfileInt
CAPL Function Overview » General » writeProfileInt

Note

Before this function can be called the write path must be set by the function
setWritePath. Otherwise the configuration directory will be used. A relative file name
must be passed to the function.

Syntax long writeProfileInt(char section[], char entry[], long value, char


filename[]);

Function Opens the file filename, searches the section section and writes the variable entry with
the value value. If entry already exists the old value is overwritten.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

value

Value as a integer.

filename

File path as a string.

Return values The functional result is 0 in case of an error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeProfileFloat

writeProfileFloat
CAPL Function Overview » General » writeProfileFloat

Note

Before this function can be called the write path must be set by the function
setWritePath. Otherwise the configuration directory will be used. A relative file name
must be passed to the function.

Syntax long writeProfileFloat(char section[], char entry[], float value, char


filename[])

Function Opens the file filename, searches the section section and writes the variable entry with
the value value. If entry already exists the old value is overwritten.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

value

Value as a float.

filename

File path as a string.

Return values The functional result is 0 in case of an error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeProfileString

writeProfileString
CAPL Function Overview » General » writeProfileString

Note

Before this function can be called the write path must be set by the function
setWritePath. Otherwise the configuration directory will be used. A relative file name
must be passed to the function.

Syntax long writeProfileString(char section[], char entry[], char value[], char


filename[]);

Function Opens the file filename, searches the section section and writes the variable entry with
the value value. If entry already exists the old value is overwritten. The functional result
is the number of characters written or 0 in case of an error.

Parameters section

Section of the file as a string.

entry

Variable name as a string.

value

Value as a string.

filename

File path as a string.

Return values 0: Write error

> 1: Write access. Number of characters will not be returned.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeTextBkgColor

writeTextBkgColor
CAPL Function Overview » General » writeTextBkgColor

Syntax void writeTextBkgColor(dword sink,dword red, dword green, dword blue)

Function Sets the color for text background of the specified page in the Write window.

You can use the following constants for the target identifier:
// write sinks
DWORD WRITE_SYSTEM = 0;
DWORD WRITE_CAPL = 1;

In addition you can use one of the target identifiers returned by the function
writeCreate.

The color settings have also an effect on the All tab of the Write window.

Parameters sink

The target identifier of the page on which the color settings should have an effect.

red

Specifies the intensity of the red color.

green

Specifies the intensity of the green color.

blue

Specifies the intensity of the blue color.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example
WriteTextColor(0,255,0,0);
WriteLineEx(0,1,"This is red text");

WriteTextBkgColor(0,0,255,0);
WriteLineEx(0,1,"This is red text with green background");

WriteTextColor(0,0,0,0);
WriteTextBkgColor(0,255,255,255);
WriteLineEx(0,1,"This is black text with white background");

| write | writeCreate | writeClear | writeDestroy | writeEx | writeLineEx | writeTextColor |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeTextColor

writeTextColor
CAPL Function Overview » General » writeTextColor

Syntax void writeTextColor(dword sink,dword red, dword green, dword blue)

Function Sets the color for text of the specified page in the Write window.

You can use the following constants for the target identifier:
// write sinks
DWORD WRITE_SYSTEM = 0;
DWORD WRITE_CAPL = 1;

In addition you can use one of the target identifiers returned by the function writeCreate.

The color settings have also an effect on the All tab of the Write window.

Parameters sink

The target identifier of the page on which the color settings should have an effect.

red

Specifies the intensity of the red color.

green

Specifies the intensity of the green color.

blue

Specifies the intensity of the blue color.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — • •

Example
WriteTextColor(0,255,0,0);
WriteLineEx(0,1,"This is red text");

WriteTextBkgColor(0,0,255,0);
WriteLineEx(0,1,"This is red text with green background");

WriteTextColor(0,0,0,0);
WriteTextBkgColor(0,255,255,255);
WriteLineEx(0,1,"This is black text with white background");

| write | writeCreate | writeClear | writeDestroy | writeEx | writeLineEx | writeTextBkgColor |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeToLog

writeToLog
CAPL Function Overview » General » writeToLog

Syntax void writeToLog(char format[], ...);

Function Writes an output string to an ASCII logging file. Write is based on the C function printf.

The compiler cannot check the format string. Illegal format entries will lead to undefined
results. Different to the writeToLogEx function, comment characters ("//") and a
timestamp at the beginning of each line will be printed.

Parameters Format string, variables or expressions

Legal format expressions:

"%ld","%d" decimal display

"%lx","%x" hexadecimal display

"%lX","%X" hexadecimal display (upper case)

"%lu","%u" unsigned display

"%lo","%o" octal display

"%s" display a string

"%g","%lf" floating point display

"%c" display a character

"%%" display %-character

"%I64d" decimal display of a 64 bit value

"%I64x" hexadecimal display of a 64 bit value

"%I64X" hexadecimal display of a 64 bit value (upper case)

"%I64u" unsigned display of a 64 bit value

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
void MarkLogFile(int marker) {
// marks line of ASCII logging file with an integer
writeToLog("===> %d",marker);
}

| snprintf | write | writeToLogEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeToLogEx

writeToLogEx
CAPL Function Overview » General » writeToLogEx

Syntax void writeToLogEx(char format[], ...);

Function Writes an output string to an ASCII logging file. Write is based on the C function printf.

The compiler cannot check the format string. Illegal format entries will lead to undefined
results. Different to the writeToLog function, neither comment characters ("//") nor
timestamps will be printed at the beginning of a line.

Parameters Format string, variables or expressions

Legal format expressions:

"%ld","%d" decimal display

"%lx","%x" hexadecimal display

"%lX","%X" hexadecimal display (upper case)

"%lu","%u" unsigned display

"%lo","%o" octal display

"%s" display a string

"%g","%lf" floating point display

"%c" display a character

"%%" display %-character

"%I64d" decimal display of a 64 bit value

"%I64x" hexadecimal display of a 64 bit value

"%I64X" hexadecimal display of a 64 bit value (upper case)

"%I64u" unsigned display of a 64 bit value

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

All — • •

Example
// write marker with current date and time to logging file
void MarkLogFileWithTimeString(void)
{
char timeBuffer[64];
getLocalTimeString(timeBuffer);
writeToLogEx("===> %s",timeBuffer);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: writeToLogEx

| snprintf | write | writeToLog |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xlAcquireLED

xlAcquireLED
CAPL Function Overview » General » xlAcquireLED

Syntax dword xlAcquireLED(dword ledBitMask);

Function Acquires the specified LEDs of a hardware device in order to set their operation mode
with xlSetLED afterwards.

This function is supported by the following device: VN8900 (driver version > 7.5)

Note that for every successful call of xlAcquireLED on a specific LED, you have to call
xlReleaseLED to release this LED again.

Parameters ledBitMask

The LEDs you want to release.


The following LEDs are available. Note that you can bitwise combine the values to specify
multiple LEDs.

LED Numeric value

Module (M) 0x001

CAN Channel 1 0x008

CAN Channel 2 0x010

CAN Channel 3 0x020

CAN Channel 4 0x040

FlexRay Channel 1 A 0x080

FlexRay Channel 1 B 0x100

Keypad S1 0x200

Keypad S2 0x400

Return values 0: no error, function succeeded.

!= 0: error, function failed. Check whether your device supports this function and you
have an appropriate driver installed on the device.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP6 — — •

Example

At measurement start three LEDs are acquired, two LEDs are set to condition "orange
glowing", and one is set to the condition "orange flashing". At measurement stop the LEDs
should be released.
/*@@var:*/
variables
{
// constants for LED access

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xlAcquireLED

const dword kLedMaskC1 = 0x008;


const dword kLedMaskC2 = 0x010;
const dword kLedMaskC3 = 0x020;
// constants for LED operation modes
const dword kLedOrangeOn = 0x00000020;
const dword kLedOrangeBlinking = 0x00000040;

dword status;
}
/*@@end*/

/*@@startStart:Start:*/
on start
{
status = xlAcquireLED(kLedMaskC1 | kLedMaskC2 | kLedMaskC3);
if( 0 == status)
{
xlSetLed(kLedMaskC1 | kLedMaskC2, kLedOrangeOn);
xlSetLed(kLedMaskC3, kLedOrangeBlinking);
}
}
/*@@end*/

/*@@stop:StopMeasurement:*/
on stopMeasurement
{
if( 0 == status)
{
xlReleaseLED(kLedMaskC1 | kLedMaskC2 | kLedMaskC3);
}
}
/*@@end*/

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xlReleaseLED

xlReleaseLED
CAPL Function Overview » General » xlReleaseLED

Syntax dword xlReleaseLED(dword ledBitMask);

Function Releases the specified LEDs after they were successfully acquired with a call of
xlAcquireLED.

This function is supported by the following device: VN8900 (driver version > 7.5)

Parameters ledBitMask

The LEDs you want to acquire.


Following LEDs can be acquired. Note that you can bitwise combine the values to specify
multiple LEDs

LED Numeric value

Module (M) 0x001

CAN Channel 1 0x008

CAN Channel 2 0x010

CAN Channel 3 0x020

CAN Channel 4 0x040

FlexRay Channel 1 A 0x080

FlexRay Channel 1 B 0x100

Keypad S1 0x200

Keypad S2 0x400

Return values 0: no error, function succeeded.

!= 0: error, function failed. Check whether your device supports this function and you
have an appropriate driver installed on the device.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP6 — — •

Example

See xlAcquireLED

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xlSetLED

xlSetLED
CAPL Function Overview » General » xlSetLED

Syntax dword xlSetLED(dword ledBitMask, dword ledMode);

Function Sets the LEDs specified by ledBitMask to the operation mode specified by ledMode. A
successful call of xlAcquireLED is necessary before the operation mode of an LED can be
set with this function.

This function is supported by the following device: VN8900 (driver version > 7.5)

Note that for every successful call of xlAcquireLED on a specific LED, you have to call
xlReleaseLED to release this LED again.

Parameters ledBitMask

The LEDs you want to set. You can bitwise combine the values to specify multiple LEDs.

The following LEDs are available:

LED Numeric value

Module (M) 0x001

CAN Channel 1 0x008

CAN Channel 2 0x010

CAN Channel 3 0x020

CAN Channel 4 0x040

FlexRay Channel 1 A 0x080

FlexRay Channel 1 B 0x100

Keypad S1 0x200

Keypad S2 0x400

ledMode

The operation mode which shall be valid for the specified LEDs. The operation modes are
mutually exclusive and only one LED can be in one operation mode.

The following operation modes are available:

Operation mode Numeric value

No Change 0x00000000

LED Off 0x00000001

LED On Red 0x00000002

LED Blinking Red 0x00000004

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xlSetLED

LED On Green 0x00000008

LED Blinking Green 0x00000010

LED On Orange 0x00000020

LED Blinking Orange 0x00000040

Info

For the LEDs S1 and S2 only the No Change, LED Off and LED On Green
operation modes are valid.

Return values 0: no error, function succeeded.

!= 0: error, function failed. Check whether your device supports this function and you
have an appropriate driver installed on the device.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP6 — — •

Example

See xlAcquireLED

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Associative Fields CAPL Functions

Associative Fields CAPL Functions


CAPL Function Overview » Associative Fields CAPL Functions

Methods Short Description

clear Removes all elements from the field.

containsKey Returns the information if a key is available in the field.

remove Removes one element from the field.

size Returns the number of elements in the field.

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: clear

clear
CAPL Function Overview » Associative Fields » clear

Method m.clear();

Function Removes all elements from the field.

Parameters —

Return values —

Complexity O(log(N) + N)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 — • •

Example
m.clear();

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: containsKey

containsKey
CAPL Function Overview » Associative Fields » containsKey

Method m.containsKey(key)

Function Returns the information if a key is available in the field.

Parameters key

Key that should be checked.

Return values 1 if the key was available - otherwise 0

Complexity O(log(N))

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 — • •

Example
if (m.containsKey(3)) { // …

| Classes and objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: remove

remove
CAPL Function Overview » Associative Fields » remove

Method m.remove(key)

Function Removes one element from the field.

Parameters key

Key of the element.

Return values 1 if the key was available - otherwise 0

Complexity O(log(N))

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 — • •

Example

Text
m.remove(3);

| Classes and objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: size

size
CAPL Function Overview » Associative Fields » size

Method m.size()

Function Returns the number of elements in the field.

Parameters —

Return values Number of elements in the field.

Complexity O(1)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 — • •

Example
if (m.size() == 0) write("Map is empty!");

| Classes and objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232 CAPL Functions

RS232 CAPL Functions


CAPL Function Overview » RS232 CAPL Functions

Info

Former releases (before 7.1) offered an 'old' API that has been extended. The support of the 'old'
API is continued but the functions are marked as obsolete.

RS232 API Short description

RS232Close Closes a serial port.

RS232Open Opens serial port.

RS232Configure Configures serial port (everything besides handshake).

RS232SetHandshake Configures handshake parameters.

RS232Send Sends block of data asynchronously on serial port.

RS232Receive Sets receiver buffer for serial port.

RS232SetSignalLine Sets signal line on serial port.

RS232 API Callback Short description


Handlers

RS232OnSend Handler will be called after completion of request issued with RS232Send.

RS232OnReceive Handler will be called regularly if data has been received at port. Starts with
RS232Receive.

RS232OnError Handler will be called if an error has occurred.

General Usage

First, open a port, then transmit and receive data, then close it.

Example
byte data[2];
int length = 2;
data[0] = 1;
data[1] = 2;
if ( 1==RS232Open(1) ) write(“Port 1 has been opened.”);
if ( 1==RS232Send(1,data,length) ) write(“Send bytes to port 1.”);
if ( 1==RS232Close(1) ) write(“Port 1 has been closed.”);

| Deprecated INI File |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232 CAPL Functions: Deprecated INI File

RS232 CAPL Functions: Deprecated INI File


CAPL Function Overview» RS232 » Deprecated INI File

INI files called v24.ini or rs232.ini can be used to configure ports. Though, it is not advised to do so. It
is much clearer to set parameters directly by use of RS232Configure. The configuration files have to be
inserted into the CANoeExec32 directory.

Section Description

[COMsettings] General section the key-value pairs of which apply to all ports used.

Info

Values of specific sections overwrite the values of the general


section for a specific port.

[COMsettings_COM1] Specific section the key-value pairs of which apply to one port specified (COM1).

...

[COMsettings_COM255] Specific section the key-value pairs of which apply to one port specified
(COM255).

[Queue-Sizes] General section to give (serial port) driver queue sizes which will be used as
recommendation by the driver. Applies to all ports.

Info

Values of specific sections overwrite the values of the general


section for a specific port.

[Queue-Sizes_COM1] Specific section to give (serial port) driver queue sizes which will be used as
recommendation by the driver. Applies to one port (COM1).

...

[Queue-Sizes_COM255] Specific section to give (serial port) driver queue sizes which will be used as
recommendation by the driver. Applies to one port (COM255).

Section Key Values


[COMsettings] COMport List of identifiers for serial ports which will be opened
at first call which opens a port (RS232Open and
RS232SetCommState). The list is separated by
semicolons (e.g. COMport=1;2;3).
[COMsettings_COMx] UseCOMspecificSettings Either 0 or 1.
with x a number
between 1 and 255 If 1, then the section is enabled.

If 0, then the values of the specific section are not


used.

[COMsettings] Baud The symbol rate to use for reception and transmission.
as well as
[COMsettings_COMx]
with x a number

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232 CAPL Functions: Deprecated INI File

between 1 and 255


Info

Typically, 9600 is used. There is a list of


possible values which depends on the serial
port. Normally, 115.200 is the allowed
maximum.

[COMsettings] ByteSize The number of data bits within a transmission frame.


as well as
[COMsettings_COMx] Info
with x a number
between 1 and 255 8 is used at most. Only values between 5
and 8 are possible. Not all values and not
all combinations with other frame
parameters may be supported by the serial
port.

[COMsettings] StopBits A code which sets the number of stop bits within a
as well as transmission frame.
[COMsettings_COMx]
with x a number 0 1 stop bit is used;
between 1 and 255 it is the typical and most reasonable value
1 1.5 stop bits are used
2 2 stop bits are used
[COMsettings] Parity A code which identifies the parity mode to use.
as well as
[COMsettings_COMx] 0 no parity used, i.e. frame contains no parity bit
with x a number
between 1 and 255 1 odd parity
2 even parity
[Queue-Sizes] QueueSize_Rx The size of the receiver buffer of the driver. The size is
as well as given in bytes. The range of numbers and the
[Queue-Sizes _COMx] constraints (e.g. dividable by 8) are dependent on the
with x a number driver. The number will be used as recommendation by
between 1 and 255 the driver.

Info

If you specify a small number which is


really used by the driver, then frequent
buffer overruns may happen and the
connection may not be stable.

[Queue-Sizes] QueueSize_Tx The size of the transmission buffer of the driver. The
as well as size is given in bytes. The range of numbers and the
[Queue-Sizes _COMx] constraints (e.g. dividable by 8) are dependent on the
with x a number driver. The number will be used as recommendation by
between 1 and 255 the driver.

Info

If you specify a small number which is


really used by the driver, then frequent
buffer overruns may happen and the
connection may not be stable.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232 CAPL Functions: Deprecated INI File

Example
; THIS FILE IS DEPRECATED
; it is better to program the serial interface by means of CAPL
; standard section, settings used for ALL ports
; can be overwritten by a prot specific section
; settings can be controlled directly by CAPL functions

[COMsettings]
; "COMport" opens "shared" ports the results of which will be given
; to all listening nodes (nodes implementing a callback)
; e.g. "COMport=2;3 ;5" means to open COM2, COM3 and COM5 as shared port
; note: the former limitation that only ports listed for "COMport" could be used
; within CAPL has been removed
COMport=1

; "Baud" sets baud rate


; note that only specific settings are possible
; the exact settings depend on the serial driver
; typical maximum is 115200
Baud=9600
; "ByteSize" means "number of data bits" within one transmission frame
; typically 5..8 are allowed
; 8 is most reasonable for best performance
ByteSize=8
; "StopBits" means "number of stop bits" within one transmission frame
; possible values:
; 0 : 1 StopBits (!!!)
; 1 : 1.5 StopBits
; 2 : 2 StopBits
; example: "StopBits=0" means to use one stop bit
; 0 is most reasonable for best performance
StopBits=0
; "Parity" determines parity bit in frame
; possible values:
; 0: No parity
; 1: Even parity
; 2: Odd parity
; 0 is most reasonable for best performance
Parity=0
; specific section for COM1 port
; (can only be used if port is available)
; uses the same key-value-pairs as general section
; i.e. "Baud", "ByteSize", "StopBits", "Parity"

[COMsettings_COM1]
; "UseCOMspecificSettings" needs to be set to really enable usage of
; specific section
; possible values: 0 or 1
UseCOMspecificSettings=1
; following values overwrite the values out of the general section for COM1
; if and only if "UseCOMspecificSettings=1" holds true
Baud=115200
ByteSize=8
StopBits=0
Parity=0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Close

RS232Close
CAPL Function Overview » RS232 » RS232Close

Syntax dword RS232Close( dword port )

Function Closes a serial port.

The serial port will be closed for all nodes. One and the same port may be closed by
several nodes (or repetitively). After closure other programs may use the serial port.

After closing the serial port the configuration of the port is lost. The next time the port is
opened it will be configured with the system default.

Parameters port

A number between 1 and 255 identifying a serial port.

Return values 0: error

The error occurs if the serial port with the given number does not exist on the system.

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
if ( 1==RS232Close(1) ) write(“It works with port 1.”);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Configure

RS232Configure
CAPL Function Overview » RS232 » RS232Configure

Syntax dword RS232Configure( dword port, dword baudrate, dword numberOfDataBits,


dword numberOfStopBits, dword parity )

Function Configures a serial port.

Without setting up a configuration explicitly, the default configuration is used.

Default baud rate: 9600, 8 data bits, 1 stop bit, no parity.

If a deprecated INI file exists, then the data of the INI file will be used.

Parameters port

A number between 1 and 255 identifying a serial port.

baudrate

The symbol rate to use for reception and transmission.

Typically, 9600 is used. There is a list of possible values which depends on the serial port.
Normally, 115.200 is the allowed maximum.

numberOfDataBits

The number of data bits within a transmission frame.

8 is used at most. Only values between 5 and 8 are possible. Not all values and not all
combinations with other frame parameters may be supported by the serial port.

numberOfStopBits

A code which sets the number of stop bits within a transmission frame.

1 1 stop bit is used

( 1 has changed meaning compared to obsolete variant RS232SetCommState )

2 2 stop bits are used

Info

1.5 stop bits are not supported any more.

parity

A code which identifies the parity mode to use.

0 no parity used, i.e. frame contains no parity bit

1 odd parity

2 even parity

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Configure

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
if ( 0!=RS232Configure(1,9600,8,1,0) )
write(“Set typical default at port 1.”);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232OnError

RS232OnError
CAPL Function Overview » RS232 » RS232OnError

Syntax RS232OnError( dword port, dword errorFlags )

Function Callback handler for reception of errors at a serial port.

Info

Will be called only at the node which issued send/receive operations.

For repetitive errors (stable error condition) just the first one is returned.
That case may happen for reception errors above all, i.e. at configuration
mismatches of both connected ends.

It is possible that in case of configuration mismatches errors may not occur at


once, e.g. a configuration of 9600/8/1/no parity at one port and
115200/8/1/no parity at the other end may seem to work (though rubbish is
received).

Parameters port

A number between 1 and 255 identifying a serial port.

errorFlags

Cumulative summary of what went wrong. Bits are set to flag conditions.

Bit Error

0 Send operation failed.

1 Receive operation failed.

2 Frame error. May be caused by parity mismatch or any other frame mismatch
(e.g. number of stop bits).

3 Frame parity error. Is caused by parity mismatch.

4 Buffer overrun. It is not specified if the driver of the sender cannot send fast
enough, if it is up to the receiver which got too much data in too short time or
anything else.

5 Buffer overrun at receiver.

6 Break state. Other end requested to pause.

7 Timeout. May be caused by wrongly set too short timeout. See RS232SetHandshake
for setting the timeout.

Info

Several error bits may be set at the same time. Some error flags are up to the
driver manufacturer what they mean and when they are issued.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232OnError

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
RS232OnError(dword port, dword errorFlags)
{
if ( errorFlags & 1 )
writeLineEx(0,3,“send failed”);
if ( errorFlags & 2 )
writeLineEx(0,3,“receive failed”);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232OnReceive

RS232OnReceive
CAPL Function Overview » RS232 » RS232OnReceive

Syntax RS232OnReceive( dword port, byte buffer[], dword number )

Function Callback handler for reception of data at a serial port.

Info

Will be called only at the nodes which issued a RS232Receive operation for
the given port.

The handler will only be called for success. For errors RS232OnError will be
called.

The buffer may be much larger than number. For very slow connections, the
handler may get called for few bytes. At least one byte is given.

It is possible to listen to one and the same port at several nodes. All nodes
will be called with the same data.

Parameters port

A number between 1 and 255 identifying a serial port.

buffer

The buffer given to the start receive call.

number

The number of bytes which have been received.

Info

The number of received bytes will vary strongly with the speed of the
connection.

Return values 0: error

The error occurs if no start receive operation has been.

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
// at sender node
char text[20] = “Hello World !”;
byte block[20];
int i;
int length;
length=strlen(text)+1;
for (i=0;i<length;i++) block[i]=text[i];

if ( 0!=RS232Send(1,block,length) )
write(“Written block of bytes to port 1.”);
...
// at receiver node (here 2)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232OnReceive

byte mybuffer[100];
int mysize = 100;
RS232Receive(2,mybuffer,mysize);
...
// at node which issued the receive request
RS232OnReceive(dword port, byte buffer[], dword number)
{
// port==2 here
// buffer==mybuffer, number<=mysize
// buffer contains some parts of block
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232OnSend

RS232OnSend
CAPL Function Overview » RS232 » RS232OnSend

Syntax RS232OnSend( dword port, byte buffer[], dword number )

Function Callback handler for completion of send operation to a serial port.

Info

Will be called only at the node which issued the send operation.

The handler will only be called for success. For errors RS232OnError will be
called.

Parameters port

A number between 1 and 255 identifying a serial port.

buffer

The buffer given to the send call.

number

The number of bytes which have been sent.

Return values 0: error

The error occurs if no send operation will be used.

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
char text[20] = “Hello World !”;
byte block[20];
int i;
int length;
length=strlen(text)+1;
for (i=0;i<length;i++) block[i]=text[i];

if ( 0!=RS232Send(1,block,length) )
write(“Written block of bytes to port 1.”);
...
// at node which issued the send request
RS232OnSend(dword port, byte buffer[], dword number)
{
// send completed now, it may time to issue the next send
// buffer==block, number==length
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Open

RS232Open
CAPL Function Overview » RS232 » RS232Open

Syntax dword RS232Open( dword port )

Function Opens a serial port.

Info

The serial port is available on exactly the node which executed the CAPL
code. One and the same port may be opened by several nodes. If the port has
been opened, other programs cannot access the serial port any more.

Parameters port

A number between 1 and 255 identifying a serial port.

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• another program uses the serial port according to the port number

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
if ( 1==RS232Open(1) ) write(“It works with port 1.”);

| RS232 CAPL Functions: Deprecated INI File |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Receive

RS232Receive
CAPL Function Overview » RS232 » RS232Receive

Syntax dword RS232Receive( dword port, byte buffer[], dword size )

Function Receive blocks of bytes from a serial port.

• The operation works continuous if issued once.


• If any data has been received, the node will be notified by the callback handler
RS232OnReceive.
• If another receive operation will be given, the result buffer will change to that one
given by the last receive operation.
• To get informed about errors occurring in later stages of the operation use
RS232OnError. Retrials to receive will be started continuously but you won’t be
notified if an error happens again.

Parameters port

A number between 1 and 255 identifying a serial port.

buffer

An array of bytes.

size

Maximum number of bytes which can be received.

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

An error is only given if a problem is issued directly by the system.

To get informed about errors occurring in later stages of the operation use RS232OnError.

1: success

Success means here, that the receive operation could be started properly.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
byte mybuffer[20];
int mysize=20;
if ( 1==RS232Receive(1,mybuffer,mysize) )
write(“It works with port 1.”);
...
RS232OnReceive( dword port, dword buffer[], dword number )
{
// works after first RS232Receive !
// buffer == mybuffer, 1<number<=mysize

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Receive

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232Send

RS232Send
CAPL Function Overview » RS232 » RS232Send

Syntax dword RS232Send( dword port, byte buffer[], dword number )

Function Sends a block of bytes to a serial port.

• The operation starts the sending of a block.


• The callback handler RS232OnSend will notify the node of completion.
• To get informed about errors occurring in later stages of the operation use
RS232OnError. There are no automatic retrials in case of error.

Parameters port

A number between 1 and 255 identifying a serial port.

buffer

An array of bytes of which number will be sent.

number

Number of bytes to send.

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened
• another non-blocking send operation (this one, RS232WriteByte or RS232WriteBlock
made by non-blocking CAN.INI switch) has been used shortly before, then the
previous send operation may not have finished which leads to an error. Use the
RS232OnSend callback handler to synchronize operations.

An error is only given if a problem is issued directly.

To get informed about errors occurring in later stages of the operation use RS232OnError.

1: success

The operation may fail in later stages. Success means here, that the send operation could
be started properly.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
char text[20] = “Hello World !”;
byte buffer[20];
int i;
int length;
length=strlen(text)+1;
for (i=0;i<length;i++) buffer[i]=text[i];
if ( 1==RS232Send(1,buffer,length) )
write(“It works with port 1.”);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232SetHandshake

RS232SetHandshake
CAPL Function Overview » RS232 » RS232SetHandshake

Note

deprecated is variant with timeout as parameter

Syntax Obsolete
dword RS232SetHandshake( dword port, dword handshake, dword XonLimit, dword
XoffLimit, dword XonChar, dword XoffChar, dword timeout )

dword RS232SetHandshake( dword port, dword handshake, dword XonLimit, dword


XoffLimit, dword XonChar, dword XoffChar )

Function Sets handshake parameters on serial port.

Info

If you use hardware handshake, then the functions which change signal lines
directly (RS232SetSignalLine, RS232EscapeCommFunc, RS232EscapeCommExt)
may conflict with the automatic handshaking.

Parameters port

A number between 1 and 255 identifying a serial port.

handshake

Sets variant of handshake to use.

Allowed values (internal bit field leads to strange values):

0 no handshake at all

10 hardware handshake, use DTR<->DSR

33 hardware handshake, use RTS<->CTS

65 hardware handshake, use RTS<->CTS, use “toggle” variant

128 software handshake, use Xon and Xoff characters

DTR: Data-Terminal-Ready (from sender).

RTS: Request-To-Send (from sender).

DSR: Data-Set-Ready (from receiver).

CTS: Clear-To-Send (from receiver).

Info

Mixtures of hardware and software handshake are not supported.

For sake of compatibility, it is possible to set signal lines to fixed levels with
this function. Please prefer for that purpose RS232SetSignalLine.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232SetHandshake

XonLimit

Parameter for software flow control. It specifies a limit after which flow control shall
become active (send XonChar). It relates to the receiver buffer (of the driver) and defines
the buffer level in bytes for starting transfer requests.

XoffLimit

Parameter for software flow control. It specifies a limit after which flow control shall
become active (send XoffChar). It relates to the receiver buffer (of the driver) and
defines the level margin from the buffer size for starting hold requests.

Info

It may lead to errors if XonLimit and XoffLimit are not set properly.

Xon is issued if current level < XonLimit.

Xoff is issued if current level > (buffer size-XoffLimit).

Both ranges may overlap so that Xon and Xoff would be signalled at the same
time.

Another problem may arise if XoffLimit > buffer size.

XonChar

Parameter for software flow control. It the symbol sent to signalize start of operations
(for reception as well as transmission).

XoffChar

Parameter for software flow control. It the symbol sent to signalize start of operations
(for reception as well as transmission).

Info

Neither XonChar nor XoffChar should ever be found in the received data (if
software flow control is used). The symbols will be removed by the lower
layers.

Xon and Xoff are sent at transitions, not steadily.

timeout

Timeout in milliseconds to be used for all send and receive operations.

-1 infinite

< 10 is not allowed

If this parameter isn't set, the timeout default value will be used: 5 sec.

Info

It should not be used at all since it may lead to errors. E.g. it is possible to
set up a slow connection and transmit much data (some kilobytes) as a block.
Then, the send block operation will time out.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232SetHandshake

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
if ( 0!=RS232SetHandshake(1,0,0,0,0,0) )
write(“No handshake at port 1.”);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RS232SetSignalLine

RS232SetSignalLine
CAPL Function Overview » RS232 » RS232SetSignalLine

Syntax dword RS232SetSignalLine( dword port, dword line, dword state )

Function Sets signal lines on serial port.

Info

If you use hardware handshake, then this function may conflict with the
automatic handshaking.

Parameters port

A number between 1 and 255 identifying a serial port.

line

Specifies signal line of which the state shall be set.

0 RTS

1 DTR

Data-Terminal-Ready (from sender).

RTS: Request-To-Send (from sender).

state

0 disabled

1 enabled

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

1: success

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Signal Access CAPL Functions

Signal Access CAPL Functions


CAPL Function Overview » Signal Access CAPL Functions

Functions Short description

getSignal Gets the value of a signal.

getSignalTime Gets the time point relative to the measurement start at which the
signal was last sent on the bus.

RegisterSignalDriver Registers the given callback as a 'signal driver' for the signal.

SetSignal Sets the transmitted signal to the accompanying value.

checkSignalInRange Checks the value of a signal, a system variable or an environment


variable against a condition.
testValidateSignalInRange

testValidateSignalOutsideRange

CheckSignalMatch Checks a given value against the value of the signal, the system variable
or the environment variable.
TestValidateSignalMatch

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Struct Byte Access CAPL Functions

Struct Byte Access CAPL Functions


CAPL Function Overview » Struct Byte Access CAPL Functions

Functions Short description

memcmp Compares the bytes of the parameters.

memcpy Copies bytes from a source to a destination.

memcpy_h2n Copies the bytes from the struct into the array.

memcpy_n2h Fills the struct with bytes from the array.

memcpy_off Copies bytes from a source to destination, giving a destination start offset.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcmp

memcmp
CAPL Function Overview » Struct Byte Access » memcmp

Syntax int memcmp(struct s, byte buffer[]) // form 1

int memcmp(byte buffer[], struct s) // form 2

int memcmp(struct s, struct t) // form 3

Function Compares the bytes of the parameters. In form 3, both structs must have the same type.

Parameters s

A struct

buffer

A byte-array

Another struct

Return values 0 if the bytes are equal; a value different from 0 if they are unequal

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — • •

Example
byte data[4];
struct WrapDword
{
dword dw;
} dwordWrapper;
int i;
for (i = 0; i < elcount(data); ++i)
data[i] = i;
dwordWrapper.dw = 0x03020100;
if (memcmp(dwordWrapper, data) == 0)
write("Data represents the number: Little Endian is used.");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy

memcpy
CAPL Function Overview » Struct Byte Access » memcpy

Syntax void memcpy(byte dest[], struct source) // form 1

void memcpy(byte dest[], int offset, struct source) // form 2

void memcpy(struct dest, byte source[]) // form 3

void memcpy(struct dest, byte source[], int offset) // form 4

void memcpy(struct dest, struct source); // form 5

void memcpy(struct dest, char source[]); // form 6

void memcpy(struct dest, char source[], dword offset); // form 7

void memcpy( byte dest[], byte source[], dword length); // form 8

void memcpy( char dest[], byte source[], dword length); // form 9

void memcpy( byte dest[], char source[], dword length); // form 10

void memcpy( char dest[], char source[], dword length); // form 11

Function Copies bytes from a source to a destination. In form 5, both structs must have the same
type. In other forms with structs, the arrays must be large enough to contain the struct
data.

Parameters source

(form 1, 2, 5): Struct whose bytes shall be copied.


(other forms): Array whose bytes shall be copied.

dest

(form 3, 4, 5, 6, 7): Struct into which the bytes shall be copied.


(other forms): Array into which the bytes shall be copied.

offset

(form 2, 4, 7): Offset in the array which marks the start of the data.

length

(form 8, 9, 10, 11): number of bytes which shall be copied.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — • •

7.2: form 7-11 — • •

Example
byte data[4];
struct WrapDword

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy

{
dword dw;
} dwordWrapper;

int i;
for (i = 0; i < elcount(data); ++i)
data[i] = i;
memcpy(dwordWrapper, data);
write("Bytes as dword: %0#10lx", dwordWrapper.dw);
dwordWrapper.dw = 0x12345678;
memcpy(data, dwordWrapper);
write("Dword as bytes: %#lx %#lx %#lx %#lx", data[0], data[1], data[2],
data[3]);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy_h2n

memcpy_h2n
CAPL Function Overview » Struct Byte Access » memcpy_h2n

Syntax void memcpy_h2n(byte dest[], struct source) // form 1

void memcpy_h2n(byte dest[], int offset, struct source) // form 2

Function Copies the bytes from the struct into the array, and translates the byte order of the
elements from little-endian to big-endian (h2n stands for "host to network").

Parameters source

Struct whose bytes shall be copied

dest

Array into which the bytes shall be copied

offset (form 2)

Offset into the array

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — • •

Example
byte data[4];
struct WrapDword
{
dword dw;
} dwordWrapper;

int i;
for (i = 0; i < elcount(data); ++i)
data[i] = i;
memcpy_n2h(dwordWrapper, data);
write("Bytes as dword: %0#10lx", dwordWrapper.dw);
dwordWrapper.dw = 0x12345678;
memcpy_h2n(data, dwordWrapper);
write("Dword as bytes: %#lx %#lx %#lx %#lx", data[0], data[1], data[2],
data[3]);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy_n2h

memcpy_n2h
CAPL Function Overview » Struct Byte Access » memcpy_n2h

Syntax void memcpy_n2h(struct dest, byte source[]) // form 1

void memcpy_n2h(struct dest, byte source[], int offset) // form 2

Function Fills the struct with bytes from the array, and translates the byte order of the elements
from big-endian to little-endian (n2h stands for "network to host").

Parameters source

Array whose bytes shall be copied

dest

Struct into which the bytes shall be copied

offset (form 2)

Offset in the array where the data begins

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — • •

Example

See example memcpy_h2n

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy_off

memcpy_off
CAPL Function Overview » Struct Byte Access » memcpy_off

Syntax void memcpy_off( struct type dest, dword destOffset, byte source[], dword
sourceOffset, dword length); // form 1

void memcpy_off( struct type dest, dword destOffset, char source[], dword
sourceOffset, dword length); // form 2

void memcpy_off( byte dest[], dword destOffset, struct type source, dword
sourceOffset, dword length); // form 3

void memcpy_off( char dest[], dword destOffset, struct type source, dword
sourceOffset, dword length); // form 4

void memcpy_off( byte dest[], dword destOffset, byte source[], dword


sourceOffset, dword length); // form 5

void memcpy_off( char dest[], dword destOffset, byte source[], dword


sourceOffset, dword length); // form 6

void memcpy_off( byte dest[], dword destOffset, char source[], dword


sourceOffset, dword length); // form 7

void memcpy_off( char dest[], dword destOffset, char source[], dword


sourceOffset, dword length); // form 8

Function Copies bytes from a source to destination, giving a destination start offset. The size of the
destination must be at least destOffset + length.

Parameters dest

(form 1, 2): Struct into which the bytes shall be copied.


(other forms): Array into which the bytes shall be copied.

source

(form 3, 4): Struct from which the bytes shall be copied.


(other forms): Array from which the bytes shall be copied.

destOffset

Start offset in the destination struct or array.

sourceOffset

Start offset int the source struct or array.

length

Number of bytes which shall be copied.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: memcpy_off

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: System Variables CAPL Functions

System Variables CAPL Functions


CAPL Function Overview » System Variables CAPL Functions

Functions Short description

SysDefineNamespace Defines a name space.

SysUndefineNamespace Deletes a name space.

SysUndefineVariable Deletes a variable.

Functions to define variables

SysDefineVariableData Defines a variable of the data type.

SysDefineVariableFloat Defines a variable of the float type.

SysDefineVariableFloatArray Defines a variable of the float[] type.

SysDefineVariableInt Defines a variable of the int type.

SysDefineVariableIntArray Defines a variable of the int[] type.

SysDefineVariableString Defines a variable of the String (char[]) type.

Functions to return the value of a variable

SysGetOrigTimeNS Returns the original time stamp of the last update to the variable value.

sysGetVariableArrayLength Returns the length of an array system variable.

SysGetVariableData Returns the value of a variable of the data type.

SysGetVariableFloat Returns the value of a variable of the float type.

SysGetVariableFloatArray Returns the value of a variable of the float[] type.

SysGetVariableInt Returns the value of a variable of the int type.

SysGetVariableLongArray Returns the value of a variable of the int[] type.

SysGetVariableString Returns the value of a variable of the String (char[]) type.

SysGetVariableMax Retrieves the maximum of a variable.

SysGetVariableMin Retrieves the minimum of a variable

SysGetVariableTimeNS Returns the time stamp of the last update to the variable value.

Functions to set the value of the variable

sysSetAnalysisOnlyVariable Defines whether the variable shall be used only in the analysis part of
CANoe.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: System Variables CAPL Functions

SysSetVariableData Sets the value of a variable of the data type.

SysSetVariableFloat Sets the value of a variable of the float type.

SysSetVariableFloatArray Sets the value of a variable of the float[] type.

SysSetVariableInt Sets the value of a variable of the int type.

SysSetVariableLongArray Sets the value of a variable of the int[] type.

SysSetVariableString Sets the value of a variable of the String (char[]) type.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineNamespace

SysDefineNamespace
CAPL Function Overview » System Variables » SysDefineNamespace

Syntax long SysDefineNamespace(char namespace[])

Function Defines a name space

Parameters namespace

Name of the name space

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableData

SysDefineVariableData
CAPL Function Overview » System Variables » SysDefineVariableData

Syntax long sysDefineVariableData(char namespace[], char variable[], byte


initialData[], long initialSize)

Function Defines a variable of data type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialData

Initial value of the variable

initialSize

Initial size (in bytes) of the variable. Must not exceed the length of the initialData array.

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableFloat

SysDefineVariableFloat
CAPL Function Overview » System Variables » SysDefineVariableFloat

Info

Variables defined with this function can only be accessed using the
sysGetVariable.../sysSetVariable... functions where namespace and variable name
are given as string parameters.

Syntax long SysDefineVariableFloat(char namespace[], char variable[], double


initialValue)

long SysDefineVariableFloat(char namespace[], char variable[], double


initialValue, double minimum, double maximum)

Function Defines a variable of the float type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialValue

Initial value of the variable

minimum

The minimum value of the variable

maximum

The maximum value of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

5: given minimum is larger than the given maximum

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

7.2: form 2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableFloat

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableFloatArray

SysDefineVariableFloatArray
CAPL Function Overview » System Variables » SysDefineVariableFloatArray

Info

Variables defined with this function can only be accessed using the
sysGetVariable.../sysSetVariable... functions where namespace and variable name
are given as string parameters.

Syntax long SysDefineVariableFloatArray(char namespace[], char vari-able[], float


initialValues[], long arraySize)

long SysDefineVariableFloatArray(char namespace[], char variable[], double


initialValues[], long arraySize, double minimum, double maximum)

Function Defines a variable of the float[] type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialValue

Initial value of the variable

arraySize

Number of values in the array

minimum

The minimum value of the variable

maximum

The maximum value of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

5: given minimum is larger than the given maximu

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableFloatArray

7.2: form 2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableInt

SysDefineVariableInt
CAPL Function Overview » System Variables » SysDefineVariableInt

Info

Variables defined with this function can only be accessed using the
sysGetVariable.../sysSetVariable... functions where namespace and variable name
are given as string parameters.

Syntax long SysDefineVariableInt(char namespace[], char variable[], long


initialValue)

long SysDefineVariableInt(char namespace[], char variable[], long


initialValue, long minimum, long maximum)

Function Defines a variable of the int type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialValue

Initial value of the variable

minimum

The minimum value of the variable

maximum

The maximum value of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

5: given minimum is larger than the given maximum

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5,2 — — •

7.2: form 2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableInt

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableIntArray

SysDefineVariableIntArray
CAPL Function Overview » System Variables » SysDefineVariableIntArray

Info

Variables defined with this function can only be accessed using the
sysGetVariable.../sysSetVariable... functions where namespace and variable name
are given as string parameters.

Syntax long SysDefineVariableIntArray(char namespace[], char variable[], int


initialValues[], long arraySize)

long SysDefineVariableIntArray(char namespace[], char variable[], int


initialValues[], long arraySize, long minimum, long maximum)

Function Defines a variable of the int[] type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialValue

Initial value of the variable

arraySize

Number of values in the array

minimum

The minimum value of the variable

maximum

The maximum value of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

5: given minimum is larger than the given maximu

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableIntArray

7.2: form 2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysDefineVariableString

SysDefineVariableString
CAPL Function Overview » System Variables » SysDefineVariableString

Info

Variables defined with this function can only be accessed using the
sysGetVariable.../sysSetVariable... functions where namespace and variable name
are given as string parameters.

Syntax long SysDefineVariableString(char namespace[], char variable[], char


initialValue[])

Function Defines a variable of the String (char[]) type.

Parameters namespace

Name of the name space

variable

Name of the variable

initialValue

Initial value of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetOrigTimeNS

SysGetOrigTimeNS
CAPL Function Overview » System Variables » SysGetOrigTimeNS

Syntax int64 SysGetOrigTimeNS(SysVarName)

Function Returns the original time stamp of the last update to the variable value, before time
synchronization may have changed it.

Parameters SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::".

Return values Original time stamp of the last update to the variable value in nanoseconds since
measurement start.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example
int64 timeStamp;
timeStamp = SysGetOrigTimeNS(sysvar::MyNamespace::FloatVar);

| SysGetVariableTimeNS |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: sysGetVariableArrayLength

sysGetVariableArrayLength
CAPL Function Overview » System Variables » sysGetVariableArrayLength

Syntax dword SysGetVariableArrayLength(char namespace[], char variable[]) // form


1

dword SysGetVariableArrayLength(SysVarName) // form 2

Function Returns the length of the array of the system variable.

Info

An access to the whole array is with this variant not possible.

Parameters namespace

Name of the name space (form 1).

variable

Name of the variable (form 1).

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".

The name must be preceded by "sysVar::". (form 2)

Return values For system variables of type data, returns the current size (in bytes) of the value.

For system variables of type long or float array, returns the number of elements in the
array.

For system variables of type string, returns the length of the string, excluding the
terminating 0 character.

For system variables of type long or float, returns 1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 — • form 2 • form 1

Example
// calculate the norm of a vector
dword length, i;
double element, sum, norm;
sum = 0.0;
length = SysGetVariableArrayLength(sysvar::MyVariables::MyVector);
for (i = 0; i < length; ++i)
{
element = @sysvar::MyVariables::MyVector[i];
sum += element * element;
}
norm = sqrt(sum);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableData

SysGetVariableData
CAPL Function Overview » System Variables » SysGetVariableData

Syntax long SysGetVariableData(char namespace[], char variable[], byte buffer[],


long& copiedBytes) // form 1

long SysGetVariableData(SysVarName, byte buffer[], long& copiedBytes) //


form 2

Function Returns the value of a variable of the data type.

Parameters namespace

Name of the name space

variable

Name of the variable

buffer

Buffer which takes the value of the variable

copiedBytes

Receives the number of bytes which were copied into the buffer. If the buffer is too
small, no bytes will be copied; else the parameter will contain the current size of the
variable.

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::".

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

5: the buffer is too small for the value

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6: form 1 — — •

7.6: form 2 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableFloat

SysGetVariableFloat
CAPL Function Overview » System Variables » SysGetVariableFloat

Syntax double SysGetVariableFloat(char namespace[], char variable[]) // form 1

double SysGetVariableFloat(SysVarName) // form 2

Function Returns the value of a variable of the float type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values Value of the variable or 0 in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

7.0: form 2 — • •

Example
SysGetVariableFloat(sysvar::MyNamespace::FloatVar);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableFloatArray

SysGetVariableFloatArray
CAPL Function Overview » System Variables » SysGetVariableFloatArray

Syntax long SysGetVariableFloatArray(char namespace[], char variable[], float


values[], long arraySize) // form 1

long SysGetVariableFloatArray(SysVarName, float values[], long arraySize)


// form 2

Function Returns the value of a variable of the float[] type.

If the actual array size of the system variable is larger than the array size given as
parameter, all elements in the values array up to the array size given as parameter will
receive the current values of the system variable. Elements in the values array beyond
the array size given as parameter will remain unchanged.

If the actual array size of the system variable is smaller than the array size given as
parameter, additional elements in the values array will be set to 0. Elements in the
values array beyond the array size given as parameter will remain unchanged.

Never give as parameter an array size which is larger than real size of the values array,
this would lead to unpredictable behavior.

Info

An access to the whole array is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

Gets the values of the variable (both forms)

arraySize

Size of the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableFloatArray

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

7.0: form 2 — • •

Example
float fVarArr[10]; // array size should match the size of the system
variable
...
SysGetVariableFloatArray(sysvar::MyNamespace::FloatArrayVar, fVarArr,
elcount(fVarArr));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableInt

SysGetVariableInt
CAPL Function Overview » System Variables » SysGetVariableInt

Syntax long SysGetVariableInt(char namespace[], char variable[]) // form 1

long SysGetVariableInt(SysVarName) // form 2

Function Returns the value of a variable of the int type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values Value of the variable or 0 in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

7.0: form 2 — • •

Example
SysGetVariableInt(sysvar::MyNamespace::IntVar);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableLongArray

SysGetVariableLongArray
CAPL Function Overview » System Variables » SysGetVariableLongArray

Syntax long SysGetVariableLongArray(char namespace[], char variable[], long


values[], long arraySize) // form 1

long SysGetVariableLongArray(SysVarName, long values[], long arraySize) //


form 2

Function Returns the value of a variable of the int[] type.

If the actual array size of the system variable is larger than the array size given as
parameter, all elements in the values array up to the array size given as parameter will
receive the current values of the system variable. Elements in the values array beyond
the array size given as parameter will remain unchanged.

If the actual array size of the system variable is smaller than the array size given as
parameter, additional elements in the values array will be set to 0. Elements in the
values array beyond the array size given as parameter will remain unchanged.

Never give as parameter an array size which is larger than real size of the values array,
this would lead to unpredictable behavior.

Info

An access to the whole array is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

Values of the variable (both forms)

arraySize

Number of values in the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableLongArray

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — — •

Example
long lVarArr[10]; // array size should match the size of the system
variable
...
SysGetVariableLongArray(sysvar::MyNamespace::LongArrayVar, lVarArr,
elcount(lVarArr));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableMax

SysGetVariableMax
CAPL Function Overview » System Variables » SysGetVariableMax

Syntax long sysGetVariableMax(SysVarName, long& maximum) // form 1

long sysGetVariableMax(SysVarName, double& maximum) // form 2

long sysGetVariableMax(char namespace[], char variable[], long& maximum) //


form 3

long sysGetVariableMax(char namespace[], char variable[], double& maximum)


// form 4

Function Retrieves the maximum of a variable.

Parameters SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sysVar::". (form 1 and 2)

namespace

Name of the namespace (form 3 and 4)

variable

Name of the variable (form 3 and 4)

maximum

Receives the maximum of the variable if no errors occur (reference parameter). Must be
the correct type for the system variable.

Return values 0: success

4: variable is of the wrong type or has no maximum defined

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableMin

SysGetVariableMin
CAPL Function Overview » System Variables » SysGetVariableMin

Syntax long sysGetVariableMin(SysVarName, long& minimum) // form 1

long sysGetVariableMin(SysVarName, double& minimum) // form 2

long sysGetVariableMin(char namespace[], char variable[], long& minimum) //


form 3

long sysGetVariableMin(char namespace[], char variable[], double& minimum)


// form 4

Function Retrieves the minimum of a variable of type Integer or Integer Array.

Parameters SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sysVar::". (form 1 and 2)

namespace

Name of the namespace (form 3 and 4)

variable

Name of the variable (form 3 and 4)

minimum

Receives the minimum of the variable if no errors occur (reference parameter). Must be
the correct type for the system variable.

Return values 0: success

4: variable is of the wrong type or has no minimum defined

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableString

SysGetVariableString
CAPL Function Overview » System Variables » SysGetVariableString

Syntax long SysGetVariableString(char namespace[], char variable[], char buffer[],


long bufferSize) // form 1

long SysGetVariableString(SysVarName,char buffer[], long bufferSize) //


form 2

Function Returns the value of a variable of the String (char[]) type.

Info

An access to the whole string is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

buffer

Buffer that takes the value of the variable (form 1)

bufferSize

Size of the buffer

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

7.0: form 2 — • •

Example
SysGetVariableString(sysvar::MyNamespace::StringVar, buf, elcount(buf));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysGetVariableTimeNS

SysGetVariableTimeNS
CAPL Function Overview » System Variables » SysGetVariableTimeNS

Syntax int64 SysGetVariableTimeNS(SysVarName)

Function Returns the time stamp of the last update to the variable value.

Parameters SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sysVar::".

Return values Time stamp of the last update to the variable value, in nanoseconds since measurement
start.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — • •

Example
int64 timeStamp;
timeStamp = SysGetVariableTimeNS(sysvar::MyNamespace::FloatVar);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetAnalysisOnlyVariable

SysSetAnalysisOnlyVariable
CAPL Function Overview » System Variables » SysSetAnalysisOnlyVariable

Syntax void SysSetAnalysisOnlyVariable(SysVarName, long anlyzLocal)

Function Determines whether the variable is meant to be used for analysis purposes.

If this is true (anlyzLocal is set to 1), and the variable is changed in a CAPL program in the
Measurement setup, the value change is not transmitted to the real time part of CANoe,
but used immediately in the analysis part. This is the default.

If it is false (anlyzLocal is set to 0), value changes are always transmitted to the real time
part.

Parameters anlyzLocal

Defines whether the variable shall be used only in the analysis part of CANoe.

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • —

Example
SysSetAnalysisOnlyVariable(sysvar::MyNamespace::StringVar, 1);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableData

SysSetVariableData
CAPL Function Overview » System Variables » SysSetVariableData

Syntax long SysSetVariableData(char namespace[], char variable[], byte data[],


long size) // form 1

long SysSetVariableData(SysVarName, byte data[], long size) // form 2

Function Sets the value of a variable of the data type.

Parameters namespace

Name of the name space

variable

Name of the variable

data

New values for the variable

size

New size for the variable. Must not exceed the length of the data array.

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::".

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6: form 1 — — •

7.6: form 2 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableFloat

SysSetVariableFloat
CAPL Function Overview » System Variables » SysSetVariableFloat

Syntax long SysSetVariableFloat(char namespace[], char variable[], float value) //


form 1

long SysSetVariableFloat(SysVarName, float value) // form 2

Function Sets the value of a variable of the float type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

value

New value of the variable (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

7.0: form 2 — • •

Example
float fVar;
...
SysSetVariableFloat(sysvar::MyNamespace::FloatVar, fVar);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableFloatArray

SysSetVariableFloatArray
CAPL Function Overview » System Variables » SysSetVariableFloatArray

Syntax long SysSetVariableFloatArray(char namespace[], char variable[], float


values[], long arraySize) // form 1

long SysSetVariableFloatArray(SysVarName,float values[], long arraySize) //


form 2

Function Sets the value of a variable of the float[] type.

The call will only succeed if the array size given as parameter is equal to the actual array
size of the system variable (you cannot change that size dynamically). The current values
of the system variable will then be set to the elements in the values array in the range
from 0 to arraySize.

Never give as parameter an array size which is larger than real size of the values array,
this would lead to unpredictable behavior.

Info

An access to the whole array is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

New values of the variable (both forms)

arraySize

Number of values in the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableFloatArray

7.0: form 2 — • •

Example
float fVarArr[10];
...
SysSetVariableFloatArray(sysvar::MyNamespace::FloatArrayVar, fVarArr,
elcount(fVarArr));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableInt

SysSetVariableInt
CAPL Function Overview » System Variables » SysSetVariableInt

Syntax long SysSetVariableInt(char namespace[], char variable[], long value) //


form 1

long SysSetVariableInt(SysVarName, long value) // form 2

Function Sets the value of a variable of the int type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

value

New value of the variable (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

7.0: form 2 — • •

Example
long lVar;
...
SysSetVariableInt(sysvar::MyNamespace::IntVar, lVar);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableLongArray

SysSetVariableLongArray
CAPL Function Overview » System Variables » SysSetVariableLongArray

Syntax long SysSetVariableLongArray(char namespace[], char variable[], long


values[], long arraySize) // form 1

long SysSetVariableLongArray(SysVarName, long values[], long arraySize) //


form 2

Function Sets the value of a variable of the int[] type.

The call will only succeed if the array size given as parameter is equal to the actual array
size of the system variable (you cannot change that size dynamically). The current values
of the system variable will then be set to the elements in the values array in the range
from 0 to arraySize.

Never give as parameter an array size which is larger than real size of the values array,
this would lead to unpredictable behavior.

Info

An access to the whole array is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

Values of the variable (both forms)

arraySize

Number of values in the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3: form 1 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableLongArray

7.0 SP3: form 2 — • •

Example
long lVarArr[10];
...
SysSetVariableLongArray(sysvar::MyNamespace::LongArrayVar, lVarArr,
elcount(lVarArr));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysSetVariableString

SysSetVariableString
CAPL Function Overview » System Variables » SysSetVariableString

Syntax long SysSetVariableString(char namespace[], char variable[], char value[])


// form 1

long SysSetVariableString(SysVarName, char value[]) // form 2

Function Sets the value of a variable of the String (char[]) type.

Info

An access to the whole string is with this variant not possible.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

value

New value of the variable (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2: form 1 — — •

7.0: form 2 — • •

Example
SysSetVariableString(sysvar::MyNamespace::StringVar, "Vector");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysUndefineNamespace

SysUndefineNamespace
CAPL Function Overview » System Variables » SysUndefineNamespace

Syntax long SysUndefineNamespace(char namespace[])

Function Deletes a name space. Also all variables in this name space are automatically deleted.

Parameters namespace

Name of the name space

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SysUndefineVariable

SysUndefineVariable
CAPL Function Overview » System Variables » SysUndefineVariable

Syntax long SysUndefineVariable(char namespace[], char variable[])

Function Deletes a variable.

Parameters namespace

Name of the name space

variable

Name of the variable

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1/5.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TCP/IP API

TCP/IP API
CAPL Function Overview » TCP/IP API

The CAPL Socket API provides access to TCP/IP networking features. It is implemented on top of the
native Winsock 2 API of the Windows operating system. The API falls into the following three categories:

IP API

The IP API consists of general functions for network information retrieval such as the querying for installed
network interface cards (NIC), IP addresses, address conversion functions, error handling and so on. In
addition, the IP API has some special functions for socket manipulations such as setting socket options or
binding.

IP API functions Short description

IpBind Associates an address and a port with a specified socket.

IpGetAdapterAddress Retrieves the addresses associated with a network


interface.

IpGetAdapterAddressAsString Retrieves the string representation of the first address


associated with a specified network interface.

IpGetAdapterCount Returns the number of network interfaces for the local


computer.

IpGetAdapterDescription Retrieves the description of a specified network interface.

IpGetAdapterGateway Retrieves the default gateway address associated with a


specified network interface.

IpGetAdapterGatewayAsString Retrieves the string representation of the default


gateway address associated with a specified network
interface.

IpGetAdapterMask Retrieves the address masks associated with a specified


network interface.

IpGetAdapterMaskAsString Retrieves the string representation of the first address


mask associated with a specified network interface.

IpGetAddressAsNumber Converts an address string in dot notation to it's numerical


value in network-byte order.

IpGetAddressAsString Converts a numeric address in network-byte order to a


address string in dot notation.

IpGetLastError Returns the Winsock 2 error code of the last operation


that failed.

IpGetLastSocketError Returns the Winsock 2 error code of the last operation


that failed on a specified socket.

IpGetLastSocketErrorAsString Retrieves the error message of the last operation that


failed on a specified socket.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TCP/IP API

IpSetSocketOption Modifies a socket option.

UDP API

The UDP API is used for UDP communications. It provides a high level interface for implementing
connectionless, datagram-oriented communications.

UDP API functions Short description

UdpClose Closes the UDP socket.

UdpOpen Creates an UDP socket for use in connectionless,


datagramm-oriented communications.

UdpReceiveFrom Receives data into a specified buffer.

UdpSendTo Sends data to a specified location.

The UDP API supports the following CAPL


callbacks:

OnUdpReceiveFrom It is dispatched when an asynchronous receive operation


on an UDP socket completes.

OnUdpSendTo It is dispatched when an asynchronous send operation on


an UDP socket completes.

TCP API

The TCP API is used for TCP connections. It provides a high level interface for implementing connection-
based, message-oriented communications.

TCP API functions Short description

TcpAccept Accepts an incoming connection request on a specified


socket resulting in a new socket.

TcpClose Closes the TCP socket.

TcpConnect Establishes a connection with a specified location.

TCPGetRemoteAddress Retrieves the remote address of the specified socket.

TCPGetRemoteAddressAsString Retrieves the remote address of the specified socket in


Internet standard dotted-decimal format.
TcpListen Causes the socket to listen for incoming connection
requests.

TcpOpen Creates a TCP socket for use in connection-based,


message-oriented communications.

TcpReceive Receives data into a specified buffer.

TcpSend Sends data on a specified socket.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TCP/IP API

TcpShutdown Disables send operations on a specified socket.

The TCP API supports the following CAPL


callbacks:

OnTcpClose It is dispatched when a TCP socket receives a close


notification.

OnTcpConnect It is dispatched when an asynchronous connection


operation completes.

OnTcpListen It is dispatched when a connection request for a specified


socket is received.

OnTcpReceive It is dispatched when an asynchronous receive operation


on a TCP socket completes.

OnTcpSend It is dispatched when an asynchronous send operation on a


TCP socket completes.

| Winsock 2 Error Codes | Technical Details | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

Winsock 2 Error Codes


CAPL Function Overview » TCP/IP API » Winsock 2 Error Codes

For your convenience, the Winsock 2 Error Codes are re-printed from the MSDN Online-Library:

Return Code / Value Description

WSAEINTR Interrupted function call.

10004 A blocking operation was interrupted by a call to WSACancelBlockingCall.

WSAEACCES Permission denied.

10013 An attempt was made to access a socket in a way forbidden by its access
permissions. An example is using a broadcast address for sendto without
broadcast permission being set using setsockopt(SO_BROADCAST).

Another possible reason for the WSAEAC-CES error is that when the bind
function is called (on Windows NT 4 SP4 or later), an-other application,
service, or kernel mode driver is bound to the same address with exclusive
access. Such exclusive access is a new feature of Windows NT 4 SP4 and
later, and is implemented by using the SO_EXCLUSIVEADDRUSE option..

WSAEFAULT Bad address.

10014 The system detected an invalid pointer address in attempting to use a


pointer argument of a call. This error occurs if an application passes an
invalid pointer value, or if the length of the buffer is too small. For
instance, if the length of an argument, which is a sockaddr structure, is
smaller than the sizeof(sockaddr).

WSAEINVAL Invalid argument.

10022 Some invalid argument was supplied (for ex-ample, specifying an invalid
level to the setsockopt function). In some instances, it also refers to the
current state of the socket—for in-stance, calling accept on a socket that is
not listening.

WSAEMFILE Too many open files.

10024 Too many open sockets. Each implementation may have a maximum
number of socket handles available, either globally, per process, or per
thread.

WSAEWOULDBLOCK Resource temporarily unavailable.

10035 This error is returned from operations on non-blocking sockets that cannot
be completed immediately, for example recv when no data is queued to be
read from the socket. It is a nonfatal error, and the operation should be
retried later. It is normal for WSAEWOULDBLOCK to be reported as the
result from calling connect on a non-blocking SOCK_STREAM socket, since
some time must elapse for the connection to be established.

WSAEINPROGRESS Operation now in progress.

10036 A blocking operation is currently executing. Windows Sockets only allows a


single blocking operation—per- task or thread—to be outstanding, and if any
other function call is made (whether or not it references that or any other
socket) the function fails with the WSAEINPROGRESS error.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

WSAEALREADY Operation already in progress.

10037 An operation was attempted on a non-blocking socket with an operation


already in progress—that is, calling connect a second time on a non-
blocking socket that is already connecting, or canceling an asynchronous
request (WSAAsyncGetXbyY) that has already been canceled or completed.

WSAENOTSOCK Socket operation on nonsocket.

10038 An operation was attempted on something that is not a socket. Either the
socket handle parameter did not reference a valid socket, or for select, a
member of an fd_set was not valid.

WSAEDESTADDRREQ Destination address required.

10039 A required address was omitted from an operation on a socket. For


example, this error is returned if sendto is called with the remote address
of ADDR_ANY.

WSAEMSGSIZE Message too long.

10040 A message sent on a datagram socket was larger than the internal message
buffer or some other network limit, or the buffer used to receive a
datagram was smaller than the datagram itself.

WSAEPROTOTYPE Protocol wrong type for socket.

10041 A protocol was specified in the socket function call that does not support
the semantics of the socket type requested. For example, the ARPA
Internet UDP protocol cannot be specified with a socket type of
SOCK_STREAM.

WSAENOPROTOOPT Bad protocol option.

10042 An unknown, invalid or unsupported option or level was specified in a


getsockopt or setsockopt call.

WSAEPROTONOSUPPORT Protocol not supported.

10043 The requested protocol has not been configured into the system, or no
implementation for it exists. For example, a socket call requests a
SOCK_DGRAM socket, but specifies a stream protocol.

WSAESOCKTNOSUPPORT Socket type not supported.

10044 The support for the specified socket type does not exist in this address
family. For example, the optional type SOCK_RAW might be selected in a
socket call, and the implementation does not support SOCK_RAW sockets at
all.

WSAEOPNOTSUPP Operation not supported.

10045 The attempted operation is not supported for the type of object
referenced. Usually this occurs when a socket descriptor to a socket that
cannot support this operation is trying to accept a connection on a
datagram socket.

WSAEPFNOSUPPORT Protocol family not supported.

10046 The protocol family has not been configured into the system or no
implementation for it exists. This message has a slightly different meaning
from WSAEAFNOSUP-PORT. However, it is interchangeable in most cases,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

and all Windows Sockets functions that return one of these messages also
specify WSAEAFNOSUPPORT.

WSAEAFNOSUPPORT Address family not supported by protocol family.

10047 An address incompatible with the requested protocol was used. All sockets
are created with an associated address family (that is, AF_INET for Internet
Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is
returned if an incorrect protocol is explicitly re-quested in the socket call,
or if an address of the wrong family is used for a socket, for ex-ample, in
sendto.

WSAEADDRINUSE Address already in use.

10048 Typically, only one usage of each socket ad-dress (protocol/IP


address/port) is permitted. This error occurs if an application attempts to
bind a socket to an IP address/port that has al-ready been used for an
existing socket, or a socket that was not closed properly, or one that is still
in the process of closing. For server applications that need to bind multiple
sockets to the same port number, consider using setsockopt
(SO_REUSEADDR). Client applications usually need not call bind at all—
connect chooses an unused port automatically. When bind is called with a
wildcard address (involving ADDR_ANY), a WSAEADDRI-NUSE error could be
delayed until the specific address is committed. This could happen with a
call to another function later, including connect, listen, WSAConnect, or
WSAJoinLeaf.

WSAEADDRNOTAVAIL Cannot assign requested address.

10049 The requested address is not valid in its context. This normally results from
an attempt to bind to an address that is not valid for the local computer.
This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or
WSASendTo when the remote address or port is not valid for a remote
computer (for example, address or port 0).

WSAENETDOWN Network is down.

10050 A socket operation encountered a dead net-work. This could indicate a


serious failure of the network system (that is, the protocol stack that the
Windows Sockets DLL runs over), the network interface, or the local
network itself.

WSAENETUNREACH Network is unreachable.

10051 A socket operation was attempted to an un-reachable network. This usually


means the local software knows no route to reach the remote host.

WSAENETRESET Network dropped connection on reset.

10052 The connection has been broken due to keep-alive activity detecting a
failure while the operation was in progress. It can also be returned by
setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that
has al-ready failed.

WSAECONNABORTED Software caused connection abort.

10053 An established connection was aborted by the software in your host


computer, possibly due to a data transmission time-out or protocol error.

WSAECONNRESET Connection reset by peer.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

10054 An existing connection was forcibly closed by the remote host. This
normally results if the peer application on the remote host is suddenly
stopped, the host is rebooted, the host or remote network interface is
disabled, or the remote host uses a hard close (see setsockopt for more in-
formation on the SO_LINGER option on the remote socket). This error may
also result if a connection was broken due to keep-alive activity detecting a
failure while one or more operations are in progress. Operations that were
in progress fail with WSAENETRESET. Subsequent operations fail with
WSAECONNRE-SET.

WSAENOBUFS No buffer space available.

10055 An operation on a socket could not be per-formed because the system


lacked sufficient buffer space or because a queue was full.

WSAEISCONN Socket is already connected.

10056 A connect request was made on an already-connected socket. Some


implementations also return this error if sendto is called on a connected
SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto
is ignored) although other implementations treat this as a legal occurrence.

WSAENOTCONN Socket is not connected.

10057 A request to send or receive data was disallowed because the socket is not
connected and (when sending on a datagram socket using sendto) no
address was supplied. Any other type of operation might also return this
error—for example, setsockopt setting SO_KEEPALIVE if the connection has
been reset.

WSAESHUTDOWN Cannot send after socket shutdown.

10058 A request to send or receive data was disallowed because the socket had
already been shut down in that direction with a previous shutdown call. By
calling shutdown a partial close of a socket is requested, which is a signal
that sending or receiving, or both have been discontinued.

WSAETIMEDOUT Connection timed out.

10060 A connection attempt failed because the connected party did not properly
respond after a period of time, or the established connection failed
because the connected host has failed to respond.

WSAECONNREFUSED Connection refused.

10061 No connection could be made because the target computer actively refused
it. This usually results from trying to connect to a service that is inactive on
the foreign host—that is, one with no server application running.

WSAEHOSTDOWN Host is down.

10064 A socket operation failed because the destination host is down. A socket
operation en-countered a dead host. Networking activity on the local host
has not been initiated. These conditions are more likely to be indicated by
the error WSAETIMEDOUT.

WSAEHOSTUNREACH No route to host.

10065 A socket operation was attempted to an un-reachable host. See


WSAENETUNREACH.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

WSAEPROCLIM Too many processes.

10067 A Windows Sockets implementation may have a limit on the number of


applications that can use it simultaneously. WSAStartup may fail with this
error if the limit has been reached.

WSASYSNOTREADY Network subsystem is unavailable.

10091 This error is returned by WSAStartup if the Windows Sockets


implementation cannot function at this time because the underlying system
it uses to provide network services is currently unavailable. Users should
check:

• That the appropriate Windows Sockets DLL file is in the current path.
• That they are not trying to use more than one Windows Sockets
implementation simultaneously. If there is more than one Winsock DLL
on your system, be sure the first one in the path is appropriate for the
network subsystem currently loaded.
• The Windows Sockets implementation documentation to be sure all
necessary components are currently installed and configured correctly.

WSAVERNOTSUPPORTED Winsock.dll version out of range.

10092 The current Windows Sockets implementation does not support the
Windows Sockets specification version requested by the application. Check
that no old Windows Sockets DLL files are being accessed.

WSANOTINITIALISED Successful WSAStartup not yet performed.

10093 Either the application has not called WSAStartup or WSAStartup failed. The
application may be accessing a socket that the current active task does not
own (that is, trying to share a socket between tasks), or WSACleanup has
been called too many times.

WSAEDISCON Graceful shutdown in progress.

10101 Returned by WSARecv and WSARecvFrom to indicate that the remote party
has initiated a graceful shutdown sequence.

WSATYPE_NOT_FOUND Class type not found.

10109 The specified class was not found.

WSAHOST_NOT_FOUND Host not found.

11001 No such host is known. The name is not an official host name or alias, or it
cannot be found in the database(s) being queried. This error may also be
returned for protocol and service queries, and means that the specified
name could not be found in the relevant database.

WSATRY_AGAIN Nonauthoritative host not found.

11002 This is usually a temporary error during host name resolution and means
that the local server did not receive a response from an authoritative
server. A retry at some time later may be successful.

WSANO_RECOVERY This is a nonrecoverable error.

11003 This indicates that some sort of nonrecoverable error occurred during a
database lookup. This may be because the database files (for example,
BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

or a DNS request was returned by the server with a severe error.

WSANO_DATA Valid name, no data record of requested type.

11004 The requested name is valid and was found in the database, but it does not
have the correct associated data being resolved for. The usual ex-ample for
this is a host name-to-address translation attempt (using gethostbyname or
WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An
MX record is returned but no A record—indicating the host itself exists, but
is not directly reachable.

WSA_INVALID_HANDLE Specified event object handle is invalid.

6 An application attempts to use an event object, but the specified handle is


not valid.

WSA_INVALID_PARAMETER One or more parameters are invalid.

87 An application used a Windows Sockets function which directly maps to a


Windows function. The Windows function is indicating a problem with one
or more parameters

WSA_IO_INCOMPLETE Overlapped I/O event object not in signaled state.

996 The application has tried to determine the status of an overlapped


operation which is not yet completed. Applications that use
WSAGetOverlappedResult (with the fWait flag set to FALSE) in a polling
mode to deter-mine when an overlapped operation has completed, get this
error code until the operation is complete.

WSA_IO_PENDING Overlapped operations will complete later.

997 The application has initiated an overlapped operation that cannot be


completed immediately. A completion indication will be given later when
the operation has been completed.

WSA_NOT_ENOUGH_MEMORY Insufficient memory available.

8 An application used a Windows Sockets function that directly maps to a


Windows function. The Windows function is indicating a lack of required
memory resources.

WSA_OPERATION_ABORTED Overlapped operation aborted.

995 An overlapped operation was canceled due to the closure of the socket, or
the execution of the SIO_FLUSH command in WSAIoctl.

WSAINVALIDPROCTABLE Invalid procedure table from service provider.

10104 A service provider returned a bogus procedure table to Ws2_32.dll. (This is


usually caused by one or more of the function pointers being null.)

WSAINVALIDPROVIDER Invalid service provider version number.

10105 A service provider returned a version number other than 2.0.

WSAPROVIDERFAILEDINIT Unable to initialize a service provider.

10106 Either a service provider's DLL could not be loaded (LoadLibrary failed) or
the provider's WSPStartup/NSPStartup function failed.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Winsock 2 Error Codes

WSASYSCALLFAILURE System call failure.

10107 Generic error code, returned under various conditions.

Returned when a system call that should never fail does fail. For example,
if a call to WaitForMultipleEvents fails or one of the registry functions fails
trying to manipulate the protocol/namespace catalogs.

Returned when a provider does not return SUCCESS and does not provide an
ex-tended error code. Can indicate a service provider implementation
error.

| Technical Details |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Technical Details

Technical Details
CAPL Function Overview » TCP/IP API » Technical Details

Socket handles

Except for the network information functions of the IP API most of the CAPL Socket API functions take a
socket handle of type dword as a first parameter.

Info

This handle parameter is not the underlying WIN32 SOCKET handle and thus of no general use.
You should treat this parameter as an opaque handle.

Socket behaviour

All sockets are created as overlapped sockets and are operated in non-blocking mode. All functions, which
cannot complete immediately, are performed in an overlapped and asynchronous manner. Upon
completion (successful or not) the CAPL program receives a callback provided that it implements the
required completion routine.

Error handling

Almost all of the functions have a return value of type long. The value returned indicates the status of
the operation (successful or not) and is – in almost all cases - identical to the return value of the
underlying Winsock 2 API. That means that the return value is typically either zero if no error occurs or
SOCKET_ERROR (-1) otherwise. To get a specific error code for the last socket operation, use the
IpGetLastSocketError function. If an invalid socket handle is passed to a CAPL Socket API function the
value WSA_INVALID_PARAMETER (87) is returned.

Info

Because the entire Winsock 2 API is used in an overlapped, asynchronous manner, functions such
as UdpReceiveFrom, TcpReceive and TcpConnect will almost always return the value
SOCKET_ERROR. Use the IpGetLastSocketError function to determine whether the operation is
just pending or a real error has occurred.

| Winsock 2 Error Codes |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnTcpClose

OnTcpClose
CAPL Function Overview » TCP/IP API » OnTcpClose

Syntax void OnTcpClose( dword socket, long result)

Function Provided the CAPL program implements this callback it is dispatched when a TCP socket
receives a close notification.

Parameters socket

The socket handle.

result

The specific result code of the operation. If the operation completed successfully the
value is zero. Otherwise the value is non-zero.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnTcpConnect

OnTcpConnect
CAPL Function Overview » TCP/IP API » OnTcpConnect

Syntax void OnTcpConnect( dword socket, long result)

Function Provided the CAPL program implements this callback it is dispatched when an
asynchronous connection operation completes.

Parameters socket

The socket handle.

result

The specific result code of the operation. If the operation completed successfully the
value is zero. Otherwise the value is non-zero.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnTcpListen

OnTcpListen
CAPL Function Overview » TCP/IP API » OnTcpListen

Syntax void OnTcpListen( dword socket, long result)

Function Provided the CAPL program implements this callback it is dispatched when a connection
request for the specified socket is received.

Parameters socket

The socket handle.

result

The specific result code of the operation. If the operation completed successfully the
value is zero. Otherwise the value is non-zero.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnTcpReceive

OnTcpReceive
CAPL Function Overview » TCP/IP API » OnTcpReceive

Syntax void OnTcpReceive( dword socket, long result, dword address, dword port,
char buffer[], dword size)

Function Provided the CAPL program implements this callback it is dispatched when an
asynchronous receive operation on a TCP socket completes.

Parameters socket

The socket handle.

result

The specific result code of the operation. If the operation completed successfully the
value is zero. Otherwise the value is non-zero.

address

The remote address of the location which sent the data in network-byte order.

port

The remote port of the location which sent the data in host-byte order.

buffer

The buffer into which the data was stored.

size

The size of the received data.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnTcpSend

OnTcpSend
CAPL Function Overview » TCP/IP API » OnTcpSend

Syntax void OnTcpSend( dword socket, long result, char buffer[], dword size)

Function Provided the CAPL program implements this callback it is dispatched when an
asynchronous send operation on a TCP socket completes.

Parameters socket

The socket handle.

result

The result code of the asynchronous operation. If the operation completed successfully
the value is zero. Otherwise the value is non-zero.

buffer

The buffer provided with the send operation.

size

The number of bytes sent.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnUdpReceiveFrom

OnUdpReceiveFrom
CAPL Function Overview » TCP/IP API » OnUdpReceiveFrom

Syntax void OnUdpReceiveFrom( dword socket, long result, dword address, dword
port, char buffer[], dword size)

Function Provided the CAPL program implements this callback it is dispatched when an
asynchronous receive operation on an UDP socket completes.

Parameters socket

The socket handle.

result

The result code of the asynchronous operation. If the operation completed successfully
the value is zero. Otherwise the value is non-zero.

address

The remote address of the location which sent the data in network-byte order.

port

The remote port of the location which sent the data in host-byte order.

buffer

The buffer into which the data was stored.

size

The number of bytes received.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnUdpSendTo

OnUdpSendTo
CAPL Function Overview » TCP/IP API » OnUdpSendTo

Syntax void OnUdpSendTo( dword socket, long result, char buffer[], dword size)

Function Provided the CAPL program implements this callback it is dispatched when an
asynchronous send operation on an UDP socket completes.

Parameters socket

The socket handle.

result

The result code of the asynchronous operation. If the operation completed successfully
the value is zero. Otherwise the value is non-zero.

buffer

The buffer provided with the send operation.

size

The number of bytes sent.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpBind

IpBind
CAPL Function Overview » TCP/IP API » IpBind

Syntax long IpBind( dword socket, dword address, dword port)

Method socket.Bind( dword address, dword port)

Function The function associates an address and a port with the specified socket.

Parameters socket

The socket handle.

address

The local address in network-byte order.

port

The local port in host-byte order.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastError to get a more specific error
code.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterAddress

IpGetAdapterAddress
CAPL Function Overview » TCP/IP API » IpGetAdapterAddress

Syntax long IpGetAdapterAddress( dword index, dword address[],dword count)

Function The function retrieves the addresses associated with a network interface. The interface is
specified by it's 1-based index in the list of network interfaces, i.e. the first interface has
index 1.

Parameters index

The 1-based network interface index.

address

The array used to store the addresses in network-byte order.

count

The size of the address array.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The address array was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterAddressAsString

IpGetAdapterAddressAsString
CAPL Function Overview » TCP/IP API » IpGetAdapterAddressAsString

Syntax long IpGetAdapterAddressAsString( dword index, char address[], dword count)

Function The function retrieves the string representation of the first address associated with the
specified network interface.

Parameters index

The 1-based network interface index.

address

The buffer used to store the address string in dot notation.

count

The size of the address buffer.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The address buffer was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterCount

IpGetAdapterCount
CAPL Function Overview » TCP/IP API » IpGetAdapterCount

Syntax dword IpGetAdapterCount()

Function The function returns the number of network interfaces for the local computer, not
including the loopback interface.

Parameters —

Return values The number of network interfaces.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterDescription

IpGetAdapterDescription
CAPL Function Overview » TCP/IP API » IpGetAdapterDescription

Syntax long IpGetAdapterDescription( dword index, char name[], dword count)

Function The function retrieves the description of the specified network interface.

Parameters index

The 1-based network interface index.

name

The buffer used to store the description.

count

The size of the name buffer.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The name buffer was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterGateway

IpGetAdapterGateway
CAPL Function Overview » TCP/IP API » IpGetAdapterGateway

Syntax long IpGetAdapterGateway( dword index, dword address[], dword count)

Function The function retrieves the default gateway address associated with the specified network
interface.

Parameters index

The 1-based network interface index.

address

The array used to store the gateway addresses in network-byte order.

count

The size of the address array.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The address array was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterGatewayAsString

IpGetAdapterGatewayAsString
CAPL Function Overview » TCP/IP API » IpGetAdapterGatewayAsString

Syntax long IpGetAdapterGatewayAsString( dword index, char address[], dword count)

Function The function retrieves the string representation of the default gateway address
associated with the specified network interface.

Parameters index

The 1-based network interface index.

address

The buffer used to store the gateway address string in dot notation.

count

The size of the address buffer.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The address buffer was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterMask

IpGetAdapterMask
CAPL Function Overview » TCP/IP API » IpGetAdapterMask

Syntax long IpGetAdapterMask( dword index, dword mask[], dword count)

Function The function retrieves the address masks (subnet masks) associated with the specified
network interface.

Parameters index

The 1-based network interface index.

mask

The array used to store the address masks in network-byte order.

count

The size of the mask array.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The mask array was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAdapterMaskAsString

IpGetAdapterMaskAsString
CAPL Function Overview » TCP/IP API » IpGetAdapterMaskAsString

Syntax long IpGetAdapterMaskAsString( dword index, char mask[], dword count)

Function The function retrieves the string representation of the first address mask associated with
the specified network interface.

Parameters index

The 1-based network interface index.

mask

The buffer used to store the address mask string in dot notation.

count

The size of the mask buffer.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The mask buffer was insufficient.

WSA_INVALID_PARAMETER (87): The specified network interface index was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAddressAsNumber

IpGetAddressAsNumber
CAPL Function Overview » TCP/IP API » IpGetAddressAsNumber

Syntax dword IpGetAddressAsNumber( char address[])

Function The function converts an address string in dot notation to it's numerical value in network-
byte order.

Parameters address

The address to be converted.

Return values 4294967295 (0xFFFFFFF, the equivalent of "255.255.255.255"): The specified address
string was invalid.

Any other value: The numeric equivalent of the given address string.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetAddressAsString

IpGetAddressAsString
CAPL Function Overview » TCP/IP API » IpGetAddressAsString

Syntax long IpGetAddressAsString( dword numericAddress, char address[], dword


count)

Function The function converts a numeric address in network-byte order to a address string in dot
notation as in "192.168.0.10".

Parameters numericAddress

The address to be converted.

address

The buffer used to store the converted address.

count

The size of the address buffer.

Return values 0: The function completed successfully.

ERROR_NOT_ENOUGH_MEMORY (8): The address buffer was insufficient.

WSA_INVALID_PARAMETER (87): The specified address was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetLastError

IpGetLastError
CAPL Function Overview » TCP/IP API » IpGetLastError

Syntax long IpGetLastError()

Function The function returns the Winsock 2 error code of the last operation that failed.

Parameters —

Return values The error code as provided by the Winsock 2 WSAGetLastError function.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetLastSocketError

IpGetLastSocketError
CAPL Function Overview » TCP/IP API » IpGetLastSocketError

Syntax long IpGetLastSocketError( dword socket)

Method socket.GetLastSocketError()

Function The function returns the Winsock 2 error code of the last operation that failed on the
specified socket.

Parameters socket

The socket handle.

Return values WSA_INVALID_PARAMETER (87): The specified socket was invalid.

Any other value: The error code as provided by the Winsock 2 WSAGetLastError function.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpGetLastSocketErrorAsString

IpGetLastSocketErrorAsString
CAPL Function Overview » TCP/IP API » IpGetLastSocketErrorAsString

Syntax long IpGetLastSocketErrorAsString( dword socket, char text[], dword count)

Method socket.GetLastSocketErrorAsString( char text[], dword count)

Function The function retrieves the error message of the last operation that failed on the specified
socket (see Winsock 2 error code).

Parameters socket

The socket handle.

text

The buffer used to store the error message.

count

The size of the text buffer.

Return values 0: The error message was written into the text buffer. In case of an invalid error code,
the error message has the format "Unknown error: x" assuming the last error code x for
the specified socket.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: IpSetSocketOption

IpSetSocketOption
CAPL Function Overview » TCP/IP API » IpSetSocketOption

Syntax long IpSetSocketOption( dword socket, long level, long name, long value)

Method socket.SetSocketOption( long level, long name, long value)

Function The function modifies a socket option.

Parameters socket

The socket handle.

level

The level at which the option is defined, e.g. SOL_SOCKET (0xFFFF).

name

The socket option name to be modified, e.g. SO_BROADCAST (0x0020).

value

The value to be set for the socket option.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastError to get a more specific error
code.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpAccept

TcpAccept
CAPL Function Overview » TCP/IP API » TcpAccept

Syntax dword TcpAccept( dword socket)

As constructor TcpSocket::Accept( dword socket)


function

Function The function accepts an incoming connection request on the specified socket resulting in
a new socket . If the operation fails, the function will return INVALID_SOCKET (~0).

Parameters socket

The socket handle.

Return values INVALID_SOCKET (~0): The function failed. Call IpGetLastError to get a more specific
error code. If this error code is WSA_INVALID_PARAMETER (87), the specified socket was
invalid. Otherwise use IpGetLastSocketError to get the reason for the failing.

Any other value: A valid socket handle identifying the created socket.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpClose

TcpClose
CAPL Function Overview » TCP/IP API » TcpClose

Syntax long TcpClose( dword socket)

Destructor socket.close()

Function The function closes the TCP socket. Upon successful completion the passed socket is no
longer valid.

Parameters socket

The socket to be closed.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastError to get a more specific error
code.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpConnect

TcpConnect
CAPL Function Overview » TCP/IP API » TcpConnect

Syntax long TcpConnect( dword socket, dword address, dword port)

Method socket.Connect( dword address, dword port)

Function The function establishes a connection with the specified location. If the connect
operation does not complete immediately the operation is performed asynchronously and
the function will return SOCKET_ERROR (-1). Use IpGetLastSocketError to get a more
specific error code. If the specific error code is WSAWOULDBLOCK (10035), the CAPL
callback OnTcpConnect will be called on completion (successful or not), provided it is
implemented in the same CAPL program.

Parameters socket

The socket handle.

address

The address of the destination in network-byte order.

port

The port of the destination in host-byte order.

Return values 0: The function completed successfully.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TCPGetRemoteAddress

TCPGetRemoteAddress
CAPL Function Overview » TCP/IP API » TCPGetRemoteAddress

Syntax dword TcpGetRemoteAddress(dword socket)

Function This function retrieves the remote address of the specified socket.

Parameters socket

The socket handle.

Return values The address of the remote host in network-byte order.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TCPGetRemoteAddressAsString

TCPGetRemoteAddressAsString
CAPL Function Overview » TCP/IP API » TCPGetRemoteAddressAsString

Syntax long TcpGetRemoteAddressAsString(dword socket, char buffer[], dword size)

Function This function retrieves the remote address of the specified socket in Internet standard
dotted-decimal format.

Parameters socket

The socket handle.

buffer

The buffer used to store the converted address.

size

The size of the address buffer.

Return values 0: The function completed successfully.

1: The provided buffer is too small.

2: Anything else failed (e.g. wrong socket parameter).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpListen

TcpListen
CAPL Function Overview » TCP/IP API » TcpListen

Syntax long TcpListen( dword socket)

Method socket.Listen()

Function The function causes the socket to listen for incoming connection requests, which will be
provided in the CAPL callback OnTcpListen, if it is implemented in the same CAPL
program. If the operation fails, the function will return SOCKET_ERROR (-1). Use
IpGetLastSocketError to get a more specific error code.

Parameters socket

The socket handle.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpOpen

TcpOpen
CAPL Function Overview » TCP/IP API » TcpOpen

Syntax dword TcpOpen( dword address, dword port)

As constructor TcpSocket::Open( dword address, dword port)


function

Function The function creates a TCP socket for use in connection-based, message-oriented
communications. All parameters may be zero. If the port parameter is non-zero the
socket is implicitly bound to the given port.

Parameters address

The local address in network-byte order to be used with the socket.

port

The port in host-byte order to be used with the socket.

Return values INVALID_SOCKET (~0): The function failed. Call IpGetLastError to get a more specific
error code.

Any other value: A valid socket handle identifying the created socket.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpReceive

TcpReceive
CAPL Function Overview » TCP/IP API » TcpReceive

Syntax long TcpReceive( dword socket, char buffer[], dword size)

Method socket.Receive( char buffer[], dword size)

Function The function receives data into the specified buffer. If the receive operation does not
complete immediately the operation is performed asynchronously and the function will
return SOCKET_ERROR (-1). Use IpGetLastSocketError to get a more specific error code. If
the specific error code is WSA_IO_PENDING (997) the CAPL callback OnTcpReceive will be
called on completion (successful or not), provided it is implemented in the same CAPL
program.

Parameters socket

The socket handle.

buffer

The buffer used to store the incoming data.

size

The size of the data buffer.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpSend

TcpSend
CAPL Function Overview » TCP/IP API » TcpSend

Syntax long TcpSend( dword socket, char buffer[], dword size)

Method socket.Send( char buffer[], dword size)

Function The function sends data on the specified socket. If the send operation does not complete
immediately the operation is performed asynchronously and the function will return
SOCKET_ERROR (-1). Use IpGetLastSocketError to get a more specific error code. If the
specific error code is WSA_IO_PENDING (997) the CAPL callback OnTcpSend will be called
on completion (successful or not), provided it is implemented in the same CAPL program.

Parameters socket

The socket handle.

buffer

The buffer containing the data to be sent.

size

The size of the data to be sent.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TcpShutdown

TcpShutdown
CAPL Function Overview » TCP/IP API » TcpShutdown

Syntax long TcpShutdown( dword socket)

Method socket.Shutdown( dword socket)

Function The function disables send operations on the specified socket. This function may be used
to shutdown a TCP connection.

Parameters socket

The socket handle.

Return values 0: The function completed successfully.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: UdpClose

UdpClose
CAPL Function Overview » TCP/IP API » UdpClose

Syntax long UdpClose( dword socket)

Destructor socket.Close()

Function The function closes the UDP socket. Upon successful completion the passed socket is no
longer valid.

Parameters socket

The socket to be closed.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastError to get a more specific error
code.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: UdpOpen

UdpOpen
CAPL Function Overview » TCP/IP API » UdpOpen

Syntax dword UdpOpen( dword address, dword port)

As constructor UdpSocket::Open( dword address, dword port)


function

Function The function creates an UDP socket for use in connectionless, datagramm-oriented
communications. All parameters may be zero. If the port parameter is non-zero the
socket is implicitly bound to the given port.

Parameters address

The local address in network-byte order to be used with the socket.

port

The port in host-byte order to be used with the socket.

Return values INVALID_SOCKET (~0): The function failed. Call IpGetLastError to get a more specific
error code.

Any other value: A valid socket handle identifying the created socket.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: UdpReceiveFrom

UdpReceiveFrom
CAPL Function Overview » TCP/IP API » UdpReceiveFrom

Syntax long UdpReceiveFrom( dword socket, char buffer[], dword size)

Method socket.ReceiveFrom( char buffer[], dword size)

Function The function receives data into the specified buffer. If the receive operation does not
complete immediately the operation is performed asynchronously and the function will
return SOCKET_ERROR (-1). Use IpGetLastSocketError to get a more specific error code. If
the specific error code is WSA_IO_PENDING (997) the CAPL callback OnUdpReceiveFrom
will be called on completion (successful or not), provided it is implemented in the same
CAPL program.

Parameters socket

The socket handle.

buffer

The buffer used to store the incoming data.

size

The size of the data buffer.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: UdpSendTo

UdpSendTo
CAPL Function Overview » TCP/IP API » UdpSendTo

Syntax long UdpSendTo( dword socket, dword address, dword port, char buffer[],
dword size)

Method socket.SendTo( dword address, dword port, char buffer[], dword size

Function The function sends data to the specified location. If the send operation does not complete
immediately the operation is performed asynchronously and the function will return
SOCKET_ERROR (-1). Use IpGetLastSocketError to get a more specific error code. If the
specific error code is WSA_IO_PENDING (997) the CAPL callback OnUdpSendTo will be
called on completion (successful or not), provided it is implemented in the same CAPL
program.

Parameters socket

The socket handle.

address

The address of the destination in network-byte order.

port

The port of the destination in host-byte order.

buffer

The buffer containing the data to be sent.

size

The size of the data to be sent.

Return values 0: The function completed successfully.

WSA_INVALID_PARAMETER (87): The specified socket was invalid.

SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific
error code.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 — — •

7.0 SP5: methods — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: File Functions

File Functions
CAPL Function Overview » General » File Functions

There is often the need to save variables or measurement values over a period of time covering a number
of measurements. File functions are provided in CAPL for this purpose.

While file access operations are generally conceived to be easy to use and reliable they are rather slow.
Therefore file access should not be done in time-critical phases during measurement. It is recommended
to use CAPL file access mainly in the on prestart and on stop event handlers.

Info

If file functions are used in CAPL programs in the simulation setup or test setup and CANoe is
running in a distributed environment (CANoe RT or VN8900), it is required to predefine the files
to be accessed in advance under Configuration|Options|Configuration Settings|User Files.
The files on the user PC and on the remote device are synchronized before measurement start
and after measurement end.

| File Search Procedure |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: File Search Procedure

File Search Procedure


CAPL Function Overview » General » File Search Procedure

Single host environment

A file search procedure is used to determine the absolute file path. There are different procedures for
writing and reading files.

File search order on read access:

1. If the CAPL file function is used in the CANoe simulation or test setup and if the file name doesn’t
contain a path (drive or directory), look up the file name in the list of pre-defined user files
(Configuration|Options|Configuration Settings|User Files) and take the path specified there.
2. If the file name is not found in the list of pre-defined user files and the CAPL function setFilePath
has been called before, use the directory specified with setFilePath as base to determine the
absolute path.
3. If setFilePath was not called before opening a file for read access search the file in the directory of
the first database.
4. If the file could not be found there, the directories of further databases will be used.
5. If the file still could not be found, the directory of the configuration file will be used.

File search order on write access

1. If the CAPL file function is used in the CANoe simulation or test setup and if the file name doesn’t
contain a path (drive or directory), look up the file name in the list of pre-defined user files
(Configuration|Options|Configuration Settings|User Files) and take the path specified there.
2. If the file name is not found in the list of pre-defined user files and the CAPL functions setFilePath
or setWritePath have been called before, use the directory specified with
setFilePath/setWritePath as base to determine the absolute path.
3. If setFilePath/setWritePath was not called before opening a file for write access, the configuration
directory will be used as base to determine the absolute path instead.

Distributed simulation environment

In a distributed simulation environment (CANoe RT or VN8900) it is required to pre-define all files to be


accessed in CAPL programs in the CANoe simulation or test setup under
Configuration|Options|Configuration Settings|User Files.

The CAPL functions that require a file name don’t accept path names (including a drive name or directory
names).

CAPL functions setFilePath, setWritePath and getAbsFilePath are not available in case of a
distributed environment.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Runtime Errors

Runtime Errors
CAPL Function Overview » General » Runtime Errors

A number of runtime errors are monitored:

• Division by zero
• Exceeding upper or lower limits of the array
• Exceeding upper or lower limits of offset in the data range of messages.
• Stack overflow when CAPL subroutines are called.

If a runtime error is detected the function runError is called. This outputs a comment to the Write
window, which contains the name of the CAPL program, the type of error and an error index. With the
help of the error index, the point in the CAPL source text which generated the error is found.
Measurement is terminated after output of the comment.

The user can also call the function runError directly to generate assertions.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: String Literal

String Literal
CAPL Function Overview » General » String Literal

A string literal is a character string in quotation marks: "This is a character string"

Escape Sequences

Certain characters are displayed as a combination of characters with a preceding backslash (escape
sequence) within a character string, e.g:

Description Display inside character strings

New line \n

Tabulator \t

Backslash \\
Carriage return \r
Backspace \b
Double quotation mark \"
Single quotation mark \'

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: writeProfileInt, writeProfileFloat, writeProfileString, getProfileInt, getProfileFloat, getProfileString, getProfileArray

Example: writeProfileInt, writeProfileFloat, writeProfileString,


getProfileInt, getProfileFloat, getProfileString, getProfileArray
CAPL Function Overview » General » Example: writeProfileInt, writeProfileFloat, writeProfileString, getProfileInt, getProfileFloat,
getProfileString, getProfileArray

on key 'i'
{
int defaultPara1;
int returnParaInt;
int returnArray;
int counter;

double defaultPara2;
double returnParaFloat;

char buffer [1280];


char buffarray[640];

defaultPara1 = -1;
defaultPara2 = -1;

// Write different values into the section "Parameter" of the INI file "Test.Ini"

writeProfileString ("Parameter","String","TestString","Test.Ini");
writeProfileFloat ("Parameter","Float", 1.7845,"Test.Ini");
writeProfileInt ("Parameter", "Integer", 8, "Test.Ini");

// Read different values from the Section "Parameter" of the INI file "Test.Ini"
// And display the values in the Write window

returnParaInt = getProfileInt("Parameter","Integer",defaultPara1,"Test.Ini");
returnParaFloat = getProfileFloat("Parameter","Float",defaultPara2,"Test.Ini");
getProfileString("Parameter","String","Default String", buffer, elcount(buffer),
"Test.Ini");
returnArray = getProfileArray("Parameter","Array", buffarray, elcount(buffarray),
"Test.Ini");

write("Integer: %d", returnParaInt);


write("Float: %f", returnParaFloat);
write("String: %s", buffer);

if (returnArray == 0)
{
write("Non array content!");
}
else
{
for (counter = 0; counter <= returnArray - 1; counter++)
{
write("Array: %d", buffarray[counter]);
}
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: ReplayStart, ReplayStop, ReplaySuspend, ReplayResume, ReplayState

Example: ReplayStart, ReplayStop, ReplaySuspend, ReplayResume,


ReplayState
CAPL Function Overview » General » Example: ReplayStart, ReplayStop, ReplaySuspend, ReplayResume, ReplayState

variables
{
char replayName[32] = "ibus_data";
}

on key 'b'
{
replayStart( replayName);
}

on key 'e'
{
replayStop( replayName);
}

on key 's'
{
replaySuspend( replayName);
}

on key 'r'
{
replayResume( replayName);
}

on key 'w'
{
writeReplayState( replayName);
}
void writeReplayState( char name[])
{
switch ( replayState( name))
{
case 0:
write( "Replay block %s is stopped", replayName);
break;
case 1:
write( "Replay block %s is running", replayName);
break;
case 2:
write( "Replay block %s is suspended", replayName);
break;
default:
write( "Error: Replay block %s has an unknown state!", replayName);
break;
};
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: Sequencial File Access

Example: Sequencial File Access


CAPL Function Overview » General » Example: Sequencial File Access

// In this CAPL programm, the test file test.dat will be


// opened on start of measurement. After pressing the key
// ‘a’, the data will be copied bytewise to the message
// 100 and is transmitted in blocks of 8 data bytes every
// 10 ms. Pressing the key ‘r’ rewinds the data file to
// the beginning and then restarts the transmission.

variables {
message 100 msg = {DLC=8};
char filename[50] = "test.dat";
long handle;
msTimer ReadNextBlock;
}

// open data file on start of measurement


on start {
handle = seqFileLoad(filename);
if (handle <= 0) {
write ("error opening file");
write("Handle = %d", handle);
}
else {
write ("file %s opened",filename);
write ("Press key ‘a’ to start reading the file");
}
}

// close data file on stop of measurement


on stopMeasurement
{
if (handle > 0) {
if (seqFileClose(handle) == 0) { write ("file closed"); }
else { write ("error closing file"); }
}
}

// start file transmission


on key 'a'
{
setTimer(ReadNextBlock,10);
}

// reset file transmission


on key 'r'
{
seqFileRewind(handle);
setTimer(ReadNextBlock,10);
}

// transmit data file in blocks of 8 bytes


on timer ReadNextBlock
{
int n;
char buffer[8]= " ";
n = seqFileGetBlock(buffer,8,handle);
msg.byte(0)= buffer[0];
msg.byte(1)= buffer[1];
msg.byte(2)= buffer[2];
msg.byte(3)= buffer[3];
msg.byte(4)= buffer[4];
msg.byte(5)= buffer[5];
msg.byte(6)= buffer[6];
msg.byte(7)= buffer[7];
output(msg);
if (n >= 0) { setTimer(ReadNextBlock,10); }
else { write("No character read"); }
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: writeClear, writeCreate, writeDestroy, writeEx, writeLineEx

Example: writeClear, writeCreate, writeDestroy, writeEx, writeLineEx


CAPL Function Overview » General » Example: writeClear, writeCreate, writeDestroy, writeEx, writeLineEx

variables
{
dword mNewPage; // Sink identifier
}

on start
{
//Create a new page at the write window
mNewPage= writeCreate("New Page");

//Configure the page so that its content is logged


writeConfigure(mNewPage, 20, 1, "c:\\temp\\writelog.txt");

//Clear content of CAPL page


writeclear(1);

//Show the description of the program


writeLineEx(mNewPage,2,"This program shows the keyboard sequence in a new created Page
");
writeLineEx(mNewPage,4,"\nKeyboard sequence: ");
}

on key *
{
//show the current key at the "New Page"
char currentKey;
currentKey = this;
writeEx(mNewPage,4,"%c ",currentKey);
}

on stopMeasurement
{
//destroy the new craeated Page
writeDestroy(mNewPage);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: File Functions

Example: File Functions


CAPL Function Overview » General » Example: File Functions

variables
{
msTimer writeTimer;
long glbPeriod = 250;

dword glbHandle = 0;
long glbValue;
}

on Start
{
char buffer[64];
long ret;

//
// Opens the file in ASCII mode for read access.
//
// To determine the absolute path, the search procedure will be used.
// The file must be located in the directory of the databases or the
// configuration directory.
//
glbHandle = OpenFileRead ("Data.Txt",0);

if ( glbHandle!=0 )
{
//
// got to end of file ...
//
while ( fileGetString(buffer,elcount(buffer),glbHandle)!=0 ) {};
//
// Get the last parameters
// (saved on disk after the end the last measurement)
//
glbValue = atol (buffer);
write ("Last value %d.",glbValue);
fileClose (glbHandle);
}
else
{
write ("File 'Data.Txt' was not opened for read access.");
}
//
// Open the file in ASCII mode for write access.
//
// The write path was not set using the function setWritePath(), so
// the configuration directory will be used instead. This is the
// default behavior.
//
glbHandle = OpenFileWrite ("Data.Txt",2);

if ( glbHandle!=0 )
{
setTimer (writeTimer,glbPeriod);
}
else
{
write ("File 'Data.Txt' was not opened for write access.");
}
}
on timer writeTimer
{
long randomValue;
char buffer [64];

if ( glbHandle!=0 )
{
randomValue = random (32767);
snprintf (buffer,elcount(buffer)," %d \n",randomValue);
filePutString (buffer, elcount(buffer),glbHandle);
setTimer (writeTimer,glbPeriod);
}
else
{
write ("Error, invalid file handle.");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: File Functions

}
}

on StopMeasurement
{
fileClose (glbHandle);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CAN CAPL Functions
(Only available with CAN!)

CAN CAPL Functions


(Only available with CAN!)
CAPL Function Overview » CAN CAPL Functions

Functions Short Description

BusLoad Returns the current busload of a channel.

ChipState Returns the current chip state of the CAN controller.

ErrorFrameCount Returns the number of error frames on a channel since start of


measurement.

ErrorFrameRate Returns the current rate of CAN error messages of a channel.

ExtendedFrameCount Returns the number of extended CAN frames on a channel since start of
measurement.

ExtendedFrameRate Returns the current rate of extended CAN frames on a channel.

ExtendedRemoteFrameCount Returns the current rate of extended remote CAN messages on a channel.

ExtendedRemoteFrameRate Returns the number of extended remote CAN messages on a channel since
start of measurement.

OverloadFrameCount Returns the number of CAN overload frames on a channel since start of
measurement.

OverloadFrameRate Returns the current rate of CAN overload frames on a channel.

PeakLoad Returns the peakload of a channel.

RxChipErrorCount Returns the current Rx error count in the receiver of a channel.

StandardFrameCount Returns the number of standard CAN frames on a channel since start of
measurement.

StandardFrameRate Returns the current rate of standard CAN frames on a channel.

StandardRemoteFrameCount Returns the number of standard remote CAN frames on channel x since
start of measurement.

StandardRemoteFrameRate Returns the current rate of standard CAN frames on a channel.

TxChipErrorCount Returns the current number of Tx errors in the CAN receiver of a channel.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: BusLoad

BusLoad
CAPL Function Overview » CAN » BusLoad

Syntax long BusLoad ()

Method CANx.BusLoad

Function Returns the current busload of channel x.

Valid x values: 1 ... 32

Return values Current busload of channel x in percent.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("CAN1 busload = %d", CAN1.BusLoad);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChipState

ChipState
CAPL Function Overview » CAN » ChipState

Syntax long ChipState ()

Method CANx.ChipState

Function Returns the current chip state of the CAN x controller.

Valid x values: 1 ... 32

Return values Chip state of the CAN x controller. See the following table for a description of the return
values.

0 Value not available

1 Simulated

2 Not used

3 Error Active

4 Warning Level

5 Error Passive

6 Bus Off

A description of the chip states can also be found here: Bus Statistics window of option
CAN.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Chip state of CAN1 = %d", CAN1.ChipState);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ErrorFrameCount

ErrorFrameCount
CAPL Function Overview » CAN » ErrorFrameCount

Syntax long ErrorFrameCount ()

Method CANx.ErrorFrameCount

Function Returns the number of error frames on channel x since start of measurement.

Valid x values: 1 ... 32

Return values Number of error frames on channel x since start of measurement.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of error frames on CAN1 = %d", CAN1.ErrorFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ErrorFrameRate

ErrorFrameRate
CAPL Function Overview » CAN » ErrorFrameRate

Syntax long ErrorFrameRate ()

Method CANx.ErrorFrameRate

Function Returns the current rate of CAN error messages of channel x.

Valid x values: 1 ... 32

Return values Current rate of CAN error messages on channel x in messages per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of error messages on CAN1 = %d", CAN1.ErrorFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ExtendedFrameCount

ExtendedFrameCount
CAPL Function Overview » CAN » ExtendedFrameCount

Syntax long ExtendedFrameCount ()

Method CANx.ExtendedFrameCount

Function Returns the number of extended CAN frames on channel x since start of measurement.

Valid x values: 1 ... 32

Return values Number of extended CAN frames on channel x since start of measurement

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of extended frames on CAN1 = %d", CAN1.ExtendedFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ExtendedFrameRate

ExtendedFrameRate
CAPL Function Overview » CAN » ExtendedFrameRate

Syntax long ExtendedFrameRate ()

Method CANx.ExtendedFrameRate

Function Returns the current rate of extended CAN frames on channel x.

Valid x values: 1 ... 32

Return values Current rate of extended CAN frames on channel x in messages per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of extended frames on CAN1 = %d", CAN1.ExtendedFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ExtendedRemoteFrameCount

ExtendedRemoteFrameCount
CAPL Function Overview » CAN » ExtendedRemoteFrameCount

Syntax long ExtendedRemoteFrameCount ()

Method CANx.ExtendedRemoteFrameCount

Function Returns the number of extended remote CAN messages on channel x since start of
measurement.

Valid x values: 1 ... 32

Return values Number of extended remote CAN messages on channel x since start of measurement.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of extended remote messages on CAN1 = %d",
CAN1.ExtendedRemoteFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ExtendedRemoteFrameRate

ExtendedRemoteFrameRate
CAPL Function Overview » CAN » ExtendedRemoteFrameRate

Syntax long ExtendedRemoteFrameRate ()

Method CANx.ExtendedRemoteFrameRate

Function Returns the current rate of extended remote CAN messages on channel x.

Valid x values: 1 ... 32

Return values Current rate of extended remote CAN messages on channel x in frames per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of extended remote messages on CAN1 = %d",
CAN1.ExtendedRemoteFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OverloadFrameCount

OverloadFrameCount
CAPL Function Overview » CAN » OverloadFrameCount

Syntax long OverloadFrameCount ()

Method CANx.OverloadFrameCount

Function Returns the number of CAN overload frames on channel x since start of measurement.

Valid x values: 1 ... 32

Return values Number of CAN overload frames on channel x since start of measurement.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of overload frames on CAN1 = %d", CAN1.OverloadFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OverloadFrameRate

OverloadFrameRate
CAPL Function Overview » CAN » OverloadFrameRate

Syntax long OverloadFrameRate ()

Method CANx.OverloadFrameRate

Function Returns the current rate of CAN overload frames on channel x.

Valid x values: 1 ... 32

Return values Current rate of CAN overload frames on channel x in messages per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of overload frames on CAN1 = %d", CAN1.OverloadFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: PeakLoad

PeakLoad
CAPL Function Overview » CAN » PeakLoad

Syntax long PeakLoad ()

Method CANx.PeakLoad

Function Returns the peakload of channel x.

Valid x values: 1 ... 32

Return values Peakload of channel x in percent.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("CAN1 peakload = %d", CAN1.PeakLoad);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RxChipErrorCount

RxChipErrorCount
CAPL Function Overview » CAN » RxChipErrorCount

Syntax long RxChipErrorCount ()

Method CANx.RxChipErrorCount

Function Returns the current Rx error count in the receiver of channel x.

Valid x values: 1 ... 32

Return values Current error count in the receiver of channel x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rx error count in the receiver of CAN1 = %d",
CAN1.RxChipErrorCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandardFrameCount

StandardFrameCount
CAPL Function Overview » CAN » StandardFrameCount

Syntax long StandardFrameCount ()

Method CANx.StandardFrameCount

Function Returns the number of standard CAN frames on channel x since start of measurement.

Valid x values: 1 ... 32

Return values Number of standard CAN frames on channel x since start of measurement.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of standard frames on CAN1 = %d", CAN1.StandardFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandardFrameRate

StandardFrameRate
CAPL Function Overview » CAN » StandardFrameRate

Syntax long StandardFrameRate ()

Method CANx.StandardFrameRate

Function Returns the current rate of standard CAN frames on channel x.

Valid x values: 1 ... 32

Return values Current rate of standard CAN frames on channel x in messages per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of standard frames on CAN1 = %d", CAN1.StandardFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandardRemoteFrameCount

StandardRemoteFrameCount
CAPL Function Overview » CAN » StandardRemoteFrameCount

Syntax long StandardRemoteFrameCount ()

Method CANx.StandardRemoteFrameCount

Function Returns the number of standard remote CAN frames on channel x since start of
measurement.

Valid x values: 1 ... 32

Return values Number of standard remote CAN frames on channel x since start of measurement.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of standard remote frames on CAN1 = %d",
CAN1.StandardRemoteFrameCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StandardRemoteFrameRate

StandardRemoteFrameRate
CAPL Function Overview » CAN » StandardRemoteFrameRate

Syntax long StandardRemoteFrameRate ()

Method CANx.StandardRemoteFrameRate

Function Returns the current rate of standard remote CAN frames of channel x.

Valid x values: 1 ... 32

Return values Current rate of standard remote CAN frames of channel x in messages per second.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Rate of standard remote frames of CAN1 = %d",
CAN1.StandardRemoteFrameRate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TxChipErrorCount

TxChipErrorCount
CAPL Function Overview » CAN » TxChipErrorCount

Syntax long TxChipErrorCount ()

Method CANx.TxChipErrorCount

Function Returns the current number of Tx errors in the CAN receiver of channel x.

Valid x values: 1 ... 32

Return values Current number of errors in the CAN receiver of channel x.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 CAN • •

Example
write ("Number of Tx errors in receiver of CAN1 = %d",
CAN1.TxChipErrorCount);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

LIN CAPL Functions


(Only available with Option .LIN!)
CAPL Function Overview » LIN CAPL Functions

The following LIN CAPL functions are available:

APIs for Configuring and Controlling a simulated LIN Master

APIs Short description

getSignal Gets the value of a signal.

linActivateCollisionResolution Activates or deactivates the Master node’s automatic collision resolution


of an event-triggered frame.

linActivateSlot Reactivates a schedule table slot defined in the LIN database file.

linChangeSchedTable Switches from the current schedule table to another one.

linChangeWakeupSettings Changes the wake-up setting.

linCheckRespError Queries the response_error flags of all Slave nodes defined in the LIN
network.

linDeactivateSlot Deactivates the specified slot of schedule table.

linSendAsSporadic Configures an associated frame as being ready for transmission.

linSendSleepModFrm Leads to a transmission of a go-to-sleep-command.

linSendWakeup Sends Wakeup frames.

linSetBreakLength Changes length of break/synch symbol parts.

linSetGlobalInterByteSpace Changes the inter-byte space for all frame responses.

linSetInterByteSpace Sets an inter-byte space for a specified frame and a specified byte filed.

linSetInterByteSpaces Sets the inter-byte spaces for all data byte fields of all published frames of
the calling LIN Slave node.

linSetInterframeSpace Sets the minimum inter-frame space.

linSetMasterRequestDirtyFlag Sets the dirty flag for the LIN master request frame.

linSetOEMDataInd Sets/resets the data indication bit for a calling slave node.

linSetOEMSleepInd Sets/resets the sleep indication bit for a calling slave node.

linSetOEMWakeupInd Sets/resets the wakeup indication bit for a calling slave node.

linSetSchedulerJitter Sets/resets the jitter mode and the jitter of the LIN hardware scheduler.

linSetWakeupParams Determines the conditions under which the LIN hardware can be
reactivated.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linSimulateETFCollision Causes collisions for next coming header(s) of an event-triggered frame.

linStartScheduler Starts the internal scheduler.

linStopScheduler Stops the internal scheduler.

output Applies frame header on the bus or reconfigures response data of LIN
frame.

setSignal Sets the transmitted signal to the accompanying value.

APIs for Configuring and Controlling a simulated LIN Slave

APIs Short description

getSignal Gets the value of a signal.

linActivateResps Reactivates all frame responses published by the calling Slave


node according to the LIN database file.

linActivateGlobalNetworkManagement Activates/deactivates network management for the entire LIN


network.

linChangeDlc Changes the Data Length Code of a LIN frame during the
measurement.

linDeactivateResps Deactivates frame responses for all frames published by the


calling slave node.

linETFSendOnSignalUpdate Activates/deactivates the automatic responses on a certain event-


triggered frame request in the case of a signal update on its
associated frame(s).

linETFSetDirtyFlag Sets/clears the dirty flag of an associated frame.

linGetBusIdleTimeout Returns the currently set bus idle timeout.

linGetOEMDataInd Queries the data indication bit of a Slave node.

linGetOEMSleepInd Queries the sleep indication bit of a Slave node.

linGetOEMWakeupInd Queries the wakeup indication bit of a Slave node.

linGetRespError Queries the response error flag of the calling Slave node or of the
Slave node.

linResetRespBaudrate Resets a response baudrate for a specified frame to the master


baudrate.

linResetNAD Resets NAD of the Slave node determined by the CAPL program
context to its initial NAD.

linResetSlave Resets the NAD of the modeled Slave node.

linSendWakeup Sends Wakeup frames.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linSetRespBaudrate Sets a response baudrate for a specified frame.

linSetBusIdleTimeout Sets a new bus idle timeout.

linSetGlobalInterByteSpace Changes the inter-byte space for all frame responses.

linSetInterByteSpace Sets an inter-byte space for a specified frame and a specified byte
filed.

linSetInterByteSpaces Sets the inter-byte spaces for all data byte fields.

linSetNAD Changes the node address of the calling simulated slave.

linSetOEMDataInd Sets/resets the data indication bit for a calling slave node.

linSetOEMDataIndTime Sets the time in milliseconds after which a simulated slave


automatically sets its data indication bit.

linSetOEMSleepInd Sets/resets the sleep indication bit for a calling slave node.

linSetOEMWakeupInd Sets/resets the wakeup indication bit for a calling slave node.

linSetRespCounter Limits the number of responses sent for the specified frame
identifier.

linSetRespError Sets/resets the response error flag for a calling slave node.

linSetRespLength Configures how many data bytes of the frame response should be
sent.

linSetValidBreakLimits Sets limits for the accepted sync break and delimiter lengths.

output Applies frame header on the bus or reconfigures response data of


LIN frame.

setSignal Sets the transmitted signal to the accompanying value.

APIs for Configuring and Controlling Network Management (Sleep/Wakeup)

APIs Short description

linActivateGlobalNetworkManagement Activates/deactivates network management for the entire LIN


network.

linActivateSlaveNetworkManagement Activates/deactivates network management for the calling Slave


node.

linBusIsAwake Inverts a specified bit when the next bus event for a specified ID
occurs.

linChangeWakeupSettings Changes the wake-up setting.

linCheckOEMDataInd Checks the data indication bits of all slave nodes defined in the
LIN network.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linCheckOEMSleepInd Checks the sleep indication bits of all slave nodes defined in the
LIN network.

linCheckOEMWakeupInd Checks the wakeup indication bits of all slave nodes defined in the
LIN network.

linCheckRespError Queries the response_error flags of all Slave nodes defined in the
LIN network.

linGetOEMDataInd Queries the data indication bit of a Slave node.

linGetOEMSleepInd Queries the sleep indication bit of a Slave node.

linGetOEMWakeupInd Queries the wakeup indication bit of a Slave node.

linGetRespError Queries the response error flag of the calling Slave node or of the
Slave node.

linSendSleepModFrm Leads to a transmission of a go-to-sleep-command.

linSendWakeup Sends Wakeup frames.

linSetOEMDataInd Sets/resets the data indication bit for a calling slave node.

linSetOEMDataIndTime Sets the time in milliseconds after which a simulated slave


automatically sets its data indication bit.

linSetOEMSleepInd Sets/resets the sleep indication bit for a calling slave node.

linSetOEMWakeupInd Sets/resets the wakeup indication bit for a calling slave node.

linSetRespError Sets/resets the response error flag for a calling slave node.

linSetWakeupParams Determines the conditions under which the LIN hardware can be
reactivated.

linSilentWakeup Wakes up the LIN bus without sending any wakeup frames.

LIN Analysis Feature Set

Functions Short description

getSignal Gets the value of a signal.

linBits2Time Converts specified bit time to an absolute time.

linBits2Time_ns

linBusIsAwake Queries the awake state of the LIN bus.

linGetByteEndTime Retrieves a data byte timestamp of a certain LIN bus event.

linGetChecksum Returns the checksum of a LIN frame or LIN checksum error.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linGetDlc Queries the Data Length Code of a LIN frame.

linGetEndOfHeader Retrieves a timestamp of the header part for a certain LIN bus event.

linGetHWReceiveAccuracy Queries the receive resolution of the LIN hardware.

linGetHWTransmitAccuracy Queries the transmit resolution of the LIN hardware.

linGetMeasBaudrate Retrieves results of a last baud rate measurement.

linGetMeasEdgeTimeDiffs Retrieves the time differences between edges.

linGetProtectedID Calculates protected ID for the corresponding LIN frame identifier.

linGetResponseData Queries LIN frame response data for specified FrameId on certain LIN
channel.

linGetStartOfFrame Retrieves a start timestamp of a LIN bus event.

linGetSyncBreakLength Retrieves the sync break (dominant bits) length of a LIN bus event.

linGetSyncDelLength Retrieves the synch delimiter (recessive bits) length of a LIN bus event.

linGetWakeupLength Retrieves a length of an occurred Wakeup frame.

linMeasHeaderBaudrate Sets request to measure the baud rate value for next LIN header event.

linMeasEdgeTimeDiffs Activates the measurement of the falling edges of the specified bytes in
the next message.

linMeasRespBaudrate Sets request to measure the baud rate value according to a certain data
byte of a certain LIN frame.

linResetMaxHeaderLength Resets the maximum header length to the protocol version dependent
default.

linResetScopeTrigger Resets the oscilloscope trigger condition(s).

linSetBaudrateDetectionRange Increases/decreases the baud rate detection range.

linSetMaxHeaderLength Sets the maximum header length in bit times.

linSetRespTolerance Sets the response tolerance for a specified frame in percent.

linSetScopeTrigger Defines trigger conditions for an oscilloscope.

linSetValidBreakLimits Sets limits for the accepted sync break and delimiter lengths.

linTime2Bits Converts specified system time to bit time.

linTime2Bits_ns

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

LIN Disturbance Feature Set

APIs Short description

linDetectMultipleErrors Instructs LIN Hardware to enable/disable detection of more than


one error per a LIN frame.

linDisturbHeaderWithBitStream Configures the LIN hardware to disturb the next header with a
bit stream.

linDisturbHeaderWithHeader Configures the LIN hardware to disturb the next header with a
new header.

linDisturbHeaderWithVariableBitStream Configures the LIN hardware to disturb the next header with a
variable bit stream.

linDisturbRespWithBitStream Configures the LIN hardware to disturb the specified response


with a bit stream.

linDisturbRespWithHeader Configures the LIN hardware to disturb the specified response


with a new header.

linDisturbRespWithVariableBitStream Configures the LIN hardware to disturb the specified response


with a variable bit stream.

linGetDominantTimeout Returns the dominant timeout of the current channel’s


transceiver in nanoseconds.

linInvertHeaderBit Inverts the specified bit in the next LIN header.

linInvertHeaderBitEx Inverts the specified number of 1/16th bits at the specified


position in the next LIN header.

linInvertMultipleHeaderBits Inverts the multiple bits in specified locations in the next LIN
header.

linInvertRespBit Inverts the specified bit when the next bus event for the
specified ID occurs.

linInvertRespBitEx Inverts the specified number of 1/16th bits at the specified


position in the next LIN message’s response with the specified
frame ID.

linInvertMultipleRespBits Inverts the multiple bits in specified locations in the next LIN
header.

linDeactivateBitInversion Cancels a previously activated bits inversion for LIN header or


response.

linSendDominantSignal Sends a dominant signal of a specified length.

linSetGlobalTimeoutPrevention Activates/deactivates the global timeout prevention for


transceivers with a dominant timeout.

linSetRespDisturbance Activates a disturbance in the response space of the specified


LIN frame.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linResetRespDisturbance Deactivates the disturbance in the response space of the


specified frame.

linStartDisturbance Starts a disturbance on the bus.

linStopDisturbance Stops the disturbance on the bus.

LIN Stress Feature Set

Functions Short description

linActivateFlashMode Activates the flash mode on high speed capable transceivers.

linGetFallingEdgesOfDisturbedByte Retrieves timestamps of all falling edges in the disturbed byte or in


the pseudo-byte caused by the last bit inversion.

linIsFlashModeActive Reports the flash mode state on high speed capable transceivers.

linSendHeaderError Sends a header with the current sync break, sync delimiter and
interbyte space settings and the specified sync byte and id byte.

linSetBaudrate Changes the baud rate during the measurement.

linSetSchedulerJitter Sets/resets the jitter mode and the jitter of the LIN hardware
scheduler.

linSetBreakLength Changes length of break/synch symbol parts.

linSendSamplingTestHeader Sends a slave response header.

linSetChecksumError Sets/resets a checksum error of a LIN frame.

linSetManualChecksum Sets a checksum (that is usually not a correct one) for a LIN frame.

linResetManualChecksum Sets the correct checksum of a LIN frame.

linSetInterByteSpace Sets an inter-byte space for a specified frame and a specified byte
filed.

linSetInterByteSpaces Sets the inter-byte spaces for all data byte fields of all published
frames of the calling LIN Slave node.

linSetGlobalInterByteSpace Changes the inter-byte space for all frame responses.

linSetInterframeSpace Sets the minimum inter-frame space.

linSetRespCounter Limits the number of responses sent for the specified frame
identifier.

linSetRespLength Configures how many data bytes of the frame response should be
sent.

linResetRespBaudrate Resets a response baudrate for a specified frame to the master


baudrate.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

linSetRespBaudrate Sets a response baudrate for a specified frame.

linSendBitStream Sends an arbitrary bit stream on the LIN bus.

linSendVariableBitStream Sends an arbitrary bit stream with bits of variable length.

linSetRespBitStream Sets up a bit stream as the response to the specified frame.

linResetRespBitStream Deactivates the bit stream response of the specified frame.

Test Feature Set for LIN

Functions Short description

TestGetWaitEventMsgData Calls up the frame content if a LIN frame with a valid response is
the last event that triggers a wait instruction.

TestGetWaitLinCSErrorData Retrieves the data of a checksum error triggered by the last wait
instruction.

TestGetWaitLinETFSingleResponseData Calls up the event content, if LIN Event-triggered frame with a


single response for the specified associated frame is the last
event that triggers a wait instruction.

TestGetWaitLinHdrData Calls up the header content if LIN Header event is the last event
that triggers a wait instruction.

TestGetWaitLinReceiveErrData Calls up the error content if LIN Receive Error event is the last
event that triggers a wait instruction.

TestGetWaitLinSyncErrorData Retrieves the data of a synchronisation error that triggered the


last wait instruction.

TestGetWaitLinTransmErrData Calls up the error content if LIN Transmission Error event is the
last event that triggers a wait instruction.

TestGetWaitLinWakeupData Calls up the frame content if LIN Wakeup frame is the last event
that triggers a wait instruction.

TestJoinMessageEvent Adds an event of type LIN Unconditional/Event-triggered Frame


to the set of joined events.

TestJoinLinCSErrorEvent Adds an event of type checksum error to the set of joined events.

TestJoinLinETFSingleResponseEvent Adds an event of type LIN event-triggered Frame with a single


response for the specified associated frame to the set of joined
events.

TestJoinLinHeaderEvent Adds an event of type LIN Header to the set of joined events.

TestJoinLinReceiveErrorEvent Adds an event of type LIN Receive Error to the set of joined
events.

TestJoinLinTransmErrorEvent Adds an event of type LIN Transmission Error to the set of joined
events.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

TestJoinLinWakeupEvent Adds an event of type LIN Wakeup frame to the set of joined
events.

TestJoinLinSyncErrorEvent Adds an event of type synchronisation error to the set of joined


events.

TestWaitForLinCSError Waits for a checksum error for the specified amount of time.

TestWaitForLinETFSingleResponse Waits for the occurrence of a LIN Event-triggered frame with a


single response for the specified associated frame.

TestWaitForLinHeader Waits for the Header occurrence of the specified LIN frame.

TestWaitForLinReceiveError Waits for the occurrence of LIN Receive Error event.

TestWaitForLinSyncError Waits for a synchronisation error for the specified amount of


time.

TestWaitForLinTransmError Waits for the occurrence of LIN Transmission Error event.

TestWaitForLinWakeupFrame Waits for the occurrence of LIN Wakeup frame.

TestWaitForMessage Waits for the occurrence of LIN frame with a valid response.

Test Service Library for LIN

Functions Short description

ChkStart_AllNodesDead This check reports a problem, if the node has not send any
of its Tx messages within a given time-interval.
ChkStart_NodeDead

ChkStart_MsgDistViolation This check is useful for spontaneous messages where one


message depends to another message; e.g. for token-ring
initializations for network management.

ChkStart_LINDiagDelayTimesViolation Checks the values of P2_min and ST_min.

ChkStart_LINETFViolation Checks the format LIN Event-triggered frame response.

ChkStart_LINHeaderToleranceViolation Checks the LIN header transmission time.

ChkStart_LINMasterBaudrateViolation Checks the LIN Master baud rate.

ChkStart_LINMasterInitTimeViolation Checks an initialization time of LIN Master.

ChkStart_LINReconfRequestFormatViolation Checks the format of LIN configuration requests.

ChkStart_LINRespErrorSignal Checks the LIN Response_Error signal.

ChkStart_LINRespToleranceViolation Checks the LIN response transmission time.

ChkStart_LINSchedTableViolation Checks a certain LIN schedule table for correspondence with


the database definition.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

ChkStart_LINSyncBreakTimingViolation Checks the timing of the synchronization break field in LIN


headers.

ChkStart_LINSyncDelTimingViolation Checks the timing of the synchronization break field in LIN


headers.

ChkStart_LINWakeupReqLengthViolation Checks the length of LIN Wake-up request.

ChkStart_LINWakeupRetryViolation Checks number of LIN wakeup signals and the time between
them.

ChkStart_MsgSignalValueRangeViolation This check is useful to supervise the value of signals.

ChkStart_MsgSignalValueInvalid

ChkStart_SignalCycleTimeViolation Checks the occurrences of a signal.

ChkStart_SignalValueChange Checks the physical value of a signal or an environment


variable.

The following LIN event procedures are available:

Event Procedures

Access to the data of the corresponding event is possible in event procedures through this.

The procedures are sub-divided into the following events:

Message events Short description

on linMessage Is called on the receipt of a valid LIN frame.

Controller events Short description

on linBaudrateEvent Is called when the LIN hardware has successfully measured the baud
rate of an external master or if the baud rate deviates by more than
0.5% from the last reported value.

on linDlcInfo Is called when the LIN hardware has successfully measured the length of
an unknown frame.

on linSleepModeEvent Is called when the wake status of the LIN hardware changes.

on linSchedulerModeChance Is called when an error occurred during a frame transmission.

on linWakeupFrame Is called when the LIN hardware detects a wakeup signal on the bus.

Error events Short description

on linCsError Is called when a frame was transmitted without a failure, but with an
incorrect checksum.

on linReceiveError Is called when an error occurred during a frame transmission.

on linSlaveTimeout Is called for SlaveTimeouts.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN CAPL Functions
(Only available with Option .LIN!)

on linSyncError Is called when the LIN hardware was unable to become synchronized to
an external master.

on linTransmError Is called when no Slave responded to a transmission request.

The following LIN selectors are available:

Selectors

Selectors Short description

linBaudrateEvent Detailed description of the linBaudrateEvent selectors.

linCsError Detailed description of the linCsError selectors.

linDlcInfo Detailed description of the linDlcInfo selectors.

linHeader Detailed description of the linHeader selectors.

linMessage Detailed description of the linMessage selectors.

linReceiveError Detailed description of the linReceiveError selectors.

linSchedulerModeChange Detailed description of the linSchedulerModeChange selectors.

linSleepModeEvent Detailed description of the linSleepModeEvent selectors.

linSyncError Detailed description of the linSyncError selectors.

linTransmError Detailed description of the linTransmError selectors.

linWakeupFrame Detailed description of the linWakeupFrame selectors.

| Network Hardware | Timeout Prevention |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateCollisionResolution

linActivateCollisionResolution
CAPL Function Overview » LIN » linActivateCollisionResolution

Syntax long linActivateCollisionResolution(long etfId, long activate)

Function Activates or deactivates the Master node's automatic collision resolution of an event-
triggered frame.

Per default the automatic collision resolution is active. If a collision occurs for any event-
triggered frame, the Master resolves this collision by sending headers for all associated
frames using the event-triggered frame slot. After all associated frames have sent new
data, the Master sends the event-triggered frame header until the next collision occurs.

If the automatic collision resolution is deactivated, the Master always sends the event-
triggered frame's header.

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters etfId

Identifier of event-triggered frame.

Value range: 0-59

activate

0: Disable
1: Enable

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

| linETFSendOnSignalUpdate | linETFSetDirtyFlag | linSetRespLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateFlashMode

linActivateFlashMode
CAPL Function Overview » LIN » linActivateFlashMode

Syntax dword linActivateFlashMode(byte activate)

Function This function activates flash mode on high speed capable transceivers. Note that in flash
mode such a transceiver will use faster rising and falling edges and will disregard the EMC
limitations of the LIN network. Note also, that the activation of the flash mode cannot be
done while the channel is transmitting or the scheduler is running.

Parameters activate

1 will activate the flash mode, 0 will deactivated it.

Return values On successful request returns 1, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP2 • LIN — •


• Real bus mode

Example
// test case for disturbing parts of a bit
// note, that test cases can only be used in the context of test module
nodes

testcase tcDisturbPartialBit()
{
dword flashModeActive;

flashModeActive = 0;

do
{
if (!linActivateFlashMode(1)) // request activation of flash mode
{
break; // if the request has been denied, either the cab/piggy is
incapable of
// flash mode or the scheduler is still running
}
testWaitForTimeout(10); // give the hardware time to activate the
flash mode
flashModeActive = linIsFlashModeActive(); // check if flash mode has
been
// activated successfully
} while (!flashModeActive);

if (!flashModeActive)
{
testStepFail(“tcDisturbPartialBit”, “Flash mode could not be
activated because of active scheduler or because the cab/piggy does not
support flash mode.”);
return;
}

linInvertRespBitEx(0, 0, 8, 4, 8, 0); // invert the middle part of the


stop bit of the
// first byte of the response to id 0

...
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateFlashMode

| linIsFlashModeActive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateGlobalNetworkManagement

linActivateGlobalNetworkManagement
CAPL Function Overview » LIN » linActivateGlobalNetworkManagement

Syntax long linActivateGlobalNetworkManagement(long active)

Function Activates/deactivates network management for the entire LIN network (the channel is
determined by the CAPL program context).

Network management is responsible for the automatic setting and resetting of response
error signals in the simulated Slave nodes.

Parameters active

0: deactivate
1: activate

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

| linActivateSlaveNetworkManagement | linCheckRespError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateResps

linActivateResps
CAPL Function Overview » LIN » linActivateResps

Syntax int linActivateResps()

Function Reactivates all frame responses published by the calling Slave node according to the LIN
database file (LDF), after having been previously deactivated by linDeactiveResps() or
linResetSlave().

Per default all frame responses are activated for Slave nodes on measurement start i.e. it
is assumed that Slave nodes have non-volatile memory.

LIN2.0 Slave nodes will automatically activate responses for re-configurable frames on
receiving valid reconfiguration commands i.e. AssignFrameID.

Individual frame responses can be activated manually using the function


linSetRespCounter.

Context Slave node only

Parameters —

Return values Number of activated frame responses or -1 if an error occurs.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

| linSetRespCounter | linDeactivateResps | linResetSlave |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateSlaveNetworkManagement

linActivateSlaveNetworkManagement
CAPL Function Overview » LIN » linActivateSlaveNetworkManagement

Syntax long linActivateSlaveNetworkManagement(long active)

Function Activates/deactivates network management for the calling Slave node.

Network management is responsible for the automatic setting and resetting of response
error signals in the simulated Slave nodes.

Parameters active

0: deactivate
1: activate

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN • •

Example

| linActivateGlobalNetworkManagement | linCheckRespError | linGetRespError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linActivateSlot

linActivateSlot
CAPL Function Overview » LIN » linActivateSlot

Syntax long linActivateSlot(dword tableIndex, dword slotIndex)

Function Reactivates a schedule table slot defined in the LIN database file (LDF), after having been
previously deactivated by linDeactivateSlot().

Schedule slots containing MasterRequests are automatically sent only if their data is
updated i.e. using output().

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters tableIndex

Schedule table index according to the LIN database file (LDF). First table in the LDF has
the index 0.

slotIndex

Slot index. First slot in a table has the index 0.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

| linDeactivateSlots |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linBits2Time

linBits2Time
CAPL Function Overview » LIN » linBits2Time

Syntax dword linBits2Time(dword bitTimes)

dword linBits2Time(dword channel, dword bitTimes)

Function Converts specified bit time to an absolute time.

The absolute time is calculated using the current baud rate on the channel determined by
the CAPL program context.

Parameters bitTimes

Time in bits.

channel

Channel number, whose baud rate will be used.

Return values Absolute time in 10 µs.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

6.0 LIN • •

Example

Convert header bit time of a LIN frame to µs


on linMessage *
{
dword headerTimeInMicroSeconds; // time in µs
headerTimeInMicroSeconds = linBits2Time(this.LIN_HeaderTime)*10;
}

| linTime2Bits |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linBits2Time_ns

linBits2Time_ns
CAPL Function Overview » LIN » linBits2Time_ns

Syntax int64 linBits2Time_ns(dword bitTimes)

int64 linBits2Time_ns(dword channel, dword bitTimes)

Function Converts specified bit time to an absolute time.

The absolute time is calculated using the current baud rate on the channel determined by
the CAPL program context.

Context Master or Slave node

Parameters bitTimes

Time in bits.

channel

Channel number, whose baud rate will be used.

Return values Absolute time in ns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 LIN • •

Example

Convert header bit time of a LIN frame to ns


on linMessage *
{
int64 headerTimeInNanoSeconds; // time in ns
headerTimeInNanoSeconds = linBits2Time_ns(this.LIN_HeaderTime);
}

| linTime2Bits_ns |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linBusIsAwake

linBusIsAwake
CAPL Function Overview » LIN » linBusIsAwake

Syntax long linBusIsAwake()

Function Queries the awake state of the LIN bus.

Parameters —

Return values Returns a value unequal to zero if the bus is awake, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 LIN — •

Example

| linChangeWakeupSettings | linSendSleepModFrm | linSendWakeup | linSilentWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linChangeDlc

linChangeDlc
CAPL Function Overview » LIN » linChangeDlc

Syntax long linChangeDlc(long frameID, long dlc)

Function Changes the Data Length Code (i.e. length in bytes) of a LIN frame during the
measurement.

Per default the DLC of LIN frames is initialized according to the LIN Description File (LDF).
This function is therefore only needed if you are simulating LIN nodes without using a LDF
and need to change the DLC of a LIN frame during the measurement.

To initialize the DLC of a LIN frame the function linSetDlc should be used in the event
procedure on preStart.

Context Master or Slave node

Parameters frameID

LIN frame identifier in the range 0 .. 63

dlc

Frame length in bytes in the range 1 .. 8

Return values If successful a value unequal to zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

Change DLC of a frame from database


...
linmessage MotorControl frameMotorControl;
linChangeDLC(frameMotorControl.id, frameMotorControl.dlc-1);
// now on transmitting the above frame a checksum error will come

| linGetDlc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linChangeSchedtable

linChangeSchedtable
CAPL Function Overview » LIN » linChangeSchedtable

Syntax long linChangeSchedTable(dword tableIndex)

long linChangeSchedTable(dword tableIndex, dword slotIndex)

long linChangeSchedTable(dword tableIndex, dword slotIndex, dword


onSlotIndex)

Function This function switches from the current schedule table to another one.

By calling this function in the event procedure on preStart, it is possible to specify in


which schedule table the measurement should start.

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters tableIndex

Index of the schedule table to be changed to.

Value range: 0..N-1, where N is a total number of defined schedule tables

slotIndex

Index of slot to be started within the new schedule table.

Default value: 0

Value range: 0..Y-1, where Y is a total number of slots in the new schedule table

onSlotIndex

Index of last slot in the current schedule table to be sent before changing to the new
schedule table.

Default value: -2 - makes change immediately

Value range: -2..X-1, where X is a total number of slots in the current schedule table.
Value: -1 - makes change on reaching the end of current schedule table.
Value: -2 - makes change immediately.

Return values Index of the current schedule table or -1 if no active schedule table exists and on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN — •

Example

Change to schedule table with index 1 on pressing 'c' key


...
on key 'c'
{
linChangeSchedTable(1);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linChangeWakeupSettings

linChangeWakeupSettings
CAPL Function Overview » LIN » linChangeWakeupSettings

Syntax dword linChangeWakeupSettings(byte restartScheduler, long wakeupIdentifier)

Function This function changes the wake-up setting.

Info

When LIN hardware is not in Sleep mode calling this function will have no
effect.

Parameters restartScheduler

0: After wakeup the current schedule table is started with the slot before entering sleep
mode.

1: After wakeup the current schedule table is started from the beginning.

In the case no schedule tables are defined this parameter is ignored.

wakeupIdentifier

LIN frame identifier to be sent additionally directly after sending a wakeup signal.

If an invalid identifier is specified i.e. not in the range 0..63:

• when schedule tables are defined no special wakeup identifier is sent;


• when no schedule tables are defined a SynchBreak / SynchField pair without an
identifier is sent;

Value range: 0..0xFF

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

Change wake-up settings on getting Sleep mode event


on linSleepModeEvent
{
linChangeWakeupSettings(0, 0x1); // do not restart scheduler, use 0x1 as
wake-up identifier
}

| linSendSleepModFrm | linSendWakeup | linSilentWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCheckOEMDataInd

linCheckOEMDataInd
CAPL Function Overview » LIN » linCheckOEMDataInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linCheckOEMDataInd()

Function This function checks the data indication bits of all slave nodes defined in the LIN network
(the channel is determined by the CAPL program context).

Parameters —

Return values Returns non-zero if all queried data indication bits are set, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linGetOEMDataInd | linSetOEMDataInd | linSetOEMDataIndTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCheckOEMSleepInd

linCheckOEMSleepInd
CAPL Function Overview » LIN » linCheckOEMSleepInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linCheckOEMSleepInd()

Function This function checks the sleep indication bits of all slave nodes defined in the LIN network
(the channel is determined by the CAPL program context).

Parameters —

Return values Returns non-zero if all queried sleep indication bits are set, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linGetOEMSleepInd | linSetOEMSleepInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCheckOEMWakeupInd

linCheckOEMWakeupInd
CAPL Function Overview » LIN » linCheckOEMWakeupInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linCheckOEMWakeupInd()

Function This function checks the wakeup indication bits of all slave nodes defined in the LIN
network (the channel is determined by the CAPL program context).

Parameters —

Return values Returns non-zero if at least one of the queried wakeup indication bits is set, otherwise
zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linGetOEMWakeupInd | linSetOEMWakeupInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCheckRespError

linCheckRespError
CAPL Function Overview » LIN » linCheckRespError

Syntax long linCheckRespError()

Function Queries the response_error flags of all Slave nodes defined in the LIN network.

Parameters —

Return values Returns one if at least one of the Slave nodes has the response_error flag set, otherwise
zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN — •

Example

| linGetRespError | linSetRespError | linActivateGlobalNetworkManagement | linActivateSlaveNetworkManagement |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDeactivateBitInversion

linDeactivateBitInversion
CAPL Function Overview » LIN » linDeactivateBitInversion

Syntax long LINDeactivateBitInversion()

Function With this function it is possible to cancel a previously activated bits inversion for LIN
header or response. This function is useful when after calling linInvertHeaderBit() no
header occurred yet on the bus or when after calling linInvertRespBit() no frame occurred
yet.

Parameters —

Return values On success a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 • LIN — •
• Real bus mode

Example

Deactivate previous bit inversion


on key 'd'
{
if (0==linDeactivateBitInversion())
{
write("CAPL: Bit inversion deactivation failure!");
}
}

| linInvertHeaderBit | linInvertRespBit |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDeactivateResps

linDeactivateResps
CAPL Function Overview » LIN » linDeactivateResps

Syntax int linDeactivateResps()

Function This function deactivates frame responses for all frames published by the calling slave
node. The frame responses can be deactivated individually using the function
linSetRespCounter().

Info

If the CAPL-program calling this function, does not model a Slave node, then
this function will have no effect.

Parameters —

Return values Number of deactivated frame responses or -1 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

| linSetRespCounter | linActivateResps | linResetSlave |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDeactivateSlot

linDeactivateSlot
CAPL Function Overview » LIN » linDeactivateSlot

Syntax long linDeactivateSlot(dword tableIndex, dword slotIndex)

Function This function deactivates the specified slot of schedule table. For example, it can be used
to turn slots off in a diagnostic table.

By calling this function in the event procedure on preStart, it is possible to configure


initial state of schedule table.

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters tableIndex

Index of the schedule table to be configured.

Value range: 0..N-1, where N is a total number of defined schedule tables

slotIndex

Index of slot to be deactivated within the specified schedule table.

Value range: 0..Y-1, where Y is a total number of slots in the specified schedule table

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

| linActivateSlot |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDetectMultipleErrors

linDetectMultipleErrors
CAPL Function Overview » LIN » linDetectMultipleErrors

Syntax long linDetectMultipleErrors(long activate)

Function This function can be used to instruct LIN Hardware to enable/disable detection of more
than one error per a LIN frame.

This function can be useful during tests of the stress functionality. For example, an
inversion of bits in a frame response may lead to a receive error and checksum error
simultaneously. By default only one error per frame is detected, but with this function
the detection of both errors can be activated.

Parameters activate

0: Disable
1: Enable

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbHeaderWithBitStream

linDisturbHeaderWithBitStream
CAPL Function Overview » LIN » linDisturbHeaderWithBitStream

Syntax dword linDisturbHeaderWithBitStream(dword byteIndex, dword bitIndex, byte


bitStream[], dword numberOfBits, dword timeoutPrevention);

Function Configures the LIN hardware to disturb the next header with a bit stream.

Parameters byteIndex

Start disturbance in byte with index <byteIndex>.

0: Sync Byte
1: ProtectedId Byte

bitIndex

The index of the bit where the interrupting bit stream will start.
An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

bitStream

The bit stream to be used for the interruption.

Maximum number of bits: 2^31-1.

numberOfBits

The number of bits in the bitStream-array.

timeoutPrevention

0: deactivates the timeout prevention for the 7259- or 7269-transceiver.


1: activates the timeout prevention for the 7259- or 7269-transceiver.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

| linDisturbHeaderWithHeader | linDisturbRespWithHeader | linDisturbRespWithBitStream | linDisturbHeaderWithVariableBitStream |


linDisturbRespWithVariableBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbHeaderWithHeader

linDisturbHeaderWithHeader
CAPL Function Overview » LIN » linDisturbHeaderWithHeader

Syntax dword linDisturbHeaderWithHeader(dword byteIndex, dword bitIndex, long


disturbingFrameId);

Function Configures the LIN hardware to disturb the next header with a new header
(id=<disturbanceHeaderID>).

Parameters byteIndex

Starts disturbance in byte with index <byteIndex>.

0: Sync Byte
1: ProtectedId Byte

bitIndex

Starts disturbance at bit position <bitIndex>.


An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

disturbanceHeaderID

Frame ID to be used for the header disturbance.

Info

This is not the ID of the header to be disturbed, but the ID of the header
disturbance itself.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

| linDisturbRespWithHeader | linDisturbHeaderWithBitStream | linDisturbRespWithBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbHeaderWithVariableBitStream

linDisturbHeaderWithVariableBitStream
CAPL Function Overview » LIN » linDisturbHeaderWithVariableBitStream

Syntax dword linDisturbHeaderWithVariableBitStream(dword byteIndex, dword


bitIndex, byte dataBuffer[], int64 lengthInNS[], dword numberOfBits, dword
roundUp, dword timeoutPrevention);

Function Configures the LIN hardware to disturb the next header with a variable bit stream.

Parameters byteIndex

Start disturbance in byte with index <byteIndex>.

0: Sync Byte

1: ProtectedId Byte

bitIndex

The index of the bit where the interrupting bit stream will start.
An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

bitStream

The bit stream to be used for the interruption.

Maximum number of bits: 2^31-1.

lengthInNS

The length of each bit in nanoseconds.

numberOfBits

The number of bits in the bitStream-array. Note that while the dataBuffer-array will
usually have a size of ceil (numberOfBits / 8), the size of lengthInNS will need to be at
least numberOfBits.

roundup

If true, the lengths specified in lengthInNS will be rounded up to the next possible length
that can be transmitted by the LIN hardware, otherwise the lengths will be rounded
down.

timeoutPrevention

0: deactivates the timeout prevention for the 7259- or 7269-transceiver.


1: activates the timeout prevention for the 7259- or 7269-transceiver.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbHeaderWithVariableBitStream

• Real bus mode

Example

| linDisturbHeaderWithHeader | linDisturbRespWithHeader | linDisturbHeaderWithBitStream | linDisturbRespWithBitStream |


linDisturbRespWithVariableBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbRespWithBitStream

linDisturbRespWithBitStream
CAPL Function Overview » LIN » linDisturbRespWithBitStream

Syntax dword linDisturbRespWithBitStream(long disturbedFrameId, dword byteIndex,


dword bitIndex, byte bitStream[], dword numberOfBits, dword
timeoutPrevention);

Function Configures the LIN hardware to disturb the specified response with a bit stream.

Parameters disturbedFrameID

ID of the bus event to be disturbed.

Value range: 0..63

byteIndex

The index of the byte to be disturbed (use 0 for the first byte).
If the index is equal to the frame’s length, then the checksum byte will be disturbed. An
index larger than the frame length is invalid.

Value range: 0..N, where N is frame length

bitIndex

The index of the bit where the interrupting bit stream will start.
An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

bitStream

The bit stream to be used for the interruption.

Maximum number of bits: 2^31-1.

numberOfBits

The number of bits in the bitStream-array.

timeoutPrevention

0: deactivates the timeout prevention for the 7259- or 7269-transceiver.


1: activates the timeout prevention for the 7259- or 7269-transceiver.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbRespWithBitStream

| linDisturbHeaderWithHeader | linDisturbRespWithHeader | linDisturbHeaderWithBitStream |


linDisturbHeaderWithVariableBitStream | linDisturbRespWithVariableBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbRespWithHeader

linDisturbRespWithHeader
CAPL Function Overview » LIN » linDisturbRespWithHeader

Syntax dword linDisturbRespWithHeader(long disturbedFrameId, dword byteIndex,


dword bitIndex, long disturbingFrameId);

Function Configures the LIN hardware to disturb the specified response with a new header
(id=<disturbanceHeaderID>).

Parameters disturbedFrameID

ID of the bus event to be disturbed.

Value range: 0..63

byteIndex

The index of the byte to be disturbed (use 0 for the first byte).
If the index is equal to the frame’s length, then the checksum byte will be disturbed. An
index larger than the frame length is invalid.

Value range: 0..N, where N is frame length

bitIndex

The index of the bit where the interrupting header will start.
An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

disturbingFrameId

The identifier of the header that will interrupt the specified header byte.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

| linDisturbHeaderWithHeader | linDisturbHeaderWithBitStream | linDisturbRespWithBitStream |


linDisturbHeaderWithVariableBitStream | linDisturbRespWithVariableBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbRespWithVariableBitStream

linDisturbRespWithVariableBitStream
CAPL Function Overview » LIN » linDisturbRespWithVariableBitStream

Syntax dword linDisturbRespWithVariableBitStream(long disturbedFrameId, dword


byteIndex, dword bitIndex, byte bitStream[], dword numberOfBits, dword
timeoutPrevention);

Function Configures the LIN hardware to disturb the specified response with a variable bit stream.

Parameters disturbedFrameID

ID of the bus event to be disturbed.

Value range: 0..63

byteIndex

The index of the byte to be disturbed (use 0 for the first byte).
If the index is equal to the frame’s length, then the checksum byte will be disturbed. An
index larger than the frame length is invalid.

Value range: 0..N, where N is frame length

bitIndex

The index of the bit where the interrupting bit stream will start.
An index in the range 0-7 specifies a data bit, while the index 8 specifies the stop bit.
Higher index values specify the interbyte-space after the indexed data byte. In which
case, the user should make sure that the interbyte space is large enough.

Value range: 0..255

bitStream

The bit stream to be used for the interruption.

Maximum number of bits: 2^31-1.

lengthInNS

The length of each bit in nanoseconds.

umberOfBits

The number of bits in the bitStream-array. Note that while the dataBuffer-array will
usually have a size of ceil (numberOfBits / 8), the size of lengthInNS will need to be at
least numberOfBits.

roundup

If true, the lengths specified in lengthInNS will be rounded up to the next possible length
that can be transmitted by the LIN hardware, otherwise the lengths will be rounded
down.

timeoutPrevention

0: deactivates the timeout prevention for the 7259- or 7269-transceiver.


1: activates the timeout prevention for the 7259- or 7269-transceiver.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDisturbRespWithVariableBitStream

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

| linDisturbHeaderWithHeader | linDisturbRespWithHeader | linDisturbHeaderWithBitStream | linDisturbRespWithBitStream |


linDisturbHeaderWithVariableBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linETFSendOnSignalUpdate

linETFSendOnSignalUpdate
CAPL Function Overview » LIN » linETFSendOnSignalUpdate

Syntax long linETFSendOnSignalUpdate(long etfId, long active)

Function With this function it is possible to activate/deactivate the automatic responses on a


certain event-triggered frame request in the case of a signal update on its associated
frame(s). This concerns all Slave tasks publishing the responses to the specified event-
triggered frame.

Parameters etfId

Identifier of event-triggered frame.

Value range: 0-59

active

1: Activate
0: Deactivate

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

| linActivateCollisionResolution | linETFSetDirtyFlag |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linETFSetDirtyFlag

linETFSetDirtyFlag
CAPL Function Overview » LIN » linETFSetDirtyFlag

Syntax long linETFSetDirtyFlag(long assocId, long dirty)

Function With this function it is possible to set/clear the dirty flag of an associated frame. If the
dirty flag of an associated frame is set when the corresponding event-triggered frame is
being requested, then the LIN hardware will try to transmit the associated frame's data.
The dirty flag gets reset automatically when the associated frame has been sent
successfully – either via the event-triggered frame or unconditionally.

Parameters assocId

Identifier of unconditional frame

LIN frame identifier of associated (unconditional) frame whose dirty flag should be set or
cleared.

Value range: 0 .. 63

dirty

1: Set the dirty flag.


0: Clear the dirty flag.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

| linActivateCollisionResolution | linETFSendOnSignalUpdate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetBusIdleTimeout

linGetBusIdleTimeout
CAPL Function Overview » LIN » linGetBusIdleTimeout

Syntax dword linGetBusIdleTimeout()

Function This function returns the currently set bus idle timeout. Depending on the protocol
version, the timeout will be specified in bit times (LIN 1.x and Cooling) or in milliseconds
(all others).

Parameters —

Return values On success, returns the bus idle timeout, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 LIN — •

Example

| linSetBusIdleTimeout |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetByteEndTime

linGetByteEndTime
CAPL Function Overview » LIN » linGetByteEndTime

Syntax dword linGetByteEndTime(linMessage busEvent, long index)

dword linGetByteEndTime(linCSError busEvent, long index)

dword linGetByteEndTime(linReceiveError busEvent, long index)

Function This function can be used to retrieve a data byte timestamp of a certain LIN bus event.
The resulting timestamp is a time elapsed since measurement start [in units of 10 µsec].

Info

The time returned by this function corresponds to the end of the data byte
field as detected by an UART. For the XL-hardware, this includes 9/16 of the
stop bit. To calculate the theoretical end of data byte field including the stop
bit, 7/16 of a bit time should be added. Similarly to calculate the start of the
data byte field, 9 and 9/16 bit times should be subtracted.

Parameters busEvent

LIN bus event of type frame, checksum error or receive error.

index

Data byte index.

Value range: 1..N, where N = data bytes count of the current bus event

Return values Returns the retrieved timestamp [in units of 10 µsec] or 0 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Retrieve timestamps of each data byte on analyzing a receive error event


on linReceiveError
{
long byteIndex;
dword byteTimestamp;
if (0 == this.lin_ShortError) // .DLC selector only valid when
.lin_ShortError is not set
{
for (byteIndex=1; byteIndex <= this.DLC; ++byteIndex)
{
byteTimestamp = linGetByteEndTime(this, byteIndex);
...
}
}
}

| linGetStartOfFrame | linGetEndOfHeader |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetChecksum

linGetChecksum
CAPL Function Overview » LIN » linGetChecksum

Syntax byte linGetChecksum(linMessage linFrame)

byte linGetChecksum(linCSError linCsError)

Function Returns the checksum of a LIN frame or LIN checksum error.

Checksum model (classic/enhanced) is determined automatically.

Context Master or Slave node

Parameters linFrame

LIN message object

linCsError

LIN checksum error object

Return values Calculated checksum

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN • •

Example

Get the checksum of a received LIN frame with name myframe


on linMessage myframe
{
byte checksum;
checksum = linGetChecksum(this);
}
or
// Calculate the checksum of a LIN frame object
...
byte checksum;
// create a LIN frame object
linmessage 0x1 myLinFrame = { dlc = 1, byte(0) = 1 };
// calculate its checksum
checksum = linGetChecksum(myLinFrame);

| linSetChecksumError | linSetManualChecksum |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetDlc

linGetDlc
CAPL Function Overview » LIN » linGetDlc

Syntax long linGetDlc(long frameID)

Function Queries the Data Length Code (i.e. length in bytes) of a LIN frame.

Per default the DLC of LIN frames is initialized according to the LIN Description File (LDF).

If no LDF is used, this function returns the DLC initialized in on preStart e.g. using
linSetDlc, for LIN frames sent by simulated LIN nodes.

For LIN frames whose DLC has not been initialized, this function will return the default
DLC for the selected ID as defined in the LIN1.1 protocol specification.

For LIN frames sent by external LIN nodes, the measured DLC is returned.

Context Master or Slave node (in on preStart only)

Parameters frameID

LIN frame identifier in the range 0 .. 63.

Return values If successful the frame length [in bytes] or -1 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 LIN — •

Example

Verify correct DLC is used by a certain frame


...
if ( linGetDLC(0x22) != 5)
{
linChangeDLC(0x22, 5); // set DLC of frame with identifier 0x22 to be 5
}

| linChangeDlc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetDominantTimeout

linGetDominantTimeout
CAPL Function Overview » LIN » linGetDominantTimeout

Syntax int64 linGetDominantTimeout();

Function Returns the dominant timeout of the current channel’s transceiver in nanoseconds. If
zero, the transceiver does not have any dominant timeout.

Parameters —

Return values Returns the dominant timeout of the LINcab/LINpiggy or zero, if the transceiver does not
have any dominant timeout.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 • LIN — •
• Real bus mode

Example

| linSetGlobalTimeoutPrevention |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetEndOfHeader

linGetEndOfHeader
CAPL Function Overview » LIN » linGetEndOfHeader

Syntax dword linGetEndOfHeader(linMessage busEvent)

dword linGetEndOfHeader(linCSError busEvent)

dword linGetEndOfHeader(linReceiveError busEvent)

Function This function can be used to retrieve a timestamp of the header part for a certain LIN bus
event. The resulting timestamp is a time elapsed since measurement start [in units of 10
µsec].

Info

The time returned by this function corresponds to the end of the Protected ID
field as detected by an UART. For the XL-hardware, this includes 9/16 of the
stop bit. To calculate the theoretical end of Protected ID field including the
stop bit, 7/16 of a bit time should be added. Similarly to calculate the start
of the Protected ID field, 9 and 9/16 bit times should be subtracted.

Parameters busEvent

LIN bus event of type frame, checksum error or receive error.

Return values Returns the retrieved timestamp [in units of 10 µsec] or 0 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Retrieve time stamps of header (ID byte) on analyzing a receive error event
on linReceiveError
{
long byteIndex;
dword endHeaderTime;
endHeaderTime = linGetEndOfHeader(this);
...
}

| linGetStartOfFrame | linGetByteEndTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetFallingEdgesOfDisturbedByte

linGetFallingEdgesOfDisturbedByte
CAPL Function Overview » LIN » linGetFallingEdgesOfDisturbedByte

Syntax dword linGetFallingEdgesOfDisturbedByte(int64 fallingEdges[])

Function With this function it is possible to retrieve timestamps of all falling edges in the disturbed
byte or in the pseudo-byte caused by the last bit inversion.

Note, that prior to calling this function the measurement of the falling edges has to be
activated and the bit inversion has to be executed (see linInvertRespBit,
linInvertHeaderBit)

Parameters fallingEdges

An array which will receive the measured timestamps [in nanoseconds].


The array size is 6. Unused timestamps will be set to 0 (i.e. in case of less than 6 falling
edges).

Return values On successful request returns 1, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 SP4 • LIN — •


• Real bus mode

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetHWReceiveAccuracy

linGetHWReceiveAccuracy
CAPL Function Overview » LIN » linGetHWReceiveAccuracy

Syntax dword linGetHWReceiveAccuracy()

Function This function can be used to query the receive resolution of the LIN hardware in units of 1
Hz.

Parameters —

Return values Returns the receive resolution of the LIN hardware.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 • LIN — •


• Real bus mode

Example
on key 't'
{
write("Transmit accuracy = %d", linGetHWTransmitAccuracy());
write("Receive accuracy = %d", linGetHWReceiveAccuracy());
}

| linGetHWTransmitAccuracy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetHWTransmitAccuracy

linGetHWTransmitAccuracy
CAPL Function Overview » LIN » linGetHWTransmitAccuracy

Syntax dword linGetHWTransmitAccuracy()

Function This function can be used to query the transmit resolution of the LIN hardware in units of
1 Hz.

Parameters —

Return values Returns the transmit resolution of the LIN hardware.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 • LIN — •


• Real bus mode

Example
on key 't'
{
write("Transmit accuracy = %d", linGetHWTransmitAccuracy());
write("Receive accuracy = %d", linGetHWReceiveAccuracy());
}

| linGetHWReceiveAccuracy |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetMeasBaudrate

linGetMeasBaudrate
CAPL Function Overview » LIN » linGetMeasBaudrate

Syntax float linGetMeasBaudrate()

Function With this function it is possible to retrieve results of a last baud rate measurement, which
is done by calling linMeasHeaderBaudrate() or linMeasRespBaudrate() functions.

Parameters —

Return values Returns the last measured baud rate [in bit/sec] or -1 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example

Test case for measuring baud rate using LIN header event.
testcase tcMeasureHeaderBaudrate ()
{
long waitResult, measBaudrate;
// set request to measure baudrate according to Synch field of a LIN header
linMeasHeaderBaudrate(0);
// wait maximum 1000 [ms] for LIN header with identifier 0x33
waitResult = TestWaitForLinHeader(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult)
{
TestStepFail("Test 1.1","No LIN header with ID=0x33 occurred during 1000
ms!");
}
// retrieve measured baudrate
measBaudrate = linGetMeasBaudrate();
if (-1 == measBaudrate)
{
TestStepFail("Test 1.1", "Failed to measure header baudrate!");
}
TestStepPass("Test 1.1", "Header baudrate measurement done...");

Info

These test cases can only be used in the context of test module nodes.

Example

Test case for measuring baud rate using certain data byte of a LIN frame.
testcase tcMeasureDatabyteBaudrate (int byteIndex)
{
long waitResult, measBaudrate;
// set request to measure baudrate using the specified byte of a frame with
ID=0x33
linMeasRespBaudrate(0x33, byteIndex);
// wait maximum 1000 [ms] for a frame with ID=0x33
waitResult = TestWaitForMessage(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult) {
TestStepFail("Test 1.1","Expected frame has not occurred during 1000 ms!");
}
// retrieve measured baudrate
measBaudrate = linGetMeasBaudrate();
if (-1 == measBaudrate)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetMeasBaudrate

{
TestStepFail("Test 1.1", "Failed to measure response baudrate!");
}
TestStepPass("Test 1.1", "Response baudrate measurement done...");
}

Info

These test cases can only be used in the context of test module nodes.

| linMeasHeaderBaudrate | linMeasRespBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetMeasEdgeTimeDiffs

linGetMeasEdgeTimeDiffs
CAPL Function Overview » LIN » linGetMeasEdgeTimeDiffs

Syntax dword linGetMeasEdgeTimeDiffs(dword arrSize, float timeDiffs[]);

Function This function retrieves the time differences between edges measured with
linMeasEdgeTimeDiffs(). Note that for each byte measured four time differences will
be returned, although all of them might be 0 (if there had been only one falling edge in
the measured byte). This means that time differences 0 to 3 contain the values for the
first measured byte, time differences 4 to 7 contain the values for the second measured
byte, etc.

Parameters arrSize

The size of the timeDiffs array.

timeDiffs

The array which will receive the measured time differences.

Return values Returns the number of time differences copied into the timeDiffs-array.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.1 • LIN — •
• Real bus mode

Example

See example for linMeasEdgeTimeDiffs.

| LinMeasEdgeTimeDiffs |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetOEMDataInd

linGetOEMDataInd
CAPL Function Overview » LIN » linGetOEMDataInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linGetOEMDataInd()

long linGetOEMDataInd(char slaveName[])

Function With this function it's possible to query the data indication bit of a Slave node.

Without parameter, the data indication bit of the calling slave node is returned or zero if
the caller is not a slave node.

Parameters slaveName

Name of the queried Slave node as specified in the database.

Return values Returns non-zero if the queried data indication bit is set, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMDataInd | linSetOEMDataInd | linSetOEMDataIndTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetOEMSleepInd

linGetOEMSleepInd
CAPL Function Overview » LIN » linGetOEMSleepInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linGetOEMSleepInd()

long linGetOEMSleepInd(char slaveName[])

Function With this function it's possible to query the sleep indication bit of a Slave node.

Without parameter, the sleep indication bit of the calling slave is returned or zero if the
caller is not a slave.

Parameters slaveName

Name of the queried Slave node as specified in the database.

Return values Returns non-zero if the queried sleep indication bit is set, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMSleepInd | linSetOEMSleepInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetOEMWakeupInd

linGetOEMWakeupInd
CAPL Function Overview » LIN » linGetOEMWakeupInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linGetOEMWakeupInd()

long linGetOEMWakeupInd(char slaveName[])

Function With this function it's possible to query the wakeup indication bit of a Slave node.

Without parameter, the wakeup indication bit of the calling slave is returned or zero if
the caller is not a slave node.

Parameters slaveName

Name of the queried Slave node as specified in the database.

Return values Returns non-zero if the queried wakeup indication bit is set, zero otherwise.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMWakeupInd | linSetOEMWakeupInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetProtectedID

linGetProtectedID
CAPL Function Overview » LIN » linGetProtectedID

Syntax dword linGetProtectedID (long frameID)

Function With this function it is possible to calculate protected ID for the corresponding LIN frame
identifier (i.e. the frame identifier with parity bits).

Parameters frameID

LIN frame identifier whose protected ID will be calculated.

Value range: 0 .. 63

Return values Returns the calculated protected identifier or -1 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Display in Write window a protected ID for each LIN frame seen on the bus
on linMessage *
{
dword pid;
pid = linGetProtectedID(this.ID);
writeLineEx(0,0, "Protected ID for LIN frame identifier 0x%x is 0x%x",
this.ID, pid);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetRespError

linGetRespError
CAPL Function Overview » LIN » linGetRespError

Syntax long linGetRespError()

long linGetRespError(long NAD)

Function With this function it’s possible to query the response error flag of the calling Slave node
or of the Slave node specified by its node address (NAD) as last seen on the LIN bus.

Parameters NAD

Configured node address of the Slave node to be queried.

Return values Returns one if the queried response_error flag is set, zero if it is not set and -1 if it has
not been sent yet.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN — •

Example

| linCheckRespError | linSetRespError | linActivateGlobalNetworkManagement | linActivateSlaveNetworkManagement |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetResponseData

linGetResponseData
CAPL Function Overview » LIN » linGetResponseData

Syntax dword LinGetResponseData(linmessage frameObject)

Function Queries LIN frame response data for specified FrameId on certain LIN channel.

The FrameId and desired LIN channel number are expected to be set in the linmessage
prior to calling this function.

The frame length, dataybte and checksum byte values will be copied into corresponding
fields of linmessage object.

Note, that in the case there is no response data for the specified FrameId no data is
copied.

Context Any

Parameters frameObject

The data structure to be filled in. Note, that the following selectors have to be set prior
to calling this function:

• ID
• MsgChannel

Return values Non-zero on success.


Zero on failure or when there is no response data defined.

The non-zero value in real mode is the initial and in simulated mode the actual response
counter value.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP2 LIN — •

Example
on key 'a'
{
linmessage 0x1 testMsg;
testMsg.MsgChannel = 1;
testMsg.ID = 0;
if (LINGetResponseData(testMsg) > 0)
{
writelineex(1,1,"FrameId=%d Length=%d, 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X
0x%X 0x%X;", testMsg.ID, testMsg.DLC,
testMsg.byte(0), testMsg.byte(1), testMsg.byte(1), testMsg.byte(3),
testMsg.byte(4), testMsg.byte(5), testMsg.byte(6), testMsg.byte(7));
}
}

| linSetRespCounter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetStartOfFrame

linGetStartOfFrame
CAPL Function Overview » LIN » linGetStartOfFrame

Syntax dword linGetStartOfFrame(linMessage busEvent)

dword linGetStartOfFrame(linCSError busEvent)

dword linGetStartOfFrame(linReceiveError busEvent)

dword linGetStartOfFrame(linTransmError busEvent)

dword linGetStartOfFrame(linSyncError busEvent)

dword linGetStartOfFrame(linWakeupFrame busEvent)

Function This function can be used to retrieve a start timestamp of a LIN bus event. The resulting
timestamp is a time elapsed since the measurement start [in units of 10 µsec].

Parameters busEvent

LIN bus event of type frame, checksum error, receive error, transmission error,
synchronization error or wakeup signal.

Return values Returns the retrieved timestamp [in units of 10 µsec] or 0 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Calculate header length [in bit times] for each received LIN frame
on linMessage *
{
dword startOfFrame, endOfHeader, headerLength;
if (this.dir != RX)
{
return; // ignore transmitted frames
}
startOfFrame = linGetStartOfFrame(this); // retrieve frame start time
endOfHeader = linGetEndOfHeader(this); // retrieve header end time
headerLength = linTime2Bits(endOfHeader - startOfFrame); // calculate
header length in bit times
// display the result in Write window
writeLineEx(0,0, "Header length for LIN frame with identifier 0x%x is %d
bit times", this.ID, headerLength);
}

| linGetEndOfHeader | linGetByteEndTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetSyncBreakLength

linGetSyncBreakLength
CAPL Function Overview » LIN » linGetSyncBreakLength

Syntax dword linGetSyncBreakLength(linMessage busEvent)

dword linGetSyncBreakLength(linCSError busEvent)

dword linGetSyncBreakLength(linReceiveError busEvent)

dword linGetSyncBreakLength(linTransmError busEvent)

dword linGetSyncBreakLength(linSyncError busEvent)

Function This function can be used to retrieve the sync break (dominant bits) length of a LIN bus
event. The resulting length is in units of 10 µsec (microseconds). To get the result in bit
times linTime2Bits() function can be used.

Parameters busEvent

LIN bus event of type frame, checksum error, receive error, transmission error,
synchronization error or wakeup signal.

Return values Returns the retrieved length [in units of 10 µsec] or 0 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Analyze receive error event by retrieving length of sync break and sync delimiter
on linReceiveError
{
dword timelenBreak,timelenDel;
dword bitlenBreak,bitlenDel;
timelenBreak = linGetSyncBreakLength(this); // retrieve break length in
time units
bitlenBreak = linTime2Bits(timelenBreak); // convert time units to bit
times
timelenDel = linGetSyncDelLength(this); // retrieve delimiter length in
time units
bitlenDel = linTime2Bits(timelenDel); // convert time units to bit
times
...
}

| linGetSyncDelLength | linSetBreakLength | linTime2Bits |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetSyncDelLength

linGetSyncDelLength
CAPL Function Overview » LIN » linGetSyncDelLength

Syntax dword linGetSyncDelLength(linMessage busEvent)

dword linGetSyncDelLength(linCSError busEvent)

dword linGetSyncDelLength(linReceiveError busEvent)

dword linGetSyncDelLength(linTransmError busEvent)

dword linGetSyncDelLength(linSyncError busEvent)

Function This function can be used to retrieve the synch delimiter (recessive bits) length of a LIN
bus event. The resulting length is in units of 10 µsec (microseconds).To get the result in
bit times linTime2Bits() function can be used.

Parameters busEvent

LIN bus event of type frame, checksum error, receive error, transmission error,
synchronization error or wakeup signal.

Return values Returns the retrieved length [in units of 10 µsec] or 0 on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN • •

Example

Analyze receive error event by retrieving length of synch break and sync delimiter
on linReceiveError
{
dword timelenBreak,timelenDel;
dword bitlenBreak,bitlenDel;
timelenBreak = linGetSyncBreakLength(this); // retrieve break length in
time units
bitlenBreak = linTime2Bits(timelenBreak); // convert time units to bit
times
timelenDel = linGetSyncDelLength(this); // retrieve delimiter length in
time units
bitlenDel = linTime2Bits(timelenDel); // convert time units to bit
times
...
}

| linGetSyncBreakLength | linSetBreakLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linGetWakeupLength

linGetWakeupLength
CAPL Function Overview » LIN » linGetWakeupLength

Syntax int linGetWakeupLength (linWakeupFrame wakeupFrame)

Function With this function it is possible to retrieve a length of an occurred Wakeup-Frame.

Parameters wakeupFrame

Bus-event of type LIN Wakeup-Frame.

Return values Returns the retrieved length [in units of 10 µsec] or zero on failure.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN • •

Example

Query the length of the wakeup frames


on linWakeupFrame
{
write("Wake-up frame length: %d µs", linGetWakeupLength(this)*10);
}

| linSendWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertHeaderBit

linInvertHeaderBit
CAPL Function Overview » LIN » linInvertHeaderBit

Syntax dword linInvertHeaderBit(dword byteIndex, dword bitIndex) // form 1

dword linInvertHeaderBit(dword byteIndex, dword bitIndex, dword level) //


form 2

dword linInvertHeaderBit(dword byteIndex, dword bitIndex, dword level,


dword numberOfExecutions) // form 3

dword linInvertHeaderBit(dword byteIndex, dword bitIndex, dword level,


dword numberOfExecutions, dword reportFallingEdges) // form 4

dword linInvertHeaderBit(dword byteIndex, dword bitIndex, dword level,


dword numberOfExecutions, dword reportFallingEdges, long
disturbAfterHeaderID, dword waitForHeaders) // form 5

Function Inverts the specified bit in the next LIN header.

Parameters byteIndex

Index of the byte.

0: Sync Byte
1: ProtectedId Byte

bitIndex

The index of the bit to be manipulated. An index in the range 0-7 will manipulate a data
bit, while the index 8 will manipulate the stop bit. Higher index values will cause the
interbyte-space after the data byte to be manipulated. In this case, the user should make
sure that the interbyte-space is large enough.

Value range: 0..255

level

Level of the disturbance

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

Info

The default level used for the first type of the function is 0!

numberOfExecutions

The number of consecutive headers in which the bit inversion will be executed.

Default: 1 (single shot).

reportFallingEdges

Flag indicating whether timestamps of the falling edges in the resulting pseudo-byte have
to be reported. The timestamps can be retrieved by calling
linGetFallingEdgesOfDisturbedByte.

0: Deactivate report
1: Activate report

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertHeaderBit

disturbAfterHeaderID

With this parameter and the next one it is possible to define exactly which header will be
disturbed. The LIN hardware will first wait for a header with ID = disturbAfterHeaderID
before additionally awaiting the number of headers defined by waitForHeaders. The next
header following these headers will then be disturbed.

For example: To disturb the next header directly after a header with the ID=5, set the
disturbAfterHeaderID parameter to 5 and the waitForHeaders to 0.

waitForHeaders

See explanation for disturbAfterHeaderID.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.1: form 4 LIN — •

7.5: form 5 LIN — •

Example
on key 'i'
{
if (0!=linInvertHeaderBit(0, 0, 0))
{
// for the next LIN header invert first bit (it’s the recessive one) of the
Sync byte
}
}

| linInvertRespBit | linDeactivateBitInversion |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertHeaderBitEx

linInvertHeaderBitEx
CAPL Function Overview » LIN » linInvertHeaderBitEx

Syntax dword linInvertHeaderBitEx(dword byteIndex, dword bitIndex, dword


bitOffsetInSixteenthBits, dword distLengthInSixteenthBits, dword level)

dword linInvertHeaderBitEx(dword byteIndex, dword bitIndex, dword


bitOffsetInSixteenthBits, dword distLengthInSixteenthBits, dword level,
dword numberOfExecutions, dword reportFallingEdges)

dword linInvertHeaderBitEx(dword byteIndex, dword bitIndex, dword


bitOffsetInSixteenthBits, dword distLengthInSixteenthBits, dword level,
dword numberOfExecutions, dword reportFallingEdges, long
disturbAfterHeaderID, dword waitForHeaders)

Function Inverts the specified number of 1/16th bits at the specified position in the next LIN
header.

Parameters byteIndex

Index of the byte.

0: Sync Byte
1: ProtectedId Byte

bitIndex

The index of the bit to be manipulated. An index in the range 0-7 will manipulate a data
bit, while the index 8 will manipulate the stop bit. Higher index values will cause the
interbyte-space after the data byte to be manipulated. In this case, the user should make
sure that the interbyte-space is large enough.

Value range: 0..255

bitOffsetInSixteenthBits

The offset in 1/16th bits into the bit specified in bitIndex.

Value range: 0..15

distLengthInSixteenthBits

The length of the disturbance in units of 1/16th bit.

Value range: 0..65535

Level

Level of the disturbance.

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

numberOfExecutions

The number of consecutive headers in which the bit inversion will be executed. The
default is 1 (single shot).

reportFallingEdges

Flag indicating whether timestamps of the falling edges in the resulting pseudo-byte have
to be reported. The timestamps can be retrieved by calling

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertHeaderBitEx

linGetFallingEdgesOfDisturbedByte.

0: Deactivate report

disturbAfterHeaderID

With this parameter and the next one it is possible to define exactly which header will be
disturbed. The LIN hardware will first wait for a header with ID = disturbAfterHeaderID
before additionally awaiting the number of headers defined by waitForHeaders. The next
header following these headers will then be disturbed.

For example: To disturb the next header directly after a header with the ID=5, set the
disturbAfterHeaderID parameter to 5 and the waitForHeaders to 0.

waitForHeaders

See explanation for disturbAfterHeaderID.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP2 • LIN — •


• Real bus mode

7.5: form 3 • LIN — •


• Real bus mode

Example
on key 'i'
{
if (0!=linInvertHeaderBitEx(0, 0, 8, 8, 0))
{
// for the next LIN header invert the second half of the first bit (it’s
the recessive one) of the Sync byte
}
}

| linInvertRespBitEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertMultipleHeaderBits

linInvertMultipleHeaderBits
CAPL Function Overview » LIN » linInvertMultipleHeaderBits

Syntax dword linInvertMultipleHeaderBits(dword byteIndices[],dword


bitIndices[],dword numberOfDisturbedBits[],dword levels[],dword arrSize)

dword linInvertMultipleHeaderBits(dword byteIndices[],dword


bitIndices[],dword numberOfDisturbedBits[],dword levels[],dword arrSize,
dword numberOfExecutions)

dword linInvertMultipleHeaderBits(dword byteIndices[],dword


bitIndices[],dword numberOfDisturbedBits[],dword levels[],dword arrSize,
dword numberOfExecutions, long disturbAfterHeaderID, dword waitForHeaders)

Function Inverts the multiple bits in specified locations in the next LIN header.

Info

Some driver versions only support inverting multiple (consecutive) bits in one
position (arrSize == 1).

Parameters byteIndices

An array of the index of the bytes.

0: Sync Byte
1: ProtectedId Byte

bitIndices

An array of the indices of the bits to be manipulated. Indices in the range 0-7 will
manipulate a data bit, while the index 8 will manipulate the stop bit. Higher index values
will cause the interbyte-space after the data byte to be manipulated. In this case, the
user should make sure that the interbyte-space is large enough.

Value range: 0..255

numberOfDisturbedBits

An array specifying how many consecutive bits shall be inverted at the specified locations.

level

An array of the levels of the disturbance

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

arrSize

The number of elements in the above arrays. This value should not be greater than the
size of the smallest array.

numberOfExecutions

The number of consecutive headers in which the bit inversions will be executed.

Default: 1 (single shot).

disturbAfterHeaderID

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertMultipleHeaderBits

With this parameter and the next one it is possible to define exactly which header will be
disturbed. The LIN hardware will first wait for a header with ID = disturbAfterHeaderID
before additionally awaiting the number of headers defined by waitForHeaders. The next
header following these headers will then be disturbed.

For example: To disturb the next header directly after a header with the ID=5, set the
<disturbAfterHeaderID> parameter to 5 and the <waitForHeaders> to 0.

waitForHeaders

See explanation for disturbAfterHeaderID.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.1 • LIN — •
• Real bus mode

7.5: form 3 • LIN — •


• Real bus mode

Example
on key 'i'
{
dword byteIndices[2] = { 0, 1}; // invert in sync field and in id-byte
dword bitIndices[2] = { 0, 0 }; // invert the first data bits in each
byte
dword numberOfDisturbedBits[2] = { 1, 2 }; // invert 1 bit in sync
field, 2 bits in id-byte
,dword levels[2] = { 0, 1 }; // push sync field bit to dominant, id-byte
bits to recessive
if (0!=linInvertMultipleHeaderBits(byteIndices, bitIndices,
numberOfDisturbedBits, levels, 2))
{
}
}

| linInvertHeaderBit | linInvertRespBit | linDeactivateBitInversion |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertMultipleRespBits

linInvertMultipleRespBits
CAPL Function Overview » LIN » linInvertMultipleRespBits

Syntax dword linInvertMultipleRespBit(long frameID, dword byteIndices[],dword


bitIndices[],dword numberOfDisturbedBits[], dword levels[], dword arrSize)

dword linInvertMultipleRespBit(long frameID, dword byteIndices[],dword


bitIndices[],dword numberOfDisturbedBits[], dword levels[], dword arrSize,
dword numberOfExecutions)

Function Inverts the multiple bits in specified locations in the next LIN header.

Info

Some driver versions only support inverting multiple (consecutive) bits in one
position (arrSize == 1).

Parameters frameID

ID of the bus event to be manipulated.

Value range: 0..63

byteIndices

An array of the indices of the bytes to be manipulated (use 0 for the first byte). If an
index is equal to the frame’s length, then the checksum byte will be manipulated. An
index larger than the frame length is invalid.

Value range: 0..N, where N is frame length

bitIndices

An array of the indices of the bits to be manipulated. An index in the range 0-7 will
manipulate a data bit, while the index 8 will manipulate the stop bit. Higher index values
will cause the interbyte-space after the data byte to be manipulated. In this case, the
user should make sure that the interbyte-space is large enough.

Value range: 0..255

numberOfDisturbedBits

An array specifying how many consecutive bits shall be inverted at the specified
locations.

levels

An array of the levels of the disturbance

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

arrSize

The number of elements in the above arrays. This value should not be greater than the
size of the smallest array.

numberOfExecutions

The number of consecutive frames with the specified identifier in which the bit inversions

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertMultipleRespBits

will be executed.

Default: 1 (single shot).

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.1 • LIN — •
• Real bus mode

Example
// Invert response bits on keyboard event
on key 'i'
{
dword byteIndices[2] = { 1, 5 };
dword bitIndices[2] = { 0, 1 };
dword numberOfDisturbedBits[2] = { 1, 2 };
dword levels[2] = { 0, 1 };
...
// Invert first bit 0 of byte 1 to dominant and bits 1 and 2
// (numberOfDisturbedBits[1] is 2) of byte 5 to recessive
linInvertMultipleRespBits(0x33, byteIndices, bitIndices,
numberOfDisturbedBits, levels, 2);
...
}

| linInvertMultipleHeaderBits | linInvertHeaderBit | linInvertRespBit | linDeactivateBitInversion |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertRespBit

linInvertRespBit
CAPL Function Overview » LIN » linInvertRespBit

Syntax dword linInvertRespBit (long frameID, dword byteIndex, dword bitIndex)

dword linInvertRespBit (long frameID, dword byteIndex, dword bitIndex,


dword level)

word linInvertRespBit (long frameID, dword byteIndex, dword bitIndex, dword


level, dword numberOfExecutions)

dword linInvertRespBit (long frameID, dword byteIndex, dword bitIndex,


dword level, dword numberOfExecutions, dword reportFallingEdges)

Function This function inverts the specified bit when the next bus event for the specified ID occurs,
provided that the bus event contains the specified data byte.

Parameters frameID

ID of the bus event to be manipulated.

Value range: 0..63

byteIndex

The index of the byte to be manipulated (use 0 for the first byte). If the index is equal to
the frame’s length, then the checksum byte will be manipulated. An index larger than the
frame length is invalid.

Value range: 0..N, where N is frame length

bitIndex

The index of the bit to be manipulated. An index in the range 0-7 will manipulate a data
bit, while the index 8 will manipulate the stop bit. Higher index values will cause the
interbyte-space after the data byte to be manipulated. In this case, the user should make
sure that the interbyte-space is large enough.

Value range: 0..255

level

Level of the disturbance

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

numberOfExecutions

The number of consecutive frames with the specified identifier in which the bit inversion
will be executed.

Default: 1 (single shot).

eportFallingEdges

Flag indicating whether timestamps of the falling edges in the resulting pseudo-byte have
to be reported. The timestamps can be retrieved by calling
linGetFallingEdgesOfDisturbedByte.

0: Deactivate report

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertRespBit

1: Activate report

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

7.1: form 4 • LIN — •


• Real bus mode

Example

Invert response bits on keyboard event


on key 'i'
{
...
// Invert first bit of byte field 8 for LIN frame with ID=0x33
linInvertRespBit(0x33, 7, 0);
...
// Invert bit 7 of checksum byte field for LIN frame with ID=0x33
linInvertRespBit(0x33, 8, 6);
...
// Invert stop bit of byte field 8 for LIN frame with ID=0x33
linInvertRespBit(0x33, 7, 8);
...
}

| linInvertHeaderBit | linDeactivateBitInversion |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertRespBitEx

linInvertRespBitEx
CAPL Function Overview » LIN » linInvertRespBitEx

Syntax dword linInvertRespBitEx(long frameID, dword byteIndex, dword bitIndex,


dword bitOffsetInSixteenthBits, dword distLengthInSixteenthBits, dword
level)

dword linInvertRespBitEx(long frameID, dword byteIndex, dword bitIndex,


dword bitOffsetInSixteenthBits, dword distLengthInSixteenthBits, dword
level, dword numberOfExecutions, dword reportFallingEdges)

Function Inverts the specified number of 1/16th bits at the specified position in the next LIN
message’s response with the specified frame ID.

Parameters frameID

ID of the bus event to be manipulated. Value range: 0..63

byteIndex

Index of the byte.

0: Sync Byte
1: ProtectedId Byte

bitIndex

The index of the bit to be manipulated. An index in the range 0-7 will manipulate a data
bit, while the index 8 will manipulate the stop bit. Higher index values will cause the
interbyte-space after the data byte to be manipulated. In this case, the user should make
sure that the interbyte-space is large enough.

Value range: 0..255

bitOffsetInSixteenthBits

The offset in 1/16th bits into the bit specified in bitIndex.

Value range: 0..15

distLengthInSixteenthBits

The length of the disturbance in units of 1/16th bit.

Value range: 0..65535

Level

Level of the disturbance.

0: Dominant (inverts recessive bit)


1: Recessive (inverts dominant bit – requires mag-Cab/Piggy and external power supply)

numberOfExecutions

The number of consecutive headers in which the bit inversion will be executed.

The default is 1 (single shot).

reportFallingEdges

Flag indicating whether timestamps of the falling edges in the resulting pseudo-byte have

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linInvertRespBitEx

to be reported. The timestamps can be retrieved by calling


linGetFallingEdgesOfDisturbedByte.

0: Deactivate report

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP2 • LIN — •


• Real bus mode

Example
on key 'i'
{
if (0!=linInvertRespBitEx(42, 1, 0, 8, 8, 0))
{
// in the next response of lin frame 42 invert the second half of the
first bit of the first data byte (the bit has to be recessive)
}
}

| linInvertHeaderBitEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linIsFlashModeActive

linIsFlashModeActive
CAPL Function Overview » LIN » linIsFlashModeActive

Syntax dword linIsFlashModeActive()

Function This function reports the flash mode state on high speed capable transceivers.

Parameters —

Return values Returns 1 if flash mode is active, otherwise 0.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP2 • LIN — •


• Real bus mode

Example
// test case for disturbing parts of a bit
// note, that test cases can only be used in the context of test module
nodes

testcase tcDisturbPartialBit()
{
dword flashModeActive;

flashModeActive = 0;

do
{
if (!linActivateFlashMode(1)) // request activation of flash mode
{
break; // if the request has been denied, either the cab/piggy is
incapable of
// flash mode or the scheduler is still running
}
testWaitForTimeout(10); // give the hardware time to activate the
flash mode
flashModeActive = linIsFlashModeActive(); // check if flash mode has
been
// activated successfully
} while (!flashModeActive);

if (!flashModeActive)
{
testStepFail(“tcDisturbPartialBit”, “Flash mode could not be
activated because of active scheduler or because the cab/piggy does not
support flash mode.”);
return;
}

linInvertRespBitEx(0, 0, 8, 4, 8, 0); // invert the middle part of the


stop bit of the
// first byte of the response to
id 0

...
}

| linActivateFlashMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasEdgeTimeDiffs

linMeasEdgeTimeDiffs
CAPL Function Overview » LIN » linMeasEdgeTimeDiffs

Syntax dword linMeasEdgeTimeDiffs(dword numIndices, long indices[])

dword linMeasEdgeTimeDiffs(dword numIndices, long indices[], dword id)

Function This function activates the measurement of the falling edges of the specified bytes in the
next message with the correct id if specified or in the next message if no id was
specified. The measured values can be queried with LINGetMeasEdgeTimeDiffs.

Parameters numIndices

The number of specified byte indices.

indices

An array containing the indices of the bytes to be measured. Note that the minimum
size for this array is numIndices.

id

The lin-identifier of the message to be measured.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.1 • LIN — •
• Real bus mode

Example
// Test case for measuring edges of a number of data bytes of a LIN frame.
// Note: This test case can only be used in the context of test module
nodes
testcase tcMeasureEdges(int byteIndex)
{
long indices[1];
float timeDiffs[4];
dword numDiffs;
indices[0] = byteIndex;
// set request to measure the edges of the specified byte of the frame
with ID=0x33
linMeasEdgeTimeDiffs(1, indices, 0x33);
// wait maximum 1000 [ms] for frame with ID=0x33
waitResult = TestWaitForMessage(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult)
{
TestStepFail("Test1.1","Expected frame has not occurred during 1000
ms!");
}
// retrieve measured edges
numDiffs = LINGetMeasEdgeTimeDiffs(4, timeDiffs);
if (numDiffs == 0)
{
TestStepFail("Test1.1", "Failed to measure edges!");
}
else
{
TestStepPass("Test 1.1", "Edge measurement done...");
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasEdgeTimeDiffs

| linGetMeasEdgeTimeDiffs |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasHeaderBaudrate

linMeasHeaderBaudrate
CAPL Function Overview » LIN » linMeasHeaderBaudrate

Syntax long linMeasHeaderBaudrate(int index)

Function With this function it is possible to set request to measure the baud rate value for next LIN
header event. Channel, where the baud rate is measured, is determined by the CAPL
program context.

This function only initiates the baud rate measurement. The result becomes available
when the next LIN header occurs and it remains valid until next measurement request. To
retrieve the result the function linGetMeasBaudrate() shall be used.

Info

When LIN hardware is in Master mode calling this function will have no
effect.

Parameters index

This parameter specifies a field of LIN header which will be used for baud rate
measurement.

0: Synch field
1: Identifier field

Return values On successful request returns zero, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

Test case for measuring baud rate using LIN header event
testcase tcMeasureHeaderBaudrate ()
{
long waitResult, measBaudrate;
// set request to measure baudrate according to Synch field of a LIN header
linMeasHeaderBaudrate(0);
// wait maximum 1000 [ms] for LIN header with identifier 0x33
waitResult = TestWaitForLinHeader(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult)
{
TestStepFail("Test 1.1","No LIN header with ID=0x33 occurred during 1000
ms!");
}
// retrieve measured baudrate
measBaudrate = linGetMeasBaudrate();
if (-1 == measBaudrate)
{
TestStepFail("Test 1.1", "Failed to measure header baudrate!");
}
TestStepPass("Test 1.1", "Header baudrate measurement done...");
}

Info

These test cases can only be used in the context of test module nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasHeaderBaudrate

| linGetMeasBaudrate | linMeasRespBaudrate | linSetBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasRespBaudrate

linMeasRespBaudrate
CAPL Function Overview » LIN » linMeasRespBaudrate

Syntax long linMeasRespBaudrate(long frameID, int index)

Function With this function it is possible to set request to measure the baud rate value according
to a certain data byte of a certain LIN frame. Channel, where the baud rate is measured,
is determined by the CAPL program context.

This function only initiates the baud rate measurement. The result becomes available
when the next bus event for the specified ID occurs and it remains valid until next
measurement request. To retrieve the result the function linGetMeasBaudrate() shall be
used.

Info

Baud rate can be measured only if the specified data byte field contains at
least one falling edge i.e. there has to be at least one recessive bit followed
by a dominant one. For example, value 0x80 is not a valid one.

Parameters frameID

LIN frame identifier whose baud rate will be measured.

Value range: 0…63

index

Data byte index.

Value range: 0..N, where N = length [in bytes] of specified LIN frame

[0..N-1]: data bytes 1..N


N: checksum byte

Return values On successful request returns zero, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example

Test case for measuring baud rate using certain data byte of a LIN frame.
testcase tcMeasureDatabyteBaudrate (int byteIndex)
{
long waitResult, measBaudrate;
// set request to measure baudrate using the specified byte of a frame with
ID=0x33
linMeasRespBaudrate(0x33, byteIndex);
// wait maximum 1000 [ms] for a frame with ID=0x33
waitResult = TestWaitForMessage(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult) {
TestStepFail("Test 1.1","Expected frame has not occurred during 1000 ms!");
}
// retrieve measured baudrate
measBaudrate = linGetMeasBaudrate();
if (-1 == measBaudrate)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMeasRespBaudrate

{
TestStepFail("Test 1.1", "Failed to measure response baudrate!");
}
TestStepPass("Test 1.1", "Response baudrate measurement done...");
}

Info

These test cases can only be used in the context of test module nodes

| linMeasHeaderBaudrate | linGetMeasBaudrate | linSetBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

output
CAPL Function Overview » LIN » output

Syntax void output(linmessage msg)

Function This function can be used for two purposes:

• To apply frame header on the bus, i.e. to transmit the frame. In that case RTR
selector has to be set to 1.

• To reconfigure response data of LIN frame. In that case RTR selector has to be set to
0. The LIN hardware responds to the next request of the specified frame with the
newly configured data.
• If working without a database it is necessary to configure a message in the handler on
prestart. The configuration is done via the output function.

Parameters Msgext

Variable of type linmessage. List of available selectors for this type of objects can be
found under linMessage selectors.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN • •

Example
linmessage MotorControl frameMotorControl;
...
// Reconfigure response of the frame defined in database linmessage
MotorControl frameMotorControl;
frameMotorControl.RTR = 0;
frameMotorControl.byte(0)=0xDF;
frameMotorControl.byte(1)=0x20;
output(frameMotorControl);
...
// Send the frame header
frameMotorControl.RTR = 1;
output(frameMotorControl);
...
// Function to set response on channel 2 for any frame.
// The specified frame might not be defined in database.
void SetFrameResponse(byte frameID, byte frameSize)
{
int index;
linmessage 0x0 frame = {msgChannel=2}; // define frame object on channel 2
// Setting frame size in run-time possible only with this function
linChangeDLC(frameID, frameSize);
frame.ID = frameID; // set specified frame ID
// initialize data byte fields
for (index=0; index < frameSize; ++index)
{
frame.byte(index) = 0xFF;
}
// issue request to update the configured response
frame.RTR = 0;
output(frame);
linSetRespCounter(frameID, -1); // enable unlimited number of responses
}
...
// Configuring a message in on prestart when working without database.
linmessage 0x20 aLinMsg;
output(aLinMsg);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

Info

When LIN hardware is not in Master mode calling this function will have no effect.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetManualChecksum

linResetManualChecksum
CAPL Function Overview » LIN » linResetManualChecksum

Syntax void linResetManualChecksum(linMessage linFrame)

Function Sets the correct checksum of a LIN frame, whose checksum has been changed by using
linSetManualChecksum() function. The checksum is calculated using the frame data.

Parameters linFrame

LIN frame for which the correct checksum will be used again.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN • •

Example

Reset checksum error caused by previously called linSetManualChecksum()


...
linmessage MotorControl frmMotorControl;
linResetManualChecksum(frmMotorControl);
output(frmMotorControl); // it is important to call output() to make the
changes active

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetMaxHeaderLength

linResetMaxHeaderLength
CAPL Function Overview » LIN » linResetMaxHeaderLength

Syntax dword linResetMaxHeaderLength()

Function Resets the maximum header length to the protocol version dependent default.

Parameters —

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • LIN — •
• Real bus mode

Example

| linSetMaxHeaderLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetNAD

linResetNAD
CAPL Function Overview » LIN » linResetNAD

Syntax long linResetNAD()

Function This function resets NAD (Node Address for Diagnostic) of the Slave node determined by
the CAPL program context to its initial NAD.

See Option .LIN: Notes to the way initial NAD is determined to understand how initial NAD
is determined in CANoe.

Info

If the CAPL program calling this function, does not model a LIN 2.x Slave
node, then this function will have no effect.

Parameters —

Return values On success this function returns a value unequal to -1, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

CAPL program modeling Slave node


// Force NAD reset on a keyboard event
on key 'r'
{
linmessage 0x3C frameMasterReq;
linmessage 0x3D frameSlaveResp;
// reset NAD of the modeled Slave node
// we assume that by default initial NAD differs from configured NAD
linResetNAD();
}
CAPL program modeling Master node
...
// Test Slave node reaction after its NAD has been reset.
// Prepare AssignFrameId command for one of the Slave's configurable frames
// In this example it is assumed that the configured NAD differs from the
initial
// NAD
// set command's data
frameMasterReq.byte(0) = 0x02; // configured NAD
frameMasterReq.byte(1) = 0x06; // PCI
frameMasterReq.byte(2) = 0xB1; // SID
frameMasterReq.byte(3) = 0x1E; // Supplier Id LSB
frameMasterReq.byte(4) = 0x0; // Supplier Id MSB
frameMasterReq.byte(5) = 0x22; // Message Id LSB
frameMasterReq.byte(6) = 0x22; // Message Id MSB
frameMasterReq.byte(7) = linGetProtectedID(0x33); // Protected ID
// update response data
frameMasterReq.RTR = 0;
output(frameMasterReq);
// send the command (issue request header)
frameMasterReq.RTR = 1;
output(frameMasterReq);
// send header of SlaveResponse frame
frameSlaveResp.RTR = 1;
output(frameSlaveResp);
// In Trace window transmission error shall occur for SlaveResponse frame
because
// Slave doesn’t know the configured NAD yet

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetNAD

| linResetSlave | linActivateResps | linDeactivateResps |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetRespBaudrate

linResetRespBaudrate
CAPL Function Overview » LIN » linResetRespBaudrate

Syntax long linResetRespBaudrate(long frameId)

Function Resets a response baudrate for a specified frame to the master baudrate.

Parameters frameId

The identifier of the frame for which the response baudrate will be reset.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • LIN — •
• Real bus mode

Example

| linSetRespBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetRespBitStream

linResetRespBitStream
CAPL Function Overview » LIN » linResetRespBitStream

Syntax long linResetRespBitStream (long frameId)

Function Deactivates the bit stream response of the specified frame.

Parameters frameId

LIN frame identifier in the range 0 .. 63

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

| linSetRespBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetRespDisturbance

linResetRespDisturbance
CAPL Function Overview » LIN » linResetRespDisturbance

Syntax long linResetRespDisturbance (long frameId)

Function Deactivates the disturbance in the response space of the specified frame.

Parameters frameId

LIN frame identifier in the range 0 .. 63

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

| linSetRespDisturbance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetScopeTrigger

linResetScopeTrigger
CAPL Function Overview » LIN » linResetScopeTrigger

Syntax long linResetScopeTrigger ()

Function Resets the oscilloscope trigger condition(s) defined with linSetScopeTrigger.

Info

If this function is called from on-prestart part of the CAPL-program, then this
function will have no effect.

Parameters —

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

| linSetScopeTrigger |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linResetSlave

linResetSlave
CAPL Function Overview » LIN » linResetSlave

Syntax long linResetSlave ()

long linResetSlave(dword resetToLastConfiguration)

Function This function resets the NAD (Node Address for Diagnostic) of the modeled Slave node and
marks all its protected identifiers as invalid or it will load the last saved configuration if
resetToLastConfiguration is set.

See Notes to the way initial NAD is determined to understand how initial NAD is
determined in CANoe.

Info

If the CAPL-program calling this function, does not model a LIN 2.x Slave
node, then this function will have no effect.

Parameters resetToLastConfiguration

0: perform a complete reset

non-zero: load last saved configuration

Return values On success this function returns a value unequal to -1, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

Force Slave reset on a keyboard event


on key 'r'
{
if ( linResetSlave() != -1) {
// from now on the Slave node stops publishing responses
...
}
}

| linResetNAD | linActivateResps | linDeactivateResps |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendAsSporadic

linSendAsSporadic
CAPL Function Overview » LIN » linSendAsSporadic

Syntax long linSendAsSporadic (long frameID)

Function This function can be used to configure an associated frame as being ready for
transmission. At the next time slot, corresponding to its sporadic frame, the associated
frame will be sent once.

Info

If LIN hardware is not in Master mode or there is no schedule table with


corresponding sporadic frame defined then calling this function will have no
effect.

Parameters frameID

Identifier of the associated LIN-frame to be transmitted in the next time slot of a


corresponding sporadic frame.

Value range: 0..59, 62

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendBitStream

linSendBitStream
CAPL Function Overview » LIN » linSendBitStream

Syntax long linSendBitStream(byte bitStream[], long numberOfBits)

long linSendBitStream(byte bitStream[], long numberOfBits, long


timeoutPrevention)

Function Sends an arbitrary bit stream on the LIN bus.

Parameters bitStream

The bit stream to be sent.


Maximum number of bits: 2^31-1.

numberOfBits

The number of bits in the bitStream-array.

timeoutPrevention

0: deactivates the timeout prevention for the 7259-transceiver.


1: activates the timeout prevention for the 7259-transceiver.

Return values On success a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Real bus mode

Example

This function sends LIN header as a bit stream


int SendSpecialHeader(int breakLength, int delimiterLength, byte syncByte,
byte idByte)
{
byte data[25];
int headerLength;
int currentPosition;
int i;
// Header consists of Break, Sync and PID bytes
headerLength = breakLength + delimiterLength + 20;
if (headerLength > 200)
{
return 0; // maximum is exceeded
}
currentPosition = 0;
for (i = 0; i < 25; ++i)
{
data[i] = 0xff; // initialize
}
for (i = breakLength; i > 0;) // set sync break
{
if (i >= 8)
{
data[currentPosition >> 3] = 0;
i -= 8;
currentPosition += 8;
}
else
{
data[currentPosition >> 3] &= ~(1 << (currentPosition & 0x7));
--i;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendBitStream

++currentPosition;
}
}
currentPosition += delimiterLength; // set synch delimiter
// set sync byte
data[currentPosition >> 3] &= ~(1 << (currentPosition & 0x7)); // start bit
++currentPosition;
for (i = 0; i < 8; ++i)
{
if ((syncByte & (1 << i)) == 0) // dominant bit in syncByte
{
data[currentPosition >> 3] &= ~(1 << (currentPosition & 0x7));
}
++currentPosition;
}
++currentPosition; // set recessive stop bit
// set protected id
data[currentPosition >> 3] &= ~(1 << (currentPosition & 0x7)); // start bit
++currentPosition;
for (i = 0; i < 8; ++i)
{
if ((idByte & (1 << i)) == 0) // dominant bit in idByte
{
data[currentPosition >> 3] &= ~(1 << (currentPosition & 0x7));
}
++currentPosition;
}
++currentPosition; // set recessive stop bit
linSendBitStream(data, headerLength); // send created header
return headerLength;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendDominantSignal

linSendDominantSignal
CAPL Function Overview » LIN » linSendDominantSignal

Syntax dword linSendDominantSignal(dword lengthInMicroseconds);

Function Sends a dominant signal of the specified length.

Parameters lengthInMicroseconds

The length of the dominant signal in microseconds.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 • LIN — •
• Real bus mode

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendHeaderError

linSendHeaderError
CAPL Function Overview » LIN » linSendHeaderError

Syntax dword linSendHeaderError(byte syncByte, byte idWithParity, byte


StopAfterError)

Function This function sends a header with the current sync break, sync delimiter and interbyte
space settings and the specified sync byte and id byte.

Info

If the LIN hardware is not in Master mode calling this function will have no
effect.

Parameters syncByte

Data value to be sent in the Synch Byte field.

Correct value is 0x55


Value range: 0..0xFF

idWithParity

Data value to be sent in the Protected Identifier field. The lower 6 bits specify the
identifier to be used. The upper 2 bits specify the identifier parity to be used. The
correct value can be calculated using the linGetProtectedID function.

Value range: 0..0xFF

StopAfterError

Specifies whether the transmission should be stopped after an error. If an incorrect synch
byte is set by this function and StopAfterError is 1, the identifier will not be sent.
A simulated message response (has to be activated independently) will generally not be
sent if there is an error in the header.

Value range: 0..1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP2 • LIN — •


• Real bus mode

Example
// Force an error in header of LIN frame with ID=0x33 by setting wrong
protected ID
on key 'h'
{
byte linID, protectedID, corParity, errParity, errPID;
// calculate protected ID with wrong parity bits
linID = 0x33; // use frame ID=0x33
protectedID = linGetProtectedID(linID); // get protected ID
corParity = (protectedID & 0xC0) >> 6; // extract parity
(0xC=0=11000000)
errParity = (corParity ^ 0x2) & 0x3; // calculate wrong parity using XOR
errPID = linID | (errParity << 6); // calculate PID with wrong parity
linSendHeaderError(0x55, errPID, 0);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendHeaderError

...
or
...
// Force an error in header of LIN frame with ID=0x33 by setting wrong
Synch byte
linSendHeaderError(0x50, linGetProtectedID(0x33), 0);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendSamplingTestHeader

linSendSamplingTestHeader
CAPL Function Overview » LIN » linSendSamplingTestHeader

Syntax long linSendSamplingTestHeader(dword startBitLengthInMicSec)

Function Sends a slave response header with the start bit of the id byte set to the specified length.

Parameters startBitLengthInMicSec

The length of the start bit in microseconds. The first data bit will be adjusted to ensure
that the start bit and the first data bit have a total length of two bit times.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 • LIN — •
• Real bus mode

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendSleepModFrm

linSendSleepModFrm
CAPL Function Overview » LIN » linSendSleepModFrm

Syntax long linSendSleepModFrm (long silent, long restartScheduler, long


wakeupIdentifier)

Function This function leads to a transmission of a go-to-sleep-command. Frame identifier and data
byte values of that command depend on the used LIN specification:

• 0: LIN specification 1.1 and older

Frame length is 2 bytes. The data bytes remain not changed.

• 0x3C: LIN specification 1.2 and newer

Frame length is 8 bytes. The first data byte is set to 0, the other data bytes remain
not changed.

Calling this function in the event procedure on preStart (parameter silent = 1) leads to
measurement start in Sleep mode.

Parameters silent

When this flag is set the LIN hardware switches to Sleep mode without sending a go-to-
sleep-command before. By this way the LIN hardware can be switched to Sleep mode even
it is not the Master. So the BusIdle timeout is reduced.

Value range: 0 .. 1

restartScheduler

Determines if index of the slot to be started with after wakeup has to be reset, i.e. it
becomes 0. If it’s not reset the next slot before entering sleep mode is used

In the case no schedule tables are defined this parameter is ignored.

Value range: 0 .. 1

wakeupIdentifier

LIN frame identifier to be sent additionally directly after sending a wakeup signal.

If an invalid identifier is specified i.e. not in the range 0 .. 63:

• when schedule tables are defined no special wakeup identifier is sent;


• when no schedule tables are defined a "SynchBreak / SynchField" pair without an
identifier is sent;

Value range: 0 .. 0xFF

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 LIN — •

Example

Start measurement in Sleep mode

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendSleepModFrm

on preStart
{
linSendSleepModFrm(1, 0 , 0x1); // use 0x1 as wake-up identifier
}
or
// send go-to-sleep-command during measurement
...
linSendSleepModFrm(0, 0 , 0xFF); // explicit sleep frame, no wake-up
identifier

| linChangeWakeupSettings | linSendWakeup | linSilentWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendVariableBitStream

linSendVariableBitStream
CAPL Function Overview » LIN » linSendVariableBitStream

Syntax long linSendVariableBitStream(byte dataBuffer[], int64 lengthInNS[], dword


numberOfBits, dword roundUp)

long linSendVariableBitStream(byte dataBuffer[], int64 lengthInNS[], dword


numberOfBits, dword roundUp, dword timeoutPrevention)

Function Sends an arbitrary bit stream with bits of variable length on the LIN bus.

Parameters dataBuffer

The bit stream to be sent.

Maximum number of bits: 2^31-1.

lengthInNS

The length of each bit in nanoseconds.

numberOfBits

The number of bits in the bitStream-array. Note that while the dataBuffer-array will
usually have a size of ceil(numberOfBits / 8), the size of lengthInNS will need to be at
least numberOfBits

roundUp

If true, the lengths specified in lengthInNS will be rounded up to the next possible length
that can be transmitted by the LIN hardware, otherwise the lengths will be rounded
down.

timeoutPrevention

0: deactivates the timeout prevention for the 7259-transceiver.

1: activates the timeout prevention for the 7259-transceiver.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 SP3 • LIN — •


• Real bus mode

Example
// This function sends a disturbance of 1 second, followed by a pause of 1
second,
// followed by a disturbance of 7 seconds using the variable bit stream
functionality
void SendDisturbances()
{
byte data[1] = { 2 };
int64 lengthInNS[3] = { 1000000000LL, 1000000000LL, 7000000000LL };
linSendVariableBitStream(data, lengthInNS, 3, 1, 1); byte data[25];
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendVariableBitStream

| linSendBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendWakeup

linSendWakeup
CAPL Function Overview » LIN » linSendWakeup

Syntax long linSendWakeup()

long linSendWakeup(long ttobrk, long count)

long linSendWakeup(long ttobrk, long count, dword length)

Function This command is used to send Wakeup frames. Wakeup frames can only be sent while the
LIN hardware is in Sleep mode. If no parameters are given, the default values of the
parameters are used.

Info

When LIN hardware is not in Sleep mode calling this function will have no
effect.

Parameters ttobrk

This parameter specifies the time difference between the transmissions of two
consecutive Wakeup frames, i.e. the time between end of one wakeup frame and start of
the next one.

Units of this parameter as well as default value depend on the hardware settings (see
Hardware Configuration: LIN).

Value range (for units expected in bit times): 20 .. 50000

Value range (for units expected in ms): 1 .. 65536

count

Sets the number of Wakeup frame retransmissions.

Value range: 1…255

Default value depends on the hardware settings: see Hardware Configuration: LIN

length

This parameter sets the length of the wakeup frame to be sent in microseconds. The
resolution is 50 µs.

This parameter is only used by LIN2.x slave nodes.

Value range: 250...5000 µs

Default value depends on the hardware settings: see Hardware Configuration: LIN

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 LIN — •

Example

Send wakeup frame on keyboard event


on key 'w'

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSendWakeup

{
linSendWakeup();
}
or
// simulate LIN 2.0 “slow” Master
...
// configure LIN hardware to wakeup after 3 wakeup frames and to send first
header
// 100 ms after wakeup
linSetWakeupParams(100, 3);
// send wakeup frame 3 times with 150 ms delay between 2 consecutive frames
linSendWakeup(150, 3);
...

| linSendSleepModFrm | linSetWakeupParams | linChangeWakeupSettings | linSilentWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetBaudrate

linSetBaudrate
CAPL Function Overview » LIN » linSetBaudrate

Syntax void linSetBaudrate(long baudrate)

Void linSetBaudrate(long minBaudrate, long maxBaudrate)

Function With this function it is possible to change the baud rate during the measurement.

It is also possible to activate automatic baudrate detection in a specified range.

Info

• It is recommended setting the baud rate via the database or the


hardware configuration dialog. This function is especially useful for test
cases (conformance test) which have to run at a number of different baud
rates.
• This function can be used also when LIN hardware is not in Master mode.
• During automatic baudrate detection no bus event will be reported until
the baudrate has been detected successfully.

Parameters baudrate

Baudrate to be set [in bit/sec].

Value range: 200 Baud – 30500 Baud

minBaudrate

The lower border of the automatic baudrate detection range.

Value range: 200 Baud – maxBaudrate

maxBaudrate

The upper border of the automatic baudrate detection range.

Value range: minBaudrate – 30500 Baud

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example

Change baud rate on keyboard event


on key 'w'
{
linSetBaudrate(9600); // change baudrate to 9600 bit/sec
}

| linMeasHeaderBaudrate | linMeasRespBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetBaudrateDetectionRange

linSetBaudrateDetectionRange
CAPL Function Overview » LIN » linSetBaudrateDetectionRange

Syntax long linSetBaudrateDetectionRange(long rangeInPercent)

Function With this function the baud rate detection range can be increased or decreased. The
default range is +/- 15%. Note that the detection range will always be symmetrical.

Context Slave mode only (in on preStart only)

Parameters rangeInPercent

The detection range in percent.

Value range: 0-30

Default: 15

Return values If successful a value unequal to zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN — •

Example

| linSetBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetBreakLength

linSetBreakLength
CAPL Function Overview » LIN » linSetBreakLength

Syntax dword linSetBreakLength(dword syncBreakLen, dword syncDelLen)

dword linSetBreakLength(float syncBreakLen, float syncDelLen)

Function With this function it is possible to change length of break/synch symbol parts. Particularly
the length of its synch break (dominant bits) and its synch delimiter (recessive bits).

The version using float parameters allows setting the break and delimiter lengths in
increments of 1/16th bits, but the unit still is bit times (i.e. linSetBreakLength(14.5, 2.5)
will set a break length of 14 8/16th bit times and a delimiter length of 2 8/16th bit times).
Note that setting non-integer break and delimiter lengths is not supported by every
hardware.

Info

When LIN hardware is not in Master mode calling this function will have no
effect.

Parameters syncBreakLen

Synch break length in bit times.

Default value: 18

Value range: 10..30

syncDelLen

Synch delimiter length in bit times.

Default value: 2

Value range: 1..30

Values required for a LIN compliant header:

• syncBreakLength >= 13
• syncDelimiterLength >= 1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

Example

| linGetSyncBreakLength | linGetSyncDelLength | linTime2Bits | linSetValidBreakLimits |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetBusIdleTimeout

linSetBusIdleTimeout
CAPL Function Overview » LIN » linSetBusIdleTimeout

Syntax dword linSetBusIdleTimeout(dword timeout)

Function This function sets a new bus idle timeout. Depending on the protocol version, the timeout
will be specified in bit times (LIN 1.x and Cooling) or in milliseconds (all others).

Parameters timeout

The timeout in bit times (LIN 1.x and Cooling) or milliseconds (all other LIN protocols).

Value range: 1 - 32767

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 LIN — •

Example

| linGetBusIdleTimeout |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetChecksumError

linSetChecksumError
CAPL Function Overview » LIN » linSetChecksumError

Syntax long linSetChecksumError(long frameId, long activate)

Function Sets/resets a checksum error of a LIN frame. The activated checksum error is then
constant and will not be affected by changes in the frame data.

Parameters frameId

LIN frame identifier in the range 0 .. 63.

activate

0: deactivate checksum error


1: activate checksum error

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

Cause check sum error for all LIN frames on the bus
on linMessage *
{
linSetChecksumError(this.id, 1);
}

| linGetChecksum |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetGlobalInterByteSpace

linSetGlobalInterByteSpace
CAPL Function Overview » LIN » linSetGlobalInterByteSpace

Syntax dword linSetGlobalInterByteSpace(dword sixteenthBits)

Function With this function it is possible to change the inter-byte space for all frame responses.
Inter-byte space is the period between the end of the stop bit of the preceding byte and
the start bit of the following byte.

By default the inter-byte space is 0.

Info

This function affects only frames published by the modeled LIN node(s), i.e.
frames sent not by external hardware.

Parameters sixteenthBits

Length of the inter-byte space to set [in units of 1/16th of bit time].

Value range: 0..65535. This corresponds to 0..4095.93 bit times.

For a LIN standard compliance: The maximum space between the bytes cannot exceed
40% duration compared to nominal transmission time.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example
on key 's'
{
if ( linSetGlobalInterByteSpace(16) != 0)
{
// from now on the inter-byte space in all frame responses is 1 bit time
...
}
}

| linSetInterByteSpace | linSetInterByteSpaces | linSetInterframeSpace |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetGlobalTimeoutPrevention

linSetGlobalTimeoutPrevention
CAPL Function Overview » LIN » linSetGlobalTimeoutPrevention

Syntax dword linSetGlobalTimeoutPrevention(dword on);

Function Activates/deactivates the global timeout prevention for transceivers with a dominant
timeout. If active, the cab/piggy will use an inbuilt transistor to keep the bus signal at a
dominant level after the dominant timeout stopped the transceiver from transmitting a
dominant signal.

Parameters on

0: Disable
1: Enable

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 • LIN — •
• Real bus mode

Example

| linGetDominantTimeout |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetInterByteSpace

linSetInterByteSpace
CAPL Function Overview » LIN » linSetInterByteSpace

Syntax dword linSetInterByteSpace (long frameID, long index, dword sixteenthBits)

Function With this function it is possible to set an inter-byte space for a specified frame and a
specified byte filed. The byte field may belong to the frame header as well as to the
frame response.

Inter-byte space is the period between the end of the stop bit of the preceding byte and
the start bit of the following byte.

By default the inter-byte space is 0.

Parameters frameID

LIN frame identifier whose inter-byte space should be changed

Value range: 0…63

index

Index of the byte field, in front of which the inter-byte space should be inserted.

Value range: 0..N+1, where N=frame length

0: Inter-byte is inserted between the Synch byte and the Identifier byte.
1: Inter-byte is inserted in front of the first data byte.
N+1: Inter-byte is inserted in front of the Checksum byte.

sixteenthBits

Length of the inter-byte space to set [in units of 1/16th of bit time].

Value range: 0..65535. This corresponds to 0..4095.93 bit times.

For a LIN standard compliance: The maximum space between the bytes cannot exceed
40% duration compared to nominal transmission time.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example
on key 's'
{
if ( linSetInterByteSpace(0x33, 9, 32) != 0)
{
// from now on for frame ID=0x33 the inter-byte space between last data
byte field
// and Checksum byte is 2 bit times
...
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetInterByteSpace

| linSetGlobalInterByteSpace | linSetInterframeSpace | linSetInterByteSpaces |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetInterByteSpaces

linSetInterByteSpaces
CAPL Function Overview » LIN » linSetInterByteSpaces

Syntax dword linSetInterByteSpaces(dword arrayOfSixteenthBits[])

dword linSetInterByteSpaces(long frameID, dword arrayOfSixteenthBits[])

Function With the first function it is possible to set the inter-byte spaces [in bit times] for all data
byte fields of all published frames (except for diagnostic frame 0x3D) of the calling LIN
Slave node.

With the second function it is possible to set the inter-byte spaces [in bit times] for all
data byte fields of a specified frame.

Inter-byte space is the period between the end of the stop bit of the preceding byte and
the start bit of the following byte.

By default the inter-byte space between all byte fields is 0.

Parameters frameID

LIN frame identifier whose inter-byte space should be changed

Value range: 0 .. 63

arrayOfSixteenthBits[]

Array of 9 elements for inter-byte space lengths, when the length of the inter-byte space
is in units of 1/16th of bit time.

The first element specifies the inter-byte space before the first data byte. It continues in
the same manner until Checksum byte. All not used elements must be set to 0.

Value range for inter-byte lengthes: 0..65535. This corresponds to 0..4095.93 bit times.

For a LIN standard compliance: The maximum space between the bytes cannot exceed
40% duration compared to nominal transmission time.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Example
on key 's'
{
int index;
dword arrayOfSixteenthBits[9];
linmessage MotorControl frameMotorControl;
for (index=0; index < 9; ++index)
{
if (index <= frameMotorControl.DLC+1) {
// for all valid data bytes and checksum byte set inter-byte space to 2 bit
times
arrayOfSixteenthBits[index] = 32;
}
else {
// initialize unused array elements
arrayOfSixteenthBits[index] = 0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetInterByteSpaces

}
}
if (linSetInterByteSpaces(0x33, arrayOfSixteenthBits) != 0) {
// the inter-byte spaces successfully set
...
}
}

| linSetGlobalInterByteSpace | linSetInterByteSpace | linSetInterframeSpace |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetInterframeSpace

linSetInterframeSpace
CAPL Function Overview » LIN » linSetInterframeSpace

Syntax dword linSetInterframeSpace(dword bitTimes)

Function This function sets the minimum inter-frame space.

With this function it is possible to change the inter-frame space for all frames.

The inter-frame space is the time from the end of the frame until start of the next frame.

By default the minimum inter-frame space is 0.

Info

If the LIN hardware is not in Master mode calling this function will have no
effect.

If large inter-frame space is set, the schedule slots time may be affected.

Parameters bitTimes

Length of the inter-frame space to set [in bit times].


Value range: 0..255

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Real bus mode

Example
on key 's'
{
if (linSetInterframeSpace (200) != 0)
{
// from now on inter-frame space is minimum 200 bit times
...
}
}

| linSetGlobalInterByteSpace | linSetInterByteSpace | linSetInterByteSpaces |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetManualChecksum

linSetManualChecksum
CAPL Function Overview » LIN » linSetManualChecksum

Syntax void linSetManualChecksum(linMessage linFrame, byte csValue)

Function Sets a checksum (that is usually not a correct one) for a LIN frame.Text

Parameters linFrame

LIN frame for which a checksum will be set.

csValue

The checksum value to be set.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN • •

Example
...
linmessage MotorControl frmMotorControl;
linSetManualChecksum(frmMotorControl, 0x1A);
output(frmMotorControl); // it is important to call output() to make the
changes active

| linResetManualChecksum |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetMasterReqDirtyFlag

linSetMasterReqDirtyFlag
CAPL Function Overview » LIN » linSetMasterReqDirtyFlag

Syntax dword linSetMasterReqDirtyFlag(dword dirty)

Function Sets the dirty flag of the MasterRequest (0x3C).

A MasterRequest in a send table will only be sent, if new data for that frame is available
or if the dirty flag has been set explicitly. Reconfiguration commands will always be sent.

Parameters dirty

New value for the dirty flag.

Return values On success a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

| linInvertHeaderBit | linInvertRespBit |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetMasterRequestDirtyFlag

linSetMasterRequestDirtyFlag
CAPL Function Overview » LIN » linSetMasterRequestDirtyFlag

Syntax dword linSetMasterRequestDirtyFlag (dword dirty)

Function Sets the dirty flag for the LIN master request frame (frame identifier=0x3C). The master
request only gets transmitted when the dirty flag is set.

Info

The dirty flag also gets set implicitly with every data update on the master
request.

Parameters dirty

0: clear the dirty flag


1: set the dirty flag

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetMaxHeaderLength

linSetMaxHeaderLength
CAPL Function Overview » LIN » linSetMaxHeaderLength

Syntax dword linSetMaxHeaderLength(long bitTimes)

Function Sets the maximum header length in bit times.

Parameters bitTimes

The new maximum header length in bit times. Headers longer than the maximum header
length will be considered illegal. CANoe will not generate any response to these headers.

Value range: 31-255

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 • LIN — •
• Real bus mode

Example

| linResetMaxHeaderLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetNAD

linSetNAD
CAPL Function Overview » LIN » linSetNAD

Syntax dword linSetNAD(dword nad)

Function Changes the node address of the calling simulated slave.

Parameters nad

The new nad to be used by the simulated slave.

Return values On success zero, otherwise -1.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 • LIN — •
• Real bus mode

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetOEMDataInd

linSetOEMDataInd
CAPL Function Overview » LIN » linSetOEMDataInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linSetOEMDataInd(long active)

Function Sets/resets the data indication bit for a calling slave node.

Parameters active

0: set
1: reset

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMDataInd | linGetOEMDataInd | linSetOEMDataIndTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetOEMDataIndTime

linSetOEMDataIndTime
CAPL Function Overview » LIN » linSetOEMDataIndTime

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linSetOEMDataIndTime(long timeInMS)

Function Sets the time in milliseconds after which a simulated slave automatically sets its data
indication bit.

Parameters timeInMS

Time value.
Unit: milliseconds

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linSetOEMDataInd | linGetOEMDataInd | linCheckOEMDataInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetOEMSleepInd

linSetOEMSleepInd
CAPL Function Overview » LIN » linSetOEMSleepInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linSetOEMSleepInd(long active)

Function Sets/resets the sleep indication bit for a calling slave node.

Parameters active

0: set
1: reset

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMSleepInd | linGetOEMSleepInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetOEMWakeupInd

linSetOEMWakeupInd
CAPL Function Overview » LIN » linSetOEMWakeupInd

Info

This function can be used for OEM specific variant of LIN protocol only.

Syntax long linSetOEMWakeupInd(long active)

Function Sets/resets the wakeup indication bit for a calling slave node.

Parameters active

0: set
1: reset

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 LIN — •

Example

| linCheckOEMWakeupInd | linGetOEMWakeupInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespBaudrate

linSetRespBaudrate
CAPL Function Overview » LIN » linSetRespBaudrate

Syntax long linSetRespBaudrate(long frameId, long baudrate)

Function Sets a response baudrate for a specified frame. This baudrate will be used for the
response, regardless of the master baudrate.

Parameters frameId

The identifier of the frame for which the response baudrate will be set.

baudrate

The baudrate to be used for the response.

Value range: 1000-20000

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • LIN — •
• Real bus mode

Example

| linResetRespBaudrate |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespBitStream

linSetRespBitStream
CAPL Function Overview » LIN » linSetRespBitStream

Syntax long linSetRespBitStream (long frameId, byte bitStream[], long


numberOfBits)

long linSetRespBitStream (long frameId, byte bitStream[], long


numberOfBits, long timeoutPrevention)

long linSetRespBitStream (long frameId, byte bitStream[], long


numberOfBits, long timeoutPrevention, long count)

Function Sets up a bit stream as the response to the specified frame.

Parameters frameId

LIN frame identifier in the range 0 .. 63

bitStream

The bit stream array to be sent as a response.


Maximum number of bits: 2^31-1.

numberOfBits

Number of bits in the bitStream array to be sent.

timeoutPrevention

0: deactivates the timeout prevention for the 7259-transceiver.


1: activates the timeout prevention for the 7259-transceiver.

count

Number of times, the bit stream shall be sent as a response before deactivating itself.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

Send LIN response for the frame MotorControl as a bit stream.


// The response consists of 8 data bytes and checksum byte. There are no
interbyte spaces.
// Response: [D0=0x1, D1=0x2, D2=0x4, D3=0x8, D4=0x10, D5=0x20, D6=0x40,
D7=0x80, CS=0x52]
on key 'r'
{
linmessage MotorControl mMotorControl;
byte bitStream[12];
long numberOfBits;
// binary stream = 0100000001 0010000001 0001000001 0000100001 0000010001
// binary stream (continue) = 0000001001 0000000101 0000000011 0010010101
bitStream[0] = 0x2;
bitStream[1] = 0x12;
bitStream[2] = 0x88;
bitStream[3] = 0x20;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespBitStream

bitStream[4] = 0x84;
bitStream[5] = 0x20;
bitStream[6] = 0x2;
bitStream[7] = 0x9;
bitStream[8] = 0x28;
bitStream[9] = 0xC0;
bitStream[10] = 0xA4;
bitStream[11] = 0x2;
numberOfBits = 90; // Each byte requires 10 bits (start bit + data bits +
stop bit)
if (0!=linSetRespBitStream(mMotorControl.id, bitStream, numberOfBits))
{
// for the next response of frame "MotorControl" is as specified
}
}

| linResetRespBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespCounter

linSetRespCounter
CAPL Function Overview » LIN » linSetRespCounter

Syntax long linSetRespCounter(long frameID, long count)

Function With this function it is possible to limit the number of responses sent for the specified
frame identifier.

By setting count = 0 it is possible to deactivate the frame response completely.

With count = -1 a frame response is always sent when a correct frame header is received.
This is the default configuration for newly configured frames.

Parameters frameID

Identifier of the LIN-frame to be configured


Value range: 0…63

count

Number of responses to be sent.

n-times: 0..254
unlimited: -1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN — •

Example

| linActivateResps | linDeactivateResps |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespDisturbance

linSetRespDisturbance
CAPL Function Overview » LIN » linSetRespDisturbance

Syntax long linSetRespDisturbance (long frameId, long lengthInBits, long level,


long offsetInSixteenthBits)

Function Activates a disturbance in the response space of the specified LIN frame. A normal
response by a simulated slave will be deactivated as long as the disturbance is active.

Info

The disturbance starts with the next occurrence of the specified frame. To
stop the disturbance the functions linResetRespDisturbance() shall be used.

Parameters frameId

LIN frame identifier in the range 0 .. 63.

lengthInBits

The duration of the disturbance [in bit times].

level

The level of the disturbance.

0: dominant disturbance (inverts recessive bits)


1: recessive disturbance (inverts dominant bits - requires mag-Cab/Piggy and external
power supply)

offsetInSixteenthBits

The offset [in 1/16th bits] of the disturbance relative to the end of the header, i.e. to the
PID byte.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • LIN — •
• Real bus mode

Example

On pressing 'c' key start corrupting the response space and the first databyte of the
response for LIN frame Motor1State_Cycl.
on key 'c'
{
linmessage Motor1State_Cycl mMotor1State_Cycl;
if (0!=linSetRespDisturbance (mMotor1State_Cycl.id, 1, 0, 20))
{
// for the next the first bit of the response space or of the first
databyte
// (if the response space is zero) is inverted from recessive to
dominant
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespDisturbance

| linResetRespDisturbance | linStartDisturbance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespError

linSetRespError
CAPL Function Overview » LIN » linSetRespError

Syntax long linSetRespError(long activate)

Function Sets/resets the response error flag for a calling slave node.

Info

This function has no effect with LIN 1.x.

Parameters activate

0: reset
1: set

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN — •

Example

| linGetRespError | linCheckRespError | linActivateGlobalNetworkManagement | linActivateSlaveNetworkManagement |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespLength

linSetRespLength
CAPL Function Overview » LIN » linSetRespLength

Syntax long linSetRespLength(long frameID, long numberOfBytes)

Function This function can be used to configure how many data bytes of the frame response should
be sent. The frame’s length is not changed by this function.

To send a correct response the numberOfBytes should be set equal to DLC+1 i.e for the
frame data bytes and their checksum.

If the numberOfBytes is to set to a value larger than DLC + 1, then a complete response
is also sent.

If the numberOfBytes is set to a value smaller than DLC+1, then a receiving error will
occur or if numberOfBytes = 0 a transmission error.

Info

This function can be used to simulate collisions during sending of a frame


response e.g. after receiving an event triggered frame.

Parameters frameID

Identifier of the LIN-frame to be configured.


Value range: 0…63

numberOfBytes

Number of bytes to be sent in the frame response (including checksum).


Value range: 0..DLC+1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN — •

Example
linmessage MotorControl frameMotorControl;
...
if (linSetRespLength (frameMotorControl.ID, frameMotorControl.DLC) != 0) {
// from now on a receive error notified for the MotorControl frame
...
}
if (linSetRespLength (frameMotorControl.ID, 0) != 0)
{
// from now on a transmission error notified for the MotorControl frame
...
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetRespTolerance

linSetRespTolerance
CAPL Function Overview » LIN » linSetRespTolerance

Syntax dword linSetRespTolerance(long frameId, long toleranceInPercent)

Function Sets the response tolerance for a specified frame in percent.

Parameters frameId

The identifier of the frame for which the response tolerance shall be set.

toleranceInPercent

The response tolerance to be used for the specified frame.

Value range: 0-255

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • LIN — •
• Real bus mode

Example

| linResetMaxHeaderLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetSchedulerJitter

linSetSchedulerJitter
CAPL Function Overview » LIN » linSetSchedulerJitter

Syntax long linSetSchedulerJitter (long mode)

long linSetSchedulerJitter (long mode, long jitterInMicSecs)

Function Sets/resets the jitter mode and the jitter of the LIN hardware scheduler. (the channel is
determined by the CAPL program context).

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters mode

0: deactivates the jitter;


1: sets the min-/max-mode; the minimum (0) and the maximum (specified value) jitter
will be used alternatively
2: sets the random jitter-mode; the jitter-offset will be equally distributed in the
min/max range

jitterInMicSecs

The jitter in microseconds to be used.


Default: Jitter value from LDF.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example
on key 'j'
{
if (0!=linSetSchedulerJitter(1))
{
// for the next LIN hardware scheduler will use jitter specified in the LDF
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetScopeTrigger

linSetScopeTrigger
CAPL Function Overview » LIN » linSetScopeTrigger

Syntax long linSetScopeTrigger (long ID, long Position)

long linSetScopeTrigger (long eventCount, long triggerCount, long


triggerMask, byte idMask[8])

Function With these functions it is possible to define trigger conditions for an oscilloscope. If the
trigger conditions are satisfied, the LIN hardware will send an impulse on the sync cable.

The first function defines a single trigger condition for a valid frame or an error in a
response.

The second function defines a set of trigger conditions.

Info

If this function is called from on prestart part of the CAPL program, then
this function will have no effect.

Parameters ID

Identifier of the frame to be triggered on. The parameter is only evaluated for trigger
conditions after the ID field.

Position

0 Trigger on end of header

1-9 Trigger on databyte 1 - 8 or checksum (5 will trigger on the checksum if the


length of the frame is 4)

10 Trigger on detection of receive error in response

11 Trigger on detection of checksum error

12 Trigger on detection of transmission error

eventCount

Number of occurred/fulfilled trigger conditions, which activate the triggering. E.g. a


number of 5 will activate the triggering, after the trigger condition was fulfilled 5 times.

A number of 0 is not allowed.

triggerCount

Number n, how often the trigger will be activated. For every trigger activation the
number of fulfilled trigger conditions (EventCount) has been occurred before, i.e. the
triggering starts after 1 time of EventCount, 2 times of EventCount...n times of
EventCount.

If the triggerCount is 0, the trigger will run indefinitely.

triggerMask

Definition of trigger conditions.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetScopeTrigger

Meaning of the bits in the mask:

0 Sync break detection (about 9.6 bit times after start of sync break)

1 Start of sync delimiter

2 Start of sync field (beginning of start bit if sync break could not have been a 2.0
wakeup frame, end of start bit otherwise)

3 End of sync field

4 Start of lin identifie

5 End of lin identifier

6 End of any data or checksum byte

7- End of data byte 1 - 8 or checksum byte (depending on dlc)


15

16 Detection of sync error

17 Detection of receive error in header/bus idle phase/sleep mode

18 Detection of receive error in response

19 Detection of checksum error

20 Detection of transmission error

21 Detection of sleep mode frame

22 Detection of sleep mode event

23 Detection of wakeup frame

idMask

An array specifying the LIN identifiers on which to trigger. Bit 0 in byte 0 specifies id 0,
bit 0 in byte 1 specifies id 8, bit 3 in byte 5 specifies id 5 * 8 + 3 = 43, etc. The parameter
is only evaluated for trigger conditions after the ID field.

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • LIN — •
• Real bus mode

Example
on key 'a'
{
long lresp;
long position=0;

// The fourth parameter is a Byte Array (8 Bytes).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetScopeTrigger

// -> 64 Bits for the setting of 64 Ids.

byte idmask[8] = {0,0,0,0,0,0,0,0};


byte identifier = 0x30;

// Byte Position: 6 // Bit Position: 0


idmask[identifier / 8] |= 1 << (identifier % 8);

lresp = linSetScopeTrigger (0x30, position);


lresp = linSetScopTrigger (1, 1, 1, idmaks);
}

| linResetScopeTrigger |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetValidBreakLimits

linSetValidBreakLimits
CAPL Function Overview » LIN » linSetValidBreakLimits

Syntax dword linSetValidBreakLimits(dword breakMin16thBits, dword


breakMax16thBits, dword delMin16thBits, dword delMax16thBits)

Function Sets limits for the accepted sync break and delimiter lengths. Any sync break and
delimiter outside of this range is considered invalid, resulting in a receive error. Note that
this function does not change the current sync break and delimiter length sent by a
simulated master. This function can also be called in slave mode to test an external
master.

This function does not change the header length restrictions of 47.6 bit times for LIN 2.x
and 49 bit times for LIN 1.x. This means that a header can still be invalid even if the
modified sync break and delimiter limits are met.

Parameters breakMin16thBits

The minimum legal sync break length, specified in units of 1/16th bit times.

Range: 152 (9.5 bit times) – 784 (49 bit times)

breakMax16thBits

The maximum legal sync break length, specified in units of 1/16th bit times.

Range: 152 (9.5 bit times) – 784 (49 bit times), has to be greater than breakMin16thBits

delMin16thBits

The minimum legal sync delimiter length, specified in units of 1/16th bit times.

Range: 1 – 784 (49 bit times)

delMax16thBits

The maximum legal sync delimiter length, specified in units of 1/16th bit times.

Range: 1 – 784 (49 bit times), has to be greater than delMin16thBits

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.1 • LIN — •
• Real bus mode

Example

| linSetBreakLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSetWakeupParams

linSetWakeupParams
CAPL Function Overview » LIN » linSetWakeupParams

Syntax long linSetWakeupParams (long wakeupDelimiter, long numberOfWakeupFrames)

Function This command determines the conditions under which the LIN hardware can be
reactivated (leaves the Sleep mode).

Default wakeup delimiter depends on the hardware settings (see Hardware Configuration:
LIN) while the number of expected wakeup frames is 1.

Main use case for this function is to simulate slow Master, which does not wake up until
an expected Wakeup frame burst.

Info

When LIN hardware is not in Master mode calling this function will have no
effect.

Parameters WakeupDelimiter

This parameter specifies the wakeup delimiter length, i.e. the time between the end of
wakeup frame and the first sent header.

Units of this parameter as well as default value depend on the hardware settings (see
Hardware Configuration: LIN).
Value range:: 3..255 (ms or bit times)

NumberOfWakeupFrames

This parameter specifies the number of wakeup frames, after that the LIN hardware is
reactivated. If the value 0 is set, the LIN hardware will never leave the Sleep mode.
Value range: 0 .. 31
Default value: 1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 LIN — •

Example
// simulate LIN 2.0 'slow' Master
...
// configure LIN hardware to wakeup after 3 wakeup frames and to send first
header
// 100 ms after wakeup
linSetWakeupParams(100, 3);
// send wakeup frame 3 times with 150 ms delay between 2 consecutive frames
linSendWakeup(150, 3);
...

| linSendWakeup | linSilentWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSilentWakeup

linSilentWakeup
CAPL Function Overview » LIN » linSilentWakeup

Syntax long linSilentWakeup ()

Function Wakes up the LIN bus without sending any wakeup frames.

Info

• When called during Wakeup mode this function has no effect.


• This function can be useful before issuing Go-to-Sleep command in order
to ensure Wakeup mode.

Parameters —

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 LIN — •

Example

| linSendWakeup |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSimulateETFCollision

linSimulateETFCollision
CAPL Function Overview » LIN » linSimulateETFCollision

Syntax dword linSimulateETFCollision (dword etfId)

dword linSimulateETFCollision (dword etfId, dword respLength, dword


numCollisions, byte dataBytes[])

Function This function can be used to cause collisions for next coming header(s) of an event-
triggered frame.

Parameters etfId

LIN frame identifier in the range 0 .. 59

respLength

Number of databytes to be sent as the response on the header of the event-triggered


frame.

Value range: 1..9. Default: 1

numCollisions

Number of times the specified response has to be applied.

Value range: 1..255. Default: 1

Databytes

Array of databytes to be sent as the response.


The size of the array shall correspond to the respLength parameter.

Default: NULL

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Real bus mode

Example

| linSetRespLength |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linStartDisturbance

linStartDisturbance
CAPL Function Overview » LIN » linStartDisturbance

Syntax long linStartDisturbance(dword length, dword level)

Function Starts a disturbance on the bus.

Note that disturbances shorter than 64 bit times cannot be stopped with
linStopDisturbance().

Parameters length

Length of the disturbance in bit times.

-1: permanent disturbance

level

The level of the disturbance.

0: dominant disturbance (inverts recessive bits)


1: recessive disturbance (inverts dominant bits - requires mag-Cab/Piggy and external
power supply)

Return values On success a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Real bus mode

Example

| linStopDisturbance | linSetRespDisturbance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linStartScheduler

linStartScheduler
CAPL Function Overview » LIN » linStartScheduler

Syntax void linStartScheduler()

Function This function starts the internal scheduler, which begins a cyclical traversal of a last
configured schedule table.

If this is the first time the scheduler started the first found schedule table, i.e. the
schedule table with index 0, is used.

Calling this function before the measurement start is not necessary, since the scheduler is
started automatically.

Info

If the Master node is not simulated or no schedule tables are defined, then
this function will have no effect.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN — •

Example

| linStopScheduler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linStopDisturbance

linStopDisturbance
CAPL Function Overview » LIN » linStopDisturbance

Syntax long linStopDisturbance()

Function Stops the disturbance on the bus which is started with linStartDisturbance().

Note that disturbances shorter than 64 bit times cannot be stopped.

Parameters —

Return values On success a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Real bus mode

Example

| linStartDisturbance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linStopScheduler

linStopScheduler
CAPL Function Overview » LIN » linStopScheduler

Syntax void linStopScheduler()

Function This function stops the internal scheduler. This way a cyclical traversal of the current
schedule table is stopped.

Scheduler can be started again by calling linStartScheduler() function.

Info

• Calling this function in the event procedure on preStart prevents the


scheduler from starting at the beginning of the measurement.
• If the Master node is not simulated or no schedule tables are defined,
then this function will have no effect.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linTime2Bits

linTime2Bits
CAPL Function Overview » LIN » linTime2Bits

Syntax dword linTime2Bits(dword time)

linTime2Bits(dword channel, dword time)

Function This function converts specified system times to bit times. The conversion is done using
the current baud rate on the channel determined by the CAPL program context.

Info

Calling this function with the explicit channel is only possible from a CAPL
program defined in the measurement setup of CANoe.

Parameters time

System time to be converted [in units of 10 µsec].

channel

Channel number, whose baud rate will be used.

Return values Resulting bit time.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 LIN — •

6.0 LIN • •

Example

Extract sync break length of LIN frames


on linMessage *
{
dword sysTimeSyncBreak; // time in 10µs units
dword bitTimeSyncBreak; // time in bit time units
sysTimeSyncBreak = linGetSyncBreakLength(this);
bitTimeSyncBreak = linTime2Bits(sysTimeSyncBreak);
}

| linBits2Time |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linTime2Bits_ns

linTime2Bits_ns
CAPL Function Overview » LIN » linTime2Bits_ns

Syntax dword linTime2Bits_ns(int64 time)

dword linTime2Bits_ns(dword channel, int64 time)

Function This function converts specified system times to bit times. The conversion is done using
the current baud rate on the channel determined by the CAPL program context.

Info

Calling this function with the explicit channel is only possible from a CAPL
program defined in the measurement setup of CANoe.

Parameters time

System time to be converted [in ns].

channel

Channel number, whose baud rate will be used.

Return values Resulting bit time.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 LIN • •

Example

Extract sync break length of LIN frames


on linMessage *
{
..dword bitTimeSyncBreak;
bitTimeSyncBreak = linTime2Bits_ns(this.breakLen);
}

| linBits2Time_ns |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linBaudrateEvent

on linBaudrateEvent
CAPL Function Overview » LIN » on linBaudrateEvent

Function The event procedure on linBaudrateEvent is called when the LIN hardware has
successfully measured the baud rate of an external master or if the baud rate deviates by
more than 0.5% from the last reported value. This only occurs if an external master is being
used (in which case the LIN hardware is running in Slave mode).

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linBaudrateEvent

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linCsError

on linCsError
CAPL Function Overview » LIN » on linCsError

Function The event procedure on linCsError is called when a frame was transmitted without a
failure, but with an incorrect checksum.

The keyword this and the selectors (see Option .LIN: linCsError selectors) can be used to
access the data of the event that has just been received.

Parameters linCsError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Simulate checksum error and check how it is handled.


on key 'c'
{
int index;
byte checksum;
linmessage MotorControl frmMotorControl;
// set data byte values and calculate resulting checksum
for (index=0; index < frmMotorControl.DLC; ++index)
{
frmMotorControl.byte(index) = 0xFF;
}
// Set permanent CS error for the current frame
linSetChecksumError(frmMotorControl.id, 1);
// update response data
frmMotorControl.RTR=0;
output(frmMotorControl);
// apply frame's header on the bus
frmMotorControl.RTR=1;
output(frmMotorControl);
}
...
on linCsError
{
int index;
linmessage MotorControl frmMotorControl;
// compare correct checksum and the received one
if (this.ID == frmMotorControl.ID)
{
// set data byte values and calculate correct checksum
for (index=0; index < frmMotorControl.DLC; ++index)
{
frmMotorControl.byte(index) = this.byte(index);
}
WriteLineEx(0,0,"received checksum=%d", getChecksum(this));
WriteLineEx(0,0,"correct checksum=%d", getChecksum(frmMotorControl));
}
}

| LINGetChecksum | LINSetChecksumError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linDlcInfo

on linDlcInfo
CAPL Function Overview » LIN » on linDlcInfo

Function The event procedure on linDlcInfo is called when the LIN hardware has successfully
measured the length of an unknown frame. This only occurs when the LIN hardware is in
Slave mode.

In Master mode, when no deviating values are specified by the database or CAPL functions,
the LIN hardware assumes the frame length derived from the frame identifier.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linDlcInfo

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linMessage

on linMessage
CAPL Function Overview » LIN » on linMessage

Note

This function is also used as a replacement for the function LINRcvFrame.

Function The event procedure on linMessage is called on the receipt of a valid LIN frame.

The keyword this and the selectors (see LIN: linMessage selectors) can be used to access
the data of the frame that has just been received.

CAPL nodes are by default not transparent to LIN frames. This means that a CAPL node in
the evaluation branch of the measurement setup will block the data flow to its right side. To
propagate the received frame to a next node in a chain a call to output(this) can be used.
However, please note that such a call from a CANoe's simulation setup node may lead to a
recursion.

Info

If for example a CAPL program contains the event procedures on linMessage


12 and on linMessage *, the procedure on linMessage 12 will be called up,
when a frame with the identifier 12 is received. For all other frames the
procedure on linMessage * will be called up.

Selectors linMessage

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Display in Write window the transmission time for a frame from the database
on linMessage MotorControl
{
writeLineEx(1, 1, "Entire frame transmission time: %d bit times",
this.LIN_Fulltime);
}

Display in Write window the header transmission time for a frame ID=0x33
on linMessage 0x33
{
writeLineEx(1, 1, "Frame header transmission time: %d bit times",
this.LIN_HeaderTime);
}

Propagate all frames to a next chain node


// Warning: This code causes recursion when called from CANoe simulation
setup node
on linMessage *
{
this.RTR=1;
output(this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linReceiveError

on linReceiveError
CAPL Function Overview » LIN » on linReceiveError

Function The event procedure on linReceiveError is called when an error occurred during a frame
transmission. The exact reason of the error is specified by lin_StateReason selector.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linReceiveError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example
linmessage MotorControl frmMotorControl;
...
// Simulate Receive Error by setting wrong response length
if (linSetRespLength (frmMotorControl.ID, frmMotorControl.DLC) != 0)
{
// from now on a receive error notified for the MotorControl frame
...
}
...
// Handle the error
on linReceiveError
{
int state, reason;
if (this.lin_ShortError != 0)
{
// The received data was too short. No additional info is available.
...
}
else
{
// extract identifier of LIN hardware state at the time the error has
occurred
state = this.lin_StateReason & 0x0F;
// extract identifier of reason caused the error
reason = this.lin_StateReason & 0xF0;
...
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linSchedulerModeChange

on linSchedulerModeChange
CAPL Function Overview » LIN » on linSchedulerModeChange

Function The event procedure on linSchedulerModeChange is called when modeled LIN Master
switches from the current schedule table to another one. This only occurs when the LIN
hardware is in Master mode.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linSchedulerModeChange

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linSlaveTimeout

on linSlaveTimeout
CAPL Function Overview » LIN » on linSlaveTimeout

Function This procedure is called for SlaveTimeouts. The timeout of an FSM status can be set with
LINSlFSMSetStTO.

Selectors TIME (data type dword)

The time stamp of the timeout with which the global time base was synchronized on the PC
(CAN hardware or PC system clock).
The time stamp must be used if you want to take into consideration time relations with
events from other sources. This time stamp is also generated in the Trace Window.

Unit:10 microseconds.

MsgOrigTime (data type dword)

Time stamp generated by the LIN hardware.


It will only prove useful in isolated cases to use this time stamp that is unsynchronized and
thus still original. The time stamp should only be used to compare the time of two LIN
hardware generated events.

Unit: 10 microseconds.

MsgTimeStampStatus (data type byte)

Status of MsgOrigTime:

Bit 0 set Time stamp is valid

Bit 0 not set Time stamp is invalid

Bit 1 set Time stamp was generated by software

Bit 1 not set Time stamp was generated by hardware

Bit 4 Has a bus-specific meaning; not currently in use for LIN

MsgChannel (data type ushort)

The channel through which the timeout was received.

lin_FsmID (data type byte)

The Identifier of the FSM that initiated the timeout.

lin_FsmState (data type byte)

The status of the FSM in which the timeout occurred.

lin_FollowStateID (data type byte)

The status to which the FSM switched after the timeout.

Write protected!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linSlaveTimeout

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linSleepModeEvent

on linSleepModeEvent
CAPL Function Overview » LIN » on linSleepModeEvent

Note

This function is also used as a replacement for the function LINSleepModeEvent.

Function The event procedure on linSleepModeEvent is called when the wake status of the LIN
hardware changes.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linSleepModeEvent

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linSyncError

on linSyncError
CAPL Function Overview » LIN » on linSyncError

Function The event procedure on linSyncError is called when the LIN hardware was unable to
become synchronized to an external master.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linSyncError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linTransmError

on linTransmError
CAPL Function Overview » LIN » on linTransmError

Function The event procedure on linTransmError is called when no Slave responded to a


transmission request.

The keyword this and the selectors (see Option .LIN: linTransmError selectors) can be used
to access the data of the event that has just been received.

Selectors linTransmError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Handle transmission error for a certain frame on channel 1:


on linTransmError
{
if (this.MsgChannel == 1 && this.ID == 0x33) {

}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on linWakeupFrame

on linWakeupFrame
CAPL Function Overview » LIN » on linWakeupFrame

Note

This function is also used as a replacement for the function LINWakeupFrame.

Function The event procedure on linWakeupFrame is called when the LIN hardware detects a wakeup
signal on the bus.

The keyword this and the selectors can be used to access the data of the event that has
just been received.

Selectors linWakeupFrame

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linBaudrateEvent Selectors

linBaudrateEvent Selectors
CAPL Function Overview » LIN » linBaudrateEvent Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

MsgChannel Channel through which the event was received. word

Value range: 1..32

lin_Baudrate Measured baud rate. int read only

Unit: bits/sec.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCsError Selectors

linCsError Selectors
CAPL Function Overview » LIN » linCsError Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

LIN_HeaderTime Frame header transmission time. byte read only

Unit: bit time

LIN_Fulltime Entire frame transmission time. byte read only

Unit: bit time

ID LIN Frame identifier (6 bits) byte

Value range: 0..63

DLC Number of data bytes contained in the frame (Data byte read only
Length Code).

Value range: 0..8

MsgChannel Channel through which the checksum error has been word read only
received.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linCsError Selectors

Value range: 1..32

DIR Direction of transmission: byte read only

Tx: Frame was transmitted by LIN hardware


Rx: Frame was received
TxRequest: Transmission request

SIMULATED This flag specifies whether the frame was simulated. byte read only

Values:
0: Not simulated
1: Simulated

lin_FsmID Identifier of the FSM that transmitted the frame byte read only
response.

Only valid if lin_FSMState <> 255.

Value range: 0..63

lin_FsmState The status, in which the FSM transmitted the frame byte read only
response.

Value range: 0..255

If lin_FsmState = 255 no FSM was configured to


respond to this frame. The value of lin_FSMId is thus
also invalid.

Byte(x) Frame data byte (8 bit). byte raed only

Possible values for x: 0..7

Word(x) Frame data word (16 bit). word read only

Possible values for x: 0-6. The index is byte-oriented.


For example, word(1) references the data consisting of
bytes 1-2 and not of bytes 2-3.

Dword(x) Frame data double word (32 bit). dword read only

Possible values for x: 0-4. The index is byte-oriented.


For example, dword(1) references the data consisting of
bytes 1-4 and not of bytes 4-7.

breakLen Length of the sync break in ns int64 read only

delimiterLen Length of the sync delimiter in ns int64 read only

EOH End of header timestamp in ns int64 read only

EOB End of byte timestamp of databyte <i> in ns int64 read only

Possible indexes: 0..7

SOF Start of Frame timestamp in ns int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linDlcInfo Selectors

linDlcInfo Selectors
CAPL Function Overview » LIN » linDlcInfo Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

ID LIN Frame identifier (6 bits) of the measured frame. byte

Value range: 0..63

DLC Measured number of data bytes (Data Length Code). byte read only

Value range: 0..8

MsgChannel Channel through which the event was received. word read only

Value range: 1..32

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linHeader Selectors

linHeader Selectors
CAPL Function Overview » LIN » linHeader Selectors

Keyword Description Type Acess limitation

ID LIN Frame identifier (6 bits) byte

Value range: 0..63

DLC Number of data bytes expected for the frame (Data Length Code). byte read only

Value range: 0..8

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMessage Selectors

linMessage Selectors
CAPL Function Overview » LIN » linMessage Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

LIN_HeaderTime Frame header transmission time. byte read only

Unit: bit time

LIN_Fulltime Entire event transmission time (transmission of the byte read only
frame header by the master and waiting for the
maximum frame duration).

Unit: bit time

ID LIN Frame identifier (6 bits) byte

Value range: 0..63

DLC Number of data bytes contained in the frame (Data byte


Length Code).

Value range: 0..8

MsgChannel Transmission channel or channel through which the word

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linMessage Selectors

frame has been received.

Value range: 1..32

DIR Direction of transmission: byte read only

Tx: Frame was transmitted by LIN hardware


Rx: Frame was received

SIMULATED This flag specifies whether the frame was simulated. byte read only

Values:
0: Not simulated
1: Simulated

RTR This flag is only required when a frame is being sent byte
with output().

Meaning:
0: Response data will be reconfigured.
1: Frame header is applied to the bus - only works with
the LIN hardware in Master mode.

Byte(x) Frame data byte (8 bit). byte

Possible values for x: 0..7

Word(x) Frame data word (16 bit). word

Possible values for x: 0-6. The index is byte-oriented.


For example, word(1) references the data consisting of
bytes 1-2 and not of bytes 2-3.

Dword(x) Frame data double word (32 bit). dword

Possible values for x: 0-4. The index is byte-oriented.


For example, dword(1) references the data consisting of
bytes 1-4 and not of bytes 4-7.

breakLen Length of the sync break in ns int64 read only

delimiterLen Length of the sync delimiter in ns int64 read only

EOH End of header timestamp in ns int64 read only

EOB[i] End of byte timestamp of databyte <i> in ns int64 read only

Possible indexes: 0..7

SOF Start of Frame timestamp in ns int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linReceiveError Selectors

linReceiveError Selectors
CAPL Function Overview » LIN » linReceiveError Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

LIN_HeaderTime Frame header transmission time. byte read only

Unit: bit time

LIN_Fulltime Entire event transmission time (transmission of the byte read only
frame header by the master and waiting for the
maximum frame duration).

Unit: bit time

ID LIN Frame identifier (6 bits) byte read only

Value range: 0..63

DLC Number of data bytes expected in the frame (Data byte


Length Code). Only valid if lin_ShortError is not set.

Value range: 0..8

MsgChannel Transmission channel. word read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linReceiveError Selectors

Value range: 1..32

lin_ShortError Specifies the detail level of the event. byte read only

Most selectors are not valid unless this selector is set.

lin_StateReason The lower 4 bits indicate the LIN hardware state at the byte read only
time the error has occurred, while the upper 4 bits
indicate the reason of the error.

Values for the state:

0 Bus idle

1 Waiting for SynchBreak

2 Waiting for SynchField

3 Waiting for frame ID

4- Waiting for data byte or checksum byte


12 depending on the frame DLC.

4: DLC 0
12: DLC 8 - the checksum byte.

14 Consecutive event (i.e. event resulting from


further data interpretation, after already
notified error for first offending byte).
15 SleepMode. Only possible if the LIN hardware is
in Master mode. In Slave mode, the LIN hardware
can be wakened by any type of bus traffic.

Values for the reason:

0 Timeout

1 Received an unexpected byte violating protocol. In


this case, lin_OffendingByte contains its value.

2 Received a byte with framing error (with dominant


stop bit). In this case, lin_OffendingByte contains
its value.
3 Unexpected Break field.

4 Unidentified error.

lin_OffendingByte The byte that resulted the protocol violation. byte read only

Only valid for certain values of lin_StateReason.

lin_FsmID Identifier of the FSM that transmitted the frame byte read only
response.

Only valid if lin_FSMState <> 255 and lin_ShortError


is not set.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linReceiveError Selectors

Value range: 0..63

breaklen Length of the sync break in ns int64 read only

delimiterlen Length of the sync delimiter in ns int64 read only

EOH End of header timestamp in ns int64 read only

EOB[i] End of byte timestamp of databyte <i> in ns . int64 read only


Possible indexes: 0..7

SOF Start of Frame timestamp in ns int64 read only

lin_FsmState The status, in which the FSM transmitted the frame. byte read only
Only valid if lin_ShortError is not set.

Value range: 0..255

If lin_FsmState = 255 no FSM was configured to


response to this frame. The value of lin_FSMId is thus
also invalid.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSchedulerModeChange Selectors

linSchedulerModeChange Selectors
CAPL Function Overview » LIN » linSchedulerModeChange Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

MsgChannel Channel through which the event was received. word

Value range: 1..32

lin_OldMode Index of a previously active schedule table. byte read only

Value range: 0..255

lin_NewMode Index of the newly activated schedule table. byte read only

Value range: 0..255

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSleepModeEvent Selectors

linSleepModeEvent Selectors
CAPL Function Overview » LIN » linSleepModeEvent Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

MsgChannel Channel through which the event was received. word

Value range: 1..32

lin_WasAwake Indicates which status the LIN hardware was in before byte read only
the LinSleepModeEvent occurred:

• In Awake status (selector set) or


• In Sleep status (selector not set)

lin_IsAwake Indicates the current state of the LIN hardware: byte read only

• In Awake status (selector set) or


• In Sleep status (selector not set)

lin_External Indicates whether the change of state is the result of byte read only

• an external event (selector set) or

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSleepModeEvent Selectors

• an internal reason (selector not set)

lin_Reason This value indicates the reason for an event. A variety of byte read only
values can be transferred.

General values:
0: Start state

Values upon transition to Sleep mode:


1: SleepModeFrame
2: BusIdle Timeout
3: Silent SleepMode" command (for shortening the
BusIdle Timeout)

Values upon leaving Sleep mode:


9: External Wakeup signal
10: Internal Wakeup signal
11: Bus traffic (can only occur if the LIN hardware does
not have a Master function)

Values if the LIN hardware does not go into Sleep mode


in spite of request to do so:
18: Bus traffic (can only occur if the LIN hardware does
not have a Master function)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linSyncError Selectors

linSyncError Selectors
CAPL Function Overview » LIN » linSyncError Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

MsgChannel Channel through which the event was received. word

Value range: 1..32

lin_SyncInterval [x] Time intervals detected between the falling signal edges word
of the Synch field. The expected time interval between
consecutive falling signal edges is 2 bit times. After the
first failure interval has been seen the rest of array
elements are initialized to 0.

Possible values for x: 0..3.

Unit: Microsecond

breaklen Length of the sync break in ns int64 read only

delimiterlen Length of the sync delimiter in ns int64 read only

SOF Start of Frame timestamp in ns int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linTransmError Selectors

linTransmError Selectors
CAPL Function Overview » LIN » linTransmError Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

LIN_HeaderTime Frame header transmission time. byte read only

Unit: bit time

LIN_Fulltime Entire event transmission time (transmission of the byte read only
frame header by the master and waiting for the
maximum frame duration).

Unit: bit time

ID LIN Frame identifier (6 bits) byte read only

Value range: 0..63

DLC Expected number of data bytes contained in the frame byte


(Data Length Code).

Value range: 0..8

MsgChannel Channel through which the event was received. word read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linTransmError Selectors

Value range: 1..32

lin_FsmID Identifier of the FSM that had to send frame response. byte read only

Only valid if lin_FSMState <> 255.

Value range: 0..63

lin_FsmState The status the FSM is currently in and in which it did not byte
transmit the frame response.

Value range: 0..255

If lin_FsmState = 255 no FSM was configured to responsd


to this frame. The value of lin_FSMId is thus also invalid.

breaklen Length of the sync break in ns int64 read only

delimiterlen Length of the sync delimiter in ns int64 read only

EOH End of header timestamp in ns int64 read only

SOF Start of Frame timestamp in ns int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linWakeupFrame Selectors

linWakeupFrame Selectors
CAPL Function Overview » LIN » linWakeupFrame Selectors

Keyword Description Type Acess limitation

Time Time stamp synchronized with the global time base on dword read only
the PC (CAN hardware or PC system clock).

Unit: 10µs

Time_ns Time stamp synchronized with the global time base on int64 read only
the PC (CAN hardware or PC system clock).

Unit: nanoseconds

MsgOrigTime Time stamp generated by the LIN hardware. This time dword read only
stamp is unsynchronized with the global time base on
the PC and thus still original. It can be used to compare
the time of two LIN hardware generated events.

Unit: 10µs

MsgTimeStampStatus Status of MsgOrigTime: byte read only

Bit 0 set Time stamp is valid

Bit 0 not Time stamp is invalid


set

Bit 1 set Time stamp was generated by software

Bit 1 not Time stamp was generated by hardware


set

Bit 4 Has a bus-specific meaning; not currently


in use for LIN

MsgChannel Channel through which the event was received. word

Value range: 1..32

lin_Signal Signal actually received. byte read only

Because of different baud rates of transmitter and


receiver in Sleep state, this signal can take on the legal
values 0x00, 0x80 (signal actually transmitted) and
0xC0.

lin_External indicates whether the wakeup signal was byte read only

• received by an external device (selector set) or


• transmitted by the LIN hardware itself (selector not
set).

length_ns Length of the wakeup signal in ns. int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: linWakeupFrame Selectors

SOF Start of wakeup signal timestamp in ns int64 read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN: Hardware Configuration

LIN: Hardware Configuration


CAPL Function Overview » LIN » Hardware Configuration

On selecting a LIN channel in the hardware configuration dialog, important parameters for the connected
hardware such as hardware type and firmware version are displayed on the right. Underneath further
hardware settings are displayed:

• Protocol
• Baudrate
• Master Mode
• Master Resistor

The values for these settings are extracted from the LIN database assigned to the channel being displayed.
If no database is currently assigned or the database settings should be overwritten, you can select these
settings manually.

To overwrite the database settings, please activate the Override DB settings option.

Certain network parameters depend on the used protocol version:

LIN 1.x

• Wakeup frame retransmission delay (‘ttobrk’): 125 bit times


• Number of Wakeup frame retransmissions: 3
• Length of Wakeup frame: 8 bit times
• Wakeup delimiter length: 4 bit times
• Byte order: Little-Endian

LIN 2.x

• Wakeup frame retransmission delay (‘ttobrk’): 150 ms


• Number of Wakeup frame retransmissions: 3
• Length of Wakeup frame: 1000 µs
• Wakeup delimiter length: 100 ms
• Byte order: Little-Endian

OEM variant

• Wakeup frame retransmission delay (‘ttobrk’): 50 ms


• Number of Wakeup frame retransmissions: 3
• Length of Wakeup frame: 600 µs
• Wakeup delimiter length: 35 ms
• Byte order: Big-Endian

SAE-J2602

• Wakeup frame retransmission delay (‘ttobrk’): 150 ms


• Number of Wakeup frame retransmissions: 3
• Length of Wakeup frame: 1000 µs
• Wakeup delimiter length: 100 ms

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN: Hardware Configuration

• Byte order: Little-Endian

Cool-LIN

• Settings identical LIN 1.x

| linSendWakeup | linSetWakeupParams |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN: Notes to the Way initial NAD is determined

LIN: Notes to the Way initial NAD is determined


CAPL Function Overview » Notes to the Way initial NAD is determined

If initial NAD is not explicitly specified in the associated database some heuristic is used to determine it.
By default, the configured NAD (an attribute defined in the associated database) is taken. If there are
schedule tables defined they are searched for corresponding AsssignNAD command and initial NAD is
extracted from the parameters of that command.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LIN: Timeout Prevention

LIN: Timeout Prevention


CAPL Function Overview » LIN » Timeout Prevention

The 7259-transceiver implements a dominant timeout of 6 to 20 ms to prevent a faulty slave from


disturbing the LIN bus for a prolonged time. This timeout, however, can lead to problems with low baud
rates. For example, a timeout of 6 ms means that only 6 dominant bits can be sent at 1 kBaud. This
excludes a null byte as well as any valid synch break. It is also impossible to create a dominant
disturbance on the bus using the transceiver alone.

To bypass these limitations, the 7259mag-cab and the 7259mag-piggy contain an auxiliary circuit that is
able to keep the bus level dominant. When using this auxiliary circuit, however, LIN conformant signal
edges can not be guaranteed, particularly for the rising edge of a dominant signal that is longer than 6 ms.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MOST CAPL Functions


(Only available with Option .MOST!)
CAPL Function Overview » MOST CAPL Functions

The following MOST CAPL functions are available:

MOST50

Function Short description

output Sends a message on the MOST ring.

MostAmsOutput Definition and direct dispatch of an AMS message using the syntax from the
MOST specification and the description in the XML function catalog.

OutputMostPkt Sends a packet on the MOST ring.

MostAllocTableGetCL Returns the connection label of the respective entry in the allocation table.

MostAllocTableGetSize Returns the number of entries (connection labels) in the allocation table.

MostAllocTableGetWidth Returns the number of channels of the respective entry (connection label) in
the allocation table.

MostAmsSetSizePrefixed Configures the minimum length of an AMS message above which the size
prefixed mode is used.

MostGetSpecVersion Returns the applied specification version of a MOST channel.

MostGetSpeedGrade Returns the configured speed grade of a MOST channel.

MostSetSyncAudio Programs the routing engine for the audio input or output of the MOST
interface.

MostSetSyncSpdif Programs the routing engine for S/PDIF input or output of the MOST interface.

MostShutDown Performs a network shutdown.

MOST150

Function Short description

output Sends a message on the MOST ring.

MostAmsOutput Definition and direct dispatch of an AMS message using the


syntax from the MOST specification and the description in the
XML function catalog.

OutputMostPkt Sends a packet on the MOST ring.

OutputMostEthPkt Sends out an Ethernet packet over the asynchronous channel.

OutputMostEthPktThis Passes the Ethernet packet on to the next node in the nodal
sequence.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MostAllocTableGetCL Returns the connection label of the respective entry in the


allocation table.
MostAllocTableGetSize Returns the number of entries (connection labels) in the
allocation table.

MostAllocTableGetWidth Returns the number of channels of the respective entry


(connection label) in the allocation table.

MostAmsSetSizePrefixed Configures the minimum length of an AMS message above


which the size prefixed mode is used.

mostConfigureEclSequence Defines a signal sequence for the Electrical Control Line and
prepares the hardware to start the generation.

mostEthPktSetTraceColors Sets the text and background color for displaying the MOST
event in the trace window.

MostGenerateBypassToggle Starts or stops generation of Bypass-open-close transitions.

mostGenerateEclSequence Starts the generation of a signal sequence on the Electrical


Control Line.

MostGetShutdownFlag Returns the current state of the Shutdown flag.

MostGetSpecVersion Returns the applied specification version of a MOST channel.

MostGetSpeedGrade Returns the configured speed grade of a MOST channel.

MostGetSystemLock Returns the number of channels of the respective entry


(connection label) in the allocation table.

mostSetEclGlitchFilter Configures the timing of the glitch filter for the ECL line.

MostSetMacAdr, MostGetMacAdr Sets/gets the MAC address of the MOST interface.

MostSetMasterMode, MostGetMasterMode Configures the timing master as static or non-static master.

mostSetRxBufferAsync Starts or stops draining of the asynchronous receive buffer and


allows to provoke low level retries.

MostSetStressNodeParameter, Configures the stress network interface controller.


MostGetStressNodeParameter

MostSetSyncAudio Programs the routing engine for the audio input or output of
the MOST interface.

MostSetSyncSpdif Programs the routing engine for S/PDIF input or output of the
MOST interface.

MostSetSystemLockFlagUsage, Switches usage of system lock flag.


MostGetSystemLockFlagUsage

MostShutDown Performs a network shutdown.

MostSetShutDownFlagUsage, Switches usage of shutdown flag.


MostGetShutDownFlagUsage

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Evaluation of event procedures

Functions for MOST Controller Short description


Events

MostEventChannel Returns the channel of a MOST controller event.

MostEventTime Returns the time stamp of a MOST controller event.

MostEventOrigTime Returns the hardware-generated time stamp of a MOST controller


event.

Functions for OnMostPkt() Short description

MostPktMsgChannel Returns the channel of the packet event.

MostPktMsgTime Returns the time stamp of the packet event.

MostPktOrigTime Returns the hardware generated time stamp of the packet event.

MostPktSrcAdr Returns the source address of the packet event.

MostPktDestAdr Returns the destination address of the packet event.

MostPktDir Returns the direction of transmission.

MostPktArbitration Returns the packet arbitration value.

MostPktDlc Number of transported data bytes of the packet.

MostPktGetData Copies the data bytes to a provided buffer.

MostPktGetSelData Copies the data bytes starting at a given position to a provided


buffer.

MostPktTelID Returns the TelID of the packet.

MostPktTelLen Returns the TelLen of the packet.

MostPktIsSpy Returns wether the packet was received over the Spy of the
asynchronous channel.

Functions for OnMostReg() Short description

MostRegChip Returns the chip identifier.

MostRegOffset Returns the start address of the register.

MostRegDataLen Returns the number of bytes.

MostRegGetData Copies the data bytes to a provided buffer.

MostRegGetByteAbs Returns the byte value at a given positon.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MostRegGetWordAbs Returns the word value at a given positon.

Hardware API

Electrical Control Line Short description

mostConfigureEclSequence Defines a signal sequence for the Electrical Control Line and
prepares the hardware to start the generation.

mostGenerateEclSequence Starts the generation of a signal sequence on the Electrical Control


Line.

MostGetEcl Returns the current state of the Electrical Control Line.

MostSetEcl Switches the Electrical Control Line.

mostSetEclGlitchFilter Configures the timing of the glitch filter for the ECL line.

MostGetEclTermination Returns the current setting of the Electrical Control Line resistor.

MostSetEclTermination Switches the Electrical Control Line resistor.

Node Addresses - Node Mode Short description

MostSetNodeAdr Sets the node address of the MOST interface.

MostSetGroupAdr Sets the group address of the MOST interface.

MostSetAltPktAdr Sets the alternative packet address of the MOST interface.

MostSetOwnAdr Sets the node and group address of the MOST interface.

MostSetMacAdr, MostGetMacAdr Sets/gets the MAC address of the MOST interface.

MostGetNodeAdr Returns the current node address of the MOST interface.

MostGetGroupAdr Returns the current group address of the MOST interface.

MostGetAltPktAdr Returns the current alternative packet address of the MOST


interface.

MostGetNodePosAdr Returns the current node position address of the MOST interface.

Ring State Short description

MostGetLockEx Returns the current lock status (unlock, lock, stable lock, critical
unlock).

MostGetSBC Returns the current value of the SBC register.

MostSetSBC Sets the value of the SBC register.

MostGetMPR Returns the current value of the MPR register (number of nodes in
the ring).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MostGetNPR Returns the current value of the NPR register (current node position
in the ring).

MostWakeup Generates an optical wake-up signal.

MostGetRxLight Returns the current light status at the FOT input.

MostSetTxLight Sets the light status at the FOT output.

MostGetTxLight Returns the current light status at the FOT output.

MostGetLock Returns the current lock status (unlock, lock)

MostGetAllocTable Copies the MOST Allocation Table to a local buffer.

MostGetCodingErrors Returns the number of coding errors.

MostGetNceType Returns the type of NCE (can only be called within OnMostMPR).

MostSetCorrectStartupSBC Activates or deactivates the correct setting of the 'Synchronous


Bandwidth Control' register (SBC) in the MOST chip.

MostShutDown Performs a network shutdown.

Register Access Short description

MostReadReg Initiates read-out of the registers of a MOST hardware chip.

MostWriteReg Writes to one or more registers of a MOST hardware chip.

Synchronous Channel Allocation Short description


Service

MostSyncAlloc Reserves bandwidth for sending data on the synchronous channel.

MostSyncDealloc Releases reserved bandwidth on the synchronous channel.

Operating Modes Short description

Bypass Mode

MostSetAllBypass Disables or enables the bypass of the MOST interface.

MostGetAllBypass Returns the current bypass status of the MOST interface.

Timing Mode

MostSetMasterMode, Configures the timing master as static or non-static master.


MostGetMasterMode

MostSetTimingMode Sets the timing mode of the MOST interface.

MostGetTimingMode Returns the current timing mode of the MOST interface.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Spy Mode

MostSetSpyAsync Disables or enables the asynchronous spy of the MOST interface.

MostSetSpyCtrl Disables or enables the control spy of the MOST interface.

MostSetSpyEthPkt Disables or enables the Ethernet packet spy of the MOST interface.
MostGetSpyAsync Returns the current asynchronous spy status of the MOST interface.

MostGetSpyCtrl Returns the current control spy status of the MOST interface.

MostGetSpyEthPkt Returns the current Ethernet packet spy status of the MOST
interface.

Stress Mode

MostConfigureBusloadAsync Configures the bus load generator for the asynchronous channel.

MostGenerateBusloadAsync Sends cyclical packets to the asynchronous channel.

MostConfigureBusloadCtrl Configures the bus load generator for the control channel.

MostGenerateBusloadCtrl Sends cyclical messages to the control channel.

MostConfigureBusloadEthPkt Configures the bus load generator for the Ethernet channel.

MostGenerateBusloadEthPkt Configures the bus load generator for the Ethernet channel.

MostGenerateBypassToggle Starts or stops generation of Bypass-open-close transitions.

mostSetRxBufferAsync Starts or stops draining of the asynchronous receive buffer and


allows to provoke low level retries.

MostSetShutDownFlagUsage, Switches usage of shutdown flag.


MostGetShutDownFlagUsage

MostSetStressNodeParameter, Configures the stress network interface controller.


MostGetStressNodeParameter

MostSetSystemLockFlagUsage, Switches usage of system lock flag.


MostGetSystemLockFlagUsage

MostSetTxLightPower Sets the intensity of the light at the Fiber Optical Transmitter (FOT).

MostSetRxBufferCtrl Disables or enables the Rx buffer for messages of the control


channel.

MostGenerateLightError Starts or stops generation of Light-ON-OFF transitions.

MostGenerateLockError Starts or stops generation of Light Unmodulated-Modulated


transitions.

MostSetRetryParameter, Provides access to the transceiver chip parameters for message


MostGetRetryParameter transmission.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Audio

MostSetSyncAudio Programs the routing engine for the audio input or output of the
MOST interface.

MostSetSyncMute Activates or deactivates the audio input or output of the MOST


interface.

MostSetSyncVolume Sets the volume of the audio input or output of the MOST interface.

MostGetSyncMute Returns the current mute status of the audio input or output of the
MOST interface.

MostGetSyncVolume Returns the current volume of the audio input or output of the MOST
interface.

S/PDIF

MostSetSyncSpdif Programs the routing engine for S/PDIF input or output of the MOST
interface.

MostSetSyncSpdifLock Llocks the internal S/PDIF timing generator on the S/PDIF input data
stream.

MostSetSyncSpdifMode Sets the timing mode for the S/PDIF signal.

MostGetSyncSpdifMode Returns the timing mode of the S/PDIF signal.

MostSetClockSource Sets the clock source for the timing master.

MostGetClockSource Returns the clock source of the timing master.

Spy Filter - only for Optolyzer!

MostSetHWFilter Activates or deactivates the hardware filter.

MostGetHWFilter Returns the current status of the hardware filter.

MostSetAndFilter Sets the AND filter.

MostGetAndFilter Returns the current AND filter.

MostSetXorFilter Sets the XOR filter.

MostGetXorFilter Returns the current XOR filter.

Other

MostGetHWCapability Returns specific properties of the attached MOST interface.

MostGetHWInfo Returns specific information of the attached MOST interface (e.g.


hardware type).

MostTwinklePowerLed Twinkles the power LED.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Application Socket API

Function blocks Short description

Registering/ Unregistering

MostApRegister Registers a CAPL node at the Application Socket as function


block.

MostApRegisterEx Registers a function block at the local function block list.

MostApUnregister Removes the function block assigned to a CAPL node from the
Application Socket.

MostApUnregisterEx Removes a function block from the local function block list.

Status

MostApIsAddressed Checks whether the functional MOST address {fblockID, instID}


matches the CAPL node function blocks.

MostApIsRegistered Checks whether a function block assigned to the CAPL node is


registered at the Application Socket.

MostApIsRegisteredEx Checks whether a function block is registered at the Application


Socket.

MostApGetFBlockID Returns the function block identifier (FBlockID) of the CAPL node.

MostApGetInstID Returns the instance identifier (InstID) of the CAPL node.

Read-Out of the Registries Short description

The registries of the Application Socket may be read-out during the entire measurement cycle.

For this purpose CAPL provides the following functions:

MostAsRgGetSize Returns the number of entries in the desired registry.

MostAsRgGetRxTxLog Returns the logical node address of a specific entry in the desired
registry.

MostAsRgGetFBlockID Returns the FBlockID of a specific entry in the desired registry.

MostAsRgGetInstID Returns the InstID of a specific entry in the desired registry.

The 'regsel' parameter is used to select the desired registry:

regsel = 1: Local FBlockList

regsel = 2: Bus Registry

Please note:
The Bus Registry is created in each device during MOST system configuration. It is only valid during
network status 'ConfigOk'. Generally the Network Master administers the Central Bus Registry. The
Network Slaves mirror it in their De-Central Bus Registry.

Changes to registries are signaled in CAPL by the OnMostAsRegistry() event procedure.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Example

Network State Short description

MostGetNetState Returns the current network state of the MOST interface.

Power Master Short description

MostPMResetOverTemperature Signalizes the PowerMaster that the device has reached operating
temperature again.

MostPMSetOverTemperature Signalizes the PowerMaster that an over-temperature in its own


device will be simulated.

MostPMShutDownStart Initiates a system shutdown by the PowerMaster.

MostPMShutDownCancel Aborts system shutdown of the PowerMaster.

MostPMTempShutdownWakeupTimeout Sets the timeout duration, after which the PowerMaster tries to
wake-up the ring after an over-temperature shutdown.

Gateway Node

If more than one MOST channel is allocated to a CAPL node (MOST-MOST gateway) the bus context must be
defined before Application Socket functions are used.

See SetBusContext() regarding this.

Notification Service Short description

MostAsNtfDeviceIDListGetSize Returns the list size of all notification clients registered to a


specific the function.

MostAsNtfDeviceIDListGetDeviceID Returns the deviceID of a specific entry in the notification list.

MostAsNtfEnable, MostAsNtfDisable Enables or disables the notification service for the function block
assigned to the CAPL node.

MostAsNtfEnableEx Enables the notification service for a function block.

MostAsNtfDisableEx Disables the notification service for a function block.

MostAsNtfFunctionCheck Checks whether a notification client (deviceID) is registered in


the notification matrix for a function.

MostAsNtfFunctionClear Clears a notification client entry from the notification matrix of a


specific function.

MostAsNtfFunctionClearAll Clears all notification clients from the notification matrix of a


specific function.

MostAsNtfFunctionEnable Enables the notification service for a specific function.

MostAsNtfFunctionDisable Disables the notification service for a specific function.

MostAsNtfFunctionIsEnabled Checks whether the notification service is enabled for a specific

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

function.

MostAsNtfFunctionEnableEx Enables the notification service for a specific function of a


function block not exclusively assigned to the CAPL node.

MostAsNtfFunctionDisableEx Disables the notification service for a specific function of a


function block not exclusively assigned to the CAPL node.

MostAsNtfFunctionIsEnabledEx Checks whether the notification service is enabled for a specific


function of a function block not exclusively assigned to the CAPL
node.

MostAsNtfFunctionListGetSize Returns the list size of the functions for which a specific
notification client is registered.

MostAsNtfFunctionListGetFunction Returns the function at a given index in the function list for
which a specific notification client is registered.

MostAsNtfFunctionSet Registers a notification client in the notification matrix.

MostAsNtfOutput Sends a message via the notification service to a stated address.

Shadow Service:

MostAsShdEnable Adds an entry to the list of shadowed function blocks.

MostAsShdDisable Removes an entry from the list of shadowed function blocks.

Notification Shadow Service Short description

MostAsNtfShdFunctionEnable Registers a function to the notification shadow service.

MostAsNtfShdFunctionDisable Removes a function from the notification shadow service.

Function Service Short description

MostAsFsEnable Enables the function service for a function block assigned to the
CAPL node.

MostAsFsDisable Disables the function service for a function block assigned to the
CAPL node.

MostAsFsEnableEx Enables the function service for a function block.

MostAsFsDisableEx Disables the function service for a function block.

MostAsFsFunctionEnable Registers a function of the function block assigned to the CAPL


node to the function service.

MostAsFsFunctionEnableEx Registers a function of a given function block to the function


service.

NetBlock Short description

MostNBSetAbilityToWake Sets the AbilityToWake flag in the NetBlock.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Test functions

Test functions Short description

Message Events:

TestGetWaitEventMostAMSMsgData Retrieves the AMS message data of a waiting condition.

TestGetWaitEventMostPkt Provides access to packet data of a waiting condition.

TestGetWaitEventMostRawMsgData Retrieves the CMS raw message data of a waiting condition.

TestGetWaitEventMostMsgData Retrieves the CMS message data of a waiting condition.

TestJoinMostAMSMessageEvent Adds an AMS message to the set of joined events.

TestJoinMostAMSReportEvent Adds an AMS report message (OpType > 8) to the set of joined events.

TestJoinMostAMSSpyMessageEvent Adds an AMS spy message to the set of joined events.

TestJoinMostAMSSpyReportEvent Adds an AMS spy report message (OpType > 8) to the set of joined
events.

TestJoinMostMessageEvent Adds a CMS message to the set of joined events.

TestJoinMostPktEvent Adds a packet to the set of joined events.

TestJoinMostReportEvent Adds a CMS report message (OpType > 8) to the set of joined events.

TestJoinMostSpyMessageEvent Adds a CMS spy message to the set of joined events.

TestJoinMostSpyPktEvent Adds a spy packet to the set of joined events.

TestJoinMostSpyReportEvent Adds a CMS spy report message (OpType > 8) to the set of joined
events.

TestSendMostAMSMessage Sends an AMS message an waits for Tx acknowledgement result.

TestSendMostRawMessage Send a CMS raw message and waits for Tx acknowledgement result.

TestWaitForMostAMSMessage Waits for specific AMS message.

TestWaitForMostAMSReport Waits for specific AMS report message (OpType > 8).

TestWaitForMostAMSRespons Sends a symbolically defined AMS message and waits for the
appropriate response message.

TestWaitForMostAMSResult Sends a symbolically defined AMS message with OpType ‘StartResult’


or ‘StartResultAck’ and waits for the reception of the appropriate
‘Result’ or ‘ResultAck’ message.

TestWaitForMostAMSSpyMessage Waits for specific AMS spy message.

TestWaitForMostAMSSpyReport Waits for specific AMS spy report message (OpType > 8).

TestWaitForMostMessage Waits for specific CMS message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

TestWaitForMostPkt Waits for a specific packet.

TestWaitForMostRawSpyMessage Waits for specific CMS raw spy message.

TestWaitForMostReport Waits for specific CMS report message (OpType > 8).

TestWaitForMostSpyMessage Waits for specific CMS spy message.

TestWaitForMostSpyPkt Waits for a specific spy or node packet.

TestWaitForMostSpyReport Waits for specific CMS spy report message (OpType > 8).

Controller Events:

TestWaitForMostAllBypass Wait for a bypass change event.

TestWaitForMostCriticalUnlock Wait for the occurrence of a LightLock event indicating a critical


unlock state.

TestWaitForMostGroupAdr Waits for group address change event.

TestWaitForMostLightOff Wait for the occurrence of a LightLock event indicating a no light &
no lock state.

TestWaitForMostMPR Waits for a MPR event (NCE).

TestWaitForMostNetState Waits for NetState change event.

TestWaitForMostNodeAdr Waits for a node address change event.

TestWaitForMostNPR Waits for a NPR change event.

TestWaitForMostSBC Wait for SBC change event.

TestWaitForMostShortUnlock Wait for the occurrence of a LightLock event indicating a light & no
lock state.

TestWaitForMostStableLock Wait for the occurrence of a LightLock event indicating a stable


unlock state.

TestMostReadReg Reads one or several MOST chip registers and waits for the result.

TestMostRegGetData Retrieve the register values after a TestMostReadReg or


TestMostWriteReg function was called.

Test MostWriteReg Writes one or several MOST chip registers and waits for the result.

| TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Transmission and receipt settings of nodes

Transmission and receipt Short description


settings of nodes

MostApplicationNode Switches the CAPL node into application mode - only messages (no
spy!) are received/sent fom/on channels to which the CAPL node is
connected to.

MostGetChannel Returns the channel number to which the CAPL node is connected to.

MostRcvSpyMessagesOnly The MOST message handling routines of this node are only called if the
message was received by the Spy of the bus interfaces.

MostStrictChannelMapping The MOST sending and receiving behavior of the node is strictly based
on the configuration in the Simulation Setup.

Message access

Message access Short description

MostPrepareReport Preparation of an AMS message as response (OpType>=9) to a received command


message (OpType<9).

getThisMessage Copies the data of an AMS message into a message variable - Obsolete - see
Initialization of Message Variables!

Message transmission

Message transmission Short description

output Sends a message on the MOST ring.

OutputMostPkt Sends a packet on the MOST ring.

OutputMostPktThis Passes the packet on to the next node in the nodal sequence.

MostAmsOutput Definition and direct dispatch of an AMS message using the syntax from the
MOST specification and the description in the XML function catalog.

MostAmsClearTxQueue Clears all entries in the AMS send buffer.

MostSendError Generates and sends an error message directly based on a received command
message.

Function catalogue

Function catalogue Short description

MostParamGet Query of a parameter value from an AMS message using the parameter name
from the XML function catalog.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MostParamGetData Query of parameters of the String type or RawStream from an AMS message
using the parameter name from the XML function catalog.

MostParamGetString Query of parameters of the String type from an AMS message using the
parameter name from the XML function catalog.

MostParamGetStringAscii Query of parameters of the String type from an AMS message and decode to
ASCII format.

MostParamIsAvailable Check whether a described parameter with the parameter name from the XML
function catalog is in an AMS message.

MostParamSet Setting of a parameter value in an AMS message using the parameter name
from the XML function catalog.

MostParamSetData Setting of parameters of the String type or RawStream in an AMS message using
the parameter name from the XML function catalog.

MostParamSetString Setting of parameters of the String type (for ASCII-coded strings only) or of the
'Enum' type in an AMS message using the parameter name from the XML
function catalog.

MostParamSetStringEnc Encoding and setting of parameters of the String type (for ASCII-coded strings
only).

MostStringToAscii Convert MOST string to ASCII string.

MostMsgDecodeRLE Decodes the data area of a message and saves the function IDs in a list.

MostMsgEncodeRLE Encodes a list of function IDs and saves it in the data area of a message.

MostMsgGetSymbols Determining the symbolic Names of the function block, the function and the
Optype from an AMS or control message using the XML function catalog.

MostMsgSet Populating an AMS message using the syntax from the MOST specification and
the description in the XML function catalog.

MostAmsOutput Definition and direct dispatch of an AMS message using the syntax from the
MOST specification and the description in the XML function catalog.

Fault injection

Fault injection Short description

MostAsFiEnable Enables/disables fault injection for CANoe’s Application Socket services.

MostFiAmsReceive Pretends an AMS message reception to the Application Socket or CAPL


node.

MostNwmFiEnableRingScan Changes the ring scan behavior of CANoe’s Network Master.

MostNwmFiSetConfigState Forces the network configuration status to be set in CANoe’s Network


Master.

MostNwmFiSetParameter, Provide access to the timing parameters of CANoe’s Network Master

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

MostNwmFiGetParameter implementation.

Trace highlighting

Fault injection Short description

mostEthPktSetTraceColors Sets the text and background color for displaying the MOST event in
(MOST150) the Trace window.

mostMHPBlockSetTraceColors

mostMHPConnectionSetTraceColors

mostMHPConnectionSetTraceColors

mostMHPPacketSetTraceColors

mostPktSetTraceColors

traceSetEventColors

The following MOST event procedures are available:

Event procedures

The following event procedures are available with MOST:

General message / packet event Short description


procedures

on mostAMSMessage Is called when a message is received from the Application


Message Service (AMS).

on mostMessage Is called on the receipt of a function catalog conform MOST


frame.

on mostRawMessage Is called on the receipt of MOST frames whose type isn't Normal.

OnMostPkt Is called when a packet is received over the Asynchronous


Channel.

OnMostEthPkt Is called when an Ethernet packet is received over the Packet


Data channel.

MOST High Protocol observer Short description


and combiner event procedures

OnMostMHPBlock Is called up as soon as a block from a MOST High connection has


been fully transmitted.

OnMostMHPPacket Is called up as soon as a MOST High packet is finished.

OnMostMHPConnection Is called as soon as a MOST High connection version 2.2 or higher


is terminated.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

OnMostMHPError Is called up as soon as a MOST High protocol violation is observed.

MOST Controller Event Short description

OnMostAllBypass Is called if the bypass of the MOST chip was opened or closed.

OnMostAllocTable Is called as soon as the hardware interface detects a change in


the MOST Allocation Table.

OnMostCriticalUnlock Is called when a critical unlock is detected.

OnMostEcl Is called when the state of the Electrical Control Line changed.

OnMostGroupAdr Is called when the group address changed.

OnMostMacAdr Is called when the MAC address changed.

OnMostMPR Is called when the value of the MPR register changed (network
change event (NCE)).

OnMostMPRDelayed Is called if the value of the MPR register has not changed since
the last network change event (NCE) for t_MPRDelayed.

OnMostNodeAdr Is called when the node address changed.

OnMostNPR Is called when the value of node position register changed.

OnMostReg Is called in response to read or write requests to registers of a


MOST hardware interface chip.

OnMostSBC Is called when the value of the synchronous bandwidth control


register changed.

OnMostStableLock Is called when stable lock is detected.

OnMostStress Is called before the beginning and after the end of the stress
generation.

OnMostTimingMode Is called if the timing mode of the MOST hardware has been
changed.

OnMostTxLight Is called as soon as the light at the output goes on/off.

on mostLightLockError Is called on controller events.

MOST Application Events Short description

OnMostNetOn / OnMostInitReady Is called when the NetOn / InitReady event (first "Stable Lock"
after he loop has been woken up) has occurred.

OnMostNetState Is called when the network status is changed.

OnMostApInstID Is called when the InstID of the associated function block


changes.

OnMostAsRegistry Is called when the Local FBlockList or Bus Registry is changed.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

Fault injection

Fault injection Short description

OnMostFiAmsPreReceive Is called before an AMS message is received.

OnMostFiAmsPreSend Is called before an AMS message is sent.

MOST50

Function Short description

on mostAMSMessage Is called when a message is received from the Application Message Service
(AMS).

on mostMessage Is called on the receipt of a function catalog conform MOST frame.

OnMostPkt Is called when a packet is received over the Asynchronous channel.

OnMostMsgFragment Is called when the spy detects an incomplete transmission on the Control
channel.

OnMostPktFragment Is called when the spy detects an incomplete transmission on the Packet Data
channel.

OnMostAllocTable Is called as soon as the hardware interface detects a change in the MOST
allocation table.

OnMostSyncAudio Is called after routing of audio input or output of the bus interface.

OnMostSyncSpdif Is called after routing of S/PDIF input or output of the bus interface.

MOST150

Function Short description

on mostAMSMessage Is called when a message is received from the Application Message Service (AMS).

on mostMessage Is called on the receipt of a function catalog conform MOST frame.

OnMostPkt Is called when a packet is received over the Asynchronous channel.

OnMostEthPkt Is called when an Ethernet packet is received over the Packet Data channel.

OnMostMsgFragment Is called when the spy detects an incomplete transmission on the Control
channel.

OnMostPktFragment Is called when the spy detects an incomplete transmission on the Packet Data
channel.

OnMostEthPktFragment Is called when the spy detects an incomplete Ethernet packet transmission.

OnMostMacAdr Is called when the MAC address changed.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST CAPL Functions
(Only available with Option .MOST!)

OnMostAllocTable Is called as soon as the hardware interface detects a change in the MOST
allocation table.

OnMostShutdownFlag Is called each time the state of the Shutdown flag changes.

OnMostSyncAudio Is called after routing of audio input or output of the bus interface.

OnMostSyncSpdif Is called after routing of S/PDIF input or output of the bus interface.

OnMostSystemLock Is called each time the state of the System-Lock flag changes.

Selectors

| Error Codes of CAPL functions | Initialization of message variables | Symbolic identification of parameters | Symbolic identification
of messages | General tips on XML function catalog support in CAPL | MOST high observer and combiner |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAllocTableGetCL

MostAllocTableGetCL
CAPL Function Overview » MOST » MostAllocTableGetCL

Syntax MOST50 / MOST150: long MostAllocTableGetCL(long channel, long idx)

Function Returns the connection label of the respective entry in the allocation table.

Parameters channel

Application channel number.

idx

Index of the entry in the allocation table.

Return values >= 0: Connection label of the concerning entry.

< 0: MOST CAPL error codes.

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP4 • MOST150 • •


• After measurement start
• Not in Stopmeasurement

7.2 SP3 • MOST150, MOST50 • •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAllocTableGetSize

MostAllocTableGetSize
CAPL Function Overview » MOST » MostAllocTableGetSize

Syntax MOST50 / MOST150: long MostAllocTableGetSize(long channel)

Function Returns the number of entries (connection labels) in the allocation table.

Parameters channel

Application channel number.

Return values >= 0: Number of entries.

< 0: MOST CAPL error codes.

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP4 • MOST150 • •


• After measurement start
• Not in Stopmeasurement

7.2 SP3 • MOST150, MOST50 • •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAllocTableGetWidth

MostAllocTableGetWidth
CAPL Function Overview » MOST » MostAllocTableGetWidth

Syntax MOST50 / MOST150: long MostAllocTableGetWidth(long channel, long idx)

Function Returns the number of channels of the respective entry (connection label) in the
allocation table.
Parameters channel

Application channel number.

idx

Index of the entry in the allocation table.

Return values > 0: Number of channels.

< 0: MOST CAPL error codes.

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP4 • MOST150 • •


• After measurement start
• Not in Stopmeasurement

7.2 SP3 • MOST150, MOST50 • •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAmsClearTxQueue

MostAmsClearTxQueue
CAPL Function Overview » MOST » MostAmsClearTxQueue

Syntax long mostAmsClearTxQueue(long channel)

Function Clears all entries in the AMS send buffer.

This command can be used to stop further sending of AMS messages in case of errors (e.g.
critical unlock or light off) or if the system state changes to "NotOk".

Parameters channel

Channel of the connected interface.

Return values <= 0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAmsOutput

MostAmsOutput
CAPL Function Overview » MOST » MostAmsOutput

Syntax mostAmsOutput(long channel, long destAdr, char symbolicMessage[], long


instId)

mostAmsOutput(long channel, char symbolicMessage[], long instId)

mostAmsOutput(long channel, char symbolicMessage[])

Function Definition and direct dispatch of an AMS message using the syntax from the MOST
specification and the description in the XML function catalog.

The description of the message must be complete, i.e. wildcards cannot be used because
the message should then be sent directly. However, the parameter list may be shorter
than specified in the function catalog, in order to be able to generate intentionally
incomplete messages.

Parameters channel

Channel of the connected interface.

destAdr

Destination address.

symbolicMessage

Description of the message content in the following formats:


FBlock.InstanceId.Function.OpType(Parameterlist)

FBlock.InstanceId.Function.OpType

FBlock.Function.OpType(Parameterlist)

FBlock.Function.OpType

InstId

InstanceID of the function block. This explicit entry overwrites the applicable InstanceID
in symbolicMessage. If neither an instance ID nor the instId parameter is specified in
symbolicMessage, the default is set to 1.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

Example
// send 'play' command for DiskPlayer on MOST ring
on key 'p'
{
// Send command on channel 1 to instanceId 1 of functionblock
"AudioDiskPlayer"
mostAmsOutput(1,"AudioDiskPlayer.SourceActivity.StartResult(1,On)",1);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAmsOutput

| General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters | Symbolic Identification of
Messages | Input Assistant | MostParamGet | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetData |
MostParamSetString | MostMsgSet | output |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAmsSetSizePrefixed

MostAmsSetSizePrefixed
CAPL Function Overview » MOST » MostAmsSetSizePrefixed

Syntax MOST50 / MOST150: long MostAmsSetSizePrefixed(long channel, long


minlength);

Function Configures the minimum length of an AMS message above which an initiating message with
TelID==4 is sent.

Parameters channel

Channel of the connected hardware interface.

minlength

Minimum length of an AMS message.

minlength == -1: use the size configured in the hardware configuration dialog, AMS page
minlength == 0: never send an initiating message with TelID==4
minlength >= 46: send an initiating message with TelID==4, when the length of the AMS
message is >=minlength

Note: Maximum value of minlength is 65535 (0xFFFF), since this is the maximum size of an
AMS message.

Return values 0: OK

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

7.2 SP3 MOST150, MOST50 — •

Example

Activate special size prefix length for exactly one AMS message.
MostAmsSetSizePrefixed(1, 46);
MostAmsOutput(1, "Telephone.List.Status(0,1,2,3,4,5,6,7)");
MostAmsSetSizePrefixed(1, -1);

Activate special size prefix length for AMS messages with more than 200 bytes payload.
MostAmsSetSizePrefixed(1, 200);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApGetFBlockID

MostApGetFBlockID
CAPL Function Overview » MOST » MostApGetFBlockID

Syntax long MostApGetFBlockID()

Function MostApGetFBlockID returns the FBlockID of the CAPL node. The function block must be
assigned to the CAPL program exclusively via MostApRegister(fblockID, instIDDefault) or
the database.

Parameters —

Return values >0: Valid FBlockID

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application Socket
is active

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApGetInstID

MostApGetInstID
CAPL Function Overview » MOST » MostApGetInstID

Syntax long MostApGetInstID()

Function MostApGetInstID returns the InstID of the CAPL node. The function block must be
assigned to the CAPL program exclusively via MostApRegister (fblockID, instIDDefault) or
the database.

Parameters —

Return values >0: Valid InstID

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| OnMostApInstID |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApIsAddressed

MostApIsAddressed
CAPL Function Overview » MOST » MostApIsAddressed

Syntax long MostApIsAddressed(long fblockID, long instID)

long MostApIsAddressed(mostAmsMessage * msgCommand)

Function MostApIsAddressed checks whether the functional MOST address {fblockID, instID}
matches the CAPL node function blocks assigned via MostApRegister() or
MostApRegisterEx(). The functional address is permitted to contain wildcard symbols.

This function can be used to determine whether an incoming command message is


destined for the CAPL node.

Parameters fblockID

Function block identifier of the functional address.

instID

Instance identifier of the functional address.

msgCommand

Received command message containing the functional address.

Return values 1: If a MOST application simulated by this CAPL node is addressed.

0: Otherwise

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.0 • MOST — •
• While Application Socket
is active

Example

| MostApRegister | MostApRegisterEx | MostPrepareReport | MostSendError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApIsRegistered

MostApIsRegistered
CAPL Function Overview » MOST » MostApIsRegistered

Syntax long MostApIsRegistered()

Function This function can be used to poll whether the CAPL node is registered as a function block
in the Local FBlockList. The function block must be assigned to the CAPL program via
MostApRegister(fblockID, instIDDefault) or the database.

Parameters —

Return values 1: Function block is registered

0: Function block is not registered

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| MostApRegister | MostApUnregister | MostApGetInstId | MostApGetFBlockId | MostApIsRegisteredEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApIsRegisteredEx

MostApIsRegisteredEx
CAPL Function Overview » MOST » MostApIsRegisteredEx

Syntax long MostApIsRegisteredEx(long fblockID, long instID)

Function This function can be used to poll whether the function block with functional address
{fblockID, instID} is entered in the Local FBlockList.

Parameters fblockID

Function block identifier to be queried.

instID

Instance identifier to be queried.

Return values 1: Function block is registered.

0: Function block is not registered.

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| MostApRegisterEx | MostApUnregisterEx | MostApIsRegistered |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApplicationNode

MostApplicationNode
CAPL Function Overview » MOST » MostApplicationNode

Syntax void MostApplicationNode()

Function This CAPL function can only be called in on preStart and switches the CAPL node into
application mode. The node will

• not receive Spy messages any more,


• only receive messages (mostMessages, mostAmsMessage)from channels to which it is
connected in the simulation setup and
• send messages on the channel to which it is connected in the simulation setup

Info

This mode is especially useful for nodes connected to a single MOST channel
in the simulation setup.
Checks like "if (this.MsgChannel!=XY) return;" or "if (this.IsSpy()) return;" or
event handler "on mostMessage MsgChannel1.*" explicit for a channel can be
omitted. In many cases the assignment of a channel before sending a message
can be omitted.
With declaration of a message variable the channel will be initialized with a
wildcard (0xFFFF), which will be mapped to the channel with which the node
is connected in the simulation setup on transmission.
This makes the CAPL code easily reusable because it is independent of any
hard coded channel numbers.
The application mode is independent of the activation of the application
socket, however it especially utilizes the implementation of function block
behavior.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApRegister

MostApRegister
CAPL Function Overview » MOST » MostApRegister

Syntax long MostApRegister(long fblockID, long instIDDefault)

long MostApRegister()

Function The first function registers the CAPL node at the Application Socket as a function block
with the specified FBlockID and InstIDDefault. The function is available in the CAPL
section on prestart and can be applied once per CAPL node only.

The second function re-registers a previously de-registered CAPL node.

Both functions make an entry in the device's Local FBlockList. If an FBlock with the same
FBlockID and InstID has already been registered by another CAPL node the InstID of the
function block to be registered is incremented until the combination {FBlockID, InstID} is
unique within the simulated device.

As a result of the call of MostApRegister(), if the network status is 'ConfigOk' the


device's NetBlock reports the new Local FBlockList to the Network Master.

Parameters fblockID

Function block identifier to be registered.

instdIDDefault

Default instance identifier. The actual registered InstID can be retrieved with
MostApGetInstID().

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application
Socket is active

Example

| MostApUnregister | MostApIsRegistered | MostApGetInstId | MostApGetFBlockId | OnMostApInstID | MostApRegisterEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApRegisterEx

MostApRegisterEx
CAPL Function Overview » MOST » MostApRegisterEx

Syntax long MostApRegisterEx(long fblockID, long instID)

Function MostApRegisterEx() registers the function block with the Application Socket using the
functional address (fblockID, instID).

It has to be checked in advance, if the functional address already exists


(MostApIsRegisteredEx). If so, another instID has to be selected.

In network status 'ConfigOk' the device's NetBlock reports the new Local FBlockList to the
Network Master.

Parameters fblockID

Function block identifier to be registered.

instID

Instance identifier to be registered.

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| MostApUnregisterEx | MostApIsRegisteredEx | MostApRegister |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApUnregister

MostApUnregister
CAPL Function Overview » MOST » MostApUnregister

Syntax long MostApUnregister()

Function MostApUnregister() removes the function block assigned to the CAPL node by CANdb or
MostApRegister(fblockID, instIDDefault) from the Local FBlockList.

In network status 'ConfigOk' the device's NetBlock reports the new Local FBlockList to the
Network Master.

Parameters —

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| MostApRegister | MostApUnregisterEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostApUnregisterEx

MostApUnregisterEx
CAPL Function Overview » MOST » MostApUnregisterEx

Syntax long MostApUnregisterEx(long fblockID, long instID)

Function Removes the function block with functional address {fblockID, instID} from the Local
FBlockList. It should be noted that CAPL nodes may only remove those function blocks you
have previously registered with MostApRegisterEx.

In network status 'ConfigOk' the device's NetBlock reports the new Local FBlockList to the
Network Master.

Parameters fblockID

Function block identifier to be logged out.

instID

Instance identifier to be logged out.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application Socket
is active

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFiEnable

MostAsFiEnable
CAPL Function Overview » MOST » MostAsFiEnable

Syntax long MostAsFiEnable(long mode)

Function This function allows to temporarily switch the Application Socket Fault Injection on and
off.

Info

To allow Fault Injection in general, the main switch in the Network


Hardware Configuration dialog has to be activated for the corresponding
channel.

The Application Socket Fault Injection allows modifications of the behavior of CANoe’s
Appliction Socket services.

All AMS Tx messages from any Application Socket service will be passed through
OnMostFiAmsPreSend before sending. All AMS Rx messages to any Application Socket
service will be passed through OnMostFiAmsPreReceive before receiving. Incoming and
outgoing messages can be blocked or modified within these callbacks in order to simulate
an imperfect device.

Parameters onoff

0: disable
1: enable

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsEnableEx, MostAsFsDisableEx

MostAsFsEnableEx, MostAsFsDisableEx
CAPL Function Overview » MOST » MostAsFsEnableEx, MostAsFsDisableEx

Syntax long MostAsFsEnableEx(long fblockId, long instId)

long MostAsFsDisableEx(long fblockId, long instId)

Function MostAsFsEnableEx() makes the function service available for a function block.
Furthermore MostAsFsEnableEx() enables the functions <FktIDs>, <Notification> and
<NotificationCheck> of the given function block for the notification service.

MostAsFsDisableEx() disables the function service for a function block.

Parameters fblockId

Function block ID

instId

Instance ID

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application Socket
is active

Example

| MostAsFsFunctionEnableEx | MostAsFsEnable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsEnable, MostAsFsDisable

MostAsFsEnable, MostAsFsDisable
CAPL Function Overview » MOST » MostAsFsEnable, MostAsFsDisable

Syntax long MostAsFsEnable()

long MostAsFsDisable()

Function MostAsFsEnable() makes the function service available for the function block. The
function block must be assigned to the CAPL program via MostApRegister(fblockID,
instIDDefault) or the database. Furthermore MostAsFsEnable() enables the functions
<FktIDs>, <Notification> and <NotificationCheck> of the function block for the notification
service.

MostAsFsDisable() disables the function service.

Parameters —

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application
Socket is active

Example

| MostAsFsEnableEx | MostAsFsFunctionEnable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsFunctionEnable

MostAsFsFunctionEnable
CAPL Function Overview » MOST » MostAsFsFunctionEnable

Syntax long MostAsFsFunctionEnable(long functionId, long opTypes)

long MostAsFsFunctionEnable(long functionId, long opTypes, char


cbSendStatus[])

Function MostAsFsFunctionEnable() registers a function and its operations with the function
service. The service must have been previously enabled for the function block with
MostAsFsEnable.

The second option registers a function with the notification service simultaneously. For
this to be achieved, the function must be of the "Property" type and the notification
service of the function block must have been previously enabled with MostAsNtfEnable.

Database support:

The special value functionID=-1 triggers the execution of the CAPL function for all MOST
functions and operations of the function block from the function catalog.

Parameters functionIdText

Function ID or -1 for all functions of the function block from the database.

cbSendStatus[]

Name of the CAPL function that generates and sends the status message.

If functionID=-1, cbSendStatus designates the prefix of the CAPL send functions to be


defined. If an empty character string is specified, the default prefix "SendStatus_" is used.

opTypes (Property/Method)

Bit 0 OpType = 0x0 (Set/Start)

Bit 1 OpType = 0x1 (Get/Abort)

Bit 2 OpType = 0x2 (SetGet/StartResult)

Bit 3 OpType = 0x3 (Increment/-)

Bit 4 OpType = 0x4 (Decrement/-)

Bit 5 OpType = 0x5 (GetInterface/GetInterface)

Bit 6 OpType = 0x6 (-/StartResultAck)

Bit 7 OpType = 0x7 (-/AbortAck)

Bit 8 OpType = 0x8 (-/StartAck)

Bit 9 OpType = 0x9 (-/ErrorAck)

Bit 10 OpType = 0xA (-/ProcessingAck)

Bit 11 OpType = 0xB (-/Processing)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsFunctionEnable

Bit 12 OpType = 0xC (Status/Result)

Bit 13 OpType = 0xD (-/ResultAck)

Bit 14 OpType = 0xE (Interface/Interface)

Bit 15 OpType = 0xF (Error)

Bit 16 All OpTypes corresponding to 0-15, if they are defined in the XML function
catalog.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application
Socket is active

Example

• MostAsFsFunctionEnable(0x123, 0x8002) enables the 0x123 function with the


"Get" and "Error" operations. The Command Interpreter will then send the error
'OpType not available' for the remaining command OpTypes of the function only.
• MostAsFsFunctionEnable(0x123, 0xFFFF) enables the 0x123 function and all its
operations. The command interpreter will never send 'OpType not available' for this
function.
• MostAsFsFunctionEnable(0x123, 0x01FFFF) enables the 0x123 function and all
operations defined in the XML function catalog.
• MostAsFsFunctionEnable(0x123, 0) disables the 0x123 function
• MostAsFsFunctionEnable(-1, 0x01FFFF) enables all functions and all operations
de-fined in the XML function catalog.
• MostAsFsFunctionEnable(-1, 0) disables all operations of all functions defined in
the XML function catalog.
• MostAsFsFunctionEnable(-1, 0x01FFFF, "SendStatus_") enables all functions
and all operations defined in the XML function catalog. Additionally, functions of type
'property' will be registered at the Notification Service if a corresponding CAPL
function for sending the status message is defined.

| MostAsFsEnable, MostAsFsDisable | MostAsFsFunctionEnableEx | MostAsNtfFunctionEnable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsFunctionEnableEx

MostAsFsFunctionEnableEx
CAPL Function Overview » MOST » MostAsFsFunctionEnableEx

Syntax long MostAsFsFunctionEnableEx(long fblockId, long instId, long functionId,


long opTypes)

long MostAsFsFunctionEnableEx(long fblockId, long instId, long functionId,


long opTypes, char cbSendStatus[])

Function MostAsFsFunctionEnableEx() registers a function and its operations with the function
service. The service must have been previously enabled for the function block with
MostAsFsEnableEx.

The second option registers a function with the notification service simultaneously. For
this to be achieved, the function must be of the "Property" type and the notification
service of the function block must have been previously enabled with MostAsNtfEnableEx.

Database support:

The special value functionID=-1 triggers the execution of the CAPL function for all MOST
functions and operations of the function block from the function catalog.

Parameters fblockId

Function block ID

instId

Instance ID

functionId

Function ID or -1 for all functions of the function block from the database.

cbSendStatus[]

Name of the CAPL function that generates and sends the status message.

If functionID=-1, cbSendStatus designates the prefix of the CAPL send functions to be


defined. If an empty character string is specified, the default prefix "SendStatus_" is used.

opTypes (Property/Method)

Bit 0 OpType = 0x0 (Set/Start)

Bit 1 OpType = 0x1 (Get/Abort)

Bit 2 OpType = 0x2 (SetGet/StartResult)

Bit 3 OpType = 0x3 (Increment/-)

Bit 4 OpType = 0x4 (Decrement/-)

Bit 5 OpType = 0x5 (GetInterface/GetInterface)

Bit 6 OpType = 0x6 (-/StartResultAck)

Bit 7 OpType = 0x7 (-/AbortAck)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsFsFunctionEnableEx

Bit 8 OpType = 0x8 (-/StartAck)

Bit 9 OpType = 0x9 (-/ErrorAck)

Bit 10 OpType = 0xA (-/ProcessingAck)

Bit 11 OpType = 0xB (-/Processing)

Bit 12 OpType = 0xC (Status/Result)

Bit 13 OpType = 0xD (-/ResultAck)

Bit 14 OpType = 0xE (Interface/Interface)

Bit 15 OpType = 0xF (Error)

Bit 16 All OpTypes corresponding to 0-15, if they are defined in the XML function
catalog.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application Socket
is active

Example

• MostAsFsFunctionEnableEx(0x22, 0x01,0x123, 0x8002) enables the 0x123


function with the "Get" and "Error" operations. The Command Interpreter will then
send the error 'OpType not available' for the remaining command OpTypes of the
function only.
• MostAsFsFunctionEnableEx(0x22, 0x01, 0x123, 0xFFFF) enables the 0x123
function and all its operations. The command interpreter will never send 'OpType not
available' for this function.
• MostAsFsFunctionEnableEx(0x22, 0x01, 0x123, 0x01FFFF) enables the 0x123
function and all operations defined in the XML function catalog.
• MostAsFsFunctionEnableEx(0x22, 0x01, 0x123, 0) disables the 0x123 function
• MostAsFsFunctionEnableEx(0x22, 0x01, -1, 0x01FFFF) enables all functions and
all operations defined in the XML function catalog.
• MostAsFsFunctionEnableEx(0x22, 0x01, -1, 0) disables all operations of all
functions defined in the XML function catalog.

| MostAsFsEnableEx, MostAsFsDisableEx | MostAsFsFunctionEnable | MostAsNtfFunctionEnableEx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfDeviceIDListGetSize, MostAsNtfDeviceIDListGetDeviceID

MostAsNtfDeviceIDListGetSize, MostAsNtfDeviceIDListGetDeviceID
CAPL Function Overview » MOST » MostAsNtfDeviceIDListGetSize, MostAsNtfDeviceIDListGetDeviceID

Syntax long MostAsNtfDeviceIDListGetSize(long fblockID, long instID, long


functionID)

long MostAsNtfDeviceIDListGetDeviceID(long fblockID, long instID, long


functionID, long index)

Function The function makes it possible to output the list of all notification clients registered with
the function (functionID). Functionality is similar to command message
FBlock.Notification.Get(functionID).

The notification matrix can be read out with the function without sending a respective
message.

Parameters fblockID

Function block ID

instID

Instance ID

functionID

Function ID

index

Index in the function list

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionCheck | MostAsNtfFunctionListGetSize, MostAsNtfFunctionListGetFunction |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfEnable, MostAsNtfDisable

MostAsNtfEnable, MostAsNtfDisable
CAPL Function Overview » MOST » MostAsNtfEnable, MostAsNtfDisable

Syntax long MostAsNtfEnable()

long MostAsNtfDisable()

Function MostAsNtfEnable() enables the notification service for the function block. The function
block must be assigned to the CAPL program via MostApRegister(fblockID, instIDDefault)
or the database.

MostAsNtfDisable() disables the notification service. The notification matrix is thereby


deleted.

Parameters —

Return values —

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostApIsRegistered | MostAsNtfEnableEx, MostAsNtfDisableEx | MostApplicationNode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfEnableEx, MostAsNtfDisableEx

MostAsNtfEnableEx, MostAsNtfDisableEx
CAPL Function Overview » MOST » MostAsNtfEnableEx, MostAsNtfDisableEx

Syntax long MostAsNtfEnableEx(long fblockID, long instID)

long MostAsNtfDisableEx(long fblockID, long instID)

Function MostAsNtfEnableEx() enables the notification service for the function block.

MostAsNtfDisableEx() disables the notification service. The notification matrix is thereby


deleted.

Parameters fblockID

Function block ID

instID

Instance ID

Return values

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• While Application Socket is
active

Example

| MostApRegisterEx | MostAsNtfEnable, MostAsNtfDisable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionCheck

MostAsNtfFunctionCheck
CAPL Function Overview » MOST » MostAsNtfFunctionCheck

Syntax long MostAsNtfFunctionCheck(long deviceID, long fblockID, long instID, long


functionID)

Function Checks whether a notification client (deviceID) is registered in the notification matrix for
a function.

Parameters deviceID

Addess of the notification client

fblockID

Function block ID

instID

Instance ID

functionID

Function ID

Return values 0: deviceID is not registered

1: deviceID is registered

Other values: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• While Application Socket is
active

Example

| MostAsNtfFunctionListGetSize, MostAsNtfFunctionListGetFunction | MostAsNtfDeviceIDListGetSize,


MostAsNtfDeviceIDListGetDeviceID |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionClear

MostAsNtfFunctionClear
CAPL Function Overview » MOST » MostAsNtfFunctionClear

Syntax long MostAsNtfFunctionClear(long deviceID, long fblockID, long instID, long


functionID)

Function Clears a notification client entry from the notification matrix. Functionality is similar to
command message FBlock.Notification.Set(Clear, deviceID, functionID).

The notification matrix can be written with the function without sending a respective
message.

Parameters deviceID

Addess of the notification client

fblockID

Function block ID

instID

Instance ID

functionID

Function ID

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionCheck | MostAsNtfFunctionSet | MostAsNtfFunctionClearAll |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionClearAll

MostAsNtfFunctionClearAll
CAPL Function Overview » MOST » MostAsNtfFunctionClearAll

Syntax long MostAsNtfFunctionClearAll(long deviceID, long fblockID, long instID)

Function Clears notification client entries from the notification matrix (deviceID >= 0).
Functionality is similar to command message FBlock.Notification.Set(ClearAll, deviceID).

The notification matrix can be written with the function without sending a respective
message.

Parameters deviceID

Address of the notification client

Exception: -1 clears the entire notification matrix

fblockID

Function block ID

instID

Instance ID

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionSet | MostAsNtfFunctionClear |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionEnable, MostAsNtfFunctionDisable, MostAsNtfFunctionIsEnabled

MostAsNtfFunctionEnable, MostAsNtfFunctionDisable,
MostAsNtfFunctionIsEnabled
CAPL Function Overview » MOST » MostAsNtfFunctionEnable, MostAsNtfFunctionDisable, MostAsNtfFunctionIsEnabled

Syntax long MostAsNtfFunctionEnable(long functionID, char cbSendStatus[])

long MostAsNtfFunctionDisable(long functionID)

long MostAsNtfFunctionIsEnabled(long functionID)

Function MostAsNtfFunctionEnable() enables the notification service for a function. The


notification service must be enabled with MostAsNtfEnable() for the function block
beforehand.

The service must have the name of a CAPL function that generates and sends the status
message of the properties. This is necessary, so that the service can send the current
value of the properties with the FBlock.Notification.Set(SetFunction/SetAll) message to
the client when registering a client (see MOST Specification 2.3 Section 2.3.12).

The CAPL function must be defined by the user and display the following signature:
long <FunctionName>(long destAdr)

or
long <FunctionName>(long destAdr, long fblockID, long instID, long
functionID)

The function must generate and send the status message to the destAdr address. If the
status message could be sent, the function has to return the value 0. Otherwise it must
report it to the notification service with the return value -1. The service then sends an
error message (FBlock.Function.Error(0x41)) to the client instead of the status message.

MostAsNtfFunctionDisable() disables the notification service for the function.

MostAsNtfFunctionIsEnabled() returns 1, if the notification service is enabled for the


function.

Database support:

The special value functionID=-1 triggers the execution of the CAPL function for all MOST
functions from the function catalog meeting the following criteria:

• The MOST function must be of the "Property" type.


• A function with the name cbSendStatus+<MOST function name> needs to be defined in
the CAPL program to generate and send the status message.

Parameters functionID

Function ID or -1 for all functions of the function block from the database.

cbSendStatus[]

Name of the CAPL function that generates and sends the status message.

If functionID=-1, cbSendStatus designates the prefix of the CAPL send functions to be


defined. If an empty character string is specified, the default prefix "SendStatus_" is used.

The name of the CAPL function is case sensitive!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionEnable, MostAsNtfFunctionDisable, MostAsNtfFunctionIsEnabled

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application
Socket is active

Example

| MostApRegister | MostAsNtfEnable, MostAsNtfDisable | MostAsNtfFunctionEnableEx, MostAsNtfFunctionDisableEx,


MostAsNtfFunctionIsEnabledEx | MostAsNtfOutput |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionEnableEx, MostAsNtfFunctionDisableEx, MostAsNtfFunctionIsEnabledEx

MostAsNtfFunctionEnableEx, MostAsNtfFunctionDisableEx,
MostAsNtfFunctionIsEnabledEx
CAPL Function Overview » MOST » MostAsNtfFunctionEnableEx, MostAsNtfFunctionDisableEx, MostAsNtfFunctionIsEnabledEx

Syntax long MostAsNtfFunctionEnableEx(long fblockID, long instID, long functionID,


char cbSendStatus[])

long MostAsNtfFunctionDisableEx(long fblockID, long instID, long


functionID)

long MostAsNtfFunctionIsEnabledEx(long fblockID, long instID, long


functionID)

Function The behavior corresponds to the functions MostAsNtfFunctionEnable,


MostAsNtfFunctionDisable, MostAsNtfFunctionIsEnabled. The functions ending with 'Ex' can
also be used, if the CAPL node is not assigned to a function block exclusively.

Parameters fblockID

Function block ID

instID

Instance ID

functionID

Function ID or -1 for all functions of the function block from the database.

cbSendStatus[]

Name of the CAPL function that generates and sends the status message.

If functionID=-1, cbSendStatus designates the prefix of the CAPL send functions to be


defined. If an empty character string is specified, the default prefix "SendStatus_" is used.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostApIsRegisteredEx | MostAsNtfEnableEx, MostAsNtfDisableEx | MostAsNtfFunctionEnable, MostAsNtfFunctionDisable,


MostAsNtfFunctionIsEnabled | MostAsNtfOutput |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionListGetSize, MostAsNtfFunctionListGetFunction

MostAsNtfFunctionListGetSize, MostAsNtfFunctionListGetFunction
CAPL Function Overview » MOST » MostAsNtfFunctionListGetSize, MostAsNtfFunctionListGetFunction

Syntax long MostAsNtfFunctionListGetSize(long deviceID, long fblockID, long


instID)

long MostAsNtfFunctionListGetFunction(long deviceID, long fblockID, long


instid, long index)

Function The function makes it possible to output the list of all functions in which the notification
client (deviceID) is registered. Functionality is similar to command message
FBlock.NotificationCheck.Get(deviceID).

The notification matrix can be read out with the function without sending a respective
message.

Parameters deviceID

Address of the notification client.

Exception: -1 outputs a list of all enabled functions.

fblockID

Function block ID

instID

Instance ID

index

Index in the function list

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionCheck | MostAsNtfDeviceIDListGetSize, MostAsNtfDeviceIDListGetDeviceID |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfFunctionSet

MostAsNtfFunctionSet
CAPL Function Overview » MOST » MostAsNtfFunctionSet

Syntax long MostAsNtfFunctionSet(long deviceID, long fblockID, long instID, long


functionID)

Function Registers a notification client in the notification matrix. Functionality is similar to


command message FBlock.Notification.Set(SetFunction, deviceID, functionID).

The notification matrix can be written with the function without sending a respective
message.

Info

The notification matrix is deleted on NetOn and if the network status changes
to ConfigNotOk.

Parameters deviceID

Address of the notification client

fblockID

Function block ID

instID

Instance ID

functionID

Function ID

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionCheck | MostAsNtfFunctionClear | MostAsNtfFunctionClearAll |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfOutput

MostAsNtfOutput
CAPL Function Overview » MOST » MostAsNtfOutput

Syntax long MostAsNtfOutput(long destAdr, mostMessage msg)

long MostAsNtfOutput(long destAdr, mostAmsMessage msg)

Function destAdr != 0xFFFF:

The command sends the message to the stated address.

destAdr == 0xFFFF:

The message is sent to the address of all notification clients. The FBlockID, InstID and
FunctionID values, which are needed to read the addresses from the notification matrix,
are extracted from the message variable (msg).

Parameters destAdr

Message destination address or 0xFFFF to send to all notification clients.

msg

Message to be sent.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application Socket
is active

Example

| MostAsNtfFunctionEnable, MostAsNtfFunctionDisable, MostAsNtfFunctionIsEnabled |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsNtfShdFunctionEnable, MostAsNtfShdFunctionDisable

MostAsNtfShdFunctionEnable, MostAsNtfShdFunctionDisable
CAPL Function Overview » MOST » MostAsNtfShdFunctionEnable, MostAsNtfShdFunctionDisable

Syntax long MostAsNtfShdFunctionEnable(long fblockId, long instId, long


functionId)

long MostAsNtfShdFunctionDisable(long fblockId, long instId, long


functionId)

Function MostAsNtfShdFunctionEnable() registers a MOST function with the notification shadow


service. As soon as the specified function block (fblockId, instId) appears in the bus
registry of the simulated device, the notification shadow service enters the simulated
device in the notification matrix of the function block, i.e., it sends the
FBlockId.InstId.Notification.Set(SetFunction, functionId) message.

MostAsNtfShdFunctionDisable() removes a MOST function from the notification shadow


service.

Parameters fblockId

Function block ID

instId

Instance ID

functionId

Function ID of a "Property" type function.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application
Socket is active

Example

| MostAsShdEnable, MostAsShdDisable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsRgGetFBlockID

MostAsRgGetFBlockID
CAPL Function Overview » MOST » MostAsRgGetFBlockID

Syntax long MostAsRgGetFBlockID(long regsel, long i)

Function Returns the FBlockID at position i of the registry. Indexing starts at 0.

Parameters regsel

1: Local FBlockList
2: Bus registry

Position of the registry entry.

Return values >=0: FBlockID

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active

Example

| MostAsRgGetSize | OnMostAsRegistry |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsRgGetInstID

MostAsRgGetInstID
CAPL Function Overview » MOST » MostAsRgGetInstID

Syntax long MostAsRgGetInstID(long regsel, long i)

Function Returns the InstID at position i of the registry. Indexing starts at 0.

Parameters regsel

1: Local FBlockList
2: Bus registry

Position of the registry entry.

Return values >=0: InstID

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active

Example

| MostAsRgGetSize | OnMostAsRegistry |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsRgGetRxTxLog

MostAsRgGetRxTxLog
CAPL Function Overview » MOST » MostAsRgGetRxTxLog

Syntax long MostAsRgGetRxTxLog(long regsel, long i)

long MostAsRgGetRxTxLog(long regsel, long fblockId, long instId)

Function The first one returns the logical device address (node address) at position i of the
registry. Indexing starts at 0.

The second one returns the logical device address (node address) of the function block. If
there is no entry with the given FBlockId and InstId, an error code <0 is returned.

Parameters regsel

1: Local FBlockList
2: Bus registry

Position of the registry entry.

fblockId

Function block ID

instId

Instance ID

Return values >=0: Logical device address

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• While Application Socket
is active

Example

| MostAsRgGetSize | OnMostAsRegistry |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsRgGetSize

MostAsRgGetSize
CAPL Function Overview » MOST » MostAsRgGetSize

Syntax long MostAsRgGetSize(long regsel)

Function Determines the number of entries in the registry.

Parameters regsel

1: Local FBlockList
2: Bus registry

Return values >=0: Number

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active

Example

| MostAsRgGetRxTxLog | MostAsRgGetFBlockID | MostAsRgGetInstID | OnMostAsRegistry |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostAsShdEnable, MostAsShdDisable

MostAsShdEnable, MostAsShdDisable
CAPL Function Overview » MOST » MostAsShdEnable, MostAsShdDisable

Syntax long MostAsShdEnable(long fblockId, long instId)

long MostAsShdDisable(long fblockId, long instId)

Function MostAsShdEnable() adds an entry to the list of searched function blocks. If certain
network events occur, CANoe automatically sends a request to the NetworkMaster to
determine the logical device address of the function block.

Registration with MostAsShdEnable(fblockId, 0xFF) causes the service to request the


device addresses of all function blocks with the appropriate FBlockId at the
NetworkMaster.

MostAsShdDisable() removes an entry from the list of searched function blocks.

Parameters fblockId

Function block ID

instId

Instance ID

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application Socket
is active

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadAsync

MostConfigureBusloadAsync
CAPL Function Overview » MOST » MostConfigureBusloadAsync

Note

This function is only available with MOST hardware VN2600/VN2610 and VN2640.

Syntax long MostConfigureBusloadAsync (long channel, long rate, long countertype,


long counterpos, long destadr, long pktdatalen, BYTE pktdata[])

Function The function configures the bus load generator for the asynchronous channel. With the
specified rate the generator tries to send packets.
Due to arbitration delays, the bus load actually generated can deviate from the specified
rate.

As an option, the packets can be supplied with a sequence counter.

Load generation can be started with the MostGenerateBusloadAsync() function.

Bus load can also be generated without CAPL programming using the MOST Stress program
window.

Info

Bus load can also be generated without CAPL programming using the MOST
Stress program window.

Parameters channel

Channel of the connected MOST hardware.

rate

Number of packets per second. The maximum transmission rate depends on the packet
length, the synchronous bandwidth control (SBC) and the MOST loop frequency.

countertype

Sequence counter type:

0 No sequence counter

1 1 byte counter

2 2 byte counter (higher quality byte first)

3 3 byte counter (higher quality bytes first)

4 4 byte counter (higher quality bytes first)

counterpos

Position of the lowest value sequence counter byte.

destadr

Destination address

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadAsync

pktdatalen

Number of user data bytes (MOST25: 0 <= pktdatalen <= 1014; MOST150: 0 <= pktdatalen
<= 1524)

pktdata[]

User data

Return values <= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• Not in StopMeasurement

Example

| MostGenerateBusloadAsync | MostConfigureBusloadCtrl | OutputMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadCtrl

MostConfigureBusloadCtrl
CAPL Function Overview » MOST » MostConfigureBusloadCtrl

Note

This function is only available with MOST hardware VN2600/VN2610 for MOST25 and
VN2640/Optolyzer G2 3150o for MOST150.

Syntax MOST25: long MostConfigureBusloadCtrl(long channel, long rate, long


countertype, long counterpos, long prio, long rtype, long destadr, BYTE
pdata[])

MOST150: MOST150: MostConfigureBusloadCtrl(long rate, mostMessage msg)

Function The function configures the bus load generator for the control channel. Load generation
can be started with the MostGenerateBusloadCtrl() function.

Form 1:

With the specified rate the generator tries to send messages on the control channel.
Due to repeated transmissions or arbitration delays, the bus load actually generated can
deviate from the specified rate.
As an option, the messages can be supplied with a sequence counter.

Form 2:

For Optolyzer G2 3150o, rate specifies the delay between two messages in 10 ms steps
and hence it is not possible to specify number of messages sent per second.

Info

Bus load can also be generated without CAPL programming using the MOST
Stress program window.

Info for VN2600/VN2610

Repeated transmissions on the control channel can be eliminated by setting


the OS8104 transmit retry register (XRTY) to 1 (MostWriteReq()).

Info for VN2640 and Optolyzer G2 3150o

A sequence counter in the stress pattern can be configured with


MostSetStressNodeParameter.

Parameters channel

Channel of the connected MOST hardware.

rate

• VN2600/VN2610: Number of messages per second. At best (optimal arbitration), the


chip can send (frequency * 21 / 1024) messages per second.
• VN2640: Number of messages per second.
• Optolyzer G2 3150o: Control busload speed. Specifies the delay between two
messages: 1 means 10 ms, 2 means 20 ms and so on.

countertype

Sequence counter type:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadCtrl

0 No sequence counter

1 1 byte counter

2 2 byte counter (higher quality byte first)

3 3 byte counter (higher quality bytes first)

4 4 byte counter (higher quality bytes first)

counterpos

Position of the lowest value sequence counter byte.

prio

Sending priority (standard value: 1)

rtype

Message type:

0 Normal

1 RemoteRead

2 RemoteWrite

3 Alloc

4 Dealloc

5 GetSource

See also mostRawMessage - Selectors

destadr

Destination address of the messages.

pdata[]

17 user data bytes; for rtype=normal pdata[0] is the message FBlockID.

msg

Variable of type mostMessage; control busload custom message.

Return values <= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• Not in StopMeasurement

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadCtrl

Example for VN2600/VN2610


// message data
byte data[17] =
{ 0x01,0x00,0xCC,0xC1,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00 };
// configure busload
// channel, rate, countertype, counterpos, prio, rtype, destadr, data
MostConfigureBusloadCtrl(MostGetChannel(), 10, 4, 8, 1, 0, 0x1234, data);
// start busload
MostGenerateBusloadCtrl(MostGetChannel(), 3);

Transmits the following messages:


DestAdr message data
|- counter -|
1234 01 00 CC C1 04 00 00 00 00 00 00 00 00 00 00 00 00
1234 01 00 CC C1 04 00 00 00 01 00 00 00 00 00 00 00 00
1234 01 00 CC C1 04 00 00 00 02 00 00 00 00 00 00 00 00

Example for VN2640

Configure and start bus load stress on keyboard event.


on key 's'
{
long channel, rate;
mostmessage NetBlock.DeviceInfo.Get msg;

channel = 1;
rate = 50; // msgs/s

// set counter type: 1-byte


mostSetStressNodeParameter(channel, 16, 1);

// set counter in byte6 (first user data byte)


mostSetStressNodeParameter(channel, 17, 6);

// configure stress pattern


msg.MsgChannel = channel;
msg.DA = 0x100;
mostConfigureBusloadCtrl(rate, msg);

// start stress: send 10 messages


mostGenerateBusloadCtrl(channel, 10);
}

| MostGenerateBusloadCtrl | MostConfigureBusloadAsync | MostSetStressNodeParameter, MostGetStressNodeParameter |


OnMostStress |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadEthPkt

MostConfigureBusloadEthPkt
CAPL Function Overview » MOST » MostConfigureBusloadEthPkt

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long MostConfigureBusloadEthPkt(long channel, long rate, long


countertype, long counterpos, int64 srcadr, int64 destadr, long datalen,
BYTE data[])

Function The function configures the bus load generator for the Ethernet channel.

As an option, the packets can be supplied with a sequence counter.

Load generation can be started with the MostGenerateBusloadEthPkt function.

Info

Bus load can also be generated without CAPL programming using the MOST
Stress program window.

Parameters channel

Channel of the connected interface.

rate

Number of Ethernet packets per second. The maximum transmission rate depends on the
packet length, the synchronous bandwidth control (SBC) and the MOST loop frequency.
Due to arbitration delays, the bus load actually generated can deviate from the specified
rate.

countertype

Sequence counter type:

0 No sequence counter

1 1 byte counter

2 2 byte counter (higher quality byte first)

3 3 byte counter (higher quality bytes first)

4 4 byte counter (higher quality bytes first)

counterpos

Position of the lowest counter byte.

srcadr

Source MAC address. (6 Byte).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostConfigureBusloadEthPkt

Info

It is possible to set another source MAC address as the own one. The value "-
1" is also valid and is used as wildcard to set the own MAC address.

destadr

Target MAC address (6 Byte).

dataLen

Number of data bytes to be sent (2 <= dataLen <= 1506).

data

Data bytes of the Ethernet packet.

Info

At least two bytes have to be sent (Ethernet Type Field). In case more than
1502 Bytes should be sent, the VLAN Tag has to be set in the first two data
bytes (0x81, 0x00).

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 MOST150 — •

Example

See MostGenerateBusloadEthPkt

| MostGenerateBusloadEthPkt | MostSetStressNodeParameter | MostSetMacAdr | MostSetSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostConfigureEclSequence

mostConfigureEclSequence
CAPL Function Overview » MOST » mostConfigureEclSequence

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long mostConfigureEclSequence (long channel, long numIntervals,


dword[] state, dword[] duration100us)

Function The function prepares VN2640 to generate a signal sequence on the ECL. The signal
sequence can be started with the MostGenerateEclSeq function.

The sequence is defined in two arrays of dword. The first indicates the level (0:
dominant, 1: recessive) of the generators output for each time interval. The second
describes the duration for each time interval.

Parameters channel

Channel of the connected interface.

numIntervals

number of intervals described in the following arrays

state

For each time interval

0: dominant
1: recessive

duration100us

Duration of interval with a resolution of 100 µs.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • MOST150 — •

Example
On key ‘s’
{
dword eclSequenceStates[16] = { 0, 1, 0, 1, 0, 1, 0, 1};
dword eclSequenceDuration[16] = { 100, 100, 100, 100, 100, 100, 100,
100};
// generates a rectangle wave with a period of 200 ms
mostConfigureEclSequence(1, 16, eclSequenceStates, eclSequenceDuration);
ret = mostGenerateEclSequence(1, 1);
}

| mostGenerateEclSequence | MostSetEcl | OnMostEcl | MostSetEclTermination |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostEthPktSetTraceColors

mostEthPktSetTraceColors
CAPL Function Overview » MOST » mostEthPktSetTraceColors

Syntax MOST150: mostEthPktSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST150 • —

Example
OnMostEthPkt
{
mostEthPktSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
OutputMostEthPktThis(); // Forwards this packet to the node in the
measurement setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostEventChannel, MostEventTime, MostEventOrigTime, MostEventTimeNs

MostEventChannel, MostEventTime, MostEventOrigTime,


MostEventTimeNs
CAPL Function Overview » MOST » MostEventChannel, MostEventTime, MostEventOrigTime, MostEventTimeNs

Note

The following functions can be use within the event procedures for MOST controller
events to call up further information on events.

Syntax long MostEventChannel()

DWORD MostEventTime()

DWORD MostEventOrigTime()

float MostEventTimeNs()

Function long MostEventChannel() returns the channel over which the event arrived.

DWORD MostEventTime() returns the time stamp of the event (Units: 10 µs).

DWORD MostEventOrigTime() returns the hardware-generated time stamp of the event


(Units: 10 µs).

float MostEventTimeNs() returns the time stamp of the event (Units: 1 ns).

Parameters —

Return values Time stamp

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example
OnMostNodeAdr(long nodeadr)
{
write("Node address changed to %04X on channel %d at %fs",
nodeadr,
MostEventChannel(),
MostEventTime() / 100000.0);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example: Read-Out of the Registries

Example: Read-Out of the Registries


CAPL Function Overview » MOST » Example: Read-Out of the Registries

In the following example whenever a registry changes its contents are output to the Write window.
OnMostAsRegistry(long regsel)
{
long size, i;
long rxtxlog, fblockid, instid;
// display registry type
if(regsel == 1)
write("Local Registry:");
else if(regsel == 2)
write("Bus Registry:");
// get registry size
size = MostAsRgGetSize(regsel);
// print the whole registry
write("Adr FBlock InstID");
for(i = 0; i < size; ++i)
{
rxtxlog = MostAsRgGetRxTxLog(regsel,i);
fblockid = MostAsRgGetFBlockID(regsel,i);
instid = MostAsRgGetInstID(regsel,i);
write("%04X %02X %02X", rxtxlog, fblockid, instid);
}
}
Bus Registry:
Adr FBlock InstID
0100 02 00
0100 04 01
0100 C0 01
0101 C1 01
0101 C5 01

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostFiAmsReceive

MostFiAmsReceive
CAPL Function Overview » MOST » MostFiAmsReceive

Syntax MostFiAmsReceive(mostAmsMessage * msg)

Function Simulates the receipt of an AMS message to the simulation node (CAPL program or node
layer module).

MostFiAmsReceive can only be used within the callback OnMostFiAmsPreReceive or


OnMostFiAmsPreSend. If MostFiAmsReceive is called more than once within the callback,
only the last fed-in message is passed on to the simulation node.

Altered received messages are neither displayed in the trace window nor logged. They are
only visible for the one node in the simulation setup from which MostFiAmsReceive was
called.

Exception: a CAPL program with fault injection for the MOST application socket (see
MostAsFiEnable) can call MostFiAmsReceive as many times as necessary and at any time
in order to simulate a received message to the CANoe-side application socket. These
altered messages are then visible only for the services of the MOST application socket in
CANoe.

Parameters msg

AMS message that is to be received by the simulation node.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example

See OnMostFiAmsPreReceive

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateBusloadAsync

MostGenerateBusloadAsync
CAPL Function Overview » MOST » MostGenerateBusloadAsync

Note

This function is only available with MOST hardware VN2600/VN2610 for MOST25 and
VN2640/Optolyzer G2 3150o for MOST150.

Syntax long MostGenerateBusloadAsync (long channel, long pkts)

Function The function sends cyclical packets to the asynchronous channel. Use the
MostConfigureBusloadAsync() function to specify the send parameters and contents of the
packets.

Info for Optolyzer G2 3150o

This function shows no effect if the StressNIC is not set to slave mode. For
that purpose use MostSetStressNodeParameter with the proper parameter.

Parameters channel

Channel of the connected MOST hardware.

pkts

0 Stops the busload generation

>0 Sends the given number of packets

-1 Sends continual packets

Return values <= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGenerateBusloadCtrl | MostGenerateLightError | MostGenerateLockError | MostConfigureBusloadAsync | OutputMostPkt |


OnMostStress |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateBusloadCtrl

MostGenerateBusloadCtrl
CAPL Function Overview » MOST » MostGenerateBusloadCtrl

Note

This function is only available with MOST hardware VN2600/VN2610 for MOST25 and
VN2640/Optolyzer G2 3150o for MOST150.

Syntax long MostGenerateBusloadCtrl (long channel, long msgs)

Function The function sends cyclical messages to the control channel. Use the
MostConfigureBusloadCtrl() function to specify the send parameters and contents of the
message.

Info for Optolyzer G2 3150o

This function shows no effect if the StressNIC is not set to slave mode. For
that purpose use MostSetStressNodeParameter function with the proper
parameter.

Parameters channel

Channel of the connected MOST hardware.

pkts

0 Stops the busload generation

>0 Sends the given number of packets

-1 Sends continual packets

Return values <= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGenerateBusloadAsync | MostGenerateLightError | MostGenerateLockError | MostConfigureBusloadCtrl | OnMostStress |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateBusloadEthPkt

MostGenerateBusloadEthPkt
CAPL Function Overview » MOST » MostGenerateBusloadEthPkt

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long MostGenerateBusloadEthPkt(long channel, long pkts)

Function The function sends cyclical packets on the Ethernet channel. Use the
MostConfigureBusloadEthPkt function to specify the send parameters and payload pattern.

Parameters channel

Channel of the connected interface.

pkts

0 Stops the busload generation

>0 Sends the given number of packets

-1 Sends continual packets

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 MOST150 — •

Example

Configure and start bus load stress on keyboard event.


on key 's'
{
long i, channel, rate, countertype, counterpos, datalen;
int64 srcadr, destadr;
byte data[1506];

channel = 1;
srcadr = -1LL; // use own MAC address as source
destadr = 0x010203040506LL;
rate = 50; // packets per second
countertype = 4; // 4 byte counter
counterpos = 9; // counter in byte6..byte9
datalen =300;

// fill payload of stress packet


for(i = 0; i < datalen; ++i)
data[i] = (byte)i;

// configure stress pattern


mostConfigureBusloadEthPkt(channel, rate, countertype, counterpos,
srcadr, destadr, datalen, data);

// start generation of 500 packets


mostGenerateBusloadEthPkt(channel, 500);
}

| MostConfigureBusloadEthPkt | OnMostStress | MostSetMacAdr | OutputMostEthPkt | MostSetSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateBypassToggle

MostGenerateBypassToggle
CAPL Function Overview » MOST » MostGenerateBypassToggle

Note

This functionality is only available for

• VN2640
• OptoLyzer G2 3150o (At least firmware version V1.5.3 is required)

Syntax MOST150: long MostGenerateBypassToggle(long channel, long invistime, long


vistime, long repeat)

Function Starts (repeat > 0) or stops (repeat = 0) generation of Bypass-open-close transitions.

VN2640:
The bypass of the INIC used for simulation and stimulation is toggled. The node has to be
in slave mode.
The range for timing values is 10…65535 ms.

Optolyzer:
The bypass of the additional stress network interface controller (NIC) in the OptoLyzer G2
3150o is switched. The bypass of the main NIC (which is responsible for sending and
receiving) is not affected.

The stress network interface controller (NIC) must have active bypass or bypass opened
(see MostSetStressNodeParameter ).

Parameters channel

Channel of the connected interface

invistime

Time during which node has its bypass closed (in ms)

vistime

Time with opened bypass (in ms)

repeat

0: Stop stress
>0: Number of transitions
0xFFFF: Generate transitions continually

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example
// prepare stress NIC: set "active" bypass
MostSetStressNodeParameter(1, 3, 2);
// make the stress NIC visible two times for 50 ms each
MostGenerateBypassToggle(1, 100, 50, 2);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateBypassToggle

| OnMostStress | OnMostMPR | MostGenerateLockError | MostSetAllBypass | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostGenerateEclSequence

mostGenerateEclSequence
CAPL Function Overview » MOST » mostGenerateEclSequence

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long mostGenerateEclSequence (long channel, long startstop)

Function Starts the generation of the signal sequence on the ECL which was prepared by
mostConfigureEclSequence. Dominant levels will be set actively whereas during recessive
phases the generator is passive and other devices connected to the ECL may pull the line
to dominant level.

Parameters channel

Channel of the connected interface.

startstop

0: stops the generation of the sequence


1: starts the generation of the sequence

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • MOST150 — •

Example

See mostConfigureEclSequence

| mostConfigureEclSequence | MostSetEcl | OnMostEcl | MostSetEclTermination |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateLightError

MostGenerateLightError
CAPL Function Overview » MOST » MostGenerateLightError

Note

This functionality is available for VN2600/VN2610 hardware and OptolyzerOL3150o


(firmware version >= V1.5.3).

Syntax long MostGenerateLightError(long channel, long lightofftime, long


lightontime, long repeat)

Function Starts (repeat > 0) or stops (repeat = 0) generation of Light-ON-OFF transitions.

For OptolyzerOL3150o: The stress network interface controller (NIC) must have active
bypass or bypass opened (see MostSetStressNodeParameter).

Parameters channel

Channel of the connected interface.

lightofftime

Time during which no light is emitted (in ms).

lightontime

Time during which modulated light is emitted (in ms).

repeat

0 Stop Light-Off-On transitions

>0 Number of Light-Off-On transitions

0xFFFF Generate Light-Off-On transitions continually

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.1 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGenerateBusloadAsync | MostGenerateBusloadCtrl | MostGenerateLockError | OnMostStress | MostGetChannel | on


mostLightLockError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGenerateLockError

MostGenerateLockError
CAPL Function Overview » MOST » MostGenerateLockError

Note

This functionality is only available for VN2600/VN2610 hardware, OptolyzerOL3150o


(firmware version >= V1.5.3) and OptolyzerOL3050e (firmware version >= V1.5).

Syntax long MostGenerateLockError(long channel, long unmodtime, long modtime, long


repeat)

Function Starts (repeat > 0) or stops (repeat = 0) generation of Light Unmodulated-Modulated


transitions.

For OptolyzerOL3150o: The stress network interface controller (NIC) must have its bypass
opened (see MostSetStressNodeParameter).

Parameters channel

Channel of the connected interface.

unmodtime

Time during which unmodulated light is emitted (in ms).

modtime

Time during which modulated light is emitted (in ms).

repeat

0 Stops the generation of Unmodulated-Modulated transitions

>0 Number of transitions

0xFFFF Generate Unmodulated-Modulated transitions continually

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.1 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGenerateBusloadAsync | MostGenerateBusloadCtrl | MostGenerateLightError | OnMostStress | MostGetChannel | on


mostLightLockError | MostGenerateBypassToggle |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetAllBypass

MostGetAllBypass
CAPL Function Overview » MOST » MostGetAllBypass

Syntax long MostGetAllBypass(long channel)

Function Return indicates whether the MOST hardware bypass is closed (Return value = 1) or open
(Return value = 0).

Parameters channel

Channel of the connected hardware.

Return values 0: Bypass is opened

1: Bypass is closed

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• Not in StopMeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetAllocTable

MostGetAllocTable
CAPL Function Overview » MOST » MostGetAllocTable

Note

This functionality is only available for VN2600/VN2610 and Optolyzer hardware.

Syntax long MostGetAllocTable(long channel, byte buffer[], long buffersize)

Function The MostGetAllocTable() function copies the MOST Allocation Table (max. 60 bytes) to
a local CAPL buffer. It must be verified that the buffer has the required size (buffersize).

The Allocation Table contains the reservation status of the synchronous MOST channels.

Parameters channel

Channel of the connected Interface.

buffer

Destination buffer

buffersize

Destination buffer size

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.1 • MOST • •
• After measurement start
• Not in Stopmeasurement

Example
byte allocTable[60];
// copy allocation table to local buffer
MostGetAllocTable(MostGetChannel(), allocTable, elcount(allocTable));

| OnMostAllocTable | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetAndFilter

MostGetAndFilter
CAPL Function Overview » MOST » MostGetAndFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

AND-Filter

Syntax long MostGetAndFilter( long channel, long arb, long targetAdr, long
sourceAdr, long type, byte msg[17], long crc, long ack)

Function Retrieves the status of the AND filter.

Parameters channel

Channel of the connected interface.

arb

Arbitration byte

targetAdr

Destination address

sourceAdr

Source address

type

Message type

msg

Use data bytes of the MOST frame

crc

CRC code

ack

Acknowledge field of the MOST frame

Return values <0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

3.2 • MOST — •
• Not in StopMeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetAndFilter

| MostGetChannel | MostSetAndFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetChannel

MostGetChannel
CAPL Function Overview » MOST » MostGetChannel

Syntax mostGetChannel ()

Function This query returns the number of the MOST channel to which the CAPL node is connected
in the Simulation Setup.

This query is especially useful with nodes that are only connected to one MOST channel in
the Simulation Setup. The return value can be used directly as a parameter for all CAPL
functions that expect specification of a channel, e.g. in driving the hardware interface.

With the help of this function CAPL programs can be created such that they are
independent of channel numbers. By proper configuration of the Simulation Setup the
user can choose the MOST interface over which the node should be operated.

Parameters —

Return values 0: the node is not connected to any MOST channel in the Simulation Setup

1..16: the allocated MOST channel

0xFFFF: The node is connected to more than one MOST channel and may operate as a
Gateway. The user must choose, on a case-by-case basis, the MOST channel over which
the node should operate.

In this case, channel numbers and bus names from the Simulation Setup are determined
by the getBusContext or getBusNameContext function.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

| getBusNameContext | getBusContext | MostStrictChannelMapping | MostApplicationNode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetClockSource

MostGetClockSource
CAPL Function Overview » MOST » MostGetClockSource

Note

This function is only available with MOST hardware VN2610.

Syntax long MostGetClockSource(long channel)

Function Returns the clock source for the MOST timing master.

Parameters channel

Channel of the connected interface

Return values 0: Internal oscillator.

1: Synchronizes the timing master clock to the S/PDIF input signal. The bus interface must
be configured as S/PDIF timing slave.

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

| MostSetTimingMode | MostSetSyncSpdifMode | MostGetSyncSpdifMode | MostSetClockSource | MostSetSyncAudio |


MostSetSyncSpdif |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetCodingErrors

MostGetCodingErrors
CAPL Function Overview » MOST » MostGetCodingErrors

Note

This function is only available with MOST hardware VN2600/VN2610.

Syntax long MostGetCodingErrors (long channel)

Function Returns the number of coding errors since measurement start or the last time this
function was called.

Info

Calling this function resets the counter in the hardware! The total number of
coding errors during measurement is displayed in Bus Statistic window.

Parameters channel

Channel of the connected interface

Return values >= 0: Number of coding errors.

< 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• Not in StopMeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWCapability

MostGetHWCapability
CAPL Function Overview » MOST » MostGetHWCapability

Syntax long MostGetHWCapability(long channel, long capID)

Function MostGetHWCapability()can be used to query the properties of the MOST interface used.

Parameters channel

Channel of the connected interface.

capID

The ID decides the meaning of the return value.

ID Return value Description of the return


value

kMostHWCap_MaxNumberOfInstances = 0 >0 Number of interfaces of


this type being used
simultaneously

kMostHWCap_MaxWriteOS8104Registers = 1 >=0 Number of OS8104


registers that can be
written with a command

kMostHWCap_MaxReadOS8104Registers = 2 >=0 Number of OS8104


registers that can be read
with a command

kMostHWCap_TwinklePowerLed = 3 0, 1 1: The
MostTwinklePowerLed
command functions with
the interface

kMostHWCap_LightLockStress = 4 0, 1 1: The
MostGenerateLightError
and
MostGenerateLockError
commands function with
the interface

kMostHWCap_CtrlNode = 8 0, 1 1: Can be operated in


Node Mode for the control
channel
(sending/receiving control
messages)

kMostHWCap_CtrlSpy = 9 0, 1 1: Can be operated in Spy


Mode for the control
channel

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWCapability

kMostHWCap_CtrlNodeAndSpySimultaneous = 0, 1: Can be operated


10 1 simultaneously in Node and Spy
Mode (control channel)

kMostHWCap_CtrlNodeAndSpyEventDoubling = 0, 1: Always generates node and


11 1 spy message for a received
message from the control
channel

kMostHWCap_CtrlRxBufferFullSimulation = 12 0, 1: The MostSetRxBufferCtrl


1 command functions with the
interface

kMostHWCap_AsyncNode = 16 0, 1: Can be operated in Node Mode


1 for the asynchronous channel

kMostHWCap_AsyncSpy = 17 0, 1: Can be operated in Spy Mode


1 for the asynchronous channel

kMostHWCap_AsyncNodeAndSpySimultaneous = 0, 1: Can be operated


18 1 simultaneously in Node and Spy
Mode (asynchronous channel)

kMostHWCap_AsyncNodeAndSpyEventDoubling 0, 1: Always generates node and


= 19 1 spy message for a received
message from the asynchronous
channel

kMostHWCap_SyncAnalogInChannels = 24 >=0 Number of analog-in channels


(16 bit stereo)

kMostHWCap_SyncAnalogOutChannels = 25 >=0 Number of analog-out channels


(16 bit stereo)

kMostHWCap_SyncAnalogInMute = 26 0, 1: Can mute the analog-in


1 channel

kMostHWCap_SyncAnalogOutMute = 27 0, 1: Can mute the analog-out


1 channel

kMostHWCap_SyncAllocTableReporting = 28 0, 1: Reports changes to the


1 allocation table

Return values >=0: Property value

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWCapability

| MostGetChannel | MostGetHWInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWFilter

MostGetHWFilter
CAPL Function Overview » MOST » MostGetHWFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

Filter Mode

Syntax long MostGetHWFilter(long channel)

Function Returns 1 if hardware filter is active, otherwise 0.

Parameters channel

Channel of the connected interface

Return values 0: HW filter inactive

1: HW filter active

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

3.2 • MOST — •
• Not in StopMeasurement

Example

| MostGetChannel | MostSetHWFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWInfo

MostGetHWInfo
CAPL Function Overview » MOST » MostGetHWInfo

Syntax long MostGetHWInfo(long channel, long infoID)

long MostGetHWInfo(long channel, long infoID, char infostring[], long


buffersize)

Function Provides information about the MOST interface used.

Parameters channel

Channel of the connected interface.

infoID

The ID decides the meaning of the return value.

ID Return value Description of the return value

kMostHWInfo_Type = 0 >0 Interface type:

1: VN2600/VN2610
2: Optolyzer
3: —
4: OptoLyzer G2 3150o
5: VN2640
6: OptoLyzer G2 3050e
7: PCI Interface 50e

kMostHWInfo_SimulationMode 0, 1 0: real
=1 1: simulated

kMostHWInfo_Manufacturer = 2 Manufacturer:
"Vector", "SMSC"

kMostHWInfo_SyncMode = 3 >=0 Synchronization mode:

0: off
1: SW Sync active
2: HW Sync active (bus interface on
<channel> is Sync Master)
3: HW Sync active (bus interface on
<channel> is Sync Slave)

kMostHWInfo_SyncStatus = 4 >=0 Synchronization status:

0: HW Sync not active


1: HW Sync active
2: HW Sync works correctly

infostring

Target buffer to which text information is copied.

buffersize

Size of the target buffer.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetHWInfo

Return values >=0: Informations value

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| MostGetChannel | MostGetHWCapability |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetLock

MostGetLock
CAPL Function Overview » MOST » MostGetLock

Syntax long MostGetLock(long channel)

Function Queries the Lock Status of the MOST hardware.

Parameters channel

Channel of the interface to be queried.

Return values 1: Lock

0: Unlock

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

3.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetLockEx | MostSetTxLight | MostGetTxLight | on mostLightLockError | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetLockEx

MostGetLockEx
CAPL Function Overview » MOST » MostGetLockEx

Syntax long MostGetLockEx (long channel)

Function The function returns the lock status of the connected MOST hardware. In contrast to
MostGetLock(), the additional states "Stable Lock" and "Critical Unlock" are considered
according to MOST specification 2.3.

Parameters channel

Channel of the connected MOST hardware.

Return values 0: Unlock

1: Lock

2: Stable Lock

3: Critical Unlock

<= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetLock | OnMostStableLock | OnMostCriticalUnlock | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetMPR

MostGetMPR
CAPL Function Overview » MOST » MostGetMPR

Syntax long MostGetMPR (long channel)

Function This function returns the "Maximum Position Register (MPR)" value of the MOST hardware
chip connected to the channel. If the loop is stable, MPR represents the number of
devices with opened bypass.

Parameters channel

Channel of the connected MOST hardware.

Return values > 0: MPR value

<= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| OnMostMPR | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetNceType

MostGetNceType
CAPL Function Overview » MOST » MostGetNceType

Syntax long MostGetNceType()

Function Returns the type of network change event (NCE) (when changing the MPR register).

Info

This function can only be called within the OnMostMPR() event procedure.

Parameters —

Return values < 0: NCE-. The absolute value corresponds to the number of devices which closed their
bypass.

0: No information available (e.g. first MPR register event, the function was not called in
the OnMostMPR() event procedure).

> 0: NCE+. The value corresponds to the number of devices which opened their bypass.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetNetState

MostGetNetState
CAPL Function Overview » MOST » MostGetNetState

Syntax long MostGetNetState()

Function Returns the current network state.


For definition of network states see OnMostNetState.

Parameters —

Return values Network status: see OnMostNetState

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetNodeAdr, MostGetGroupAdr, MostGetAltPktAdr, MostGetNodePosAdr

MostGetNodeAdr, MostGetGroupAdr, MostGetAltPktAdr,


MostGetNodePosAdr
CAPL Function Overview » MOST » MostGetNodeAdr, MostGetGroupAdr, MostGetAltPktAdr, MostGetNodePosAdr

Syntax long MostGetNodeAdr(long channel)

long MostGetGroupAdr(long channel)

long MostGetAltPktAdr(long channel)

long MostGetNodePosAdr(long channel)

Function Return of the node address, group address, alternative packet address or node position
address of the MOST hardware associated with the specified channel.

Parameters channel

Channel of the connected interface.

Return values NodeAdr: Logical node address

GroupAdr: Group address

AltPktAdr: Alternative packet address

NodePosAdr: Node position address

<0: See error codes

Availability Since Version Restricted to Measurement Simulation /


Setup Test Setup

3.2 • MOST — •
• Not in
StopMeasurement

5.0: • MOST — •
MostGetAltPktAdr
• Not in
StopMeasurement

Example

| MostSetNodeAdr, MostSetGroupAdr, MostSetAltPktAdr, MostSetOwnAdr | OnMostNodeAdr | OnMostGroupAdr | OnMostNPR |


MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetNPR

MostGetNPR
CAPL Function Overview » MOST » MostGetNPR

Syntax long MostGetNPR (long channel)

Function This function returns the "Node Position Register (NPR)" value of the MOST hardware chip
connected to the channel.

Parameters channel

Channel of the connected MOST hardware.

Return values > 0: NPR value

<= 0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetNodeAdr, MostGetGroupAdr, MostGetAltPktAdr, MostGetNodePosAdr | OnMostNPR | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetRxLight

MostGetRxLight
CAPL Function Overview » MOST » MostGetRxLight

Syntax long MostGetRxLight(long channel)

Function Queries the Light Status at the Fiber Optical Receiver (FOR).

Parameters channel

Channel of the interface to be queried.

Return values 1: Light on

0: Light out

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.1 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostSetTxLight | MostGetTxLight | on mostLightLockError | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSBC

MostGetSBC
CAPL Function Overview » MOST » MostGetSBC

Syntax long MostGetSBC (long channel)

Function This function returns the "Synchronous Bandwidth Control (SBC) Register" value of the
MOST hardware chip connected to the channel.

Parameters channel

Channel of the connected MOST hardware.

Return values >= 0: Current value of the SBC register

< 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• Not in StopMeasurement

Example

| MostSetSBC | OnMostSBC | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetShutdownFlag

MostGetShutdownFlag
CAPL Function Overview » MOST » MostGetShutdownFlag

Syntax MOST150: long MostGetShutdownFlag(long channel)

Function Returns the current state of the Shutdown flag.

Parameters channel

Application channel number.

Return values 1: Shutdown Flag set.

0: Shutdown Flag not set.

< 0: MOST CAPL error codes.

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP4 • MOST150 — •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSpecVersion

MostGetSpecVersion
CAPL Function Overview » MOST » MostGetSpecVersion

Syntax long MostGetSpecVersion(long channel)

Function Returns the applied specification version of a MOST channel.

Parameters channel

Application channel number.

Return values Version of MOST Specification

0x0205: version 2.5


0x0300: version 3.0

Info

Currently the MOST Specification version depends on the chosen speed grade:

• MOST25: Version 2.5


• MOST50 / MOST150: Version 3.0

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP2 • MOST — •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSpeedGrade

MostGetSpeedGrade
CAPL Function Overview » MOST » MostGetSpeedGrade

Syntax long MostGetSpeedGrade(long channel)

Function Returns the configured speed grade of a MOST channel.

Parameters channel

Application channel number.

Return values Speed grade

1: MOST25
2: MOST50
3: MOST150

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP2 • MOST — •


• After measurement start
• Not in Stopmeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSpyCtrl, MostGetSpyAsync, MostGetSpyEthPkt

MostGetSpyCtrl, MostGetSpyAsync, MostGetSpyEthPkt


CAPL Function Overview » MOST » MostGetSpyCtrl, MostGetSpyAsync, MostGetSpyEthPkt

Syntax long MostGetSpyCtrl(long channel)

long MostGetSpyAsync(long channel)

MOST150: long MostGetSpyEthPkt(long channel)

Function Determines whether Spy mode for the Control, Asynchronous or Ethernet transmission
channel is activated (Return value = 1) or deactivated (Return value = 0).

Parameters channel

Channel of the connected interface.

Return values 0: Spy inactive

1: Spy activated

<0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• Not in StopMeasurement

7.6 SP2 • MOST150 — •


• Not in StopMeasurement

Example

| MostGetChannel | MostSetSpyCtrl, MostSetSpyAsync, MostSetSpyEthPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSyncMute

MostGetSyncMute
CAPL Function Overview » MOST » MostGetSyncMute

Syntax long MostGetSyncMute(long channel, long device)

Function Returns the mute status of the audio input or output.

Parameters channel

Channel of the connected interface.

device

0: Line-In
1: Line-Out
2: S/PDIF In (VN2640 only)
3: S/PDIF Out (VN2640 only)

Return values 0: mute off

1: mute on

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetChannel | MostSetSyncAudio | MostSetSyncVolume | MostSetSyncMute | MostGetSyncVolume |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSyncSpdifMode

MostGetSyncSpdifMode
CAPL Function Overview » MOST » MostGetSyncSpdifMode

Note

This function is only available with MOST hardware VN2610.

Syntax long MostGetSyncSpdifMode(long channel)

Function Gets the timing mode for the S/PDIF signal.

Parameters channel

Channel of the connected interface.

Return values 0: S/PDIF slave

1: S/PDIF master

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

| MostSetSyncSpdif | MostSetSyncSpdifMode | MostSetSyncSpdifLock | MostSetClockSource | MostGetClockSource | MostSetSyncAudio


|

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSyncVolume

MostGetSyncVolume
CAPL Function Overview » MOST » MostGetSyncVolume

Syntax long MostGetSyncVolume(long channel, long device)

Function Returns the volume of the audio input or output.

Parameters channel

Channel of the connected interface.

device

0: Line-In
1: Line-Out

Return values 0...255: Volume (255 = 100%)

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetChannel | MostSetSyncAudio | MostSetSyncVolume | MostSetSyncMute | MostGetSyncMute |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetSystemLock

MostGetSystemLock
CAPL Function Overview » MOST » MostGetSystemLock

Syntax MOST150: long MostGetSystemLock(long channel)

Function Returns the current state of the System Lock Flag.

Parameters channel

Application channel number.

Return values 1: System Lock Flag set

0: System Lock Flag not set

< 0: MOST CAPL error codes.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST150 — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getThisMessage

getThisMessage
CAPL Function Overview » MOST » getThisMessage

Syntax GetThisMessage(mostAMSMessage msg, long count);

Function Copies the data of a AMS message into the msg variable.

This function must be used exclusively within a an event procedure on mostAMSMessage.

Parameters msg

Variable of the type MostAmsMessage.

count

Number of use data bytes that have to be copied.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 MOST • •

Example

The following program section copies 1000 bytes of a message's useful data to the local
variable msg on Channel 1. Afterwards the contents of byte 500 are output to the Write
window.
on mostAMSMessage MsgChannel1.*
{
mostAMSMessage * msg = { DLC = 1000 };
GetThisMessage(msg, 1000);
write(“Byte 500: %02X”, msg.byte(500));
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetTimingMode

MostGetTimingMode
CAPL Function Overview » MOST » MostGetTimingMode

Syntax long MostGetTimingMode(long channel)

Function Returns the Timing Mode of the MOST hardware.

Parameters channel

Channel of the connected interface.

Return values 0: Timing Slave

1: Timing Master

<0: See error codes

If the bypass is closed this function returns the mode that would have been set if the
bypass were opened (see MostSetAllBypass).

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• Not in StopMeasurement

Example

| MostSetTimingMode | OnMostTimingMode | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetTxLight

MostGetTxLight
CAPL Function Overview » MOST » MostGetTxLight

Syntax long MostGetTxLight(long channel)

Function Queries the Light Status at the Fiber Optical Transmitter (FOR).

Parameters channel

Channel of the interface to be queried.

Return values 0: Light out

1: Modulated light

• Bypass/Slave: Tx has light modulation of the Rx


• Master: Master light

2: Constant light

<0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.1 • MOST — •
• Not in StopMeasurement

Example

| MostSetTxLight | MostGetRxLight | MostGetChannel | OnMostTxLight |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetXorFilter

MostGetXorFilter
CAPL Function Overview » MOST » MostGetXorFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

XOR-Filter

Syntax long MostGetXorFilter( long channel, long arb, long targetAdr, long
sourceAdr, long type, byte msg[17], long crc, long ack)

Function Retrieves the status of the XOR filter.

Parameters channel

Channel of the connected interface

arb

Arbitration byte

targetAdr

Destination address

sourceAdr

Source address

type

Message type

msg

Use data byte of the MOST frame

crc

CRC code

ack

Acknowledge field of the MOST frame

Return values <0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

3.2 • MOST — •
• Not in StopMeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostGetXorFilter

| MostGetChannel | MostSetXorFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostMHPBlockSetTraceColors

mostMHPBlockSetTraceColors
CAPL Function Overview » MOST » mostMHPBlockSetTraceColors

Syntax mostMHPBlockSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST • —

Example
OnMostMHPConnection (long sourceDevID, long destDevID, long fBlockID, long
instID, long functionID, long opType)
{
mostMHPConnectionSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
return 1; // Forward the MHPConnection-Event to the next node in the
measurement setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostMHPConnectionSetTraceColors

mostMHPConnectionSetTraceColors
CAPL Function Overview » MOST » mostMHPConnectionSetTraceColors

Syntax mostMHPConnectionSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST • —

Example
OnMostMHPConnection (long sourceDevID, long destDevID, long fBlockID, long
instID, long functionID, long opType)
{
mostMHPConnectionSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
return 1; // Forward the MHPConnection-Event to the next node in the
measurement setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostMHPConnectionSetTraceColors

mostMHPConnectionSetTraceColors
CAPL Function Overview » MOST » mostMHPConnectionSetTraceColors

Syntax mostMHPErrorSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST • —

Example
OnMostMHPError (long sourceDevID, long destDevID, long fBlockID, long
instID, long functionID, long opType)
{
mostMHPErrorSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
return 1; // Forward the MHPError-Event to the next node in the
measurement setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostMHPPacketSetTraceColors

mostMHPPacketSetTraceColors
CAPL Function Overview » MOST » mostMHPPacketSetTraceColors

Syntax mostMHPPacketSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST • —

Example
OnMostMHPPacket (long sourceDevID, long destDevID, long fBlockID, long
instID, long functionID, long opType)
{
mostMHPPacketSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
return 1; // Forward the MHPPacket to the next node in the measurement
setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostMsgDecodeRLE

MostMsgDecodeRLE
CAPL Function Overview » MOST » MostMsgDecodeRLE

Syntax long MostMsgDecodeRLE(mostAmsMessage * msg, long fktIds[], long buffersize)

Function MostMsgDecodeRLE() decodes the data area of a message and saves the function IDs in a
list. Run Length Encoding in accordance with MOST Specification 2.4 Para. 2.3.9 is used.
This function is suitable for evaluating messages of the FBlock.FktIds.Status type.

Parameters msg

Message

fktIds[]

Destination buffer

buffersize

Size of the destination buffer

Return values >=0: Number of valid function IDs in fktIds[]

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • •

Example

| MostMsgEncodeRLE | MostMsgSet |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostMsgEncodeRLE

MostMsgEncodeRLE
CAPL Function Overview » MOST » MostMsgEncodeRLE

Syntax long MostMsgEncodeRLE(mostAmsMessage * msg, long fktIds[], long size)

Function MostMsgEncodeRLE() encodes a list of function IDs and saves it in the data area of a
message. Run Length Encoding in accordance with MOST Specification 2.4 Para. 2.3.9 is
used. This function is suitable for compiling messages of the FBlock.FktIds.Status type.

Parameters msg

Message, which is to have data input into it.

fktIds[]

List of function IDs (can be unsorted).

size

Number of function IDs in fktIds[].

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • •

Example

| MostMsgDecodeRLE | MostMsgSet |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostMsgGetSymbols

MostMsgGetSymbols
CAPL Function Overview » MOST » MostMsgGetSymbols

Syntax long mostMsgGetSymbols(mostAmsMessage * msg, char[] fblock, char[]


function, char[] optype, long bufferSize)

long mostMsgGetSymbols(mostMessage * msg, char[] fblock, char[] function,


char[] optype, long bufferSize)

Function Determining the symbolic Names of the function block, the function and the Optype from
an AMS or control message using the XML function catalog.

Parameters msg

Message from which the symbolic names are determined.

fblock

Destination buffer for the function block name.

function

Destination buffer for the function name.

optype

Destination buffer for the optype name.

bufferSize

Destination buffer size. Valid for fblock, function and optype!

Return values 0: None of the three symbolic names could be determined.

1: Function block name determined.

2: Function block and function name determined.

3: Function block, function and optye name determined.

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • •

Example

| General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostMsgSet

MostMsgSet
CAPL Function Overview » MOST » MostMsgSet

Syntax long mostMsgSet(mostAmsMessage * msg, long destAdr, char symbolicMessage[],


long instId)

long mostMsgSet(mostAmsMessage * msg, char symbolicMessage[], long instId)

long mostMsgSet(mostAmsMessage * msg, char symbolicMessage[]);

Function Populating an AMS message using the syntax from the MOST specification and the
description in the XML function catalog.

PosDescription, TelLen and StreamCases are checked in addition to Funktionsblock,


FunktionsID and OpType.

See also Option .MOST: Symbolic Identification of Messages

Parameters msg

Message to be populated

destAdr

Destination address

symbolicMessage

Description of the message content in the following formats:


FBlock.InstanceId.Function.OpType(Parameterlist)

FBlock.InstanceId.Function.OpType

FBlock.Function.OpType(Parameterlist)

FBlock.Function.OpType

InstId

InstanceID of the function block

Return values 0: OK (Parameter is available)

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| MostParamGet | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetString | MostAMSOutput | output |


General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostNBSetAbilityToWake

MostNBSetAbilityToWake
CAPL Function Overview » MOST » MostNBSetAbilityToWake

Note

The property "AbilityToWake" is renamed in NetBlock version 2V5 to "PermissionToWake".


The behavior remains the same.

Syntax MostNBSetAbilityToWake(long wakestatus)

Function Sets the AbilityToWake flags in NetBlock.

If this flag is set to "Off", the connected MOST interface must not wake up the ring.

Parameters wakestatus

0: Off
1: On
2: Critical

Return values <0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• While Application Socket is
active

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostNwmFiEnableRingScan

MostNwmFiEnableRingScan
CAPL Function Overview » MOST » MostNwmFiEnableRingScan

Syntax long MostNwmFiEnableRingScan(long mode)

Function Can be called to change the ring scan behavior of CANoe’s Network Master.

The function is available for CAPL programs assigned to the Network Master block in the
simulation setup.

Parameters mode

0: disable network scan


1: enable normal network scan behaviour
2: terminate currently running network scan
3: trigger network scan once

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example

| OnMostFiAmsPreSend | OnMostFiAmsPreReceive | MostNwmFiSetConfigState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostNwmFiSetConfigState

MostNwmFiSetConfigState
CAPL Function Overview » MOST » MostNwmFiSetConfigState

Syntax long MostNwmFiSetConfigState(long state, long sendConfigStatusMsg)

Function Forces the network configuration status to be set in CANoe’s Network Master.

Use the function with care since the state machine of the Network Master is not
guaranteed to work properly afterwards. (A shutdown of the network will reset the
Network Master’s state machine.)

The function is available for CAPL programs assigned to the Network Master block in the
simulation setup.

Parameters state

0: ConfigNotOk
1: ConfigOK

sendConfigStatusMsg

0: set the configuration status without sending a message


1: set configuration status and broadcast NetworkMaster.Configuration.Status

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example

| OnMostFiAmsPreSend | OnMostFiAmsPreReceive | MostNwmFiEnableRingScan |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostNwmFiSetParameter, MostNwmFiGetParameter

MostNwmFiSetParameter, MostNwmFiGetParameter
CAPL Function Overview » MOST » MostNwmFiSetParameter, MostNwmFiGetParameter

Syntax long MostNwmFiSetParameter(long paramID, long value)

long MostNwmFiGetParameter(long paramID)

Function In order to modify timing parameters the functions MostNwmFiSetParameter and


MostNwmFiGetParameter provide access to the timing parameters of CANoe’s Network
Master implementation.

Use the function with care since the state machine of the Network Master is not
guaranteed to work properly afterwards.

Refer to the MOST specification for a detailed description of the timing parameters and
the Network Master state machine.

The function is available for CAPL programs assigned to the Network Master block in the
simulation setup.

Parameters paramID

-1: set default for all parameter values


1: timer value tWaitBeforeScan (value range: 1…20000 ms)
2: timer value tWaitAfterNCE (value range: 1…20000 ms)
3: timer value tWaitForAnswer (value range: 1…20000 ms)
4: timer value tDelayCfgRequest1 (value range: 1…200000 ms)
5: timer value tDelayCfgRequest2 (value range: 1…200000 ms)

value

New value to be set.

Return values MostNwmFiSetParameter

See error codes

MostNwmFiGetParameter

>=0: value of the parameter identified by paramID

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example
// set the timer value for tDelayCfgRequest2 to 15 s
MostNwmFiSetParameter(5, 15000);

| OnMostFiAmsPreSend | OnMostFiAmsPreReceive | MostNwmFiEnableRingScan |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

output
CAPL Function Overview » MOST » output

Syntax void output (mostMessage msg)

void output (mostAmsMessage msg)

void output (mostRawMessage msg)

Function Sends a message on the MOST ring.

Parameters Variable of type mostMessage, mostAmsMessage or mostRawMessge

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.1 MOST • •

Example

| MostAMSOutput | Initialization of Message Variables | OutputMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OutputMostEthPkt

OutputMostEthPkt
CAPL Function Overview » MOST » OutputMostEthPkt

Syntax MOST150: outputMostEthPkt(long channel, int64 destMacAdr, long dataLen,


BYTE[] data)

MOST150: outputMostEthPkt(long channel, long prio, long retryCount, int64


sourceMacAdr, int64 destMacAdr, long dataLen, BYTE[] data)

Function Sends out an Ethernet packet over the asynchronous channel.

Parameters channel

Application channel number.

destMacAdr

Destination MAC address (6 Byte).

dataLen

Number of data bytes to be sent (2 <= dataLen <= 1506).

Data

Data bytes of the Ethernet packet.

Info

At least two bytes have to be sent (Ethernet Type Field). In case more than
1502 Bytes should be sent, the VLAN Tag has to be set in the first two data
bytes (0x81, 0x00).

prio

Sending priority of the Ethernet packet.

Info

Value range: 0x01..0x07.

The value "-1" is also valid and used as wildcard to set the default priority
(0x07).

retryCount

Number of retries.

Info

Value range: 0x00..0x07.

The value "-1" is also valid and used as wildcard to set the number of retries
configured for the asynchronous channel (s. MostSetRetryParamater()).

sourceMacAdr

Source MAC address. (6 Byte).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OutputMostEthPkt

Info

It is possible to set another source MAC address as the own one. The value "-
1" is also valid and is used as wildcard to set the own MAC address.

Return values —

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.1 SP4 • MOST150 — •


• After measurement start
• Not in Stopmeasurement

Example

| MostSetMasterMode | MostGenerateBusloadEthPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OutputMostEthPktThis

OutputMostEthPktThis
CAPL Function Overview » MOST » OutputMostEthPktThis

Note

OutputMostEthPktThis() may only be called within the OnMostEthPkt() event


procedure.

Syntax MOST150: outputMostEthPktThis()

Function Passes the Ethernet packet on to the next node in the nodal sequence.

Parameters —

Return values —

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.1 SP4 • MOST150 — •


• After measurement start
• Not in Stopmeasurement

Example

| output | OutputMostEthPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OutputMostPkt

OutputMostPkt
CAPL Function Overview » MOST » OutputMostPkt

Syntax OutputMostPkt(long channel, long destadr, long pktdatalen, BYTE pktdata[])

Function Sends out packets over the asynchronous MOST channel.

Parameters channel

Channel number

destadr

Destination address

pktdatalen

Number of bytes to be sent.

MOST25/MOST50: 0 < pktdatalen = 1014


MOST150: 0 < pktdatalen = 1524

pktdata[]

Useful data

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST • •
• After measurement
start

Example

| output | OutputMostPktThis |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OutputMostPktThis

OutputMostPktThis
CAPL Function Overview » MOST » OutputMostPktThis

Note

OutputMostPktThis() may only be called within the OnMostPkt() event procedure.

Syntax OutputMostPktThis()

Function Passes the packet on to the next node in the nodal sequence.

Parameters —

Return values —

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• After measurement
start

Example

Packet filter in CAPL:


OnMostPkt(long pktdatalen)
{
// filter destination address 0x100
if(MostPktDestAdr() == 0x100)
{
// forward packet to the successor
OutputMostPktThis();
}
}

| output | OutputMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGet

MostParamGet
CAPL Function Overview » MOST » MostParamGet

Syntax double MostParamGet (mostAmsMessage msg, char paramAdr[])

double MostParamGet (mostAmsMessage msg, char paramAdr[], long arrayIndex)

Function Query of a parameter value from an AMS message using the parameter name from the XML
function catalog.

Suitable for parameter types 'Number', 'Enum', 'BitField' and 'Bool'.

Info

For parameters of type 'Array' or 'Sequence' the size (number of elements) of


the parameter is retrieved. The array size cannot be determined, if the
parameter 'Pos' selects only one array element.

Example
mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg;
int arraySize;
mostParamSet(msg, "Pos", 0x0200); // second array element
selected
arraySize = mostParamGet(msg, "Data"); // Return value '0'

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

Parameters msg

Message from which the parameter value should be read.

paramAdr

Identification of parameters (see symbolic identification of parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

Return values Value of the parameter

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGet

Example

| MostParamIsAvailable | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetData | MostParamSetString |


General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetData

MostParamGetData
CAPL Function Overview » MOST » MostParamGetData

Syntax long mostParamGetData(mostAmsMessage msg, char paramAdr[], byte buffer[],


long buffersize)

long mostParamGetData(mostAmsMessage msg, char paramAdr[], long arrayIndex,


byte buffer[], long buffersize)

Function Query of parameters of the String type or RawStream from an AMS message using the
parameter name from the XML function catalog.

With strings, the coding and scheduling in the message are taken into account.

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

Parameters msg

Message from which the parameter value should be read.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

buffer

Buffer to which the parameter bytes are copied.

buffersize

Maximum number of copied parameter bytes (can be specified with (elcount(buffer))).

Return values >=0: Number of copied bytes.

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetData

| MostParamIsAvailable | MostParamGet | MostParamGetString | MostParamSet | MostParamSetData | MostParamSetString | General


Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetString

MostParamGetString
CAPL Function Overview » MOST » MostParamGetString

Syntax long mostParamGetString (mostAmsMessage msg, char paramAdr[], char


buffer[], long buffersize)

long mostParamGetString (mostAmsMessage msg, char paramAdr[], long


arrayIndex, char buffer[], long buffersize)

Function Query of parameters of the String type from an AMS message using the parameter name
from the XML function catalog.

Info

This function supports ASCII-coded strings only. In case of other string


encoding use the function mostParamGetData.

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

Parameters msg

Message from which the parameter should be read.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

buffer

Buffer to which the parameter bytes are copied.

buffersize

Maximum number of copied parameter bytes (can be specified with (elcount(buffer))).

Return values >=0: Number of copied bytes.

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetString

Example

| MostParamIsAvailable | MostParamGet | MostParamGetData | MostParamSet | MostParamSetData | MostParamSetString | General


Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetStringAscii

MostParamGetStringAscii
CAPL Function Overview » MOST » MostParamGetStringAscii

Syntax long mostParamGetStringAscii(mostAmsMessage msg, char paramAdr[], char


buffer[], long buffersize)

long mostParamGetStringAscii(mostAmsMessage msg, char paramAdr[], long


arrayIndex, char buffer[], long buffersize)Syntax

Function Query of parameters of the String type from an AMS message and decode to ASCII format
using the parameter name from the XML function catalog. Unsupported characters are
ignored.

Info

The message data must contain a parameter with the given parameter
address.
Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

Parameters msg

Message in which the parameter value should be described.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

buffer

Buffer to which the ASCII string parameter is copied.

bufferSize

Maximum number of copied ASCII string parameter bytes (can be specified with
(elcount(buffer))).

Return values >=0: number of converted characters

<0: See error codes


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST • •

Example
on mostAmsMessage AmFmTuner.RadioText.Status
{
char buffer[200];
long dataLen;
// get string parameter data
datalen = mostParamGetStringAscii(this, "TextA", buffer,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamGetStringAscii

elcount(buffer));
if(datalen >= 0)
{
write("Radiotext: %s", buffer);
}
}

Input: Message parameter bytes: 00 00 61 00 62 00 63 00 00


Output: Radiotext: abc

| OnMostApInstID | MostParamGet | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetData |


MostParamSetStringEnc | General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamIsAvailable

MostParamIsAvailable
CAPL Function Overview » MOST » MostParamIsAvailable

Syntax long mostParamIsAvailable(mostAmsMessage * msg, char paramadr[])

long mostParamIsAvailable(mostAmsMessage * msg, char paramadr[], long


arrayIndex)

Function Check whether a described parameter with the parameter name from the XML function
catalog is in an AMS message.

PosDescription, TelLen and StreamCases are checked in addition to FblockID, FunktionID


and OpType.

This function can be used to prevent erroneous access to messages that can be first
identified at run time of a CAPL program.

Parameters msg

Message to which parameter access should be applied.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

Return values 1: Parameter is available

0: Parameter is not available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

Assure access to a parameter

In the following sample, access to a parameter is assured in a received message. If the


status message is partially transmitted, either through targeted use of the Pos parameter
or erroneous assignment of TelLen, it can happen that StartTrack is not part of the
received message.
On mostAmsMessage DiskPlayer.MediaInfo.Status
{
int firstTrack;
// check whether message was transmitted including FirstTrack of third
array element (third media here)
if(mostParamIsAvailable(this, “Data.Record[].FirstTrack”, 3))
{
// read FirstTrack from message
firstTrack = mostParamGet (this, “Data.Record[].FirstTrack”, 3);
}
else
{
// do error handling, either
// a) Pos did not indicate existence of FirstTrack (only subset
transmitted)
// b) TelLen was not sufficient (erroneous message transmission)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamIsAvailable

// c) Message is no MediaInfo (would only be applicable if ‘On


mostAmsMessage’ handler
// were not so specific as in this example, error in
implementation of model)
// d) Parameter description was erroneous (error in implementation of
model)
// (Hint: Check if an appropriate XML Function Catalog is assigned to
the configuration)
}
}

| MostParamGet | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetString | General Tips on XML Function


Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSet

MostParamSet
CAPL Function Overview » MOST » MostParamSet

Syntax long mostParamSet(mostAmsMessage msg, char paramAdr[], double value)

long mostParamSet(mostAmsMessage msg, char paramAdr[], long arrayIndex,


double value)

Function Setting of a parameter value in an AMS message using the parameter name from the XML
function catalog.

Suitable for parameter types 'Number', 'Enum', 'BitField' and 'Bool'.

For parameters of the 'Enum' type, the numeric value can be specified. The
mostParamSetString function can be used to set the symbolic value.

Info

For arrays and sequences the size (number of elements) of the parameter is
set. The array size cannot be set, if the parameter 'Pos' selects only one array
element.

Example
mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg;
mostParamSet(msg, "Pos", 0x0200); // second array element
selected mostParamSet(msg, "Data", 6); // Returns an error code
at run time! Array size can only be set if Pos selects all array
elements.

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

When using function mostParamSet to build a message dump, the parameters


must be populated in the order specified by the MOST Function Catalog,
particularly for messages with StreamCases.

Parameters msg

Message in which the parameter value should be described.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

value

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSet

Value of the parameter with whole-number parameter types, decimal places are
truncated.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| MostParamIsAvailable | MostParamGet | MostParamGetData | MostParamGetString | MostParamSetData | MostParamSetString |


General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetData

MostParamSetData
CAPL Function Overview » MOST » MostParamSetData

Syntax long mostParamSetData(mostAmsMessage msg, char paramadr[], byte data[],


long datalen)

long mostParamSetData(mostAmsMessage msg, char paramadr[], long arrayIndex,


byte data[], long datalen)

Function Setting of parameters of the String type or RawStream in an AMS message using the
parameter name from the XML function catalog.

When writing a string parameter with mostParamSetData 'data' has to include the coding
byte and terminator character (mostParamSetString can be used for ASCII coding).

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

When using function mostParamSetData to build a message dump, the


parameters must be populated in the order specified by the MOST Function
Catalog, particularly for messages with StreamCases.

Parameters msg

Message in which the parameter bytes should be written.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

buffer

Buffer from which the parameter bytes are copied.

datalen

Number of valid parameter bytes that are copied to the message.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetData

| MostParamIsAvailable | MostParamGet | MostParamGetData | MostParamGetString | MostParamSet | MostParamSetString | General


Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetString

MostParamSetString
CAPL Function Overview » MOST » MostParamSetString

Syntax long mostParamSetString (mostAmsMessage msg, char paramAdr[], char value[])

long mostParamSetString (mostAmsMessage msg, char paramAdr[], long


arrayIndex, char value[])

Function Setting of parameters of the String type (for ASCII-coded strings only) or of the 'Enum'
type in an AMS message using the parameter name from the XML function catalog.

Info

This function supports ASCII-coded strings only. In case of other string


encoding use the function mostParamSetData. For enumerations, the
parameter value can be indicated symbolically. The mostParamSet function
can be used to set the numeric value.

Info

The message data must contain a parameter with the given parameter
address.

Since the compiler is not able to validate this, errors are detected at run
time of the CAPL program only. If the parameter is not part of the message or
not the expected type, an error text is displayed in the write window and the
measurement stops. The function mostParamIsAvailable can be applied to
assure parameter availability.

When using function mostParamSetString to build a message dump, the


parameters must be populated in the order specified by the MOST Function
Catalog, particularly for messages with StreamCases.

Parameters msg

Message in which the parameter value should be described.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

value

String: Characters that should be copied to the message.


Enumeration: Symbolic name of the parameter value.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetString

Example

| OnMostApInstID | MostParamSetStringEnc | MostParamGet | MostParamGetData | MostParamGetString | MostParamSet |


MostParamSetData | General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetStringEnc

MostParamSetStringEnc
CAPL Function Overview » MOST » MostParamSetStringEnc

Syntax long mostParamSetStringEnc (mostAmsMessage msg, char paramAdr[], long


encoding, char asciiStr[])

long mostParamSetStringEnc (mostAmsMessage msg, char paramAdr[], long


arrayIndex, long encoding, char asciiStr[])

Function Encoding and setting of parameters of the String type (for ASCII-coded strings only) in an
AMS message using the parameter name from the XML function catalog. Only ASCII-coded
strings are supported.

Info

The parameter description must go with the message content. The compiler
is not able to validate this here. Errors only appear at run time of the CAPL
program, if applicable. This function is primarily used to access messages,
whose content was previously limited explicitly, e.g. by the declaration. The
message must be populated in the order of its parameters particularly for
messages with StreamCases. If the parameter is not part of the message or
not the expected type, an error message it output in the Write window and
the measurement stops.

Parameters msg

Message in which the parameter value should be described.

paramAdr

Identification of parameters (see Symbolic Identification of Parameters).

arrayIndex

Parameter index in arrays or sequences. This declaration overwrites the indexing in the
brackets of <paramAdr>.

enconding

Specifies the target encoding. Supported target encodings:

0x00 Unicode, UTF16

0x01 ISO 8859/15 8 bit

0x02 Unicode, UTF8

0x03 RDS
0x04 DAB Charset 0001
0x05 DAB Charset 0010
0x06 DAB Charset 0011
0x07 SHIFT_JIS
asciiStr

String that should be encoded and copied to the message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostParamSetStringEnc

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST • •

Example
mostAmsMessage AmFmTuner.RadioText.Status msg;
mostParamSetString(msg, "TextA", 0x00, "abc");

-> Message parameter bytes: 00 00 61 00 62 00 63 00 00

| OnMostApInstID | MostParamSetString | MostParamGet | MostParamGetData | MostParamGetString | MostParamSet |


MostParamSetData | MostParamGetStringAscii | General Tips on XML Function Catalog Support in CAPL | Symbolic Identification of
Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostPktSetTraceColors

mostPktSetTraceColors
CAPL Function Overview » MOST » mostPktSetTraceColors

Syntax mostPktSetTraceColors(long font, long bkgnd)

Function Sets the text and background color for displaying the MOST event in the Trace window.
The makeRGB function can be used for the colors.

Info

• This function can only be used in measurement setup and is only applied
to the trace window.
• The setting of colors with this function has a higher priority than the
color settings for events in the trace window.

Parameters font

Font color (RGB value)

bkgnd

Background color (RGB value)

Return values 0: OK

-1: Invalid RGB value of a color.


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 MOST • —

Example
OnMostPkt (long pktlen)
{
mostPktSetTraceColors(makeRGB(0, 0, 0), makeRGB(255, 0, 0) );
OutputMostPktThis(); // Forwards this packet to the node in the
measurement setup
}

| traceSetEventColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPMSetOverTemperature, MostPMResetOverTemperature

MostPMSetOverTemperature, MostPMResetOverTemperature
CAPL Function Overview » MOST » MostPMSetOverTemperature, MostPMResetOverTemperature

Syntax long MostPMSetOverTemperature ()

long MostPMResetOverTemperature ()

Function MostPMSetOverTemperature notifies the PowerMaster in its own device that an over
temperature of the device will be simulated. When setting the "over temperature status",
the PowerMaster is prompted to not wake up the ring after it has been shut down, if a
MOST signal is detected at the Rx-FOT.
MostPMResetOverTemperature signals the PowerMaster that the device has again reached
operating temperature.

Info

No message that triggers the shutdown of the ring due to overheating is sent
by setting the "overview temperature status"
(NetBlock.Shutdown.Result(0x03)). If the "over temperature status" is reset,
the ring is not automatically woken up by the PowerMaster. This must be
performed by the application, if necessary.

Parameters —

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• While Application
Socket is active
• Only in device with
Power Master

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPMShutDownCancel

MostPMShutDownCancel
CAPL Function Overview » MOST » MostPMShutDownCancel

Syntax long MostPMShutDownCancel()

Function Aborts shutdown of the system by the Power Master.

Parameters —

Return values <0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active
• Only in device with Power
Master

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPMShutDownStart

MostPMShutDownStart
CAPL Function Overview » MOST » MostPMShutDownStart

Syntax long MostPMShutDownStart()

Function Initiates a shutdown of the system by the Power Master (see MOST Specification 2.2).

Parameters —

Return values <0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • MOST — •
• While Application Socket is
active
• Only in device with Power
Master

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPMTempShutdownWakeupTimeout

MostPMTempShutdownWakeupTimeout
CAPL Function Overview » MOST » MostPMTempShutdownWakeupTimeout

Syntax long MostPMTempShutdownWakeupTimeout (long timeout)

Function As described in the MOST specification in the chapter "Over-Temperature Management",


the PowerMaster may try to wake-up the MOST ring, after a temperature shutdown, after
a certain time. This function sets the timeout duration.

The default value is 60s.

Info

By setting the "over temperature status" in the device of the PowerMaster,


the wake-up attempt will not be performed after the timeout. After resetting
the "over temperature status" the application has to perform the wake-up, if
necessary.

Parameters timeout

Timeout in [ms].

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• While Application Socket
is active
• Only in device with
Power Master

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPrepareReport

MostPrepareReport
CAPL Function Overview » MOST » MostPrepareReport

Syntax mostPrepareReport(mostAmsMessage * msgCommand, mostAmsMessage * msgReport)

Function Preparation of an AMS message as response (OpType>=9) to a received command message


(OpType<9).

The destination address of the report message is set to the source address of the
command message. The parameters FBlockId, InstId and FunctionId in msgReport are set
as given by the msgCommand. Any wildcard InstId in msgCommand is transferred to a
concrete value in msgReport with the help of the device’s Local FBlock list.

According to the MOST specification, the OpTypes are converted by the command into the
associated report OpType:

For Properties:

Command OpType Report OpType

GetInterface Interface

any other Status

For Methods:

Command OpType Report OpType

Start, StartResult Result

GetInterface Interface

Abort Error

StartAck, StartResultAck ResultAck

AbortAck ErrorAck

Messages with Ack-OpTypes contain a sender handle in the first two data bytes. This
sender handle is also set in the first two data bytes of the report message.

Parameters msgCommand

Command message to be answered.

msgReport

Message that should serve as a response.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostPrepareReport

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

Example

| MostSendError | on mostAMSMessage | output(mostAmsMessage * msg) |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostRcvSpyMessagesOnly

MostRcvSpyMessagesOnly
CAPL Function Overview » MOST » MostRcvSpyMessagesOnly

Note

MostRcvSpyMessagesOnly() may only be called within the on preStart function of the


CAPL program!

Syntax mostRcvSpyMessagesOnly ()

Function The MOST message handling routines of this node are only called if the message was
received by the Spy of the bus interfaces.

This mode is especially useful for nodes that act as pure observers or – with the help of
the Spy – are used to perform cross-node analyses.

Queries such as "if (!this.MOST_IsSpy) return;" have been eliminated in the message
handling routines, because the message handling routines are no longer called by node
and Spy messages.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

| MostGetChannel | MostStrictChannelMapping | MostApplicationNode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostReadReg

MostReadReg
CAPL Function Overview » MOST » MostReadReg

Note

Register structure of the OS8104:


The registers of the OS8104 chip are distributed among pages. Read and write actions are
not possible across several register pages. The offset is calculated as follows: offset =
page << 8 + address

Syntax long MostReadReg(long channel, long chip, DWORD offset, long regdatalen)

Function Initiates read-out of the registers of a MOST hardware chip.

Parameters channel

Channel to which the hardware is connected.

chip

Number of the chip in the MOST hardware (1 = OS8104; other chips cannot be accessed
yet).

offset

Address of the first register.

regdatalen

Number of registers to be read (1 <= regdatalen <= 16).

Return values See error codes

A read request by MostReadReg() causes the CAPL event procedure OnMostReg to be


called.

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostWriteReg | OnMostReg |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSendError

MostSendError
CAPL Function Overview » MOST » MostSendError

Syntax mostSendError_Code (mostAmsMessage * msgcmd, byte code)

(Suitable for error codes: 0x01, 0x02, 0x03, 0x05, 0x0B, 0x40, 0x41, 0x42, 0x43)

mostSendError_CodeByte (mostAmsMessage * msgcmd, byte code, byte byte1)

(Suitable for error codes: 0x04, 0x0C, 0x20, 0x06, 0x07)

mostSendError_CodeByteByte(mostAmsMessage * msgcmd, byte code, byte byte1,


byte byte2)

(Suitable for error codes: 0x06, 0x07)

mostSendError_CodeByteWord(mostAmsMessage * msgcmd, byte code, byte byte1,


word word1)

(Suitable for error codes: 0x06, 0x07)

void SendError_CodeBytes(mostAMSMessage * msgcmd, byte code, byte data[],


long datalen)

(Suitable for error codes: 0x06, 0x07)

Function Generates and sends an error message directly based on a received command message.

The various signatures make it easy to transfer the most common error codes with their
ancillary information.

Any wildcard InstId in the command message is transferred to a concrete value in the
error message with the help of the device’s Local FBlock list.

Parameters msgcmd

Received command message to be responded to

code

Error Code (see MOST specification)

byte1

First ancillary information as byte

byte2

Second ancillary information as byte

word1

Second ancillary information as word

data

Ancillary information as byte array

datalen

Number of valid bytes in the array with the ancillary information

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSendError

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

Example

| on mostAMSMessage | output(mostAMSMessage * msg) | MostPrepareReport |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetAllBypass

MostSetAllBypass
CAPL Function Overview » MOST » MostSetAllBypass

Syntax long MostSetAllBypass(long channel, long bypassmode)

Function This command can be used to close the MOST hardware bypass (bypassmode=1) or open it
(bypassmode=0). If the bypass is closed the MOST device is invisible to other devices in
the ring.

For the functionality of the AllBypass see also the description for the /ABY bit in the
Transceiver Control Register of the OS8104.

Parameters channel

Channel of the connected interface

Return values <0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• Not in StopMeasurement

Example

| MostGetAllBypass | OnMostAllBypass | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetAndFilter

MostSetAndFilter
CAPL Function Overview » MOST » MostSetAndFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

AND-Filter

Syntax long MostSetAndFilter( long channel, long arb, long targetAdr, long
sourceAdr, long type, byte msg[17], long crc, long ack)

Function Effects the Optolyzer only when in spy mode. See the online help of the OptoControl help
file for information about how AND and XOR filter masks work together. The there
described mask string is assembled appropriately from the parameters of the function
‘MostSetAndFilter’.

Parameters channel

Channel of the connected interface

arb

Arbitration byte

targetAdr

Destination address

sourceAdr

Source address

type

Message type

msg

Use data bytes of the MOST frame

crc

CRC code

ack

Acknowledge field of the MOST frame

Return values <0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

3.2 • MOST — •
• Not in StopMeasurement

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetAndFilter

Example

| MostGetChannel |MostGetAndFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetClockSource

MostSetClockSource
CAPL Function Overview » MOST » MostSetClockSource

Note

This function is only available with MOST hardware VN2610.

Syntax long MostSetClockSource(long channel, long source)

Function Sets the clock source for the MOST timing master. The function has no effect if the bus
interface is configured as MOST timing slave.

Parameters channel

Channel of the connected interface

source

0 Internal oscillator.

1 Synchronizes the timing master clock to the S/PDIF input signal. The bus interface
must be configured as S/PDIF timing slave (refer to MostSetSyncSpdifMode()).

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

Use case: External S/PDIF source device connected to the S/PDIF In connector of the
VN2610

Typically the internal oscillator is used as clock source, since most S/PDIF source devices
do not generate a S/PDIF signal with the same clock as the MOST clock (44,1 / 48 kHz).
// use internal oscillators timing master clock
on key 's'
{
long channel = 1;

// configure hardware interface as S/PDIF slave


MostSetSyncSpdifMode( channel, 0 );
MostSetSyncSpdifLock( channel, 1 );

// set the clock source


MostSetClockSource( channel, 0 );
}

In some special cases, e.g. for testing purpose it is possible to synchronize the timing
master clock to S/PDIF input signal.
// synchronize the timing master clock to the S/PDIF input signal
on key 's'
{
long channel = 1;

// configure hardware interface as S/PDIF slave


MostSetSyncSpdifMode( channel, 0 );

// set the clock source


MostSetClockSource( channel, 1 );

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetClockSource

More S/PDIF examples see CANoe online help MOST Access to Digital Audio Channels
(S/PDIF In and Out).

| MostSetTimingMode | MostSetSyncSpdifMode | MostGetSyncSpdifMode | MostGetClockSource | MostSetSyncAudio |


MostSetSyncSpdif |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetCorrectStartupSBC

MostSetCorrectStartupSBC
CAPL Function Overview » MOST » MostSetCorrectStartupSBC

Note

This function is only available for VN2600/VN2610.

Syntax long MostSetCorrectStartupSBC (long channel, long mode)

Function During the next start-up phase of the ring, this function activates or deactivates the
correct setting of the "Synchronous Bandwidth Control" register (SBC) in the MOST chip
(e.g. at the next wake up of the ring).

Info

• This function has only an effect if the connected VN2600/VN2610 is


configured as Timing Master.
• This function should only be executed if the connected VN2600/VN2610 is
not in the start-up phase.

Parameters channel

Channel of the connected MOST interface.

mode

0 inactive

1 active

Return values

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP2 MOST — •

Example

| MostSetTimingMode | MostWakeup | MostSetSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostSetEclGlitchFilter

mostSetEclGlitchFilter
CAPL Function Overview » MOST » mostSetEclGlitchFilter

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long mostSetEclGlitchFilter (long channel, long durationus)

Function Configures the timing of the glitch filter for the ECL. For pulses which are shorter than
the given time durationus the callback <OnMostEcl> will not be called, neither will those
pulses appear in a Trace window.

Parameters channel

Channel of the connected interface.

durationus

Minimum duration of a pulse in µs required to generate an event which calls


<OnMostECL>. The value ranges from 50 µs to 50 ms (Default: 1 ms)

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • MOST150 — •

Example

| MostSetEclTermination | MostWakeup | OnMostEcl |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetEcl, MostGetEcl

MostSetEcl, MostGetEcl
CAPL Function Overview » MOST » MostSetEcl, MostGetEcl

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long MostSetEcl(long channel, long eclState)

MOST150: long MostGetEcl(long channel)

Function MostSetEcl switches the Electrical Control Line which can be used for wake-up and
diagnosis purposes.

MostGetEcl returns the current state of the Electrical Control Line.

Parameters channel

Channel of the connected interface.

eclState

0: low
1: high

Return values MostSetEcl

See error codes

MostGetEcl

>=0: See eclState parameter


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 MOST150 — •

Example

| OnMostEcl | MostSetEclTermination | MostWakeup | mostGenerateEclSequence |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetEclTermination, MostGetEclTermination

MostSetEclTermination, MostGetEclTermination
CAPL Function Overview » MOST » MostSetEclTermination, MostGetEclTermination

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long MostSetEclTermination(long channel, long eclTermination)

MOST150: long MostGetEclTermination (long channel)

Function Sets and gets the state of the termination resistor of the Electrical Control Line.

Parameters channel

Channel of the connected interface.

eclTermination

0: pull-up not active


1: pull-up active

Return values MostSetEclTermination

See error codes

MostGetEclTermination

>=0: See eclState parameter


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 MOST150 — •

Example

| MostSetEcl | mostSetEclGlitchFilter | mostConfigureEclSequence |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetMacAdr, MostGetMacAdr

MostSetMacAdr, MostGetMacAdr
CAPL Function Overview » MOST » MostSetMacAdr, MostGetMacAdr

Note

This function is only available with MOST hardware VN2640 and OptoLyzer G2 3150o
(firmware version V1.2 is required).

Syntax MOST150: long MostSetMacAdr(long channel, int64 macAdr)

MOST150: int64 MostGetMacAdr(long channel)


Function The functions set and retrieve the 48 bit MAC address of the network interface controller.
The MAC address identifies the network node during Ethernet-over-MOST150
communication (see OnMostEthPkt, OutputMostEthPkt).

Parameters channel

Channel of the connected interface

macAdr

48 bit MAC address.

Return values MostSetMacAdr: See error codes

MostGetMacAdr:

>=0: 48 bit MAC address


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example
// Set MAC address on channel MOST 1 to 01:02:03:04:05:06
MostSetMacAdr(1, 0x010203040506LL);

| OnMostMacAdr | OnMostEthPkt | OutputMostEthPkt | MostSetNodeAdr | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetMasterMode, MostGetMasterMode

MostSetMasterMode, MostGetMasterMode
CAPL Function Overview » MOST » MostSetMasterMode, MostGetMasterMode

Note

This function is only available with MOST hardware VN2640 and OptoLyzer G2 3150o
(firmware version V1.2 is required).

Syntax MOST150: long MostSetMasterMode(long channel, long mode)

MOST150: long MostGetMasterMode(long channel)

Function Configures the timing master as static or non-static master. A non-static master shuts the
network down if there is for example no signal at its optical input, whereas a static
master keeps the network running independently from the input signal.

MostSetMasterMode becomes operative with the next call of MostSetTimingMode.

Parameters channel

Channel of the connected interface

mode

0: static master
1: non-static master

Return values MostSetMasterMode: See error codes

MostGetMasterMode:

>=0: See mode parameter


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example
// configure bus interface as non-static timing master
MostSetMasterMode(1, 1);
MostSetTimingMode(1, 1);

| MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetRetryParameter, MostGetRetryParameter

MostSetRetryParameter, MostGetRetryParameter
CAPL Function Overview » MOST » MostSetRetryParameter, MostGetRetryParameter

Syntax long MostSetRetryParameter(long channel, long id, long value)

long MostGetRetryParameter(long channel, long id)

Function The functions provide access to the transceiver chip parameters for message transmission.
The number of low-level transmission attempts and delay between attempts can be set
and retrieved.

Parameters channel

Channel of the connected interface.

id

Parameter identification (see table below).

ID Meaning VN26x0 Optolyzer VN2640 OptoLyzer G2


(MOST25) (MOST25) (MOST150) 3150o
(MOST150)

0 Transmission attempts on 1..255 1..255 1..16 1..16


the control channel.

1 Time between send retries 3..255 3..255 3..31 3..15


on the control channel.

2 Transmission attempts on — — 1..16 1..16


the asynchronous channel.

3 Time between send retries — — 0..255 0..255


on the asynchronous
channel.

value

Value to be set.

Return values MostSetRetryParameter: See error codes.

MostGetRetryParameter:

>=0: Retry parameter value.

<0: See error codes.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST — •

Example
// configure MOST transceiver for 5 low-level transmission attempts on
Control channel
MostSetRetryParameter(1, 0, 5);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetRetryParameter, MostGetRetryParameter

| mostGetChannel |output | mostReadReg | OnMostReg |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetShutDownFlagUsage, MostGetShutDownFlagUsage

MostSetShutDownFlagUsage, MostGetShutDownFlagUsage
CAPL Function Overview » MOST » MostSetShutDownFlagUsage, MostGetShutDownFlagUsage

Note

At least OptoLyzer G2 3150o firmware version V1.2 is required.

Syntax MOST150: long MostSetShutDownFlagUsage(long channel, long mode)

MOST150: long MostGetShutDownFlagUsage(long channel)


Function For test purposes the stress network interface controller in the OptoLyzer G2 3150o is
able to suppress the shutdown flag for the next node by calling.

MostSetShutDownFlagUsage with mode 0.

Parameters channel

Channel of the connected interface

mode

0: clear shutdown flag


1: default mode

Return values MostSetShutDownFlagUsage: See error codes

MostGetShutDownFlagUsage:

>=0: See mode parameter


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example

| OnMostShutdownFlag | MostWakeup | MostShutDown | MostSetSystemLockFlagUsage | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetStressNodeParameter, MostGetStressNodeParameter

MostSetStressNodeParameter, MostGetStressNodeParameter
CAPL Function Overview » MOST » MostSetStressNodeParameter, MostGetStressNodeParameter

Note

This function is only available with MOST hardware VN2640 and OptoLyzer G2 3150o
(firmware version V1.2 is required).

Syntax MOST150: long MostSetStressNodeParameter(long channel, long id, long


value)

MOST150: long MostGetStressNodeParameter(long channel, long id)

Function VN2640:

Additional parameters of the stress generators (MostGenerateBusloadCtrl,


MostGenerateBusloadAsync, MostGenerateBusloadEthPkt) can be set with
MostSetStressNodeParameter.

OptoLyzer G2 3150o:

The OptoLyzer G2 3150o for MOST150 provides stress functionality through an additional
network interface controller (NIC). For a set of stress functions (MostSetRxBufferCtrl,
MostSyncAlloc) the NIC is required to be visible in the network (bypass open).

With MostSetStressNodeParameter the MOST node parameters of this additional NIC can
be configured.

Parameters channel

Channel of the connected interface.

id

Parameter identification:

ID Description Value range / meaning Availability

1 Node address 0...0xFFFF OptoLyzer G2 3150o

2 Group address 0x300...0x3FF OptoLyzer G2 3150o

3 Bypass values: OptoLyzer G2 3150o


0: open bypass,
1: retimed bypass,
2: active bypass

10 Control busload destination address 0...0xFFFF VN2640

OptoLyzer G2 3150o

11 Control busload speed VN2640: VN2640


Messages per second

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetStressNodeParameter, MostGetStressNodeParameter

G2 3150o: OptoLyzer
Specifies the delay between two G2 3150o
messages:
1 means 10 ms delay,
2 means 20 ms delay and so on.
0: as fast as possible

12 Control busload pattern: specifies 0: OptoLyzer


what message is sent as busload FBlockID: 0xF1 G2 3150o
InstID: 0x00
FuncID: 0xFFF
OpType: 0xC
Length

2:
FBlockID: 0x01
InstID: 0x00
FuncID: 0x000
OpType: 0x1

16:
custom message (to specify
custom message use function
mostConfigureBusloadCtrl)

13 Control busload pattern length: 6...51 OptoLyzer


amount of payload sent as G2 3150o
busload, applies for pattern 0x00
only
14 Control busload burst count: 1...65535 OptoLyzer
amount of messages sent as G2 3150o
busload per (10 ms) cy-cle. For
further information regarding the
burst mode please refer to SMSC
socket protocol specification.
15 Control busload send attempts 1...16 VN2640

OptoLyzer
G2 3150o

16 Control busload counter type 0: no counter VN2640


1: 1 byte counter
2...4: 2-4 byte counter (VN2640 OptoLyzer
only) G2 3150o

17 Control busload counter position: 6...50 VN2640


specifies the position of the
payload byte that is incremented OptoLyzer
G2 3150o

50 Data packet channel busload 0...0xFFFF VN2640


destination address
OptoLyzer
G2 3150o

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetStressNodeParameter, MostGetStressNodeParameter

51 Data packet channel busload speed VN2640: VN2640


Packets per second
OptoLyzer G2
G2 3150o: 3150o
Specifies the delay
between two packets:
1 means 10 ms delay,
2 means 20 ms delay
and so on.
0: as fast as possible

52 Data packet channel busload pattern: 0: OptoLyzer G2


specifies what a message is sent as FBlockID: 0xF1 3150o
busload InstID: 0x00
FuncID: 0xFFF
OpType: 0xC
Length (2 Byte)

53 Data packet channel busload pattern 6...48 OptoLyzer G2


length 3150o

55 Send attempts for data packet bus load 1...16 VN2640

56 Data packet bus load counter type 0: no counter VN2640


1...4: 1-4 byte counter

57 Data packet bus load counter position 0...1523 VN2640

75 Send attempts for Ethernet bus load 1...16 VN2640


packet

76 Ethernet bus load counter type 0: no counter VN2640


1...4: 1-4 byte counter

77 Ethernet bus load counter position 0...1505 VN2640

value

Parameter value to be set.

Return values MostSetStressNodeParameter: See error codes

MostGetStressNodeParameter:

>=0: Parameter value


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example VN2640

See MostConfigureBusloadCtrl

Example G2 3150o
// configure stress controller as visible network node with logical address
0x123

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetStressNodeParameter, MostGetStressNodeParameter

MostSetStressNodeParameter(1, 1, 0x123); // set node address


MostSetStressNodeParameter(1, 3, 0); // open bypass

| MostSetAllBypass | MostSetNodeAdr | MostGetChannel | MostSyncDealloc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSystemLockFlagUsage, MostGetSystemLockFlagUsage

MostSetSystemLockFlagUsage, MostGetSystemLockFlagUsage
CAPL Function Overview » MOST » MostSetSystemLockFlagUsage, MostGetSystemLockFlagUsage

Note

At least OptoLyzer G2 3150o firmware version V1.2 is required.

Syntax MOST150: long MostSetSystemLockFlagUsage(long channel, long mode)

MOST150: long MostGetSystemLockFlagUsage(long channel)


Function For test purposes the stress network interface controller in the OptoLyzer G2 3150o is
able to suppress the system lock flag for the next node by calling.

MostSetSystemLockFlagUsage with mode 0.

Parameters channel

Channel of the connected interface

mode

0: clear system lock flag


1: default mode

Return values MostSetSystemLockFlagUsage: See error codes

MostGetSystemLockFlagUsage:

>=0: See mode parameter


<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

Example

| OnMostSystemLock | MostWakeup | MostShutDown | MostSetShutDownFlagUsage | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetHWFilter

MostSetHWFilter
CAPL Function Overview » MOST » MostSetHWFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

Filter Mode

Syntax long MostSetHWFilter(long channel, long mode)

Function Effects the Optolyzer only when in spy mode.

mode = 1 HW filter on

mode = 0 HW filter off

Parameters channel

Channel of the connected interface

Return values <0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

3.2 • MOST — •
• Not in StopMeasurement

Example

| MostGetChannel | MostGetHWFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetNodeAdr, MostSetGroupAdr, MostSetAltPktAdr, MostSetOwnAdr

MostSetNodeAdr, MostSetGroupAdr, MostSetAltPktAdr, MostSetOwnAdr


CAPL Function Overview » MOST » MostSetNodeAdr, MostSetGroupAdr, MostSetAltPktAdr, MostSetOwnAdr

Syntax long MostSetNodeAdr(long channel, long nodeadr)

long MostSetGroupAdr(long channel, long grpadr)

long MostSetAltPktAdr(long channel, long altpktadr)

long MostSetOwnAdr(long channel, long grpadr, long nodeadr)

Function These functions set the node address, group address or alternative packet address of the
MOST hardware to the specified values.

Parameters channel

Channel of the connected interface

nodeadr

Logical node address

groupadr

Group address

altpktadr

Alternative packet address (not with Optolyzer box)

nodeposadr

Node position address

Return values <0: See error codes

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

3.2 • MOST — •
• Not in
StopMeasurement

5.0: • MOST — •
MostSetAltPktAdr
• Not in
StopMeasurement

Example

| MostGetNodeAdr, MostGetGroupAdr, MostGetAltPktAdr, MostGetNodePosAdr | OnMostNodeAdr | OnMostGroupAdr | OnMostNPR |


MostGetChannel | MostSetMacAdr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: mostSetRxBufferAsync

mostSetRxBufferAsync
CAPL Function Overview » MOST » mostSetRxBufferAsync

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: long mostSetRxBufferAsync (long channel, long buffermode)

Function Starts or stops draining of the asynchronous receive buffer and thereby allows to provoke
low level retries.

The node may receive a varying number of packets (MDP or MEP) before it eventually
provokes low level retries. The number depends on the size of the packets and is limited
either to 3 kByte of data or 255 packets.

After enabling the draining of the Rx buffer again, a number of packets received during
the stress mode may be shown in the Trace with time stamps close to the time of re-
enabling the draining.

Parameters channel

Channel of the connected interface.

buffermode

0: stops draining the Rx buffer for MDP and MEP


1: starts draining the buffer again.

Return values 0

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • MOST150 — •

Example

| MostSetRxBufferCtrl |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetRxBufferCtrl

MostSetRxBufferCtrl
CAPL Function Overview » MOST » MostSetRxBufferCtrl

Note

This functionality is only available for

• VN2640
• VN2600/VN2610
• Optolyzer (MOST25)
• OptolyzerOL3150o (firmware version >= V1.5.3)
• OptolyzerOl3050e (firmware version >= V1.5)

Syntax long MostSetRxBufferCtrl(long channel, long mode)

Function Disables or enables the Rx buffer for messages of the control channel.

In case the parameter mode is set to '0' or '1' the result is reported by means of the
callback function OnMostStress().

Disabling the Rx buffer means that exactly one more message is accepted. Afterwards the
buffer is no longer enabled, i.e. further messages are rejected with "RxBuffer full" (see
status flags of Tx acknowledgment).

After the measurement start the receive buffer is always enabled.

VN2640:
Disabling the Rx buffer means that up to four control messages will be accepted, before
the buffer is disabled and low level retries on the bus are provoked.

OptolyzerOL3150o:
The stress network interface controller (NIC) must have its bypass opened (see
MostSetStressNodeParameter ).
Only messages addressed to the StressNIC will be blocked.

Parameters channel

Channel of the connected interface

mode

0 Disable receive buffer

1 Enable receive buffer

2 Enable receive buffer exactly once for one message

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.1 • MOST — •
• After measurement start

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetRxBufferCtrl

• Not in Stopmeasurement

Example

| MostGetChannel | mostSetRxBufferAsync |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSBC

MostSetSBC
CAPL Function Overview » MOST » MostSetSBC

Syntax long MostSetSBC (long channel, long sbcvalue)

Function This function sets the "Synchronous Bandwidth Control (SBC) Register" of the MOST
hardware chip to the given value.

The function is only practically applicable if the hardware connected to the channel is in
master mode.

The newly set value is only accepted once a "DeAllocate" message re-releases all
synchronous channel assignments.

Parameters channel

Channel of the connected MOST hardware

sbcvalue

New SBC register value. Values between 0 and 15 are permitted.

Return values

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• Not in StopMeasurement

Example

| MostGetSBC | OnMostSBC | MostGetChannel | MostSetCorrectStartupSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSpyCtrl, MostSetSpyAsync, MostSetSpyEthPkt

MostSetSpyCtrl, MostSetSpyAsync, MostSetSpyEthPkt


CAPL Function Overview » MOST » MostSetSpyCtrl, MostSetSpyAsync, MostSetSpyEthPkt

Syntax long MostSetSpyCtrl(long channel, long mode)

long MostSetSpyAsync(long channel, long mode)

MOST150: long MostSetSpyEthPkt(long channel, long mode)

Function Spy mode is activated (mode = 1) or deactivated (mode = 0) for the Control,
Asynchronous or Ethernet transmission channel using these functions.

Parameters channel

Channel of the connected interface

mode

0 Spy inactive

1 Spy active

Return values See error codes

For MOST hardware interfaces that do not support a Spy mode the error code
kMostWrongHWType is returned.

The Optolyzer Box supports Control Spy mode only with a closed bypass, i.e. if it is open
the bypass must be closed with MostSetAllBypass(channel, 1).

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• Not in StopMeasurement

7.6 SP2: form • MOST150 — •


3
• Not in StopMeasurement

Example

| MostGetChannel | MostGetSpyCtrl, MostGetSpyAsync, MostGetSpyEthPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncAudio

MostSetSyncAudio
CAPL Function Overview » MOST » MostSetSyncAudio

Syntax long MostSetSyncAudio(long channel, long channels[4], long device, long


mode)

MOST50 / MOST150: long MostSetSyncAudio(long channel, long label, long


width, long device, long mode)

Function The function programs the routing engine for the audio input or output of the bus
interface. The functions works independently of whether the synchronous channels are
reserved. The user must ensure the reservation, e.g. by sending an Alloc message to the
timing master.

MOST50 / MOST150: The function performs the routing of audio input or output of the
bus interface. At completion of the routing operation the event procedure
OnMostSyncAudio() will be called.

Info

MostSetSyncAudio automatically allocates new channels to which Line-In is


routed. (Device==0).

This function is only available if the connected hardware interface has its
bypass opened.

Parameters channel

Channel of the connected interface

channels

device = 0 Synchronous channels on which the Line input signal should be routed to.

device = 1 Synchronous channels from which the data should be routed to the
Line output.

The transferred array must always have four entries. Unused channels must be assigned
0xF8. The four channels have the following mapping to the audio data:

channels[0]: MSB left audio channel

channels[1]: LSB left audio channel

channels[2]: MSB right audio channel

channels[3]: LSB right audio channel

Info

This parameter is ignored in case the routing is canceled (mode==0).

device

0 Line-In: Audio input signals are put on synchronous channels.

1 Line-Out: Synchronous channel signals are grabbed for audio output.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncAudio

mode

0 Cancels the routing.

1 Executes the routing.

label

Connection label. In case of Line-In routing (device=0; mode=1) the label parameter has
no meaning.

width

Number of channels to be routed.

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST • •
• Not in Stopmeasurement

7.1 SP2 • MOST, MOST150 • •


• Not in Stopmeasurement

7.2 SP3 • MOST, MOST150, MOST50 • •


• Not in Stopmeasurement

Example

See CANoe online help MOST Access to Analog Audio Channels (Line In/ Headphone Out).

| MostGetChannel | MostSetSyncVolume | MostSetSyncMute | MostGetSyncVolume | MostGetSyncMute | MostSetSyncSpdif |


MostSyncAlloc | MostSyncDealloc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncMute

MostSetSyncMute
CAPL Function Overview » MOST » MostSetSyncMute

Syntax long MostSetSyncMute(long channel, long device, long mute)

Function Activates or deactivates the audio input or output of the bus interface.

Parameters channel

Channel of the connected interface

device

0 Line-In

1 Line-Out

2 S/PDIF In (VN2640 only)

3 S/PDIF Out (VN2640 only)

mute

0 Active (mute off)

1 Inactive (mute on)

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• Not in StopMeasurement

Example

See CANoe online help MOST Access to Analog Audio Channels (Line In/ Headphone Out).

| MostGetChannel | MostSetSyncAudio | MostSetSyncVolume | MostGetSyncVolume | MostGetSyncMute |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncSpdif

MostSetSyncSpdif
CAPL Function Overview » MOST » MostSetSyncSpdif

Note

This function is only available with MOST hardware VN2610 for MOST25, Optolyzer G2
3050e for MOST50 and VN2640/Optolyzer G2 3150o for MOST150.

Syntax long MostSetSyncSpdif(long channel, long channels[8], long device, long


mode)

MOST50 / MOST150: long MostSetSyncSpdif(long channel, long label, long


width, long device, long mode)

Function The function programs the routing engine for S/PDIF input or output of the bus interface.
The function works independently of whether the synchronous channels are reserved. The
user must ensure the reservation, e.g. by sending an Alloc message to the timing master.

MOST50 / MOST150: The function performs the routing of S/PDIF input or output of the
bus interface. At completion of the routing operation the event procedure
OnMostSyncSpdif() will be called.

Info

MostSetSyncSpdif automatically allocates new channels to which the S/PDIF


In is routed. (Device==0).

SPDIF In (device==0) is only available if the connected hardware interface has


its bypass opened.

Call MostSetSyncMute to mute/demute the signal.

Parameters channel

Channel of the connected interface

channels

S/PDIF In Synchronous channels on which the S/PDIF input signal should be routed
to.

S/PDIF Out Synchronous channels from which the data should be routed to the
S/PDIF output.

The transferred array must always have eight entries. Unused channels must be assigned
0xF8. The eight channels have the following mapping to the S/PDIF data:

channels[0]: MSB left audio channel

channels[1]: LSB left audio channel

channels[2]: AUX left audio channel

channels[3]: VUCP left audio channel

channels[4]: MSB right audio channel

channels[5]: LSB right audio channel

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncSpdif

channels[6]: AUX right audio channel

channels[7]: VUCP right audio channel

Info

This parameter is ignored in case the routing is canceled (mode==0).

device

0 S/PDIF in: S/PDIF input signals are put on synchronous channels.

1 S/PDIF out: Synchronous channel signals are grabbed for S/PDIF output.

mode

0 Cancels the routing.

1 Executes the routing.

label

Connection label. In case of S/PDIF-In routing (device=0; mode=1) the label parameter has
no meaning.

width

Number of channels to be routed.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 MOST — •

7.1 SP2 MOST, MOST150 — •

7.2 SP3 MOST, MOST150, — •


MOST50

Example

See CANoe online help MOST Access to Digital Audio Channels (S/PDIF In and Out).

| MostSetSyncSpdifLock | MostSetSyncSpdifMode | MostGetSyncSpdifMode | MostSetClockSource | MostGetClockSource |


MostSetSyncAudio |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncSpdifLock

MostSetSyncSpdifLock
CAPL Function Overview » MOST » MostSetSyncSpdifLock

Note

This function is only available with MOST hardware VN2610.

Syntax long MostSetSyncSpdifLock(long channel, long mode)

Function The function locks the internal S/PDIF timing generator on the S/PDIF input data stream.

Unlock the timing generator if frame synchronization is not possible due to a closed loop
configuration. A closed loop means that the S/PDIF input signal is locked through an
external S/PDIF device on the S/PDIF output of the bus interface.

Parameters channel

Channel of the connected interface

mode

0 Separates the timing generator from the S/PDIF input data stream.

1 Locks the timing generator on the S/PDIF input data stream.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

Use Cases:

External S/PDIF source device connected to the S/PDIF In connector of the VN2610

In this case the VN2610 is S/PDIF Slave (set by MostSetSyncSpdifMode()). In case the
VN2610 is configured as TimingSlave it automatically locks the internal S/PDIF timing
generator on the S/PDIF input data stream. As TimingMaster the there are two
possibilities for configuring the VN2610: Please refer to the example given for
MostSetClockSource()).

External S/PDIF source and sink device connected to the S/PDIF In and Out connector
of the VN2610

This is not the tyical use case but in case of synchronization problems (mentioned above)
the timing generator has to be separated from the S/PDIF input data stream.
on key 's'
{
long channel = 1;
MostSetSyncSpdifLock( channel, 0 );
}

More S/PDIF examples see CANoe online help MOST Access to Digital Audio Channels
(S/PDIF In and Out).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncSpdifLock

| MostSetSyncSpdif | MostSetSyncSpdifMode | MostGetSyncSpdifMode | MostSetClockSource | MostGetClockSource |


MostSetSyncAudio |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncSpdifMode

MostSetSyncSpdifMode
CAPL Function Overview » MOST » MostSetSyncSpdifMode

Note

This function is only available with MOST hardware VN2610.

Syntax long MostSetSyncSpdifMode(long channel, long mode)

Function Sets the timing mode for the S/PDIF signal.

Parameters channel

Channel of the connected interface

mode

0 S/PDIF slave.

1 S/PDIF master.

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

Example

Use Cases:

External S/PDIF sink device connected to the S/PDIF Out connector of the VN2610

In this case the VN2610 is S/PDIF Master and the S/PDIF mode has to be set accordingly
(mode = 1).
on key 's'
{
long channel = 1;
MostSetSyncSpdifMode( channel, 1 );
}

External S/PDIF source device connected to the S/PDIF In connector of the VN2610

In this case the VN2610 is S/PDIF Slave and the S/PDIF mode has to be set accordingly
(mode = 0).
on key 's'
{
long channel = 1;
MostSetSyncSpdifMode( channel, 0 );
}

More S/PDIF examples see CANoe online help MOST Access to Digital Audio Channels
(S/PDIF In and Out).

| MostSetSyncSpdif | MostSetSyncSpdifLock | MostGetSyncSpdifMode | MostSetClockSource | MostGetClockSource | MostSetSyncAudio


|

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetSyncVolume

MostSetSyncVolume
CAPL Function Overview » MOST » MostSetSyncVolume

Syntax long MostSetSyncVolume(long channel, long device, long volume)

Function Sets the volume of the audio input or output of the bus interface.

Parameters channel

Channel of the connected interface

device

0 Line-In

1 Line-Out

volume

Value range: 0...255 (0...100%)

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

See CANoe online help MOST Access to Analog Audio Channels (Line In/ Headphone Out).

| MostGetChannel | MostSetSyncAudio | MostSetSyncMute | MostGetSyncVolume | MostGetSyncMute |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetTimingMode

MostSetTimingMode
CAPL Function Overview » MOST » MostSetTimingMode

Syntax long MostSetTimingMode(long channel, long mode)

Function This function configures the MOST hardware as a Timing Master (mode = 1) or Timing
Slave (mode = 0).

MOST25: For further information on Master/Slave switchover functionality see also the
description of the MTR bit in the Transceiver Control Register of the OS8104.

MOST50/150: Switching from Slave to non-static Master does not wake the network
automatically. Use MostWakeup to start the network.

Info

If the bypass is closed (see MostSetAllBypass()) this function has no effect


until the bypass is opened.

Parameters channel

Channel of the connected interface

mode

0 Slave

1 Master

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• Not in StopMeasurement

Example

| MostGetTimingMode | OnMostTimingMode | MostGetChannel | MostSetMasterMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetTxLight

MostSetTxLight
CAPL Function Overview » MOST » MostSetTxLight

Note

This functionality is available for

• VN2600/VN2610
• Optolyzer (MOST25)
• OptolyzerOL3150o (firmware version >= V1.5.3)

Syntax long MostSetTxLight(long channel, long txlight)

Function Sets the Light Status at the Fiber Optical Transmitter (FOT).

Parameters channel

Channel of the interface to be queried

txlight

0 disable FOT: Tx light off

1 enable FOT: TimingMaster: Modulated light on

TimingSlave/Bypass: Tx light = Rx light

2 enable FOT: Constant light on (only available for


VN2600/VN2610/OptolyzerOL3150o)

For OptolyzerOL3150o:
The stress network interface controller (NIC) must have its bypass opened ( see
MostSetStressNodeParameter ).

Return values <0: See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.1 • MOST — •
• Not in StopMeasurement

Example

| MostGetRxLight | MostGetTxLight | MostSetTxLightPower | MostGetChannel | OnMostTxLight | MostShutDown |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetTxLightPower

MostSetTxLightPower
CAPL Function Overview » MOST » MostSetTxLightPower

Note

This functionality is only available for VN2600/VN2610 hardware.

Syntax long MostSetTxLightPower(long channel, long power)

Function Sets the intensity of the light at the Fiber Optical Transmitter (FOT).

The result is reported by means of the callback function OnMostStress().

Parameters channel

Channel of the interface to be driven

power

valid values:

50 3db attenuated to normal intensity

100 normal intensity

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.1 • MOST — •
• Not in StopMeasurement

Example

| MostSetTxLight | MostGetTxLight | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetXorFilter

MostSetXorFilter
CAPL Function Overview » MOST » MostSetXorFilter

Note

Works only if an Optolyzer box is assigned to the channel as interface.

XOR-Filter

Syntax long MostSetXorFilter( long channel, long arb, long targetAdr, long
sourceAdr, long type, byte msg[17], long crc, long ack)

Function Set the XOR filter. Effects the Optolyzer only when in spy mode.

Parameters channel

Channel of the connected interface

arb

Arbitration byte

targetAdr

Destination address

sourceAdr

Source address

type

Message type

msg

Use data byte of the MOST frame

crc

CRC code

ack

Acknowledge field of the MOST frame

Return values <0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

3.2 • MOST — •
• Not in StopMeasurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSetXorFilter

| MostGetChannel | MostGetXorFilter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostShutDown

MostShutDown
CAPL Function Overview » MOST » MostShutDown

Syntax MOST50 / MOST150: long MostShutDown(long channel)

Function Performs a regular network shutdown.

Parameters channel

Channel of the connected interface

Return values See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST150 — •

7.2 SP3 MOST150, MOST50 — •

Example

| MostWakeup | MostSetTxLight | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostStrictChannelMapping

MostStrictChannelMapping
CAPL Function Overview » MOST » MostStrictChannelMapping

Note

MostStrictChannelMapping() may only be called within the on preStart function of the


CAPL program!

Syntax MostStrictChannelMapping ()

Function The MOST sending and receiving behavior of the node is strictly based on the
configuration in the Simulation Setup:

• MOST messages and events are only received on channels that have been connected
to the node in the Simulation Setup.
• By default the node sends MOST messages on the channel to which it is connected in
the Simulation Setup.

Both Node messages and Spy messages continue to be received, provided that both types
are generated by the connected hardware.

This mode is especially useful for nodes that are only connected to one MOST channel in
the Simulation Setup. In this mode queries such as the following are omitted in the
message handling routines "if (this.MsgChannel!=XY) return;" or else the channel is
specified in defining the message handling routines e.g. "on mostMessage
MsgChannel1.*".

In many cases the user does not need to allocate the specific channel before sending a
message. When a message is created the channel is allocated by a wildcard (0xFFFF)
which is mapped to the channel that is connected in the Simulation Setup for sending in
this mode. This makes the CAPL code channel-independent, and it is easier to re-use the
code.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

| MostGetChannel | MostApplicationNode | mostRcvSpyMessagesOnly |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostStringToAscii

MostStringToAscii
CAPL Function Overview » MOST » MostStringToAscii

Syntax long mostStringToAscii(byte sourceData[], long sourceDatalen, char


buffer[], long buffersize)

Function Convert MOST string to ASCII string. Unsupported characters in the input data are ignored.

Info

Supported encodings:

0x00 Unicode, UTF16

0x01 ISO 8859/15 8 bit

0x02 Unicode, UTF8

0x03 RDS
0x04 DAB Charset 0001
0x05 DAB Charset 0010
0x06 DAB Charset 0011
0x07 SHIFT_JIS
Parameters sourceData

A buffer containing the MOST string to be decoded.

sourceDataLen

The size of the buffer containing the MOST string.

buffer

Buffer to which the ASCII string is copied.

bufferSize

Maximum number of copied ASCII string bytes (can be specified with (elcount(buffer))).

Return values >=0: number of converted characters

<0: See error codes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST • •

Example
byte data[9] = {0x00,0x00,0x61,0x00,0x62,0x00,0x63,0x00,0x00);
char buffer[200];
if(0 < mostStringToAscii(data, elcount(data), buffer, elcount(buffer)))
write("ASCII: %s", buffer);

Output:
ASCII: abc

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSyncAlloc

MostSyncAlloc
CAPL Function Overview » MOST » MostSyncAlloc

Syntax long MostSyncAlloc(long numChannels)

Function MOST25:

This function reserves synchronous bandwidth by sending an Alloc system message to the
MOST TimingMaster.

The result is reported by means of the callback function OnMostSyncAllocResult(). This


requires defining OnMostSyncAllocResult() in the CAPL program using the following
signature: OnMostSyncAllocResult(long allocResult, long numChannels, long
channels[])

Info

The service can only process one request at a time. After MostSyncAlloc()
or MostSyncDealloc() is called, the next request cannot be made until the
result of the current request is returned – asynchronously.

MOST150:

Allocates synchronous bandwidth on MOST150.

Info

• The callback function OnMostSyncAllocResult (see below) will not be


called on completion. MostAllocTableGetCL can be applied to check the
allocation result.
• Channels will be allocated only (e.g. for resource shortage tests). It is not
possible to put any data on these channels.
• Specific for VN2640:
• The bypass of the network interface controller (NIC) has to be open
(see MostSetAllBypass).
• At most ten labels can be allocated at a time.
• Specific for OptolyzerOL3150o:
• The bypass of the OptolyzerOL3150o’s stress NIC has to be open (see
MostSetStressNodeParameter).
• At most eight labels can be allocated at a time.

Parameters numChannels

The number of channels to be reserved:

MOST25: 1 <= numChannels <= 8

MOST150: 1 <= numChannels <= MaxSyncBandwidth (depends on boundary settings - max.


value: 372)

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSyncAlloc

6.0 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

Callback function:

Syntax void OnMostSyncAllocResult(long allocResult, long numChannels, long


channels[])

Function This function is called on completion of the allocation of channels triggered by the call of
the function.

Whether the allocation was successful and if so, which channels were allocated, is
indicated in the parameters described below.

Parameters allocResult

Result of the operation.

kGrant = 0x01 The channels were reserved

kBusy = 0x02 The channels were not reserved, because the TimingMaster is busy
processing another request

kDeny = 0x03 The channels were not reserved, because there are no more
channels available

kWrong = 0x04 The reservation request contains invalid parameters

kUnknown = 0xFF Unspecified error (e.g. a timeout while waiting for the
TimingMaster to respond)

numChannels

The number of reserved channels. (1 <= numChannels <= 8).

channels[]

The values contained in this parameter are valid for allocResult = 0x01 only. It passes
numChannels channel numbers reserved via MostSyncAlloc(). The value in channels[0]
designates the label used for administration of the reserved channels.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

MOST — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSyncAlloc

| OnMostAllocTable | MostSyncDealloc | MostSetSyncAudio | MostSetSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSyncDealloc

MostSyncDealloc
CAPL Function Overview » MOST » MostSyncDealloc

Syntax long MostSyncDealloc(long label)

Function MOST25:

This function releases reserved bandwidth for synchronous channels by sending a Dealloc
system message to the TimingMaster.

The result is reported by means of the callback function OnMostSyncDeallocResult. This


requires defining OnMostSyncDeallocResult in the CAPL program using the following
signature: OnMostSyncDeallocResult(long deallocResult, long label)

Info

• The service can only process one request at a time. After MostSyncAlloc
or MostSyncDealloc is called, the next request cannot be made until the
result of the current request is returned – asynchronously.
• OnMostSyncDeallocResult() is only called for channel labels reserved
via MostSyncAlloc.
• OnMostSyncDeallocResult() is also called for each reserved label if
release of all channels is requested (DeallocAll).

Most150:

Deallocates synchronous bandwidth on MOST150.

Info

• In contrast to MOST25 the callback function OnMostSyncDeallocResult


(see below) will not be called on completion. MostAllocTableGetCL can
be applied to check the de-allocation result.

Parameters label

Channel label.

MOST25: content of channels[0] in OnMostSyncAllocResult, see MostSyncAlloc. Value 0x7F


(=DeallocAll) releases all synchronous channels.
MOST150: Label number (see MostAllocTableGetCL)
Value 0xFFF releases all synchronous channels previously reserved with MostSyncAlloc
(VN2640 only).

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • MOST — •
• After measurement start
• Not in Stopmeasurement

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostSyncDealloc

Example

Callback function:

Syntax void OnMostSyncDeallocResult(long deallocResult, long label)

Function This function is called on completion of the deallocation of channels triggered by the call
of the function.

Whether the deallocation was successful and if so, which channels were deallocated, is
indicated in the parameters described below.

Parameters deallocResult

Result of the operation.

kGrant = 0x01 The channels were reserved

kBusy = 0x02 The channels were not reserved, because the TimingMaster is busy
processing another request

kWrong = 0x04 The specified channel label is invalid

kUnknown = 0xFF Unspecified error (e.g. a timeout while waiting for the
TimingMaster to respond)

label

Channel label (content of channels[0] in OnMostSyncAllocResult, see MostSyncAlloc).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

MOST — •

Example

| OnMostAllocTable | MostSyncAlloc | MostSetSyncAudio | MostSetStressNodeParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostWakeup

MostWakeup
CAPL Function Overview » MOST » MostWakeup

Syntax long MostWakeup (long channel, long duration)

Function The function wakes up the MOST loop optically by switching on the light on the output of
the connected MOST hardware for the maximum duration.

Parameters channel

Channel of the connected MOST hardware

duration

Length of the wake up impulse [ms]

Return values <= 0: See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostSetTxLight | MostGetTxLight | on mostLightLockError | MostGetChannel | MostSetCorrectStartupSBC | MostShutDown |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostTwinklePowerLed

MostTwinklePowerLed
CAPL Function Overview » MOST » MostTwinklePowerLed

Note

This function is available for the VN2600/VN2610 hardware only.

Syntax long MostTwinklePowerLed(long channel)

Function Causes the power LED of the interface to briefly twinkle.

Parameters channel

Channel of the connected interface

Return values See error codes

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.2 • MOST — •
• After measurement start
• Not in Stopmeasurement

Example

| MostGetChannel | MostGetHWCapability |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MostWriteReg

MostWriteReg
CAPL Function Overview » MOST » MostWriteReg

Note

Changes to registers may lead to unpredicatable behavior of the hardware interface.

Register layout of the OS8104:

The registers of the OS8104 chip are distributed among pages. It is not possible to
perform read or write actions on register pages. The offset is calculated as follows: offset
= page << 8 + address

Syntax long MostWriteReg(long channel, long chip, DWORD offset, long regdatalen,
byte regdata[])

Function Writes to one or more registers of a MOST hardware chip.

Parameters channel

Channel to which the hardware is connected

chip

Number of the MOST hardware chip (1 = OS8104; other chips cannot be accessed yet)

offset

Address of the first register

regdatalen

Number of registers to be written (maximum 16; for the Optolyzer Interface Box
maximum 1)

regdata[]

A byte buffer at least regdatalen in size with the data to be written

Return values See error codes

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

5.0 • MOST — •
• After measurement start
• Not in StopMeasurement

Example

| MostReadReg | OnMostReg | MostGetChannel |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostAllBypass(long mode)

OnMostAllBypass(long mode)
CAPL Function Overview » MOST » OnMostAllBypass(long mode)

Syntax OnMostAllBypass(long mode)

Function The event procedure OnMostAllBypass is called if the bypass of the MOST chip was
opened or closed. The variable mode contains the new state.

Supplemental information can be called up within this procedure by the


MostEventChannel, MostEventTime and MostEventOrigTime functions.

Controller events are passed through CAPL nodes. Please use the Multibus filter or MOST
filter to filter these events in node chains.

Parameters mode

0: The bypass is opened.


1: The bypass is closed. The MOST hardware is transparent to other devices on the ring.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 MOST • •

Example

| MostSetAllBypass | MostGetAllBypass |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostAllocTable

OnMostAllocTable
CAPL Function Overview » MOST » OnMostAllocTable

Note

This functionality is only available for VN2600/VN2610 and Optolyzer hardware.

Syntax OnMostAllocTable()

Function OnMostAllocTable is called as soon as the hardware interface detects a change in the
MOST allocation table. The allocation table contains the reservation status of the
synchronous MOST channels.

Supplemental information can be called up within this procedure by the


MostEventChannel, MostEventTime and MostEventOrigTime functions.

Controller events are passed through CAPL nodes. Please use the Multibus filter or MOST
filter to filter these events in node chains.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 MOST • •

7.1 SP4 MOST, MOST150 • •

7.2 SP3 MOST, MOST150, • •


MOST50
Example

| MostGetAllocTable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on mostAMSMessage

on mostAMSMessage
CAPL Function Overview » MOST » on mostAMSMessage

Syntax on mostAMSMessage

Function The event procedure on mostAMSMessage is called when a message is received from the
Application Message Service (AMS).

The key word this and the message selectors are available within event procedures to
permit access to the data of the message just received. The output(this) command serves
to pass the message in a nodal sequence.

The same modes of the event procedure as for on mostMessage may be used to prefilter
messages.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

The following examples show various modes of the event procedure on mostAMSMessage:

• on mostAMSMessage AudioPlayer.TimePosition.Set
React to message AudioPlayer.TimePosition.Set defined in a XML function
catalog.
• on mostAMSMessage AudioPlayer_TimePosition_Set
React to message AudioPlayer_TimePosition_Set defined in a CANdb database.
• on mostAMSMessage *
React to all MOST messages
• on mostAMSMessage 0x312010
React to message 0x312010 (function block 0x31, function 0x201, operation 0x0)
• on mostAMSMessage MsgChannel1.*
React to all messages received by channel 1.
• on mostAMSMessage MsgChannel1.0x312010
React to message 0x312010 if it is received by channel 1.
• on mostAMSMessage 0x22104C,0x312010-0x31201F
React to messages 0x22104C and 0x31201c through 0x31201F.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostApInstID

OnMostApInstID
CAPL Function Overview » MOST » OnMostApInstID

Syntax OnMostApInstID()

Function If the InstID of the associated function block changes, the CAPL node is informed by the
event procedure OnMostApInstID (only with an active MOST Application Socket). If the
functional address {FBlockID, InstID} occurs more than once in the network a change to
the InstID is initiated by the Network Master (Message:
NetBlock.FBlockIDs.SetGet(FBlockID, OldInstID, NewInstID)).

The new valid InstID may be polled by MostApGetInstID.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

In the Simulation Setup event procedures are only called if the event occurs on the
channel allocated to the CAPL node.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostAsRegistry(long regsel)

OnMostAsRegistry(long regsel)
CAPL Function Overview » MOST » OnMostAsRegistry(long regsel)

Syntax OnMostAsRegistry()

Function When the Local FBlockList or Bus Registry is changed the event procedure
OnMostAsRegistry() is called.

Causes for a change to the Local FBlockList:

• Registration or unregistration of one or more function blocks


• Change to the InstID of a function block by the Network Master
(NetBlock.FBlockIDs.SetGet).

Causes for a change to the Bus Registry:

• In a device with Network Master: Change in network status


• In a device without Network Master: Receipt of the
NetworkMaster.CentralRegisrty.Status message

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

In the Simulation Setup event procedures are only called if the event occurs on the
channel allocated to the CAPL node.

Parameters regsel

1: Changes in Local FBlockList


2: Changes in Bus Registry

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST — •

Example

Read-Out of the Registries

In the following example whenever a registry changes its contents are output to the Write
window.
OnMostAsRegistry(long regsel)
{
long size, i;
long rxtxlog, fblockid, instid;
// display registry type
if(regsel == 1)
write("Local Registry:");
else if(regsel == 2)
write("Bus Registry:");
// get registry size
size = MostAsRgGetSize(regsel);
// print the whole registry
write("Adr FBlock InstID");
for(i = 0; i < size; ++i)
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostAsRegistry(long regsel)

rxtxlog = MostAsRgGetRxTxLog(regsel,i);
fblockid = MostAsRgGetFBlockID(regsel,i);
instid = MostAsRgGetInstID(regsel,i);
write("%04X %02X %02X", rxtxlog, fblockid, instid);
}
}
Bus Registry:
Adr FBlock InstID
0100 02 00
0100 04 01
0100 C0 01
0101 C1 01
0101 C5 01

| MostAsRgGetSize | MostAsRgGetRxTxLog | MostAsRgGetFBlockID | MostAsRgGetInstID |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostCriticalUnlock

OnMostCriticalUnlock
CAPL Function Overview » MOST » OnMostCriticalUnlock

Syntax OnMostCriticalUnlock()

Function A "Critical Unlock" was detected on one of the configured MOST channels. This event
occurs if the lock status of the connected MOST hardware does not exhibit a "Lock" (see
MOST Spec 2V3 - 3.2.2 NetInterface) after a "Stable Lock" for at least t_Unlock (see MOST
Spec 2V3 – 3.9 Timing Definitions).
The relevant channel or time stamp of this event can be called up with the
MostEventChannel, MostEventTime and MostEventOrigTime functions.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| OnMostStableLock | MostGetLockEx | on mostLightLockError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostEcl

OnMostEcl
CAPL Function Overview » MOST » OnMostEcl

Note

This function is only available with MOST hardware VN2640.

Syntax MOST150: OnMostEcl(long eclState)

Function The event procedure is called when the state of the Electrical Control Line has changed.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

Parameters eclState

0: Low
1: High

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 MOST • •

Example

Output of ECL changes with time stamp.


OnMostEcl(long eclState)
{
write(„ECL state at %fs: %d“, MostEventTimeNs() / 1.0e9, eclState);
}

| MostSetEcl | mostSetEclGlitchFilter | mostConfigureEclSequence |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostEthPkt

OnMostEthPkt
CAPL Function Overview » MOST » OnMostEthPkt

Syntax MOST150: OnMostEthPkt(long pktDataLen)

Function When an Ethernet packet is received over the Packet Data Channel the OnMostEthPkt
event procedure is called.

The following functions are available for evaluating the event:

• long MostEventChannel()

Returns the channel of the packet event.

• long MostEventTime()

Returns the time stamp of the event (Units: 10 µs).

• float MostEventTimeNs()

Returns the time stamp of the event (Units: 1 ns).

• long MostEventOrigTime()

Returns the hardware generated time stamp of the event (Units: 10 µs).

• int64 MostEthPktSrcMacAdr(), int64 MostEthPktDestMacAdr()

Returns the 48 bit source or destination Ethernet address.

• long MostEthPktDir()

Returns the direction of transmission (Rx=0, Tx=1, TxRe-quest=2).

• long MostEthPktDlc()

Number of transported data bytes.

• long MostEthPktGetData(byte[] buffer, long cnt)

Tries to copy cnt data bytes to a provided buffer. Returns the actual number of
copied bytes.

• long MostEthPktGetSelData(byte[] buffer, long begin, long cnt)

Tries to copy cnt data bytes starting at byte position 'begin' to a provided buffer.
Returns the actual number of copied bytes.

• long MostEthPktIsSpy()

Returns 1 if the packet was received over the Spy of the Packet Data Channel,
otherwise 0.

• long MostEthPktAck()

Returns the acknowledge code.

• long mostEthPktPAck()

Returns the preemptive acknowledge code (for MostEthPktIsSpy()=1 only).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostEthPkt

(0x00: No Response; 0x01: Buffer full; 0x04: OK)

• dword MostEthPktCRC()

Returns the CRC value (for MostEthPktIsSpy()=1 only).

• long MostEthPktCAck()

Returns the CRC acknowledge code (for MostEthPktIsSpy()=1 only).


(0x00: No Response; 0x01: CRC error; 0x04: OK)

In nodal sequences (Measurement Setup) a received packet can be passed to the next
node by the OutputMostEthPktThis command.

Parameters pktDataLen

Number of data bytes of the packet.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP2 MOST150 • •

Example

| MostSetMacAdr | OnMostMacAdr | mostEthPktSetTraceColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostEthPktFragment

OnMostEthPktFragment
CAPL Function Overview » MOST » OnMostEthPktFragment

Syntax MOST150: OnMostEthPktFragment()

Function The event procedure OnMostEthPktFragment is called when the spy detects an
incomplete Ethernet packet transmission.

The following functions are available for evaluating the event:

• long MostEventChannel()

Returns the channel of the packet event.

• long MostEventTime()

Returns the time stamp of the event (Units: 10 µs).

• float MostEventTimeNs()

Returns the time stamp of the event (Units: 1 ns).

• long MostEventOrigTime()

Returns the hardware generated time stamp of the event (Units: 10 µs).

• long MostEthPktFragmentDlc()

Number of transported data bytes.

• long MostEthPktFragmentGetData(byte[] buffer, long cnt)

Tries to copy cnt data bytes to a provided buffer. Returns the actual number of copied
bytes.

Info

Due to performance reasons only the first transmitted data bytes are
stored in the fragment event.

All following functions return -1 if the corresponding data field is invalid (i.e. event was
too short to contain the information).

• int64 MostEthPktSrcMacAdr(), int64 MostEthPktDestMacAdr()

Returns the 48 bit source or destination Ethernet address.

• long MostEthPktFragmentAck()

Returns the acknowledge code.

• long MostEthPktFragmentPAck()

Returns the preemptive acknowledge from the potential packet receiver(s) to the
packet transmitter.

• dword MostEthPktFragmentCRC()

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostEthPktFragment

Returns the CRC value.

• long MostEthPktFragmentCAck()

Returns the CRC acknowledge code.

• long MostEthPktFragmentAnnouncedDlc()

Returns the announced data length at start of transmission. In general, the announced
length is not equal to the actual number of transmitted data bytes for fragments.

In nodal sequences (Measurement Setup) a fragment can be passed to the next node by
the OutputMostEthPktFragmentThis command.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP2 MOST150 • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostFiAmsPreReceive

OnMostFiAmsPreReceive
CAPL Function Overview » MOST » OnMostFiAmsPreReceive

Syntax long OnMostFiAmsPreReceive(mostAmsMessage * msg)

Function When fault injection is active, this function is called before the simulation node (CAPL
program or node layer module) receives the AMS message. This allows incoming messages
to be manipulated in order to emulate faulty application behavior.

The message can be suppressed (return value 0), forwarded (return value 1), or forwarded
as an altered message (use of MostFiAmsReceive).

Info

• All CAPL functions are available within the callback. When


output(mostAmsMessage) and MostFiAmsReceive are used, attention must
be paid that recursions are not programmed. This can be ensured through
appropriate message filtering (see example below).
• The callback is only called for the AMS messages for which the simulation
node has implemented a mostAmsMessage handler (i.e., for the messages
whose receipt the node is intended for).

Parameters msg

This variable contains the AMS message of the simulation node to be received.

The number of transmitted data can be up to 65535 bytes for a mostAmsMessage. For
reasons of efficiency, only the first 200 bytes are copied to the msg variable. To facilitate
access to all the message's user data, the message can be assigned to an AMS message
declared with a sufficient size (see example below).

Return values The return value can be used to control whether or not the message is to be received by
the simulation node.

0: Original message is not received.


1: Original message is received without alteration

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example
// change all Set operations to SetGet operations
// before the simulation node receives the message
long OnMostFiAmsPreReceive(mostAmsMessage * msg)
{
// The following if statement prevents this code from being called
recursively
// e.g. by ignoring the Tx acknowledgements
if((msg.OpType == 0x0) && (msg.dir == Rx)) // Set message
{
// make a copy
mostAmsMessage * modMsg = {DLC = 1000}; // buffer for 1000 data bytes
modMsg = msg; // at most 1000 data bytes are copied here

// modify OpType
modMsg.OpType = 0x2;
// forward modified message to simulation node
MostFiAmsReceive(modMsg);

// do not forward the original message


return 0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostFiAmsPreReceive

}
else
{
// forward the original message
return 1;
}
}

| OnMostFiAmsPreSend |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostFiAmsPreSend

OnMostFiAmsPreSend
CAPL Function Overview » MOST » OnMostFiAmsPreSend

Syntax long OnMostFiAmsPreSend(mostAmsMessage * msg)

Function When fault injection is active, this function is called before the AMS send request of a
CAPL program or node layer module is issued on the bus. This allows outgoing messages to
be manipulated in order to emulate faulty application behavior.
Parameters msg

This variable contains the send request of the simulation node.

The number of transmitted data can be up to 65535 bytes for a mostAmsMessage. For
reasons of efficiency, only the first 200 bytes are copied to the msg variable. To facilitate
access to the entire message's user data, the message can be assigned to an AMS message
declared with a sufficient size (see example below).

Return values The return value can be used to control whether or not the message is sent.

0: Original message is not sent


1: Original message is sent without alteration

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 MOST — •

Example
// change all Status messages a simulated node tries to send to error
messages
long OnMostFiAmsPreSend(mostAmsMessage * msg)
{
if(msg.OpType == 0xC) // Status or Result message
{
// make a copy
mostAmsMessage * modMsg = {DLC = 1000}; // buffer for 1000 data bytes
modMsg = msg; // at most 1000 data bytes are copied here
// modify OpType
modMsg.OpType = 0xF;
// keep message length and data
// but change the first byte
modMsg.byte(0) = 0x0B; // set ErrorCode=Device malfunction
// send modified message
output(modMsg);

// do not send original message


return 0;
}
else
{
// send original message
return 1;
}
}

| OnMostFiAmsPreReceive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostGroupAdr(long groupadr)

OnMostGroupAdr(long groupadr)
CAPL Function Overview » MOST » OnMostGroupAdr(long groupadr)

Syntax OnMostGroupAdr(long groupadr)

Function The group address of the hardware interface to the MOST bus has changed. The value of
the new group address is in the groupadr parameter.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters groupadr

New value of the group address.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostSetGroupAdr | MostGetGroupAdr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on mostLightLockError

on mostLightLockError
CAPL Function Overview » MOST » on mostLightLockError

Syntax on mostLightLockError

Function On controller events on mostLightLockError is called.


Light, Lock and Error events will be forwarded automatically.

If the event procedure should only react to events on channel 1 this is defined as follows:
on MsgChannel1.mostLightLockError

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 MOST • •

Example

| MostGetRxLight | MostGetLock | OnMostTxLight | mostLightLockError - Selectors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMacAdr

OnMostMacAdr
CAPL Function Overview » MOST » OnMostMacAdr

Syntax MOST150: OnMostMacAdr(int64 macAdr)

Function The MAC address (48 bit) of the hardware interface to the MOST bus has changed.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the MOST application
filter, to filter these events in nodal sequences.

Parameters macAdr

New value of the MAC address.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST150 • •

Example

| MostSetMacAdr | OutputMostEthPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on mostMessage

on mostMessage
CAPL Function Overview » MOST » on mostMessage

Syntax on mostMessage

Function The event procedure on mostMessage is called on the receipt of a function catalog
conform MOST frame (RType=Normal).
The key word this and the message selectors (see Selectors) are available within the
event procedures, to access the data of the message that has just been received. The
command output(this) can be used for forwarding the message in a node chain.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 MOST • •

Example

The following examples show various modes of the event procedure on mostMessage:

• on mostMessage AudioPlayer.TimePosition.Set
React to message AudioPlayer.TimePosition.Set defined in a XML function
catalog.
• on mostMessage AudioPlayer_TimePosition_Set
React to message AudioPlayer_TimePosition_Set defined in a CANdb database.
• on mostMessage *
React to all MOST messages
• on mostMessage 0x312010
React to message 0x312010 (function block 0x31, function 0x201, operation 0x0)
• on mostMessage MsgChannel1.*
React to all messages received by channel 1.
• on mostMessage MsgChannel1.0x312010
React to message 0x312010 if it is received by channel 1.
• on mostMessage 0x22104C,0x312010-0x31201F
React to messages 0x22104C and 0x31201c through 0x31201F.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPBlock

OnMostMHPBlock
CAPL Function Overview » MOST » OnMostMHPBlock

Note

OnMostMHPBlock can only be used in the measurement setup and should be inserted
under the item "Callback function".

For simulation of a MOST High connection sender and receiver in CAPL the MOST High DLL
can be used. The DLL is located in the Exec32 folder of the MOST High Demos.

Syntax long OnMostMHPBlock(long sourceDevID, long destDevID, long fBlockID, long


instID, long functionID, long opType)

Function The event procedure is called up as soon as a block from a MOST High connection has
been fully transmitted.

Within this event procedure the following functions are available

• long MostMHPBlockGetData(byte buffer[], long bufferSize)

Copies the reference data of the block in a provided buffer.


Parameter:
buffer (buffer for the data bytes)
bufferSize (size of the buffer)
Returns:
Number of data bytes copied

• long MostMHPBlockIsSpy()

Indicates whether the block was made up of Spy messages.


Parameter:
None
Returns:
0: Comprised of node messages
1: Comprised of Spy messages

• long MostMHPBlockNumberOfFrames()

Provides the number of Data Frames of the block.


Parameter:
None
Returns:
Number of actual Data Frames

• long MostMHPBlockNumberOfFramesIndicated()

Provides the number of Data Frames of the block that it should has according to the 0
frame.
Parameter:
None
Returns:
Number of Data Frames

• long MostMHPBlockSize()

Provides the size of the block.


Parameter:
None
Returns:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPBlock

Number of data bytes (reference data only)

• long MostMHPBlockTransportMode()

Provides the transmission mode of the block.


Parameter:
None
Returns:
1: Transmission on the control channel
2: Transmission on the asynchronous channel

• long MostMHPBlockCnt()

Provides the sequence number of the block.


Parameter:
None
Returns:
Cnt field of the 0 frame (see MHP specification)

• long MostMHPBlockOptions()

Provides the options for the transmission of the block.


Parameter:
None
Returns:
Options field of the 0 frame (see MHP specification)

• long MostMHPBlockSegID()

Provides the segmentation ID of the block.


Parameter:
None
Returns:
Options field of the 0 frame (see MHP specification)

The functions MostEventChannel, MostEventTime and MostEventTimeNS can be used to


call up supplemental information.

Parameters sourceDevID

Address of the transmitter

destDevID

Address of the receiver

fBlockID

FBlockID of the receiver

instID

Instance ID of the receiver

functionID

FunctionID of the receiver

opType

OpType of the receiver

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPBlock

Return values The return value determines whether the MHP block event is relayed to the next function
block in the measurement setup (e.g. a Trace window).

0: No relay

1: relay

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • —

Example

The example shows how the data of a block can be written to a file. The file (fileHandle
variable) must be opened in advance. The block event is relayed by the "return 1"
instruction to the next function block in the measurement setup.
const long blockBufferSize = 64*1024;
long OnMostMHPBlock (long sourceDevID, long destDevID, long fBlockID, long
instID,
long functionID, long opType)
{
//Prepare a data buffer
byte buffer[blockBufferSize];
long byteCount;
//Get data of the MHPBlock
mostMHPBlockGetData(buffer, blockBufferSize);
//Write data to the file
byteCount = (mostMHPBlockSize() < blockBufferSize) ?
mostMHPBlockSize() :
blockBufferSize;
fileWriteBinaryBlock(buffer, byteCount, fileHandle);
//Forward MHPBlock to the next CAPL node
return 1;
}

| OnMostMHPPacket | OnMostMHPError | mostMHPBlockSetTraceColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPConnection

OnMostMHPConnection
CAPL Function Overview » MOST » OnMostMHPConnection

Note

OnMostMHPConnection can only be used in the measurement setup and should be


inserted under the item "Callback function".

For simulation of a MOST High connection sender and receiver in CAPL the MOST High DLL
can be used. The DLL is located in the Exec32 folder of the MOST High Demos.

Syntax long OnMostMHPConnection(long sourceDevID, long destDevID, long fBlockID,


long instID, long functionID, long opType)

Function The event procedure is called up as soon as a MOST High connection version 2.2 or higher
is terminated.

Within this event procedure the following functions are available

• long MostMHPOnMostMHPConnectionIsSpy()

Indicates whether the connection was made up of Spy messages.


Parameters:
None
Returns:
0: Comprised of node messages
1: Comprised of Spy messages

• long MostMHPOnMostMHPConnectionVersion()

Indicates the used MOST High Protocol version.


Parameters:
None
Returns:
0: Version 2.1
1: Version 2.2

• long MostMHPOnMostMHPConnectionNegAcks()

Indicates the number of negative frame acknowledge messages.


Parameter:
None
Returns:
Number of NegAcks (see MHP specification)

• long MostMHPOnMostMHPConnectionFrameRequests()

Indicates the number of single or multiple frame request messages.


Parameter:
None
Returns:
Number of (multiple) frame requests

• long MostMHPPOnMostMHPConnectionBlockRequests()

Indicates the number of block request messages.


Parameter:
None
Returns:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPConnection

Number of block requests

• long MostMHPOnMostMHPConnectionWarnings()

Indicates the number of MHP observer warnings. Warnings may indicate


communication problems.
Parameter:
None
Returns:
Number of Observer warnings

• long MostMHPOnMostMHPConnectionErrors()

Indicates the number of MHP Observer errors. Errors indicate MOST High Protocol
violations.
Parameter:
None
Returns:
Number of Observer errors

• long MostMHPConnectionPackets()

Indicates the number of connections transmitted during the MHP connection.


Parameter:
None
Returns:
Number of packets

The functions MostEventChannel(), MostEventTime() and MostEventTimeNS() can be used


to call up supplemental information.

Parameters sourceDevID

Address of the transmitter

destDevID

Address of the receiver

fBlockID

FBlockID of the receiver

instID

Instance ID of the receiver

functionID

FunctionID of the receiver

opType

OpType of the receiver

Return values The return value determines whether the MHP connection event is relayed to the next
function block in the measurement setup (e.g. a Trace window).

0: No relay

1: relay

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPConnection

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 MOST • —

Example

| OnMostMHPBlock | OnMostMHPError | mostMHPConnectionSetTraceColors | MOST High Observer and Combiner |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPError

OnMostMHPError
CAPL Function Overview » MOST » OnMostMHPError

Note

OnMostMHPError can only be used in the measurement setup and should be inserted
under the item "Callback function".

For simulation of a MOST High connection sender and receiver in CAPL the MOST High DLL
can be used. The DLL is located in the Exec32 folder of the MOST High Demos.

Syntax long OnMostMHPError(long sourceDevID, long destDevID, long fBlockID, long


instID, long functionID, long opType)

Function The event procedure is called up as soon as a MOST High protocol violation is observed.

Within this event procedure the following functions are available

• long MostMHPErrorCode()

Indicates the MHP observer error number. See possible MHP observer error codes.
Parameter:
None
Returns:
Observer error number

• long MostMHPErrorValue()

Indicates the error value. Not supported by all error codes.


Parameter:
None
Returns:
Error value or 0

• long MostMHPErrorExpectedValue()

Indicates the expected value. Not supported by all error codes.


Parameter:
None
Returns:
Expected value or 0

• long MostMHPErrorIsWarning()

Indicates if this is a warning. Warnings may indicate a communication problem.


Parameter:
None
Returns:
Error value or 0

The functions MostEventChannel, MostEventTime and MostEventTimeNS can be used to


call up supplemental information.

Parameters sourceDevID

Address of the transmitter

destDevID

Address of the receiver

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPError

fBlockID

FBlockID of the receiver

instID

Instance ID of the receiver

functionID

FunctionID of the receiver

opType

OpType of the receiver

Return values The return value determines whether the MHP error event is relayed to the next function
block in the measurement setup (e.g. a Trace window).

0: No relay

1: relay

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • —

Example

| OnMostMHPBlock | OnMostMHPPacket | mostMHPErrorSetTraceColors | MOST High Observer Error Codes | MOST High Observer and
Combiner | MOST High Protocol: Simulation of Sender and Receiver |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPPacket

OnMostMHPPacket
CAPL Function Overview » MOST » OnMostMHPPacket

Note

OnMostMHPPacket can only be used in the measurement setup and should be inserted
under the item "Callback function".

For simulation of a MOST High connection sender and receiver in CAPL the MOST High DLL
can be used. The DLL is located in the Exec32 folder of the MOST High Demos.

Syntax long OnMostMHPPacket(long sourceDevID, long destDevID, long fBlockID, long


instID, long functionID, long opType)

Function The event procedure is called up as soon as a MOST High packet is finished.

Within this event procedure the following functions are available

• long MostMHPPacketIsSpy()

Indicates whether the packet was made up of Spy messages.


Parameters:
None
Returns:
0: Comprised of node messages
1: Comprised of Spy messages

• long MostMHPPacketVersion()

Indicates the used MOST High Protocol version.


Parameters:
None
Returns:
0: Version 2.1
1: Version 2.2

• long MostMHPPacketNegAcks()

Indicates the number of negative frame acknowledge messages.


Parameter:
None
Returns:
Number of NegAcks (see MHP specification)

• long MostMHPPacketFrameRequests()

Indicates the number of single or multiple frame request messages.


Parameter:
None
Returns:
Number of (multiple) frame requests

• long MostMHPPacketBlockRequests()

Indicates the number of block request messages.


Parameter:
None
Returns:
Number of block requests

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPPacket

• long MostMHPPacketWarnings()

Indicates the number of MHP observer warnings. Warnings may indicate


communication problems.
Parameter:
None
Returns:
Number of Observer warnings

• long MostMHPPacketErrors()

Indicates the number of MHP Observer errors. Errors indicate MOST High Protocol
violations.
Parameter:
None
Returns:
Number of Observer errors

The functions MostEventChannel(), MostEventTime() and MostEventTimeNS() can be used


to call up supplemental information.

Parameters sourceDevID

Address of the transmitter

destDevID

Address of the receiver

fBlockID

FBlockID of the receiver

instID

Instance ID of the receiver

functionID

FunctionID of the receiver

opType

OpType of the receiver

Return values The return value determines whether the MHP packet event is relayed to the next
function block in the measurement setup (e.g. a Trace window).

0: No relay

1: relay

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST • —

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMHPPacket

| OnMostMHPBlock | OnMostMHPError | mostMHPPacketSetTraceColors | MOST High Observer and Combiner | MOST High
Protocol: Simulation of Sender and Receiver |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMPR(long value)

OnMostMPR(long value)
CAPL Function Overview » MOST » OnMostMPR(long value)

Syntax OnMostMPR(long value)

Function A change is made to the Maximum Position Register of the MOST chip, i.e. the number of
devices in the MOST ring. The value parameter contains the new value of the Maximum
Position Register.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters value

New value of the Maximum Position Register of the MOST chip.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostGetMPR |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMPRDelayed(long mpr)

OnMostMPRDelayed(long mpr)
CAPL Function Overview » MOST » OnMostMPRDelayed(long mpr)

Syntax OnMostMPRDelayed(long mpr)

Function The value of the maximum position register in the MOST chip has not changed since the
last network change event (NCE) for t_MPRDelayed (see MOST Spec 2V3 – 3.9 Timing
Definitions). The mpr parameter indicates the value of the maximum position register.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters mpr

Value of the Maximum Position Register in the MOST chip.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| OnMostMPR | MostGetNceType |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMsgFragment

OnMostMsgFragment
CAPL Function Overview » MOST » OnMostMsgFragment

Syntax MOST50 / MOST150: OnMostMsgFragment()

Function The event procedure OnMostMsgFragment is called when the spy detects an incomplete
transmission on the Control channel.

The following functions are available for evaluating the event:

• long MostEventChannel()

Returns the channel of the packet event.

• long MostEventTime()

Returns the time stamp of the event (Units: 10 µs).

• float MostEventTimeNs()

Returns the time stamp of the event (Units: 1 ns).

• long MostEventOrigTime()

Returns the hardware generated time stamp of the event (Units: 10 µs).

• long MostMsgFragmentDlc()

Number of transported data bytes.

• long MostMsgFragmentGetData(byte[] buffer, long cnt)

Tries to copy cnt data bytes to a provided buffer. Returns the actual number of
copied bytes.

Info

Due to performance rea-sons only the first transmitted data bytes are
stored in the fragment event.

All following functions return -1 if the corresponding data field is invalid (i.e. event was
too short to contain the information).

• long MostMsgFragmentSrcAdr(), long MostMsgFragmentDestAdr()

Returns the source or destination address.

• long MostMsgFragmentAck()

Returns the acknowledge code.

• long MostMsgFragmentPAck()

Returns the preemptive acknowledge from the potential packet receiver(s) to the
packet transmitter.

• long MostMsgFragmentPriority()

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostMsgFragment

Returns the message priority.

• long MostMsgFragmentPIndex()

Returns the packet index. The packet index increments by one per message from a
node.

• dword MostMsgFragmentCRC()

Returns the CRC value.

• long MostMsgFragmentCAck()

Returns the CRC acknowledge code.

• long MostMsgFragmentAnnouncedDlc()

Returns the announced data length at start of transmission. In general, the announced
length is not equal to the actual number of transmitted data bytes for fragments.

In nodal sequences (Measurement Setup) a fragment can be passed to the next node by
the OutputMostMsgFragmentThis command.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP2 MOST150 • •

7.2 SP3 MOST150, MOST50 • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostNetOn / OnMostInitReady

OnMostNetOn / OnMostInitReady
CAPL Function Overview » MOST » OnMostNetOn / OnMostInitReady

Syntax OnMostNetOn

OnMostInitReady

Function The NetOn event (first "Stable Lock" after the loop has been woken up) has occurred on
one of the configured MOST channels. The relevant channel or time stamp of this event
can be called up with the MostEventChannel, MostEventTime and MostEventOrigTime
functions.

Info

In the MOST Specification 3V0 the NetOn event was renamed to InitReady.
However, the meaning is still the same. The Trace window displays this
information in the disassembly column and the detail view. In CAPL there is
an additional event procedure OnMostInitReady (since version 7.2). To
assure the correct operation of existing CAPL programs, the event handler
OnMostNetOn is still called.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| OnMostStableLock |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostNetState(long oldstate, long newstate)

OnMostNetState(long oldstate, long newstate)


CAPL Function Overview » MOST » OnMostNetState(long oldstate, long newstate)

Syntax OnMostNetState(long oldstate, long newstate)

Function The OnMostNetState() event procedure is called when the network status is changed.
oldstate and newstate pass the previous and current network status respectively.

The following network states are defined based on the MOST Specification 2.3.

Value Symbol Meaning

<0 Error code See Error codes in CAPL functions

0 MostNetState_Undefined Before the first event (shortly after


measurement start) the network status is
unknown.

2 MostNetState_PowerOff The network interface to the MOST ring is


deactivated. The Tx FOT is not emitting any
light.

3 MostNetState_NetInterfaceInit The network interface is initializing, e.g. after


it has been woken by "light on".

4 MostNetState_ConfigNotOk The network interface is in normal operating


mode (stable lock). On application level the
MOST ring is in state ConfigNotOk. ConfigNotOk
is entered on device initialization or when the
NetworkMaster broadcasts
Configuration.Status(NotOk).

5 MostNetState_ConfigOk The network interface is in normal operating


mode (stable lock). On application level the
MOST ring is in state ConfigOk. ConfigOk is
entered when the NetworkMaster broadcasts
Configuration.Status(Ok).

Info

Each device or each MOST hardware forms its own network state from the
perspective of a node in the MOST ring.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

In the Simulation Setup event procedures are only called if the event occurs on the
channel allocated to the CAPL node.

Parameters oldstate

Old network status.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostNetState(long oldstate, long newstate)

newstate

Current network status.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostGetNetState | OnMostNetOn | OnMostStableLock | OnMostCriticalUnlock | MostGetLockEx|

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostNodeAdr(long nodeadr)

OnMostNodeAdr(long nodeadr)
CAPL Function Overview » MOST » OnMostNodeAdr(long nodeadr)

Syntax OnMostNodeAdr(long nodeadr)

Function The node address of the hardware interface to the MOST bus has changed. The value of
the new node address is in the nodeadr parameter.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters nodeadr

New value of the node address.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostGetNodeAdr | MostSetNodeAdr |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostNPR(long value)

OnMostNPR(long value)
CAPL Function Overview » MOST » OnMostNPR(long value)

Syntax OnMostNPR(long npr)

Function The Node Position Register of the MOST chip, i.e. the position of the device in the MOST
ring, has changed. The parameter value contains the new value of the Node Position
Register.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters npr

New value of the Node Position Register in the MOST chip.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostGetNPR |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostPkt(long pktdatalen)

OnMostPkt(long pktdatalen)
CAPL Function Overview » MOST » OnMostPkt(long pktdatalen)

Syntax OnMostPkt(long pktdatalen)

Function When a packet is received over the Asynchronous Channel the OnMostPkt() event
procedure is called.

The following functions are available for evaluating the event:

• long MostPktMsgChannel()
Returns the channel of the packet event.
• long MostPktMsgTime()
Returns the time stamp of the event (Units: 10 µs).
• float MostPktMsgTimeNs()
Returns the time stamp of the event (Units: 1 ns).
• long MostPktOrigTime()
Returns the hardware generated time stamp of the event (Units: 10 µs).
• long MostPktSrcAdr(), long MostPktDestAdr()
Returns the source or destination address
• long MostPktDir()
Returns the direction of transmission (Rx=0, Tx=1, TxRequest=2)
• long MostPktArbitration()
Returns the packet arbitration value
• long MostPktDlc()
Number of transported data bytes (= Source address + Number of used quadlets = 2 +
N*4; N = 0,1,2...)
• long MostPktGetData(BYTE[] buffer, long cnt)
Tries to copy cnt data bytes to a provided buffer. Returns the actual number of
copied bytes.
• long MostPktGetSelData(BYTE[] buffer, long begin, long cnt)
Tries to copy cnt data bytes starting at byte position 'begin' to a provided buffer.
Returns the actual number of copied bytes.
• long MostPktTelID()
Returns the TelID of the packet (upper four bits of data byte 4)
• long MostPktTelLen()
Returns the TelLen of the packet (comprised of data bytes 4 and 5)
• long MostPktIsSpy()
Returns 1 if the packet was received over the Spy of the asynchronous channel,
otherwise 0.
• long MostPktAck()
Returns the acknowledge code (MOST150 only).
• long MostPktPAck
Returns the preemptive acknowledge from the potential packet receiver(s) to the
packet transmitter (for MostEthPktIsSpy()=1 and MOST150).
(0x00: No Response; 0x01: Buffer full; 0x04: OK)
• long MostPktCRC
Returns the CRC value (for MostPktIsSpy()=1 and MOST150).
• long MostPktCAck()
Returns the CRC acknowledge code (for MostPktIsSpy()=1 and MOST150).
(0x00: No Response; 0x01: CRC error; 0x04: OK)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostPkt(long pktdatalen)

In nodal sequences (Measurement Setup) a received packet can be passed to the next
node by the OutputMostPktThis command.

Parameters pktdatalen

Number of data bytes of the packet.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 MOST • •

7.1 SP2 MOST, MOST150 • •

7.2 SP3 MOST, MOST150, • •


MOST50
Example

Access to packet data:


OnMostPkt(long pktDataLen)
{
byte data[1524];
long i, bytesdisp;
write("Packet detected on channel %d", MostPktMsgChannel());
// copy packet data to local buffer
MostPktGetData(data, pktDataLen);
// output first data bytes
bytesdisp = pktDataLen > 10 ? 10 : pktDataLen;
for(i = 0; i < bytesdisp; i++)
{
write("Byte %03d: %02X", i, data[i]);
}
// forward packet to the next node
OutputMostPktThis();
}

| OutputMostPkt | OutputMostPktThis | mostPktSetTraceColors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostPktFragment

OnMostPktFragment
CAPL Function Overview » MOST » OnMostPktFragment

Syntax MOST50 / MOST150: OnMostPktFragment()

Function The event procedure OnMostPktFragment is called when the spy detects an incomplete
transmission on the Packet Data channel.

The following functions are available for evaluating the event:

• long MostEventChannel()

Returns the channel of the packet event.

• long MostEventTime()

Returns the time stamp of the event (Units: 10 µs).

• float MostEventTimeNs()

Returns the time stamp of the event (Units: 1 ns).

• long MostEventOrigTime()

Returns the hardware generated time stamp of the event (Units: 10 µs).

• long MostPktFragmentDlc()

Number of transported data bytes.

• long MostPktFragmentGetData(byte[] buffer, long cnt)

Tries to copy cnt data bytes to a provided buffer. Returns the actual number of
copied bytes.

Info

Due to performance rea-sons only the first transmitted data bytes are
stored in the fragment event.

All following functions return -1 if the corresponding data field is invalid (i.e. event was
too short to contain the information).

• long MostPktFragmentSrcAdr(), long MostPktFragmentDestAdr()

Returns the source or destination address.

• long MostPktFragmentAck()

Returns the acknowledge code.

• long MostPktFragmentPAck()

Returns the preemptive acknowledge from the potential packet receiver(s) to the
packet transmitter.

• long MostPktFragmentPIndex()

Returns the packet index. The packet index increments by one per message from a

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostPktFragment

node.

• dword MostPktFragmentCRC()

Returns the CRC value.

• long MostPktFragmentCAck()

Returns the CRC acknowledge code.

• long MostPktFragmentAnnouncedDlc()

Returns the announced data length at start of transmission. In general, the announced
length is not equal to the actual number of transmitted data bytes for fragments.

In nodal sequences (Measurement Setup) a fragment can be passed to the next node by
the OutputMostPktFragmentThis command.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 SP2 2MOST150 • •

7.2 SP3 2MOST150, MOST50 • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on mostRawMessage

on mostRawMessage
CAPL Function Overview » MOST » on mostRawMessage

Syntax on mostRawMessage

Function on mostRawMessage is called on the receipt of MOST frames whose type isn't Normal.

These are RemoteRead, RemoteWrite, Alloc, Dealloc and GetSource. See Selectors for
the applicable selectors. The command output(this) can be used for forwarding the
message in a node chain.

If the event procedure should only react to messages on channel 1 this is defined as
follows:
on MsgChannel1.mostRawMessage

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

4.0 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostReg

OnMostReg
CAPL Function Overview » MOST » OnMostReg

Syntax OnMostReg()

Function OnMostReg() is called in response to read or write requests to registers of a MOST


hardware interface chip.

The following functions are available for evaluating the event:

• long MostRegChip()
Returns the identifier of the chip whose registers are transported with this event ( see
MostReadReg)
• long MostRegOffset()
Returns the start address of the register.
• long MostRegDataLen()
Returns the number of bytes transported with this event (maximum of 16).
• void MostRegGetData(byte buffer[], long buffersize)
The register values may be copied to a byte buffer with the function
MostRegGetData(). It must be assured that the buffer has the specified size
(buffersize). A maximum of 16 bytes are transported with the MostReg event.
• long MostRegGetByteAbs(long chip, long adr)
long MostRegGetWordAbs(long chip, long adr)
Returns the contents of the register 'adr' in the chip 'chip'. If the MostReg event does
not contain this register kMostParameterOutOfRange = -9 is returned.

For further information on this event see Supplemental Information on Event


Procedures for MOST Controller Events.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example
OnMostReg()
{
byte regData[16];
long i, offset;
// get register contents
MostRegGetData(regData, 16);
// get offset
offset = MostRegOffset();
// output register contents to Write window
write("OnMostReg() called for chip %d on channel %d", MostRegChip(),
MostEventChannel());
write("Map Value");
for(i = 0; i < MostRegDataLen(); i++)
{
write("%04X %02X", offset + i, regData[i]);
}
}

Output in the Write Window:


OnMostReg() called for chip 1 on channel 1
Map Value
0080 E2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostReg

0081 42
0082 16
...

| MostReadReg | MostWriteReg |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostSBC(long value)

OnMostSBC(long value)
CAPL Function Overview » MOST » OnMostSBC(long value)

Syntax OnMostSBC(long value)

Function A change is made to the Synchronous Bandwidth Register of the MOST chips, i.e. the
distribution into synchronous/asynchronous transmission bandwidth. The 'value' parameter
contains the new value of the Synchronous Bandwidth Register (see also Datasheet for the
OS8104).

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters value

New value of Synchronous Bandwidth Register of the MOST chip.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 MOST • •

Example

| MostGetSBC | MostSetSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostShutdownFlag

OnMostShutdownFlag
CAPL Function Overview » MOST » OnMostShutdownFlag

Syntax MOST150: OnMostShutdownFlag(long oldstate, long newstate)

Function This event procedure is called each time the state of the Shutdown flag changes.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

Parameters oldstate

Old state of the Shutdown Flag.

newstate

New state of the Shutdown Flag.

Return values 1: Shutdown Flag set.

0: Shutdown Flag not set.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST • •

Example

| MostSetShutDownFlagUsage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostStableLock

OnMostStableLock
CAPL Function Overview » MOST » OnMostStableLock

Syntax OnMostStableLock()

Function A "Stable Lock" was detected on one of the configured MOST channels. This event occurs if
the lock status of the connected MOST hardware exhibits "Lock" (see MOST Spec 2V3 -
3.2.2 NetInterface) for at least t_Lock (see MOST Spec 2V3 – 3.9 Timing Definitions). The
relevant channel or time stamp of this event can be called up with the MostEventChannel,
MostEventTime and MostEventOrigTime functions.

CAPL nodes are transparent to the controller events. Please use the Multibus filter or
MOST filter, to filter these events in nodal sequences.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Example

| OnMostCriticalUnlock | MostGetLockEx | on mostLightLockError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostStress(long mode, long state)

OnMostStress(long mode, long state)


CAPL Function Overview » MOST » OnMostStress(long mode, long state)

Syntax OnMostStress(long mode, long state)

Function The event procedure OnMostStress() will be called before the beginning and after the
end of the stress generation.

Parameters mode

1 Stress generation with MostGenerateLightError

2 Stress generation with MostGenerateLockError

3 Stress generation with MostGenerateBusloadCtrl

4 Stress generation with MostGenerateBusloadAsync

5 Stress generation with MostSetRxBufferCtrl

6 Stress generation with MostSetTxLightPower

7 MostGenerateBypassToggle

8 MostSetSystemLockFlagUsage

9 MostSetShutDownFlagUsage

10 MostGenerateBusloadEthPkt

11 mostSetRxBufferAsync

state

0 Stress mode is stopped

Note:

mode = 5: Rx buffer enabled

mode = 6: normal light intensity

1 Stress mode is started

Note:

mode = 5: Rx buffer disabled

mode = 6: 3db attenuation

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostStress(long mode, long state)

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostSyncAudio

OnMostSyncAudio
CAPL Function Overview » MOST » OnMostSyncAudio

Syntax OnMostSyncAudio(long label, long device, long mode)

Function The event procedure OnMostSyncAudio will be called after routing of audio input or
output of the bus interface (see MostSetSyncAudio).
Parameters label

Connection label.

device

0: Line-In: Audio input signals are put on synchronous channels.


1: Line-Out: Synchronous channel signals are grabbed for audio output.

mode

0: Routing canceled.
1: Routing executed.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostSyncSpdif

OnMostSyncSpdif
CAPL Function Overview » MOST » OnMostSyncSpdif

Syntax OnMostSyncSpdif(long label, long device, long mode)

Function The event procedure OnMostSyncSpdif will be called after routing of S/PDIF input or
output of the bus interface (see MostSetSyncSpdif).
Parameters label

Connection label.

device

0: S/PDIF-In: Audio input signals are put on synchronous channels.


1: S/PDIF-Out: Synchronous channel signals are grabbed for audio output.

mode

0: Routing cancelled.
1: Routing executed.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostSystemLock

OnMostSystemLock
CAPL Function Overview » MOST » OnMostSystemLock

Syntax MOST150: OnMostSystemLock(long oldstate, long newstate)

Function This event procedure is called each time the state of the System-Lock flag changes.

Within this event procedure the functions MostEventChannel, MostEventTime and


MostEventOrigTime can be used to call up supplemental information.

Parameters oldstate

Old state of the System Lock Flag.

newstate

New state of the System Lock Flag.

Return values 1: System Lock Flag set.

0: System Lock Flag not set.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 MOST150 • •

Example

| MostSetSystemLockFlagUsage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostTimingMode(long mode)

OnMostTimingMode(long mode)
CAPL Function Overview » MOST » OnMostTimingMode(long mode)

Syntax OnMostTimingMode(long mode)

Function The OnMostTimingMode() event procedure is called if the timing mode of the MOST
hardware has been changed.

Supplemental information can be called up within this procedure by the


MostEventChannel, MostEventTime and MostEventOrigTime functions.

Controller events are passed through CAPL nodes. Please use the Multibus filter or MOST
filter to filter these events in node chains.

Parameters mode

0 Timing Slave

1 Timing Master

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 MOST • •

Example

| MostSetTimingMode | MostGetTimingMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnMostTxLight

OnMostTxLight
CAPL Function Overview » MOST » OnMostTxLight

Note

Only available with VN2600/VN2610!

Syntax OnMostTxLight(long mode)

Function The event procedure is called as soon as the light status of the fibre optical transmitter
(FOT) is switched.

Info

The event procedure is only called if the light status has been switched by
the application (see also MostSetTxLight).

Parameters mode

Light status of the FOT:

0 FOT disabled: Tx light off

1 FOT enabled: TimingMaster: Modulated light on

TimingSlave/Bypass: Tx light = Rx light

2 FOT enabled: Constant light on

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Selectors

Selectors
CAPL Function Overview » MOST » Selectors

mostMessage and mostAMSmessage Selectors

Keyword Description Range/Valid Access


values limitations

ACK Acknowledgement information 0...0xFF read only

Arbitration Bus arbitration bytes 0...0xFFFFFFFF read only,


Spy

DA Destination address 0...0xFFFF

DIR Direction of transmission Tx, Rx,


TxRequest

FBlockID Function block identifier 0...0xFF

FunctionID Function identifier 0...0xFFF

ID Message ID (CANdb lookup key) 0...0xFFFFFF obsolete!


(see Database Support)

InstanceID Instance identifier 0...0xFF

Most_InstanceID

SA Source address 0...0xFFFF

OpType Operation type 0...0xF

PIndex PIndex is a node-based counter (1 byte) which 0..0xFF read only,


increments per message sent. All low-level retries of Spy
a message have the same PIndex.

MsgChannel Transmission channel 1...16

MsgOrigTime Unsynchronized hardware time stamp read only


(unit: 10 µs)

Most_IsSpy Message was received by: 0, 1 read only


1: Spy
0: Node

Most_RType Message types: 0...0x5

When receiving always Normal, other message types


are received with mostRawMessage.

When applying a mostMessage variable the type can


be set to Normal, RemRead, RemWrite, Alloc, Dealloc
or GetSource.

Most_State Status information 0...0xFF read only

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Selectors

Most_TelID TelID 0...0xF

Time Synchronized time read only


(unit: 10 µs)

These selectors are only valid for mostAMSMessage

Keyword Description Range/Valid values Access limitations

BYTE(idx) Provides access to the data 0 <= idx <= 65534


bytes of the complex MOST message.
0..0xFF
(BYTE(0) is the first parameter byte)

DLC Data length code 0..65535


(Number of user data bytes for mostAMSMessages)

These selectors are only valid for mostMessage

Keyword Description Range/Valid Access


values limitations

Arbitration Bus arbitration bytes 0...0xFFFFFFFF read only, Spy

BYTE(idx) Provides access to the data 0 ≤ idx ≤ 11


bytes of the MOST frame.
0...0xFF
(BYTE(0) is the first byte behind the TelLen)

CAck Returns the CRC acknowledge code 0...0xFF read only, Spy,
MOST150 only

0x00: No
Response
0x01: CRC error
0x04: OK

DLC Data length code (TelLen) 0...45

Most_TelID TelID 0...0xF

MsgCRC CRC code 0...0xFFFF read only, Spy

Most_RType Message types: 0...0x5 MOST25 only

When receiving always Normal, other message types


are received with mostRawMessage.

When applying a mostMessage variable the type can be


set to Normal, RemRead, RemWrite,Alloc, Dealloc or
GetSource.

PAck Returns the preemptive acknowledge code 0...0xFF read only, Spy,
MOST150 only

0x00: No
Response

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Selectors

0x01: Buffer full


0x04: OK

PIndex PIndex is a node-based counter (1 byte) which 0..0xFF read only, Spy,
increments per message sent. All low-level retries of a MOST150 only
message have the same PIndex.

Example

Press <Ctrl>+<W> or select Signal insertion from MOST function catalog... from the shortcut
menu to open a selection dialog listing all messages and their parameters from the function
catalog for selection.

This includes all non-nested parameters in the user data with constant width and constant
position.

In this context, the parameter name is inserted into the program text as a selector.

mostRawMessage Selectors

Keyword Description Range/Valid values Access


limitations

ACK Acknowledgement information 0...0xFF read only, Spy

Arbitration Bus arbitration bytes 0...0xFFFFFFFF read only, Spy

BYTE(idx) Provides the access to the data 0...0xFF


bytes of the MOST frame.
0 ≤ idx ≤ 16

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Selectors

DA Destination address 0...0xFFFF

DIR Direction of transmission Tx, Rx, TxRequest

MsgChannel Transmission channel 1...16

MsgCRC CRC code 0...0xFFFF read only, Spy

MsgOrigTime Unsynchronized hardware time stamp (unit: read only


10µs)

Most_IsSpy Message was received by: 0, 1 read only


1: Spy
0: Node

Most_RType Message type 0...5


(Normal, RemRead, RemWrite,
Alloc, Dealloc, GetSource)

Most_State Status information 0...0xFF read only

SA Source address 0...0xFFFF

Time Synchronized time read only


(unit: 10µs)

Byte contents of mostRawMessages (see data sheet of MOST transceiver OS8104):

Byte RemoteRead RemoteWrite Alloc Dealloc GetSource


RType=1 RType=2 RType=3 RType=4 RType=5

0 rsvd rsvd rsvd rsvd rsvd

1 MAP MAP Request CL CL

2 rsvd LENGTH rsvd rsvd rsvd

3 D0 D0 Answer1 Answer1 rsvd

4 D1 D1 Answer2 0x0 rsvd

5 D2 D2 P0 rsvd rsvd

6 D3 D3 P1 rsvd NPR

7 D4 D4 P2 rsvd rsvd

8 D5 D5 P3 rsvd GA

9 D6 D6 P4 rsvd NAH

10 D7 D7 P5 rsvd NAL

11 rsvd rsvd P6 rsvd rsvd

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Selectors

12 rsvd rsvd P7 rsvd rsvd

13 ... 16 rsvd rsvd rsvd rsvd rsvd

mostLightLockError Selectors

Keyword Description Range/Valid values Access limitations

Most_Light Light state of controller 0, 1 read only, mostLightLockError

Most_Lock Lock state of controller 0, 1 read only, mostLightLockError

Most_Error 0: as long as lock exists 0, 1 read only, mostLightLockError


1: as soon as lock does not exists

Time Synchronized time read only


(unit: 10µs)

MsgOrigTime Unsynchronized hardware time stamp read only


(unit: 10µs)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Database Support in CAPL

MOST: Database Support in CAPL


CAPL Function Overview » MOST » Database Support in CAPL

Symbols from MOST function catalogs can be used in CAPL. The most common applications are outlined on
this page.

• Initializing a MOST message variable and Sending

mostAmsMessage AudioDiskPlayer.TrackPosition.Get msg;


output(msg);

• Declaration of event procedures (see on mostMessage or on mostAmsMessage)

on mostAmsMessage AudioDiskPlayer.TrackPosition.Status
{
...
}

• Populating simple message parameters with data. This includes all non-nested parameters in the user
data with constant width and constant position.

mostAmsMessage AudioDiskPlayer.TrackPosition.Status msg;


msg.Track = 5;

• Populating complex message parameters with data (parameters with variable length/position, all
nested parameters):

mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg;


mostParamSetString(msg, “Data.Record[].MediaTitle", idx, “Rolling Stones”);
mostParamSet(msg, “Data.Record[].LastTrack", idx, 10);

Since the message data is dynamic, the parameter address ("Data.Record[].MediaTitle") cannot be
checked until runtime.

• Symbols from enumeration types can be indicated with the addition of message names and parameter
names.

mostAmsMessage AudioDiskPlayer.Random.Status msg;


msg.RandomState = AudioDiskPlayer.Random.Status.RandomState::Off;

• Functions of test feature sets for MOST

if(1 == TestWaitForMostAMSMessage("AudioDiskPlayer.TrackPosition.Status(5)", 1, 200))


TestStepPass(“1”, “TrackPosition=5 reported”);

• Complete data population of messages (mostMsgSet, mostAmsOutput)

mostMsgSet(msg, "AudioDiskPlayer.SourceActivity.StartResult(1,On)", 1);


or
mostAmsOutput(1, "AudioDiskPlayer.SourceActivity.StartResult(1,On)", 1);

| General Tips on XML Function Catalog Support in CAPL | Input Assistant | MOST: Symbolic Identification of Messages | MOST:
Symbolic Identification of Parameters | Selectors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Error Codes of CAPL Functions

MOST: Error Codes of CAPL Functions


CAPL Function Overview » MOST » Error Codes of CAPL Functions

kMostOK = 0 No Error occurred.

kMostInvalidChannel = -1 The operation was requested for an invalid channel number.

kMostNoConnection = -2 The driver was unable to establish a connection to the MOST


interface hardware.
Check the connection settings in the Harware Configuration dialog
under the menu item Configuration|Hardware Configuration.

kMostIllegalTime = -3 The function was called in the wrong phase of the measurement.
For example the Optolyzer mode can only be changed in the
‘prestart’ function.

kMostWrongThread = -4 For technical reasons this function may not be called from this area
of CANoe.
Not all functions can be called from CAPL nodes in the analyzing
setup.

kMostWrongHWMode = -5 The hardware interface to the MOST bus is in a state in which the
called function is unavailable.

kMostTxQueueFull = -6 The transmit queue of 256 Messages is full, while trying to send
another message.

kMostHWBusy = -7 Unable to perform the desired action due to hardware overload.

kMostWrongHWType = -8 This functionality is not supported by the hardware used.

kMostParameterOutOfRange = -9 One or more function parameters lie outside of their valid value
ranges.

kMostDriverCallFailed = -10 The MOST hardware driver returned an error. Please make sure
that the driver has been properly installed and that the hardware is
operationally ready.

kMostAsInvalidChannel = -21 The function was called for an invalid channel.

kMostAsDoubleOp = -22 The function cannot be executed, because its results already apply.
(e.g. a CAPL node has already been registered in the Local
FBlockList)

kMostAsIllegalTime = -23 The function cannot be executed in this phase of the simulation
cycle.

kMostAsParamNotAvailable = -24 The requested parameter value is unavailable.

kMostAsNotAvailable = -25 The function is unavailable or the MOST Application Socket is


inactive.

kMostAsBeforeNetOn = -26 This function can not be called before NetOn.

kMostAsInvalidParameter = -29 At least one parameter passed with the function lies outside of its

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Error Codes of CAPL Functions

valid value range.

kMostXML4CAPLGeneralExecError = - General execution error.


30

kMostXML4CAPLUnknownMsg = -31 The specified message cannot be dissolved with the available
function catalogs.

kMostXML4CAPLMsgSizeExceeded = - The function cannot be executed, since the size of the specified
32 message is exceeded.

kMostXML4CAPLUnknownParamAdr = The specified parameter address cannot be dissolved with the


-33 available function catalogs.

kMostXML4CAPLParamNotFoundInMsg A parameter with the indicated address cannot be found in the


= -34 message.

kMostXML4CAPLParamTypeMismatch The function has attempted to read a value that does not have the
= -35 compatible data type.

kMostXML4CAPLEncodingMismatch = The function cannot read the string or raw data, since the coding
-36 does not match.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: General Tips on XML Function Catalog Support in CAPL

MOST: General Tips on XML Function Catalog Support in CAPL


CAPL Function Overview » MOST » General Tips on XML Function Catalog Support in CAPL

Tips for using XML-based CAPL functions for the symbolic description of messages and parameters:

There are two different access formats when using XML function catalogs in CAPL:

Compile time

Examples
mostAmsMessage AudioDiskPlayer.TrackPosition.Status msg;

msg.Track = 3;

• The symbols are checked and resolved during compilation.


• Compile time access is very efficient.

Runtime

Examples
mostAmsOutput(1, "AudioDiskPlayer.SourceActivity.StartResult(1,On)", 1);

testWaitForMostAMSMessage("AudioDiskPlayer.TrackPosition.Status(5)", 1, 200);

mostParamSet(msg, "Data.Record[].LastTrack", idx, 10);

• Since the symbols are interpreted during runtime, this access format is less efficient.
• Faulty symbols cause the measurement process to be aborted.
• Runtime access is the only possible access format for parameters with variable length/position (e.g.,
strings) and nested parameters (e.g., elements of an array or record).
• For runtime access, symbols have to be enclosed in quotation marks.

| Symbolic Identification of Messages | Symbolic Identification of Parameters | Input Assistance | MOST Database Support in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: High Observer and Combiner

MOST: High Observer and Combiner


CAPL Function Overview » MOST » High Observer and Combiner

The MOST High Observer observes all messages belonging to the MOST High Protocol (MHP) and uses the
Combiner to combine them. The CAPL event procedures described here allow the reaction to events of the
observer.

• To analyze of data
• To filter the events
• To save the reference data in files

Event procedures:

• OnMostMHPBlock
• OnMostMHPPacket
• OnMostMHPError
• OnMostMHPConnection

Info

These event procedures and their functions are only available for CAPL programs in the
measurement setup.

For simulation of a MOST High connection sender and receiver in CAPL the MOST High DLL can be
used. The DLL is located in the Exec32 folder of the MOST High Demos.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: High Observer Error Codes

MOST: High Observer Error Codes


CAPL Function Overview » MOST » High Observer Error Codes

Errors

Error Meaning Erroneous value Expected value


code

0 Data Frame has unexpected FrameID. yes yes

1 0-Frame has an unexpected Block Nr. yes yes

2 Data Frames without prior 0-Frame. no no

3 FrameID of Ack/Nack Frame does not match FrameID of yes yes


the last Data Frame.

4 Block Nr of Ack/Nack Frame does not match Nr of the yes yes


block.

5 Frame Acknowledge in Block Acknowledge Mode. no no

6 (Multiple) Frame or Block Request not allowed. no no

7 MHP message without existing connection. no no

8 Observer Timeout, observing of connection stopped. no no

9 Invalid MHP message. no no

10 Too many REQUEST CONNECTION retries (R_Request). yes yes

11 Timeout violation between REQUEST CONNECTION yes (ms) yes (ms)


attempts (T_Send).

12 Too many START CONNECTION retries (R_Start). yes yes

13 Timeout violation between START CONNECTION yes (ms) yes (ms)


attempts (T_Ready).

14 Illegal value of Options field in 0-Frame. yes no

15 Timeout of 0-Frame retry (T_Frame). yes (ms) yes (ms)

16 Timeout violation sending NegAck on missing 0-Frame yes (ms) yes (ms)
(T_Frame).

17 Too many NegAck retries on missing 0-Frame yes yes


(R_NegAck).

18 Too many retransmission attempts (R_Trans). yes yes

19 Timeout violation between retransmission attempts yes (ms) yes (ms)


(T_Retrans).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: High Observer Error Codes

20 Timeout transmitting one block (T_Trans). yes (ms) yes (ms)

21 Timeout violation between Data Frames (T_AIR_Delay). yes (ms) yes (ms)

22 Too many END CONNECTION TX retries (R_End). yes yes

23 Timeout violation between END CONNECTION attempts yes (ms) yes (ms)
(T_End).

24 Timeout violation closing the connection (T_Delay_End). yes (ms) yes (ms)

25 Timeout violation between HOLD CONNECTION messages yes (ms) yes (ms)
(T_Hold_Resend).

26 Timeout after last HOLD CONNECTION message yes (ms) yes (ms)
(T_Hold).

27 Timeout of HOLD CONNECTION cycle (T_Hold_Max_Buf). yes (ms) yes (ms)

28 Timeout violation sending NegAck (T_Receive). yes (ms) yes (ms)

29 Timeout violation between Data Frame and NegAck yes (ms) yes (ms)
(T_dwn_NegAck).

30 Illegal value of NDF_Ack: Value must not exceed NDF. yes yes

31 Scale * NDF_Ack exceeds maximum block size. yes (block size) yes (block size)

32 Timeout violation between ADJUST TRANSMISSION RATE yes (ms) yes (ms)
(increase) messages (T_TxSpeedRecovery).

33 ADJUST TRANSMISSION RATE is only allowed for block no no


acknowledge mode using the asynchronous channel.

34 Total number of frames changed. yes yes

35 MHP message not expected. no no

40 Usage of control channel not allowed with MHP 2.3 or no no


newer
41 Field MaxBlkSize not allowed in MHP version < 2.3 no no
42 Illegal value of MaxBlkSize: Value must be between yes yes (Scale << 16
+ NDF_ACK)
Scale * NDF_ACK and (Scale+1) * NDF_ACK

43 Frame Interleave not allowed for connections with no no


different priorities
44 Frame Interleave not allowed for multiple connections no no
to one device
45 Field HoldFlag not allowed in MHP version < 2.3 or no no
Negative Acknowledge Frames

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: High Observer Error Codes

Warnings

Error Meaning Erroneous value Expected value


code

36 Negative Acknowledge Frame observed. yes (block no.) no

37 (Multiple) Frame Request observed. no no

38 Block Request observed. no no

39 Receiver refused connection by sending PrioAck with yes yes


higher value than Prio.

| OnMostMHPError | MOST High Observer and Combiner |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Initialization of Message Variables

MOST: Initialization of Message Variables


CAPL Function Overview » MOST » Initialization of message variables

There are the following types of message variable for MOST:

Message variable Description

mostMessage Variables describe MOST frames which are compliant with the function catalog.

Example

With XML function catalog support:


mostMessage NetBlock.FBlockIDs.Get msg;

With CANdb database support :


mostMessage NetBlock_FBlockIDs_Get msg;

mostMessage * msg; // Initialization with wildcard -> The parameters


FBlockID..OpType have to be set explicitly (msg.FBlockID, msg.InstanceID,
msg.FunctionID, msg.OpType)

mostMessage 0x010001 msg; // Initialization with FBlockID..OpType (see


also Message-ID)

mostRawMessage Variables describe MOST frames which do not fit into the function catalog structure
(e.g., RemRead, RemWrite, Alloc, Dealloc, GetSource).

mostAMSMessage Variables describe Application Message Service (AMS) messages. These messages
comply with the function catalog format and - like mostMessage variables - they can
be identified by an ID.

Example

With XML function catalog support:


mostAMSMessage NetBlock.FBlockIDs.Get msg;

With CANdb database support :

mostAMSMessage NetBlock_FBlockIDs_Get msg;

mostAMSMessage * msg; // Initialization with wildcard -> The parameters


FBlockID..OpType have to be set explicitly (msg.FBlockID, msg.InstanceID,
msg.FunctionID, msg.OpType)

mostAMSMessage 0x010001 msg; // Initialization with FBlockID..OpType


(see also Message-ID)

The default size of mostAMSMessage variables is 200 bytes. To define messages with
larger useful data ranges the desired size must be specified explicitly:
mostAMSMessage * msg = { DLC = 1000 };

Before sending the message with output(msg) the DLC and thereby also the TelLen can
be updated according to the length actually set.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Initialization of Message Variables

Example

Press <Ctrl>+<M> or select Message entry with MOST function catalog from the shortcut menu
to open an input assistant which displays a data entry field in the current program line listing a
selection of all MOST messages described in the function catalog. The selection takes in all
function catalogs assigned to the CAPL node.

In this context, the input assistant enables the description of messages up to OpType and adds
the resulting description to the program text without quotation marks in the notation separated
by period marks.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Input Assistance

MOST: Input Assistance


CAPL Function Overview » MOST » Input Assistance

Using the MOST input assistance you can enter symbolic messages in the CAPL Browser.

Info

XML function catalogs must be inserted in the simulation setup to use the MOST input
assistance.

The Input assistance can be opened with the Message input with MOST function catalog... shortcut menu
item or by the key combination <Ctrl>+<M>.

You can enter FBlockID, FunctionID and OpType of a MOST message in the opened input assistance window
using a selection list. This list contains the current available information from the XML catalogs.

It is also possible to enter the parameters of a MOST message.


If you enter a left parenthesis, you can - depending on parameter type - manually enter values or select
valid parameter values via a selection list. Note, that parameters cannot be set in message and event
procedure declarations.

You can enter the single parts of a function address in numeric or symbolic notation. Depending on the
first entered sign the list view changes:

• When entering characters the list shows the symbol names followed by the hexadecimal IDs in
brackets.
• When entering "0" it is assumed that you want to enter a hexadecimal value. The list shows the
hexadecimal IDs followed by the symbolic names in brackets.
• When entering a digit between 1 and 9 it is assumed that you want to enter the ID in decimal format.
The list shows the decimal IDs followed by the symbolic names in brackets.

Function description Key combination

Marks an entry of the selection list < ↑>, <↓>, <Page ↑>, < Page

Handing over the marked entry. <Tab>, <Return>

Handing over FBlockID and FunctionID. <.>

Handing over OpType, start of parameter entry. <(>

Handing over the current parameter value. <,>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Input Assistance

Function description Key combination

Finishing parameter entry, handing over the <)>


entry and closing the dialog.

Closing the selection list. <Esc>

Closing the dialog without handing over the entry <Esc>


(with closed selection list)

Closing the dialog and handing over the entry <Return>


(with closed selection list).

Switching between input format with or without <F2>


Instance ID.

Jumping back or forward within the input filed. <Ctrl> + < →>, <Ctrl> + <←>

Info

The MOST input assistance is also available as an add-in for Visual Studio 2003 .NET and Visual
Studio 2005. The installation program MOST_Function_Catalogue_Setup.msi is located in the
folder Exec32\util_most.

| General Tips on XML Function Catalog Support in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Symbolic Identification of Messages

MOST: Symbolic Identification of Messages


CAPL Function Overview » MOST » Symbolic Identification of Messages

For selected CAPL functions, e.g., mostAmsOutput, MOST messages can be described with the name used
in the XML function catalog.

The symbolic definition of the message essentially follows the syntax that is used in the MOST
specification. All variants are derived from the following basic form:

FBlock.Instance.Function.OpType(Parameter,Parameter,Parameter)

Example
AudioAmplifier.1.Mute.Status(MuteOn)

Essentially it is possible to set raw data for the user data. Accordingly, the parameter bytes have to be set
as hexadecimal values in curly brackets. This facilitates, for example, the sending of messages which do
not comply with the definition in the function catalog.

Example
Diagnosis.1.KeywordRec.Set({AABB11223344})

or pure numerical:
0x06.1.0x050.0x0({AABB11223344})

Example

Press <Ctrl>+<M> or select Message input with MOST function catalog... from the shortcut
menu to open an input assistant which displays a data entry field in the current program line
listing a selection of all MOST messages described in the function catalog. The selection takes in
all function catalogs assigned to the CAPL node.

In this context, the input assistant permits the description of messages up to OpType and adds
the resulting description to the program text without quotation marks in the notation separated
by period marks.

| MostAMSOutput | MostMsgSet | Symbolic Identification of Parameters |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Symbolic Identification of Parameters

MOST: Symbolic Identification of Parameters


CAPL Function Overview » MOST » Symbolic Identification of Parameters

For selected CAPL functions, e.g., mostParamGet, MOST messages can be described with the name used in
the XML function catalog.

The current content of the message to which the CAPL function, e.g., mostParamSet, refers determines
which definition in the function catalog the parameter description is compared with.

With simple parameters, the parameter name is sufficient for identification. With structured parameter
types, the path to the elementary parameter must be specified.

Taking the AudioDiskPlayer(0x31) function block as an example, the parameter descriptions for a number
of parameter types can be explained.

Parameter type: Number


Property: DeckStatus (0x200)

Parameter name: DeckStatus

Parameter type: Record


Property: TimePosition (0x201)

Parameter name: Data.TrackTime

Info

The POS parameter that belongs to the record must be set so that the TrackTime parameter is
part of the message. If this is the case, the parameter value is written to the correct place in
the message, regardless of whether the entire record is a part of the message or only the record
field: TrackTime.

Parameter type: Array of Record


Property: MediaInfo (0x413)

Parameter name: Data.Record[2].MediaType

The index of the array element is specified in square brackets and attached to the name of the array
element. The associated POS parameter must be set so that the array element is part of the message. The
parameter is MediaType irrespective of whether the entire array or only an element is part of the
message.

As an alternative, the functions for accessing parameters permit the specification of the parameter index
as an additional parameter inside the brackets of the parameter address instead (see the <arrayIndex>
parameter in MostParamSet). This index declaration overwrites the indexing in the brackets of the
parameter address.

Example
mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg
MostParamSet(msg, "Data", 2); // sets the array size to 2
MostParamSet(msg, "Data.Record[].MediaType", 2, 1); // sets the parameter
'MediaType' in the second array element to 1

Parameter type: Array


Property: MediaInfo (0x413)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Symbolic Identification of Parameters

Parameter name: Data

The size (number of elements) of arrays can be set or read with MostParamSet() and MostParamGet().

Example
mostAmsMessage AudioDiskPlayer.MediaInfo.Status msg
MostParamSet(msg, "Data", 3);

The "Data" parameter now contains 3 elements (here: 3 records).

Parameter type: Sequence


Property: FBlockIDs (0x000) from function block NetBlock

Parameter name: FBlockIDList

The size (number of elements) of a sequence can also be set or read with MostParamSet() and
MostParamGet().

Example
mostAmsMessage NetBlock.FBlockIDs.Status msg
MostParamSet(msg, "FBlockIDList", 3);

The "FBlockIDList" parameter now contains 3 elements (here: 3 entries with {FBlockID, InstID}).

The parameters can be set as follows:


MostParamSet(msg, "FBlockIDList.FBlockID[]", 1, 0x02);
MostParamSet(msg, "FBlockIDList.InstID[]", 1, 0x00);
MostParamSet(msg, "FBlockIDList.FBlockID[]", 2, 0x04);
MostParamSet(msg, "FBlockIDList.InstID[]", 2, 0x01);

Example

Press <Ctrl>+<W> or select Signal insertion from MOST function catalog... from the shortcut
menu to open a selection dialog listing all messages and their parameters from the function
catalog for selection.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MOST: Symbolic Identification of Parameters

In this context the parameter identification is inserted into the program text as a string
enclosed inside quotation marks.

| Symbolic Identification of Messages | Test Feature Set: Symbolic Definition of MOST Messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

FlexRay CAPL Functions


(Only available with Option .FlexRay!)
CAPL Function Overview » FlexRay CAPL Functions

In Option .FlexRay several APIs are provided for receiving and transmitting FlexRay frames:

Objects Short description

FRFrame Creates a FlexRay frame object.

FRConfiguration Create a FlexRay parameter object.

FrPDU Creates a FlexRay PDU object.

Functions Short description

FRGetConfiguration Copies the FlexRay protocol parameters to


a FlexRay parameter object.

FRGetFrameCRC Returns the CRC of a received FlexRay


frame.

FROutputDynFrame Updates the FlexRay Communication


Controller’s (CC) send buffer with the
current data from the send object.

FRSendFrame Generates a FlexRay message and sends it


to the hardware.

FRSendSymbol Sends an MTS symbol in the next possible


symbol window if the Communication
Controller is in normal mode
(synchronized).

FRSetAutoIncrement Part of the payload of a frame will be


incremented automatically on each
transmission.

FRSetConfiguration Writes the FlexRay protocol parameters


from the FlexRay parameter object to the
FlexRay interface’s Communication
Controller.

FRSetKeySlot This function configures one of two


possible key slots that are to be sent for a
FlexRay bus.

FRSetMode Initializes the FlexRay bus transceivers.

FRSetPayloadLengthInByte Sets the payload (data) length of the


object in bytes.

FRSetPOCState Puts the FlexRay Communication


Controller into the desired Protocol
Operation Mode.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

FRSetSendFrame Configures the hardware for sending the


specified message.

FRSetSendGroup All frames in the group are sent in the


current cycle, or all frames are not sent
until the next possible cycle.

FRSetSendPDU Configures the hardware to transmit the


specified PDU.

FRSetTrigger Activates the Trigger Output of the


selected VN interface.

FRUpdatePDU Updates the PDU payload in the assigned


FlexRay frames.

FRUpdateStatFrame Updates the FlexRay Communication


Controller’s (CC) send buffer with the
current data from the send object.

MessageTimeNS Returns the receive time of the frame or


slot in nanoseconds.

output Outputs the object from the program


block of the analysis branch.

ResetFlexRayCC Initializes the FlexRay Communication


Controller (CC) and begins a new startup
phase for the cluster or a new integrations
phase in the cluster.

ResetFlexRayCCEx Initializes the FlexRay Communication


Controller (CC) and generates the
specified wakeup pattern before
reintegration in the cluster or the startup.

Event procedures Short description

on FRError Is called in the event of a general error


being detected on the FlexRay bus.

on FRFrame Is called up after a frame has been


received in the specified slot and cycle.
It is recommended to use on FRFrame only for the reception
of valid data frames.

To receive Null frames and erroneous frames, please use the


on FRNullFrame or on FRFrameError event procedures, since
these events will not be received anymore with on FRFrame
from version 6.1.

on FRFrameError Is called if a erroneous frame is received


in the specified slot and cycle.

on FRNullFrame Is called if a Null frame is received in the


specified slot and cycle.

on FrPDU Is called when a PDU with the

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

corresponding name is received.

on FRPOCState Is called whenever there is a change of


state on the FlexRay Communication
Controller's protocol operation state
machine.

on FRSlot Is called up in each cycle after the Slot is


past.

on FRStartCycle Can be generated by FlexRay at the


beginning of each communication cycle
and contains the NM vector valid for this
cycle.

on FRSymbol Is called whenever a symbol (wakeup,


CAS, MTS) is received.

Callbacks Short description

FlexRayRcvStatusEvent The callback occurs when the FlexRay


Communication Controller (CC) has
synchronized with the bus or the
synchronization fails.

Test Feature Set for FlexRay Short description

Waiting for valid FlexRay frames

TestWaitForFrFrame Waits for the occurrence of the valid


specified FlexRay frame.

TestGetWaitFrFrameData If a valid FlexRay frame is the last event


that triggers a wait instruction, the
frame’s content can be called up.

TestJoinFrFrameEvent Completes the current set of "joined


events" with the FlexRay frame.

Waiting for FlexRay Null frame

TestWaitForFrNullFrame Waits for the occurrence of the specified


FlexRay Null frame.

TestGetWaitFrNullFrameData If a FlexRay Null-Frame is the last event


that triggers a wait instruction, the
frame’s content can be called up.

TestJoinFrNullFrameEvent Completes the current set of "joined


events" with the FlexRay null frame.

Waiting for FlexRay start cycle event

TestWaitForFrStartCycle Waits for the occurrence of the specified


FlexRay start cycle event.

TestGetWaitFrStartCycleData If a FlexRay start cycle is the last event


that triggers a wait instruction, the

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

event’s content can be called up.

TestJoinFrStartCycleEvent Completes the current set of "joined


events" with the FlexRay start cycle
event.

Waiting for FlexRay PDU

TestWaitForFrPDU Waits for the occurrence of the specified


FlexRay PDU event.

TestGetWaitFrPDUData If a valid FlexRay PDU is the last event


that triggers a wait instruction, the PDU’s
content can be called up.

TestJoinFrPDUEvent Completes the current set of "joined


events" with the FlexRay PDU.

Waiting for FlexRay POC state event

TestWaitForFrPOCState Waits for the occurrence of change of


state on the FlexRay Communication
Controller's protocol operation state
machine.

TestGetWaitFrPOCStateData If an event indicating a change of state on


the FlexRay Communication Controller's
protocol operation state machine is the
last event that triggers a wait instruction,
the event’s content can be called up.

TestJoinFrPOCState Completes the current set of "joined


events" with the change of state event on
the FlexRay Communication Controller's
protocol operation state machine.

Waiting for FlexRay erroneous frame

TestWaitForFrFrameError Waits for the occurrence of FlexRay


erroneous frame event (frame error).

TestGetWaitFrFrameErrorData If a FlexRay erroneous frame is the last


event that triggers a wait instruction, the
event’s content can be called up.

TestJoinFrFrameErrorEvent Completes the current set of "joined


events" with the FlexRay erroneous frame
event.

Waiting for FlexRay symbol event

TestWaitForFrSymbol Waits for the occurrence of a FlexRay


symbol on the bus.

TestGetWaitFrSymbolData If a FlexRay symbol event is the last event


that triggers a wait instruction, the
event’s content can be called up.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

TestJoinFrSymbolEvent Completes the current set of "joined


events" with the FlexRay symbol event.

Test Service Library for FlexRay Short description

DLC monitoring

TestCheck::CreateInconsistentDLC, The check condition is violated if the


TestCheck::StartInconsistentDLC payload length of the message does not
agree with the specified payload length of
the database (useful for dynamic frames).

Cycle time

TestCheck::CreateMsgAbsCycleTimeViolation, Checks the occurrences of cyclic


TestCheck::StartMsgAbsCycleTimeViolation messages.

TestCheck::CreateMsgRelCycleTimeViolation, Checks the occurrences of cyclic


TestCheck::StartMsgRelCycleTimeViolation messages.

Occurrence of a message

TestCheck::CreateMsgRelOccurrenceViolation, Checks are used to monitor the sending


TestCheck::StartMsgRelOccurrenceViolation delay of messages which allow both cyclic
and spontaneous transmission.
TestCheck::CreateNodeMsgsRelOccurrenceViolation,
TestCheck::StartNodeMsgsRelOccurrenceViolation

Message distance

TestCheck::CreateMsgDistViolation, This check is useful for spontaneous


TestCheck::StartMsgDistViolation messages where one message is a result of
another message; e.g. the check is used
to check the processing time of the
reference message.

Absence of defined messages

TestCheck::CreateMsgOccurrenceCount, Checks the absence of the specified


TestCheck::StartMsgOccurrenceCount message on the bus.

Absence of a FlexRay Erroneous Frame

TestCheck::CreateFlexRayFrameErrorOccurrenceCount, Checks the absence of erroneous frames


TestCheck::StartFlexRayFrameErrorOccurrenceCount, for the specified frame/slot on the bus.
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount,
TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount

Absence of a FlexRay Null Frame

TestCheck::CreateFlexRayNullFrameOccurrenceCount, Checks the absence of Null frames for the


TestCheck::StartFlexRayNullFrameOccurrenceCount, specified frame/slot on the bus.
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount,
TestCheck::StartNodeFlexRayNullFramesOccurrenceCount

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay CAPL Functions
(Only available with Option .FlexRay!)

Message Count Observation

TestCheck::CreateMsgSendCountViolation, Check is used to monitor the minimum


TestCheck::StartMsgSendCountViolation, and/or maximum number for each of the
TestCheck::CreateNodeMsgSendCountViolation, defined messages within a specified cyclic
TestCheck::StartNodeMsgSendCountViolation time interval.

Node active

TestCheck::CreateAllNodesDead, This check reports a problem, if the node


TestCheck::StartAllNodesDead has not send any of its Tx messages within
a given time-interval.
TestCheck::CreateNodeDead, TestCheck::StartNodeDead

Node inactive

TestCheck::CreateAllNodesBabbling, This check allows the observation of the


TestCheck::StartAllNodesBabbling end of the activity of nodes.

TestCheck::CreateNodeBabbling,
TestCheck::StartNodeBabbling

Signal value

TestCheck::CreateMsgSignalValueInvalid, This check is useful to supervise the value


TestCheck::StartMsgSignalValueInvalid of signals.

TestCheck::CreateMsgSignalValueRangeViolation,
TestCheck::StartMsgSignalValueRangeViolation

Signal value constancy

TestCheck::CreateSignalValueChange, The check is useful to observe the


TestCheck::StartSignalValueChange constancy of a signal value.

Timeout

TestCheck::CreateTimeout, TestCheck::StartTimeout This check creates an error event if


particular time is expired.

Unknown message received

TestCheck::CreateUndefinedMessageReceived, This check listens to the bus and reports a


TestCheck::StartUndefinedMessageReceived violation, if a message was received that
is not defined in any of the databases that
are associated to the current bus.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

FRConfiguration
CAPL Function Overview » FlexRay » FRConfiguration

Syntax FRConfiguration <configuration var>;

Function Can be used to create a FlexRay parameter object. The data content of this object is all
protocol parameters relevant to FlexRay in the context of initializing a FlexRay
Communication Controller. The object data can be manipulated or read out by selectors
associated with this object.

Initially, all protocol parameters are set to a value of 0.

The FRGetConfiguration or FRSetConfiguration functions are used to read or set parameters


from or in the FlexRay interface’s Communication Controller.

Parameters <configuration var>

Character string defining the object’s variable name.

Selectors FRBaudrate

Baud rate in kBit/s.

gdMacrotick

FlexRay protocol parameter. See FlexRay specification.

Data type: double

gMacroPerCycle

FlexRay protocol parameter. See FlexRay specification.

gdNIT

FlexRay protocol parameter. See FlexRay specification.

gdSampleClockPeriod

FlexRay protocol parameter. See FlexRay specification.

Data type: double

gdTSSTransmitter

FlexRay protocol parameter. See FlexRay specification.

gPayloadLengthStatic

FlexRay protocol parameter. See FlexRay specification.

gdActionPointOffset

FlexRay protocol parameter. See FlexRay specification.

gdStaticSlot

FlexRay protocol parameter. See FlexRay specification.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

gNumberOfStaticSlots

FlexRay protocol parameter. See FlexRay specification.

gdMinislotActionPointOffset

FlexRay protocol parameter. See FlexRay specification.

gdMinislot

FlexRay protocol parameter. See FlexRay specification.

gNumberOfMinislots

FlexRay protocol parameter. See FlexRay specification.

gClusterDriftDamping

FlexRay protocol parameter. See FlexRay specification.

gListenNoise

FlexRay protocol parameter. See FlexRay specification.

gColdstartAttempts

FlexRay protocol parameter. See FlexRay specification.

gSyncNodeMay

FlexRay protocol parameter. See FlexRay specification.

gOffsetCorrectionStart

FlexRay protocol parameter. See FlexRay specification.

gdDynamicSlotIdlePhase

FlexRay protocol parameter. See FlexRay specification.

gdSymbolWindow

FlexRay protocol parameter. See FlexRay specification.

gdCASRxLowMax

FlexRay protocol parameter. See FlexRay specification.

gdCASRxLowMax

FlexRay protocol parameter. See FlexRay specification.

gdWakeupSymbolRxIdle

FlexRay protocol parameter. See FlexRay specification.

gdWakeupSymbolRxLow

FlexRay protocol parameter. See FlexRay specification.

gdWakeupSymbolRxWindow

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

FlexRay protocol parameter. See FlexRay specification.

gdWakeupSymbolTxIdle

FlexRay protocol parameter. See FlexRay specification.

gdWakeupSymbolTxLow

FlexRay protocol parameter. See FlexRay specification.

gMaxWithoutClockCorrectionFatal

FlexRay protocol parameter. See FlexRay specification.

gMaxWithoutClockCorrectionPassive

FlexRay protocol parameter. See FlexRay specification.

gNetworkManagementVectorLength

FlexRay protocol parameter. See FlexRay specification.

pChannels

FlexRay protocol parameter. See FlexRay specification.

pMicroPerCycle

FlexRay protocol parameter. See FlexRay specification.

pSamplesPerMicrotick

FlexRay protocol parameter. See FlexRay specification.

pPayloadLengthDynMax

FlexRay protocol parameter. See FlexRay specification.

pPayloadLengthFIFO

Size of the maximum data length that can be received via the FIFO buffer in 16-bit words.

pLatestTx

FlexRay protocol parameter. See FlexRay specification.

pdMaxDrift

FlexRay protocol parameter. See FlexRay specification.

pdAcceptedStartupRange

FlexRay protocol parameter. See FlexRay specification.

pClusterDriftDamping

FlexRay protocol parameter. See FlexRay specification.

pDecodingCorrection

FlexRay protocol parameter. See FlexRay specification.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

pDelayCompensation_A

FlexRay protocol parameter. See FlexRay specification.

pDelayCompensation_B

FlexRay protocol parameter. See FlexRay specification.

pOffsetCorrectionOut

FlexRay protocol parameter. See FlexRay specification.

pRateCorrectionOut

FlexRay protocol parameter. See FlexRay specification.

pExternOffsetCorrection

FlexRay protocol parameter. See FlexRay specification.

pExternRateCorrection

FlexRay protocol parameter. See FlexRay specification.

pExternCorrectionMode

Defines the addition mode for the external rate and offset correction values:

Value Meaning

Offset Rate

0 Disable Disable

1 Disable Disable

2 Disable —

3 Disable •

4 Disable Disable

5 Disable Disable

6 Disable —

7 Disable •

8 — Disable

9 — Disable

10 — —

11 — •

12 • Disable

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

13 • Disable

14 • —

15 • •

Possible values are: 0, 5, 10, 11, 14 and 15.

pMacroInitialOffset_A

FlexRay protocol parameter. See FlexRay specification.

pMacroInitialOffset_B

FlexRay protocol parameter. See FlexRay specification.

pMicroInitialOffset_A

FlexRay protocol parameter. See FlexRay specification.

pMicroInitialOffset_B

FlexRay protocol parameter. See FlexRay specification.

pWakeupChannel

FlexRay protocol parameter. See FlexRay specification.

pWakeupPattern

FlexRay protocol parameter. See FlexRay specification.

pAllowHaltDueToClock

FlexRay protocol parameter. See FlexRay specification.

pAllowPassiveToActive

FlexRay protocol parameter. See FlexRay specification.

pBGTick

FlexRay protocol parameter. See FlexRay specification.

pPhysicalLayer

Defines the physical layer to be used:

Value Meaning

0 RS485_0

1 RS485_1

2 FlexRay Electrical

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRConfiguration

pSingleSlotEnabled

FlexRay protocol parameter. See FlexRay specification.

pBGEnable

FlexRay protocol parameter. See FlexRay specification.

pDynamicSegmentEnable

FlexRay protocol parameter. See FlexRay specification.

pChannelsMTS

FlexRay protocol parameter. See FlexRay specification.

pCCVersion

Indicates the selected FlexRay interface type:

Value Meaning

2 BusDoctor

3 FlexCard Cyclone

4 FlexCard Cyclone II

5 VN

Write protected!

pStrobePointPosition

E-Ray parameter. See E-Ray specification.

pdMicrotick

FlexRay protocol parameter. See FlexRay specification.

Data type: double

In function FRSetConfiguration this parameter is ignored!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 FlexRay • •

Example

For an example see functions FRGetConfiguration and FRSetConfiguration.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

FRFrame
CAPL Function Overview » FlexRay » FRFrame

Syntax FRFrame <frame name> <frame var>;

Uses a symbolic frame name from the database.

FRFrame MsgChannel<num>.<frame name> <frame var>;

Uses a symbolic frame name from the database and specifies the send channel/cluster.

FRFrame (<slot ID>, <base cycle>, <cycle repetition>) <frame var>;

Can be used to define the transmission time without database.

FRFrame MsgChannel<num>.(<slot ID>, <base cycle>, <cycle repetition>) <frame


var>;

Can be used to define the transmission time and channel/cluster without database.

Function Can be used to create a FlexRay send object. The object data can be manipulated by
selectors associated with this object. Other object characteristics can be read out from
selectors.

Objects are then registered using the FRSetSendFrame and are sent using the
FRUpdateStatFrame or FROutputDynFrame functions.

Parameters MsgChannel<num>

Defines the send channel/cluster.

<num> must be an integer (e.g. 1, 2, 3, etc.) defining the channel number of the
corresponding FlexRay interface.

<frame name>

Character string corresponding to a frame name from the database.

The required parameters (<slot ID>, <base cycle>, <cycle repetition> and <channel mask>)
are taken from the corresponding frame definition in the database.

<frame var>

Character string defining the object’s variable name.

<slot ID>

This number designates a specific slot.

Its value must be between 1 and 2047.

<base cycle>

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0 and
63.

This value, together with the repetition factor, determines the "Cycle Multiplexing".

<cycle repetition>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or 64).

This value, together with the base cycle, determines the "Cycle Multiplexing".

Selectors General use

MsgChannel

The application channel that the FlexRay interface determines, which should send the
frame.

FR_ChannelMask

Identifies the FlexRay channel of the CC. A value of 1 will send the frame to channel A, 2
will send it to channel B and 3 to channels A and B.

FR_SlotID

The frame has to be transmitted in this slot.

FR_CycleOffset

FlexRay cycle number of the base cycle.

This value must be less than FR_CycleRepetition.

FR_CycleRepetition

Repetition factor for transmission times in multiples of a FlexRay cycle.

This value must come from the value set {1, 2, 4, 8, 16, 32, 64}.

FR_PayloadLength

Length of the payload to be sent in 16 Bit words (data type: word).

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index), <signal name>

Direct access to the payload/data of the frame.


The number of valid data bytes is specified by the selector FR_PayloadLength.

The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

If the frame object was initialized via a symbolic name from the database, signal names can
also be used directly as selectors for the data range. The raw value of the signal is retrieved
or set. The physical value can be retrieved or set by <signal name>.Phys.

FR_Flags

Corresponding bits in the flags set or activate special statuses for the frame to be sent:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

Bit mask Meaning

0x01 Sets the sync bit in the header.

Only a frame in the static segment may have set this bit.

Caution

Bit is only evaluated in function FRSetSendFrame.

This flag is deprecated (for CANoe ≥ 7.2)! Use instead function


FRSetKeySlot.

0x02 Sets the startup bit in the header.

If this bit is set, then the sync bit must also be set.

Caution

Bit is only evaluated in function FRSetSendFrame.

This flag is deprecated (for CANoe ≥ 7.2)! Use instead function


FRSetKeySlot.

0x10 Sets the send mode to event-triggered.

If not set, the frame will be transmitted in time-triggered mode.

0x20 Sets the payload preamble bit.

With static frames, the initial data bytes then contain the local NM vector;
with dynamic frames, the first two bytes then designate the expanded message
ID.

0x80 TX OFF

The frame is no longer sent, the corresponding slots remain empty.

The flag can only be used with VN interfaces.

0x200 Disable use of In-Cycle-Repetition

Flag has only effect on In-Cycle-Repetition frames. Is the flag set (1), then the
frame can be sent in the slot given by the parameter slotID. Is the flag not set
(0 = default), then the frame will be sent in the next slot of any of the slots
that are given by the In-Cycle-Repetition definition in the database.

CANoe Version ≥ 7.1 SP3

0x400 Sets the null frame indicator in the header.

The flag can only be used with VN interfaces.

All other bits of the flags are reserved.

Caution

If the FRFrame object is used as a parameter for the function FRSetSendFrame,


then consider the flags that are defined to be used for this function!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.


Selectors Test environment

If the Frame object is created (e.g. FrFrame (1,0,1) receiveFrame;) for use with the TFS
function TestGetWaitFrFrameData or TestGetWaitFrNullFrameData or
TestGetWaitFrFrameErrorData, then the following selectors can be used to retrieve the
received event information:
Time

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel or PC system clock).

The time stamp must be used if time relations should be regarded with events from other
sources.

Note: The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

Timer unit: 10 microseconds, data type: dword

Time_ns

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel 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 frame.

Timer unit: nanoseconds, data type: int64

MsgChannel

The application channel that the FlexRay interface determines, which received the frame.

FR_ChannelMask

Identifies the FlexRay channel of the CC. With 1 the frame was received on channel A, with
2 on channel B.

FR_SlotID

The frame was received in this FlexRay slot.

FR_Cycle

The frame was received in this FlexRay slot.

FR_PayloadLength

Length of the payload that was received in 16 Bit words (data type: word).

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index), <signal name>

Direct access to the payload/data of the frame.


The number of valid data bytes is specified by the selector FR_PayloadLength.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

If the frame object was initialized via a symbolic name from the database, signal names can
also be used directly as selectors for the data range. The raw value of the signal is retrieved
or set. The physical value can be retrieved or set by <signal name>.Phys.

Caution

But be aware that the symbolic declaration of the frame object must match the
received frame. Otherwise the symbolic signal interpretation will be wrong!

FR_Flags

Corresponding bits in the flags mirror specific bits in the FlexRay header of the received
frame:

Bit mask Meaning

0x01 The sync bit is set in the header.

0x02 The startup bit is set in the header.

0x20 The payload preamble bit is set in the header.

With static frames, the initial data bytes then contain the local NM vector;
with dynamic frames, the first two bytes then designate the expanded message
ID.

All other bits of the flags are reserved and do not have any meaning.

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

6.1 FlexRay • •

7.5: enhanced for usage in FlexRay • •


arrays and as function
parameter

Example 1

For an example see function FRUpdateStatFrame.

Example 2

This is an example for forwarding the payload to other functions.


variables
{
const dword cFrTTFlag = 0x00;
const dword cFrETFlag = 0x10;
const dword cFrPPFlag = 0x20;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRFrame

const dword cFrStopFlag = 0x80; // only for VN


const dword cFrNullFlag = 0x400; // only for VN
}

void foo (byte[] data, int bytecount)


{
// evaluate or set the contents of the data array
}

void example ()
{
FrFrame (1,0,1) myFrame = { FR_Flags = cFrTTFlag | cFrPPFlag,
FR_ChannelMask = 1, FR_PayloadLength = 2 };
foo (myFrame.FR_Payload, myFrame.FR_PayloadLength * 2);
}

Example 3

This is an example for using the frame object as a function parameter.


variables
{
const dword cFrTTFlag = 0x00;
const dword cFrETFlag = 0x10;
const dword cFrPPFlag = 0x20;
const dword cFrStopFlag = 0x80; // only for VN
const dword cFrNullFlag = 0x400; // only for VN
FrFrame (1,0,1) myFrame = { FR_Flags = cFrTTFlag | cFrPPFlag,
FR_ChannelMask = 1, FR_PayloadLength = 2 };
}

void foo (FrFrame * frame)


{
// evaluate or set the contents of the frame object
}

void example ()
{
foo (myFrame);
}

Example 4

This is an example for using the Frame object in arrays.

Caution

All objects of an array must be initialized with an appropriate frame definition!


variables
{
FrFrame (1,0,1) frm1;

// All objects are equal:


FrFrame (2,0,1) frArray1[10];

// All objects may be different:


FrFrame * frArray2[3] = { (3,0,1), <FrameNameFromDB>, frm1 };
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrPDU

FrPDU
CAPL Function Overview » FlexRay » FrPDU

Syntax FrPDU <FIBEX PDU name> <PDU var>;

Uses a symbolic PDU name from the database to create a transmission object.

FrPDU MsgChannel<num>.< FIBEX PDU name> <PDU var>;

Uses a symbolic PDU name from the database to create a transmission object and
additionally specifies the transmission channnel/cluster.

FrPDU <PDU var>;

Creates a receive object, which is available only for use with the TFS function
TestGetWaitFrPDUData (CANoe ≥ 7.0 SP4).

Function This can be used to create a FlexRay PDU object. The object data can be manipulated via
the object's selectors. Additional object properties can be read from the selectors.

The object is then registered using the FrSetSendPDU and transmitted using the
FrUpdatePDU functions.

Parameters <FIBEX PDU name>

String that corresponds to a PDU name in the database.

The parameters needed to uniquely identify the PDU are taken from the corresponding PDU
definition in the database.

<PDU var>

String that specifies the variable name of the object.

MsgChannel<num>

Specifies the transmission channel/cluster

<num> must be a whole number (e.g. 1, 2, 3, ...) that specifies the channel number of the
corresponding FlexRay interface.

Selectors General use

The symbolically defined transmission object contains the following selectors:

MsgChannel

The application channel that the FlexRay interface determines, which should send the PDU.

Name

Returns the symbolic name of the PDU (data type: char array[]).

Info

This selector is not available for CAPL code execution on interface hardware
(CAPL on Board).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrPDU

Write protected!

FR_ChannelMask

Identifies the CC's FlexRay channel. With 1, the PDU is transmitted on channel A, with 2 on
channel B, and with 3 on channels A and B.

FR_PDULength

Length of the PDU's payload to be sent in bytes (data type: word).

Write protected!

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index), <signal name>

Direct access to the payload/data of the PDU.


The number of valid data bytes is specified by the selector FR_PDULength.
The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

Signal names can also be used directly as selectors for the data range. The raw value of the
signal is retrieved or set. The physical value can be retrieved or set by <signal
name>.Phys.

Write protected!

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.

Write protected!

Selectors Test environment

If the PDU object is created without the symbolic name (e.g. FrPDU receivePDU;) for use
with the TFS function TestGetWaitFrPDUData, then it contains the following selectors:

Time

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel or PC system clock).
The time stamp must be used if time relations should be regarded with events from other
sources.

Info

The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

Timer unit: 10 microseconds, data type: dword

Write protected!

Time_ns

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel or PC system clock).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrPDU

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 PDU.

Timer unit: nanoseconds, data type: int64

Write protected!

MsgChannel

The application channel that the FlexRay interface determines, which received the PDU.

Write protected!

FR_ChannelMask

Identifies the FlexRay channel of the CC. With 1 the PDU was received on channel A, with 2
on channel B.

Write protected!

FR_SlotID

The PDU was received in this FlexRay slot.

Write protected!

FR_Cycle

The PDU was received in this FlexRay cycle.

Write protected!

FR_PayloadLength

Length of the payload that is received for the PDU in bytes (data type: word).

Write protected!

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index)

Direct access to the payload/data of the PDU.


The number of valid data bytes is specified by the selector FR_PayloadLength.
The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

Write protected!

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.

Write protected!

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

6.1 FlexRay • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrPDU

7.5: enhanced for usage in arrays FlexRay • •


and as function parameter

Example 1

For an example see function FrUpdatePDU.

Example 2

This is an example for forwarding the payload to other functions.


void foo (byte[] data, int count)
{
// evaluate the contents of the data array
}

void example ()
{
FrPDU EngineData myPDU;
foo (myPDU.FR_Payload, myPDU.FR_PDULength);
}

Example 3

This is an example for using the PDU object as a function parameter.


variables
{
FrPDU EngineData myPDU;
}

void foo (FrPDU * pdu)


{
// evaluate or set the contents of the PDU object
}

void example ()
{
foo (myPDU);
}

Example 4

This is an example for using the PDU object in arrays.

Caution

All objects of an array must be initialized with an appropriate PDU definition!


variables
{
FrPDU EngineData pdu1;

// All objects are equal:


FrPDU EngineData frPDUArray1[10];

// All objects may be different:


FrPDU * frPDUArray2[2] = { EngineStatus, pdu1 };
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRGetConfiguration

FRGetConfiguration
CAPL Function Overview » FlexRay » FRGetConfiguration

Syntax FRGetConfiguration( int channel, FRConfiguration<configuration var> );

Function This function copies the FlexRay protocol parameters to <configuration var>.

Parameters channel

FlexRay channel (cluster number).

<configuration var>

Name of the variable referenced by the configuration object. The variable name was
defined when the object was created using FRConfiguration.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

7.1 FlexRay • •

Example

The following CAPL function outputs all FlexRay protocol parameters in the Write window.
variables
{
FRConfiguration gFRParams;
}

void printFRConf ()
{
FRGetConfiguration(%CHANNEL%, gFRParams);
Write("%33s = %6d %s", "pCCVersion", gFRParams.pCCVersion, "");
Write("%33s = %6ld %s","FRBaudrate", gFRParams.FRBaudrate, "kBit/s");
Write("%33s = %6f %s", "gdMacrotick", gFRParams.gdMacrotick, "us");
Write("%33s = %6d %s", "gMacroPerCycle", gFRParams.gMacroPerCycle,
"MT");
Write("%33s = %6d %s", "gdNIT", gFRParams.gdNIT, "MT");
Write("%33s = %6f %s", "gdSampleClockPeriod",
gFRParams.gdSampleClockPeriod, "us");
Write("%33s = %6d %s", "gdTSSTransmitter", gFRParams.gdTSSTransmitter,
"Bit");
Write("%33s = %6d %s", "gPayloadLengthStatic",
gFRParams.gPayloadLengthStatic, "Words");
Write("%33s = %6d %s", "gdActionPointOffset",
gFRParams.gdActionPointOffset, "MT");
Write("%33s = %6d %s", "gdStaticSlot", gFRParams.gdStaticSlot, "MT");

Write("%33s = %6d %s", "gNumberOfStaticSlots",


gFRParams.gNumberOfStaticSlots, "#");
Write("%33s = %6d %s", "gdMinislotActionPointOffset",
gFRParams.gdMinislotActionPointOffset, "MT");
Write("%33s = %6d %s", "gdMinislot", gFRParams.gdMinislot, "MT");
Write("%33s = %6d %s", "gNumberOfMinislots",
gFRParams.gNumberOfMinislots, "#");
Write("%33s = %6d %s", "gClusterDriftDamping",
gFRParams.gClusterDriftDamping, "");
Write("%33s = %6d %s", "gListenNoise", gFRParams.gListenNoise, "");
Write("%33s = %6d %s", "gColdStartAttempts",
gFRParams.gColdStartAttempts, "#");
Write("%33s = %6d %s", "gSyncNodeMax", gFRParams.gSyncNodeMax, "#");
Write("%33s = %6d %s", "gOffsetCorrectionStart",
gFRParams.gOffsetCorrectionStart, "MT");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRGetConfiguration

Write("%33s = %6d %s", "gdDynamicSlotIdlePhase",


gFRParams.gdDynamicSlotIdlePhase, "MS");

Write("%33s = %6d %s", "gdSymbolWindow", gFRParams.gdSymbolWindow,


"MT");
Write("%33s = %6d %s", "gdCASRxLowMax", gFRParams.gdCASRxLowMax, "Bit");
Write("%33s = %6d %s", "gdCASRxLowMin", gFRParams.gdCASRxLowMin, "Bit");
Write("%33s = %6d %s", "gdWakeupSymbolRxIdle",
gFRParams.gdWakeupSymbolRxIdle, "Bit");
Write("%33s = %6d %s", "gdWakeupSymbolRxLow",
gFRParams.gdWakeupSymbolRxLow, "Bit");
Write("%33s = %6d %s", "gdWakeupSymbolRxWindow",
gFRParams.gdWakeupSymbolRxWindow, "Bit");
Write("%33s = %6d %s", "gdWakeupSymbolTxIdle",
gFRParams.gdWakeupSymbolTxIdle, "Bit");
Write("%33s = %6d %s", "gdWakeupSymbolTxLow",
gFRParams.gdWakeupSymbolTxLow, "Bit");
Write("%33s = %6d %s", "gMaxWithoutClockCorrectionFatal",
gFRParams.gMaxWithoutClockCorrectionFatal, "double cycles");
Write("%33s = %6d %s", "gMaxWithoutClockCorrectionPassive",
gFRParams.gMaxWithoutClockCorrectionPassive, "double cycles");

Write("%33s = %6d %s", "gNetworkManagementVectorLength",


gFRParams.gNetworkManagementVectorLength, "Bytes");
Write("%33s = %6d %s", "pChannels", gFRParams.pChannels, "");
Write("%33s = %6d %s", "pMicroPerCycle", gFRParams.pMicroPerCycle,
"uT");
Write("%33s = %6d %s", "pSamplesPerMicrotick",
gFRParams.pSamplesPerMicrotick, "#");
Write("%33s = %6d %s", "pPayloadLengthDynMax",
gFRParams.pPayloadLengthDynMax, "Words");
Write("%33s = %6d %s", "pPayloadLengthFIFO",
gFRParams.pPayloadLengthFIFO, "Words");
Write("%33s = %6d %s", "pLatestTx", gFRParams.pLatestTx, "MS");
Write("%33s = %6d %s", "pdMaxDrift", gFRParams.pdMaxDrift, "uT");
Write("%33s = %6d %s", "pdAcceptedStartupRange",
gFRParams.pdAcceptedStartupRange, "uT");
Write("%33s = %6d %s", "pdListenTimeout", gFRParams.pdListenTimeout,
"uT");

Write("%33s = %6d %s", "pClusterDriftDamping",


gFRParams.pClusterDriftDamping, "uT");
Write("%33s = %6d %s", "pDecodingCorrection",
gFRParams.pDecodingCorrection, "uT");
Write("%33s = %6d %s", "pDelayCompensation_A",
gFRParams.pDelayCompensation_A, "uT");
Write("%33s = %6d %s", "pDelayCompensation_B",
gFRParams.pDelayCompensation_B, "uT");
Write("%33s = %6d %s", "pOffsetCorrectionOut",
gFRParams.pOffsetCorrectionOut, "uT");
Write("%33s = %6d %s", "pRateCorrectionOut",
gFRParams.pRateCorrectionOut, "uT");
Write("%33s = %6d %s", "pExternOffsetCorrection",
gFRParams.pExternOffsetCorrection, "uT");
Write("%33s = %6d %s", "pExternRateCorrection",
gFRParams.pExternRateCorrection, "uT");
Write("%33s = %6d %s", "pExternCorrectionMode",
gFRParams.pExternCorrectionMode, "");
Write("%33s = %6d %s", "pMacroInitialOffset_A",
gFRParams.pMacroInitialOffset_A, "MT");

Write("%33s = %6d %s", "pMacroInitialOffset_B",


gFRParams.pMacroInitialOffset_B, "MT");
Write("%33s = %6d %s", "pMicroInitialOffset_A",
gFRParams.pMicroInitialOffset_A, "uT");
Write("%33s = %6d %s", "pMicroInitialOffset_B",
gFRParams.pMicroInitialOffset_B, "uT");
Write("%33s = %6d %s", "pWakeupChannel", gFRParams.pWakeupChannel, "");
Write("%33s = %6d %s", "pWakeupPattern", gFRParams.pWakeupPattern, "#");
Write("%33s = %6d %s", "pAllowHaltDueToClock",
gFRParams.pAllowHaltDueToClock, "Boolean");
Write("%33s = %6d %s", "pAllowPassiveToActive",
gFRParams.pAllowPassiveToActive, "cycles");
Write("%33s = %6d %s", "pBGTick", gFRParams.pBGTick, "Boolean");
Write("%33s = %6d %s", "pPhysicalLayer", gFRParams.pPhysicalLayer, "");
Write("%33s = %6d %s", "pSingleSlotEnabled",
gFRParams.pSingleSlotEnabled, "Boolean");

Write("%33s = %6d %s", "pBGEnable", gFRParams.pBGEnable, "Boolean");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRGetConfiguration

Write("%33s = %6d %s", "pDynamicSegmentEnable",


gFRParams.pDynamicSegmentEnable, "Boolean");
Write("%33s = %6d %s", "pStrobePointPosition",
gFRParams.pStrobePointPosition, "");
Write("%33s = %6f %s", "pdMicrotick", gFRParams.pdMicrotick, "us");"
}

| FRSetConfiguration |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrGetFrameCRC

FrGetFrameCRC
CAPL Function Overview » FlexRay » FrGetFrameCRC

Syntax dword FrGetFrameCRC(this);

Function This function returns the CRC of a received FlexRay frame.

The Header CRC can be determined with a special selector of the event procedure.

Parameters this

The function can only be used in the context of the following event procedures:

• on FRSlot
• on FRFrame
• on FRNullFrame
• on FRFrameError

this references the corresponding receive object in the event procedure.

Return values Frame CRC (data type WORD).

The return value is only valid if the frame was received by a Vector FlexRay hardware
interface in asynchronous monitor mode. In any other case 0 will be sent back.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 FlexRay • •

Example

The following example writes the CRC into the write window for all received frames.
on FRFrame *
{
DWORD crc;
crc = FRGetFrameCRC(this);
Write(“Frame %d in Cycle %d has CRC 0x%x”, this.FR_SlotID,
this.FR_Cycle, crc);
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

output
CAPL Function Overview » FlexRay » output

Syntax void output(flexraymessage msg); // form 1

void output(flexraystartcycle msg); // form 2

void output(flexraysymbol msg); // form 3

void output(flexraypocstate msg); // form 4

void output(flexrayerror msg); // form 5

Function Outputs the object from the program block of the analysis branch. This function must be
used inside the appropriate event procedure in order to forward the event to the next
block in the analysis branch. If the function is not called, then the event is not forwarded.
Thus, events will be filtered by the CAPL program when omitting this function.

The function must not be used in the simulation setup or transmit branch.

Parameters Msg

Variable of type

• flexraymessage

List of available selectors for this type of objects can be found under on FRFrame
selectors, on FRSlot selectors, on FRNullFrame selectors, and on FRFrameError
selectors.

• flexraystartcycle

List of available selectors for this type of objects can be found under on FRStartCycle
selectors.

• flexraysymbol

List of available selectors for this type of objects can be found under on FRSymbol
selectors.

• flexraypocstate

List of available selectors for this type of objects can be found under on FRPOCState
selectors.

• flexrayerror

List of available selectors for this type of objects can be found under on FRError
selectors.

The parameter variable can be accessed in each event handler by the keyword this.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2: form 1, 2 FlexRay • —

6.1: form 3 - 5 FlexRay • —

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: output

Example

If you react on start of cycle, frame, Null frame or frame error events, then you must
forward the event explicitly to the next node in the measurement setup. Otherwise the
successor node will not receive that event!
on FRFrame *
{
// do something ...
// forward event to next node in measurement setup:
output(this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FROutputDynFrame

FROutputDynFrame
CAPL Function Overview » FlexRay » FROutputDynFrame

Syntax int ret = FROutputDynFrame( <frame var> );

Function This function updates the FlexRay Communication Controller's (CC) send buffer with the
current data from the send object. This corresponds to a request to send.

Only frames in the dynamic segment can be sent using this function!

Parameters <frame var>

Name of the variable referenced by the frame object. The variable name was defined
when the object was created using FrFrame.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

For an example see function FRUpdateStatFrame.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRayRcvStatusEvent

FlexRayRcvStatusEvent
CAPL Function Overview » FlexRay » FlexRayRcvStatusEvent

Note

The callback function FlexRayRcvStatusEvent is deprecated! Use the event procedures on


FRSymbol and on FRPOCState instead.

Syntax FlexRayRcvStatusEvent (long msgTime, int channel, long statusType, long


infomask1, long infomask2, long infomask3);

Function This function is a callback and is called by the tool!

The callback occurs when the FlexRay Communication Controller (CC) has synchronized
with the bus or the synchronization fails.

Parameters msgTime

Event time stamp.

channel

Channel in the tool that selects the CC.

Should be set to 1 by default (since the tool currently only supports one FlexRay CC).

statusType

The bits signal the type of status event concerned.

At the moment only bus synchronization type is available. This means the bits of this mask
define which bit is valid in infomask1.

Type Meaning

0x0001 "Bus Synchronization" status is included.

0x0002 Received symbol

infomask1

If statusType == 1:

The bits signal the value of an special status event.

Type Bit value Meaning

0x0001 0 CC unable to synchronize with the bus.

1 CC is synchronized to the bus.

If statusType == 2:

Symbol type (in bits 0-15):

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRayRcvStatusEvent

1 CAS
2 MTS
3 Wakeup
4 Not specified

Symbol length (in bits 16-30) in bit times.

Example

0x00260004: not specified signal with the length 38.

Info

The bit length is only determined by the BusDoctor and the Vector FlexRay
hardware interfaces in asynchronous mode.

infomask2

If statusType == 1:

Not used.

If statusType == 2:

Symbol receiving cycle.

infomask3

If statusType == 1:

Not used.

If statusType == 2:

Channel mask (A=1 / B=2 / AB = 3): Channel the symbol was received.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 FlexRay • •

Example
variables
{
int busIsSynchronized = 0;
}
FlexRayRcvStatusEvent (long msgTime, int channel, long statusType, long
infomask1, long infomask2, long infomask3)
{
if (statusType & 0x00000001)
{
if (infomask1 & 0x00000001)
{
busIsSynchronized = 1;
Write("FR StatusEvent: Bus (channel %d) is synchronized.",
channel);
}
else
{
Write("FR StatusEvent: Bus (channel %d) lost synchronization.",
channel);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRayRcvStatusEvent

if (busIsSynchronized == 1) ResetFlexRayCC(channel);
busIsSynchronized = 0;
}
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSendFrame

FrSendFrame
CAPL Function Overview » FlexRay » FrSendFrame

Note

This function is deprecated! Use function FRUpdateStatFrame or FROutputDynFrame


instead.

Syntax FrSendFrame( <frame name>, dword flags, byte dataBytes[] );

Uses a symbolic frame name from the database.

Note: This symbolic function is not available when executing CAPL programs directly on
an interface hardware (CAPL on Board).

FrSendFrame( int slotId, int channelMask, int len, int cycleStart, int
cycleRepetition, dword flags, byte dataBytes[], int channel );

If no database is available, all necessary parameters can be set separately, too.

Function This function generates a FlexRay message and sends it on the bus. The FlexRay
communication controller sends the message at the next possible point in time.
The message must be registered before sending (see FRSetSendFrame function).

Parameters <frame name>

String that corresponds to a frame name of the database.


The necessary parameters slotId, channelMask, len, cycleStart and cycleRepetition are
taken from the corresponding frame definition of the database.

slotId

Identifier of the time slot in which the message should be sent.

channelMask

Channel of the transmission message.


Values:

1 Channel A

2 Channel B

3 Channel A+B (should correspond to the registered value; see FRSetSendFrame


function)

len

Number of data bytes (maximum 254 bytes).

cycleStart

This number designates the base cycle. This value must be smaller than the repetition
factor and lies in the range between 0 and 63.
This value, together with the repetition factor, determines the "Cycle Multiplexing" of the
frame. The slot ID, channel mask, and cycle multiplexing uniquely identify the message in
a FIBEX database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSendFrame

cycleRepetition

This number designates the cycle repetition factor. The value must be between 1 and 64
and must be a power of 2 (e.g. 1, 2, 4, 8, 16, 32 or 64).
This value, together with the base cycle, determines the "Cycle Multiplexing" of the
frame. The slot ID and the cycle multiplexing (and the cluster allocation of the FlexRay
bus) uniquely identify the message in a FIBEX database.

flags

Corresponding bits in the flags set or activate special states for the frame to be sent:

Bit mask Meaning

0x10 Sets the send mode to event triggered (if bit not set then time-triggered
mode).
0x20 Sets the payload preamble bit (with static frames, the initial databytes then
contain the local NM vector; with dynamic frames, the first two bytes then
designate the expanded message ID).
0x80 TX OFF

The frame is no longer sent, the corresponding slots remain empty.

The flag can only be used with VN interfaces.

0x200 Disable use of In-Cycle-Repetition

Flag has only effect on In-Cycle-Repetition frames. Is the flag set (1), then
the frame can be sent in the slot given by the parameter slotID. Is the flag
not set (0 = default), then the frame will be sent in the next slot of any of
the slots that are given by the In-Cycle-Repetition definition in the
database.

CANoe Version ≥ 7.1 SP3

0x400 Sets the null frame indicator in the header.

The flag can only be used with VN interfaces.

databytes

Array of data bytes (payload)

channel

Channel number (or cluster number)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 FlexRay — •

Example
variables
{
// Bit mask meaning in flags:
// bit | mask | for
//----------------------------------------------------------------
// 0 | 1 | sync flag (1 == set)
// 1 | 2 | startup flag (1 == set)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSendFrame

// 4 | 16 | TT flag (1 == event-triggered, 0 = time-triggered)


//
BYTE gSta1Id = 9; // slot ID for frame to send
BYTE gSta1Flags = 16; // event-triggered
BYTE gSta1Dlc = 4; // bytes
BYTE gSta1Chan = 3; // send on channel A+B
BYTE gSta1Base = 0; // base cycle
BYTE gSta1Rep = 1; // cycle repetition
BYTE gSta1Channel = %CHANNEL%; // FR interface
const long gPeriodSine = 8000;
const long gPeriodRect = 1000;
const long gAmplitudeSine = 1000;
const int cMaxFRBufSize = 254;
BYTE gSta1Msg[cMaxFRBufSize]; // message buffer
}
on preStart
{
int i;
// Declare TX buffer in interface:
FRSetSendFrame(gSta1Id /*frameId*/, gSta1Chan /*channelMask*/, gSta1Dlc
/*len*/, gSta1Base /*cycleStart*/, gSta1Rep /*cycleRepetition*/, gSta1Flags
/*flags*/, gSta1Channel /*cluster*/);
// Initialize payload:
for(i=0; i<gSta1Dlc; ++i)
{
gSta1Msg[i] = i;
}
}
on FRStartCycle *
{
if (this.FR_Cycle % gSta1Rep == gSta1Base)
{
doCalc();
FRSend();
}
}
FRSend ()
{
FRSendFrame(gSta1Id /*frameId*/, gSta1Chan /*channelMask*/, gSta1Dlc
/*len*/, gSta1Base /*cycleStart*/, gSta1Rep /*cycleRepetition*/, gSta1Flags
/*flags*/, gSta1Msg /*dataBytes*/, gSta1Channel /*cluster*/);
}
doCalc ()
{
float sine
BYTE rect;
long sinel;
// Calculating sine wave and rectangle values:
sine = gAmplitudeSine*sin((timeNow()/100)*2*PI/gPeriodSine);
if (sin((timeNow()/100)*2*PI/gPeriodRect)<0)
rect = 0;
else
rect = 1;
sinel = sine;
// assigning values to message buffer:
gSta1Msg[0] = (sinel & 0x000000FF);
gSta1Msg[1] = (sinel & 0x0000FF00) >> 8;
gSta1Msg[2] = rect;
gSta1Msg[3] = 0;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSendSymbol

FRSendSymbol
CAPL Function Overview » FlexRay » FRSendSymbol

Syntax FRSendSymbol( long <type>, long <param>, int channel );

Function This function sends an MTS symbol in the next possible symbol window if the
Communication Controller is in normal mode (synchronized).

Parameters <type>

Not used at this time. Reserved for future expansions. Should always be equal to 0.

<param>

Not used at this time. Reserved for future expansions. Should always be equal to 0.

channel

Channel number (or cluster number)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

This example sends a MTS symbol when a key is pressed in the next possible cycle.
on key 'm'
{
FrSendSymbol(0 /* not used */, 0 /* not used */, %CHANNEL%);
}

Note

The cluster parameters must define a symbol window!

A CAS cannot be sent explicitly. It is reserved for the start-up procedure.

For sending a wakeup see function ResetFlexRayCCEx.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetAutoIncrement

FRSetAutoIncrement
CAPL Function Overview » FlexRay » FRSetAutoIncrement

Note

This function can only be used with VN3300 and VN3600.

Syntax void FRSetAutoIncrement (int channel, int slotId, int channelMask, int
cycleStart, int cycleRepetition, dword flags, int increment_size, int
increment_offset);

Function Part of the payload of a frame will be incremented automatically on each transmission.
The number of bytes used can be set to 1, 2 or 4.

The byte offset can also be set. The only format supported is Intel (Little Endian).

Parameters channel

Channel number (or cluster number)

slotId

Slot number of the frame used.

channelMask

FlexRay channel mask


Possible values:

1 Channel A

2 Channel B

3 Channel A+B

cycleStart, cycleRepetition

Cycle multiplexing parameter

flags

1: Payload increment is switched on.


All other values are reserved and must not be used.

increment_size

Number of bits used for the increment.


8, 16 and 32 are valid values.

increment_offset

Byte position after which the payload is incremented.


Possible values:

increment_size increment_offset

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetAutoIncrement

8 0,1,2,3...

16 0,2,4,6,...

32 0,4,8,...

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

This example sends automatically a frame each second cycle in slot 30 with automatically
incrementing a message counter:
variables
{
// The gMsg2 message for the static segment
// that is sent on channel A only.
FRFrame ( 30, 0, 2) gMsg2;
const BYTE gMsg2Flags = 0; // state-driven for repeated transmission
const BYTE gMsg2Channel = %CHANNEL%; // send on network the CAPL node
is assigned to
const BYTE gMsg2ChanMask = 1; // send on FlexRay channel A
const BYTE gMsg2Len = 32; // 32 byte user data
const int gMsg2IncSize = 16; // 16 bit message counter
const int gMsg2IncOffset = 0; // Byte 0 is first byte of message
counter
}
on preStart
{
// Optionally prepare buffer for message gMsg2:
gMsg2.MsgChannel = gMsg2Channel;
gMsg2.FR_ChannelMask = gMsg2ChanMask;
gMsg2.FR_Flags = gMsg2Flags;
FRSetPayloadLengthInByte(gMsg2, gMsg2Len);
FRSetSendFrame( gMsg2 );
// Define the automatic icrementing message counter:
FRSetAutoIncrement(gMsg2.MsgChannel, gMsg2.FR_SlotID,
gMsg2.FR_ChannelMask, gMsg2.FR_CycleOffset, gMsg2.FR_CycleRepetition, 1,
gMsg2IncSize, gMsg2IncOffset);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetConfiguration

FRSetConfiguration
CAPL Function Overview » FlexRay » FRSetConfiguration

Note

When using the BusDoctor, this function is ignored.

Syntax FRSetConfiguration( int channel, <configuration var> );

Function This function writes the FlexRay protocol parameters from the configuration object to the
FlexRay interface's Communication Controller.

The values must previously have been set in the configuration object in compliance with
the FlexRay specification.

The new protocol parameters will only be applied when the Communication Controller is
reset!

Parameters channel

FlexRay channel (cluster number)

<configuration var>

Name of the variable referenced by the configuration object.

The variable name was defined when the object was created using FRConfiguration.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

The following CAPL program reconfigures the FlexRay Communication Controller with new
FlexRay protocol parameters.
variables
{
FRConfiguration gFRParams;
}
void setFRConf1 ()
{
FRGetConfiguration(%CHANNEL%, gFRParams);
gFRParams.FRBaudrate = 10000; // "kBit/s"
gFRParams.gdMacrotick = 1; // "us"
gFRParams.gMacroPerCycle = 5000; // "MT"
gFRParams.gdNIT = 100; // "MT"
//gFRParams.gdSampleClockPeriod = 0.0; // "us"
gFRParams.gdTSSTransmitter = 10; // "Bit"
gFRParams.gPayloadLengthStatic = 2; // "Words"
gFRParams.gdActionPointOffset = 9; // "MT"
gFRParams.gdStaticSlot = 35; // "MT"
gFRParams.gNumberOfStaticSlots = 60; // "#"
gFRParams.gdMinislotActionPointOffset = 4; // "MT"
gFRParams.gdMinislot = 10; // "MT"
gFRParams.gNumberOfMinislots = 276; // "#"
//gFRParams.gClusterDriftDamping = 0; // ""
gFRParams.gListenNoise = 10; // ""
gFRParams.gColdStartAttempts = 20; // "#"
gFRParams.gSyncNodeMax = 4; // "#"
gFRParams.gOffsetCorrectionStart = 4931; // "MT"
gFRParams.gdDynamicSlotIdlePhase = 1; // "MS"

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetConfiguration

gFRParams.gdSymbolWindow = 35; // "MT"


gFRParams.gdCASRxLowMax = 0; // "Bit"
gFRParams.gdCASRxLowMin = 0; // "Bit"
gFRParams.gdWakeupSymbolRxIdle = 59; // "Bit"
gFRParams.gdWakeupSymbolRxLow = 51; // "Bit"
gFRParams.gdWakeupSymbolRxWindow = 301; // "Bit"
gFRParams.gdWakeupSymbolTxIdle = 180; // "Bit"
gFRParams.gdWakeupSymbolTxLow = 60; // "Bit"
gFRParams.gMaxWithoutClockCorrectionFatal = 10; // "double cycles"
gFRParams.gMaxWithoutClockCorrectionPassive = 6; // "double cycles"
gFRParams.gNetworkManagementVectorLength = 0; // "Bytes"
gFRParams.pChannels = 3; // "A+B"
gFRParams.pMicroPerCycle = 200000; // "uT"
gFRParams.pSamplesPerMicrotick = 2; // "#"
gFRParams.pPayloadLengthDynMax = 10; // "Words"
gFRParams.pPayloadLengthFIFO = 10; // "Words"
gFRParams.pLatestTx = 272; // "MS"
gFRParams.pdMaxDrift = 89; // "uT"
gFRParams.pdAcceptedStartupRange = 189; // "uT"
gFRParams.pdListenTimeout = 401202; // "uT"
gFRParams.pClusterDriftDamping = 1; // "uT"
gFRParams.pDecodingCorrection = 52; // "uT"
gFRParams.pDelayCompensation_A = 10; // "uT"
gFRParams.pDelayCompensation_B = 10; // "uT"
gFRParams.pOffsetCorrectionOut = 143; // "uT"
gFRParams.pRateCorrectionOut = 601; // "uT"
gFRParams.pExternOffsetCorrection = 0; // "uT"
gFRParams.pExternRateCorrection = 0; // "uT"
gFRParams.pExternCorrectionMode = 0; // ""
gFRParams.pMacroInitialOffset_A = 9; // "MT"
gFRParams.pMacroInitialOffset_B = 9; // "MT"
gFRParams.pMicroInitialOffset_A = 18; // "uT"
gFRParams.pMicroInitialOffset_B = 18; // "uT"
gFRParams.pWakeupChannel = 1; // 1 (A) or 2 (B)
gFRParams.pWakeupPattern = 0; // "#"
gFRParams.pAllowHaltDueToClock = 1; // "Boolean"
gFRParams.pAllowPassiveToActive = 1; // "cycles"
//gFRParams.pBGTick = 0; // "Boolean"
//gFRParams.pPhysicalLayer = 0; // ""
gFRParams.pSingleSlotEnabled = 0; // "Boolean"
//gFRParams.pBGEnable = 0; // "Boolean"
//gFRParams.pDynamicSegmentEnable = 0; // "Boolean"

FRSetConfiguration(%CHANNEL%, gFRParams);
ResetFlexRayCC(%CHANNEL%); // in order to apply the new values
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetKeySlot

FrSetKeySlot
CAPL Function Overview » FlexRay » FrSetKeySlot

Note

When using the BusDoctor, this function is unnecessary and is ignored.

Syntax void FrSetKeySlot (long channel, long channelMask, long keySlotIndex, long
keySlotId, long keySlotUsage)

Function Configures one of two possible key slots that are to be sent for a FlexRay bus.

The change will be applied with the next reset of the interface hardware (e.g. by
ResetFlexRayCC or ResetFlexRayCCEx).

Parameters channel

Channel number (or cluster number)

channelMask

Channel of the transmission frame.


Values:

1 Channel A

2 Channel B

3 Channel A+B

kyeSlotIndex

Addresses the desired key slot (1 or 2).

keySlotId

This number designates a specific FlexRay slot in the static segment.

Its value must be between 1 and 1023.

keySlotUsage

Defines the mode of the key slot:

Value Meaning

0 Off

1 Startup/Sync (Allowing Leading Coldstart)

2 Sync

3 Startup/Sync

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetKeySlot

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 FlexRay — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetMode

FRSetMode
CAPL Function Overview » FlexRay » FRSetMode

Note

The function is only supported by FlexCard Cyclone II or the Vector FlexRay hardware
interface.

Syntax FRSetMode( int channel, int channelMask, dword mode );

Function This function initializes the FlexRay bus drivers. Essentially, it defines whether the drivers
are set to normal mode or sleep mode.

Info

If the transceivers had been disabled (sleep mode), and a wakeup pattern is
received (see on FRPOCState), then the transceivers must explicitly be
activated again!

Parameters channel

FlexRay channel (cluster number).

channelMask

Determines which bus driver is being programmed.


Value:

1 Channel A

2 Channel B

3 Channel A+B

mode

Defines the bus driver state:

Mode Meaning

0x0000 Normal mode, when starting the Communication Controller a Wakeup will be
sent if this is defined in the hardware configuration dialog.

0x0001 Sleep mode

0x0002 Normal mode, when starting the Communication Controller no Wakeup will be
sent.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example 1

The following CAPL program deactivates or activates the physical drivers according to key

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetMode

presses.
on key 'd'
{
// suspend physical layers:
FRSetMode(%CHANNEL%, 3, 1);
Write("FlexRay physical layers of channel %d are offline (sleep mode).",
%CHANNEL%);
}
on key 'a'
{
// activate physical layers (with optional wakeup):
FRSetMode(%CHANNEL%, 3, 0);
Write("FlexRay physical layers of channel %d are going online (with
optional wakeup to send).", %CHANNEL%);
}
on key 'q'
{
// activate physical layers without any wakeup:
FRSetMode(%CHANNEL%, 3, 2);
Write("FlexRay physical layers of channel %d are going online.",
%CHANNEL%);
}

Example 2

The following CAPL program deactivates or activates the physical drivers according to the
clusters synchronisation state and reception of a wakeup symbol.
variables
{
const int cFrChanMask = 3; // for channel A+B
const int cFrModeGoSleep = 1;
const int cFrModeGoNormal = 2;
int gClusterSync = -1;
int gCntWakeups = 0;
}
on FRPocState
{
if (this.MsgChannel != %CHANNEL%) return;
if (((gClusterSync == -1) || (gClusterSync == 1)) && ((this.FR_POCState
== 4) || (this.FR_PocState == -2))) // FlexRay interface is async
{
// ResetFlexRayCC(%CHANNEL%);
gClusterSync = 0;
write("FR: Lost Sync Time: %.6f", timenowns()/1000000000.0);
gotoSleep();
}
else if (((gClusterSync == -1) || (gClusterSync == 0)) &&
(this.FR_POCState == 2)) // Synchronous again
{
gClusterSync = 1;
write("FR: Get Sync Time: %.6f", timenowns()/1000000000.0);
write("FR: received %d Wakeup Symbols", gCntWakeups);
gCntWakeups = 0;
}
if (this.FR_Info2 == 7)
{ // generated by VN interface
receiveWakeup();
}
}
on start
{
gotoNormal();
}
on FRSymbol
{
if (this.MsgChannel != %CHANNEL%) return;
if (this.FR_Symbol == 3) // Wakeup symbol
{ // generated by FlexCard Cyclone II interface
receiveWakeup();
}
}
void gotoSleep ()
{
FRSetMode( %CHANNEL%, cFrChanMask, cFrModeGoSleep);
write("FR: Sleep Time: %.6f", timenowns()/1000000000.0);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetMode

void gotoNormal ()
{
FRSetMode( %CHANNEL%, cFrChanMask, cFrModeGoNormal);
write("FR: Wakeup Time: %.6f", timenowns()/1000000000.0);
}
void receiveWakeup ()
{
gotoNormal();
gCntWakeups++;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSetPayloadLengthInByte

FRSetPayloadLengthInByte
CAPL Function Overview » FlexRay » FRSetPayloadLengthInByte

Syntax FRSetPayloadLengthInByte( <frame var>, dword <dlc> );

Function This function sets the payload (data length) of the object in bytes. In the event of an
uneven value, the length of the buffer will be set to the next even value.

The payload length can also be set using the FR_PayloadLength frame variables selector.
However, in this case, the length is set in 16-bit words.

The data length can only be manipulated for frames sent in the dynamic segment!

Parameters <frame var>

Name of the variable referenced by the frame object. The variable name was defined
when the object was created using FrFrame.

<dlc>

Defines the payload (data length) in bytes.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay • •

Example

For an example see function FRUpdateStatFrame.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetPOCState

FrSetPOCState
CAPL Function Overview » FlexRay » FrSetPOCState

Note

The function is supported by VN interfaces only!

Syntax long FrSetPOCState( long channel, long ccNumber, long pocState )

Function This function puts the FlexRay Communication Controller (CC) into the desired Protocol
Operation Mode (POC state). The function is non-blocking. That means, the function will
return before the CC has reached the desired POC-state.

All E-Ray POC-state changes can be monitored with the status- or POC-state-events. A
status event is generated as soon as the second CC has reached the desired POC-state.

The diagram shows the several states and the corresponding transitions in the protocol
operation control process:

Parameters Channel

FlexRay channel (cluster number).

ccNumber

1: E-Ray
2: Second Startup Controller/Coldstart helper (Fujitsu)

pocState

Desired POC state:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetPOCState

POC state Meaning

0 wakeup

1 normal active

2 halt

3 ready

Return values 0: Error (wrong parameter, or the POC state can not be reached)

1: No error
Availability Since Version Restricted to Measurement Setup Simulation / Test
Setup

7.1 FlexRay — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendFrame

FrSetSendFrame
CAPL Function Overview » FlexRay » FrSetSendFrame

Note

When using the BusDoctor, this function is unnecessary and is ignored.

This function is not available when executing CAPL programs directly on an interface
hardware (CAPL on Board).

Syntax FrSetSendFrame( <frame name>, dword flags );

Uses a symbolic frame name from the database.

FrSetSendFrame( int slotId, int channelMask, int len, int cycleStart, int
cycleRepetition, dword flags, int channel );

If no database is available all necessary parameters can be set separately, too.

FrSetSendFrame( <frame object> );

If a FRFrame object was created with FRFrame, with this function the object can be
registered for sending.

Function Configures the hardware for sending the specified message.

The call must take place in the On PreStart routine in the simulation setup /
transmission branch.

Parameters <frame name>

String that corresponds to a frame name of the database.


The necessary parameters slotId, channelMask, len, cycleStart and cycleRepetition are
taken from the corresponding frame definition of the database.

slotId

Identifier of the time slot in which the message should be sent.

channelMask

Channel of the transmission message.


Values:

1 Channel A

2 Channel B

3 Channel A+B

len

Number of databytes (maximum 254 bytes).

cycleStart

This number designates the base cycle. This value must be smaller than the repetition
factor and lie in the range between 0 and 63.
This value together with the repetition factor determines the "Cycle Multiplexing" of the
frame. The slot ID and the cycle multiplexing (and the cluster allocation of the FlexRay

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendFrame

bus) uniquely identify the message in a FIBEX database.

cycleRepetition

This number designates the cycle repetition factor. The value must be between 1 and 64
and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or 64).
This value, together with the base cycle, determines the "Cycle Multiplexing" of the
frame. The slot ID and the cycle multiplexing (and the cluster allocation of the FlexRay
bus) uniquely identify the message in a FIBEX database.

flags

Corresponding bits in the flags set or activate special statuses for the frame to be sent:

Bit mask Meaning

0x01 Sets the sync bit in the header.

Only a frame in the static segment may have set this bit.

Caution

This flag is deprecated (for CANoe ≥ 7.2)! Use instead function


FRSetKeySlot.

0x02 Sets the startup bit in the header.

If this bit is set, then the sync bit must also be set.

Caution

This flag is deprecated (for CANoe ≥ 7.2)! Use instead function


FRSetKeySlot.

0x10 Sets the send mode to event-triggered.

If not set, the frame will be transmitted in time-triggered mode.

0x20 Sets the payload preamble bit.

With static frames, the initial data bytes then contain the local NM vector;
with dynamic frames, the first two bytes then designate the expanded
message ID.

0x40 Enable TX Check.

When a TX Ack is received, its cycle number is compared with that of the
transmission time.

If the TX Ack is not received until the next but one cycle or even later, an
error message is output in the Write window.

Example
A frame is sent in cycle 7, the TX Ack contains cycle 9. The cycle interval
increases accordingly for frames with a cycle repetition > 1.

The flag can only be used with VN3300 and VN3600.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendFrame

0x100 Inhibit leading cold start.

If set, the CC is not allowed to initialize the cluster communication.

Caution

This flag is deprecated (for CANoe ≥ 7.2)! Use instead function


FRSetKeySlot.

channel

Channel number (or cluster number)

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 FlexRay — •

Example

For an example see functions FRUpdateStatFrame and FRSendFrame.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendGroup

FrSetSendGroup
CAPL Function Overview » FlexRay » FrSetSendGroup

Note

This function can only be used with VN3300 and VN3600.

If you would like to use this function, canrtk.dll must be integrated as a CAPL DLL.

Syntax void frSetSendGroup (int slotId, int channelMask, int groupNo, int
cycleStart, int cycleRepetition, long flags, int channel);

Function Grouped frames, which are transmitted in a CAPL handler (e.g., on FrFrame, on timer,
etc.), are not written to the CC send buffer until it has been ensured that frames with a
payload that has not yet been modified and frames with a modified payload have not
been mixed together during a FlexRay cycle.

In other words, all frames in the group are sent in the current cycle, or all frames are not
sent until the next possible cycle.

Restrictions
The number of frames per group is restricted to four per FlexRay channel (A, B).

Parameters slotId

Slot number of the frame used

channelMask

FlexRay channel mask


Possible values:

1 Channel A

2 Channel B

3 Channel A+B

cycleStart, cycleRepetition

Cycle multiplexing parameter

groupNo

Group number can be selected as required.

flags

Reserved, must be 0

channel

Channel number (or cluster number)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendGroup

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

The frames in slots 8 and 40 are registered as a group. The frames are sent in on FrFrame
(10, 0, 1).

The frame in slot 40 was able to be sent in the current CC cycle, but not the other frame.
Therefore, the TX buffers of all frames of the group are not written until slot 40 has been
expired.
variables
{
FRFrame MsgChannel1.( 8, 0, 1) gSta1Msg;
FRFrame MsgChannel1.(40, 0, 1) gSta2Msg;
int flags = 16; // event-driven
int channelMask = 1;
int payloadlength = 4;

int groupNo = 66;


int Cnt = 0;
}
on preStart
{
// register frame 1:
gSta1Msg.FR_Channelmask = channelMask;
gSta1Msg.FR_Flags = flags;
FRSetPayloadLengthInByte(gSta1Msg, payloadlength);
FRSetSendFrame( gSta1Msg );
// add to send group:
FRSetSendGroup( gSta1Msg.FR_SlotID,
gSta1Msg.FR_ChannelMask,
groupNo,
gSta1Msg.FR_CycleOffset,
gSta1Msg.FR_CycleRepetition,
0 );
// register frame 2:
gSta2Msg.FR_Channelmask = channelMask;
gSta2Msg.FR_Flags = flags;
FRSetPayloadLengthInByte(gSta2Msg, payloadlength);
FRSetSendFrame( gSta2Msg );
// add to send group:
FRSetSendGroup( gSta2Msg.FR_SlotID,
gSta2Msg.FR_ChannelMask,
groupNo,
gSta2Msg.FR_CycleOffset,
gSta2Msg.FR_CycleRepetition,
0 );
}
on FRFrame (10, 0, 1)
{
// we assume that we receive at least a message
// in slot 10 in cycle 0 on channel A:
if ((this.FR_Cycle == 0) && (this.FR_ChannelMask == 1))
{
// Update is done in cycle 0 only:
gSta1Msg.byte(0) = Cnt;
gSta2Msg.byte(0) = Cnt;
FRupdateStatFrame(gSta1Msg);
FRupdateStatFrame(gSta2Msg);
Write(„Update of Frames in cycle %d with data %d.“, this.FR_Cycle,
Cnt);
if (++Cnt > 255) Cnt = 0;
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetSendPDU

FrSetSendPDU
CAPL Function Overview » FlexRay » FrSetSendPDU

Syntax FrSetSendPDU( <PDU object> );

If a FrPDU object was created using FrPDU, it can be submitted for transmission with this
function.

Function Configures the hardware to transmit the specified PDU.

All relevant slots are submitted for transmission.

This submission must take place in the OnPreStart routine in the transmit branch.

Parameters <PDU object>

Specifies the PDU object that is to be submitted for transmission.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 FlexRay — •

Example

For an example see function FRUpdatePDU.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrSetTrigger

FrSetTrigger
CAPL Function Overview » FlexRay » FrSetTrigger

Note

The function is supported by VN interfaces only!

Syntax long FrSetTrigger( long channel, long portNo )

Function This function activates the Trigger output of the selected VN interface. The VN interfaces
provide three different trigger ports. The ports can be set separately.

Parameters channel

FlexRay channel (cluster number). The channel number identifies the VN interfaces in
case several interfaces are active.

portNo

1-3: Number of corresponding trigger output. The PIN assignment is defined in the manual
of the hardware interface.

Return values 0: Error

1: Ok
Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 FlexRay — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrUpdatePDU

FrUpdatePDU
CAPL Function Overview » FlexRay » FrUpdatePDU

Syntax FrUpdatePDU(<PDU var>, dword flags, int updateCounter);

Function This function updates the PDU payload in the assigned FlexRay frames.

The update bit can also be set.

Parameters <PDU var>

Name of the variable referenced by the PDU object.

The variable name was defined via FrPDU when the object was created.

flags

Bit mask Meaning

0x01 Update bit is set on transmission.

All other bits are reserved and must be set to a value of 0.

updateCounter

Value Meaning

-1 The PDU is transmitted in every configured slot.


0 The PDU's default value is transmitted.
N (>0) The PDU is transmitted at least n times.
Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 FlexRay — •

Example

The following example assumes that the database defines a PDU that is named
PDU_CNT_02 and that this PDU contains a signal that is named counter.

This program sends the PDU once every 64 cycles. The update is made on the beginning of
cycle 0.
variables
{
FRPDU MsgChannel%CHANNEL%.PDU_CNT_02 gPDU1;
BYTE gCycle; // remember current FlexRay cycle
}
on preStart
{
// Optionally prepare buffer for PDU gPDU1:
FRSetSendPDU(gPDU1);
}
on FRStartCycle 0
{
if (this.MsgChannel != %CHANNEL%) return;
gCycle = this.FR_Cycle;
gPDU1.counter = gCycle;
FRUpdatePDU(gPDU1, 1, 1); // set update bit and send only once

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FrUpdatePDU

Info

When the appropriate TX buffers are declared by the TX buffer list of the hardware
configuration dialog, then the function FrSetSendPDU in on preStart is obsolete.

Is the update time close to the sending slot (e.g. update of slot 2 just after the start of a
cycle), then with high probability the update will be too late for the current cycle and the
frame is sent in the next possible cycle! Thus, updates should be made early enough
before the sending slot of the PDU.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRUpdateStatFrame

FRUpdateStatFrame
CAPL Function Overview » FlexRay » FRUpdateStatFrame

Syntax int ret = FRUpdateStatFrame( <frame var> );

Function This function updates the FlexRay Communication Controller's (CC) send buffer with the
current data from the send object. This corresponds to a request to send.

Only frames in the static segment can be sent using this function!

Parameters <frame var>

Name of the variable referenced by the frame object. The variable name was defined
when the object was created using FrFrame.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay — •

Example

The following CAPL program sends a startup/sync frame in slot 60 in every cycle. The
calculation of the payload and the TX buffer update is synchronously executed to every
start of a cycle.
variables
{
// The gMsg1 message is a startup/sync message for the static segment
// that is sent on both channels.

FRFrame ( 60, 0, 1) gMsg1;


const BYTE gMsg1Flags = 3; // state-driven with sync and startup
const BYTE gMsg1Channel = %CHANNEL%; // send on network the CAPL node
is assigned to
const BYTE gMsg1ChanMask = 3; // send on FlexRay channel A+B
const BYTE gMsg1Len = 32; // 32 byte user data
BYTE gCycle; // remember current FlexRay cycle
}
on preStart
{
// Optionally prepare buffer for message gMsg1:
gMsg1.MsgChannel = gMsg1Channel;
gMsg1.FR_ChannelMask = gMsg1ChanMask;
gMsg1.FR_Flags = gMsg1Flags;
FRSetPayloadLengthInByte(gMsg1, gMsg1Len);
FRSetSendFrame( gMsg1 );
}
DoFRCalc ()
{
int i;
gMsg1.byte(0) = gCycle;
// or gMsg1.signame = value; if frame is symbolically declared
for (i = 1; i < gMsg1.FR_PayloadLength * 2; ++i)
{
gMsg1.byte(i) = i;
}
}
DoFRSend ()
{
// Update the message buffer:
FRUpdateStatFrame(gMsg1); // or FROutputDynFrame(gMsg1);
}
on FRStartCycle *
{
gCycle = this.FR_Cycle;
DoFRCalc(); // calculate and set message contents

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRUpdateStatFrame

DoFRSend(); // commit buffer for sending


}

Info

Instead of giving the parameters in brackets the message object can be declared by using
a symbolic name from the FIBEX database. In this case those parameters are taken from
the database and you can directly access the signals of the frame by its symbolic name
instead of accessing its bytes.

Is the frame located in a slot of the dynamic segment, you must use the function
FROutputDynFrame instead of FRUpdateStatFrame. A dynamic frame must not be a
startup or sync frame. A dynamic frame must also not be sent redundantly on both
channels A + B with a channel mask 3.

When the appropriate TX buffer is declared by the TX buffer list of the hardware
configuration dialog, then the function FrSetSendFrame in on preStart is obsolete. It
can still be used for overriding settings in the TX buffer list.

Is the update time close to the sending slot (e.g. update of slot 2 just after the start of a
cycle), then with high probability the update will be too late for the current cycle and the
frame is sent in the next possible cycle! Thus, updates should be made early enough
before the sending slot.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MessageTimeNS

MessageTimeNS
CAPL Function Overview » FlexRay » MessageTimeNS

Syntax float ns = MessageTimeNS( this );

Function This function returns the receive time of the frame or slot in nanoseconds.

Parameters this

The function can only be used in the context of the following event procedures:

• on FRFrame
• on FRNullFrame
• on FRFrameError
• on FRSlot
• on FRStartCycle

this references the corresponding receive object in the event procedure.

Return values Receive time in nanoseconds since start of message.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 FlexRay • •

Example

For an example see event procedure on FRFrame.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetFlexRayCC

ResetFlexRayCC
CAPL Function Overview » FlexRay » ResetFlexRayCC

Note

When using the BusDoctor this function is ignored.

The resetting of the FlexRay communication controller takes considerable time (approx.
up to 100 ms). During this time the complete execution of (CANoe including any remaining
bus simulation) is halted/suspended. Also bus events from other busses are not
recognized. Therefore this function should only be used in one channel configurations. For
an alternative functionality see Example II.

Syntax ResetFlexRayCC (int channel);

Function This function initializes the FlexRay Communication Controller (CC) and begins a new
startup phase for the cluster or a new integrations phase in the cluster - depending on
whether a startup frame is to be sent or not.

Parameters channel

FlexRay channel (cluster number).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 FlexRay — •

Example I

The following program resets the FlexRay interface of the attached channel, when key 'r'
is pressed.
on key 'r'
{
ResetFlexRayCC(%CHANNEL%);
Write("Reset FlexRay CC on channel %d.", %CHANNEL%);
}

Example II

In order to prevent the suspension during the call of ResetFlexRayCC the reset can be
executed asynchronously by manipulating the Protocol Operation Control (POC) state
machine of the FlexRay Communication Controller directly.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetFlexRayCCEx

ResetFlexRayCCEx
CAPL Function Overview » FlexRay » ResetFlexRayCCEx

Note

When using the BusDoctor this function is ignored.

The resetting of the FlexRay communication controller takes considerable time (approx.
up to 100 ms). During this time the complete execution of CANoe (including any remaining
bus simulation) is halted/suspended. Also bus events from other busses are not
recognized. Therefore this function should only be used in one channel configurations. For
an alternative functionality see Example II.

Syntax ResetFlexRayCCEx (int channel, int wuChMask, int wuCount, int wuTxIdle, int
wuTxLow, char[] cfg);

Function This function initializes the FlexRay Communication Controller (CC) and generates the
specified wakeup pattern before reintegration in the cluster or the startup.

Parameters channel

FlexRay channel (cluster number)

wuChMask

Channel for the wakeup pattern.


Values:

1 Channel A

2 Channel B

wuCount

Number of repetitions (2 – 63) of the wakeup symbol in a wakeup pattern.

wuTxIdle

This number designates the number of idle bits in a wakeup symbol.

According to protocol specification, this should result in 18 µs.

wuTxLow

This number designates the number of low bits in a wakeup symbol.

According to protocol specification, this should result in 6 µs.

cfg

Character data array.

This is currently not used and is of no importance.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetFlexRayCCEx

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 FlexRay — •

Example I

The following program resets the FlexRay interface of the attached channel and sends a
wakeup (if network is idle), when key ‘w’ is pressed.
on key 'w'
{
int wuChMask = 3; // send wakeup on both channels
int wuCount = 4; // send symbol 2 times (range 2-63)
int wuTxIdle = 180; // idle time of symbol in bit (range 0-255)
int wuTxLow = 60; // low time of symbol in bit (range 0-63)
CHAR cfg[1]; // <cfg> -> not used yet
ResetFlexRayCCEx(%CHANNEL%,wuChMask,wuCount,wuTxIdle,wuTxLow,cfg);
Write("FlexRay CC %d is reseted and sending a wakeup.", %CHANNEL%);
}

Example II

In order to prevent the suspension during the call of ResetFlexRayCCEx the reset can be
executed asynchronously by manipulating the Protocol Operation Control (POC) state
machine of the FlexRay Communication Controller directly.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRError

on FRError
CAPL Function Overview » FlexRay » on FRError

Syntax on FRError

Function The event procedure is called in the event of a general error being detected on the FlexRay
bus.

Parameters —

Selectors Time (data type dword)

The error 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_HWTag

Identifies the type of the FlexRay hardware (data type: DWORD):

0 HW independent

1 Invalid

2 FlexCard Cyclone I

3 BusDoctor

4 FlexCard Cyclone II

5 Vector FlexRay hardware

Write protected!

FR_Code

Identifies the error type (data type: LONG)

-1 Unknown error

0 NO error

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRError

1 FlexCard Overflow

2 POC Error Mode Changed

3 Sync Frames Below Minimum

4 Sync Frame Overflow

5 Clock Correction Failure

6 Parity Error

7 Receive FIFO Overrun

8 Empty FIFO Access

9 Illegal Input Buffer Access

10 Illegal Output Buffer Access

11 Syntax Error

12 Content Error

13 Slot Boundary Violation

14 Transmission Across Boundary Channel A

15 Transmission Across Boundary Channel B

16 Latest Transmit Violation Channel A

17 Latest Transmit Violation Channel B

18 Error Detection on Channel A

19 Error Detection on Channel B

20 Message Handler Constraints Flag Error

21 NIT SENA (Syntax Error during NIT Channel A)

22 NIT SBNA (Slot Boundary Violation during NIT Channel A)

23 NIT SENB (Syntax Error during NIT Channel B)

24 NIT SBNB (Slot Boundary Violation during NIT Channel B)

25 Internal Error Overflow

26 Wrong Frame

27 Bus Guardian Error

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRError

28 CHI Error

29 Error Handling Level Changed

30 Symbol Received

Write protected!

FR_Data0

Contains extended information (data type: DWORD):

Not used.

Write protected!

FR_Data1

Contains extended information (data type: DWORD): Not used as yet.

Write protected!

FR_Data2

Contains extended information (data type: DWORD): Not used as yet.

Write protected!

FR_Data3

Contains extended information (data type: DWORD): Not used as yet.

Write protected!

FR_Data4

Contains extended information (data type: DWORD): Not used as yet.

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 SP2 FlexRay • •

Example

The following program reacts on bus errors 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 FRError
{
getFRErrorName(this.FR_Code, cWriteTextSize2, writeTxt2);
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRError %3d (%-32s) on

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRError

channel %2d with HW Type %2d, Data0 0x%02x, Data1 0x%02x, Data2 0x%02x, Data3
0x%02x, Data4 0x%02x.", getTime(0), this.FR_Code, writeTxt2,
(int)this.MsgChannel, this.FR_HWTag, this.FR_Data0, this.FR_Data1,
this.FR_Data2, this.FR_Data3, this.FR_Data4);
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 getFRErrorName (word code, word nameSize, char name[])
{
int r = -1;
if (code == 0) {
snprintf(name, nameSize, "No Error");
r = code;
} else if (code == 1) {
snprintf(name, nameSize, "FlexCard Overflow");
r = code;
} else if (code == 2) {
snprintf(name, nameSize, "POC Error Mode Change");
r = code;
} else if (code == 3) {
snprintf(name, nameSize, "Sync Frames Below Minimum");
r = code;
} else if (code == 4) {
snprintf(name, nameSize, "Sync Frame Overflow");
r = code;
} else if (code == 5) {
snprintf(name, nameSize, "Clock Correction Failure");
r = code;
} else if (code == 6) {
snprintf(name, nameSize, "Parity Error");
r = code;
} else if (code == 7) {
snprintf(name, nameSize, "Receive FIFO Overrun");
r = code;
} else if (code == 8) {
snprintf(name, nameSize, "Empty FIFO Access");
r = code;
} else if (code == 9) {
snprintf(name, nameSize, "Illegal Input Buffer Access");
r = code;
} else if (code == 10) {
snprintf(name, nameSize, "Illegal Output Buffer Access");
r = code;
} else if (code == 11) {
snprintf(name, nameSize, "Syntax Error");
r = code;
} else if (code == 12) {
snprintf(name, nameSize, "Content Error");
r = code;
} else if (code == 13) {
snprintf(name, nameSize, "Slot Boundary Violation");
r = code;
} else if (code == 14) {
snprintf(name, nameSize, "Transmission Across Boundary A");
r = code;
} else if (code == 15) {
snprintf(name, nameSize, "Transmission Across Boundary B");
r = code;
} else if (code == 16) {
snprintf(name, nameSize, "Latest Transmit Violation A");
r = code;
} else if (code == 17) {
snprintf(name, nameSize, "Latest Transmit Violation B");
r = code;
} else if (code == 18) {
snprintf(name, nameSize, "Error Detection on A");
r = code;
} else if (code == 19) {
snprintf(name, nameSize, "Error Detection on B");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRError

r = code;
} else if (code == 20) {
snprintf(name, nameSize, "Message Handler Constraints Flag Error");
r = code;
} else if (code == 21) {
snprintf(name, nameSize, "NIT SENA");
r = code;
} else if (code == 22) {
snprintf(name, nameSize, "NIT SBNA");
r = code;
} else if (code == 23) {
snprintf(name, nameSize, "NIT SENB");
r = code;
} else if (code == 24) {
snprintf(name, nameSize, "NIT SBNB");
r = code;
} else if (code == 25) {
snprintf(name, nameSize, "Internal Error Overflow");
r = code;
} else if (code == 26) {
snprintf(name, nameSize, "Wrong Frame");
r = code;
} else if (code == 27) {
snprintf(name, nameSize, "Bus Guardian Error");
r = code;
} else if (code == 28) {
snprintf(name, nameSize, "CHI Error");
r = code;
} else if (code == 29) {
snprintf(name, nameSize, "Error Handling Level Changed");
r = code;
} else if (code == 30) {
snprintf(name, nameSize, "Symbol Received");
r = code;
} else {
snprintf(name, nameSize, "Unknown");
r = -1;
}
return r;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

on FRFrame
CAPL Function Overview » FlexRay » on FRFrame

Note

This event procedure is only used for the reception of valid frames.

To receive null frames and erroneous frames, please use the on FRNullFrame or on on
FRFrameError event procedures.

Syntax on FRFrame *

This procedure is always called when the frame definitions below do not apply. This means
that for a certain frame either this function or one of the functions below is called.

on FRFrame <frame name>

Uses a symbolic frame name from the database.

on FRFrame (<slot ID>, <base cycle>, <cycle repetition>)

This function is only called for a frame in a certain slot.


This event procedure is called after a frame in the slot <slot ID> - in a cycle that
corresponds to the Cycle Multiplexing - has been received. Potentially frames from the <z>
cycles are received that conform to the following formula:

<z> modulo <cycle repetition> = <base cycle>.

Function This event procedure is called after a valid data frame has been received in the specified
slot and cycle.

If two valid data frames are received in the according slot (on channel A and on B) then the
event procedure is called up twice (once for each frame).

An optional channel parameter for event filtering can be assigned to all handlers:

Example I

In this example, the event procedure is only called for frames whose application
channel is 2 and its ID is 5.
on FRFrame MsgChannel2.(5,0,1)

An optional qualifier can be used to assign the handler to a specific network:

Example II

In this example, the event procedure is only called for specific frames from the
application channel that is named "network" in the simulation setup (only
available for CANoe).
on FRFrame network.<frame name>

Parameters *

Specifies the default procedure. This procedure is called up on all received frames for which
no explicit event procedure exists.

<frame name>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

String that corresponds to a frame name of the database.


The necessary parameters <slot ID>, <base cycle>, and <cycle repetition> are taken from
the corresponding frame definition of the database.

<slot ID>

This number describes a certain slot.


Value range: 1...2047.

<base cycle>

This number describes the base cycle.


This value must be less than the repetition factor and be in the following range: 0...63.
This value, together with the repetition factor, determines the Cycle Multiplexing.

<cycle repetition>

This number describes the cycle repetition factor.


The value has to be between 1 and 64 and has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).
This value, together with the base cycle, determines the Cycle Multiplexing.

Selectors Time

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel or PC system clock).
The time stamp must be used if time relations should be regarded with events from other
sources.

Info

The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

Timer unit: 10 microseconds, data type: dword

Write protected!

Time_ns

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel 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 frame.

Timer unit: nanoseconds, data type: int64

Write protected!

MsgChannel

The application channel that the FlexRay interface determines, which received the frame.

Write protected!

FR_ChannelMask

Identifies the FlexRay channel of the CC. With 1 the frame was received on channel A, with
2 on channel B.

Write protected!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

FR_SlotID

The frame was received in this slot.

Write protected!

FR_Cycle

The frame was received in this cycle.

Write protected!

FR_PayloadLength

Length of the present payload in 16 Bit words (data type: word).

Write protected!

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index), <signal name>

Direct access to the payload/data of the frame.


The number of valid data bytes is specified by the selector FR_PayloadLength.
The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

If the event procedure was initialized via a symbolic name from the database, signal names
can also be used directly as selectors for the data range. The raw value of the signal is
retrieved. The physical value can be retrieved by <signal name>.Phys.

Write protected!

FR_Flags

Provides more detailed status information from the frame header, if necessary.
Possible values:

Bit mask Meaning


0x1 Null frame

0x2 Payload valid = msg contains valid data

0x4 Frame set the sync bit.

0x8 Frame set the startup bit.

0x10 Frame set the payload preamble bit.

0x20 Frame set the reserved bit.

0x40 Frame is faulty.

0x80 —

0x100 —

0x200 Only with TX frames: The TX cycle is not the expected one.

0x400 Only with TX frames: An update has overwritten a preceding update.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

0x800 Only with TX frames: New data was sent.

0x1000 —

0x2000 —

0x4000 The frame was sent/simulated.

0x8000 The frame was received in asynchronous mode.

0x10000 —

0x20000 —

0x40000 —

0x80000 —

0x100000 Frame is part of the dynamic segment.

0x400000 —

All other bits of the flags are reserved.

Write protected!

FR_HeaderCRC

Retrieves the CRC in the header of the frame received.

Write protected!

FR_Segment

Identifies the segment that this frame is assigned to.

Value Meaning
0 Frame belongs to the static segment

1 Frame belongs to the dynamic segment

Write protected!

FR_Status

Additional status information about the reception buffer of the CC.

Caution

The value is hardware dependant according to the selected interface type. The
selected interface type can be determined by calling FRGetConfiguration.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

Bit VN FlexCard FlexCard Cyclone BusDoctor


mask Cyclone II
0x0001 Syntax Error Syntax Error TX Conflict (TXCON) Decoding Error
(SERR) (SERR) (CODERR)

0x0002 Content Error Content Error Boundary Violation TSS Violation


(CERR) (CERR) (BVIOL) Error (TSSVIOL)

0x0004 Slot Boundary Slot Boundary Content Error (CERR) Header CRC Error
Violation (BVIOL) Violation (HCRCERR)
(BVIOL)

0x0008 Empty Slot Empty Slot Syntax Error (SERR) Frame CRC Error
(SLEMPTY) (SLEMPTY) (FCRCERR)

0x0010 Message Lost Message Lost Startup Frame Frame End


(MLOST) (MLOST) Indication (SUPF) Sequence Error
(FESERR)

0x0020 Valid Frame (VAL) Valid Frame NULL Frame Symbol (SYMB)
(VAL) Indication (NULLF,
NF)

0x0040 TX Conflict Hdr — SYNC Frame Valid Frame


(TXCON) Indication (SYNCF, SF) (VAL)

0x0080 Framing Error — Valid Communication Boundary


(FrmERR) Element (VCE) Violation Error
(MASB)

0x0100 Header CRC Error — — NIT Violation


(HdrERR) Error (NITVIOL)

0x0200 Frame CRC Error — — Symbol Window


(FrmCRC) Violation Error
(SWVIOL)

0x0400 — — — Slot Overbooked


Error (SOVERR)

0x0800 TX Conflict — — Null Frame Error


(TXCONFLICT) (INFE)

Due to the bus


physics a
transmission
conflict is not
detected in any
case.

Available from
CANoe 7.2.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

0x1000 — — — Syncframe or Start-up


Error (ISFE)

0x2000 — — — Frame ID Error (FIDE)

0x4000 — — — Cycle Counter Error


(CCE)

0x8000 — — — Static Payload Length


Error (PLSE)

All other bits of the status are reserved.

Write protected!

DIR

Transmission direction of the message.

Value Meaning
TX Message was sent by this node.

RX Message was received by this node.

TXRequest Transmit request

Write protected!

SIMULATED

This flag indicates whether the message was simulated.

Value Meaning
0 Not simulated

1 Simulated

Write protected!

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 SP2 FlexRay • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrame

Example

The following program reacts on received frames and prints them in the Write window.
variables
{
const int cWriteTextSize = 512;
char writeTxt[cWriteTextSize];
}
float getTime (float time)
{
// convert NS to SEC:
return time / 1000000000.0;
}
void myprint(char text[])
{
write("%s", text);
}
on FRFrame *
{
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRFrame in slot %2d in
cycle %2d on channel %2d with mask %d with Type %2d, Flags 0x%02x, Status
0x%02x, Simulated %d.", getTime(messageTimeNS(this)), this.FR_SlotID,
this.FR_Cycle, (int)this.MsgChannel, this.FR_ChannelMask, this.Type,
this.FR_Flags, this.FR_Status, this.Simulated);
myprint(writeTxt);
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrameError

on FRFrameError
CAPL Function Overview » FlexRay » on FRFrameError

Syntax on FRFrameError *

This procedure is always called whenever the frame definitions below do NOT occur. In
other words, for a specific frame, only this function or the formats below will be called!

on FRFrameError <frame name>

Uses a symbolic frame name from the database.

on FRFrameError (<slot ID>, <base cycle>, <cycle repetition>)

This function is only called for an erroneous frame in a specific slot.

This event procedure is called after a frame has been received in slot <slot ID> and a cycle
corresponding to the Cycle Multiplexing has been received erroneously. Potential frames are
received from the <z> cycles that conform to the following formula:

<z> modulo <cycle repetition> = <base cycle>

Function The event procedure is called if an erroneous frame is received in the specified slot and
cycle.

If two erroneous frames are received in the corresponding slot (on channel A and on B), then
the event procedure is called twice (once for each frame).

An optional channel parameter for event filtering can be assigned to all handlers:

Example I

In this example, the event procedure is only called for erroneous frames whose
application channel is 2 and its ID is 5.
on FRFrameError MsgChannel2.(5,0,1)

An optional qualifier can be used to assign the handler to a specific network:

Example II

In this example, the event procedure is only called for erroneous frames from
the application channel that is named "network" in the simulation setup (only
available for CANoe).
on FRFrameError network.<frame name>

Parameters *

Specifies the default procedure. This procedure is called for all received erroneous frames
for which there is no explicit event procedure.

<frame name>

Character string corresponding to a frame name from the database.

The required parameters (<slot ID>, <base cycle> and <cycle repetition>) are taken from
the corresponding frame definition in the database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRFrameError

<slot ID>

This number designates a specific slot.


Its value must be between 1 and 2047.

<base cycle>

This number designates the base cycle.


This value must be smaller than the repetition factor and lie in the range between 0 and 63.
This value, together with the repetition factor, determines the Cycle Multiplexing.

<cycle repetition>

This number designates the cycle repetition factor.


The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or 64).
This value, together with the base cycle, determines the Cycle Multiplexing.

Selectors The same selectors as for on FRFrame can be applied.

All selectors are write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 SP2 FlexRay • •

Example

The following program reacts on frame errors and prints them in the Write window.
variables
{
const int cWriteTextSize = 512;
char writeTxt[cWriteTextSize];
}
float getTime (float time)
{
return time / 1000000000.0;
}
void myprint(char text[])
{
write("%s", text);
}
on FRFrameError *
{
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRFrameError in slot %2d in
cycle %2d on channel %2d with mask %d with Type %2d, Flags 0x%02x, Status
0x%02x, Simulated %d.", getTime(messageTimeNS(this)), this.FR_SlotID,
this.FR_Cycle, (int)this.MsgChannel, this.FR_ChannelMask, this.Type,
this.FR_Flags, this.FR_Status, this.Simulated);
myprint(writeTxt);
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRNullFrame

on FRNullFrame
CAPL Function Overview » FlexRay » on FRNullFrame

Syntax on FRNullFrame *

This procedure is always called whenever the frame definitions below do NOT occur. In
other words, for a specific frame, only this function or the formats below will be called!

on FRNullFrame <frame name>

Uses a symbolic frame name from the database.

on FRNullFrame (<slot ID>, <base cycle>, <cycle repetition>)

This function is only called for a null frame in a specific slot.

This event procedure is called after a frame has been received in slot <slot ID> along with a
cycle corresponding to the Cycle Multiplexing. Potential frames are received from the <z>
cycles that conform to the following formula:

<z> modulo <cycle repetition> = <base cycle>

Function The event procedure is called if a null frame is received in the specified slot and cycle.

If two null frames are received in the corresponding slot (on Channel A and on B), then the
event procedure is called twice (once for each frame).

An optional channel parameter for event filtering can be assigned to all handlers:

Example I

In this example, the event procedure is only called for Null frames whose
application channel is 2 and its ID is 5.
on FRNullFrame MsgChannel2.(5,0,1)

An optional qualifier can be used to assign the handler to a specific network:

Example II

In this example, the event procedure is only called for specific Null frames from
the application channel that is named "network" in the simulation setup (only
available for CANoe).
on FRNullFrame network.<frame name>

Parameters *

Specifies the default procedure.

This procedure is called for all received null frames for which there is no explicit event
procedure.

<frame name>

Character string corresponding to a frame name from the database.


The required parameters <slot ID>, <base cycle>, and <cycle repetition> are taken from
the corresponding frame definition in the database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRNullFrame

<slot ID>

This number designates a specific slot.


Its value must be between 1 and 2047.

<base cycle>

This number designates the base cycle.


This value must be smaller than the repetition factor and lie in the range between 0 and 63.
This value, together with the repetition factor, determines the Cycle Multiplexing.

<cycle repetition>

This number designates the cycle repetition factor.


The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or 64).
This value, together with the base cycle, determines the Cycle Multiplexing.

Selectors The same selectors as for on FRFrame can be applied.

All selectors are write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 SP2 FlexRay • •

Example

The following program reacts on Null frames and prints them in the Write window.
variables
{
const int cWriteTextSize = 512;
char writeTxt[cWriteTextSize];
}
float getTime (float time)
{
return time / 1000000000.0;
}
void myprint(char text[])
{
write("%s", text);
}
on FRNullFrame *
{
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRNullFrame in slot %2d in
cycle %2d on channel %2d with mask %d with Type %2d, Flags 0x%02x, Status
0x%02x, Simulated %d.", getTime(messageTimeNS(this)), this.FR_SlotID,
this.FR_Cycle, (int)this.MsgChannel, this.FR_ChannelMask, this.Type,
this.FR_Flags, this.FR_Status, this.Simulated);
myprint(writeTxt);
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FrPDU

on FrPDU
CAPL Function Overview » FlexRay » on FrPDU

Syntax on FrPDU <PDU name>

This handler is called on reception of the symbolically defined PDU.

on FrPDU *

This procedure is always called when the PDU definition above does not apply. This means
that for a certain PDU either this function or the function above is called.

Caution

The asterisk form is allowed only in the analysis branch in order to forward the
received PDU event to the next CAPL program by calling "output(this);".

The PDUs that are handled by this event procedure cannot be distinguished,
because there does not exists any unique selector.

Function This procedure is called when a PDU with the corresponding name is received.

on FrPDU <ID> is not allowed!

An optional channel parameter for event filtering can be assigned to all handlers:

Example I

In this example, the event procedure is only called for PDUs whose application
channel is 2 and its name is <PDU name>.
on FrPDU MsgChannel2.<PDU name>

An optional qualifier can be used to assign the handler to a specific network:

Example II

In this example, the event procedure is only called for specific PDUs from the
application channel that is named "network" in the simulation setup (only
available for CANoe).
on FrPDU network.<PDU name>

Selectors Time (data type dword)


Time_ns (data type int64)

The RX time stamp that has been synchronized with the global time base in the PC
(hardware synchronization's reference channel or PC system clock).
The time stamp must be used, if time relations should be regarded with events from other
sources. The time stamp (Time_ns) is also output in the Trace window when receiving a
frame.

Timer unit: 10 microseconds.


NS timer unit: nanoseconds.

Note: The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

Write protected!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FrPDU

UpdateBit

The flag contains the current value of the update bit. The configuration of the PDU behavior
must be taken into consideration here (see Options).

Write protected!

MsgChannel

The application channel that the FlexRay interface determines, which received the PDU.

Write protected!

FR_ChannelMask

Identifies the FlexRay channel of the CC. With 1 the PDU's frame was received on channel A,
with 2 on channel B.

Write protected!

FR_SlotID

The PDU's frame was received in this slot.

Write protected!

FR_Cycle

The PDU was received in this cycle.

Write protected!

FR_PayloadLength

Length of the present payload in bytes (data type: word).

Write protected!

byte(index), word(index), dword(index), qword(index), char(index), int(index),


long(index), int64(index), <signal name>

Direct access to the payload/data of the PDU.


The number of valid data bytes is specified by the selector FR_PayloadLength.
The index is always byte-oriented and counted from 0. Thus, dword(1) returns the double
word from bytes 1...4 and not from bytes 4...7.

If the event procedure was initialized via a symbolic name from the database, signal names
can also be used directly as selectors for the data range. The raw value of the signal is
retrieved. The physical value can be retrieved by <signal name>.Phys.

Write protected!

FR_Flags

Provides more detailed status information from the frame header, if necessary.
Possible values:

Bit mask Meaning

0x1 —

0x2 Payload valid = msg contains valid data

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FrPDU

0x4 —

0x8 —

0x10 —

0x20 —

0x40 —

0x80 —

0x100 —

0x200 —

0x400 —

0x800 —

0x1000 —

0x2000 —

0x4000 The PDU was sent/simulated.

0x8000 The PDU was received in asynchronous mode.

0x10000 It is a PDU!

0x20000 PDU Update Bit

0x40000 —

0x80000 —

0x100000 PDU is part of the dynamic segment.

0x400000 PDU has an Update Bit.

All other bits of the flags are reserved.

Write protected!

FR_HeaderCRC

Retrieves the CRC in the header of the frame received.

Write protected!

FR_Segment

Identifies the segment that this frame is assigned to.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FrPDU

Value Meaning
0 PDU belongs to the static segment

1 PDU belongs to the dynamic segment

Write protected!

FR_Status

Additional status information about the frame's reception buffer of the CC. See on FRFrame.

Write protected!

DIR

Transmission direction of the message.

Value Meaning
TX Message was sent by this node.

RX Message was received by this node.

TXRequest Transmit request

Write protected!

SIMULATED

This flag indicates whether the message was simulated.

Value Meaning
0 Not simulated

1 Simulated

Write protected!

FR_Payload

This selector allows the access of the payload array (for using as a byte array parameter in
functions).

Available from CANoe 7.2.

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 FlexRay • •

Example

The following program reacts on PDUs and prints them in the Write window.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FrPDU

on FRPDU PDU_XY // PDU_XY name from FIBEX database


{
float var;
write( "%10.6f: PDU PDU_XY received with update bit = %d!",
TimeNowNS()/1000000000.0, this.updateBit);
var = this.signalname;
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRPOCState

on FRPOCState
CAPL Function Overview » FlexRay » on FRPOCState

Syntax on FRPOCState

Function The event procedure is called whenever there is a change of state on the FlexRay
Communication Controller's protocol operation state machine.

Parameters —

Selectors Time (data type dword)


Time_ns (data type int64)

The transition 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.

Timer unit: 10 microseconds.


NS timer unit: nanoseconds.

Note: The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

Write protected!

MsgChannel

Channel in the tool that the FlexRay CC determines.

Write protected!

FR_POCState

The POC state of the E-Ray and the cold-start helper CC can be changed with the function
FrSetPocState (only valid for the Vector VN interfaces). If the desired POC-state is reached,
then this event is generated.

Identifies the new state of the POC state machine (data type LONG):

E-Ray Coldstart helper POC state

-2 254 SYNC LOST

-1 255 UNKNOWN

0 256 DEFAULT CONFIG

1 257 READY

2 258 NORMAL ACTIVE

3 259 NORMAL PASSIVE

4 260 HALT

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRPOCState

5 261 MONITOR MODE

15 262 CONFIG

16 263 WAKEUP STANDBY

17 264 WAKEUP LISTEN

18 265 WAKEUP SEND

19 266 WAKEUP DETECT

32 267 STARTUP PREPARE

33 268 COLDSTART LISTEN

34 269 COLDSTART COLLISION RESOLUTION

35 270 COLDSTART CONSISTENCY CHECK

36 271 COLDSTART GAP

37 272 COLDSTART JOIN

38 273 INTEGRATION COLDSTART CHECK

39 274 INTEGRATION LISTEN

40 275 INTEGRATION CONSISTENCY CHECK

41 276 INITIALIZE SCHEDULE

42 277 ABORT STARTUP

100 — RESERVED FOR INTERNAL USE

Write protected!

Type

Identifies the FlexRay hardware type (data type: DWORD)

0 HW Independent

1 Invalid

2 FlexCard Cyclone I

3 BusDoctor

4 FlexCard Cyclone II

5 VN

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRPOCState

6 Reserved for internal use

Write protected!

FR_Info1

Contains extended information (data type: DWORD):

If Type == 1:

0 Interface is synchronized, but passive

1 Interface is synchronized and active

2 Interface is not synchronized

3 Unknown

Write protected!

FR_Info2

Contains extended information (data type: DWORD):

0 WAKEUP UNDEFINED

1 WAKEUP RECEIVED HEADER

2 WAKEUP RECEIVED WUP

3 WAKEUP COLLISION HEADER

4 WAKEUP COLLISION WUP

5 WAKEUP COLLISION UNKNOWN

6 WAKEUP TRANSMITTED

7 WAKEUP RECEIVED (Only with VN interfaces)

16 WUP DETECTED (Only with VN interfaces)

Write protected!

FR_Info3

Contains extended information (data type: DWORD): Not used as yet.

Write protected!

FR_Info4

Contains extended information (data type: DWORD).

FR_POCState is set to -1 and FR_Info4 is set to 1, when the trigger input of the VN

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRPOCState

interface has recognized an appropriate edge.

Write protected!

FR_Cycle

Current FlexRay cycle number.

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 SP2 FlexRay • •

Example

The following program reacts on Protocol Operation Control state changes in the FlexRay
interface 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;
int gClusterIsAsync = -1;
}

on FRPocState
{
getPOCStateName(this.FR_POCState, cWriteTextSize2, writeTxt2);
snprintf(writeTxt, cWriteTextSize, "%10.6f: on FRPOCState %2d (%-32s) in
cycle %3d on channel %2d with HW Type %2d, Info1 0x%02x, Info2 0x%02x, Info3
0x%02x, Info4 0x%02x.", getTime(0), this.FR_POCState, writeTxt2,
this.FR_Cycle, (int)this.MsgChannel, this.Type, this.FR_Info1, this.FR_Info2,
this.FR_Info3, this.FR_Info4);
myprint(writeTxt);
output(this); // only required in measurement setup
if ((this.FR_POCState != -1) && (this.FR_POCState < 100)) {
if (((gClusterIsAsync == -1) || (gClusterIsAsync == 0)) &&
((this.FR_POCState == 4) || (this.FR_POCState == -2))) {
gClusterIsAsync = 1;
write("gClusterIsAsync = 1");
}
if (((gClusterIsAsync == -1) || (gClusterIsAsync == 1)) &&
(this.FR_POCState == 2)) {
gClusterIsAsync = 0;
write("gClusterIsAsync = 0");
}
}
}

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 getPOCStateName (int state, word nameSize, char name[])


{
int r = -1;
if (state == -2) {
snprintf(name, nameSize, "Synchronization Lost");
r = state;
} else if (state == 0x00) {

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRPOCState

snprintf(name, nameSize, "Default Config");


r = state;
} else if (state == 0x01) {
snprintf(name, nameSize, "Ready");
r = state;
} else if (state == 0x02) {
snprintf(name, nameSize, "Normal Active");
r = state;
} else if (state == 0x03) {
snprintf(name, nameSize, "Normal Passive");
r = state;
} else if (state == 0x04) {
snprintf(name, nameSize, "Halt");
r = state;
} else if (state == 0x05) {
snprintf(name, nameSize, "Monitor Mode");
r = state;
} else if (state == 0x0f) {
snprintf(name, nameSize, "Config");
r = state;
} else if (state == 0x10) {
snprintf(name, nameSize, "Wakeup Standby");
r = state;
} else if (state == 0x11) {
snprintf(name, nameSize, "Wakeup Listen");
r = state;
} else if (state == 0x12) {
snprintf(name, nameSize, "Wakeup Send");
r = state;
} else if (state == 0x13) {
snprintf(name, nameSize, "Wakeup Detect");
r = state;
} else if (state == 0x20) {
snprintf(name, nameSize, "Startup Prepare");
r = state;
} else if (state == 0x21) {
snprintf(name, nameSize, "Coldstart Listen");
r = state;
} else if (state == 0x22) {
snprintf(name, nameSize, "Coldstart Collision Resolution");
r = state;
} else if (state == 0x23) {
snprintf(name, nameSize, "Coldstart Consistency Check");
r = state;
} else if (state == 0x24) {
snprintf(name, nameSize, "Coldstart Gap");
r = state;
} else if (state == 0x25) {
snprintf(name, nameSize, "Coldstart Join");
r = state;
} else if (state == 0x26) {
snprintf(name, nameSize, "Integration Coldstart Check");
r = state;
} else if (state == 0x27) {
snprintf(name, nameSize, "Integration Listen");
r = state;
} else if (state == 0x28) {
snprintf(name, nameSize, "Integration Consistency Check");
r = state;
} else if (state == 0x29) {
snprintf(name, nameSize, "Initialize Schedule");
r = state;
} else if (state == 0x2a) {
snprintf(name, nameSize, "Abort Startup");
r = state;
} else if (state == 0x2b) {
snprintf(name, nameSize, "Startup Success");
r = state;
} else {
snprintf(name, nameSize, "Unknown");
r = -1;
}
return r;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

on FRSlot
CAPL Function Overview » FlexRay » on FRSlot

Syntax on FRSlot *

This procedure is always called if the slot definition as described below not apply. This
means that for a certain slot either this function or the form below is called.

It is strongly recommended to use the concrete on FRSlot callback or the on FrFrame


callback because this general callback produces a high system load.

on FRSlot <slot ID>

This function is only called for a certain slot.

on FRSlot signalname

This function is only called for the slot containing the signal indicated.

on FRSlot (signalname1 | signalname2 | ...)

This function is called for any slot containing one of the signals indicated.

on FRSlot (signalname1, signalname2 , ...)

This function is called for the last slot in the cycle among those slots containing one of the
signals indicated.

All signals in the list must belong to either the static segment of a cycle or to the same
message on the dynamic segment of a cycle.

Function This event procedure is called up in each cycle after the slot is past. The event procedure is
only called for slots in the static segment.

The event procedure is also called up if no frame is received in the specified slot.

Thus it will synchronously be executed to the FlexRay cycle. Therefore it cannot be used in
the measurement setup or the analysis branch.

If any frame is not received in the slot, then the event procedure is called with the next slot
that contains a frame or at the latest when the next cycle begins. For the VN interfaces it
will be called approx. 500 microseconds after the slot.

If two frames are received in slot <slot ID> (on channel A and B), then the event procedure
is called up just once (and in fact, with the frame contents of channel A).

The selectors always reference the contents of the Slot. The FrameType selector should be
evaluated before further processing.

Value range for n: 1 <= <slot ID> <= max. static slot ID of the cluster configuration.

An optional channel parameter for event filtering can be assigned to all functions.

Example

In the example, the event procedure is only called for frames whose FlexRay
channel 2 ID is 35.
on FrSlot MsgChannel2.35

Parameters *

Specifies the default procedure. This procedure is called for all slots for which no explicit

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

event procedure exists.

<slot ID>

This number describes a certain slot. The value must be in the following range: 1 to
<maximum static slot ID>.

signalname

Signal name

Selectors Time (data type dword)


Time_ns (data type int64)

The Slot N 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 frame in Slot
n.

Timer unit: 10 microseconds.


NS timer unit: nanoseconds.

Note: The Time selector is not available when executing CAPL programs directly on an
interface hardware (CAPL on Board).

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 frame was received on channel A, with
2 on channel B. If a frame is received on each channel, the only the frame from channel A is
returned.

Write protected!

FR_SlotID

Always contains the n value.

Write protected!

FR_Cycle

Current FlexRay cycle number.

Write protected!

Type

Identifies the type of frame (=data type: int) and whether a frame has even been received.
Possible values:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

Normal=1 A valid data frame was received.

Error=-1 A faulty frame was received.

Null=0 An empty (null) data frame was received.

Empty=-2 No frame was received.

Important:

If no frame is received in the specified slot, the contents of the ChannelMask,


PayloadLength, msg, Flags, HeaderCRC, Status, DIR and SIMULATED selectors are invalid!

Write protected!

FR_PayloadLength

Length of the presented payload in 16Bit words (=data type: word).

Write protected!

msg

Payload of the message.


The number of valid databytes is specified by the PayloadLength. Direct access to the data
is not possible. It takes place via byte(index), word(index) or dword(index), whereby index
is always byte-oriented and counted from 0. Thus, dword(1) returns the double word from
bytes 1...4 and not from bytes 4...7.

Write protected!

FR_Flags

Provides more detailed status information from the frame header, if necessary.
Possible values:

Bit mask Meaning

0x1 Null frame

0x2 Payload valid = msg contains valid data

0x4 Frame set the sync bit.

0x8 Frame set the startup bit.

0x10 Frame set the payload preamble bit.

0x20 Frame set the reserved bit.

0x40 Frame is faulty.

0x80 The data of the redundant frame is inconsistent on both channels.

0x100 The frame is a dummy frame and was not received by the bus.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

0x200 Only with TX frames: The Tx cycle is not the expected one.

0x400 Only with TX frames: An update has overwritten a preceding update.

0x800 Only with TX frames: New data was sent.

0x1000 —

0x2000 —

0x4000 The frame was sent/simulated.

0x8000 The frame was received in asynchronous mode.

0x10000 It is a PDU!

0x20000 PDU RX Update Bit

0x40000 PDU TX Update Bit

0x80000 If PDUs are received, this bit indicates a normal frame!

0x100000 Frame is part of the dynamic segment.

Write protected!

FR_HeaderCRC

Delivers the CRC in the header of the frame received.

Write protected!

FR_Segment

This selector always returns Static since this event procedure is only permissible for static
slots.
Possible values:

Static=0 Frame belongs to the status segment

Dynamic=1 Frame belongs to the dynamic segment

Write protected!

FR_Status

Delivers additional status information about the reception buffer of the CC, if necessary.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

Bit mask Label Meaning


0x800 TxConflict Only with TX frames: Will be set if there already exists a frame in
that slot and cycle. Due to the bus physics a transmission conflict
is not detected in any case.

This bit will only be set from the VN interface.

Available from CANoe 7.2.

All other bits of the status are reserved.

Write protected!

DIR (byte data type)

Transmission direction of the message.


Possible values:

TX Message was send by the hardware.

RX Message was received.

TXRequest Transmit request

Write protected!

SIMULATED

This flag indicates whether the message was simulated.


Values:

0 Not simulated

1 Simulated

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 SP2 FlexRay — •

Example

The following program executes an action always when the static slot 60 is expired.
on FRSlot 60
{
// slot 60 is over ... do action ...
// Remark: The handler is called even if any frame
// is not received in this slot!
if (this.Type == 1) // valid Frame was received in this slot
{

// Attention: Frame can be from channel A or B.


// If received on both, then only frame from channel A
// will be signaled and retrieved here.
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSlot

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRStartCycle

on FRStartCycle
CAPL Function Overview » FlexRay » on FRStartCycle

Note

This event procedure is not called when using the BusDoctor.

Syntax on FRStartCycle *

This procedure is always called if one of the cycle definitions below does not apply.
This means that for a certain cycle either this function or one of the two functions below is
called.

on FRStartCycle <cycle>

This function is only called for a certain cycle <cycle>.


This procedure must not describe any cycle that has already been described by a procedure
of the form "on FRStartCycle (<base cycle>, <cycle repetition>)".

on FRStartCycle (<base cycle>, <cycle repetition>)

This function is called for all cycles that comply with the defined cycle multiplexing
(FR_Cycle modulo <cycle repetition> = <base cycle>).
this procedure must not describe any cycle that has already been described by a procedure
of the form "on FRStartCycle <cycle>".

Function This event procedure can be generated by FlexRay at the beginning of each communication
cycle and contains the NM vector valid for this cycle.

An optional channel parameter for event filtering can be assigned to all functions.

Example

In the example, the event procedure is only called for the 16 cycles of FlexRay
channel 2.
on FRStartCycle MsgChannel2.16

Parameters *

Specifies the default procedure. This procedure is called on every cycle start for which no
explicit event procedure exists.

<cycle>

This number describes a certain cycle. The value range is 0...63.

<base cycle>

This number describes the base cycle. The value has to be less than the repetition factor;
the value range is 0...63.
Together with the repetition factor this value determines the "Cycle Multiplexing".

<cycle repetition>

This number describes the cycle repetition factor. The value has to be between 1 and 64
and has to be a power of 2 (1, 2, 4, 8, 16, 32 or 64).
Together with the base cycle this value determines the "Cycle Multiplexing".

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRStartCycle

Selectors Time (data type dword)


Time_ns (data type int64)

The StartCycle event 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.

Timer unit: 10 microseconds.


NS timer unit: nanoseconds.

The Time selector is not available when executing CAPL programs directly on an Interface
hardware.

Write protected!

MsgChannel

Channel in the tool that the FlexRay CC determines.

Write protected!

FR_Cycle

Cycle number of the FlexRay cycle beginning herewith.

Write protected!

FR_nmLength

Length of the presented Network Management Vector in bytes.

Write protected!

FR_nmVector

Network Management Vector of the message.


The number of valid data bytes is specified by the nmLength. Direct access to the data is
not possible. It takes place via byte(index), word(index) or dword(index), whereby index is
always byte-oriented and counted from 0. Thus, dword(1) returns the double word from
bytes 1 – 4 and not from bytes 4 – 7.

Write protected!

FR_correctionOffset

Provides the signed correction value for the synchronization offset of the previous cycle.

Permitted maximum value from the FlexRay parameters: pOffsetCorrectionOut

Unit: Microticks

Write protected!

FR_correctionRate

Provides the signed correction value for the synchronization rate of the previous cycle.

Permitted maximum value from the FlexRay parameters: pRateCorrectionOut

Unit: Microticks

Write protected!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRStartCycle

FR_correctionFailedCounter

Indicates the number of continuous previous cycles in which synchronization was not
possible.

Write protected!

FR_passiveToActiveCounter

If the CC is in passive mode, this counter will indicate the number of continuous previous
cycles in which clock synchronization was possible.

Write protected!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 SP2 FlexRay • •

Example

The following program reacts on every start of a cycle and prints info in the Write window.
variables
{
const int cWriteTextSize = 512;
char writeTxt[cWriteTextSize];
}
void myprint(char text[])
{
write("%s", text);
}
float getTime (float time)
{
// convert NS to SEC:
return time / 1000000000.0;
}
on FRStartCycle *
{
snprintf(writeTxt, cWriteTextSize, "%10.6f: SOC %2d on FR%d!",
getTime(messageTimeNS(this)), this.FR_Cycle, this.MsgChannel);
myprint(writeTxt);
output(this); // only required in measurement setup
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSymbol

on FRSymbol
CAPL Function Overview » FlexRay » on FRSymbol

Syntax on FRSymbol

Function The event procedure is called whenever a symbol (wakeup, 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 and with the BusDoctor)

Caution

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

Write protected!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on FRSymbol

FR_Length

Indicates the length (data type: WORD) of the symbol in bit times.

Write protected!

FR_Cycle

Current FlexRay cycle number.

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;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay ISO TP CAPL Functions
(Only available with Option .FlexRay!)

FlexRay ISO TP CAPL Functions


(Only available with Option .FlexRay!)
CAPL Function Overview » FlexRay ISO TP CAPL Functions

The ISO TP node-layer DLL for Vector DENoe.FlexRay implements the transport protocol to allow nodes
simulated by DENoe to interact with hardware nodes attached to a FlexRay network.

A detailed description of the ISO 10681-2 TP for FlexRay and the implemented CAPL functions can be
found in the FlexRayISOTP_Manual.pdf (DOC installation folder).

The following functions are implemented in the DLL and can be called in CAPL programs:

Functions Short description

FrTP_AddConnSlots Slot assignment


FrTP_CopyDataReceived Access to data already received
FrTP_CreateConnUnicast Creation of connections on slots
FrTP_CreatePDUConnUnicast Creation of connections on PDUs
FrTP_DataRequest Data transfer
FrTP_DeleteConn Deletion of connections
FrTP_GetLastReceivedAddresses Retrieving status information
FrTP_GetNodeName Get information about the node and the DLL
FrTP_GetDLLInfo
FrTP_ProvideTxData Provide additional data to transmit
FrTP_ReserveSendSlot Slots for sending
FrTP_ReserveSendSlots
FrTP_ReserveReceiveSlot Slots for reception
FrTP_ReserveReceiveSlots
FrTP_SetAddresses Set addresses
FrTP_Set2ndAddresses
FrTP_SetBandwidthControl Set bandwidth control
FrTP_SetConnMode Set connection mode
FrTP_SetMaxPDULength Set maximum PDU length and fill byte
FrTP_SetFillByte
FrTP_SetBufferSize Set ISO TP parameters
FrTP_SetTimingParams
FrTP_SetVerbosity DLL development support functions
FrTP_SetExpertParam
FrTP_SetRxBufferSize Limit of receive buffer
FrTP_SmallBufferSend Sending data without providing it completely
Callbacks functions Short description

FrTP_ErrorInd Indication of protocol errors


FrTP_ProvideTxDataInd Request additional data to transmit
FrTP_ReceptionInd Reception of data

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FlexRay ISO TP CAPL Functions
(Only available with Option .FlexRay!)

FrTP_RxBufferFullInd Indication of a full receive buffer


FrTP_TxConfirmationInd Indications of the start and end of data
transmissions
FrTP_FirstFrameInd

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANoe IL CAPL Functions

CANoe IL CAPL Functions


CAPL Function Overview » CANoe IL CAPL Functions

The following functions are available with the CANoe Inteaction Layer (CANoe IL):

Setting of Signals Short Description

ILSetSignal Sets the transferred signal to the provided


physical value.

ILSetSignalRaw Sets the transferred signal to the provided raw


value.

ILSetSignalRawField Sets the transferred signal to the provided value.

Test Functions Short Description

ILSetEvent Sends the transferred signal directly to the bus if


the network is active.

ILSetMsgEvent Sends the transferred message directly to the bus


if the network is active.

Controlling of the CANoe IL Short Description

ILControlInit Initialization of CANoe IL.

ILControlResume Cyclical sending restarts.

ILControlSimulationOff Stops the simulation of the IL.

ILControlSimulationOn Starts the simulation of the IL.

ILControlStart Cyclical sending starts; setting signals is now


possible.

ILControlStop Cyclical sending is stopped; setting signals is now


no longer possible.

ILControlWait Cyclical sending is stopped; setting signals is


possible.

NM Control Short Description

ILActivateClamp15 Forwards the appropriate state of clamp 15.

ILDeactivateClamp15

Interpretation of the Return Values of the API Short Description


Functions (Error Codes)

ILErrno Returns the last CANoe IL error code.

ILSetResultString Converts the transferred error code to text.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANoe IL CAPL Functions

Fault Injection Functions Short Description

ILFaultInjectionDisableMsg Prevents all sending of the message except the


sending by calling the function ILSetMsgEvent.

ILFaultInjectionEnableMsg Enables the sending of the message.

ILFaultInjectionResetMsgCycleTime Resets the cycle time of the message to the


database cycle time.

ILFaultInjectionResetAllFaultInjections Reset all fault injection settings.

ILFaultInjectionResetMsgDlc Resets the DLC of the message to the database


DLC.

ILFaultInjectionSetMsgCycleTime Assigns a new cycle time to the message.

ILFaultInjectionSetMsgDlc Assigns a new DLC to the message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILActivateClamp15, ILDeactivateClamp15

ILActivateClamp15, ILDeactivateClamp15
CAPL Function Overview » CANoe IL » ILActivateClamp15, ILDeactivateClamp15

Syntax long ILActivateClamp15();

long ILDeactivateClamp15();

Function Forwards the appropriate state (active/deactive) of clamp 15 to the NM simulation (if
present).
Parameters —

Return values 0: No error

-1: The IL is not initialized properly. The function is ignored.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlInit

ILControlInit
CAPL Function Overview » CANoe IL » ILControlInit

Syntax long ILControlInit ()

Function Initialization of CANoe IL.

This function may only be used in on preStart to prevent the IL autostart function.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILControlResume | ILControlStart | ILControlStop | ILControlWait |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlResume

ILControlResume
CAPL Function Overview » CANoe IL » ILControlResume

Syntax long ILControlResume ()

Function Cyclical sending restarts.

This function may only be used after ILControlWait.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILControlInit | ILControlStart | ILControlStop | ILControlWait |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlSimulationOff

ILControlSimulationOff
CAPL Function Overview » CANoe IL » ILControlSimulationOff

Syntax long ILControlSimulationOff()

Function The simulation of the IL is stopped. After that no other function to control the IL has an
effect to the IL.

To restart the simulation of the IL use ILControlSimulationOn.

Parameters —

Return values 0: No error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILControlSimulationOn |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlSimulationOn

ILControlSimulationOn
CAPL Function Overview » CANoe IL » ILControlSimulationOn

Syntax long ILControlSimulationOn()

Function Start the simulation of the IL. The IL is in the same state as it was before stopping it by
the function ILControlSimulationOff.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILControlSimulationOff |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlStart

ILControlStart
CAPL Function Overview » CANoe IL » ILControlStart

Syntax long ILControlStart ()

Function Cyclical sending starts; setting signals is now possible.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILControlInit | ILControlResume | ILControlStop | ILControlWait |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlStop

ILControlStop
CAPL Function Overview » CANoe IL » ILControlStop

Syntax long ILControlStop()

Function Cyclical sending is stopped; setting signals is now no longer possible.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILControlInit | ILControlResume | ILControlStart | ILControlWait |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILControlWait

ILControlWait
CAPL Function Overview » CANoe IL » ILControlWait

Syntax long ILControlWait()

Function Cyclical sending is stopped; setting signals is possible.

Cyclical sending is continued only after an ILControlResume.

Parameters —

Return values 0: No error.

1: Momentary state of the IL does not permit this query.

50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILControlInit | ILControlResume | ILControlStart | ILControlStop |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILErrno

ILErrno
CAPL Function Overview » CANoe IL » ILErrno

Syntax long ILErrno ()

Function Returns the last CANoe IL error code.

Parameters —

Return values Error Code of the last call.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetResultString |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionDisableMsg

ILFaultInjectionDisableMsg
CAPL Function Overview » CANoe IL » ILFaultInjectionDisableMsg

Syntax long ILFaultInjectionDisableMsg (dbMessage msg)

Function Disables the sending of the message except by calling the function ILSetMsgEvent.

Parameters msg

Message that should be disabled.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILFaultInjectionEnableMsg | ILFaultInjectionResetAllFaultInjections | ILFaultInjectionResetMsgCycleTime |


ILFaultInjectionSetMsgCycleTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionEnableMsg

ILFaultInjectionEnableMsg
CAPL Function Overview » CANoe IL » ILFaultInjectionEnableMsg

Syntax long ILFaultInjectionEnableMsg (dbMessage msg)

Function Enables the sending of the message.

Parameters msg

Message that should be re-enabled after having disabled it with


ILFaultInjectionDisableMsg.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILFaultInjectionResetAllFaultInjections | ILFaultInjectionResetMsgCycleTime | ILFaultInjectionSetMsgCycleTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionResetAllFaultInjections

ILFaultInjectionResetAllFaultInjections
CAPL Function Overview » CANoe IL » ILFaultInjectionResetAllFaultInjections

Syntax long ILFaultInjectionResetAllFaultInjections()

Function Resets the fault injection settings for all messages of the node.

Parameters —

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILFaultInjectionDisableMsg | ILFaultInjectionEnableMsg | ILFaultInjectionResetMsgCycleTime | ILFaultInjectionSetMsgCycleTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionResetMsgCycleTime

ILFaultInjectionResetMsgCycleTime
CAPL Function Overview » CANoe IL » ILFaultInjectionResetMsgCycleTime

Syntax long ILFaultInjectionResetMsgCycleTime(dbMessage msg)

Function Resets the cycle time of the message to the database cycle time, after having
manipulated the cycle time with ILFaultInjectionSetMsgCycleTime.

Parameters msg

Message that should get the database cycle time.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILFaultInjectionDisableMsg | ILFaultInjectionEnableMsg | ILFaultInjectionResetAllFaultInjections |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionResetMsgDlc

ILFaultInjectionResetMsgDlc
CAPL Function Overview » CANoe IL » ILFaultInjectionResetMsgDlc

Syntax long ILFaultInjectionResetMsgDlc (dbMessage msg)

Function Resets the DLC of the message to the database DLC, after having manipulated the DLC
with ILFaultInjectionSetMsgDlc.

Parameters msg

Message that should get the database DLC.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionSetMsgCycleTime

ILFaultInjectionSetMsgCycleTime
CAPL Function Overview » CANoe IL » ILFaultInjectionSetMsgCycleTime

Syntax long ILFaultInjectionSetMsgCycleTime (dbMessage msg, double value)

Function Assigns a new cycle time to the message. To set the cycle time back to its original value,
use ILFaultInjectionResetMsgCycleTime.

Parameters msg

Message that should get a new cycle time.

value

New cycle time of the message in milliseconds.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| ILFaultInjectionDisableMsg | ILFaultInjectionEnableMsg | ILFaultInjectionResetAllFaultInjections |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILFaultInjectionSetMsgDlc

ILFaultInjectionSetMsgDlc
CAPL Function Overview » CANoe IL » ILFaultInjectionSetMsgDlc

Syntax long ILFaultInjectionSetMsgDlc (dbMessage msg, dword dlc)

Function Assigns a new DLC to the message. To set the DLC back to its original value, use
ILFaultInjectionResetMsgDlc.

Parameters msg

Message that should get a new DLC.

dlc

New DLC of the message.

Return values 0: No error.

-1: Momentary state of the IL does not permit this function.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetEvent

ILSetEvent
CAPL Function Overview » CANoe IL » ILSetEvent

Syntax long ILSetEvent (dbSignal sig)

Function Sends the transferred signal directly to the bus if the network is active.

The send model is ignored.

Parameters sig

Signal that should be sent. Specify as follows 'Message::Signal'.

Return values 0: No error.

1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node

-104: General error for invalid calls.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetMsgEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetMsgEvent

ILSetMsgEvent
CAPL Function Overview » CANoe IL » ILSetMsgEvent

Syntax long ILSetMsgEvent (dbMessage msg)

Function Sends the transferred message directly to the bus if the network is active.

The send model is ignored.

Parameters msg

Message that should be sent.

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

-104: General error for invalid calls.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetResultString

ILSetResultString
CAPL Function Overview » CANoe IL » ILSetResultString

Syntax long ILSetResultString (VILResult aResult, char *aText, long aLenText)

Function Converts the transferred error code to text.

Parameters aResult

Return value of a CANoe IL API function.

aText

Char array.

aLenText

Length of the char array.

Return values 0: No error.

-103: Invalid value was passed.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILErrno |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetSignal

ILSetSignal
CAPL Function Overview » CANoe IL » ILSetSignal

Note

If a signal should be set on measurement start and it is not allowed to modify the initial
value of the signal in the database, the function SetSignal has to be used in the on start
procedure instead of the function ILSetSignal.

Syntax long ILSetSignal (dbSignal sig, double value)

Function Sets the transferred signal to the provided physical value.

Parameters sig

Signal that should be set. Specify as follows 'Message::Signal'.

value

Physical value to which the signal should be set.

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

-101: The maximum possible value range was exceeded (no sending on the bus).

-103: Invalid value was passed.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetSignalRaw | ILSetSignalRawField |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetSignalRaw

ILSetSignalRaw
CAPL Function Overview » CANoe IL » ILSetSignalRaw

Syntax long ILSetSignalRaw (dbSignal sig, double value)

Function Sets the transferred signal to the provided raw value.

Parameters sig

Signal that should be set. Specify as follows ’Message::Signal’.

value

Raw value to which the signal should be set.

Return values 0: No error.

1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

-101: The maximum possible value range was exceeded (no sending on the bus).

-103: Invalid value was passed.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetSignal | ILSetSignalRawField |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ILSetSignalRawField

ILSetSignalRawField
CAPL Function Overview » CANoe IL » ILSetSignalRawField

Syntax long ILSetSignalRawField (dbSignal sig, const char *pData, long aDataLen)

Function Sets the transferred signal to the provided value.

Use for integer signals > 32 bit.

Parameters sig

Signal that should be set. Specify as follows 'Message::Signal'.

pData

Byte array, which contains the raw data.

aDataLen

Length of the byte array.

Return values 0: No error.

-1: Momentary state of the IL does not permit this query.

-50: Nodelayer is inactive — possibly deactivated in the node’s configuration dialog.

-100: Signal or message was not found in the database or is not mapped to this node.

-101: The maximum possible value range was exceeded (no sending on the bus).

-103: Invalid value was passed.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

| ILSetSignal | ILSetSignalRaw |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

Diagnostics CAPL Functions


CAPL Function Overview » Diagnostics CAPL Functions

The following diagnostics CAPL functions are available:

Functions for access to the whole object

Functions Short description

DiagGetLastResponse Saves the last response received (for the specified request) in the output
object.

DiagGetLastResponseCode Returns the code of the last received response (for the specified request).

DiagGetNegCode Returns the error code for a KWP2000 mnemonic.

DiagGetObjectName Writes the language dependent name of the diagnostics object into the
buffer.

DiagGetObjectPath Delivers the qualifier path of the object that must be specified upon
generation.

DiagGetPrimitiveData Reads/sets the raw data of the complete service primitive.

DiagGetPrimitiveByte Reads one byte of a diagnostics object.

DiagGetPrimitiveSize Returns the byte length of the object.

DiagGetResponseCode Returns the code of the specified response (for the specified request).

DiagGetRespPrimitiveByte Reads one byte of the response stored for the request.

DiagGetRespPrimitiveSize Returns the byte length of the response stored for the request.

DiagGetSuppressResp Polls the "suppressPosRspMsgIndicationBit" ("suppress positive response


message indication bit").

DiagInitialize Reinitializes the object for the given service or primitive.

DiagInterpretAs Treats the data of the response object as the specified primitive.

DiagInterpretRespAs Treats the data of the request's response as the specified primitive.

DiagIsNegativeResponse Returns value <> 0 if the object is a negative response to a request.

DiagIsPositiveResponse Returns value <> 0 if the object is a positive response to a request.

DiagIsRaw Returns if the object is stored as raw data or can be interpreted.

DiagIsRawResp Returns if the response stored for the request is stored as raw data or can be
interpreted.

DiagResize Adjusts the size of the diagnostics object to the desired number of repetitions
of the complex parameters.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

DiagResize Adapt size of a diagnostics object to match specified parameter iterations, or


set size of bus message to given number of byte.

DiagSetPrimitiveByte Writes one byte of a diagnostics object.

DiagSetRespPrimitiveByte Writes one byte of the response stored for the request.

DiagSetSuppressResp Sets the "suppressPosRspMsgIndicationBit" ("suppress positive response


message indication bit").

Functions for access to one parameter

Functions Short description

DiagGetComplexParameter The behavior of this CAPL function depends on the used parameters.

• Retrieving numeric sub-parameter from a parameter iteration.


• Returns the symbolic value of a complex parameter.

DiagGetComplexParameterRaw Reads/sets the complex parameter to the specified raw value.

DiagGetComplexRespParameter The behavior of this CAPL function depends on the used parameters.

• Returns the value of a numeric complex parameter.


• Returns the symbolic value of a complex parameter.
• Retrieve numeric sub-parameter from a parameter iteration
directly.

DiagGetComplexRespParameterRaw Reads/sets the complex parameter to the specified raw value.

DiagGetParameter The behavior of this CAPL function depends on the used parameters.

• Returns the value of the numeric parameter.


• Returns the symbolic value of the parameter.
• Retrieves numeric parameter directly.

DiagGetParameterName Writes the name of the parameter in the transmitted field.

DiagGetParameterPath Return the qualifier path of the parameter at the given position in
the primitive.

DiagGetParameterSizeCoded Returns the length of the coded parameter.

DiagGetParameterSizeRaw Returns the length of the raw parameter.

DiagGetParameterType Retrieve the qualifier of the parameter's type.

DiagGetParameterUnit Writes the unit of the parameter in the transmitted field.

DiagGetRespParameter The behavior of this CAPL function depends on the used parameters.

• Returns the value of the numeric parameter.


• Returns the symbolic value of the parameter.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

• Retrieves numeric parameter directly.

DiagGetRespParameterRaw Offers access to parameters contained in a received response


object.

DiagIsParameterConstant Returns 1 if the parameter is declared constant in the diagnostics


description.

DiagIsParameterDefault Returns <> 0 if the parameter in the object has its default value.

DiagIsValidValue Returns if the parameter in the response object is valid.

DiagResetParameter Sets the parameter to its default value.

DiagSetComplexParameter Sets one of the sub-parameters within a complex parameter to the


specified (numeric or symbolic) value.

DiagSetParameter The behavior of this CAPL function depends on the used parameters.

• Sets the numeric parameter to the specified value.


• Sets a parameter to the symbolically-specified value.

DiagSetParameterRaw Sets or specifies the value of a (complex) parameter directly via


uncoded data bytes.

Functions for communication and setup

Functions Short description

CANdelaLibCloseChannel Closes the communication channel to the control unit.

DiagGetCommParameter Finds the value of a numeric communication parameter of the interface


that was selected for the description in the configuration dialog.
DiagGetCommParameter
(Only available with Option
FlexRay)
DiagGetP2Extended Returns the "P2 extended" timeout.

DiagGetP2Timeout Returns the time P2 in milliseconds, which is set by the CDD or the
configuration.

DiagGetSendingMode Delivers information about the send mode of the answer.

DiagGetTargetCount Returns the number of possible diagnostics targets configured.

DiagGetTargetQualifier Writes the target qualifier for the diagnostics target.

DiagGetTesterPresentState Returns the state of autonomous/cyclical Tester Present requests from


CANoe to the specified or current ECU.

DiagSendFunctional Send a request to the functional group defined for the current target.

DiagSendPositiveResponse Sends the response object back to the tester. Can only be called in the
ECU simulation.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

DiagSendNegativeResponse Sends a negative response to the tester, whereby the specified value is
transmitted as error code.

DiagSendRequest Sends the request object to the ECU.

DiagSendResponse Sends the response object back to the tester. Can only be called in the
ECU simulation.

DiagSetP2Extended Sets the "P2 extended" timeout to the specified value.

DiagSetP2Timeouts Changes the P2 and P2ex timeout values at the CANdelaLib diagnostics
channel.

DiagSetTarget Sets the ECU with which the tester should communicate from now on.
May not be called in an ECU simulation node.

DiagSetTimeout Specifies the request timeout.

DiagSetTimeoutHandler Sets the timeout callback for a request, or default timeout callback
function.

DiagStartTesterPresent Starts sending autonomous/cyclical Tester Present requests from CANoe


to the specified or current ECU.

DiagStopTesterPresent Stops sending autonomous/cyclical Tester Present requests from CANoe


to the specified or current ECU.

Functions for physical network requests

Functions Short description

DiagGetCurrentEcu Gets the name of the current ECU.

DiagGetPendingRequests Returns the number of unresolved Network Requests.

DiagIsMarked Checks if the ECU is marked.

DiagIsPresent Checks if a response was already received from the ECU.

DiagMarkEcu Marks the specified or current ECU.

DiagSendMarked Sends a request to all marked ECUs.

DiagSendNetwork Sends a Request to all ECUs on this bus.

DiagSetCurrentEcu The specified ECU is made the current ECU.

DiagSetEcuAbsent No more attempt is made to send Network Requests to the specified or current
ECU.

DiagSetEcuPresent Accepts this ECU back into the group of ECUs to be addressed.

DiagSetRequestInterval Sets the interval between network requests in milliseconds.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

DiagUnmarkAllEcus Clears all ECU markings.

DiagUnmarkEcu Clears marking of the specified or current ECU.

Functions to support tests

Functions Short description

DiagCheckObjectMatch Checks if the response is a valid (positive or negative) response for the
request.

DiagCheckValidNegResCode Checks if the given negative response code is defined for the object.

DiagCheckValidPrimitive Checks if the given object matches its specification in the CDD.

DiagCheckValidRespPrimitive Checks if the response received for the request matches its specification
in the CDD.

TestJoinDiagResponseFromEcu Adds an event to the set of joined events.

Events: Arrival of a diagnostics response from a specific or any ECU.

TestReportWriteDiagObject Writes a test step with a textual interpretation of the specified request or
response object into the test report.

TestReportWriteDiagResponse Writes a test step with a textual interpretation of the received response
for the specified request object into the test report.

TestWaitForDiagRequestSent Waits until the previously sent request has been sent to the ECU.

TestWaitForDiagResponse Waits for arrival of the response to the given request.

TestWaitForDiagResponseStart Waits for the arrival of the response to a sent request, e.g. the so-called
"First Frame" in ISO TP transmissions.

Functions for Generic Diagnostics TP Interface

Functions for Generic Diagnostics Short description


TP Interface

To use the CAPL callback interface, you have to implement the following CAPL functions:

_Diag_DataRequest With this function CANoe triggers the CAPL interface to transmit
data.

_Diag_SetChannelParameters This function will be called after measurement start (in ECU
simulations) or after DiagSetTarget() (in test nodes) and enables the
CAPL program to configure the transport protocol.

_Diag_SetupChannelReq With this function the CAPL program of a tester implementation will
be requested to open a channel to the ECU.

Diag_ClosedChannelInd Communicates to CANoe that the communication channel is not


longer available.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

Diag_DataCon Tells the diagnostic layer, via the count parameter, how many
bytes of data were transmitted successfully.

Diag_DataInd Passes count bytes of the transmitter address sender from the
rxBuffer buffer to the diagnostic layer.

Diag_FirstFrameInd Indicates the start of a diagnostics data reception to the diagnostics


layer.

Diag_ErrorInd Reports errors to the diagnostic layer.

Diag_SetDataSegmentation Configures the segmentation of diagnostics data at the


transmission.

Diag_SetupChannelCon Communicates to CANoe, that a communication channel is available


to the communication partner and data can be sent.

DiagGetFunctionalGroupExt Returns the value of the "address extension" byte.

DiagGetFunctionalGroupId Determines the CAN ID on which functional requests are sent by the
diagnostic tester.

DiagGetFunctionalGroupIdMask Determines the CAN ID mask in order to be able to filter out CAN
messages sent by the diagnostic tester as functional requests.

Functions for Variant Identification

Functions Short description

DiagGetIdentifiedVariant Retrieves the qualifier of the variant that has been


identified by the last successful run of the automatic
variant identification algorithm for given target, or the
current target if no target is given.

DiagGetConfiguredVariant Retrieves the qualifier of the variant that is configured


for the current or given target in the Diagnostics
configuration dialog.

DiagStartVariantIdentification Starts the automatic variant identification algorithm for


the given target, or the currently selected one if none is
given.

TestWaitForDiagVariantIdentificationCompleted Waits for the completion of the automatic variant


identification algorithm.

Functions for Diagnostics over IP — DoIP

Info

With the DoIP CAPL API you can simulate a DoIP node or DoIP gateway in CAPL.
For the implementation of a (DoIP) tester the following functions are not stringently necessary.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

Functions Short description

DoIP_AddTester Adds a valid DoIP tester address to the DoIP layer.

DoIP_DataInd Is called from the DoIP layer when new data is received.

DoIP_DataCon Is called from the DoIP layer when data was sent.

DoIP_DataReq Passes data to the DoIP layer.

DoIP_AddECU Adds a valid DoIP ECU address to the DoIP layer.

DoIP_ErrorInd Is called from the DoIP layer when an error occurred.

DoIP_SetAliveCheckTimeout Sets the alive check timeout parameter of the DoIP layer.

DoIP_SetGenericTimeout Sets the generic inactivity timeout parameter of the DoIP layer.

DoIP_SetInitialTimeout Sets the initial inactivity timeout parameter of the DoIP layer.

DoIP_SetTesterUdpPort Sets the UDP port to be used by the DoIP layer.

DoIP_SetVehicleAddress Sets the address to be used by the DoIP layer.

DoIP_SetVehicleInterface Sets the network interface to be used by the DoIP layer.

DoIP_SetVehicleTcpPort Sets the TCP port to be used by the DoIP layer.

DoIP_SetVehicleUdpPort Sets the UDP port to be used by the DoIP layer.

Further functions

Functions Short description

DiagGenerateKeyFromSeed Creates a key to execute secured diagnostics functions within devices.

The following diagnostics event procedures are available:

Event Procedures

Access to the data of the corresponding event is possible in event procedures through this.

The procedures are sub-divided into different events; the first matching event procedure (top-down) is
called.

Response/request events Short description

on diagRequest Is called when a diagnostic request is received in the ECU simulation.

on diagRequestSent Is called when a diagnostics request has been sent by the tester.

on diagResponse Is called when a diagnostic response is received in the tester.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics CAPL Functions

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckObjectMatch

DiagCheckObjectMatch
CAPL Function Overview » Diagnostics » DiagCheckObjectMatch

Syntax long DiagCheckObjectMatch( diagRequest request, diagResponse response);

Method diagRequest.CheckObjectMatch( diagResponse response);

Function Checks if the response is a valid (positive or negative) response for the request.

Parameters request

Diagnostics request

response

Diagnostics response

Return values 1: Objects match.

0: Objects do not match.

Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 Online mode — •

Example
DiagRequest AirbaContr_Read req;
DiagResponse AirbaContr_Read resp;

if( 1 == DiagCheckObjectMatch( req, resp))


write( "Request and response match!");

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckValidNegResCode

DiagCheckValidNegResCode
CAPL Function Overview » Diagnostics » DiagCheckValidNegResCode

Syntax long DiagCheckValidNegResCode( diagRequest obj, DWORD negResCode);

long DiagCheckValidNegResCode( diagResponse obj, DWORD negResCode);

long DiagCheckValidNegResCode( diagResponse obj);

Method diagRequest.CheckValidNegResCode(DWORD negResCode);

diagResponse.CheckValidNegResCode(DWORD negResCode);

diagResponse.CheckValidNegResCode();

Function The functions return 1 if the given negative response code is defined for the object. It
returns 0 if the code is not valid, and <0 for an error.

In the one-argument form, the response object has to be a negative response.

Parameters obj

Diagnostics object to check the response code for.

negResCode

Negative response code like 0x11, "serviceNotSupported" (KWP 2000).

Return values 1: Code is defined for the object in the CDD.

0: Code is not defined for the object in the CDD.

Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagGetResponseCode | DiagGetLastResponseCode | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckValidPrimitive

DiagCheckValidPrimitive
CAPL Function Overview » Diagnostics » DiagCheckValidPrimitive

Syntax long DiagCheckValidPrimitive( diagRequest obj);

long DiagCheckValidPrimitive( diagRequest obj, DWORD reasonOut[]);

long DiagCheckValidPrimitive( diagResponse obj);

long DiagCheckValidPrimitive( diagResponse obj, DWORD reasonOut[]);

long DiagCheckValidPrimitive( diagResponse obj, char primitiveQualifier[]);

long DiagCheckValidPrimitive( diagResponse obj, char primitiveQualifier[],


DWORD reasonOut[]);

Method diagRequest.CheckValidPrimitive();

diagRequest.CheckValidPrimitive(DWORD reasonOut[]);

diagResponse.CheckValidPrimitive();

diagResponse.CheckValidPrimitive(DWORD reasonOut[]);

diagResponse.CheckValidPrimitive(char primitiveQualifier[]);

diagResponse.CheckValidPrimitive(char primitiveQualifier[], DWORD


reasonOut[]);

Function Returns 1 if the response received for the request matches its specification in the
diagnostics description. If a primitive qualifier is given, the definition of that primitive at
the object's service is used as specification.

If the primitive is not valid, 0 is returned and the optional parameter reasonOut[0] is set
to the precise reason why the check failed (see below).

Info

If a primitive is specified, it must be defined for the service the response


currently refers to! Please refer to Diagnostics descriptions with overloaded
responses for details.

Parameters obj

Diagnostics object to check.

reasonOut

Optional output parameter field for fail reason.

primitiveQualifier

Qualifier of the service primitive that should be used as specification.

Return values 1: Primitive matches the specification in the diagnostics description.

0: Primitive does not match its specification. In this case, reasonOut[0] will indicate the
problem:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckValidPrimitive

1 data too long


2 data too short
3 constant overwritten
4 unknown format error
5 illegal parameter value found
<o: Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.2 • Online mode — •


• Not for basic diagnostics

7.1 SP3: form 5 • Online mode — •


and 6
• Not for basic diagnostics

7.0 SP5: methods • Online mode — •


• Not for basic diagnostics

Example
long ConformsToKnownPrimitives( diagResponse * response)
{
if( 1 == response.CheckValidPrimitive( "ServiDefauD")
|| 1 == response.CheckValidPrimitive( "ServiEcu1PR"))
return 1;
return 0;
}

| DiagCheckValidRespPrimitive | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckValidRespPrimitive

DiagCheckValidRespPrimitive
CAPL Function Overview » Diagnostics » DiagCheckValidRespPrimitive

Syntax long DiagCheckValidRespPrimitive( diagRequest obj);

long DiagCheckValidRespPrimitive( diagRequest obj, DWORD reasonOut[]);

long DiagCheckValidRespPrimitive( diagRequest obj, char


primitiveQualifier[]);

long DiagCheckValidRespPrimitive( diagRequest obj, char


primitiveQualifier[], DWORD reasonOut[]);

Method diagRequest.CheckValidRespPrimitive();

diagRequest.CheckValidRespPrimitive(DWORD reasonOut[]);

diagRequest.CheckValidRespPrimitive( char primitiveQualifier[]);

diagRequest.CheckValidRespPrimitive( char primitiveQualifier[], DWORD


reasonOut[]);

Function Returns 1 if the response received for the request matches its specification in the
diagnostics description.

If the primitive is not valid, 0 is returned and the optional parameter reasonOut[0] is set
to the precise reason why the check failed (see below).

Info

If a primitive is specified, it must be defined for the service the response


currently refers to! Please refer to Diagnostics descriptions with overloaded
responses for details.

Parameters obj

Diagnostics object to check.

reasonOut

Optional output parameter field for fail reason.

primitiveQualifier

Qualifier of the service primitive that should be used as specification.

Return values 1: Primitive matches its specification in the diagnostics description.

0: Primitive does not match its specification. In this case, reasonOut[0] will indicate the
problem:

1 data too long


2 data too short
3 constant overwritten
4 unknown format error
5 illegal parameter value found
<0: Error code

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagCheckValidRespPrimitive

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.2 • Online mode — •


• Not for basic diagnostics

7.1 SP3: form 3 • Online mode — •


and 4
• Not for basic diagnostics

Example
if( 1 == request.CheckValidRespPrimitive( "ServiDefauD"))
TestStepPass( "Is default response");
else
TestStepFail( "Not default response");

| DiagCheckValidPrimitive | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_ClosedChannelInd

Diag_ClosedChannelInd
CAPL Function Overview » Diagnostics » Diag_ClosedChannelInd

Syntax long Diag_ClosedChannelInd ();

Function This function communicates to CANoe that the communication channel is not longer
available, e.g. the tester closed the channel or a non reparable error occurred.

The CAPL program first has to call Diag_SetupChannelCon before further data can be sent.

Parameters —

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_DataCon

Diag_DataCon
CAPL Function Overview » Diagnostics » Diag_DataCon

Syntax void Diag_DataCon (long count);

Function Tells the diagnostic layer, via the count parameter, how many bytes of data were
transmitted successfully.

This function is typically called within a transport layer callback. Once the diagnostic
layer has initiated the transmission of a message via _Diag_DataRequest() and the
transport layer has sent this message in its entirety, using several message segments if
needed, the diagnostic layer's transport layer uses this function to indicate that the
message was sent successfully.

Parameters count

Number of bytes transmitted successfully.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Communication Layer Connection / Reference Implementations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_DataInd

Diag_DataInd
CAPL Function Overview » Diagnostics » Diag_DataInd

Syntax void Diag_DataInd (byte rxBuffer [], long count, long sender);

Function Passes count bytes of the transmitter address sender from the rxBuffer buffer to the
diagnostic layer.

This function is typically called in a transport layer callback after a message, which may
be segmented, has been received in its entirety. The transport layer removes all protocol
information (segmentation, flow control, etc.) and forwards only the payload data (e.g.
the ECU's diagnostic response starting at the service ID and including all response
parameters) to the diagnostic layer.

Parameters rxBuffer

Byte buffer to be passed to the diagnostic layer.

sender

Address of the transmitter from which the diagnostic message was received.

count

Number of bytes to be passed.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Communication Layer Connection / Reference Implementations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _Diag_DataRequest

_Diag_DataRequest
CAPL Function Overview » Diagnostics » _Diag_DataRequest

Syntax void _Diag_DataRequest (BYTE data[], DWORD count, long furtherSegments);

Function With this function CANoe triggers the CAPL interface to transmit data.

Parameters data

The data of the diagnostics primitive (byte stream of request or response) that the node
should transmit on the bus. This may be several hundred or thousand bytes, therefore a
suitable transport protocol has to be used here to forward the data.

count

The actual number of bytes to be sent.

furtherSegments

0 This is the last segment of a segmented transmission (see


Diag_SetDataSegmentation), typical value for ISO TP.

1 Further segments follow.

other reserved

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_ErrorInd

Diag_ErrorInd
CAPL Function Overview » Diagnostics » Diag_ErrorInd

Syntax void Diag_ErrorInd( long error);

Function Reports errors to the diagnostic layer.

This function is typically called within a transport layer callback. The transport layer uses
it to report errors to the diagnostic layer.

If, for example, TestWaitForDiagResponse() is used in a test module to wait for receipt of
a response and Diag_ErrorInd() reports an error, the test function returns an error and
stops waiting.

Parameters error

Error number.

This number is valid only in the context of the concrete transport protocol
implementation used. It is recommended to forward error numbers reported by the
protocol layer. For example, the OSEKTL API for the ISO TP on CAN implementation found
in OSEK_TP.DLL reports errors in the callback function OSEKTL_ErrorInd (cf.
DOC/OSEK_TP_E.pdf, section 3.2).

The error number reported here can simply be forwarded to the diagnostics layer:
OSEKTL_ErrorInd( int error)
{
Diag_ErrorInd( error);
}

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Communication Layer Connection / Reference Implementations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_FirstFrameInd

Diag_FirstFrameInd
CAPL Function Overview » Diagnostics » Diag_FirstFrameInd

Syntax void Diag_FirstFrameInd( long source, long target, long length);

Function Indicates the start of a diagnostics data reception to the diagnostics layer.

This function is typically called from a transport layer callback. For example, the ISO TP
protocol on CAN indicates the reception of a "First Frame" to the application.

In the diagnostics layer of a tester, a call to this function will stop the timer started after
the request has been sent, i.e. even a very long data reception will not time out. If the
tester has called TestWaitForDiagResponseStart, that call will now be continued.

Parameters source

Identifies the sender node

target

Identifies the receiver

length

Number of bytes announced

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

The OSEKTL API for the ISO TP on CAN implementation found in OSEK_TP.DLL reports
FirstFrames in the callback function OSEKTL_FirstFrameInd (see OSEK_TP_E.pdf, DOC
installation folder). The arguments can simply be forwarded in this case:
OSEKTL_FirstFrameIndication( long source, long target, long length)
{
Diag_FirstFrameInd(source, target, length);
}

| Communication Layer Connection / Reference Implementations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGenerateKeyFromSeed

DiagGenerateKeyFromSeed
CAPL Function Overview » Diagnostics » DiagGenerateKeyFromSeed

Syntax long DiagGenerateKeyFromSeed ( byte seedArray[], dword seedArraySize, dword


securityLevel, char variant[], char ipOption[], byte keyArray[], dword
maxKeyArraySize, dword& keyActualSize)

Function Creates a key to execute secured diagnostics functions within devices.

The key will be defined with the Seed of the device.

Parameters seedArray

Seed for the definition of the key.

seedArraySize

Number of bytes in the SeedArray.

securityLevel

Security level for which the key will be created.

variant

Variant of the diagnostics description.

ipOption

Further options that will be forwarded to the customer function.

keyArray

Key that is created with the customer DLL.

maxKeyArraySize

The maximum allowed number of bytes in the keyArray.

keyActualSize

Actual used bytes in the keyArray.

Return values At success 0 will be returned, otherwise an error code will be returned.

For further error analyses you can use the callback function _Diag_GetError.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

This example shows schematically the use of DiagGenerateKeyFromSeed and the Callback
function in a CAPL test module.
Variables
{

//actual size of Seed and Key Arrays depend on ECU
byte gSeedArray[2];

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGenerateKeyFromSeed

int gSeedArraySize = 2;
int gSecurityLevel = 0x20;
char gVariant[200] = "Variant1";
char gOption[200] = "option";
byte gKeyArray[255];
int gMaxKeyArraySize = 255;
DWORD gActualSize = 0;
char gDebugBuffer[2000];
diagRequest SecurityAccess::SecuritySeed::Request gSeedReq;
diagResponse SecurityAccess::SecuritySeed::Request gSeedResp;
diagRequest SecurityAccess::SecurityKey::Send gKeyReq;

}
//Unlock ECU by calling customer specific SeedKey DLL (e.g. in a CAPL test
module)
{

//Request seed from ECU
DiagSendRequest(gSeedReq);
//Wait for response and write seed from response parameter to array
TestWaitForDiagResponse(gSeedReq, 1000)
DiagGetLastResponse (gSeedReq, gSeedResp);
DiagGetParameterRaw (gSeedResp, "Seed", gSeedArray, elcount(SeedArray));
//Calculate key
DiagGenerateKeyFromSeed (gSeedArray, gSeedArraySize, gSecurityLevel,
gVariant, gOption, gKeyArray, gMaxKeyArraySize, gActualSize);
//Write result to diagnostic request
DiagSetParameterRaw(gKeyReq, "Key", gKeyArray, gActualSize);
//Send Key to unlock ECU
TestWaitForDiagRequestSent(gKeyReq);

}
//Callback function for error handling (optional)
_Diag_GetError (char buffer[])
{
//called if error in DiagGenerateKeyFromSeed occurs
snprintf(gDebugBuffer,elcount(gDebugBuffer),"%s", buffer);
write("CALLBACK %s", gDebugBuffer);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

DiagGetCommParameter
CAPL Function Overview » Diagnostics » DiagGetCommParameter

Syntax long DiagGetCommParameter (char qualifier[]);

long DiagGetCommParameter( char qualifier[], dword index, char buffer[],


dword size)

Function Finds the value of a numeric communication parameter of the interface that was selected
for the description in the configuration dialog.
Parameter qualifiers are defined in the CDDT and depend on the manufacturer or
concrete template.

Parameters qualifier

The following qualifiers can be used in addition to the CDD interface parameters:

Qualifier Available in Description

CANoe.AddressMode ISO TP address mode:

0: Normal
1: Extended
2: NormalFixed
3: Mixed
<0: No ISO TP

CANoe.TxId [0 1*] CAN Id for transmitted frames

CANoe.RxId [0 1*] CAN Id for received frames

CANoe.BaseAddress [1*] TP base address

CANoe.EcuAddr [1 2 3] Number of this node

CANoe.TgtAddr [1 2 3] Target node number

CANoe.AddrExt [3] Address extension byte

CANoe.TxPrio [2 3] Frame transmit priority

Info

1*: Extended address can be operated on two different types:

• With base address


• With free assignment of the Tx-and Rx-Id

Please note the reference implementation example for more details.

The parameter values are each determined from the viewing angle of the
corresponding node. Therefore, in an ECU simulation with normal addressing,
the TxId represents the RxId, which is included in the tester node.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

Further Qualifier, independent of address mode:

Qualifier Description

CANoe.UudtId If the ECU delivers responses also via UUDT frames,


their CAN-Id can be determined here as well.

CANoe.Blocksize ISO TP parameter, number of consecutive frames


between two flow control frames.

CANoe.STmin ISO TP parameter, minimum interval [ms] between


sent consecutive frames, which the sender should
maintain.

CANoe.FCDelay ISO TP parameter, delay of flow control frames


sent.

Timing Parameter with ISO 15765-3:

CANoe.S3ClientTime Time the diagnostics client (=tester) should wait


before sending a tester present request.
This value is also returned for the deprecated
qualifier CANoe.S3Time.

CANoe.S3ServerTime Timeout in the diagnostics server for leaving a non-


default session.

CANoe.P3TimePhys Minimum waiting time after physical transmitting of


a request.

CANoe.P3TimeFunc Minimum waiting time after functional transmitting


of a request.

CANoe.Padding
Values

-1 No padding (i.e. DLC variable)

0..255 Use this value to pad to DLC=8.

<-1 Normal diagnostics error codes.

rest reserved

CANoe.UseAllFC
Values

0 Use the values of the first flow control frame


only.

1 Use the values from ALL flow control frames.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

CANoe.UseFFPrio
Values

0 Use the Tx priority given.

1 Use the priority of the received "first frame" as


priority of flow control frame.

CANoe.FirstSN 0..15: The sequence number sent in the first


"consecutive frame".

CANoe.BSOff 0..255: Block size value indicating "do not expect


further flow controls".

CANoe.FixedFrameLength 0..8: All CAN frames should have at least this many
bytes.

DoIP.VEHICLE_Interface See DoIP_SetVehicleInterface

DoIP.VEHICLE_Address See DoIP_SetVehicleAddress

DoIP.VEHICLE_LogicalAddress Returns the logical DoIP address of the DoIP entity.

DoIP.VEHICLE_UDP_Data See DoIP_SetVehicleUdpPort

DoIP.VEHICLE_TCP_Data See DoIP_SetVehicleTcpPort

DoIP.TESTER_LogicalAddress Returns the logical DoIP address of the test


equipment.

DoIP.TESTER_UDP_Data See DoIP_SetTesterUdpPort

DoIP.T_TCP_Generic_Inactivity See DoIP_SetGenericTimeout

DoIP.T_TCP_Initial_Inactivity See DoIP_SetInitialTimeout

DoIP.T_TCP_Alive_Check See DoIP_SetAliveCheckTimeout

index

Set to 0.

buffer

Buffer to retrieve string parameters.

size

Size of the buffer in bytes.

Return values Error code or value of the parameter.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

| Connection of the Communication Layer / Reference Implementations | Expanded Functions in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

DiagGetCommParameter
CAPL Function Overview » Diagnostics » DiagGetCommParameter

Note

Only available with Option .FlexRay!

Syntax long DiagGetCommParameter (char qualifier[]);

Function Finds the value of a numeric communication parameter of the interface that was selected
for the description in the configuration dialog.

Parameters qualifier

Parameters for diagnostics on FlexRay. See DiagGetCommParameter for parameters that


are not FlexRay specific.

In the AUTOSAR and OEM add-on packages there is a reference implementation of the
CAPL Callback Interface for Diagnostics. Please call our support for further information:
+49 711 80670-200.

Qualifier Description

FlexRay.Protocol The protocol variant to use.

0 AUTOSAR 2.x
rest reserved for future extensions

FlexRay.AddressType Using one or two byte addresses?

Values

1 One byte addresses

2 Two byte addresses

FlexRay.LocalAddress Address of *this* node, i.e. ECU address in ECU simulation,


tester address in tester nodes.

FlexRay.RemoteAddress Address of the target node, i.e. ECU address in tester nodes,
tester address in ECU simulation.

FlexRay.ConnectionMode Control the usage of flow control frames.

Values

1 Unicast

2 Acknowledged Unicast

3 Acknowledged Unicast with Retry

rest reserved

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

Info

Please refer to the AUTOSAR FlexRay TP


specifiction for details on the parameter value
semantics.

FlexRay.MessageLength Control the TP PDU types used.

Values

1 ISO

2 ISO6

3 L16M

4 L4G

rest reserved

Info

Please refer to the AUTOSAR FlexRay TP


specifiction for details on the parameter value
semantics.

FlexRay.StMin Separation time [ms]

Info

Please refer to the AUTOSAR FlexRay TP


specifiction for details on the parameter value
semantics.

FlexRay.BlockSize Block size

Info

Please refer to the AUTOSAR FlexRay TP


specifiction for details on the parameter value
semantics.

Configuration of send and receive slots/PDUs

Qualifier Description

FlexRay.LocalStartSlot Id of first slot the node sends in

FlexRay.LocalCount Number of consecutive slots to send in

FlexRay.LocalStartCycle First cycle to send slots in

FlexRay.LocalCycleRepetition Cycle spacing to send slots in

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCommParameter

FlexRay.LocalPayloadLen Length of slots to send in

FlexRay.RemoteStartSlot Id of first slot to receive

FlexRay.RemoteCount Number of consecutive slots to receive

FlexRay.RemoteStartCycle First cycle to receive slots in

FlexRay.RemoteCycleRepetition Cycle spacing of slots to receive

FlexRay.RemotePayloadLen Length of slots received

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameter

DiagGetComplexParameter
CAPL Function Overview » Diagnostics » DiagGetComplexParameter

The behavior of this CAPL function depends on the used parameters.

Possible scenarios:

Retrieving numeric sub-parameter

Syntax long DiagGetComplexParameter (diagResponse obj, char parameterName[], DWORD


iteration, char* subParameter, double output[1])

long DiagGetComplexParameter (diagRequest obj, char parameterName[], DWORD


iteration, char* subParameter, double output[1])

double DiagGetComplexParameter (diagResponse obj, char parameterName[],


DWORD iteration, char* subParameter)

double DiagGetComplexParameter (diagRequest obj, char parameterName[],


DWORD iteration, char* subParameter)

long DiagGetComplexParameter (diagResponse obj, long mode, char


parameterName[], DWORD iteration, char* subParameter, double output[1])

long DiagGetComplexParameter (diagRequest obj, long mode, char


parameterName[], DWORD iteration, char* subParameter, double output[1])

double DiagGetComplexParameter (diagResponse obj, long mode, char


parameterName[], DWORD iteration, char* subParameter)

double DiagGetComplexParameter (diagRequest obj, long mode, char


parameterName[], DWORD iteration, char* subParameter)

Method diagResponse.GetComplexParameter (char* parameterName, DWORD iteration,


char subParameter[], double output[1])

diagRequest.GetComplexParameter (char* parameterName, DWORD iteration, char


subParameter[], double output[1])

diagResponse.GetComplexParameter (char parameterName[], DWORD iteration,


char* subParameter)

diagRequest.GetComplexParameter (char parameterName[], DWORD iteration,


char* subParameter)

diagResponse.GetComplexParameter (long mode, char parameterName[], DWORD


iteration, char* subParameter, double output[1])

diagRequest.GetComplexParameter (long mode, char parameterName[], DWORD


iteration, char* subParameter, double output[1])

diagResponse.GetComplexParameter (long mode, char parameterName[], DWORD


iteration, char* subParameter)

diagRequest.GetComplexParameter (long mode, char parameterName[], DWORD


iteration, char subParameter[])

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameter

Function Retrieve numeric sub-parameter from a parameter iteration directly.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

Output

Output field

mode

Access mode

Return values Error code

or value of the parameter or 0.0 if this could not be acquired.

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 • Online mode — •


• Not for basic diagnostics

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example
On diagResponse ReadListOfDTCs
{
char DTCasText[100];
DWORD i;
// Iterate over the list of DTCs and retrieve the numeric DTC value
until an error occurs
i = 0;
while( 0 <= DiagGetComplexParameter( this, "ListOfDTCs", i, "DTC",
DTCasText, elcount( DTCasText))
{
long DTCnumeric;
DTCnumeric = DiagGetComplexParameter( this, 0, "ListOfDTCs", i,
"DTC"); // mode == numeric
write( "%d DTC %06x \"%s\"", i, DTCnumeric, DTCasText);
++i;
}
}

Returning the symbolic value of a complex parameter

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameter

Syntax long DiagGetComplexParameter (diagResponse obj, char parameterName[], DWORD


iteration, char subParameter[], char buffer[], DWORD buffersize)

long DiagGetComplexParameter (diagRequest obj, char parameterName[], DWORD


iteration, char subParameter[], char buffer[], DWORD buffersize)

Method diagResponse.GetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], char buffer[], DWORD buffersize)

diagRequest.GetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], char buffer[], DWORD buffersize)

Function Returns the symbolic value of a complex parameter. This is possible for all parameters.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

buffer

Output buffer

buffersize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 • Online mode — •


• Not for basic diagnostics

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example
On diagResponse ReadListOfDTCs
{
char DTCasText[100];
DWORD i;
// Iterate over the list of DTCs and retrieve the numeric DTC value
until an error occurs
i = 0;
while( 0 <= DiagGetComplexParameter( this, "ListOfDTCs", i, "DTC",
DTCasText, elcount( DTCasText))
{
long DTCnumeric;
DTCnumeric = DiagGetComplexParameter( this, 0, "ListOfDTCs", i,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameter

"DTC"); // mode == numeric


write( "%d DTC %06x \"%s\"", i, DTCnumeric, DTCasText);
++i;
}
}

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameterRaw, DiagSetComplexParameterRaw

DiagGetComplexParameterRaw, DiagSetComplexParameterRaw
CAPL Function Overview » Diagnostics » DiagGetComplexParameterRaw, DiagSetComplexParameterRaw

Syntax long DiagGetComplexParameterRaw (diagResponse obj, char parameterName[],


DWORD iteration, char subParameter[], BYTE* buffer, DWORD buffersize)

long DiagGetComplexParameterRaw (diagRequest obj, char parameterName[],


DWORD iteration, char subParameter[], BYTE* buffer, DWORD buffersize)

long DiagSetComplexParameterRaw (diagResponse obj, char parameterName[],


DWORD iteration, char subParameter[], BYTE* buffer, DWORD buffersize)

long DiagSetComplexParameterRaw (diagRequest obj, char parameterName[],


DWORD iteration, char subParameter[], BYTE* buffer, DWORD buffersize)

Method diagResponse.GetComplexParameterRaw (char parameterName[], DWORD iteration,


char subParameter[], BYTE* buffer, DWORD buffersize)

diagRequest.GetComplexParameterRaw (char parameterName[], DWORD iteration,


char subParameter[], BYTE* buffer, DWORD buffersize)

diagResponse.SetComplexParameterRax (char parameterName[], DWORD iteration,


char subParameter[], BYTE* buffer, DWORD buffersize)

diagRequest.SetComplexParameterRaw (char parameterName[], DWORD iteration,


char subParameter[], BYTE* buffer, DWORD buffersize)

Function Reads/sets the complex parameter to the specified raw value.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

buffer

Output buffer

buffersize

Buffer size

Return values Error code

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

5.0 • Online mode — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexParameterRaw, DiagSetComplexParameterRaw

• Not for basic diagnostics

7.0 SP5 • Online mode — •


• Not for basic diagnostics

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexRespParameter

DiagGetComplexRespParameter
CAPL Function Overview » Diagnostics » DiagGetComplexRespParameter

The behavior of this CAPL function depends on the used parameters.

Possible scenarios:

Returning the value of a numeric complex parameter

Syntax long DiagGetComplexRespParameter (diagRequest req, char parameterName[],


dword iteration, char subParameter[], double output[]);

long DiagGetComplexRespParameter (diagRequest req, long mode,char


parameterName[], dword iteration, char subParameter[], double output[]);

Method diagRequest.GetComplexRespParameter (char parameterName[], dword iteration,


char subParameter[], double output[]);

diagRequest.GetComplexRespParameter (long mode,char parameterName[], dword


iteration, char subParameter[], double output[]);

Function Returns the value of a numeric complex parameter.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

output

Output field

mode

Access mode

Return values Error code,

or value of the parameter or 0.0 if this could not be acquired.

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.1 • Online mode — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexRespParameter

• Not for basic diagnostics

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example

Using Diagnostics Functions in Test Cases

Returning the symbolic value of a complex parameter

Syntax long DiagGetComplexRespParameter (diagRequest req, char parameterName[],


dword iteration, char subParameter[], byte buffer[], dword bufferLen);

Method diagRequest.GetComplexRespParameter (char parameterName[], dword iteration,


char subParameter[], byte buffer[], dword bufferLen);

Function Returns the symbolic value of a complex parameter. This is possible for all parameters.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

buffer

Output buffer

bufferLen

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.1 • Online mode — •


• Not for basic diagnostics

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexRespParameter

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example

Using Diagnostics Functions in Test Cases

Retrieving numeric sub-parameter from a parameter

Syntax double DiagGetComplexRespParameter (diagRequest req, char parameterName[],


dword iteration, char subParameter[]);

double DiagGetComplexRespParameter (diagRequest req, long mode, char


parameterName[], dword iteration, char subParameter[]);

Method diagRequest.GetComplexRespParameter (char parameterName[], dword iteration,


char subParameter[]);

diagRequest.GetComplexRespParameter (long mode, char parameterName[], dword


iteration, char subParameter[]);

Function Retrieve numeric sub-parameter from a parameter iteration directly.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

mode

Access mode

Return values Parameter value

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.1 • Online mode — •


• Not for basic diagnostics

7.0 SP5: • Online mode — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexRespParameter

methods • Not for basic diagnostics

Example

Using Diagnostics Functions in Test Cases

| DiagGetComplexParameter | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetComplexRespParameterRaw

DiagGetComplexRespParameterRaw
CAPL Function Overview » Diagnostics » DiagGetComplexRespParameterRaw

Syntax long DiagGetComplexRespParameterRaw (diagRequest req, char parameterName[],


dword iteration, char subParameter[], byte buffer[], dword bufferLen);

Method diagRequest.GetComplexRespParameterRaw (char parameterName[], dword


iteration, char subParameter[], byte buffer[], dword bufferLen);

Function Reads/sets the complex parameter to the specified raw value.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

iteration

Iteration (beginning with 0)

subParameter

Sub parameter qualifier

buffer

Output buffer

bufferLen

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.1 • Online mode — •


• Not for basic diagnostics

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example

Using Diagnostics Functions in Test Cases

| DiagGetComplexParameterRaw | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetConfiguredVariant

DiagGetConfiguredVariant
CAPL Function Overview » Diagnostics » DiagGetConfiguredVariant

Syntax long DiagGetConfiguredVariant(char configuredVariantOut[], DWORD


bufferLen);

long DiagGetConfiguredVariant(char ecuQualifier[], char


configuredVariantOut[], DWORD bufferLen);

Function Retrieves the qualifier of the variant that is configured for the current target.

Retrieve the qualifier of the variant that is configured for the current or given target in
the Diagnostics configuration dialog. It is possible to provide this qualifier to the
automatic variant identification algorithm.

Parameters ecuQualifier

ECU the identification algorithm should run for, not the currently selected one. If given,
DiagSetTarget does not have to be called.

configuredVariantOut

Buffer for the qualifier

bufferLen

Length of the buffer

Return values 0: No error, OK

<0: Error code

Especially:
-94: No target was selected

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetCurrentEcu

DiagGetCurrentEcu
CAPL Function Overview » Diagnostics » DiagGetCurrentEcu

Syntax long DiagGetCurrentEcu (char[] qualifier, DWORD bufferLen)

Function Gets the name of the current ECU.

Parameters qualifier

Output buffer

bufferLen

Length of the output buffer

Return values Error code or length of the name provided.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetFunctionalGroupExt

DiagGetFunctionalGroupExt
CAPL Function Overview » Diagnostics » DiagGetFunctionalGroupExt

Syntax long DiagGetFunctionalGroupExt ()

long DiagGetFunctionalGroupExt(char groupQualifier)

Function Returns the value of the "address extension" byte (extended address information for ISO
TP "extended addressing mode").

If the functional group is not specified, the destination set with DiagSetTarget is used.

Parameters groupQualifier

Functional group's qualifier.

Return values -1: Extended addressing is not used.

[0, 255]:

For the ID of a received CAN message to match (see DiagGetFunctionalGroupIdMask), the


value of the first data byte must correspond to this value.

Others: Reserved
Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Processing Functional Diagnostic Requests in ECU Simulations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetFunctionalGroupId

DiagGetFunctionalGroupId
CAPL Function Overview » Diagnostics » DiagGetFunctionalGroupId

Syntax DWORD DiagGetFunctionalGroupId ()

DWORD DiagGetFunctionalGroupId (char groupQualifier)

Function Determines the CAN ID on which functional requests are sent by the diagnostic tester.

If the functional group is not specified, the destination set with DiagSetTarget is used.

Parameters groupQualifier

Functional group's qualifier.

Return values CAN ID of the requests, or 0xFFFFFFFF if no functional group has been set.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Processing Functional Diagnostic Requests in ECU Simulations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetFunctionalGroupIdMask

DiagGetFunctionalGroupIdMask
CAPL Function Overview » Diagnostics » DiagGetFunctionalGroupIdMask

Syntax DWORD DiagGetFunctionalGroupIdMask ()

DWORD DiagGetFunctionalGroupIdMask (char groupQualifier)

Function Determines the CAN ID mask in order to be able to filter out CAN messages sent by the
diagnostic tester as functional requests.

If the functional group is not specified, the destination set with DiagSetTarget is used.

Parameters groupQualifier

Functional group's qualifier

Return values The value returned must be logically ANDed with the ID of a received CAN message. If the
result is the same as the Group ID, this is a functional request.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

Example

| Processing Functional Diagnostic Requests in ECU Simulations |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetIdentifiedVariant

DiagGetIdentifiedVariant
CAPL Function Overview » Diagnostics » DiagGetIdentifiedVariant

Syntax long DiagGetIdentifiedVariant(char identifiedVariantOut[], DWORD


bufferLen);

long DiagGetIdentifiedVariant(char ecuQualifier[], char


identifiedVariantOut[], DWORD bufferLen);

Function Retrieve the qualifier of the variant that has been identified by the last successful run of
the automatic variant identification algorithm for given target, or the current target if no
target is given. The function can also be used to determine whether the algorithm has
finished.

Parameters ecuQualifier

ECU the identification algorithm should run for, not the currently selected one. If given,
DiagSetTarget does not have to be called.

identifiedVariantOut

Buffer for the qualifier

bufferLen

Length of the buffer

Return values >=0: Number of characters written into the buffer

<0: Error code

Especially:
-99: The algorithm is still running, try again later
-98: No variant was identified, e.g. the algorithm was not started or failed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetLastResponse

DiagGetLastResponse
CAPL Function Overview » Diagnostics » DiagGetLastResponse

Note

The output object must first be declared with any desired qualifier path, however after
use in this function it may correspond to any desired diagnostic service. Therefore extra
caution should be exercised when accessing the object’s parameters.

Syntax long DiagGetLastResponse (diagRequest req, diagResponse respOut);

long DiagGetLastResponse (diagResponse respOut);

Method diagRequest.GetLastResponse (diagResponse respOut);

diagResponse.GetLastResponse ();

Function Saves the last response received (for the specified request) in the output object.

Parameters req

Request

respOut

Output object for the received response

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetNegCode

DiagGetNegCode
CAPL Function Overview » Diagnostics » DiagGetNegCode

Syntax long DiagGetNegCode (char mnemonic[])

Function Returns the error code for a KWP2000 mnemonic, e.g. 0x10 for "GR" ("General Reject").

Parameters mnemonic

Abbreviation for the error code.

Return values Diagnostics/KWP2000 Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetObjectName

DiagGetObjectName
CAPL Function Overview » Diagnostics » DiagGetObjectName

Syntax long DiagGetObjectName( diagResponse obj, char nameBufferOut[], DWORD


nameBufferLen);

long DiagGetObjectName( diagRequest obj, char nameBufferOut[], DWORD


nameBufferLen);

Method diagRequest.GetObjectName( char nameBufferOut[], DWORD nameBufferLen);

diagResponse.GetObjectName( char nameBufferOut[], DWORD nameBufferLen);

Function Writes the language dependent name of the diagnostics object into the buffer. For ODX
descriptions, this is the "long name".

Parameters obj

Diagnostics object

nameBufferOut

Output buffer

nameBufferLen

Output buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 Online mode — •

7.0 SP5: methods Online mode — •

Example
DiagRequest AirbaContr_Read req;
char name[100];
DiagGetObjectName( req, name, elcount( name));

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetObjectPath

DiagGetObjectPath
CAPL Function Overview » Diagnostics » DiagGetObjectPath

Syntax long DiagGetObjectPath (diagResponse obj, char buffer[], DWORD buffersize)

long DiagGetObjectPath (diagRequest obj, char buffer[], DWORD buffersize)

Method diagResponse.GetObjectPath (char buffer[], DWORD buffersize)

diagRequest.GetObjectPath (char buffer[], DWORD buffersize)

Function Delivers the qualifier path of the object that must be specified upon generation.

Parameters obj

Diagnostics object

buffer

Input/output buffer

buffersize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetP2Extended, DiagSetP2Extended

DiagGetP2Extended, DiagSetP2Extended
CAPL Function Overview » Diagnostics » DiagGetP2Extended, DiagSetP2Extended

Note

If "Response Pending" handling is deactivated, CANoe forwards these responses to CAPL as


negative responses. Otherwise the P2ex timer is automatically started and the final
response or a timeout is reported.

Syntax long DiagGetP2Extended ();

long DiagSetP2Extended (long timeout);

Function Returns the "P2 extended" timeout, or sets it to the specified value.

Parameters timeout

-1 Deactivates "Response Pending" handling


0 Resets P2ex to its preset value
>0 Sets P2ex to the value (in ms)
Return values Error code or time in ms for DiagGetP2Extended.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

| TestWaitForDiagResponse |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetP2Timeout

DiagGetP2Timeout
CAPL Function Overview » Diagnostics » DiagGetP2Timeout

Syntax long DiagGetP2Timeout ();

Function Returns the time P2 in milliseconds, which is set by the CDD or the configuration.

P2: Time between sending of the request and arrival of the response.

Parameters —

Return values Error code or time in ms.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameter

DiagGetParameter
CAPL Function Overview » Diagnostics » DiagGetParameter

The behavior of this CAPL function depends on the used parameters.

Possible scenarios:

Returning the value of the numeric parameter

Syntax long DiagGetParameter (diagResponse obj, char parameterName[], double


output[1])

long DiagGetParameter (diagRequest obj, char parameterName[], double output


[1])

double DiagGetParameter (diagResponse obj, char parameterName[])

double DiagGetParameter (diagRequest obj, char parameterName[])

long DiagGetParameter (diagResponse obj, long mode, char parameterName[],


double output[1])

long DiagGetParameter (diagRequest obj, long mode, char parameterName[],


double output [1])

double DiagGetParameter (diagResponse obj, long mode, char parameterName[])

double DiagGetParameter (diagRequest obj, long mode, char parameterName[])

Method diagResponse.GetParameter (char parameterName[], double output[1])

diagRequest.GetParameter (char parameterName[], double output [1])

diagResponse.GetParameter (char parameterName[])

diagRequest.GetParameter (char parameterName[])

diagResponse.GetParameter (long mode, char parameterName[], double


output[1])

diagRequest.GetParameter (long mode, char parameterName[], double output


[1])

diagResponse.GetParameter (long mode, char parameterName[])

diagRequest.GetParameter (long mode, char parameterName[])

Function Returns the value of the numeric parameter, either in an output field or as return value
(without the possibility of checking the correct function).

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Output

Output field

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameter

mode

Access mode

Return values Error code or value of the parameter or 0.0 if this could not be acquired.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

Returning the symbolic value of the parameter

Syntax long DiagGetParameter (diagResponse obj, char parameterName[], char


buffer[], DWORD buffersize)

long DiagGetParameter (diagRequest obj, char parameterName[], char


buffer[], DWORD buffersize)

Method diagResponse.GetParameter (char parameterName[], char buffer[], DWORD


buffersize)

diagRequest.GetParameter (char parameterName[], char buffer[], DWORD


buffersize)

Function Returns the symbolic value of the parameter. This functions for all parameters. The
values received can be used for setting the parameter.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

buffer

Output field

buffersize

Size of the buffer

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameter

Example

Retrieving numeric parameter

Syntax double DiagGetParameter (diagResponse obj, char parameterName[])

double DiagGetParameter (diagRequest obj, char parameterName[])

Method diagResponse.GetParameter (char parameterName[])

diagRequest.GetParameter (char parameterName[])

Function Retrieves numeric parameter directly.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterName

DiagGetParameterName
CAPL Function Overview » Diagnostics » DiagGetParameterName

Syntax long DiagGetParameterName (diagResponse obj, DWORD paramNo, char buffer[],


DWORD buffersize)

long DiagGetParameterName (diagRequest obj, DWORD paramNo, char buffer[],


DWORD buffersize)

Method diagResponse.GetParameterName (DWORD paramNo, char buffer[], DWORD


buffersize)

diagRequest.GetParameterName (DWORD paramNo, char buffer[], DWORD


buffersize)

Function Writes the name of the parameter in the transmitted field.

Parameters obj

Diagnostics object

paramNo

Which parameter in the object, beginning with 0.

buffer

Output buffer

buffersize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterPath, DiagGetRespParameterPath

DiagGetParameterPath, DiagGetRespParameterPath
CAPL Function Overview » Diagnostics » DiagGetParameterPath, DiagGetRespParameterPath

Syntax long DiagGetParameterPath( diagResponse object, DWORD paramNo, char[]


buffer, DWORD bufferSize)

long DiagGetParameterPath( diagRequest object, DWORD paramNo, char[]


buffer, DWORD bufferSize)

long DiagGetRespParameterPath( diagRequest object, DWORD paramNo, char[]


buffer, DWORD bufferSize)

Method diagResponse.GetParameterPath( DWORD paramNo, char[] buffer, DWORD


bufferSize)

diagRequest.GetParameterPath( DWORD paramNo, char[] buffer, DWORD


bufferSize)

diagRequest.GetRespParameterPath( DWORD paramNo, char[] buffer, DWORD


bufferSize)

Function Return the qualifier path of the parameter at the given position in the primitive.

Parameters object

Diagnostics object

paramNo

Which parameter in the object, beginning with 0.

buffer

Input/output buffer

bufferSize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterSizeCoded

DiagGetParameterSizeCoded
CAPL Function Overview » Diagnostics » DiagGetParameterSizeCoded

Syntax long DiagGetParameterSizeCoded(diagRequest obj, char parameterName[])

long DiagGetParameterSizeCoded(diagResponse obj, char parameterName[])

Object myDiagRequest.GetParameterSizeCoded(char* parameterName);


oriented
notation myDiagResponse.GetParameterSizeCoded(char* parameterName);

Function Returns the length of the coded parameter in bits.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values If > 0 the number of bits, otherwise an error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterSizeRaw

DiagGetParameterSizeRaw
CAPL Function Overview » Diagnostics » DiagGetParameterSizeRaw

Syntax long DiagGetParameterSizeRaw(diagRequest obj, char parameterName[])

long DiagGetParameterSizeRaw(diagResponse obj, char parameterName[])

Object myDiagRequest.GetParameterSizeRaw(char* parameterName);


oriented
notation myDiagResponse.GetParameterSizeRaw(char* parameterName);

Function Returns the length of the raw parameter in bits (raw stream) including leading size byte,
terminating zeros etc.
Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values If > 0 the number bits, otherwise an error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterType, DiagGetRespParameterType

DiagGetParameterType, DiagGetRespParameterType
CAPL Function Overview » Diagnostics » DiagGetParameterType, DiagGetRespParameterType

Syntax long DiagGetParameterType(diagResponse object, char[] qualifier, char[]


buffer, DWORD bufferSize)

long DiagGetParameterType(diagRequest object, char[] qualifier, char[]


buffer, DWORD bufferSize)

long DiagGetRespParameterType(diagRequest object, char[] qualifier, char[]


buffer, DWORD bufferSize)

Method diagResponse.GetParameterType(char[] qualifier, char[] buffer, DWORD


bufferSize)

diagRequest.GetParameterType(char[] qualifier, char[] buffer, DWORD


bufferSize)

diagRequest.GetRespParameterType(char[] qualifier, char[] buffer, DWORD


bufferSize)

Function Retrieve the qualifier of the parameter's type.

Parameters object

Diagnostics object

qualifier

Parameter qualifier

buffer

Input/output buffer

bufferSize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetParameterUnit

DiagGetParameterUnit
CAPL Function Overview » Diagnostics » DiagGetParameterUnit

Syntax long DiagGetParameterUnit (diagResponse obj, char parameterName[], char


buffer[], DWORD buffersize)

long DiagGetParameterUnit (diagRequest obj, char parameterName[], char


buffer[], DWORD buffersize)

Method diagResponse.GetParameterUnit (char parameterName[], char buffer[], DWORD


buffersize)

diagRequest.GetParameterUnit (char parameterName[], char buffer[], DWORD


buffersize)

Function Writes the unit of the parameter in the transmitted field.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

buffer

Output buffer

buffersize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetPendingRequests

DiagGetPendingRequests
CAPL Function Overview » Diagnostics » DiagGetPendingRequests

Info

This function is only available for function network requests.

Syntax long DiagGetPendingRequests ()

Function Returns the number of unresolved network requests.

0 means that there are no outstanding responses and another network request can be sent
out.

Parameters —

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetPrimitiveByte

DiagGetPrimitiveByte
CAPL Function Overview » Diagnostics » DiagGetPrimitiveByte

Syntax long DiagGetPrimitiveByte( diagRequest request, DWORD bytePos);

long DiagGetPrimitiveByte( diagResponse response, DWORD bytePos);

Method diagRequest.GetPrimitiveByte( DWORD bytePos);

diagResponse.GetPrimitiveByte( DWORD bytePos);

Function Reads one byte of a diagnostics object.

Parameters request

Request

response

Response

bytePos

Position of the byte in the object

Return values >= 0: Requested value or "no error"


<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

|Diag GetRespPrimitiveByte | DiagSetPrimitiveByte | DiagSetRespPrimitiveByte | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetPrimitiveData, DiagSetPrimitiveData

DiagGetPrimitiveData, DiagSetPrimitiveData
CAPL Function Overview » Diagnostics » DiagGetPrimitiveData, DiagSetPrimitiveData

Syntax long DiagGetPrimitiveData (diagResponse obj, byte* buffer, DWORD


buffersize)

long DiagGetPrimitiveData (diagRequest obj, byte* buffer, DWORD buffersize)

long DiagSetPrimitiveData (diagResponse obj, byte* buffer, DWORD


buffersize)

long DiagSetPrimitiveData (diagRequest obj, byte* buffer, DWORD buffersize)

Method diagResponse.GetPrimitiveData (byte* buffer, DWORD buffersize)

diagRequest.GetPrimitiveData (byte* buffer, DWORD buffersize)

diagResponse.SetPrimitiveData (byte* buffer, DWORD buffersize)

diagRequest.SetPrimitiveData (byte* buffer, DWORD buffersize)

Function Reads/sets the raw data of the complete service primitive (all data that is transmitted via
the transport protocol).

Parameters objxt

Diagnostics object

buffer

Input/output buffer

buffersize

Buffer size

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example
// Print the length and first byte of a diagnostics request object
PrintDiagRequestBytes( diagRequest * req)
{
BYTE primitiveRaw[4095];
long size;
size = DiagGetPrimitiveData( req, primitiveRaw, elcount( primitiveRaw));
if( size > 0)
write( "Request = (%d)[%02x ...]", size, primitiveRaw[0]);
else
write( "Request: error %d", size);
}

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetPrimitiveSize

DiagGetPrimitiveSize
CAPL Function Overview » Diagnostics » DiagGetPrimitiveSize

Syntax long DiagGetPrimitiveSize( diagRequest request);

long DiagGetPrimitiveSize( diagResponse response);

Method diagRequest.GetPrimitiveSize();

diagResponse.GetPrimitiveSize();

Function Returns the byte length of the object.

Parameters request

Request

response

Response

Return values >0: Number of bytes

<0: Error code


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagGetRespPrimitiveSize | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetResponseCode, DiagGetLastResponseCode

DiagGetResponseCode, DiagGetLastResponseCode
CAPL Function Overview » Diagnostics » DiagGetResponseCode, DiagGetLastResponseCode

Syntax long DiagGetResponseCode (diagResponse resp);

long DiagGetLastResponseCode (diagRequest req);

long DiagGetLastResponseCode ();

Method diagResponse.GetResponseCode();

diagRequest.GetLastResponseCode();

Function Returns the code of the specified response or last received response (for the specified
request).

Parameters resp

Response

req

Request

Return values -1: The response was positive, i.e. there is no error code.

0: No response has been received yet.

>0: (KWP) Error code of the negative response.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespParameter

DiagGetRespParameter
CAPL Function Overview » Diagnostics » DiagGetRespParameter

The behavior of this CAPL function depends on the used parameters.

Possible scenarios:

Returning the value of the numeric parameter

Syntax long DiagGetRespParameter (diagRequest req, char parameterName[], double


output[]);

long DiagGetRespParameter (diagRequest req, long mode, char


parameterName[], double output[]);

Method diagRequest.GetRespParameter (char parameterName[], double output[]);

diagRequest.GetRespParameter (long mode, char parameterName[], double


output[]);

Function Returns the value of the numeric parameter, either in an output field or as return value
(without the possibility of checking the correct function).

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

output

Output field

mode

Access mode

Return values Error code or value of the parameter.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Using Diagnostics Functions in Test Cases

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespParameter

Returning the symbolic value of the parameter

Syntax long DiagGetRespParameter (diagRequest req, char parameterName[], char


buffer[], dword bufferLen);

Method diagRequest.GetRespParameter (char parameterName[], char buffer[], dword


bufferLen);

Function Returns the symbolic value of the parameter. This functions for all parameters. The
values received can be used for setting the parameter.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

buffer

Output field

bufferLen

Size of the buffer

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Using Diagnostics Functions in Test Cases

Retrieving numeric parameter

Syntax double DiagGetRespParameter (diagRequest req, char parameterName[]);

double DiagGetRespParameter (diagRequest req, long mode, char


parameterName[]);

Method diagRequest.GetRespParameter (char parameterName[]);

diagRequest.GetRespParameter (long mode, char parameterName[]);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespParameter

Function Retrieves numeric parameter directly.

This function offers access to parameters contained in a received response object,


whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

mode

Access mode

Return values Parameter value

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Using Diagnostics Functions in Test Cases

| DiagGetParameter | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespParameterRaw

DiagGetRespParameterRaw
CAPL Function Overview » Diagnostics » DiagGetRespParameterRaw

Syntax long DiagGetRespParameterRaw (diagRequest req, char parameterName[], byte


buffer[], dword bufferLen);

Method diagRequest.GetRespParameterRaw (char parameterName[], byte buffer[], dword


bufferLen);

Function This function offers access to parameters contained in a received response object,
whereby the function is addressed directly by the request. This eliminates the need to
generate a separate response object. If no response is available yet for the request, an
error is reported.

Parameters req

Request

parameterName

Parameter qualifier

buffer

Output field

bufferLen

Size of the buffer

Return values 0 if bytes were copied, otherwise <0 for an error code

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

Using Diagnostics Functions in Test Cases

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespPrimitiveByte

DiagGetRespPrimitiveByte
CAPL Function Overview » Diagnostics » DiagGetRespPrimitiveByte

Syntax long DiagGetRespPrimitiveByte( diagRequest request, DWORD bytePos);

Method diagRequest.GetRespPrimitiveByte( DWORD bytePos);

Function Reads one byte of the response stored for the request.

Parameters request

Request

bytePos

Position of the byte in the response

Return values >= 0: Requested value or "no error"

<0: Error code


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagGetPrimitiveByte | DiagSetPrimitiveByte | DiagSetRespPrimitiveByte | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetRespPrimitiveSize

DiagGetRespPrimitiveSize
CAPL Function Overview » Diagnostics » DiagGetRespPrimitiveSize

Syntax long DiagGetRespPrimitiveSize( diagRequest request);

Method diagRequest.GetRespPrimitiveSize();

Function Returns the byte length of the response stored for the request.

Parameters request

Request

Return values >0: Number of bytes

<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagGetPrimitiveSize | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetSendingMode

DiagGetSendingMode
CAPL Function Overview » Diagnostics » DiagGetSendingMode

Note

The sending as UUDT is activated via CDD and only available for special manufacturers.

Syntax long DiagGetSendingMode (diagResponse response);

Method diagResponse.GetSendingMode ()

Function Delivers information about the send mode of the answer.

Parameters response

Response

Return values Returns 0 if the answer should be sent "physically", returns 1 if the answer should be sent
as UUDT.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetSuppressResp, DiagSetSuppressResp

DiagGetSuppressResp, DiagSetSuppressResp
CAPL Function Overview » Diagnostics » DiagGetSuppressResp, DiagSetSuppressResp

Syntax long DiagGetSuppressResp (diagRequest req);

long DiagSetSuppressResp (diagRequest req, long flag);

Method diagRequest.GetSuppressResp ();

diagRequest.SetSuppressResp (long flag);

Function Under UDS (Unified Diagnostics Services), in certain requests it is possible to set the
"suppressPosRspMsgIndicationBit" ("suppress positive response message indication bit").
This means that the receiver must not send any positive response. These two functions
make it possible to poll and set this bit.

Parameters req

Request

flag

0: Clear, else: Set

Return values 1: The bit is set.

0: The request does not use the bit, or it is not set.

Error code or value of the parameter.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetTargetCount

DiagGetTargetCount
CAPL Function Overview » Diagnostics » DiagGetTargetCount

Syntax long DiagGetTargetCount();

Function Returns the number /n/ of possible diagnostics targets configured. For indices /i/ with 0 ≤
i ≤ n you can retrieve the target qualifier with DiagGetTargetQualifier.

Info

Diagnostics descriptions that cannot work as diagnostics targets are not


counted, e.g. descriptions configured as interpretation only are ignored.

Parameters —

Return values Error code or number of diagnostics targets.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Online mode — •

Example
long i;
char ecuQual[100];
i = DiagGetTargetCount();
while( i-- > 0)
{
DiagGetTargetQualifier( i, ecuQual, elcount(ecuQual));
write( "Target %d: %s", i, ecuQual);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetTargetQualifier

DiagGetTargetQualifier
CAPL Function Overview » Diagnostics » DiagGetTargetQualifier

Syntax long DiagGetTargetQualifier( DWORD index, char bufferOut[], DWORD


bufferSize);

Function Writes the target qualifier for the diagnostics target at given index into the buffer. If
successful, the qualifier can be used in DiagSetTarget.

Parameters index

Value in 0 ≤ index ≤ n, where /n/ is the number of possible targets returned by


DiagGetTargetCount.

bufferOut

Character array for the result.

bufferSize

Maximum number of characters available in the buffer.

Return values Error code or number of characters copied into the buffer. Note that an error is returned
if the buffer is too small for the qualifier.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Online mode — •

Example
long i;
char ecuQual[100];
i = DiagGetTargetCount();
while( i-- > 0)
{
DiagGetTargetQualifier( i, ecuQual, elcount(ecuQual));
write( "Target %d: %s", i, ecuQual);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagGetTesterPresentState

DiagGetTesterPresentState
CAPL Function Overview » Diagnostics » DiagGetTesterPresentState

Syntax DiagGetTesterPresentState(char ecuQualifier[])

DiagGetTesterPresentState()

Function Returns the state of autonomous/cyclical Tester Present requests from CANoe to the
specified or current ECU.

Info

This function only returns the correct state if in the calling CAPL node no
CAPL Callback interface for diagnostics is used.

Status:

0: sending Tester Present disabled for target ECU


1: sending Tester Present enabled for target ECU

Parameters ecuQualifier

Qualifier of the ECU as specified in the diagnostic configuration dialog, for which the
Tester Present state shall be queried.

If no parameter is provided, the state of the current diagnostic target (set by


DiagSetTarget(char ecuQualifier[]) is returned.

Return values Error code or status

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Online mode — •

Example

| DiagStartTesterPresent | DiagStopTesterPresent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagInitialize

DiagInitialize
CAPL Function Overview » Diagnostics » DiagInitialize

Syntax long DiagInitialize( diagReponse object, char serviceQualifier[]);

long DiagInitialize( diagReponse object, char serviceQualifier[], char


primitiveQualifier[]);

long DiagInitialize( diagRequest object, char serviceQualifier[]);

Method diagReponse.Initialize( char serviceQualifier[]);

diagReponse.Initialize( char serviceQualifier[], char


primitiveQualifier[]);

diagRequest.Initialize( char serviceQualifier[]);

Function Reinitializes the object for the given service or primitive. Diagnostics request will be
initialized with the default request parameters of the service, while diagnostics responses
will be initialized with the default parameters of the first or specified primitive of the
service. If the service is not defined, or the primitive is not defined at the given service,
nothing happens and an error code is returned.

Attention

The data contained in the primitive is overwritten by a successful call of this


function!

Info

Please refer to Diagnostics descriptions with overloaded responses for details


on services defining more than one response.

Parameters object

Diagnostics object to re-initialize

serviceQualifier

Qualifier of the service that should be used for reinterpretation

primitiveQualifier

Qualifier of the service primitive that should be used for reinterpretation

Return values 0: No error, OK

<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Online mode — •

Example

In an ECU simulation, initialize a response object with a specific primitive before sending
it.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagInitialize

on diagRequest Servi
{
diagResponse this response; // will be initialized with first primitive
response.Initialize( "Servi", "ServiEcu1PR"); // Force initialization
with specific primitive
response.SetParameter( "Voltage", 28.0); // Access primitive specific
parameter
response.SendResponse();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagInterpretAs

DiagInterpretAs
CAPL Function Overview » Diagnostics » DiagInterpretAs

Syntax long DiagInterpretAs( diagResponse response, char primitiveQualifier[]);

Method diagResponse.InterpretAs( char primitiveQualifier[]);

Function Treats the data of the response object as the specified primitive. This will cause a
reinterpretation of the data, but the data will not be changed.

Info

The specified primitive must be defined for the service the response
currently refers to! Please refer to Diagnostics descriptions with overloaded
responses for details.

Parameters response

Diagnostics object

primitiveQualifier

Qualifier of the service primitive that should be used for reinterpretation.

Return values 0: No error, OK

<0: Error code

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.1 SP3 • Online mode — •


• Not for basic
diagnostics

Example

his function determines the actual response primitive by trying to set the interpretation
of the argument to the defined variations. 0 is returned if interpretation is possible.
long FindCorrectInterpretation( diagResponse * response)
{
if( !response.InterpretAs( "ServiPR"))
return 0; // no error -> interpretation OK
if( !response.InterpretAs( "ServiEcu1PR"))
return 0; // no error -> interpretation OK
if( !response.InterpretAs( "ServiDefauD"))
return 0; // no error -> interpretation OK
// None of the known primitives matches, so return failure
return -1; // not found
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagInterpretRespAs

DiagInterpretRespAs
CAPL Function Overview » Diagnostics » DiagInterpretRespAs

Syntax long DiagInterpretRespAs( diagRequest response, char primitiveQualifier[]);

Method diagRequest.InterpretRespAs( char primitiveQualifier[]);

Function Treats the data of the request's response as the specified primitive. This will cause a
reinterpretation of the data, but the data will not be changed.

Info

The specified primitive must be defined for the service the response
currently refers to! Please refer to Diagnostics descriptions with overloaded
responses for details.

Parameters request

Request that has to contain a response object received by waiting for a response.

primitiveQualifier

Qualifier of the service primitive that should be used for reinterpretation.

Return values 0: No error, OK

<0: Error code

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.1 SP3 • Online mode — •


• Not for basic
diagnostics

Example

A tester module tries to interpret the response received for a request.


if( 1 == TestWaitForDiagResponse( request, 2000))
{
if( 0 == DiagInterpretRespAs( request, "ServiEcu1PR"))
{
if( 27.5 < DiagGetRespParameter( request, "Voltage"))
TestStepPass( "Voltage is high enough");
else
TestStepFail( "Voltage too low");
} else
{
TestStepFail( "Unexpected response version");
}
} else
{
TestStepFail( "No response received");
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsMarked

DiagIsMarked
CAPL Function Overview » Diagnostics » DiagIsMarked

Syntax long DiagIsMarked (char[] qualifier)

Function Returns !0 if the ECU is marked.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsNegativeResponse

DiagIsNegativeResponse
CAPL Function Overview » Diagnostics » DiagIsNegativeResponse

Syntax long DiagIsNegativeResponse (diagResponse obj)

Method diagResponse.IsNegativeResponse ()

Function Returns value <> 0 if the object is a negative response to a request.

Parameters obj

Diagnostics object

Return values 0 or <>0

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsParameterConstant, DiagIsRespParameterConstant

DiagIsParameterConstant, DiagIsRespParameterConstant
CAPL Function Overview » Diagnostics » DiagIsParameterConstant, DiagIsRespParameterConstant

Syntax long DiagIsParameterConstant(diagResponse object, char[] qualifier)

long DiagIsParameterConstant(diagRequest object, char[] qualifier)

long DiagIsRespParameterConstant(diagRequest object, char[] qualifier)

Method diagResponse.IsParameterConstant(char[] qualifier)

diagRequest.IsParameterConstant(char[] qualifier)

diagRequest.IsRespParameterConstant(char[] qualifier)

Function Returns 1 if the parameter is declared constant in the diagnostics description.

Parameters object

Diagnostics object

qualifier

Parameter qualifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsParameterDefault

DiagIsParameterDefault
CAPL Function Overview » Diagnostics » DiagIsParameterDefault

Syntax long DiagIsParameterDefault (diagResponse obj, char parameterName[])

long DiagIsParameterDefault (diagRequest obj, char parameterName[])

Method diagResponse.IsParameterDefault (char* parameterName)

diagRequest.IsParameterDefault (char parameterName[])

Function Returns <> 0 if the parameter in the object has its default value.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 • Online mode — •


• Not for basic diagnostics

7.0 SP5: • Online mode — •


methods
• Not for basic diagnostics

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsPositiveResponse

DiagIsPositiveResponse
CAPL Function Overview » Diagnostics » DiagIsPositiveResponse

Syntax long DiagIsPositiveResponse (diagResponse obj)

Method diagResponse.IsPositiveResponse ()

Function Returns value <> 0 if the object is a positive response to a request.

Parameters obj

Diagnostics object

Return values 0 or <>0

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsPresent

DiagIsPresent
CAPL Function Overview » Diagnostics » DiagIsPresent

Syntax long DiagIsPresent (char[] qualifier)

Function Returns !0 if a response was already received from the ECU.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsRaw

DiagIsRaw
CAPL Function Overview » Diagnostics » DiagIsRaw

Syntax long DiagIsRaw( diagRequest request);

long DiagIsRaw( diagResponse response);

Method diagRequest.IsRaw();

diagResponse.IsRaw();

Function Returns if the object is stored as raw data or can be interpreted.

Parameters request

Request

response

Response

Return values 1: Object is stored as raw data.

0: Object can be interpreted.

<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagIsRawResp | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsRawResp

DiagIsRawResp
CAPL Function Overview » Diagnostics » DiagIsRawResp

Syntax long DiagIsRawResp( diagRequest request);

Method diagRequest.IsRawResp();

Function Returns if the response stored for the request is stored as raw data or can be interpreted.

Parameters request

Request

Return values 1: Response is stored as raw data.

0: Response can be interpreted.

<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| DiagIsRaw | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagIsValidValue

DiagIsValidValue
CAPL Function Overview » Diagnostics » DiagIsValidValue

Syntax long DiagIsValidValue( diagResponse response, char[] parameterQualifier,


long[] errorLevelOut);

Function Returns 1 if the parameter in the response object is valid, otherwise 0 is returned and the
level of the problem (error or warning) is set in the output parameter field.

Parameters response

The response object where the parameter is searched

parameterQualifier

The qualifier of the parameter that is checked

errorLevelOut

Return value if parameter could be checked:

errorLevelOut[0]:
0: Value is valid
1: Warning
2: Error

Return values 1: Parameter value is valid, errorLevelOut[0] is set to 0.

0: Parameter value is invalid, errorLevelOut[0] is set to the level of the problem.

<0: Error code

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • Online mode — •


• Not for basic
diagnostics

Example
on DiagResponse Example_Service
{
long errorLevelOut[1];
long status;
status = DiagIsValidValue( this, "MyParameter", errorLevelOut);
if( status == 1)
{
write( "Parameter value OK");
} else if( status == 0)
{
if( errorLevelOut[0] == 1)
write( "Warning.");
else if( errorLevelOut[0] == 2)
write( "ERROR!");
} else
{
write( "Error %d checking parameter value!", status);
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagMarkEcu

DiagMarkEcu
CAPL Function Overview » Diagnostics » DiagMarkEcu

Syntax long DiagMarkEcu (char[] qualifier)

long DiagMarkEcu()

Function Marks the specified or current ECU.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagResetParameter

DiagResetParameter
CAPL Function Overview » Diagnostics » DiagResetParameter

Syntax long DiagResetParameter (diagResponse obj, char parameterName[])

long DiagResetParameter (diagRequest obj, char parameterName[])

Method diagResponse.ResetParameter (char parameterName[])

diagRequest.ResetParameter (char parameterName[])

Function Sets the parameter to its default value.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagResize

DiagResize
CAPL Function Overview » Diagnostics » DiagResize

Syntax long DiagResize (diagResponse obj)

long DiagResize (diagRequest obj)

long DiagResize (diagResponse obj, DWORD length)

long DiagResize (diagRequest obj, DWORD length)

Method diagResponse.Resize()

diagRequest.Resize()

diagResponse.Resize (DWORD length)

diagRequest.Resize (DWORD length)

Function Adjusts the size of the diagnostics object to the desired number of repetitions of the
complex parameters. For this, the counting parameter must be set first in case the
number of repetitions is coded explicitly (iteration).

If the number of repetitions is acquired via the length of the transmitted data, then the
length of the object can be set directly.

Parameters Texobjt

Diagnostics object

length

Length in bytes, if necessary

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagResize

DiagResize
CAPL Function Overview » Diagnostics » DiagResize

Syntax long DiagResize (diagResponse obj)

long DiagResize (diagRequest obj)

long DiagResize (diagResponse obj, dword byteCount)

long DiagResize (diagRequest obj, dword byteCount)

Method diagResponse.Resize()

diagRequest.Resize()

diagResponse.Resize (dword byteCount)

diagRequest.Resize (dword byteCount)

Function Adapt size of a diagnostics object to match specified parameter iterations, or set size of
bus message to given number of byte.

Parameters obj

Diagnostics object

byteCount

Length of data to send.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendFunctional

DiagSendFunctional
CAPL Function Overview » Diagnostics » DiagSendFunctional

Info

• This function does not work with the CAPL Callback Interface!
• If one or more "Functional Group Request" descriptions are defined at the network,
this function does not work too.
In this case, set the FGR description as target and communicate using the appropriate
means.

Syntax long DiagSendFunctional( diagRequest request)

Method diagRequest.SendFunctional()

Function Send a request to the functional group defined for the current target. The configuration
of the functional transport protocol settings in the description configuration dialog must
be present and consistent.

Info

• Only responses from the current target are received, responses from
other ECUs are ignored.
• The reception channels for ALL ECUs that are member of the same
functional group are opened to make sure that they do not run into
transport protocol errors. Note that the Tester Present is NOT activated
if those channels were not open before! It might be necessary to activate
it when a different target is selected.

Note on usage with diagnostics on K-Line

When used together with the built-in K-Line diagnostic channel, also the
channel will be initialized to use functional addressing i.e. a functional
startCommunication service will be put on the K-Line (Bit 6 & 7 of format
byte set to 1) when the first request is sent. All subsequent requests sent
with this function to the same target ECU will also carry the use functional
addressing information.

In order to switch back to physical addressing, you have to call


CANdelaLibCloseChannel(ECU_Qualifier) and then
DiagSetTarget(ECU_Qualifier) to prepare the re-opening of the channel upon
the next request.

Parameters request

The request to be sent.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendFunctional

DiagSendFunctional( request1);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendMarked

DiagSendMarked
CAPL Function Overview » Diagnostics » DiagSendMarked

Syntax long DiagSendMarked (diagRequest request)

Method diagRequest.SendMarked()

Function Sends a request to all marked ECUs.

Parameters request

The request to be sent.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

7.0 SP3: method Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendNegativeResponse

DiagSendNegativeResponse
CAPL Function Overview » Diagnostics » DiagSendNegativeResponse

Syntax long DiagSendNegativeResponse (diagResponse obj, DWORD code)

long DiagSendNegativeResponse (diagRequest obj, DWORD code)

Method diagResponse.SendNegativeResponse (DWORD code)

diagRequest.SendNegativeResponse (DWORD code)

Function Sends a negative response to the tester, whereby the specified value is transmitted as
error code.

Parameters obj

Diagnostics object

code

Error code (can, for example, be acquired with DiagGetNegCode from the mnemonic).

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP3: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendNetwork

DiagSendNetwork
CAPL Function Overview » Diagnostics » DiagSendNetwork

Syntax long DiagSendNetwork (diagRequest request)

Method diagRequest.SendNetwork()

Function Sends a Request to all ECUs on this bus.

Parameters request

The request to be sent.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

7.0 SP3: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendRequest

DiagSendRequest
CAPL Function Overview » Diagnostics » DiagSendRequest

Syntax long DiagSendRequest (diagRequest obj)

Method diagRequest.SendRequest()

Function Sends the request object to the ECU.

Parameters obj

Diagnostics object

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP3: method Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSendResponse, DiagSendPositiveResponse

DiagSendResponse, DiagSendPositiveResponse
CAPL Function Overview » Diagnostics » DiagSendResponse, DiagSendPositiveResponse

Syntax long DiagSendResponse (diagResponse obj)

long DiagSendPositiveResponse (diagResponse obj)

Method diagResponse.SendResponse ()

diagResponse.SendPositiveResponse()

Function Sends the response object back to the tester. Can only be called in the ECU simulation.

Parameters obj

Diagnostics object

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP3: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _Diag_SetChannelParameters

_Diag_SetChannelParameters
CAPL Function Overview » Diagnostics » _Diag_SetChannelParameters

Syntax void _Diag_SetChannelParameters ();

Function This function will be called after measurement start (in ECU simulations) or after
DiagSetTarget() (in test nodes) and enables the CAPL program to configure the transport
protocol.

If the protocol is configured by the data base nothing has to be done.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetComplexParameter

DiagSetComplexParameter
CAPL Function Overview » Diagnostics » DiagSetComplexParameter

Syntax long DiagSetComplexParameter (diagResponse obj, char parameterName[], DWORD


iteration, char subParameter[], double numValue)

long DiagSetComplexParameter (diagRequest obj, char parameterName[], DWORD


iteration, char subParameter[], double numValue)

long DiagSetComplexParameter (diagResponse obj, char parameterName[], DWORD


iteration, char subParameter[], char symbValue[])

long DiagSetComplexParameter (diagRequest obj, char parameterName[], DWORD


iteration, char subParameter[], char symbValue[])

long DiagSetComplexParameter (diagResponse obj, long mode, char


parameterName[], DWORD iteration, char subParameter[], char valueIn[])

long DiagSetComplexParameter (diagRequest obj, long mode, char


parameterName[], DWORD iteration, char subParameter[], char valueIn[])

Method diagResponse.SetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], double numValue)

diagRequest.SetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], double numValue)

diagResponse.SetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], char symbValue[])

diagRequest.SetComplexParameter (char parameterName[], DWORD iteration,


char subParameter[], char symbValue[])

diagResponse.SetComplexParameter (long mode, char parameterName[], DWORD


iteration, char subParameter[], char valueIn[])

diagRequest.SetComplexParameter (long mode, char parameterName[], DWORD


iteration, char subParameter[], char valueIn[])

Function Sets one of the sub-parameters within a complex parameter to the specified (numeric or
symbolic) value.

For this first the complex parameter, that is, the name of the iteration, must be
specified; then the number of repetitions of the sub-parameter list that is the goal, and
then the sub-parameter in the iteration itself.

Parameters obj

Diagnostics object

parameterName

Complex parameter

iteration

Number of the iteration (beginning with 0)

subParameter

Sub parameter

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetComplexParameter

numValue

New numeric value (only possible with numeric parameters)

symbValue

Symbolic value (possible with all parameters)

valueIn

Depending on the mode the value is numerical or symbolical.

mode

Access mode

Return values Error code

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 • Online mode — •


• Not for basic diagnostics

7.0 SP3: • Online mode — •


methods
• Not for basic diagnostics

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetCurrentEcu

DiagSetCurrentEcu
CAPL Function Overview » Diagnostics » DiagSetCurrentEcu

Syntax long DiagSetCurrentEcu (char[] qualifier)

Function The specified ECU is made the current ECU.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_SetDataSegmentation

Diag_SetDataSegmentation
CAPL Function Overview » Diagnostics » Diag_SetDataSegmentation

Note

This function is only available with the implementation of the generic CAPL callback
interface!

Syntax long Diag_SetDataSegmentation (long mode, DWORD maxSegmentSize, DWORD


segmentSeparationTime);

Function Configures the segmentation of diagnostics data at the transmission.

Parameters mode

Mode:

maxSegmentSize

Maximum length of a segment, header inclusive.


The value 0 implies that the segment may have any length.

segmentSeparationTime

Distance between sending of the segments in milliseconds.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetEcuAbsent

DiagSetEcuAbsent
CAPL Function Overview » Diagnostics » DiagSetEcuAbsent

Syntax long DiagSetEcuAbsent (char[] qualifier)

long DiagSetEcuAbsent ()

Function No more attempt is made to send Network Requests to the specified or current ECU.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetEcuPresent

DiagSetEcuPresent
CAPL Function Overview » Diagnostics » DiagSetEcuPresent

Syntax long DiagSetEcuPresent (char[] qualifier)

Function Accepts this ECU back into the group of ECUs to be addressed.
Network Requests are sent to it again.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetP2Timeouts

DiagSetP2Timeouts
CAPL Function Overview » Diagnostics » DiagSetP2Timeouts

Syntax long DiagSetP2Timeouts( DWORD newP2timeout_ms, DWORD newP2exTimeout_ms);

Function Changes the P2 and P2ex timeout values at the CANdelaLib diagnostics channel.

Parameters newP2timeout_ms

The CANdelaLib channel will use this P2 timeout (in milliseconds) from now on.

newP2exTimeout_ms

New P2 extended value (in milliseconds) for the CANdelaLib channel.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetParameter

DiagSetParameter
CAPL Function Overview » Diagnostics » DiagSetParameter

The behavior of this CAPL function depends on the used parameters.

Possible scenarios:

Setting the numeric parameter to the specified value

Syntax long DiagSetParameter (diagResponse obj, char parameterName[], double


newValue)

long DiagSetParameter (diagRequest obj, char parameterName[], double


newValue)

long DiagSetParameter (diagResponse obj, long mode, char parameterName[],


double newValue)

long DiagSetParameter (diagRequest obj, long mode, char parameterName[],


double newValue)

Method diagResponse.SetParameter (char parameterName[], double newValue)

diagRequest.SetParameter (char parameterName[], double newValue)

diagResponse.SetParameter (long mode, char parameterName[], double


newValue)

diagRequest.SetParameter (long mode, char parameterName[], double newValue)

Function Sets the numeric parameter to the specified value.

Info

Textual diagnostic parameters cannot be set with double values.

With 7.6 SP2 the function behavior was changed. The parameter will no
longer be set to its default value.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier (NOT the language-dependent name of the parameter!)

newValue

Numeric value to which the parameter should be set.

mode

Access mode

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetParameter

7.0 SP3: methods Online mode — •

Example

Setting a parameter to the symbolically-specified value

Syntax long DiagSetParameter (diagResponse obj, char parameterName[], char


newValue[])

long DiagSetParameter (diagRequest obj, char parameterName[], char


newValue[])

Method diagResponse.SetParameter (char parameterName[], char newValue[])

diagRequest.SetParameter (char parameterName[], char newValue[])

Function Sets a parameter to the symbolically-specified value. This is possible for all parameters,
also numeric ones.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

newValue

Symbolic value

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP3: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetParameterRaw, DiagGetParameterRaw

DiagSetParameterRaw, DiagGetParameterRaw
CAPL Function Overview » Diagnostics » DiagSetParameterRaw, DiagGetParameterRaw

Syntax long DiagSetParameterRaw (diagResponse obj, char parameter[], byte* buffer,


DWORD buffersize)

long DiagSetParameterRaw (diagRequest obj, char parameterName[], byte*


buffer, DWORD buffersize)

long DiagGetParameterRaw (diagResponse obj, char parameterName[], byte*


buffer, DWORD buffersize)

long DiagGetParameterRaw (diagRequest obj, char parameterName[], byte*


buffer, DWORD buffersize)

Method diagResponse.SetParameterRaw (char parameterName[], byte* buffer, DWORD


buffersize)

diagRequest.SetParameterRaw (char parameterName[], byte* buffer, DWORD


buffersize)

diagResponse.GetParameterRaw (char parameterName[], byte* buffer, DWORD


buffersize)

diagRequest.GetParameterRaw (char parameterName[], byte* buffer, DWORD


buffersize)

Function Sets or specifies the value of a (complex) parameter directly via uncoded data bytes.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

buffer

Input/output buffer

buffersize

Buffer size

Return values 0 if bytes were copied, otherwise <0 for an error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP5: methods Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetPrimitiveByte

DiagSetPrimitiveByte
CAPL Function Overview » Diagnostics » DiagSetPrimitiveByte

Syntax long DiagSetPrimitiveByte( diagRequest request, DWORD bytePos, DWORD


newValue);

long DiagSetPrimitiveByte( diagResponse response, DWORD bytePos, DWORD


newValue);

Method diagRequest.SetPrimitiveByte( DWORD bytePos, DWORD newValue);

diagResponse.SetPrimitiveByte( DWORD bytePos, DWORD newValue);

Function Writes one byte of a diagnostics object.

Parameters request

Request

response

Response

bytePos

Position of the byte in the object

newValue

New value of the accessed byte

Return values >= 0: Requested value or "no error"

<0: Error code


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP3: methods Online mode — •

Example

| DiagSetRespPrimitiveByte | DiagGetPrimitiveByte | DiagGetRespPrimitiveByte | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetRequestInterval

DiagSetRequestInterval
CAPL Function Overview » Diagnostics » DiagSetRequestInterval

Syntax long DiagSetRequestInterval (long value)

Function Sets the interval between network requests in milliseconds.

Parameters value

Request interval in milliseconds.

-1: Do not resume until a response or timeout is received.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetRespPrimitiveByte

DiagSetRespPrimitiveByte
CAPL Function Overview » Diagnostics » DiagSetRespPrimitiveByte

Syntax long DiagSetRespPrimitiveByte( diagRequest request, DWORD bytePos, DWORD


newValue);

Method diagRequest.SetRespPrimitiveByte( DWORD bytePos, DWORD newValue);

Function Writes one byte of the response stored for the request.

Parameters request

Request

bytePos

Position of the byte in the object.

newValue

New value of the accessed byte.

Return values >= 0: Requested value or "no error"

<0: Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Online mode — •

7.0 SP3: methods Online mode — •

Example

| DiagSetPrimitiveByte | DiagGetPrimitiveByte | DiagGetRespPrimitiveByte | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetTarget

DiagSetTarget
CAPL Function Overview » Diagnostics » DiagSetTarget

Syntax long DiagSetTarget (char ecuName[])

Function Sets the target ECU with which the tester shall communicate from now on and
configures/establishes the communication channel to that ECU.

Info

This function is only to be used inside a CAPL tester node and must not be
called from inside a CAPL ECU node which simulates diagnostics.

In case you are implementing a diagnostic ECU simulator node, assign the
diagnostics database to the node by selecting the ECU’s name in the
Function/Node combo box of the Diagnostics configuration dialog /
Assigments tab.

After calling the function in the tester, the following actions are executed:

• From now on the tester will interpret and use all diagnostics objects in the CAPL code
of this node as defined in the respective diagnostic description file.
• From now on the tester will use the SeedKey DLL defined for this target in the
diagnostic configuration dialog when computing a security key with
DiagGenerateKeyFromSeed().
• All diagnostic objects (requests/responses) defined in the CAPL code are re-initialized
for the given target. If DiagSetTarget() was called for the same or a different target
before, the request/response objects will no longer keep modifications made in a
previous session with a previous target ECU.
• DiagSetTarget shall not be called in the "on prestart" handler of a test module, since
it would be called only once when the measurement starts. It is recommended to call
it in the "preparation" phase of an XML test module, or to make sure
programmatically that it is called before any test case using diagnostics is executed.
• The communication layer is configured:
• In case of a CAPL Callback interface (CCI) being used, the function
_Diag_SetChannelParameters is called to configure the parameters of the underlying
TP nodelayer DLL. For details on CAPL Callback Interfaces for diagnostics please see
AN-IND-1-012_CAPL_Callback_Interface.pdf (DOC installation folder).
• If no CCI is implemented, a built-in diagnostic channel is configured according to
the network type to which the diagnostics database is attached and according to
the communication parameters of the selected diagnostic interface. For
connection oriented transport protocols (like e.g. VW TP 2.0) furthermore not
only the parameters of the connection are configured, but a communication
channel is actually established between tester and ECU.

Parameters ecuName

Qualifier of the ECU as set in the diagnostic configuration dialog for the respective
diagnostic description (CDD/ODX).

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetTarget

5.0 Online mode — •

Example
on start
{
//In this example the DiagSetTarget(<ECU>) is simply called in the
//‘on start’ handler of a test node, as this tester only needs to access
//one dedicated ECU named LightControl_LF
//In case a test module needs to diagnose different ECUs, the function
could be
//called e.g. in the first / initializing test case of a test group for
each specific //ECU

if( 0 != DiagSetTarget( " LightControl_LF ")) write( "Error setting


target!");


}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetTimeout

DiagSetTimeout
CAPL Function Overview » Diagnostics » DiagSetTimeout

Syntax long DiagSetTimeout (DWORD timeout)

Function Specifies the request timeout.

Parameters timeout

Timeout in ms
Default: 1000 ms.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagSetTimeoutHandler

DiagSetTimeoutHandler
CAPL Function Overview » Diagnostics » DiagSetTimeoutHandler

Syntax long DiagSetTimeoutHandler (diagRequest obj, char callbackName[])

long DiagSetTimeoutHandler (char callbackName[])

Method diagRequest.SetTimeoutHandler (char callbackName[])

Function Sets the timeout callback for a request, or default timeout callback function. This
function will be called if no response arrives at the tester within the timeout specified
with DiagSetTimeout().

Parameters obj

Diagnostics object

callbackName

Callback name

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Online mode — •

7.0 SP3: method Online mode — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diag_SetupChannelCon

Diag_SetupChannelCon
CAPL Function Overview » Diagnostics » Diag_SetupChannelCon

Syntax long Diag_SetupChannelCon ();

Function This function communicates to CANoe, that a communication channel is available to the
communication partner and data can be sent.

For connectionless transport protocols this function can be called out of the callback
_Diag_SetupChannelReq.

Parameters —

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: _Diag_SetupChannelReq

_Diag_SetupChannelReq
CAPL Function Overview » Diagnostics » _Diag_SetupChannelReq

Note

If the transport protocol is not connection oriented, Diag_SetupChannelCon can be called


immediately. In ECU simulations this callback is not necessary, because ECUs never
initiate connections to the tester.

Syntax void _Diag_SetupChannelReq ();

Function With this function the CAPL program of a tester implementation will be requested to open
a channel to the ECU. After opening the channel the CAPL program can call the function
Diag_SetupChannelCon.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagStartTesterPresent

DiagStartTesterPresent
CAPL Function Overview » Diagnostics » DiagStartTesterPresent

Syntax DiagStartTesterPresent(char ecuQualifier[])

DiagStartTesterPresent()

Function Starts sending autonomous/cyclical Tester Present requests from CANoe to the specified
or current ECU.

Parameters ecuQualifier

Qualifier of the ECU as specified in the diagnostic configuration dialog, for which the
Tester Present service shall be started.

If no parameter is provided, sending of Tester Present requests is started for the current
diagnostic target (set by DiagSetTarget(char ecuQualifier[]).

Info

This function will only start the Tester Present service if in the calling CAPL
node no CAPL Callback interface for diagnostics is used.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Online mode — •

Example

| DiagGetTesterPresentState | DiagStopTesterPresent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagStartVariantIdentification

DiagStartVariantIdentification
CAPL Function Overview » Diagnostics » DiagStartVariantIdentification

Syntax long DiagStartVariantIdentification();

long DiagStartVariantIdentification(char ecuQualifier[]);

Function Start the automatic variant identification algorithm for the given target, or the currently
selected one if none is given. The algorithm will communicate via the CANdelaLib
channel, i.e. the CAPL callback functions are not used for the identification.

A tester module may wait for the completion of the algorithm with
TestWaitForDiagVariantIdentificationCompleted, or query the status of the identification
with DiagGetIdentifiedVariant.

Parameters ecuQualifier

ECU the identification algorithm should run for, not the currently selected one. If given,
DiagSetTarget does not have to be called.

Return values 0: No error, algorithm was started

<0: Error code, especially:

-98 No communication channel could be found for the target

-97 Automatic variant identification is not defined in the diagnostics description

-91 The variant identification algorithm is already running

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagStopTesterPresent

DiagStopTesterPresent
CAPL Function Overview » Diagnostics » DiagStopTesterPresent

Syntax DiagStopTesterPresent (char ecuQualifier[])

DiagStopTesterPresent ()

Function Stops sending autonomous/cyclical Tester Present requests from CANoe to the specified
or current ECU.

Parameters ecuQualifier

Qualifier of the ECU as specified in the diagnostic configuration dialog, for which the
Tester Present service shall be stopped.

If no parameter is provided, sending of Tester Present requests is stopped for the current
diagnostic target (set by DiagSetTarget(char ecuQualifier[]).

Info

This function will only stop the Tester Present service if in the calling CAPL
node no CAPL Callback interface for diagnostics is used.

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Online mode — •

Example

| DiagGetTesterPresentState | DiagStartTesterPresent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagUnmarkAllEcus

DiagUnmarkAllEcus
CAPL Function Overview » Diagnostics » DiagUnmarkAllEcus

Syntax long DiagUnmarkAllEcus ()

Function Clears all ECU markings.

Parameters —

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DiagUnmarkEcu

DiagUnmarkEcu
CAPL Function Overview » Diagnostics » DiagUnmarkEcu

Syntax long DiagUnmarkEcu (char[] qualifier)

Function Clears marking of the specified or current ECU.

Parameters qualifier

ECU identifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Online mode — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_AddECU

DoIP_AddECU
CAPL Function Overview » Diagnostics » DoIP_AddECU

Syntax void DoIP_AddECU( dword address)

Function Adds a valid DoIP ECU address to the DoIP layer.

Parameters address

Logical DoIP address of an ECU. You must set at least one logical ECU address (e.g. the
logical DoIP address of the DoIP entity).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
DoIP_AddECU( 0x200);
DoIP_AddECU( 0x201);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_AddTester

DoIP_AddTester
CAPL Function Overview » Diagnostics » DoIP_AddTester

Syntax void DoIP_AddTester( dword address)

Function Adds a valid DoIP tester address to the DoIP layer.

Parameters address

Logical DoIP address of a tester. You must set at least one valid logical tester address.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
dword address;
address = DiagGetCommParameter( “DoIP.TESTER_LogicalAddress")
DoIP_AddTester(address);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_DataCon

DoIP_DataCon
CAPL Function Overview » Diagnostics » DoIP_DataCon

Syntax void DoIP_DataCon( dword count)

Callback This callback is called from the DoIP layer when data was sent.

Parameters count

Size of the sent data in bytes.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
void DoIP_DataCon( dword count)
{
// pass up to the diagnostics layer
Diag_DataCon( count);
}

| Diag_DataCon |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_DataInd

DoIP_DataInd
CAPL Function Overview » Diagnostics » DoIP_DataInd

Syntax void DoIP_DataInd( byte buffer[], dword count, word address, dword
reserved)

Callback This callback is called from the DoIP layer when new data is received.

Parameters buffer

Buffer containing the received data.

count

Size of the received data in bytes.

address

Logical DoIP address the data was sent to

reserved

Reserved parameter.
Always 0.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
void DoIP_DataInd( byte buffer[], dword count,
word address, dword reserved)
{
// gateway processing here…
// pass data up to the diagnostics layer
Diag_DataInd( buffer, count, 0);
}

| Diag_DataInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_DataReq

DoIP_DataReq
CAPL Function Overview » Diagnostics » DoIP_DataReq

Syntax void DoIP_DataReq( byte buffer[], dword count, dword address, dword
reserved)

Function Call this function to pass data to the DoIP layer.

Parameters buffer

Buffer containing the data to be transmitted.

count

Size of data in bytes.

address

Logical DoIP address of the sending ECU.

reserved

Reserved parameter.
Set to 0.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
_Diag_DataRequest( BYTE data[], DWORD count,
long furtherSegments)
{
// send data via DoIP
DoIP_DataReq( data, count, gDoIPAddress, 0);
}

| _Diag_DataRequest |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_ErrorInd

DoIP_ErrorInd
CAPL Function Overview » Diagnostics » DoIP_ErrorInd

Syntax void DoIP_ErrorInd( int error)

Callback This callback is called from the DoIP layer when an error occurred.

Parameters error

Error code of the DoIP layer.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 Online mode — •

Example
void DoIP_ErrorInd( int error)
{
// pass up to the diagnostics layer
Diag_ErrorInd( error);
}

| Diag_ErrorInd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetAliveCheckTimeout

DoIP_SetAliveCheckTimeout
CAPL Function Overview » Diagnostics » DoIP_SetAliveCheckTimeout

Syntax void DoIP_SetAliveCheckTimeout( dword timeout)

Function Sets the alive check timeout parameter (T_TCP_Alive_Check) of the DoIP layer. This
function must be called in on preStart.

Parameters Timeout

The timeout parameter in milliseconds.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
// Set T_TCP_Alive_Check to 3s
DoIP_SetAliveCheckTimeout( 3000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetGenericTimeout

DoIP_SetGenericTimeout
CAPL Function Overview » Diagnostics » DoIP_SetGenericTimeout

Syntax void DoIP_SetGenericTimeout( dword timeout)

Function Sets the generic inactivity timeout parameter (T_TCP_Generic_Inactivity) of the DoIP
layer. This function must be called in on preStart.

Parameters Timeout

The timeout parameter in milliseconds.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
// Set T_TCP_Generic_Inactivity to 30s
DoIP_SetGenericTimeout( 30000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetInitialTimeout

DoIP_SetInitialTimeout
CAPL Function Overview » Diagnostics » DoIP_SetInitialTimeout

Syntax void DoIP_SetInitialTimeout( dword timeout)

Function Sets the initial inactivity timeout parameter (T_TCP_Initial_Inactivity) of the DoIP layer.
This function must be called in on preStart.

Parameters Timeout

The timeout parameter in milliseconds.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
// Set T_TCP_Initial_Inactivity to 3s
DoIP_SetInitialTimeout( 3000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetTesterUdpPort

DoIP_SetTesterUdpPort
CAPL Function Overview » Diagnostics » DoIP_SetTesterUdpPort

Syntax void DoIP_SetTesterUdpPort( dword port)

Function Sets the UDP port (UDP_TEST_EQUIPMENT_LISTEN) to be used by the DoIP layer. This
function must be called in on preStart.

Parameters port

The UDP_TEST_EQUIPMENT_LISTEN port of the test equipment.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
dword port;
port = DiagGetCommParameter( "DoIP.TESTER_UDP_Data");
// Set the tester UDP port
DoIPSetTesterUdpPort( port);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetVehicleAddress

DoIP_SetVehicleAddress
CAPL Function Overview » Diagnostics » DoIP_SetVehicleAddress

Syntax void DoIP_SetVehicleAddress( char address[])

Function Sets the address to be used by the DoIP layer. The address may be used to identify the
DoIP entity from the tester equipment. The function might be used to either set a VIN, an
IP address or a MAC address. In the current implementation only the VIN is supported.
This function must be called in on preStart.

Parameters address

The address of the DoIP layer. For example a VIN.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
// Set the vehicle ‘address’
char buffer[256];
DiagGetCommParameter( "DoIP.VEHICLE_Address",
0, buffer, elcount( buffer));
DoIP_SetVehicleAddress( buffer);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetVehicleInterface

DoIP_SetVehicleInterface
CAPL Function Overview » Diagnostics » DoIP_SetVehicleInterface

Syntax void DoIP_SetVehicleInterface( char interface[])

Function Sets the network interface to be used by the DoIP layer. This function must be called in
on preStart.

Parameters interface

The name of the network interface.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
// Set the network interface
char buffer[256];
DiagGetCommParameter( "DoIP.VEHICLE_Interface",
0, buffer, elcount( buffer));
DoIP_SetVehicleInterface( buffer);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetVehicleTcpPort

DoIP_SetVehicleTcpPort
CAPL Function Overview » Diagnostics » DoIP_SetVehicleTcpPort

Syntax void DoIP_SetVehicleTcpPort( dword port)

Function Sets the TCP port (TCP_DATA) to be used by the DoIP layer. This function must be called
in on preStart.

Parameters port

The TCP_DATA port of the DoIP layer.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
dword port;
port = DiagGetCommParameter( "DoIP.VEHICLE_TCP_Data");
// Set the vehicle TCP port
DoIP_SetVehicleTcpPort( port);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: DoIP_SetVehicleUdpPort

DoIP_SetVehicleUdpPort
CAPL Function Overview » Diagnostics » DoIP_SetVehicleUdpPort

Syntax void DoIP_SetVehicleUdpPort( dword port)

Function Sets the UDP port (UDP_VEHICLE_LOCAL) to be used by the DoIP layer. This function must
be called in on preStart.

Parameters port

The UDP_VEHICLE_LOCAL port of the DoIP layer.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 — — •

Example
dword port;
port = DiagGetCommParameter( "DoIP.VEHICLE_UDP_Data");
// Set the vehicle UDP port
DoIP_SetVehicleUdpPort( port);

| DiagGetCommParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportWriteDiagObject, TestReportWriteDiagResponse

TestReportWriteDiagObject, TestReportWriteDiagResponse
CAPL Function Overview » Diagnostics » TestReportWriteDiagObject, TestReportWriteDiagResponse

Syntax TestReportWriteDiagObject (diagRequest req);

TestReportWriteDiagObject (diagResponse resp);

TestReportWriteDiagResponse (diagRequest req);

Function TestReportWriteDiagObject writes a test step with a textual interpretation of the


specified request or response object into the test report.

TestReportWriteDiagResponse writes a test step with a textual interpretation of the


received response for the specified request object into the test report.

These test steps are subject to the common test step report filtering as configured in the
Test Module Configuration dialog.

Parameters req

Request

resp

Response

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

Using Diagnostics Functions in Test Cases

| Test Feature Set CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForDiagRequestSent

TestWaitForDiagRequestSent
CAPL Function Overview » Diagnostics » TestWaitForDiagRequestSent

Note

This function can only be called within a test module!

Syntax long TestWaitForDiagRequestSent (diagRequest request, dword timeout);

Function Waits until the previously sent request has been sent to the ECU.
This might be triggered by a call of the function Diag_DataCon() at the CAPL Callback
Interface.

Parameters request

Sent request

timeout [ms]

Maximum wait time

Return values <0: An internal error occurred, e.g. a faulty configuration of the Diagnostic Layer.

0: The timeout was reached, i.e. the event of interest did not occur within the specified
time.
1: The event occurred.
Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test mode — •

Example
DiagRequest SerialNumber_Read req;
long result;

DiagSetTarget("Door");
req.SendRequest();
// waits until request is completely sent
if (TestWaitForDiagRequestSent(req, 2000)== 1)
TestStepPass("Request was sent successfully!");
else
TestStepFail("Request could not be sent!");
TestWaitForDiagResponse(req, 2000)

| Test Feature Set CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForDiagResponse

TestWaitForDiagResponse
CAPL Function Overview » Diagnostics » TestWaitForDiagResponse

Note

This function can only be called within a test module!

Syntax long TestWaitForDiagResponse (diagRequest request, dword timeout);

long TestWaitForDiagResponse (dword timeout);

Function Waits for the arrival of the response to the given request.

The function will return immediately after a positive or negative reponse - other than
"responsePending" - was received within the configured protocol (P2/P2*) timings.

Intermediate "responsePending" NRCs from the target ECU will automatically prolong the
wait timer of the tester in P2* increments until maximally <timeout> [ms]. If by then no
response has been received from the ECU target, the function will return with value <0,
timeoutReached>.

In case the tester node implements a "CAPL callback interface for diagnostics" (CCI), but
has no further provisions to handle NRCs on its own right, the behaviour is equivalent to
the one described above (automated "responsePending" handling).

If the tester implements a CCI and handles "responsePending" messages by itself - calling
DiagSetP2Extended(-1) beforehand on the CCI - then this function will also treat
"reponsePending" as a regular negative reponse code and will return immediately after
having received such a negative response.

Parameters request

Sent request

timeout [ms]

Maximum wait time

Return values <0: An internal error occurred, e.g. a faulty configuration of the Diagnostic Layer.

0: The timeout was reached, i.e. the event of interest did not occur within the specified
time.
1: The event occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

Using Diagnostics Functions in Test Cases

| Test Feature Set CAPL Functions | TestJoinDiagResponseFromEcu |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForDiagResponseStart

TestWaitForDiagResponseStart
CAPL Function Overview » Diagnostics » TestWaitForDiagResponseStart

Note

This function can only be called within a test module!

Syntax long TestWaitForDiagResponseStart (diagRequest request, dword timeout)

long TestWaitForDiagResponseStart (dword timeout);

Function Waits for the arrival of the response to a sent request, e.g. the so-called "First Frame" in
ISO TP transmissions.
One way this function might be triggered is by Diag_FirstFrameInd() at the CAPL
Callback Interface, but only if this has been implemented suitably. When other protocols
or interfaces are used this call might be omitted. Then the function rolls back after the
response has been fully received.

Parameters request

Sent request

timeout [ms]

Maximum wait time

Return values <0: An internal error occurred, e.g. a faulty configuration of the Diagnostic Layer.

0: The timeout was reached, i.e. the event of interest did not occur within the specified
time.
1: The event occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example
DiagRequest SerialNumber_Read req;
long result;

DiagSetTarget("Door");
req.SendRequest();
// waits for the start of the response reception
if (TestWaitForDiagResponseStart(req, 2000)== 1)
TestStepPass("Starting response reception!!");
else
TestStepFail("No response!");
TestWaitForDiagResponse(req, 2000)

| Test Feature Set CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForDiagVariantIdentificationCompleted

TestWaitForDiagVariantIdentificationCompleted
CAPL Function Overview » Diagnostics » TestWaitForDiagVariantIdentificationCompleted

Syntax long TestWaitForDiagVariantIdentificationCompleted();

long TestWaitForDiagVariantIdentificationCompleted( char


expectedVariant[]);

Function Wait for the completion of the automatic variant identification algorithm. If the qualifier
of an expected variant is given, an error is returned if a different variant is identified.

Parameters expectedVariant

Qualifier of the variant that should be identified.

Return values 1: Identification algorithm finished successfully

0: Timeout (10 seconds)


<0: Error code, especially:

-100 Variant identification not running - DiagStartVariantIdentification must be called!

-98 No variant was identified, i.e. the algorithm failed

-90 TestWaitFor... functions are only possible in tester modules

-83 The identified variant was not the expected one

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on diagRequest

on diagRequest
CAPL Function Overview » Diagnostics » on diagRequest

Syntax on diagRequest

Function The procedure is sub-divided into the following events; the first matching event procedure
(top-down) is called:

• on diagRequest <service>
• (1)
on diagRequest <class>::<instance>::<service>

Is called when a request is received in the ECU simulation that belongs to the
indicated diagnostics service.

• (1)
on diagRequest <class>::<instance>::*

Is called when the service of the request received belongs to the specified class and
instance.

This procedure may therefore be called for several services!

• on diagRequest <class>::*

Is called when the service of the request received belongs to the specified class.

This procedure may therefore be called for several services!

• on diagRequest *

Is called when no other event procedure matches.

This procedure may therefore be called for several services!


_______________________

(1) While the CANdela process knows the concept of a "diagnostics instance", ODX does not. Starting with CANoe 7.0
it is possible to use new unique service qualifiers, while CAPL programs for earlier CANoe versions might indicate
the equivalent long qualifier path.

It is not recommended to mix these forms of declaration!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on diagRequestSent

on diagRequestSent
CAPL Function Overview » Diagnostics » on diagRequestSent

Syntax on diagRequestSent

Function The procedure is sub-divided into the following events; the first matching event procedure
(top-down) is called:

• on diagRequestSent <service>

Is called when a request is received in the ECU simulation that belongs to the
indicated diagnostics service.

• *on diagRequest <class>::*

Is called when the service of the request received belongs to the specified class.

• on diagRequest <class>::*

Is called when the service of the request received belongs to the specified class.

This procedure may therefore be called for several services!

• on diagRequestSent *

Is called when no other event procedure matches.

This procedure may therefore be called for several services!

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 — — •

Example
on diagRequestSent *
{
// A request was sent, therefore on LIN the schedule has to be changed
linChangeSchedTable( cSchedulingTableForDiagResponse);
}

on diagRequestSent ECU_SoftReset
{
// The ECU will perform a reset for some time, so inform the rest of the
CAPL program
gECUisResetting = 1;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on diagResponse

on diagResponse
CAPL Function Overview » Diagnostics » on diagResponse

Syntax on diagResponse

Function The procedure is sub-divided into the following events; the first matching event procedure
(top-down) is called:

• on diagResponse <ECU>.<service>
• (1)
on diagResponse <ECU>.<class>::<instance>::<service>

Is called when a response from the indicated ECU (specified with its ECU qualifier) is
received in the tester that belongs to the indicated diagnostics service.

This is especially useful in situations where the tester program communicates with more
than one diagnostics targets, e.g. sending functional requests.

• on diagResponse <service>
• (1)
on diagResponse <class>::<instance>::<service>

Is called when a response is received in the tester that belongs to the indicated
diagnostics service.

• (1)
on diagResponse <ECU>.<class>::<instance>::*
• (1)
on diagResponse <class>::<instance>::*

Is called when the service of the response received belongs to the specified class and
instance. If an ECU qualifier is given, the procedure is called only when the response was
sent by this ECU.

This procedure may therefore be called for several services!

• on diagResponse <ECU>.<class>::*
• on diagResponse <class>::*

Is called when the service of the response received belongs to the specified class. If an
ECU qualifier is given, the procedure is called only when the response was sent by this
ECU.

This procedure may therefore be called for several services!

• on diagResponse <ECU>.*
• on diagResponse *

Is called when no other event procedure matches. If an ECU qualifier is given, the
procedure is called only when the response was sent by this ECU.

This procedure may therefore be called for several services!


_______________________

(1) While the CANdela process knows the concept of a "diagnostics instance", ODX does not. Starting with CANoe 7.0
it is possible to use new unique service qualifiers, while CAPL programs for earlier CANoe versions might indicate
the equivalent long qualifier path.

It is not recommended to mix these forms of declaration!

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: on diagResponse

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Access Mode

Diagnostics: Access Mode


CAPL Function Overview » Diagnostics » Access Mode

Parameter access functions can access to the transmitted value as follows:

0 numerical: Access to the transmitted numerical value.

1 physical: Access to the value calculated from the transmitted numerical value (is also displayed
symbolical as text).

2 coded: Immediate transformation into a numeric type (up to 32 bit), i.e. floating point values will also
be provided in their internal description (bit form).

| DiagGetComplexParameter | DiagGetComplexRespParameter | DiagGetParameter | DiagGetRespParameter |


DiagSetComplexParameter | DiagSetParameter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Basic CAPL Procedure for an ECU Implementation

Diagnostics: Basic CAPL Procedure for an ECU Implementation


CAPL Function Overview » Diagnostics » Basic CAPL Procedure for an ECU Implementation

Preparation:

On the configuration dialog of the diagnostics observer, a description must be assigned to the simulation
node!

Example

The CAPL program waits for requests from the tester and can then send a response:
on diagRequest CALIBRATION::Parametrierung::Lesen {
DiagResponse CALIBRATION::Parametrierung::Lesen resp;
DiagSetParameter( resp, "Parameter1", 0.37);
DiagSendResponse( resp);
}

It is possible to react to several requests:


on diagRequest CALIBRATION::* {
DiagSendNegativeResponse( this, DiagGetNegCode( "SNS")); // Service not
supported
}

Here the method which qualifier path has the longest match with that of the object will be
called.

Info

The length of the elements of a qualifier path from the CANdela description file is limited to 50
characters in the CAPL Compiler. Longer names may exceed this limit, but the CAPL program
cannot be compiled. Nevertheless, it is possible to specify the qualifier path as a text string in
quotation marks: "<Qualifier Path>". In this case the qualifier path may be up to 255 characters
in length.

| Connection of the Communication Layer | Basic CAPL Procedure for a Tester Implementation | Expanded Functions in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Basic CAPL Procedure for a Tester Implementation

Diagnostics: Basic CAPL Procedure for a Tester Implementation


CAPL Function Overview » Diagnostics » Basic CAPL Procedure for a Tester Implementation

This example explains how to implement

• a CAPL test module for the test setup or


• a CAPL tester for the simulation setup

Example

Selection of the target control device:


DiagSetTarget( "TestECU");

Create and send a request:


diagRequest CALIBRATION::Parametrierung::Lesen req;

DiagSendRequest(req);

Changing the parameters of a request:


diagRequest CALIBRATION::Parametrierung::Lesen req;
DiagSetParameter( req, "Parameter1", 0.25);
rawData[0] = 2500 / 256; rawData[1] = 2500 % 256; // set raw data bytes
DiagSetParameterRaw( req, "Parameter1", rawData, 2);

Reception of a response object, access to symbolic values:


on diagResponse CALIBRATION::Parametrierung::Lesen {
double out[1]; // numeric parameter
DiagGetParameter( this, "Parameter2", out);
// Symbolic representation of the parameter value.
DiagGetParameter( this, "Parameter2", gValueString, gStringLen);
}

Reception of a timeout indication:


{ // ...
DiagSetTimeoutHandler( "DefaultTimeoutHandler")
DiagSetTimeoutHandler( request1, "Request1TimeoutHandler");
}
DefaultTimeoutHandler() {
// ...
}
Request1TimeoutHandler() {
// ...
}

Info

The length of the elements of a qualifier path from the CANdela description file is limited to 50
characters in the CAPL Compiler. Longer names may exceed this limit, but the CAPL program
cannot be compiled. Nevertheless, it is possible to specify the qualifier path as a text string in
quotation marks: "<Qualifier Path>". In this case the qualifier path may be up to 255 characters
in length.

| Connection of the Communication Layer | Basic CAPL Procedure for an ECU Implementation | Expanded Functions in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

Diagnostics: Connection of the Communication Layer


CAPL Function Overview » Diagnostics» Connection of the Communication Layer

The diagnostics commands in CAPL allow access to the diagnostics services and data using symbols that
were defined in the CANdela description file. For communication, this data must be transmitted, where
two ways are available:

• In a tester node or test module, a call to DiagSetTarget suffices. It will connect the tester to the ECU
via the so called CANdelaLib channel provided by CANoe.
• In an ECU simulation it is necessary to implement the CAPL callback interface. This interface consists
of a set of functions implemented in CAPL that are called by CANoe to trigger actions, and special
CAPL functions implemented by CANoe that forward transport protocol events to CANoe.

This interface may also be used in tester nodes and test modules if direct access to the transport protocol
is necessary, e.g. to perform fault injection.

CAPL callback interface for diagnostics

• _Diag_SetChannelParameters: This function is called by CANoe to indicate that a new communication


"channel" to the ECU or tester should be opened. Typically the settings configured for the ECU are
queried and the transport protocol layer is configured.
• _Diag_DataRequest: CANoe triggers the sending of data to the peer, i.e. in an ECU simulation, the
bytes representing the response primitive will be given to be forwarded to the transport protocol. In a
tester, the bytes represent the request primitive.
• _Diag_SetupChannelReq (in testers only): For connection-oriented transport protocols the tester has to
establish a communication channel to the ECU. Once the channel is available, the tester has to call
Diag_SetupChannelCon.

For connectionless transport protocols, Diag_SetupChannelCon can be called immediately.

Depending on the transport protocol implementation used, the events the CAPL program receives have to
be forwarded to CANoe.
Please refer to these functions for details:

• Diag_DataInd
• Diag_ErrorInd
• Diag_DataCon
• Diag_FirstFrameInd

The following code fragments show a possible implementation of this interface for CAN or LIN using the
ISO transport protocol. These fragments may be used inside simulation nodes, test nodes, test modules
(CAPL) and test case libraries. Within CANoe transport protocol functions are provided as nodelayer DLL
OSEK_TP.dll and LINtp.dll respectively.

For special applications in the course of ECU test and development those functions may be modified e.g.
for inducing transmission errors for robustness tests (see OSEK_TP_EN.pdf (DOC installation folder)
"Appendix: Fault injection support").

Reference Implementation CAN

The implementation of the generic CAPL callback interface for the OSEK_TP.DLL which follows here can
be found as CCI_Implementation.cin file in the demo folder Demo_CAN_CN\Diagnostics\UDSSim\Nodes.
You can find the file location in the Options dialog (Application Settings|File Locations).

You can include the CCI_Implementation.cin file directly into your simulations program.
_Diag_SetChannelParameters()
{
long value;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

// Close a possible database connection to make sure that this module has full
control over the // settings
if( CanTpGetDBConnection() > 0)
{
CanTpCloseConnection( CanTpGetDBConnection());
}

if( gHandle > 0)


{
CanTpCloseConnection( gHandle);
gHandle = 0;
}

if( gHandleFunctional > 0)


{
CanTpCloseConnection( gHandleFunctional);
gHandleFunctional = 0;
}

// Configure the physical connection


value = DiagGetCommParameter( "CANoe.AddressMode");

switch( value)
{
case 0: // Normal addressing
gHandle = CanTpCreateConnection(0);
CanTpSetTxIdentifier( gHandle, DiagGetCommParameter( "CANoe.TxId"));
CanTpSetRxIdentifier( gHandle, DiagGetCommParameter( "CANoe.RxId"));
writeDbgLevel(1, "%s: Normal [0x%x, 0x%x]", gECU, DiagGetCommParameter(
"CANoe.TxId"), DiagGetCommParameter( "CANoe.RxId"));
break;

case 1: // extended addressing


value = DiagGetCommParameter( "CANoe.BaseAddress");
if( value != -98)
{
// This is the extended/based address approach
gHandle = CanTpCreateConnection( 1);
CanTpSetBaseIdentifier( gHandle, value);
CanTpSetTargetAddress( gHandle, DiagGetCommParameter( "CANoe.TgtAddr"));
CanTpSetEcuAddress( gHandle, DiagGetCommParameter( "CANoe.EcuAddr"));
writeDbgLevel(1, "%s: Extended/base [0x%x, 0x%x, 0x%x]", gECU,
DiagGetCommParameter( "CANoe.BaseAddress"),DiagGetCommParameter"CANoe.TgtAddr"),
DiagGetCommParameter( "CANoe.EcuAddr"));
}
else
{
// There is a TxId, therefore deactivate Id from adr etc.
gHandle = CanTpCreateConnection( 5);
value = DiagGetCommParameter( "CANoe.TxId");
CanTpSetTxIdentifier( gHandle, DiagGetCommParameter( "CANoe.TxId"));
CanTpSetRxIdentifier( gHandle, DiagGetCommParameter( "CANoe.RxId"));
CanTpSetTargetAddress( gHandle, DiagGetCommParameter( "CANoe.TgtAddr"));
CanTpSetEcuAddress( gHandle, DiagGetCommParameter( "CANoe.EcuAddr"));
writeDbgLevel(1, "%s: Extended/free [0x%x, 0x%x, 0x%x, 0x%x]", gECU,
DiagGetCommParameter( "CANoe.TxId"), DiagGetCommParameter( "CANoe.RxId"),
DiagGetCommParameter( "CANoe.TgtAddr"), DiagGetCommParameter( "CANoe.EcuAddr"));
}
break;

case 2: // NormalFixed addressing


gHandle = CanTpCreateConnection( 2);
CanTpSetTargetAddress( gHandle, DiagGetCommParameter( "CANoe.TgtAddr"));
CanTpSetEcuAddress( gHandle, DiagGetCommParameter( "CANoe.EcuAddr"));
CanTpSetTxPriority( gHandle, DiagGetCommParameter( "CANoe.TxPrio"));
CanTpSetFlowControlPriority( gHandle, DiagGetCommParameter( "CANoe.TxPrio"));
writeDbgLevel(1, "%s: NormalFixed [0x%x, 0x%x, 0x%x]", gECU,
DiagGetCommParameter( "CANoe.TgtAddr"), DiagGetCommParameter( "CANoe.EcuAddr"),
DiagGetCommParameter( "CANoe.TxPrio"));
break;

case 3: // Mixed addressing (29 bit)


gHandle = CanTpCreateConnection( 3);
CanTpSetTargetAddress( gHandle, DiagGetCommParameter( "CANoe.TgtAddr"));
CanTpSetEcuAddress( gHandle, DiagGetCommParameter( "CANoe.EcuAddr"));
CanTpSetTxPriority( gHandle, DiagGetCommParameter( "CANoe.TxPrio"));
CanTpSetFlowControlPriority( gHandle, DiagGetCommParameter( "CANoe.TxPrio"));
CanTpSetAddressExtension( gHandle, DiagGetCommParameter( "CANoe.AddrExt"));
writeDbgLevel(1, "%s: Mixed 29 bit [0x%x, 0x%x, 0x%x, 0x%x]", gECU,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

DiagGetCommParameter( "CANoe.TgtAddr"), DiagGetCommParameter( "CANoe.EcuAddr"),


DiagGetCommParameter( "CANoe.TxPrio"), DiagGetCommParameter( "CANoe.AddrExt"));
break;

default:
write( "%s: Unsupported addressing mode!", gECU);
}

// Configure common protocol parameters


CanTpSetBlockSize( gHandle, DiagGetCommParameter( "CANoe.Blocksize"));
CanTpSetSTmin( gHandle, DiagGetCommParameter( "CANoe.STmin"));
value = DiagGetCommParameter( "CANoe.Padding");
CanTpSetPadding( gHandle, value);

if( value >= 0 && value < 256)


{
writeDbgLevel(1, "%s: Padding to DLC=8 with byte 0x%02x", gECU, value);
}
else if( value == -1)
{
writeDbgLevel(1, "%s: Using variable length DLC", gECU);
}
else if( value == 256)
{
writeDbgLevel(1, "%s: Padding to DLC=8 without initialization", gECU);
}
else
{
writeDbgLevel(1, "%s: Unknown padding mode!", gECU, value);
}

// Configure functional request connection, if defined


// Note that only one direction is configured!
value = DiagGetFunctionalGroupId();

if( value != -1)


{
// Does the first byte contain the target address, i.e. the group?
if( DiagGetFunctionalGroupExt() < 0)
{
// No target address in first byte, so either normal or normal fixed addressing
if( DiagGetFunctionalGroupIdMask() == -1)
{
// Using normal mode for functional requests
gHandleFunctional = CanTpCreateConnection( 0);
if( cIsTester)
{
CanTpSetTxIdentifier( gHandleFunctional, value);
}
else
{
CanTpSetRxIdentifier( gHandleFunctional, value);
}
}
else
{
// NormalFixed mode since the priority bits are masked out
gHandleFunctional = CanTpCreateConnection( 2);
CanTpSetAddressType( gHandleFunctional, 1);
if( cIsTester)
{
CanTpSetTargetAddress( gHandleFunctional, (value >> 8) & 0xFF);
CanTpSetEcuAddress( gHandleFunctional, value & 0xFF);
}
else
{
CanTpSetEcuAddress( gHandleFunctional, (value >> 8) & 0xFF);
}
}
}
else
{
// There is a target address in the first byte, so either extended or mixed
mode
if( DiagGetFunctionalGroupIdMask() == -1)
{
// No masking, so use extended/free mode
gHandleFunctional = CanTpCreateConnection( 5);
if( cIsTester)
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

CanTpSetTxIdentifier( gHandleFunctional, value);


CanTpSetTargetAddress( gHandleFunctional, DiagGetFunctionalGroupExt());
}
else
{
CanTpSetRxIdentifier( gHandleFunctional, value);
CanTpSetEcuAddress( gHandleFunctional, DiagGetFunctionalGroupExt());
}
}
else
{
// There is masking, so mixed mode
gHandleFunctional = CanTpCreateConnection( 3);
CanTpSetAddressType( gHandleFunctional, 1);
CanTpSetAddressExtension( gHandleFunctional, DiagGetFunctionalGroupExt());

if( cIsTester)
{
CanTpSetTargetAddress( gHandleFunctional, (value >> 8) & 0xFF);
CanTpSetEcuAddress( gHandleFunctional, value & 0xFF);
}
else
{
CanTpSetEcuAddress( gHandleFunctional, (value >> 8) & 0xFF);
}
}
}
}
}

_Diag_DataRequest( BYTE data[], DWORD count, long furtherSegments)


{
if(gSendNextRequestFunctionally) // a request should be sent functionally
{
if( !gHandleFunctional)
return; // Not configured, so make sure an error is reported!

writeDbgLevel(1, "%s: Functional DataRequest %d byte: %02x ...",gECU, count,


data[0]);

CanTpSendData(gHandleFunctional, data, count); // Send data on the functional


connection

'gSendNextRequestFunctionally = 0;

return;
}

// Send physically
writeDbgLevel(1, "%s: DataRequest %d byte: %02x ...",gECU, count, data[0]);

CanTpSendData(gHandle, data, count); // Send data on the physical connection


}

_Diag_SetupChannelReq()
{
// This callback function is mandatory in tester nodes
// If used in simulation nodes it is not called
Diag_SetupChannelCon();
}

CanTp_ErrorInd( long handle, long error)


{
char cErrorText[12][30] = { "(no error)"
, "Timeout while waiting for CF" // 1
, "Timeout while waiting for FC" // 2
, "Wrong Sequence Number" // 3
, "TP_DLL busy" // 4
, "Unexpected PDU" // 5
, "Timeout waiting for Tx-Ack" // 6
, "WFT Overrun" // 7
, "Buffer overflow" // 8
, "Wrong parameter" // 9

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

, "Invalid FlowStatus received" // 10


, "Transfer abort requested" // 11
};

if( error < elcount(cErrorText))


{
writeDbgLevel( 1, "%s: CanTp_ErrorInd(%d): %s", gECU, error, cErrorText[error]);
}
else
{
writeDbgLevel( 1, "%s: CanTp_ErrorInd(%d): unknown error!", gECU, error);
}

Diag_ErrorInd( error);
}

CanTp_FirstFrameInd( long handle, DWORD length)


{
writeDbgLevel(1,"%s: CanTp_FirstFrameInd", gECU);

diag_FirstFrameInd( 0, 1, length);
}

CanTp_ReceptionInd( long handle, BYTE data[])


{
writeDbgLevel(1,"%s: CanTp_ReceptionInd", gECU);

gLastRequestWasReceivedFunctionally = (handle == gHandleFunctional ? 1 : 0);

Diag_DataInd( data, elcount( data), CanTpGetSenderAddress());


}

CanTp_SendCon( long handle, DWORD txCount)


{
writeDbgLevel(1,"%s: CanTp_SendCon", gECU);
Diag_DataCon( txCount);
}

Reference Implementation LIN

Please adapt the node name gECU to your actual configuration.


variables
{
char gECU[10] = "ECU1";
long gNodeAddress;
}

_Diag_DataRequest( byte data[], DWORD count, long flag)


{
write( "%s: _Diag_DataRequest", gECU);
// Get the AddressExtension!
LINtp_DataReq(data, count, gNodeAddress);
}

_Diag_SetChannelParameters()
{
gNodeAddress = diagGetCommParameter("CANoe.AddrExt");
write( "%s: _Diag_SetChannelParameters: node address is %d"
, gECU, gNodeAddress);
}

_Diag_SetupChannelReq()
{
write( "%s: _Diag_SetupChannelReq", gECU);
Diag_SetupChannelCon();
}

LINtp_DataInd( long count)


{
BYTE data[4095];
write( "%s: LINtp_DataInd(%d)", gECU, count);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Connection of the Communication Layer

LINtp_GetRxData(data, count);
Diag_DataInd(data, count, 0);
}

LINtp_ErrorInd( int error)


{
write( "%s: LINtp_ErrorInd(%d)", gECU, error);
Diag_ErrorInd(error);
}

| Expanded Functions in CAPL | Basic CAPL Procedure for an ECU Implementation | Basic CAPL Procedure for a Tester
Implementation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics Descriptions with Overloaded Responses

Diagnostics Descriptions with Overloaded Responses


CAPL Function Overview » Diagnostics » Diagnostics Descriptions with Overloaded Responses

Introduction

ODX allows the specification of more than one positive response primitive for a diagnostics service (also
for negative responses). A diagnostics client (i.e. tester) cannot know which one of the valid primitives the
ECU will respond a request with. Therefore it may have to try all primitives of the service until finding one
that matches the received data.

Use Cases

The following use cases exist:

• Interpretation of diagnostics data: If a primitive exists that matches the data without error, this
primitive is displayed in the trace. Otherwise one of the primitives is used to interpret the data, and
errors are indicated at the respective parameters.
• Accessing the parameters in the response primitive in the tester: Upon reception of the response data,
CANoe will automatically use a primitive that matches without error. If no such primitive exists,
CANoe will use one of the available primitives for interpretation. In this case, not all parameters may
be available to the CAPL program.
• Forcing CANoe to use a specific primitive for interpretation: The program can ask CANoe to interpret
the data in the response object using a specific existing primitive. Parameters matching the primitive
definition will be available symbolically afterwards. The following functions are available for this:
• DiagInterpretAs
• DiagInterpretRespAs
• Check if the response received conforms to the definition for one specific primitive:
• DiagCheckValidPrimitive
• DiagCheckValidRespPrimitive
• Initializing a diagnostics object using a specific primitive definition: In CAPL you can initialize
diagnostics objects by specifying a service qualifier. This will initialize the object with the first
primitive defined, i.e. if the service defines several primitives, the program has to select one of them
explicitly. This can be achieved by using this function:
• DiagInitialize

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Error Code

Diagnostics: Error Code


CAPL Function Overview » Diagnostics » Error Code

The following values can be returned:

Error Error String Description ToDo


Code

0 No error, success.

>0 Number, e.g. length of


the given text.

-100 The input provided on The arguments provided to Check the arguments provided to the
function call is not a CAPL function call are not function call.
consistent or sufficient. usable.

Examples are: exceeding a


range for a parameter value
or byte position.

-99 The object's response is The diagnostics object is Delay the operation until the object is no
pending, therefore still in use, therefore the longer accessed.
cannot delete it. operation is not possible.

-98 The handle is not A diagnostics object was • Check that the initialization of the
assigned to a referred to that does not object worked, i.e. DiagSetTarget
diagnostics object. (no longer) exist, or there is was successful.
no target with the given
Invalid diagnostics • Make sure that the object is valid in
qualifier.
object handle the current target's context, i.e. the
encountered! service it is declared with is defined
in the target's description.
No diagnostics
• When accessing the last response
description for ECU
stored at a request, make sure that a
qualifier '...' found!
response has been received for the
request.

-97 The parameter does not An operation on a • Make sure that the parameter exists
exist in this object, or is parameter is not possible, in the diagnostics object. Some
constant. because it cannot be found primitives may hold different
or is not accessible. parameters depending on their data.
Parameter '...' not
found or has wrong • If a parameter is declared constant
type! in the description, its value cannot
be changed.
Parameter '...' is
• If the type of a parameter does not
declared constant!
allow the operation specified, this
Error accessing complex error will be given.
parameter: '...', sub-
parameter '...' not
found or constant.

-96 Function not The function called has not


implemented yet. been implemented yet.

-95 Accessing CANdelaLib An operation performed on • The details in the warning will
lead to error '...' for '...' the diagnostics objects

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Error Code

Parameter or object '...' contradicts the definitions provide additional information.


not defined! in the diagnostics
• Make sure the parameter is defined
descriptions.
Value conversion for in the accessed diagnostics object.
parameter '...' failed: • Make sure to provide a valid
... symbolic/physical parameter value
for conversion.

-94 Diagnostics was not The operation is not • Make sure DiagSetTarget is called
initialized for the node, possible because and sets an existing target
i.e. no SetEcu/Target DiagSetTarget has not been successfully. A network description
called. called in a tester yet, or has to be selected in order to use
there is no diagnostics certain network request functions.
Diagnostics not description assigned to the
initialized! A tester • Assign a diagnostics description to
simulation node (for
must call the ECU simulation node.
diagnostics server
DiagSetTarget() e.g. simulation).
Network request
interface not found!

-93 The specified callback Please refer to Diagnostics: Connection


was not found. of the Communication Layer for details
on the CAPL callback interface.

-92 There was an error on The transport protocol (TP) Check the Write window for further
TP level. layer has reported a information. Check the communication
transmission error. sequence in the Trace window for
possible problems.

-91 Only one It is possible to send only Make sure that the processing of the
request/response can one diagnostics object at a previous object is finished.
be sent at a time! time, i.e. while the object
is processed for sending, no
other object can be sent.

-90 Test function outside Some functionality is only Requests can only be sent from nodes
TestCase, or Tester-only available in a tester or a configured as tester, i.e. DiagSetTarget
function called in ECU, test case in a test module. must have been called successfully.
or vice-versa.
Responses can only be sent from nodes
configured to be diagnostics server
simulations, i.e. a diagnostics description
must have been assigned to them.

TFS functionality is only available in test


modules, e.g. waiting for a response with
TestWaitForDiagResponse or writing a
diagnostics object to the test report with
TestReportWriteDiagObject.

-89 No seed and key library No seed&key dll was Configure a seed&key DLL.
was specified. specified in the diagnostic
configuration.

-88 The seed and key The seed&key dll does not Configure a seed&key DLL.
library did not contain a contain a valid seed&key
matching seed and key function.
function.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Error Code

-87 The seed and key Ensure that the correct seed&key path
library couldn't be and filename is configured.
loaded.

-86 The buffer was too Increase the buffer size.


small.

-85 The seed array size is Decrease the seed array size.
too large.

-84 The security level is Use a correct security level.


invalid.

-83 The variant is invalid. Use a supported variant.

-82 An unspecified error


occurred.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Expanded Functions in CAPL

Diagnostics: Expanded Functions in CAPL


CAPL Function Overview » Diagnostics » Expanded Functions in CAPL

As of CANoe 5.0 it is possible to access CANdela Studio diagnostics descriptions within CAPL programs:

• With the configuration of the diagnostics observer, a description can be assigned to a simulation node.
The CAPL program of this node is then regarded as an implementation of the diagnostics functionality
of this ECU (ECU implementation) and thus all defined services are recognized.
• For the implementation of a diagnostics tester it is possible to select the target ECU in the CAPL
program, i.e. to choose the corresponding diagnostics description.
• Request and response objects can be generated using their qualifier.
• In the CAPL program, diagnostics services, parameters, and parameter values can be accessed
symbolically.
• The arrival of requests and responses can be processed via event procedures.
• The connection to the communication layer occurs via CAPL callbacks, whereby the full control over
the communication is retained for development and test. For standard applications, corresponding
implementations are already available.
• Usage in Test modules: Effective with CANoe 5.0 SP3 it is possible within test modules to wait on
diagnostics events. After sending a request you can wait for a response without programming a state
machine. You have access to the response of the ECU.

Starting with CANoe 7.5 it is also possible to access basic diagnostics ECUs from within CAPL. Only
functions for the diagnostic tester side are supported, simulation of basic diagnostics ECUs is not
supported. Details whether a function is supported for Basic Diagnostics can be found in the
documentation of each function.

Limitations

Please note the following limitations of the diagnostics functions:

• Presently, a node can only implement the diagnostics functions of one ECU. The tester node cannot
communicate in parallel with several ECUs simultaneously (it is, however, possible to work with
different ECUs one after the other or to use several tester nodes).

Additional Remarks

• To specify a service its qualifier path from the CANdela diagnostics description is used. You can find
and compose the qualifier path in CANdelaStudio under Properties (right mouse key for "class",
"instance" and "service") or you can determine it in CANoe/DENoe with the following procedure:
• Open the diagnostics console of the diagnostics description in which the searched service is
defined.
• Choose the wished service out of the tree view.
• Take over the shown qualifier path in a CAPL program.

Info

"/" must be replaced by "::"

The CDD in CANoe must be assigned to a node or bus.

The qualifier of a simple or complex parameter can be found in CANdelaStudio with the Properties of
the parameter.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Expanded Functions in CAPL

Info

Do not confuse the identifier with the language-dependent name of the object since then the
object cannot be identified!

• In order to assign an object with a variable number of parameters, proceed as follows: if the
parameter list is defined in CANdelaStudio as iterative parameters with a number, then first this
parameter (e.g. "NUMBER_OF_DTC") must be set. Then call DiagResize( response), which makes
space for the actual parameters. These can be set with the DiagSetComplexParameter functions.

If, however, the number of sub-parameters is not set via an individual parameter but instead from the
length of the transmitted TP message, then the resulting size of the object must be transmitted in
bytes when calling DiagResize.

Info

The length of the elements of a qualifier path from the CANdela description file is limited to 50
characters in the CAPL Compiler. Longer names may exceed this limit, but the CAPL program
cannot be compiled. Nevertheless, it is possible to specify the qualifier path as a text string in
quotation marks: "<Qualifier Path>". In this case the qualifier path may be up to 255 characters
in length.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Example for Automatic Variant Identification

Example for Automatic Variant Identification


CAPL Function Overview » Diagnostics » Example for Automatic Variant Identification

This test case checks if the identified variant matches the configured one.
// This test case checks if the variant found by the identification
// algorithm is the configured one

testcase IdentifyConfiguredVariant()
{
char configuredVariant[50];
char identifiedVariant[50];
long status;
// Select ECU the variant identification should work on
DiagSetTarget( "ECU");
// Retrieve the qualifier of the configured variant
DiagGetConfiguredVariant(configuredVariant, elcount( configuredVariant));
TestStep( "Expected:", configuredVariant);
// Start variant identification
status = DiagStartVariantIdentification();
if( 0 == status)
{
TestStepPass( "Variant Identification was started!");
} else if( status == -97)
{
TestStepFail( "Variant identification not defined in diagnostics description");
} else
{
TestStepFail( "Variant identification could not be started");
}
// Wait explicitly
status = TestWaitForDiagVariantIdentificationCompleted( configuredVariant);
// Evaluate the result
switch( status)
{
case 1:
TestStepPass( "Configured variant identified.");
break;
case 0:
TestStepFail( "Variant identification ran into timeout!");
break;
case -100:
TestStepFail( "Variant identification not running!");
break;
case -98:
TestStepFail( "Variant identification algorithm not successfull!");
break;
case -90:
TestStepFail( "TestWaitFor... functions are only possible in tester modules!");
break;
case -83:
DiagGetIdentifiedVariant( identifiedVariant, elcount(identifiedVariant));
TestStep( "Found:", identifiedVariant);
TestStepFail( "Identified variant is not the expected one!");
break;
default:
TestStepFail( "Variant identification failed!");
break;
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Generic CAPL Callback Interface

Diagnostics: Generic CAPL Callback Interface


CAPL Function Overview » Diagnostics » Generic CAPL Callback Interface

With CANoe 5.1 SP2 an updated CAPL callback interface is available that makes no assumptions of the
used transport protocol and supports connection oriented and segmented transmissions easier.

Interface configuration

It is now possible, with two (ECU simulations) or three functions (test simulations or test modules) to
extensively configure the TP layer.
To do this, the DiagGetCommParameter function was introduced, which makes set parameters for a
diagnostic description accessible in CAPL programs, whereby the parameter qualifiers are identical for all
CDDS and manufacturers.

| Diagnostics: Connection of the Communication Layer |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Processing Functional Diagnostic Requests in ECU Simulations

Diagnostics: Processing Functional Diagnostic Requests in ECU


Simulations
CAPL Function Overview » Diagnostics » Processing Functional Diagnostic Requests in ECU Simulations

An ECU simulation can respond to functional diagnostic requests sent in an individual CAN message by the
tester.
To implement such a response, proceed as follows:

• When the communication parameters are configured in callback Diag_SetChannelParameters, the


values for functional requests have to be polled and saved.
• On receipt of a CAN message, a check must be carried out to determine whether it matches the saved
values. If it does, the data received has to be transferred to the diagnostics layer (see Diag_DataInd).

Example Implementation
variables
{
[...]
DWORD gFunctionalRequestId = 0;
DWORD gFunctionalRequestIdMask = 0;
long gFunctionalRequestExt = -1;
long gCANchannel = -1;
}
_Diag_SetChannelParameters()
{
[...]
// Configure functional request ids
gCANchannel = DiagGetCommParameter( "CANoe.ChannelNumber");
gFunctionalRequestId = DiagGetFunctionalGroupId();
if( gFunctionalRequestId != -1)
{
gFunctionalRequestIdMask = DiagGetFunctionalGroupIdMask();
gFunctionalRequestExt = DiagGetFunctionalGroupExt();
}
}
on message *
{
int i, dataStart, requestLength;
BYTE requestData[7];
// Check if the message received has the functional request id,
// and if extended addresses are used, if the extension matches
if( gCANchannel != this.can
|| (this.id & gFunctionalRequestIdMask) != gFunctionalRequestId
|| gFunctionalRequestExt >= 0 && this.byte(0) != gFunctionalRequestExt)
return;
// This is a functional request, so indicate the data to the diagnostics
layer.
// The length of the data is found in the first byte of data
dataStart = (gFunctionalRequestExt >= 0) ? 1 : 0;
requestLength = this.byte(dataStart);
++dataStart;
writeDbgLevel(1, "%s: Functional request received, %d byte: %02x...",
gECU, requestLength, this.byte( dataStart));
for( i = 0; i < requestLength; ++i)
{
requestData[ i] = this.byte( dataStart + i);
}
Diag_DataInd( requestData, requestLength, gFunctionalRequestExt);
}

| DiagGetFunctionalGroupExt | DiagGetFunctionalGroupId | DiagGetFunctionalGroupIdMask |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Using Diagnostics Functions in Test Cases

Diagnostics: Using Diagnostics Functions in Test Cases


CAPL Function Overview » Diagnostics » Using Diagnostics Functions in Test Cases

Info

Waiting for diagnostic events is only possible in test modules! Conventional CAPL nodes continue
to operate, but only by the event-driven principle.

After basic configuration of a diagnostic test module has been completed (the Target ECU can be selected
in the MainTest function, for example), waiting for diagnostic events may be executed within the test
module.

After a request has been sent the following phases are run through:

1. The request is sent to the ECU. Execution of the TestCase can be synchronized to the entire sending of
the request using the function
TestWaitForDiagRequestSent( diagRequest request, dword timeout);
2. The ECU begins to send a response to the tester, i.e. a "FirstFrame" (ISO TP) announces the arrival of
the Response Primitive. Waiting for this event is executed using the function
TestWaitForDiagResponseStart(diagRequest request, dword timeout);
TestWaitForDiagResponseStart( dword timeout)
This function is also called if the entire response has arrived at once, i.e. a "SingleFrame" (ISO TP)
contains the entire response.
3. The entire response has arrived at the tester, i.e. transmission of the entire response primitive has
been completed. The function
TestWaitForDiagResponse( diagRequest request, dword timeout);
TestWaitForDiagResponse( dword timeout);
returns.

Info

CANoe assumes the automatic handling of "Response Pending" (negative response with error
code 0x78) responses of the ECU, i.e. this function does not return until another negative or
positive response arrives, or until the timeout expires.

The return values of these functions conform to the following pattern:

• <0: An internal error occurred, e.g. faulty configuration of the Diagnostic Layer.
• 0: The timeout was reached, i.e. the specific event did not occur within the specified time.
• 1: The event occurred. This may also be a negative response while waiting for a response from the
ECU!

To evaluate the ECU’s response the request can be used to access the last received response:

• It is possible to determine whether a positive response was received, or else which negative response
was received. The function
long DiagGetLastResponseCode( diagRequest req);
long DiagGetLastResponseCode();
returns the error code of the last response received (for the specified request), whereby -1 stands for
a positive response ("No error code").
• The parameters of the response can be accessed indirectly via the request object; i.e. no additional
response object is needed. The following functions are available for this purpose; their functionality is
analogous to those access functions that do not have "Resp" in their names:
long DiagGetRespParameter( diagRequest req, char parameterName[], double output[]); double
DiagGetRespParameter( diagRequest req, char parameterName[]);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Using Diagnostics Functions in Test Cases

long DiagGetRespParameter( diagRequest req, char parameterName[], byte buffer[], dword


bufferLen);
long DiagGetRespParameterRaw( diagRequest req, char parameterName[], byte buffer[], dword
bufferLen);
long DiagGetComplexRespParameter( diagRequest req, char parameterName[], dword iteration, char
subParameter[], double output[]);
double DiagGetComplexRespParameter( diagRequest req, char parameterName[], dword iteration,
char subParameter[]);
long DiagGetComplexRespParameter( diagRequest req, char parameterName[], dword iteration, char
subParameter[], byte buffer[], dword bufferLen);
long DiagGetComplexRespParameterRaw( diagRequest req, char parameterName[], dword iteration,
char subParameter[], byte buffer[], dword bufferLen);
These functions return -98 ("Object not found") if no response has been received for the request yet
(since the last transmission).

Finally, there are yet other functions that simplify the development of test cases for diagnostics:

• It is possible to write a diagnostic object to the test report. This involves calling the function:
TestReportWriteDiagObject( diagRequest req);
TestReportWriteDiagObject( diagResponse resp);
TestReportWriteDiagResponse( diagRequest req);
The object’s contents are written to the XML file if this was activated. The message then appears in
the HTML file in the form of a table.
• The P2 timer that was defined in the Diagnostic Description can be polled by the function:
long DiagGetP2Timeout();
• Other communication parameters of the configured interface can be polled by the function:
long DiagGetCommParameter( char name[]);
If no parameter is found with the specified qualifiers, then -98 ("Object not found") is returned.
• It is possible to copy the contents of the last received response (for a specific request) to a response
object.
Attention:
This may result in a change to the "Type" of the object (its qualifier path) and the number of its
parameters!
long DiagGetLastResponse( diagRequest req, diagResponse respOut);
long DiagGetLastResponse( diagResponse respOut);

Example test case

The following test case shows the values of all possible states that may occur after a request is
sent.
TestCase Test1()
{
// Send Request and react to all possible cases.
diagRequest IDENTIFICATION::SgIdentifikation::Lesen idReq;
DiagSendRequest( idReq);
switch( TestWaitForDiagResponse( idReq, 200))
{
case 0: // Timeout: The ECU did not respond within 200 ms.
write("No answer from ECU!");
TestStepFail("Read ID", "No answer from ECU!");
break;
case 1: // response received
TestReportWriteDiagResponse(idReq); // write response to report
if( DiagGetLastResponseCode(idReq) == -1)
{
// A positive response was received
write("ECU Diagnostics Identification: %d",
(long)DiagGetRespParameter(idReq,"Diagnostic_Identification"));
TestStepPass("Read ID", "Positiv response received!");
}
else // A negative response was received
{
write( "ECU Diagnostics Identification failed: 0x%x",
DiagGetLastResponseCode( idReq));
TestStepFail("Read ID", "Negative response received");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Diagnostics: Using Diagnostics Functions in Test Cases

}
break;
default: // internal or setup error
TestStepFail("Read ID", "Error in TestCase! Verdict unreliable.");
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

Test Feature Set CAPL Functions


CAPL Function Overview » Test Feature Set CAPL Functions

Info

Wait instructions for messages are available for the bus systems CAN, LIN, FlexRay and MOST.

For the formulation of tests the following CAPL functions are available:

Collection of Event Information

Functions Short description


TestGetLastWaitElapsedTimeNS Indicates the period of time for which the last wait function
executed had to wait until being triggered.

TestGetLastWaitResult Makes he last occurred return value of a TestWait instruction


available.

TestGetStringInput Returns the result of the last successful call of


TestWaitForStringInput.

TestGetValueInput Returns the result of the last successful call of


TestWaitForValueInput.

testGetWaitEventEnvVarData Retrieves the environment variable value that has led to the
resume of a joined wait statement.

TestGetWaitEventMsgData Calls up the message content.

TestGetWaitEventSysVarData Retrieves the system variable value that has led to the resume of
a joined wait statement.

FleRay functions Short description

TestGetWaitFrFrameData If a valid FlexRay frame is the last event that triggers a wait
instruction, the frame’s content can be called up.

TestGetWaitFrFrameErrorData If a FlexRay frame error is the last event that triggers a wait
instruction, the event’s content can be called up.

TestGetWaitFrNullFrameData If a FlexRay Null-Frame is the last event that triggers a wait


instruction, the frame’s content can be called up.

TestGetWaitFrPDUData If a valid FlexRay PDU is the last event that triggers a wait
instruction, the PDU’s content can be called up.

TestGetWaitFrPOCStateData If an event indicating a change of state on the FlexRay


Communication Controller's protocol operation state machine is
the last event that triggers a wait instruction, the event’s
content can be called up.

TestGetWaitFrStartCycleData If a FlexRay start cycle is the last event that triggers a wait
instruction, the event’s content can be called up.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestGetWaitFrSymbolData If a FlexRay symbol event is the last event that triggers a wait
instruction, the event’s content can be called up.

LIN functions Short description

TestGetWaitLinCSErrorData Retrieves the data of a checksum error.

TestGetWaitLinSyncErrorData Retrieves the data of a synchronization error.

TestGetWaitLinETFSingleResponseData Calls up the event content.

TestGetWaitLinHdrData Calls up the header content.

TestGetWaitLinReceiveErrData Calls up the error content.

TestGetWaitLinTransmErrData Calls up the frame content.

TestGetWaitLinWakeupData

MOST functions Short description

TestGetWaitEventMostAMSMsgData Calls up the message content.

TestGetWaitEventMostMsgData

Scope functions Short description

testGetWaitScopeEventData Retrieves the data of CANoe Scope event.

Composed Wait Points

Functions Short description

TestJoinAuxEvent Completes the current set of "joined events" with the transmitted
event.
TestJoinEnvVarEvent
Events: auxiliary event, system variable, environment variable,
message, message ID, text, signal (or system or environment
TestJoinMessageEvent variable) with value condition

TestJoinSysVarEvent

TestJoinTextEvent

TestJoinSignalInRange

TestJoinSignalOutsideRange

TestJoinSignalMatch

TestWaitForAllJoinedEvents Waits for the current set of "joined events."

TestWaitForAnyJoinedEvent

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

FlexRay functions Short description

TestJoinFrFrameErrorEvent Completes the current set of "joined events" with the transmitted
event.
TestJoinFrFrameEvent
Events: FlexRay frame error, FlexRay frame, FlexRay null frame,
FlexRay PDU, change of state on the FlexRay Communication
TestJoinFrNullFrameEvent Controller's protocol operation state machine, FlexRay start cycle
and FlexRay symbol.
TestJoinFrPDUEvent

TestJoinFrPOCState

TestJoinFrStartCycleEvent

TestJoinFrSymbolEvent

MOST functions Short description

TestJoinMostAMSMessageEvent Completes the current set of "joined events" with the transmitted
event.
TestJoinMostAMSReportEvent
Events: MOST AMS message, MOST AMS response message, MOST AMS
Spy message, MOST AMS spy response message, MOST message, MOST
TestJoinMostAMSSpyMessageEvent response message, MOST Spy message, MOST Spy response message

TestJoinMostAMSSpyReportEvent

TestJoinMostMessageEvent

TestJoinMostReportEvent

TestJoinMostSpyMessageEvent

TestJoinMostSpyReportEvent

LIN functions Short description

TestJoinLinCSErrorEvent Adds an event to the set of joined events.

TestJoinLinETFSingleResponseEvent Events: checksum error, LIN event-triggered frame single response,


synchronisation error
TestJoinLinSyncErrorEvent

TestJoinLinHeaderEvent Completes the current set of "joined events" with the transmitted
event.
TestJoinLinReceiveErrorEvent
Events: frame, frame ID (header, receive error, transmission error)
TestJoinLinTransmErrorEvent

TestJoinLinWakeupEvent

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

Constraints and Conditions

Functions Short description

TestAddCondition Adds an event object or an event text as a condition.

TestAddConstraint Adds an event object or an event text as a constraint.

TestCheckCondition Checks whether the specified condition was already injured.

TestCheckConstraint Checks whether the specified constraint was already injured.

TestRemoveCondition Removes an event object or an event text that was added as a condition.

TestRemoveConstraint Removes an event object or an event text that was added as a constraint.

TestSetParseErrorConstraint Sets the behavior of the symbolic variants of TestWaitForMost... and


TestJoinMost... functions.

Diagnostics Test Support

Functions Short description

TestJoinDiagResponseFromEcu Adds an event to the set of joined events.

Events: Arrival of a diagnostics response from a specific or any ECU.

TestReportWriteDiagObject Writes the specified object in the test report as a HTML table.

TestReportWriteDiagResponse Writes the received response of the request in the test report as a HTML
table.

TestWaitForDiagRequestSent Waits until the previously sent request has been sent to the ECU.

TestWaitForDiagResponse Waits for arrival of the response to the given request.

TestWaitForDiagResponseStart Waits for the arrival of the response to a sent request.

Fault Injection Functions

Functions Short description

TestDisableMsg Prevents all sending of the message except the sending by calling the
function testSetMsgEvent.

TestDisableMsgAllTx Prevents all sendings of tx messages of the node except the sending with
testSetMsgEvent.

TestEnableMsg Enables the sending of the message.

TestEnableMsgAllTx Enables the sending of all tx messages of a node.

TestResetAllFaultInjections Reset all fault injection settings.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestResetMsgCycleTime Resets the cycle time of the message to the database cycle time.

TestResetMsgDlc Resets the Dlc of the message to the Dlc of the database.

TestSetMsgCycleTime Assigns a new cycle time to the message.

TestSetMsgDlc Assigns a new DLC to the message.

TestSetMsgEvent Sends the message once.

OEM Package based Fault Injection Functions

Info

These functions are not available for all OEM packages, the availability depends on the CANoe
Interaction Layer.

Functions Short description

TestDisableCRCCalculation Disables the CRC calculation of a message.

TestDisableMsgSequenceCounter Disables the message sequence counter.

TestDisableUpdateBit Disables the standard behaviour of the update bit and sets the value of
the update bit to a constant value.

TestEnableCRCCalculation Enables the CRC calculation of a message.

TestEnableMsgSequenceCounter Enables the message sequence counter.

TestEnableUpdateBit Enables the standard behaviour of the update bit.

TestFRILControlResume Restarts the FlexRay Interaction Layer.

TestFRILControlWait Stops the FlexRay Interaction Layer.

TestFRILDisturbChecksum Disturbs the checksum a configurable value.

TestFRILDisturbCounter Disturbs the counter with a configurable value.

TestFRILDisturbPduUpdateBit Disturbs the PDU Update Bit with constant 0 or 1.

TestFRILDisturbSignalUpdateBit Disturbs the signal update bit with a configurable value.

Signaling of User-Defined Events

Functions Short description

TestSupplyTextEvent Signals the specified event.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

Signal Oriented Tests

Functions Short description

checkSignalInRange Checks the value of the signal, the system variable or the environment
variable against a condition.
testValidateSignalInRange

testValidateSignalOutsideRange

CheckSignalMatch Checks a given value against the value of the signal, the system
variable or the environment variable.
TestValidateSignalMatch

getSignal Gets the value of a signal.

getSignalTime Gets the time point when the signal value has been changed to the
current value.

RegisterSignalDriver Registers the given callback as a 'signal driver' for the signal.

SetSignal Sets the transmitted signal to the accompanying value.

TestResetEnvVarValue Resets an environment variable to initial value.

TestResetNamespaceSysVarValues Resets all system variables of the given namespace (and all sub-
namespaces) to their initial value.

TestResetNodeSignalValues Resets all tx-signals of a node to their initial value.

TestResetSignalValue Resets a signal to initial value.

TestResetSysVarValue Resets a system variable to initial value.

Test Controlling

Functions Short description

TestSetEcuOffline Disconnects the ECU from the bus.

TestSetEcuOnline Connects the ECU to the bus.

Test Report

Functions Short description

TestCaseComment Within a test case a commentary can be taken over into the report.

TestReportAddEngineerInfo Information pairs of name and description can be taken up into the report
in the areas TestEngineer, TestSetUp, and device (SUT).
TestReportAddSetupInfo

TestReportAddSUTInfo

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestReportAddExtendedInfo Takes over information into the protocol that is not subject to processing
by CANoe.

TestReportAddExternalRef Adds an external reference to the report.

TestReportAddImage Takes over the reference to a file that contains an image into the
protocol.

TestReportAddMiscInfo Information pairs of name and description can be taken up into an


additional information area in the report.

TestReportAddMiscInfoBlock Generates a new information block for additional information pairs in the
report.

TestReportAddWindowCapture Creates a screen capture of a Graphics, Statistics, Data or Trace window.

TestReportFileName Sets the name of the report file using the user interface.

Test Structuring

Functions Short description

TestCaseDescription Writes a description text for a test case into the report.

TestCaseSkipped Marks a test case as unexecuted.

TestCaseTitle The title of a test case is acquired automatically from the test case name in the
CAPL program.

TestGroupBegin Opens a test group.

TestGroupEnd Closes a test group.

TestModuleDescription Writes a description text for the test module into the report.

TestModuleTitle The title of the test module is acquired automatically from the name of the test
node in the simulation structure.

TestStep Reports a test step without influence on the result.

TestStepFail Describes a test step that causes an error.

TestStepPass Reports a test step that was executed as expected.

TestStepWarning Describes a test case that was executed without errors but whose result could
contribute to a problem later on.

Transmission Commands

Functions Short description

TestSetSendTimeout Sets the timeout.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

MOST functions Short description

TestSendMostAMSMessage Sends a symbolically-defined MOST message.

Verdict Interaction

Functions Short description

TestCaseFail Sets the verdict of the current test case to fail.

TestGetVerdictLastTestCase Returns the verdict of the last elapsed or current test case.

TestGetVerdictModule Returns the current verdict out of the test module.

TestSetVerdictModule Sets the verdict of the test module.

TestStepFail Describes a test step that causes an error.

Visualization

Functions Short description

TestAcquireStatusLED Assigns the test module state to an LED (standalone mode).

Wait Instructions

Info

Wait instructions for messages are available for the bus systems CAN, LIN and MOST.

Functions Short description

TestWaitForAuxEvent Waits for the signaling of the specified auxiliary event from a
connected NodeLayer module.

TestWaitForEnvVar Waits for the description of the specified environment variable


aEnvVar.

TestWaitForMeasurementEnd Waits for the end of the measurement.

TestWaitForSignalInRange Checks if the signal, the system or the environment variable value is
within or outside a defined value range.
TestWaitForSignalOutsideRange

TestWaitForSignalMatch Checks if a given value matches the value of the signal, the system
variable or the environment variable.

TestWaitForSysVar Waits for the next system variable.

TestWaitForStringInput Creates a dialog window in which the tester can enter a text.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestWaitForSyscall Starts an external application and check its exit code.

TestWaitForTesterConfirmation Creates a popup window and waits for tester confirmation.

TestWaitForTextEvent Waits for the signaling of the specified textual event from the
individual test module.

TestWaitForTimeout Waits until the expiration of the specified timeout time.

TestWaitForValueInput Creates a dialog window in which the tester can enter a number.

CAN functions Short description

TestWaitForMessage Waits for the occurrence of a specified message.

TestWaitForSignalAvailable Tests the availability of a specific signal and waits if necessary until its
availability.

TestWaitForSignalsAvailable Tests the availability of all the send signals of a node and waits if
necessary until all the send signals of the node are available.

FlexRay functions Short description

TestWaitForFrFrame Waits for the occurrence of the valid specified FlexRay frame.

TestWaitForFrFrameError Waits for the occurrence of FlexRay frame error event.

TestWaitForFrNullFrame Waits for the occurrence of the specified FlexRay null frame.

TestWaitForFrPDU Waits for the occurrence of the valid specified FlexRay PDU event.

TestWaitForFrPOCState Waits for the occurrence of change of state on the FlexRay


Communication Controller's protocol operation state machine.

TestWaitForFrStartCycle Waits for the occurrence of the specified FlexRay start cycle event.

TestWaitForFrSymbol Waits for the occurrence of a FlexRay symbol on the bus.

LIN functions Short description

TestWaitForLinCSError Waits for a checksum error for the specified amount of time.

TestWaitForLinETFSingleResponse Waits for the occurrence of a LIN Event-triggered frame with a single
response for the specified associated frame.

TestWaitForLinHeader Waits for the Header occurrence of the specified LIN frame.

TestWaitForLinReceiveError Waits for the occurrence of LIN Receive Error event.

TestWaitForLinTransmError Waits for the occurrence of LIN Transmission Error event.

TestWaitForLinWakeupFrame Waits for the occurrence of LIN Wakeup frame.

TestWaitForMessage Waits for the occurrence of a specified message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestWaitForSignal Tests the availability of a specific signal and waits if necessary until its
availability.

MOST functions Short description

TestMostReadReg Reads one or several MOST chip registers and waits for the result.

TestMostRegGetData Retrieve the register values after a TestMostReadReg or


TestMostWriteReg function was called.

TestMostWriteReg Writes one or several MOST chip registers and waits for the result.

TestWaitForMostAllBypass Waits for specific bypass change event (opened/closed).

TestWaitForMostAMSMessage Waits for specific AMS message.

TestWaitForMostAMSReport Waits for specific AMS report message (OpType > 8).

TestWaitForMostAMSResponse Waits for specific AMS response message.

TestWaitForMostAMSResult Waits for the ‚Result’ or ‚ResultAck’ report of a method.

TestWaitForMostAMSSpyMessage Waits for specific AMS spy message.

TestWaitForMostAMSSpyReport Waits for specific AMS spy report message (OpType > 8).

TestWaitForMostApInstID Waits for InstID change of a function block.

TestWaitForMostAsRegistry Waits for a registry change.

TestWaitForMostCriticalUnlock Waits for the occurrence of a LightLock event indicating a critical


unlock state.

TestWaitForMostGroupAdr Waits for group address change event.

TestWaitForMostLightOff Waits for the occurrence of a LightLock event indicating a no light &
no lock state.

TestWaitForMostMessage Waits for specific CMS message.

TestWaitForMostMPR Waits for a MPR event (NCE).

TestWaitForMostNetState Waits for NetState change event.

TestWaitForMostNodeAdr Waits for a node address change event.

TestWaitForMostNPR Waits for a NPR change event.

TestWaitForMostReport Waits for specific CMS report message (OpType > 8).

TestWaitForMostSBC Wait for SBC change event.

TestWaitForMostShortUnlock Waits for the occurrence of a LightLock event indicating a light & no
lock state.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set CAPL Functions

TestWaitForMostSpyMessage Waits for specific CMS spy message.

TestWaitForMostSpyReport Waits for specific CMS spy report message (OpType > 8).

TestWaitForMostStableLock Waits for the occurrence of a LightLock event indicating a stable


unlock state.

Scope functions

testWaitForScopeEvent Waits for the occurrence of CANoe Scope event.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: checkSignalInRange

checkSignalInRange
CAPL Function Overview » Test Feature Set / Signal Access » checkSignalInRange

Note

This function replaces checkSignalInRangeByTxNode.

Syntax long checkSignalInRange(dbSignal aSignal, float aLowLimit, float


aHighLimit); // form 1

long checkSignalInRange(EnvVarName, float aLowLimit, float aHighLimit); //


form 2

long checkSignalInRange(sysVar aSysVar, float aLowLimit, float aHighLimit);


// form 3

Function Checks the signal value or the environment variable value or the system variable value
against the condition:

aLowLimit <= Value <= aHighLimit

Parameters aSignal

The signal to be polled.

EnvVarName

Environment variable to be queried.

aSysVar

System Variable to be queried.

aLowLimit

Lower limit of the signal value.

aHighLimit

Upper limit of the signal value.

Return values 1: If the condition is TRUE

0: If the condition is violated or the signal is unavailable, i.e. was not on the bus yet

-1: General error

-2: Type of the environment or system variable is not valid – only float or integer are valid
- or invalid limits of the given range.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

6.0: form 2 — — •

7.0: form 3 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: checkSignalInRange

Example
// checks if the value of the signal is in the given range
long result;
result = checkSignalInRange(Node_SUT::Velocity, 60, 100);
if (result != 1)
TestStepFail("Value of signal is not in the allowed range!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CheckSignalMatch

CheckSignalMatch
CAPL Function Overview » Test Feature Set » CheckSignalMatch

Syntax long CheckSignalMatch(dbSignal aSignal, float aCompareValue); // form 1

long CheckSignalMatch(dbEnvVar aEnvVar, float aCompareValue); //form 2

long CheckSignalMatch(sysvar aSysVar, float aCompareValue); //form 3

Function Checks the given value against the value of signal, the system or the environment
variable. The resolution of the signal is considered.

Parameters aSignal

The signal to be polled.

aEnvVar

The environment variable to be polled.

aSysVar

The system variable to be polled.

aCompareValue

Value which is compared to the signal value.

Return values 1: If the condition is TRUE

0: If the condition is violated or the signal is unavailable, i.e. was not on the bus yet

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 — — •

7.5: form 2, 3 — — •

Example
// checks if the value of the signal matches a specified value
long result;
result = CheckSignalMatch(Node_SUT::Velocity, 80);
if (result != 1)
TestStepFail("Value of signal matches not the value ‘80’!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getSignal

getSignal
CAPL Function Overview » Test Feature Set / Signal Access » getSignal

Note

This function replaces getSignalByTxNode.

Syntax float getSignal(dbSignal aSignal); //form 1

Function Gets the value of a signal.

Info

It is recommended to use form 1. The runtime environment is faster with


form 1, because the signal object is determined during CAPL code
compilation before measurement start. With form 2 the signal object is
determined during runtime which influences the performance.

Parameters aSignal

The signal to be polled.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example — Signal is unique

You have to use at minimum one more object to identify the signal uniquely. It could be
any object from the list of possible objects.
float value;
value = getSignal(OnOff);

Example — Signal is ambiguous


float value;

//Node and signal


value = getSignal(LightSwitch::OnOff);

//Channel and signal


value = getSignal(CAN1::Status);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getSignal

Special Use Case: Signal is not known before Measurement Start (form 2)

Syntax float getSignal(char signalName[]); // form 2

Function Gets the value of a signal.

Info

It is recommended to use this form only in special cases, because the signal
object is determined during runtime which influences the performance.

Reasons to use this string notation of the function:

• Signal object is not known before measurement start.


• In case of signal ambiguities the unique signal is determined during
measurement.

Parameters signalName

Name of the signal.

Signal Ambiguity

You have to use further objects to identify the signal uniquely. They are:
channel, database name (alias), node name and message name.

The exact qualification syntax is:


[Channel::][Database name (alias)::][Node::][Message::]Signal

The order and completeness of the objects from right to left is important
(see example).

Return values Value of the signal; 0.0 if the signal is not found.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — • •

Example — Signal is unique


float value;
value = getSignal("OnOff");

Example — Signal is ambiguous


float value;

//Message and signal


value = getSignal("LightState::OnOff");

//Node, message and signal


value = getSignal("LightSwitch::LightState::OnOff");

//Database name (alias), node, message and signal


value = getSignal("PowerTrain::LightSwitch::LightState::OnOff");
value = getSignal("C11_Fy_Cluster::ESP::PDU_ESP_35::BTS_Bmg");

//Channel, database name (alias), node, message and signal


value = getSignal("CAN1::PowerTrain::LightSwitch::LightState::OnOff");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: getSignalTime

getSignalTime
CAPL Function Overview » Test Feature Set / Signal Access » getSignalTime

Note

This function replaces getSignalTimeByTxNode.

Syntax dword getSignalTime(dbSignal aSignal);

Function Gets the time point relative to the measurement start at which the signal was last sent on
the bus.

Parameters aSignal

The signal to be polled.

Return values Time point or 0 if the signal was not sent yet.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example
dword timePoint;
timePoint = getSignalTime(Node_SUT::CrashDetected);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: RegisterSignalDriver

RegisterSignalDriver
CAPL Function Overview » Test Feature Set » RegisterSignalDriver

Syntax long RegisterSignalDriver (dbSignal aSignal , char aCallbackFunction[])

Function Registers the given callback as a 'signal driver' for the signal.

Parameters aSignal

DB signal to be queried.

aCallbackFunction

Name of a callback function that should be defined as follows: void function(double


value).

Return values 1: Correct functionality

0: CAPL 'signal driver' could not be registered

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetSignal

SetSignal
CAPL Function Overview » Test Feature Set / Signal Access » SetSignal

Note

This function replaces SetSignalByTxNode.

Syntax void setSignal(dbSignal aSignal, double aValue); //form 1

Function Sets the transmitted signal aSignal to the accompanying value.

If no suitable signal driver exists and thus no signal can be stimulated, then in the test
module the verdict of the test module is set to "fail". In the simulation module the
measurement is stopped and an error message is displayed.

Info

It is recommended to use form 1. The runtime environment is faster with


form 1, because the signal object is determined during CAPL code
compilation before measurement start. With form 2 the signal object is
determined during runtime which influences the performance.

Parameters aSignal

Signal to be set.

aValue

Physical value to be accepted.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example — Signal is unique


setSignal(OnOff, 1.0);

Example — Signal is ambiguous

You have to use at minimum one more object to identify the signal uniquely. It could be
any object from the list of possible objects.
//Node and signal
setSignal(LightSwitch::OnOff, 1.0)

//Channel and signal


setSignal(CAN1::Status, 1)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetSignal

Special Use Case: Signal is not known before Measurement Start (form 2)

Syntax long setSignal(char signalName[], double aValue); //form 2

Function Sets the transmitted signal aSignal to the accompanying value.

If no suitable signal driver exists and thus no signal can be stimulated, then in the test
module the verdict of the test module is set to "fail". In the simulation module the
measurement is stopped and an error message is displayed.

Info

It is recommended to use this form only in special cases, because the signal
object is determined during runtime which influences the performance.

Reasons to use this string notation of the function:

• Signal object is not known before measurement start.


• In case of signal ambiguities the unique signal is determined during
measurement.

Parameters signalName

Name of the signal.

Signal Ambiguity

You have to use further objects to identify the signal uniquely. They are:
channel, database name (alias), node name and message name.

The exact qualification syntax is:


[Channel::][Database name (alias)::][Node::][Message::]Signal

The order and completeness of the objects from right to left is important
(see example).

aValue

Physical value to be accepted.

Return values 0: Signal exists


1: Signal with given name does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example — Signal is unique


setSignal("OnOff", 1.0);

Example — Signal is ambiguous


//Message and signal
setSignal("LightState::OnOff", 1.0);

//Node, message and signal


setSignal("LightSwitch::LightState::OnOff", 1.0);

//Database name (alias), node, message and signal


setSignal("PowerTrain::LightSwitch::LightState::OnOff", 1.0);
setSignal("C11_Fy_Cluster::ESP::PDU_ESP_35::BTS_Bmg", 1);

//Channel, database name (alias), node, message and signal

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetSignal

setSignal("CAN1::PowerTrain::LightSwitch::LightState::OnOff", 1.0);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestAcquireStatusLED

TestAcquireStatusLED
CAPL Function Overview » Test Feature Set » TestAcquireStatusLED

Syntax long TestAcquireStatusLED(dword ledBitMask);

Function Can be used in standalone mode to assign the test module state to an LED.

States:

• Off: Test module was never run in current measurement


• Blinking, Green: Test module is currently running, verdict is passed
• Blinking, Red: Test module is currently running, verdict is failed
• On, Green: Test module has ended, verdict is passed
• On, Red: Test module has ended, verdict is failed

Parameters ledBitMask

The LED that wants to be used. Available bit masks under xlAcquireLED.
The LED’s Keypad S1 and Keypad S2 cannot be used for test modules.

Return values 0: Success

-1: General error, e.g. not in standalone mode

>0: error, function failed. Check whether your device supports this function and you have
an appropriate driver installed on the device.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestAddCondition

TestAddCondition
CAPL Function Overview » Test Feature Set » TestAddCondition

Syntax long TestAddCondition (dword aAuxHandle)

long TestAddCondition (dword aAuxHandle, long aBehavior)

long TestAddCondition (char aEventText[])

long TestAddCondition (char aEventText[], long aBehavior)

Function Adds an event object or an event text as a condition. Checks from the Test Service
Library are suitable as event objects.

This function can be used within a test case and also on the main test level.

Parameters aAuxHandle

Event object, for example a check from the TestService Library. Specified is the handle
that is returned when a check is created.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

aBehavior

Normally in case of a constraint injury, only a corresponding entry is made in the test
protocol and the verdict of the active test case is set to "fail". In exceptional cases, this
behavior can be set otherwise:

0 Default behavior, entry in test protocol and setting of the verdict to "fail"

1 Only an entry in the test protocol is made, the verdict remains unchanged

2, 3 reserved

Return values 0: Constraint was added successfully

<0: Constraint could not be added

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example 1

Add check as condition


dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestAddCondition

// Remove check as condition


TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);
// reset stored values of the check
ChkControl_Reset(checkId);

// start the check again without adding as condition,


// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check
ChkControl_Destroy(checkId);

Example 2

Add text event as condition


// test case to check if Error Frames occur
testcase CheckErrorFrameReceived ()
{
TestAddCondition("ErrorFrameReceived");
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition("ErrorFrameReceived");
}

// handler to supply text event


on errorFrame
{
TestSupplyTextEvent("ErrorFrameReceived");
}

| TestRemoveCondition | TestCheckCondition | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestAddConstraint

TestAddConstraint
CAPL Function Overview » Test Feature Set » TestAddConstraint

Syntax long TestAddConstraint (dword aAuxHandle)

long TestAddConstraint (dword aAuxHandle, long aBehavior)

long TestAddConstraint (char aEventText[])

long TestAddConstraint (char aEventText[], long aBehavior)

Function Adds an event object or an event text as a constraint. Checks from the Test Service
Library are suitable as event objects.

This function can be used within a test case and also on the main test level.

Parameters aAuxHandle

Event object, for example a check from the TestService Library. Specified is the handle
that is returned when a check is created.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

aBehavior

Normally in case of a constraint injury, only a corresponding entry is made in the test
protocol and the verdict of the active test case is set to "fail". In exceptional cases, this
behavior can be set otherwise:

0 Default behavior, entry in test protocol and setting of the verdict to "fail"

1 Only an entry in the test protocol is made, the verdict remains unchanged

2, 3 reserved

4 In addition to the entry in the test protocol and the setting of the verdict to
"fail," the current waiting point is also aborted. This behavior was introduced
for reasons of compatibility with Version 5.0 and should only be selected in
exceptional cases since here after each waiting point a corresponding query
must be inserted.

Return values 0: Constraint was added successfully

< 0: Constraint could not be added

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example 1

Add check as constraint


dword checkId;
dword numCheckEvents;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestAddConstraint

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as constraint,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddConstraint(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as constrait
TestRemoveConstraint(checkId);

// stop the check


ChkControl_Stop(checkId);
// reset stored values of the check
ChkControl_Reset(checkId);

// start the check again without adding as constraint,


// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check
ChkControl_Destroy(checkId);

Example 2

Add check as constraint


// test case to check if Error Frames occur
testcase CheckErrorFrameReceived ()
{
TestAddConstraint("ErrorFrameReceived");
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveConstraint("ErrorFrameReceived");
}

// handler to supply text event


on errorFrame
{
TestSupplyTextEvent("ErrorFrameReceived");
}

| TestRemoveConstraint | TestCheckConstraint | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseComment

TestCaseComment
CAPL Function Overview » Test Feature Set » TestCaseComment

Syntax TestCaseComment (char aComment[])

TestCaseComment (char aComment[], message aMsg)

TestCaseComment (char aComment[], mostMessage aMsg)

TestCaseComment (char aComment[], mostAmsMessage aMsg)

TestCaseComment (char aComment[], mostRawMessage aMsg)

TestCaseComment (char aComment[], linMessage aMsg)

TestCaseComment (char aComment[], char aRawString[])

TestCaseComment (char aComment[], gmLanMsg aMsg)

Function With this function within a test case a commentary can be taken over into the report.
This comment can relate to a message that can also be output in the report.

The verdict of the test case is not be influenced.

Parameters aComment

Commentary to be taken over into the report.

aMsg

CAN-, GMLAN-, LIN-, MOST-, MOST-AMS- or MOST system message to be taken over into
the report.

aRawString

Here you may enter any ASCII characters. They will be added to the comment in the
following way: <Hex value of the given character>(<ASCII display of the given charcter>).
In ASCII display special characters will be replaced by '.'.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
testcase CheckLockingOnCrash ()
{
TestCaseTitle("TC 1.0", "Check unlock of central locking system on
crash");
TestCaseDescription("This test case simulates a crash during drive. The
central locking system has to be unlocked on crash!");
// Initialization of signals
$CrashDetected = 0;
$LockState = Locked;
TestWaitForTimeout(200);

TestCaseComment("Initialization of system completed");


...
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseComment

| TestCaseFail | TestStep | TestStepFail | TestStepPass |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseDescription

TestCaseDescription
CAPL Function Overview » Test Feature Set » TestCaseDescription

Syntax TestCaseDescription (char description[])

Function With this function, a description test for a test case can be written into the report. The
function can be called several times in a row, the transmitted texts are then added to
one another without additional separation. The function may only be called within a test
case and relates then to the respective test case.

To obtain line breaks (in form of <br /> tags) in the HTML test report, "\n" may be
inserted at any place. The required replacement takes place during the transformation of
the XML test protocol into an HTML file by means of an XSLT style sheet, where it can also
be deactivated.

Parameters Description test for the test case.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example 1
// add description with line break to report
TestCaseDescription("In this test case\nthe occurrence of error frames is
tested.");

Example 2

See example: TestCaseTitle, TestCaseDescription, TestStep

Example 3
testcase CheckLockingOnCrash ()
{
TestCaseTitle("TC 1.0", "Check unlock of central locking system on
crash");
TestCaseDescription("This test case simulates a crash during drive. The
central locking system has to be unlocked on crash!");
// Initialization of signals
$CrashDetected = 0;
$LockState = Locked;
TestWaitForTimeout(200);

TestCaseComment("Initialization of system completed");


...
}

| TestCaseTitle |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseFail

TestCaseFail
CAPL Function Overview » Test Feature Set » TestCaseFail

Syntax TestCaseFail ()

Function You can set the verdict of the current test case to fail. This function can only be used
within a test case. It is not possible to set the verdict of this test case back to pass.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// checks if the value of the signal is in the given range
testcase CheckSignalValue()
{
long result;
result = checkSignalInRange(Node_SUT::Velocity, 60, 100);
if (result != 1)
TestCaseFail();
}

| TestStepFail | TestGetVerdictLastTestCase |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseSkipped

TestCaseSkipped
CAPL Function Overview » Test Feature Set » TestCaseSkipped

Syntax TestCaseSkipped(char[] ident, char[] title);

Function This function can be used to mark a test case as unexecuted. This will then appear as a
"skipped" Test Case in the Test Report.
The verdict of the Test Module is not affected. This function may only be called in the
context of the MainTest function.

Parameters ident

Identifier of the Test Case, e.g. number.

title

Title of the Test Case.

Return values —

Possible errors This function must not be called within a Test Case.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 Test nodes — •

Example

Test Case "tc3" is only executed under certain conditions


MainTest
{
tc1();
tc2();
if(condition)
{
tc3();
}
else
{
TestCaseSkipped("TC3", "Example");
}
tc4();
}

| TestCaseComment |TestCaseDescription | TestCaseFail | TestCaseTitle | TestStep | TestStepFail | TestStepPass |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCaseTitle

TestCaseTitle
CAPL Function Overview » Test Feature Set » TestCaseTitle

Note

The title must not contain parenthesis.

Syntax TestCaseTitle (char identifier[], char title[])

Function The title of a test case is acquired automatically from the test case name in the CAPL
program. It can also be set explicitly together with a test case identifier with the help of
this function. The function may only be called within a test case and relates then to the
respective test case.

Parameters Title of the test case.

Identifier (e.g. a test case number) of the test case.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example 1
testcase CheckLockingOnCrash ()
{
TestCaseTitle("TC 1.0", "Check unlock of central locking system on
crash");
TestCaseDescription("This test case simulates a crash during drive. The
central locking system has to be unlocked on crash!");
// Initialization of signals
$CrashDetected = 0;
$LockState = Locked;
TestWaitForTimeout(200);

TestCaseComment("Initialization of system completed.");


...
}

Example 2

See example: TestCaseTitle, TestCaseDescription, TestStep

| TestCaseDescription |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheckCondition

TestCheckCondition
CAPL Function Overview » Test Feature Set » TestCheckCondition

Syntax long TestCheckCondition (dword aAuxHandle)

long TestCheckCondition (char aEventText[])

Function Checks whether the specified condition was already injured.

This function can be used both within a test case and also on test module level.

Parameters aAuxHandle

Event object, for example a check from the TestService Library. Specified is the handle
that is returned on creation of a check. This function can be used both within a test case
and also on the test module level.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

Return values 1: Condition was already injured at least once

0: Condition was not yet injured

< 0: The function cannot be executed because, for example, the specified condition does
not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example 1

Add check as condition


// checks the maximum duration of a sequence of actions
checkId = ChkStart_Timeout (1000);
TestAddCondition(checkId);
TestWaitForTimeout(1500);
result = TestCheckCondition(checkId);
if (result == 1)
TestStepFail("Timeout already occurred after 1500 ms.");
// sequence of different actions and waiting conditions
TestRemoveCondition(checkId);

Example 2

Add text event as condition


// test case to check if Error Frames occur
testcase CheckErrorFrameReceived ()
{
TestAddCondition("ErrorFrameReceived");
TestWaitForTimeout(1000);
result = TestCheckCondition("ErrorFrameReceived");
if (result == 1)
TestStepFail("Error Frame already occurred after 1000 ms.");
// sequence of different actions and waiting conditions
TestRemoveCondition("ErrorFrameReceived");
}
// handler to supply text event
on errorFrame

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheckCondition

{
TestSupplyTextEvent("ErrorFrameReceived");
}

| TestAddCondition | TestSupplyEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheckConstraint

TestCheckConstraint
CAPL Function Overview » Test Feature Set » TestCheckConstraint

Syntax long TestCheckConstraint (dword aAuxHandle)

long TestCheckConstraint (char aEventText[])

Function Checks whether the specified constraint was already injured.

This function can be used both within a test case and also on test module level.

Parameters aAuxHandle

Event object, for example a check from the Test Service Library. Specified is the handle
that is returned on creation of a check. This function can be used both within a test case
and also on the test module level.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

Return values 1: Condition was already injured at least once

0: Condition was not yet injured

< 0: The function cannot be executed because, for example, the specified condition does
not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example 1

Add check as constraint


// checks the maximum duration of a sequence of actions
checkId = ChkStart_Timeout (1000);
TestAddConstraint (checkId);
TestWaitForTimeout(1500);
result = TestCheckConstraint(checkId);
if (result == 1)
TestStepFail("Timeout already occurred after 1500 ms.");
// sequence of different actions and waiting conditions
TestRemoveConstraint (checkId);

Example 2

Add text event as constraint


// test case to check if Error Frames occur
testcase CheckErrorFrameReceived ()
{
TestAddConstraint ("ErrorFrameReceived");
TestWaitForTimeout(1000);
result = TestCheckConstraint("ErrorFrameReceived");
if (result == 1)
TestStepFail("Error Frame already occurred after 1000 ms.");
// sequence of different actions and waiting conditions
TestRemoveConstraint("ErrorFrameReceived");
}

// handler to supply text event

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheckConstraint

on errorFrame
{
TestSupplyTextEvent("ErrorFrameReceived");
}

| TestAddConstraint | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayFrameErrorOccurrenceCount, TestCheck::StartFlexRayFrameErrorOccurrenceCount,
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount, TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount

TestCheck::CreateFlexRayFrameErrorOccurrenceCount,
TestCheck::StartFlexRayFrameErrorOccurrenceCount,
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount,
TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount
CAPL Function Overview » Test Service Library » Checks » TestCheck::CreateFlexRayFrameErrorOccurrenceCount,
TestCheck::StartFlexRayFrameErrorOccurrenceCount, TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount,
TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount

As constructor TestCheck::CreateFlexRayFrameErrorOccurrenceCount (dword slotID, dword


function cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount, char[]
aCaplCallbackFunction)

TestCheck::StartFlexRayFrameErrorOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount, char[]
aCaplCallbackFunction)

TestCheck::CreateFlexRayFrameErrorOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount)

TestCheck::StartFlexRayFrameErrorOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount)

TestCheck::CreateFlexRayFrameErrorOccurrenceCount (Message aMessage, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::StartFlexRayFrameErrorOccurrenceCount (Message aMessage, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::CreateFlexRayFrameErrorOccurrenceCount (Message aMessage, dword


aMaxCount)

TestCheck::StartFlexRayFrameErrorOccurrenceCount (Message aMessage, dword


aMaxCount)

TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount (Node aNode, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount (Node aNode, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount (Node aNode, dword


aMaxCount)

TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount (Node aNode, dword


aMaxCount)

Check name | Absence of a FlexRay Erroneous Frame check |

Function Checks the absence of erroneous frames for the specified frame/slot on the bus. An
event is created if more than aMaxCount of the specified erroneous frames were sent.

If a DB node is used as reference, then all its TX frames are observed.

Parameters slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayFrameErrorOccurrenceCount, TestCheck::StartFlexRayFrameErrorOccurrenceCount,
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount, TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

aNode

The node from the DB whose TX messages should be observed.

aMaxCount

The maximum number of message that may be sent without the check to fail.

aMessage

The message whose occurrence is to be monitored in symbolic form, e.g.: "EngineData".

aCaplCallbackFunction

This parameter must be specified in simulation nodes; it is optional in test modules.

Return value Object of type TestCheck.

Check-specific ChkQuery_EventMessageId
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 FlexRay — •

Example
variables
{
const dword cTesttime = 640; // [ms] per check

FrFrame MsgChannel1.(10,0,2) frame10 = { FR_Flags = 0, FR_ChannelMask =


1, FR_PayloadLength = 2 };

const dword cFrFlagTT = 0x00;


const dword cFrFlagET = 0x10;
const dword cFrFlagStop = 0x80;
}

testcase GoodCheckFlexRayFrameErrorOccurrenceCount_1 ()
{
TestCheck c;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayFrameErrorOccurrenceCount, TestCheck::StartFlexRayFrameErrorOccurrenceCount,
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount, TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount

long cMaxCount = 0;

// Assure check to succeed:


frame10.FR_Flags = cFrFlagTT; // start sending the frame
FRUpdateStatFrame(frame10);
TestWaitForTimeout(12);

c = TestCheck::CreateFlexRayFrameErrorOccurrenceCount(
frame10.FR_SlotID, frame10.FR_CycleOffset, frame10.FR_CycleRepetition,
frame10.FR_ChannelMask, cMaxCount);

TestAddCondition(c);

c.start();
TestWaitForTimeout(cTesttime);

TestRemoveCondition(c);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayNullFrameOccurrenceCount, TestCheck::StartFlexRayNullFrameOccurrenceCount,
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount, TestCheck::StartNodeFlexRayNullFramesOccurrenceCount

TestCheck::CreateFlexRayNullFrameOccurrenceCount,
TestCheck::StartFlexRayNullFrameOccurrenceCount,
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount,
TestCheck::StartNodeFlexRayNullFramesOccurrenceCount
CAPL Function Overview » Test Service Library » Checks » TestCheck::CreateFlexRayNullFrameOccurrenceCount,
TestCheck::StartFlexRayNullFrameOccurrenceCount, TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount,
TestCheck::StartNodeFlexRayNullFramesOccurrenceCount

As constructor TestCheck::CreateFlexRayNullFrameOccurrenceCount (dword slotID, dword


function cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount, char[]
aCaplCallbackFunction)

TestCheck::StartFlexRayNullFrameOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount, char[]
aCaplCallbackFunction)

TestCheck::CreateFlexRayNullFrameOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount)

TestCheck::StartFlexRayNullFrameOccurrenceCount (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, dword aMaxCount)

TestCheck::CreateFlexRayNullFrameOccurrenceCount (Message aMessage, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::StartFlexRayNullFrameOccurrenceCount (Message aMessage, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::CreateFlexRayNullFrameOccurrenceCount (Message aMessage, dword


aMaxCount)

TestCheck::StartFlexRayNullFrameOccurrenceCount (Message aMessage, dword


aMaxCount)

TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount (Node aNode, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::StartNodeFlexRayNullFramesOccurrenceCount (Node aNode, dword


aMaxCount, char[] aCaplCallbackFunction)

TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount (Node aNode, dword


aMaxCount)

TestCheck::StartNodeFlexRayNullFramesOccurrenceCount (Node aNode, dword


aMaxCount)

Check name | Absence of a FlexRay Null Frame check |

Function Checks the absence of Null frames for the specified frame/slot on the bus. An event is
created if more than aMaxCount of the specified Null frames were sent.

If a DB node is used as reference, then all its TX frames are observed.

Parameters slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayNullFrameOccurrenceCount, TestCheck::StartFlexRayNullFrameOccurrenceCount,
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount, TestCheck::StartNodeFlexRayNullFramesOccurrenceCount

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

aMaxCount

The maximum number of message that may be sent without the check to fail.

aNode

The node from the DB whose TX messages should be observed.

aMessage

The message whose occurrence is to be monitored in symbolic form, e.g.: "EngineData".

aCaplCallbackFunction

This parameter must be specified in simulation nodes; it is optional in test modules.

Return value Object of type TestCheck.

Check-specific ChkQuery_EventMessageId
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 FlexRay — •

Example
variables
{
const dword cTesttime = 640; // [ms] per check

FrFrame MsgChannel1.(10,0,2) frame10 = { FR_Flags = 0, FR_ChannelMask =


1, FR_PayloadLength = 2 };

const dword cFrFlagTT = 0x00;


const dword cFrFlagET = 0x10;
const dword cFrFlagStop = 0x80;
}

testcase GoodCheckFlexRayNullFrameOccurrenceCount_1 ()
{
TestCheck c;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateFlexRayNullFrameOccurrenceCount, TestCheck::StartFlexRayNullFrameOccurrenceCount,
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount, TestCheck::StartNodeFlexRayNullFramesOccurrenceCount

long cMaxCount = 0;

// Assure check to succeed:


frame10.FR_Flags = cFrFlagStop; // stop sending the frame
FRUpdateStatFrame(frame10);
TestWaitForTimeout(12);

c = TestCheck::CreateFlexRayNullFrameOccurrenceCount( frame10.FR_SlotID,
frame10.FR_CycleOffset, frame10.FR_CycleRepetition,
frame10.FR_ChannelMask, cMaxCount);

TestAddCondition(c);

c.start();
TestWaitForTimeout(cTesttime);

TestRemoveCondition(c);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateMsgSendCountViolation, TestCheck::StartMsgSendCountViolation,
TestCheck::CreateNodeMsgSendCountViolation, TestCheck::StartNodeMsgSendCountViolation

TestCheck::CreateMsgSendCountViolation,
TestCheck::StartMsgSendCountViolation,
TestCheck::CreateNodeMsgSendCountViolation,
TestCheck::StartNodeMsgSendCountViolation
CAPL Function Overview » Test Service Library » Checks » TestCheck::CreateMsgSendCountViolation,
TestCheck::StartMsgSendCountViolation, TestCheck::CreateNodeMsgSendCountViolation,
TestCheck::StartNodeMsgSendCountViolation

As constructor TestCheck::CreateMsgSendCountViolation (dword slotID, dword cycleOffs,


function dword cycleRep, dword channelMask, dword aMinCount, dword aMaxCount,
Duration aInterval, char[] aCaplCallbackFunction)

TestCheck::StartMsgSendCountViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, dword aMinCount, dword aMaxCount,
Duration aInterval, char[] aCaplCallbackFunction)

TestCheck::CreateMsgSendCountViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, dword aMinCount, dword aMaxCount,
Duration aInterval)

TestCheck::StartMsgSendCountViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, dword aMinCount, dword aMaxCount,
Duration aInterval)

TestCheck::CreateMsgSendCountViolation (Message aMessage, dword


aMinCount, dword aMaxCount, Duration aInterval, char[]
aCaplCallbackFunction)

TestCheck::StartMsgSendCountViolation (Message aMessage, dword aMinCount,


dword aMaxCount, Duration aInterval, char[] aCaplCallbackFunction)

TestCheck::CreateMsgSendCountViolation (Message aMessage, dword


aMinCount, dword aMaxCount, Duration aInterval)

TestCheck::StartMsgSendCountViolation (Message aMessage, dword aMinCount,


dword aMaxCount, Duration aInterval)

TestCheck::CreateNodeMsgSendCountViolation (Node aNode, dword aMinCount,


dword aMaxCount, Duration aInterval, char[] aCaplCallbackFunction)

TestCheck::StartNodeMsgSendCountViolation (Node aNode, dword aMinCount,


dword aMaxCount, Duration aInterval, char[] aCaplCallbackFunction)

TestCheck::CreateNodeMsgSendCountViolation (Node aNode, dword aMinCount,


dword aMaxCount, Duration aInterval)

TestCheck::StartNodeMsgSendCountViolation (Node aNode, dword aMinCount,


dword aMaxCount, Duration aInterval)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateMsgSendCountViolation, TestCheck::StartMsgSendCountViolation,
TestCheck::CreateNodeMsgSendCountViolation, TestCheck::StartNodeMsgSendCountViolation

Check name | Message Count Observation check |

Function Monitors the bus and reports if at least aMinCount and at most aMaxCountfor each of
the defined messages occurred within a specified time interval aInterval.

If a DB node is used as reference, then all its TX frames are observed.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

aMinCount

The minimum number of message that must be sent without the check to fail.

aMaxCount

The maximum number of message that may be sent without the check to fail. ('0' means
infinite number.)

aInterval

Defines the cyclic repeating time period in which the minimum and maximum number
of defined messages must occur without the check failing.

The unit can be set with ChkConfig_SetPrecision.

aNode

The node from the DB whose TX messages should be observed.

aMessage

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestCheck::CreateMsgSendCountViolation, TestCheck::StartMsgSendCountViolation,
TestCheck::CreateNodeMsgSendCountViolation, TestCheck::StartNodeMsgSendCountViolation

The message whose occurrence is to be monitored in symbolic form, e.g.: "EngineData".

aCaplCallbackFunction

This parameter must be specified in simulation nodes; it is optional in test modules.

Return values 0: Check could not be created and may not be referenced.

CheckId [dword] > 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.
Check-specific —
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 FlexRay — •

Example
variables
{
const dword cTesttime = 640; // [ms] per check
// Frames that are sent by node Controller_Node_1:
FrFrame MsgChannel1.Sync_Message_1_Ch_A frame2;
FrFrame MsgChannel1.Sync_Message_1_Ch_B frame2b;
FrFrame MsgChannel1.TimeSync_Message_1_Ch_A frame15;

const dword cFrFlagTT = 0x00;


const dword cFrFlagET = 0x10;
const dword cFrFlagStop = 0x80;
}

testcase GoodCheckNodeMsgSendCountViolation_1 ()
{
TestCheck c;
dword cMinCount = 1;
dword cMaxCount = 0; // ignore
dword cInterval = 320; // [ms]

// Assure check to succeed:


frame2.FR_Flags = cFrFlagTT; // start sending the frame
FRUpdateStatFrame(frame2);
frame2b.FR_Flags = cFrFlagTT; // start sending the frame
FRUpdateStatFrame(frame2b);
frame15.FR_Flags = cFrFlagTT; // start sending the frame
FRUpdateStatFrame(frame15);
TestWaitForTimeout(330);

c = TestCheck::CreateNodeMsgSendCountViolation( Controller_Node_1,
cMinCount, cMaxCount, cInterval );

TestAddCondition(c);

c.start();
TestWaitForTimeout(cTesttime);

TestRemoveCondition(c);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestDisableCRCCalculation

TestDisableCRCCalculation
CAPL Function Overview » Test Feature Set » TestDisableCRCCalculation

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestDisableCRCCalculation (dbMessage aMessage)

long TestDisableCRCCalculation (dword aMessageId)

long TestDisableCRCCalculation (char aMessageName[])

Function Disables the calculation of the CRC of a message.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be manipulated.

aMessageId

Numeric ID of the message that should be manipulated.

aMessageName

Name of the message that should be manipulated.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// disables the CRC calculation of message ‚MsgToManipulate’ for 2000 ms
TestDisableCRCCalculation(MsgToManipulate);
TestWaitForTimeout(2000);
TestEnableCRCCalculation(MsgToManipulate);

| TestEnableCRCCalculation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestDisableMsg

TestDisableMsg
CAPL Function Overview » Test Feature Set » TestDisableMsg

Syntax long TestDisableMsg (dbMessage aMessage)

long TestDisableMsg (dword aMessageId)

long TestDisableMsg (char aMessageName[])

Function Disables the sending of the message except by calling the function TestSetMsgEvent. Use
TestEnableMsg to re-enable the message.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be disabled.

aMessageId

Numeric ID of the message that should be disabled.

aMessageName

Name of the message that should be disabled.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// send a message event for the disabled message ‘MsgToManipulate’
TestDisableMsg(MsgToManipulate);
TestWaitForTimeout(5000);
TestSetMsgEvent(MsgToManipulate);
TestWaitForTimeout(5000);
TestEnableMsg(MsgToManipulate);

| TestResetAllFaultInjections | TestResetMsgCycleTime | TestSetMsgCycleTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestDisableMsgAllTx

TestDisableMsgAllTx
CAPL Function Overview » Test Feature Set » TestDisableMsgAllTx

Syntax long TestDisableMsgAllTx (char [] aNode)

Function Disables the sending of all tx messages of the node except the sending with
testSetMsgEvent.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aNode

Node, the tx messages should be disabled.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// send a message event for a message which is disabled by
TestDisableMsgAllTx
TestDisableMsgAllTx(NodeToManipulate);
TestWaitForTimeout(5000);
TestSetMsgEvent(MsgToManipulate);
TestWaitForTimeout(5000);
TestEnableMsgAllTx(NodeToManipulate);

| TestEnableMsgAllTx |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestDisableMsgSequenceCounter

TestDisableMsgSequenceCounter
CAPL Function Overview » Test Feature Set » TestDisableMsgSequenceCounter

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestDisableMsgSequenceCounter (dbMessage aMessage)

long TestDisableMsgSequenceCounter (dword aMessageId)

long TestDisableMsgSequenceCounter (char aMessageName[])

Function Disables the message sequence counter.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be manipulated.

aMessageId

Numeric ID of the message that should be manipulated.

aMessageName

Name of the message that should be manipulated.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// disables the message sequence counter of message ‚MsgToManipulate’ for
2000ms
TestDisableMsgSequenceCounter(MsgToManipulate);
TestWaitForTimeout(2000);
TestEnableMsgSequenceCounter(MsgToManipulate);

| TestEnableMsgSequenceCounter |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestDisableUpdateBit

TestDisableUpdateBit
CAPL Function Overview » Test Feature Set » TestDisableUpdateBit

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestDisableUpdateBit (dbSignal aSignal, double aValue)

Function Disables the standard behaviour of the update bit and sets the value of the update bit to
a constant value.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aSignal

Signal that should be manipulated.

aValue

Constant value to which the update bit is set.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example
// disables the update bit of signal ‘DoorStatus_UB’ for 1000 ms
TestDisableUpdateBit(DoorStatus_UB, 0);
TestWaitForTimeout(1000);
TestEnableUpdateBit(DoorStatus_UB);

| TestEnableUpdateBit |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestEnableCRCCalculation

TestEnableCRCCalculation
CAPL Function Overview » Test Feature Set » TestEnableCRCCalculation

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestEnableCRCCalculation (dbMessage aMessage)

long TestEnableCRCCalculation (dword aMessageId)

long TestEnableCRCCalculation (char aMessageName[])

Function Re-enables the calculation of the CRC, after it has been disabled with
TestDisableCRCCalculation.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be reset to default behavior.

aMessageId

Numeric ID of the message that should be reset to default behavior.

aMessageName

Name of the message that should be reset to default behavior.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// resets the CRC calculation of message ‚MsgToManipulate’ to default
behaviour after a break of 2000 ms
TestDisableCRCCalculation(MsgToManipulate);
TestWaitForTimeout(2000);
TestEnableCRCCalculation(MsgToManipulate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestEnableMsg

TestEnableMsg
CAPL Function Overview » Test Feature Set » TestEnableMsg

Syntax long TestEnableMsg (dbMessage aMessage)

long TestEnableMsg (dword aMessageId)

long TestEnableMsg (char aMessageName[])

Function Re-enables the sending of the message after having disabled it with TestDisableMsg.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be enabled.

aMessageId

Numeric ID of the message that should be enabled.

aMessageName

Name of the message that should be enabled.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// send a message event for the disabled message ‘MsgToManipulate’
TestDisableMsg(MsgToManipulate);
TestWaitForTimeout(5000);
TestSetMsgEvent(MsgToManipulate);
TestWaitForTimeout(5000);
TestEnableMsg(MsgToManipulate);

| TestResetAllFaultInjections | TestResetMsgCycleTime | TestSetMsgCycleTime | TestSetMsgEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestEnableMsgAllTx

TestEnableMsgAllTx
CAPL Function Overview » Test Feature Set » TestEnableMsgAllTx

Syntax long TestEnableMsgAllTx (char [] aNode)

Function Re-enables the sending of all tx messages of the node after having disabled it with
TestDisableMsgAllTx.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aNode

Node, the tx messages should be enabled.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// send a message event for a message which is disabled by
TestDisableMsgAllTx
// and re-enable the sending of all tx messages of node ‚NodeToManipulate’
TestDisableMsgAllTx(NodeToManipulate);
TestWaitForTimeout(5000);
TestSetMsgEvent(MsgToManipulate);
TestWaitForTimeout(5000);
TestEnableMsgAllTx(NodeToManipulate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestEnableMsgSequenceCounter

TestEnableMsgSequenceCounter
CAPL Function Overview » Test Feature Set » TestEnableMsgSequenceCounter

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestEnableMsgSequenceCounter (dbMessage aMessage)

long TestEnableMsgSequenceCounter (dword aMessageId)

long TestEnableMsgSequenceCounter (char aMessageName[])

Function Re-enables the message sequence counter, after it has been disabled with
TestDisableMsgSequenceCounter.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be reset to default behavior.

aMessageId

Numeric ID of the message that should be reset to default behavior.

aMessageName

Name of the message that should be reset to default behavior.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// disables the message sequence counter of message ‚MsgToManipulate’ for
2000ms
// and re-enables the message sequence counter afterwards
TestDisableMsgSequenceCounter(MsgToManipulate);
TestWaitForTimeout(2000);
TestEnableMsgSequenceCounter(MsgToManipulate);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestEnableUpdateBit

TestEnableUpdateBit
CAPL Function Overview » Test Feature Set » TestEnableUpdateBit

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestEnableUpdateBit (dbSignal aSignal)

Function Re-enables the standard behaviour of the update bit, after it has been disabled with
TestDisableUpdateBit.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aSignal

Signal that should be reset to update bit standard behavior.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example
// disables the update bit of signal ‘DoorStatus_UB’ for 1000 ms
TestDisableUpdateBit(DoorStatus_UB, 0);
TestWaitForTimeout(1000);
TestEnableUpdateBit(DoorStatus_UB);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILControlResume

TestFRILControlResume
CAPL Function Overview » Test Feature Set » TestFRILControlResume

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILControlResume (char aNodeName[])

Function Restarts the Interaction Layer of the selected simulation node.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aNodeName

Name of the node that should restart its the Interaction Layer.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 • FlexRay — •


• Test nodes

Example
// stops the interaction layer of ECU A for 2000ms.
TestFRILControlWait (“ECU_A”);
TestWaitForTimeout(2000);
TestFRILControlResume ((“ECU_A”);

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILControlWait

TestFRILControlWait
CAPL Function Overview » Test Feature Set » TestFRILControlWait

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILControlWait(char aNodeName[])

Function Stops the Interaction Layer of the selected simulation node.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aNodeName

Name of the node that should stop the Interaction Layer.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 • FlexRay — •


• Test nodes

Example
// stops the interaction layer of ECU A for 2000 ms
TestFRILControlWait (“ECU_A”);
TestWaitForTimeout(2000);
TestFRILControlResume ((“ECU_A”);

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbChecksum

TestFRILDisturbChecksum
CAPL Function Overview » Test Feature Set » TestFRILDisturbChecksum

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILDisturbChecksum(char pduName[], long checksumType, long


disturbanceMode, long disturbanceCount, long disturbanceValue);

long TestFRILDisturbChecksum(char pduName[], char sigGroupName[], long


checksumType, long disturbanceMode, long disturbanceCount, long
disturbanceValue);

Function This function modifies the checksum. Different fault injections are possible.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aPDUName

Name of the node that should be modified.

aSigGroupName

Some systems assign a counter to signal group. With this variant you can apply the
disturbance to a dedicated signal group within a PDU.

checksumType

The possible values are described in the corresponding OEM Package manual.

disturbanceMode

Identifies the disturbance mode:

0 Value The disturbance uses the value in disturbanceValue as Counter.

1 Freeze The current counter value is transmitted.

2 Random A random value is transmitted as counter.

3 Offset The counter is incremented with the value in disturbanceValue.

disturbanceCount

-1 Infinite

0 Stops the disturbance, e.g.a infinite disturbance

n Number of disturbances

disturbanceValue

This value is used in combination with the disturbanceMode.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbChecksum

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • FlexRay — •


• Test nodes

Example

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbCounter

TestFRILDisturbCounter
CAPL Function Overview » Test Feature Set » TestFRILDisturbCounter

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILDisturbCounter(char aPduName[], long counterType, long


disturbanceMode, long disturbanceCount, long disturbanceValue, long
continueMode);

long TestFRILDisturbCounter(char pduName[], char aSigGroupName[], long


counterType, long disturbanceMode, long disturbanceCount, long
disturbanceValue, long continueMode);

Function This function modifies the counter. Different fault injections are possible.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aPDUName

Name of the node that should be modified.

aSigGroupName

Some systems assign a counter to signal group. With this variant you can apply the
disturbance to a dedicated signal group within a PDU.

counterType

The possible values are described in the corresponding OEM Package manual.

disturbanceMode

Identifies the disturbance mode:

0 Value The disturbance uses the value in disturbanceValue as Counter.

1 Freeze The current counter value is transmitted.

2 Random A random value is transmitted as counter.

3 Offset The counter is incremented with the value in disturbanceValue.

disturbanceCount

-1 Infinite

0 Stops the disturbance, e.g.a infinite disturbance

n Number of disturbances

disturbanceValue

This value is used in combination with the disturbanceMode.

continueMode

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbCounter

Defines the behavior of the counter after the disturbances are finished.

0 CorrectCounter The counter will be incremented with counter value + number of


disturbances.

1 LastValidCounter The counters next value bases on the last value before the
disturbance has started.

2 LastValue The counter incremets the last counter value (last disturbance
value).

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • FlexRay — •


• Test nodes

Example 1

Continue Mode: disturbanceMode=Value, disturbanceValue=8, disturbanceCount=2

Regular continueMode: continueMode: continueMode:


CorrectCounter LastValidCounter LastValue

Counter = 1 Counter = 1 Counter = 1 Counter = 1

Counter = 2 Counter = 8 Counter = 8 Counter = 8

Counter = 3 Counter = 8 Counter = 8 Counter = 8

Counter = 4 Counter = 4 Counter = 2 Counter = 9

Example 2

Disturbance Mode: disturbanceCount=2, continueMode=CorrectCounter,


disturbanceMode=Value, disturbanceValue=8

Regular disturbanceMode: disturbanceMode: disturbanceMode:


Value (8) Freeze Offset

Counter = 1 Counter = 1 Counter = 1 Counter = 1

Counter = 2 Counter = 8 Counter = 1 Counter = 9

Counter = 3 Counter = 8 Counter = 1 Counter = 1

Counter = 4 Counter = 4 Counter = 4 Counter = 4

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbPduUpdateBit

TestFRILDisturbPduUpdateBit
CAPL Function Overview » Test Feature Set » TestFRILDisturbPduUpdateBit

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILDisturbPduUpdateBit(char aPduName[], int disturbanceCount, int


updateBit);

Function This function modifies the update bit of a PDU. Different fault injections are possible.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aPDUName

Name of the node that should be modified.

aSignalName

Name of the signal using an update bit.

disturbanceCount

-1 Infinite

0 Stops the disturbance, e.g.a infinite disturbance

n Number of disturbances

updateBit

Desired disturbance value (0,1).

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 • FlexRay — •


• Test nodes

Example
// set the signal update bit of the signal “Signal_A” in PDU “PDU_A” for
100times to 1.
TestFRILDisturbSignalUpdateBit(“PDU_A”, Signal_A , 0, 100, 1);

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbSignalUpdateBit

TestFRILDisturbSignalUpdateBit
CAPL Function Overview » Test Feature Set » TestFRILDisturbSignalUpdateBit

Note

This function is not available for all OEM packages - depends on the CANoeIL.

Syntax long TestFRILDisturbSignalUpdateBit(char aPduName[], char aSignalName[],


long disturbanceMode, long disturbanceCount, long disturbanceValue);

Function This function modifies the update bit of a signal. Different fault injections are possible.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aPDUName

Name of the node that should be modified.

aSignalName

Name of the signal using an update bit.

disturbanceMode

Identifies the disturbance mode:

0 Value The disturbance uses the value in disturbanceValue as Counter.

1 Freeze The current counter value is transmitted.

2 Random A random value is transmitted as counter.

disturbanceCount

-1 Infinite

0 Stops the disturbance, e.g.a infinite disturbance

n Number of disturbances

disturbanceValue

This value is used in combination with the disturbanceMode.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • FlexRay — •


• Test nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestFRILDisturbSignalUpdateBit

Example
// set the signal update bit of the signal “Signal_A” in PDU “PDU_A” for
100times to 1.
TestFRILDisturbSignalUpdateBit(“PDU_A”, Signal_A , 0, 100, 1);

| OEM Package based Fault Injection Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetLastWaitElapsedTimeNS

TestGetLastWaitElapsedTimeNS
CAPL Function Overview » Test Feature Set » TestGetLastWaitElapsedTimeNS

Syntax float TestGetLastWaitElapsedTimeNS()

Function Indicates the period of time for which the last wait function executed had to wait until
being triggered.

Parameters —

Return values Last wait duration (see above)

-1.0 for call without a previous call to a wait function.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetLastWaitResult

TestGetLastWaitResult
CAPL Function Overview » Test Feature Set » TestGetLastWaitResult

Syntax long TestGetLastWaitResult()

Function Makes available the last occurred return value of a TestWait instruction once again.

Parameters —

Return values See TestWait instructions

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
TestWaitForTimeout(100);
Write("Waiting Result = %d", TestGetLastWaitResult());

| TestWaitForMessage | TestWaitForEnvVar | TestWaitForAuxEvent | TestWaitForTextEvent | TestWaitForTimeout |


TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetStringInput

TestGetStringInput
CAPL Function Overview » Test Feature Set » TestGetStringInput

Syntax long TestGetStringInput (char aAnswer[], dword aAnswerLen)

Function Returns the result of the last successful call of TestWaitForStringInput.

Parameters aAnswer

Variable in which the entry of the user must be accepted.

aAnswerLen

Length of variable which has to accept the user entry.

Return values <0: General error, e.g. by calling outside of a test sequence or through no previously
performed call of TestWaitForStringInput.

0: Data were successfully queried.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// ask for the users name and report it in the Write window
char answer[100];
if (1== TestWaitForStringInput("Please enter your name", 5000))
{
TestGetStringInput(answer, 100);
Write("name = %s", answer);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetValueInput

TestGetValueInput
CAPL Function Overview » Test Feature Set » TestGetValueInput

Syntax double TestGetValueInput ()

Function Returns the result of the last successful call of TestWaitForValueInput.

Parameters —

Return values = 0.0: Possible error during the last call of TestWaitForValueInput.

This can mean that the entry could not be correctly converted to a numeric value. This
value is also returned if no previous call of TestWaitForValueInput occurred.

But it is also possible that the user actually entered "0". This can be determined by
checking the entry in text form which can be obtained via TestGetStringInput.

Note that this value can only be the desired entry from the user if it was preceded by a
successful call of TestWaitForValueInput, i.e. with the return value "1".

!= 0.0: Last value queried from the tester with TestWaitForValueInput.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// ask for the test ID and report it in the Write window
TestWaitForValueInput("Please enter the test ID", 5000);
Write("Test ID = %f", TestGetValueInput());

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetVerdictLastTestCase

TestGetVerdictLastTestCase
CAPL Function Overview » Test Feature Set » TestGetVerdictLastTestCase

Syntax long TestGetVerdictLastTestCase()

Function Returns the verdict of the last elapsed or current test case.

Parameters —

Return values 1: Failed

0: Passed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example 1
// gets the verdict of last test case and report it in the Write window
void MainTest()
{
MyTestCase();
if (TestGetVerdictLastTestCase() == 1)
Write("MyTestCase failed.");
else
Write("MyTestCase passed.");
}

Example 2

See example: TestSetVerdictModule

| TestGetVerdictModule |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetVerdictModule

TestGetVerdictModule
CAPL Function Overview » Test Feature Set » TestGetVerdictModule

Syntax long TestGetVerdictModule ()

Function Returns the current verdict out of the test module.

Parameters —

Return values 1: Failed

0: Passed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// gets the verdict of the test module and report it in the Write window
void MainTest()
{
MyTestCase();
if (TestGetVerdictModule() == 1)
Write("State of Test Module: failed.");
else
Write("State of Test Module: passed.");
}

| TestGetVerdictLastTestCase |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testGetWaitEventEnvVarData

testGetWaitEventEnvVarData
CAPL Function Overview » Test Feature Set » testGetWaitEventEnvVarData

Syntax long testGetWaitEventEnvVarData(dword index, float & value);

long testGetWaitEventEnvVarData(dword index, char value[], dword length);

long testGetWaitEventEnvVarData(dword index, byte value[], dword length);

Function Retrieves the environment variable value that has led to the resume of a joined wait
statement.

Parameters value

The variable will be filled with the current value of the environment variable value.

length

Length of the char or byte filled. Used for environment variables of type string and data.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a message event

-2: Data access not possible, wrong function was used

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// add envVar event to the current set of “joined events” and get the
envVar value
dword index = 0;
float evValue = 0;
TestJoinEnvVarEvent(MyEnvVar);
// ... other join events
index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventEnvVarData(index, evValue);

|TestWaitForEnvVar | TestJoinEnvVarEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventMostAMSMsgData

TestGetWaitEventMostAMSMsgData
CAPL Function Overview » Test Feature Set » TestGetWaitEventMostAMSMsgData

Syntax long TestGetWaitEventMostAMSMsgData (MostAMSmessage aMessage)

long TestGetWaitEventMostAMSMsgData (dword index, MostAMSmessage aMessage)

Function If the last event was a MOST AMS message that resolved a wait construction, with the first
function the content of the message can be called.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin…") is here being used as an index.

Parameters aMessage

Message variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Successful data access

-1: Data access cannot be executed, the last event was no message event

-3: aMessage is not long enough to store the data of the received message.

Remedy:
Explicit setting of a sufficient size when defining the variable, e.g. MostAMSMessage *
msg = {DLC = 2000};

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

6.0: form 2 Test nodes — •

Example

| TestWaitForMostAMSMessage | TestWaitForMostAMSReport | TestJoinMostAMSMessageEvent | TestJoinMostAMSReportEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventMostMsgData

TestGetWaitEventMostMsgData
CAPL Function Overview » Test Feature Set » TestGetWaitEventMostMsgData

Syntax long TestGetWaitEventMostMsgData (mostMessage aMessage)

long TestGetWaitEventMostMsgData (dword index, mostMessage aMessage)

Function If the last event was a MOST message (MOST control message or MOST spy message) that
resolved a wait construction, with the first function the content of the message can be
called.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aMessage

Message variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin…".

Return values 0: Successful data access.

-1: Data access cannot be executed, the last event was no message event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

6.0: form 2 Test nodes — •

Example

| TestWaitForMostMessage | TestWaitForMostReport | TestJoinMostMessageEvent | TestJoinMostReportEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventMostPkt

TestGetWaitEventMostPkt
CAPL Function Overview » Test Feature Set » TestGetWaitEventMostPkt

Syntax long TestGetWaitEventMostPkt()

long TestGetWaitEventMostPkt(dword aIndex)

Function If the last (single) wait condition was resolved by a MOST packet event, the first function
makes the packet data accessible by the packet API functions normally used within the
OnMostPkt() event handler, such as MostPktSrcAdr(), MostPktDestAdr(), MostPktGetData()
etc.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Once another wait condition is set up in the current test sequence, access to the packet
data will be no longer available.

Parameters aIndex

Number of the “joined event” that was resumed by a MOST packet event. The number
corresponds to return value of the "testJoin..." function call, by which the event was
added to a joined condition.

Return values 0: Successful data access

-1: Data access can’t be executed, since the last wait condition was not resolved by a
MOST packet event.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 • MOST — •
• Test nodes

Example

| TestWaitForMostPkt| TestWaitForMostSpyPkt | TestJoinMostPktEvent | TestJoinMostSpyPktEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventMostRawMsgData

TestGetWaitEventMostRawMsgData
CAPL Function Overview » Test Feature Set » TestGetWaitEventMostRawMsgData

Syntax long TestGetWaitEventMostRawMsgData(mostRawMessage aRawMsg)

long TestGetWaitEventMostRawMsgData(dword aIndex, mostRawMessage


aRawMessage)

Function If the last (single) wait condition was resolved by a MOST control message, the function
copies the data of that message into the provided CAPL variable.

The second signature can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Info

If the wait condition was resolved by a control message having function


catalog format, it is recommended to use TestGetWaitEventMostMsgData
instead.

Parameters aMessage

Message variable that should be filled with this function.

aIndex

Number of the "joined event" that was resumed by a MOST (raw) control message. The
number corresponds to return value of the "testJoin..." function call, by which the
event was added to a joined condition.

Return values 0: Successful data access

-1: Data access can’t be executed, since the last wait condition was not resolved by a
MOST message event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

|TestWaitForMostRawSpyMessage | TestSendMostRawMessage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventMsgData

TestGetWaitEventMsgData
CAPL Function Overview » Test Feature Set » TestGetWaitEventMsgData

Syntax long TestGetWaitEventMsgData (message aMessage)

long TestGetWaitEventMsgData (dword index, message aMessage)

long TestGetWaitEventMsgData (linmessage aMessage)

long TestGetWaitEventMsgData (dword index, linmessage aMessage)

long TestGetWaitEventMsgData (gmLanMessage aMessage)

long TestGetWaitEventMsgData (dword index, gmLanMessage aMessage)

Function If a message event is the last event that triggers a wait instruction, the message content
can be called up with the first function.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aMessage

Message variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a message event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

6.0: extended Test nodes — •

Example
// add msg event to the current set of “joined events” and fill the msg
data to message ‘eventMessage’
dword index = 0;
TestJoinMessageEvent(VehicleMotion);
// ... other join events
index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventMsgData(index, eventMessage);

| TestWaitForMessage | TestJoinMessageEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitEventSysVarData

TestGetWaitEventSysVarData
CAPL Function Overview » Test Feature Set » TestGetWaitEventSysVarData

Syntax long testGetWaitEventSysVarData(dword index, float & value);

long testGetWaitEventSysVarData(dword index, char value[], dword length);

long testGetWaitEventSysVarData(dword index, float value[], dword length);

Function Retrieves the system variable value that has led to the resume of a joined wait
statement.

Parameters value

The variable will be filled with the current value of the system variable value.

length

Length of the char or float array. Used for system variables of type string, integer array or
float array.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a system variable event

-2: Data access not possible, wrong function was used

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example
// add sysVar event to the current set of “joined events” and get the
sysVar value
dword index = 0;
float sysValue = 0;
TestJoinSysVarEvent(MySysVar);
// ... other join events
index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventSysVarData(index, sysValue);

| TestWaitForSysVar | TestJoinSysVarEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrFrameData

TestGetWaitFrFrameData
CAPL Function Overview » Test Feature Set » TestGetWaitFrFrameData

Syntax long TestGetWaitFrFrameData (frFrame aFrame)

long TestGetWaitFrFrameData (dword index, frFrame aFrame)

Function If a valid FlexRay frame is the last event that triggers a wait instruction, the frame’s
content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aFrame

A FrFrame variable that should be filled in with this function.

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay frame event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrFrame.

| TestWaitForFrFrame | TestJoinFrFrameEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrFrameErrorData

TestGetWaitFrFrameErrorData
CAPL Function Overview » Test Feature Set » TestGetWaitFrFrameErrorData

Syntax long TestGetWaitFrFrameErrorData (frFrameError aFrameError)

long TestGetWaitFrFrameErrorData (dword index, frFrameError aFrameError)

Function If a FlexRay frame error is the last event that triggers a wait instruction, the event’s
content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aFrameError

Event variable that should be filled in with this function.

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay error frame event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by


FrFrameError.

| TestWaitForFrFrameError | TestJoinFrFrameErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrNullFrameData

TestGetWaitFrNullFrameData
CAPL Function Overview » Test Feature Set » TestGetWaitFrNullFrameData

Syntax long TestGetWaitFrNullFrameData (frNullFrame aNullFrame)

long TestGetWaitFrNullFrameData (dword index, frNullFrame aNullFrame)

Function If a FlexRay Null-Frame is the last event that triggers a wait instruction, the frame’s
content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aNullFrame

Null-Frame variable that should be filled in with this function.

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay null frame event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by FrNullFrame.

| TestWaitForFrNullFrame | TestJoinFrNullFrameEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrPDUData

TestGetWaitFrPDUData
CAPL Function Overview » Test Feature Set » TestGetWaitFrPDUData

Syntax long TestGetWaitFrPDUData (frPDU aPDU)

long TestGetWaitFrPDUData (dword index, frPDU aPDU)

Function If a valid FlexRay PDU is the last event that triggers a wait instruction, the PDU’s content
can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aPDU

PDU variable of type FrPDU that should be filled in with this function.

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay PDU event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrPDU.

| TestWaitForFrPDU | TestJoinFrPDUEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrPOCStateData

TestGetWaitFrPOCStateData
CAPL Function Overview » Test Feature Set » TestGetWaitFrPOCStateData

Syntax long TestGetWaitFrPOCStateData (FrPOCState aPOCState)

long TestGetWaitFrPOCStateData (dword index, FrPOCState aPOCState)

Function If an event indicating a change of state on the FlexRay Communication Controller's


protocol operation state machine is the last event that triggers a wait instruction, the
event’s content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aPOCState

Event structure that should be filled in with this function (see selectors of event
procedure on FrPOCState).

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay POC event

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrPOCState.

| TestWaitForFrPOCState | TestJoinFrPOCState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrStartCycleData

TestGetWaitFrStartCycleData
CAPL Function Overview » Test Feature Set » TestGetWaitFrStartCycleData

Syntax long TestGetWaitFrStartCycleData (frStartCycle aFrStartCycle)

long TestGetWaitFrStartCycleData (dword index, frStartCycle aFrStartCycle)

Function If a FlexRay start cycle is the last event that triggers a wait instruction, the event’s
content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aFrStartCycleText

Flexray Start Cycle variable that should be filled in with this function.

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay start cycle event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrStartCycle.

| TestWaitForFrStartCycle | TestJoinFrStartCycleEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitFrSymbolData

TestGetWaitFrSymbolData
CAPL Function Overview » Test Feature Set » TestGetWaitFrSymbolData

Syntax long TestGetWaitFrSymbolData (FrSymbol aSymbol)

long TestGetWaitFrSymbolData (dword index, FrSymbol aSymbol)

Function If a FlexRay symbol event is the last event that triggers a wait instruction, the event’s
content can be called up with the first function.

The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aSymbol

Event structure that should be filled in with this function (for selectors see event
procedure on FRSymbol).

Index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a FlexRay POC event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 • FlexRay — •
• Test nodes

Example

For an example see function TestWaitForFrSymbol.

| TestWaitForFrPOCState | TestJoinFrSymbolEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinCSErrorData

TestGetWaitLinCSErrorData
CAPL Function Overview » Test Feature Set » TestGetWaitLinCSErrorData

Syntax long TestGetWaitLinCSErrorData (linCSError apEvent)

long TestGetWaitLinCSErrorData (dword index, linCSError apEvent)

Function Retrieves the data of a checksum error triggered by the last wait instruction.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters apEvent

Data structure with the checksum error data.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access was successful

-1: Data access failed – the last wait function was not triggered by a checksum error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linCSError ()
{
linCSError linCSErrorData;
if (testWaitForLinCSError(5000) == 1)
{
if (testGetWaitLinCSErrorData(linCSErrorData) == 0)
{
testStep("Evaluation", "LIN CS Error event occurred for
FrameId=0x%X", linCSErrorData.ID);
}
}
}

| TestJoinLinCSErrorEvent | TestWaitForLinCSError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinETFSingleResponseData

TestGetWaitLinETFSingleResponseData
CAPL Function Overview » Test Feature Set » TestGetWaitLinETFSingleResponseData

Syntax long TestGetWaitLinETFSingleResponseData (linMessage apEvent)

long TestGetWaitLinETFSingleResponseData (dword index, linMessage apEvent)

Function If LIN Event-triggered frame with a single response for the specified associated frame is
the last event that triggers a wait instruction, the event content can be called up with
this function.

When the triggering event is a part of a wait instruction for joined events, the index
parameter has to correspond to the return value of "testJoin..." function.

Parameters apEvent

Event variable that is filled with current data from the bus.

index

Index of the joined event. It corresponds to the return value of "testJoin..." function.

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not an awaited event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
testcase tcTFS_linETFSingleResponse ()
{
linMessage 0 linETFSingleResponseData;
if (testWaitForLinETFSingleResponse(0x3A, 0x36, 5000) == 1)
{
if (testGetWaitLinETFSingleResponseData(linETFSingleResponseData) ==
0)
{
testStep("Evaluation", "LIN Event-triggered frame with a single
response occurred for FrameId=0x%X", linETFSingleResponseData.ID);
}
}
}

| TestWaitForLinETFSingleResponse | TestJoinLinETFSingleResponseEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinHdrData

TestGetWaitLinHdrData
CAPL Function Overview » Test Feature Set » TestGetWaitLinHdrData

Syntax long TestGetWaitLinHdrData (linheader aHeader)

long TestGetWaitLinHdrData (dword index, linheader aHeader)

Function If LIN Header event is the last event that triggers a wait instruction, the header content
can be called up with the first function.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters aHeader

Header variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not a LIN header event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linHdrEvent ()
{
linheader linHeaderData;
if (testWaitForLinHeader(5000) == 1)
{
if (TestGetWaitLinHdrData(linHeaderData) == 0)
{
testStep("Evaluation", "LIN Header event occurred for
FrameId=0x%X", linHeaderData.ID);
}
}
}

| TestWaitForLinHeader | TestJoinLinHeaderEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinReceiveErrData

TestGetWaitLinReceiveErrData
CAPL Function Overview » Test Feature Set » TestGetWaitLinReceiveErrData

Syntax long TestGetWaitLinReceiveErrData (linReceiveError apEvent)

long TestGetWaitLinReceiveErrData (dword index, linReceiveError apEvent)

Function If LIN Receive Error event is the last event that triggers a wait instruction, the error
content can be called up with the first function.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters apEvent

Event variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not an awaited event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linReceiveErrorEvent ()
{
linReceiveError linReceiveErrorData;
if (testWaitForLinReceiveError(5000) == 1)
{
if (TestGetWaitLinReceiveErrData(linReceiveErrorData) == 0)
{
testStep("Evaluation", "LIN Receive Error event occurred for
FrameId=0x%X", linReceiveErrorData.ID);
}
}
}

| TestWaitForLinReceiveError | TestJoinLinReceiveErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinSyncErrorData

TestGetWaitLinSyncErrorData
CAPL Function Overview » Test Feature Set » TestGetWaitLinSyncErrorData

Syntax long TestGetWaitLinSyncErrorData (LinSyncError apEvent)

long TestGetWaitLinSyncErrorData (dword index, LinSyncError apEvent)

Function Retrieves the data of a synchronisation error that triggered the last wait instruction.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters apEvent

Data structure that will be filled with the synchronisation error data.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access was successful

-1: Data access failed – the last wait function was not triggered by a synchronisation error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linSyncErrorEvent ()
{
linSyncError linSyncErrorData;
if (testWaitForLinSyncError(5000) == 1)
{
if (testGetWaitLinSyncErrorData(linSyncErrorData) == 0)
{
testStep("Evaluation", "LIN Sync Error event occurred.
SyncBreak=%d ns; SyncDel=%d ns", linSyncErrorData.breaklen,
linSyncErrorData.delimiterlen);
}
}
}

| TestJoinLinSyncErrorEvent | TestWaitForLinSyncError |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinTransmErrData

TestGetWaitLinTransmErrData
CAPL Function Overview » Test Feature Set » TestGetWaitLinTransmErrData

Syntax long TestGetWaitLinTransmErrData (linTransmError apEvent)

long TestGetWaitLinTransmErrData (dword index, linTransmError apEvent)

Function If LIN Transmission Error event is the last event that triggers a wait instruction, the error
content can be called up with the first function.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters apEvent

Event variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not an awaited event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linNoResponseEvent ()
{
linTransmError linTransmErrorData;
if (testWaitForLinTransmError(5000) == 1)
{
if (testGetWaitLinTransmErrData(linTransmErrorData) == 0)
{
testStep("Evaluation", "LIN No-Response event occurred for
FrameId=0x%X", linTransmErrorData.ID);
}
}
}

| TestWaitForLinTransmError | TestJoinLinTransmErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGetWaitLinWakeupData

TestGetWaitLinWakeupData
CAPL Function Overview » Test Feature Set » TestGetWaitLinWakeupData

Syntax long TestGetWaitLinWakeupData (linWakeupFrame apEvent)

long TestGetWaitLinWakeupData (dword index, linWakeupFrame apEvent)

Function If LIN Wakeup frame is the last event that triggers a wait instruction, the frame content
can be called up with the first function.
The second function can only be used for "joined events". The number of the "joined
event" (return value of "testJoin...") is here being used as an index.

Parameters apEvent

Event variable that should be filled in with this function.

index

Number of the "joined event" corresponds with the return value of "testJoin...".

Return values 0: Data access successful

-1: Data access could not be executed, the last event was not an awaited event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

6.0: form 2 Test nodes — •

Example
testcase tcTFS_linWakeupEvent ()
{
linWakeupFrame linWakeupData;
if (testWaitForLinWakeupFrame(5000) == 1)
{
if (testGetWaitLinWakeupData(linWakeupData) == 0)
{
testStep("Evaluation", "LIN Wakeup event occurred. Signal length
is %d ns", linWakeupData.length_ns);
}
}
}

| TestWaitForLinWakeupFrame | TestJoinLinWakeupEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testGetWaitScopeEventData

testGetWaitScopeEventData
CAPL Function Overview » Scope » testGetWaitScopeEventData

Syntax long testGetWaitScopeEventData (ScopeEvent aScopeEvent)

Function Retrieves the data of CANoe Scope event triggered by the last wait instruction.

Parameters aScopeEvent

Data structure to be filled.

Return values 0: Data access successful.

-1: Data access could not be executed, the last event was not an awaited event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 • Scope — •


• Test nodes

Example
void WaitForAnyScopeEvent(enum ScopeEventType expectedEventType)
{
long res;
int expected;
int received;
ScopeEvent scopeEventData;
if ((res = testWaitForScopeEvent(8000)) != 1)
{
testStepFail("","testWaitForScopeEvent (any) failed res=%d", res);
return;
}
res = testGetWaitScopeEventData(scopeEventData);
if (res != 0)
{
testStepFail("","testGetWaitScopeEventData failed res=%d", res);
return;
}
if (scopeEventData.Type != expectedEventType)
{
expected = expectedEventType;
received = scopeEventData.Type;
testStepFail("","testGetWaitScopeEventData delivers not expected
event type: expected = %d, received = %d", expected, received);
return;
}
testStepPass("", "Scope event received. Data: type=%d, DataId=%d,
Time=%I64d", (int)scopeEventData.Type, (int)scopeEventData.DataID,
scopeEventData.Time);
}

| ScopeEvent Seletors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGroupBegin

TestGroupBegin
CAPL Function Overview » Test Feature Set » TestGroupBegin

Syntax TestGroupBegin (char title[], char description[])

TestGroupBegin (char ident[], char title[], char description[])

Function A test group is opened with this function. It may only be called in a test module, but not
in a test case. All test cases and test groups that are executed before call of the
corresponding function TestGroupEnd are part of this test group. If a test group is not
closed with TestGroupEnd, then at the end of the test module, a warning is written in the
write window and the test group is closed automatically.

To obtain line breaks (in form of <br /> tags) in the HTML test report, "\n" may be
inserted at any place. The required replacement takes place during the transformation of
the XML test protocol into an HTML file by means of an XSLT style sheet, where it can also
be deactivated.

Parameters Identifier (e.g. a test group number) of the test group.

Title for the test group.

Description text for the test group.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

7.0 SP4: form 2 Test nodes — •

Example

See example: TestGroupBegin, TestGroupEnd

| TestGroupEnd |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestGroupEnd

TestGroupEnd
CAPL Function Overview » Test Feature Set » TestGroupEnd

Syntax TestGroupEnd ()

Function The function closes a test group opened with TestGroupBegin. If several test groups were
opened, then the last-opened and not yet closed test group is closed.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestGroupBegin, TestGroupEnd

| TestGroupBegin |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinAuxEvent

TestJoinAuxEvent
CAPL Function Overview » Test Feature Set » TestJoinAuxEvent

Syntax long TestJoinAuxEvent(dword aAuxEventId)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aAuxEventId

Auxiliary event id that should be awaited

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// wait is resumed on check event
dword index = 0;
dword checkId = 0;
checkId = ChkStart_Timeout(1000);
TestJoinAuxEvent(checkId);
// … other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");

index = TestWaitForAnyJoinedEvent(2000);

| TestWaitForAuxEvent | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinDiagResponseFromEcu

TestJoinDiagResponseFromEcu
CAPL Function Overview » Test Feature Set » TestJoinDiagResponseFromEcu

Syntax long TestJoinDiagResponseFromEcu()

long TestJoinDiagResponseFromEcu( char ecuQualifier[])

Function Adds an event of type diagnostics response reception to the set of joined events. This is a
non-blocking function.

Info

Please be aware that the tester will only receive responses from the selected
ECU target! Therefore if an event for ECU1 is added to the set of joined
events, but ECU2 is set as target before the response from ECU1 arrives, the
response from ECU1 will NOT be processed, i.e. the wait function does not
continue.

If the test program should continue on the reception of diagnostics responses


from several ECUs at the same time, a physical or functional network
description has to be the active diagnostics target!

Parameters ecuQualifier

If given, only a response from the indicated ECU will fire the event.

Return values -3: Error while adding the specified event to the set of joined events

-1: General error, for example, functionality is not available

>0: Number of the newly joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 Test nodes — •

Example
// waits for a diagnostics response
// wait is resumed on check event
dword index = 0;

TestJoinDiagResponseFromEcu();
// … other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");

Index = TestWaitForAnyJoinedEvent(2000);

| TestWaitForDiagResponse |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinEnvVarEvent

TestJoinEnvVarEvent
CAPL Function Overview » Test Feature Set » TestJoinEnvVarEvent

Note

If the value of an environment variable is changed before a wait instruction that waits for
a change to an environment variable, then the wait instruction rolls back, i.e. there is no
waiting. The reason for this is that the change to the environment variable does not take
effect in a CAPL program until the next wait point. In this case the change to the
environment variable occurs at the same time as waiting for the change, and this causes
the wait point to be discontinued immediately.

Syntax long TestJoinEnvVarEvent(dbEnvVar aEnvVar)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aEnvVar

Environment variable that should be awaited.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example 1
putValue (evMyEnvVar, 1);
TestJoinEnvVarEvent (evMyEnvVar);
TestWaitForAnyJoinedEvent (1000); // Does not wait, is immediately
discontinued by an environment variable change!

Example 2
// add envVar event to the current set of “joined events” and get the
envVar value
dword index = 0;
float evValue = 0;
TestJoinEnvVarEvent(MyEnvVar);
// ... other join events
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");

index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventEnvVarData(index, evValue);

| TestWaitForEnvVar | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrFrameErrorEvent

TestJoinFrFrameErrorEvent
CAPL Function Overview » Test Feature Set » TestJoinFrFrameErrorEvent

Syntax long TestJoinFrFrameErrorEvent (dbFrame aFrame)

long TestJoinFrFrameErrorEvent (dword aSlotId, dword aBaseCycle, dword


aCycleRepetition, dword aChannelMask)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrame

Symbolic frame as it is defined in the database.

aSlotId

Numeric slot identifier.

Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrFrameErrorEvent

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by


FrFrameError.

| TestWaitForFrFrameError | TestGetWaitFrFrameErrorData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrFrameEvent

TestJoinFrFrameEvent
CAPL Function Overview » Test Feature Set » TestJoinFrFrameEvent

Syntax long TestJoinFrFrameEvent (dbFrame aFrame)

long TestJoinFrFrameEvent (dword aSlotId, dword aBaseCycle, dword


aCycleRepetition, dword aChannelMask)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrame

Frame to be awaited as it is defined in the database.

aSlotId

Numeric slot identifier.

Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrFrameEvent

Example

For an example see function TestWaitForFrFrame.

| TestWaitForFrFrame | TestGetWaitFrFrameData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrNullFrameEvent

TestJoinFrNullFrameEvent
CAPL Function Overview » Test Feature Set » TestJoinFrNullFrameEvent

Syntax long TestJoinFrNullFrameEvent (dbFrame aFrame)

long TestJoinFrNullFrameEvent (dword aSlotId, dword aBaseCycle, dword


aCycleRepetition, dword aChannelMask)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrame

Frame to be awaited as it is defined in the database.

aSlotId

Numeric slot identifier.

Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrNullFrameEvent

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by FrNullFrame.

| TestWaitForFrNullFrame | TestGetWaitFrNullFrameData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrPDUEvent

TestJoinFrPDUEvent
CAPL Function Overview » Test Feature Set » TestJoinFrPDUEvent

Syntax long TestJoinFrPDUEvent (dbPDU aPDU)

long TestJoinFrPDUEvent ()

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aPDU

PDU to be awaited as it is defined in the database.

Default value: wait for any PDU.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrPDU.

| TestWaitForFrPDU | TestGetWaitFrPDUData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrPOCState

TestJoinFrPOCState
CAPL Function Overview » Test Feature Set » TestJoinFrPOCState

Syntax long TestJoinFrPOCState ()

long TestJoinFrPOCState (dword aPOCState)

long TestJoinFrPOCState (dword aPOCState, dword aWUState)

Function Completes the current set of "joined events" with the transmitted event.

This function does not wait.

Parameters aPOCState

The POC state the function will wait for (see selector 'FR_POCState' in event procedure on
FrPOCState).

If set to '-1' in combination with a 'WUState' the function will wait only for a Wakeup state
(any POC state will be accepted).

Available from CANoe 7.2.

aWUState

The Wakeup state the function will wait for (see selector 'FR_Info2' in event procedure on
FrPOCState).

Available from CANoe 7.2.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

7.2: form 2, 3 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrPOCState.

| TestWaitForFrPOCState | TestGetWaitFrPOCStateData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrStartCycleEvent

TestJoinFrStartCycleEvent
CAPL Function Overview » Test Feature Set » TestJoinFrStartCycleEvent

Syntax long TestJoinFrStartCycleEvent (dword aCycle)

long TestJoinFrStartCycleEvent (dword aBaseCycle, dword aCycleRepetition)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aCycle

Numeric cycle identifier.

Value range: 0...63

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrStartCycle.

| TestWaitForFrStartCycle | TestGetWaitFrStartCycleData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinFrSymbolEvent

TestJoinFrSymbolEvent
CAPL Function Overview » Test Feature Set » TestJoinFrSymbolEvent

Syntax long TestJoinFrSymbol ()

long TestJoinFrSymbol (dword aSymbolType, dword aChannelMask)

Function Completes the current set of "joined events" with the FlexRay symbol event.

This function does not wait.

Parameters aSymbolType

Identifies the type of symbol the function will wait for.

0 unknown

1 CAS

2 MTS

3 Wakeup

aChannelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will wait for
the symbol on channel A, 2 will wait for it on channel B and 3 on any channel (A/B).

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Test nodes

Example

For an example see function TestWaitForFrSymbol.

| TestWaitForFrSymbol | TestGetWaitFrSymbolData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinCSErrorEvent

TestJoinLinCSErrorEvent
CAPL Function Overview » Test Feature Set » TestJoinLinCSErrorEvent

Syntax long TestJoinLinCSErrorEvent()

long TestJoinLinCSErrorEvent(dbMessage apDBMsg)

long TestJoinLinCSErrorEvent(dword aFrameId)

Function Adds an event of type checksum error to the set of joined events. This is a non-blocking
function.

Parameters apDBMsg

Symbolic message

aFrameId

Frame identifier

Return values -3: Error while adding the specified event to the set of joined events

-1: General error, e.g. functionality is not available

>0: Number of the newly joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINResponse(int frameId)
{
long eventIndex;

testJoinMessageEvent(frameId);
testJoinLinReceiveErrorEvent(frameId);
testJoinLinCSErrorEvent(frameId);
testJoinLinTransmErrorEvent(frameId);
eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1: // valid frame
testStepPass("Validation", "IUT has responded correctly");
break;

case 2: // receive error


testStepFail("Validation", "IUT has responded with wrong number of
data bytes");
break;

case 3: // checksum error


testStepFail("Validation", "IUT has responded with wrong
checksum");
break;

case 4: // transmission error


testStepFail("Validation", "IUT has not responded");
break;

default:
testStepFail("Validation", "Internal error! Unexpected event (return

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinCSErrorEvent

code %d) on waiting for response", eventIndex);


}
}

| TestGetWaitLinCSErrorData | TestWaitForLinCSError | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinETFSingleResponseEvent

TestJoinLinETFSingleResponseEvent
CAPL Function Overview » Test Feature Set » TestJoinLinETFSingleResponseEvent

Syntax long TestJoinLinETFSingleResponseEvent (dword aETFFrameId, dword


aAssocFrameId)

Function Adds an event of type LIN Event-triggered Frame Single Response to the set of joined
events. This is a non-blocking function.

Parameters aETFFrameId

Frame identifier of LIN event-triggered frame to be awaited.

aAssocFrameId

Frame identifier of a LIN unconditional frame associated with the awaited event-triggered
frame.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLinETFSingleResponse(int etfFrameId)
{
long eventIndex;
testJoinLinETFSingleResponseEvent(etfFrameId, linGetProtectedID(0x36));
testJoinLinETFSingleResponseEvent(etfFrameId, linGetProtectedID(0x34));

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1:
testStepPass("Validation", "ETF single frame response occurred.
FrameId=0x36");
break;

case 2:
testStepPass("Validation", "ETF single frame response occurred.
FrameId=0x34");
break;

default:
testStepFail("Validation", "ETF single frame response not
occurred");
}
}

| TestGetWaitLinETFSingleResponseData | TestWaitForLinETFSingleResponse | TestWaitForAllJoinedEvents |


TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinHeaderEvent

TestJoinLinHeaderEvent
CAPL Function Overview » Test Feature Set » TestJoinLinHeaderEvent

Syntax long TestJoinLinHeaderEvent (dbMessage aFrame)

long TestJoinLinHeaderEvent (dword aFrameId)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrame

Frame whose header should be awaited.

aFrameId

Numeric ID of a frame whose header should be awaited.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINHeader(int frameId)
{
long eventIndex;
testJoinLinHeaderEvent(frameId);
testJoinLinWakeupEvent();
testJoinLinSyncErrorEvent();

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1:
testStepPass("Validation", "LIN Header for FrameId=0x%X occurred",
frameId);
break;

case 2:
testStepFail("Validation", "LIN Wakeup signal occurred");
break;

case 3:
testStepFail("Validation", "LIN Sync error occurred");
break;

default:
testStepFail("Validation", "Internal error! Unexpected event
(return code %d) on waiting for any LIN event", eventIndex);
}
}

| TestGetWaitLinHdrData | TestWaitForLinHeader | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinReceiveErrorEvent

TestJoinLinReceiveErrorEvent
CAPL Function Overview » Test Feature Set » TestJoinLinReceiveErrorEvent

Syntax long TestJoinLinReceiveErrorEvent (dword aFrameId)

long TestJoinLinReceiveErrorEvent ()

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrameId

Numeric ID of a frame whose Receive Error should be awaited.

Default value: wait for any ID.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINResponse(int frameId)
{
long eventIndex;

testJoinMessageEvent(frameId);
testJoinLinReceiveErrorEvent(frameId);
testJoinLinCSErrorEvent(frameId);
testJoinLinTransmErrorEvent(frameId);

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1: // valid frame
testStepPass("Validation", "IUT has responded correctly");
break;

case 2: // receive error


testStepFail("Validation", "IUT has responded with wrong number of
data bytes");
break;

case 3: // checksum error


testStepFail("Validation", "IUT has responded with wrong
checksum");
break;

case 4: // transmission error


testStepFail("Validation", "IUT has not responded");
break;
default:
testStepFail("Validation", "Internal error! Unexpected event
(return code %d) on waiting for response", eventIndex);
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinReceiveErrorEvent

| TestGetWaitLinReceiveErrData | TestWaitForLinReceiveError | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinSyncErrorEvent

TestJoinLinSyncErrorEvent
CAPL Function Overview » Test Feature Set » TestJoinLinSyncErrorEvent

Syntax long TestJoinLinSyncErrorEvent()

Function Adds an event of type synchronisation error to the set of joined events. This is a non-
blocking function.

Parameters —

Return values -3: error while adding the specified event to the set of joined events

-1: general error, e.g. functionality is not available

>0: number of the newly joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINHeader(int frameId)
{
long eventIndex;

testJoinLinHeaderEvent(frameId);
testJoinLinWakeupEvent();
testJoinLinSyncErrorEvent();

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1:
testStepPass("Validation", "LIN Header for FrameId=0x%X occurred",
frameId);
break;

case 2:
testStepFail("Validation", "LIN Wakeup signal occurred");
break;

case 3:
testStepFail("Validation", "LIN Sync error occurred");
break;

default:
testStepFail("Validation", "Internal error! Unexpected event
(return code %d) on waiting for any LIN event", eventIndex);
}
}

| TestGetWaitLinSyncErrorData | TestWaitForLinSyncError | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinTransmErrorEvent

TestJoinLinTransmErrorEvent
CAPL Function Overview » Test Feature Set » TestJoinLinTransmErrorEvent

Syntax long TestJoinLinTransmErrorEvent (dword aFrameId)

long TestJoinLinTransmErrorEvent ()

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aFrameId

Numeric ID of a frame whose Transmission Error should be awaited.

Default value: wait for any ID.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINResponse(int frameId)
{
long eventIndex;

testJoinMessageEvent(frameId);
testJoinLinReceiveErrorEvent(frameId);
testJoinLinCSErrorEvent(frameId);
testJoinLinTransmErrorEvent(frameId);

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1: // valid frame
testStepPass("Validation", "IUT has responded correctly");
break;

case 2: // receive error


testStepFail("Validation", "IUT has responded with wrong number of
data bytes");
break;

case 3: // checksum error


testStepFail("Validation", "IUT has responded with wrong
checksum");
break;

case 4: // transmission error


testStepFail("Validation", "IUT has not responded");
break;

default:
testStepFail("Validation", "Internal error! Unexpected event
(return code %d) on waiting for response", eventIndex);
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinTransmErrorEvent

| TestGetWaitLinTransmErrData | TestWaitForLinTransmError | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinLinWakeupEvent

TestJoinLinWakeupEvent
CAPL Function Overview » Test Feature Set » TestJoinLinWakeupEvent

Syntax long TestJoinLinWakeupEvent ()

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters —

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_waitForLINHeader(int frameId)
{
long eventIndex;

testJoinLinHeaderEvent(frameId);
testJoinLinWakeupEvent();
testJoinLinSyncErrorEvent();

eventIndex = testWaitForAnyJoinedEvent(5000);
switch (eventIndex)
{
case 1:
testStepPass("Validation", "LIN Header for FrameId=0x%X occurred",
frameId);
break;

case 2:
testStepFail("Validation", "LIN Wakeup signal occurred");
break;

case 3:
testStepFail("Validation", "LIN Sync error occurred");
break;

default:
testStepFail("Validation", "Internal error! Unexpected event
(return code %d) on waiting for any LIN event", eventIndex);
}
}

| TestGetWaitLinWakeupData | TestWaitForLinWakeupFrame | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMessageEvent

TestJoinMessageEvent
CAPL Function Overview » Test Feature Set » TestJoinMessageEvent

Syntax long TestJoinMessageEvent (dbMessage aMessage)

long TestJoinMessageEvent (dword aMessageId)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aMessage

Message that should be awaited.

aMessageId

Numeric ID of the message for which should be waited.

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// add msg event to the current set of “joined events” and fill the msg
data to message ‘eventMessage’
dword index = 0;
TestJoinMessageEvent(VehicleMotion);
// ... other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");

index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventMsgData(index, eventMessage);

| TestWaitForMessage | TestGetWaitEventMsgData | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSMessageEvent

TestJoinMostAMSMessageEvent
CAPL Function Overview » Test Feature Set » TestJoinMostAMSMessageEvent

Syntax long TestJoinMostAMSMessageEvent(dbMessage aDBMsg, int aInstanceId)

long TestJoinMostAMSMessageEvent(int aFBlockId, int aInstanceId)

long TestJoinMostAMSMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId)

long TestJoinMostAMSMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType)

long TestJoinMostAMSMessageEvent(int aSourceAddress, int


aDestinationAddress, int aFBlockId, int aInstanceId, int aFunctionId, int
aOpType)

long TestJoinMostAMSMessageEvent(int aSourceAddress, int


aDestinationAddress, char[] aSymbolicMessage, int aInstanceId)

long TestJoinMostAMSMessageEvent(int aSourceAddress, int


aDestinationAddress, char[] aSymbolicMessage)

long TestJoinMostAMSMessageEvent(char[] aSymbolicMessage, int aInstanceId)

long TestJoinMostAMSMessageEvent(char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST AMS
message. This function does not wait.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of BlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSMessageEvent

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestJoinMostAMSSpyMessageEvent | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestWaitForMostAMSMessage |


TestWaitForMostAMSReport | TestJoinMostAMSReportEvent | TestGetWaitEventMostAMSMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSReportEvent

TestJoinMostAMSReportEvent
CAPL Function Overview » Test Feature Set » TestJoinMostAMSReportEvent

Syntax long TestJoinMostAMSReportEvent (int aFBlockId, int aInstanceId, int


aFunctionId)

long TestJoinMostAMSReportEvent (char[] aSymbolicMessage, int aInstanceId)

long TestJoinMostAMSReportEvent (char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST AMS
response message (Report, OpType > 8). This function does not wait.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSReportEvent

| TestJoinMostAMSSpyReportEvent | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestWaitForMostAMSMessage |


TestWaitForMostAMSReport | TestJoinMostAMSMessageEvent | TestGetWaitEventMostAMSMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSSpyMessageEvent

TestJoinMostAMSSpyMessageEvent
CAPL Function Overview » Test Feature Set » TestJoinMostAMSSpyMessageEvent

Syntax TestJoinMostAMSSpyMessageEvent(dbMessage aDBMsg, int aInstanceId)

TestJoinMostAMSSpyMessageEvent(int aFBlockId, int aInstanceId)

TestJoinMostAMSSpyMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId)

TestJoinMostAMSSpyMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType)

TestJoinMostAMSSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType)

TestJoinMostAMSSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId)

TestJoinMostAMSSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage)

TestJoinMostAMSSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage)

TestJoinMostAMSSpyMessageEvent(char[] aSymbolicMessage, int aInstanceId)

TestJoinMostAMSSpyMessageEvent(char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST AMS
Spymessage. This may deal with individual frames transmissions (TelID=0) or segmented
transmissions. In the case of segmented transmissions, the last control message of a
correct transmission triggers the wait condition.

This function does not wait.

The wait point can be subsequently attached with TestWaitForAllJoinedEvents and


TestWaitForAnyJoinedEvent.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of BlockID

aInstanceId

Numeric value of InstanceID

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSSpyMessageEvent

aFunctionId

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestJoinMostAMSMessageEvent | TestJoinMostAMSSpyReportEvent |


TestJoinMostSpyMessageEvent | TestWaitForMostAMSSpyMessage | TestGetWaitEventMostAMSMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSSpyReportEvent

TestJoinMostAMSSpyReportEvent
CAPL Function Overview » Test Feature Set » TestJoinMostAMSSpyReportEvent

Syntax TestJoinMostAMSSpyReportEvent (int aFBlockId, int aInstanceId, int


aFunctionId)

TestJoinMostAMSSpyReportEvent (char[] aSymbolicMessage, int aInstanceId)

TestJoinMostAMSSpyReportEvent (char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST AMS spy
response message (Report, OpType > 8).

This function does not wait.

The wait point can be subsequently attached with TestWaitForAllJoinedEvents and


TestWaitForAnyJoinedEvent.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostAMSSpyReportEvent

• Test nodes

Example

| TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestJoinMostAMSReportEvent | TestJoinMostSpyReportEvent |


TestJoinMostAMSSpyMessageEvent | TestWaitForMostAMSSpyMessage | TestGetWaitEventMostAMSMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostMessageEvent

TestJoinMostMessageEvent
CAPL Function Overview » Test Feature Set » TestJoinMostMessageEvent

Syntax long TestJoinMostMessageEvent (dbMessage aDBMsg, int aInstanceId)

long TestJoinMostMessageEvent (int aFBlockId, int aInstanceId)

long TestJoinMostMessageEvent (int aFBlockId, int aInstanceId, int


aFunctionId)

long TestJoinMostMessageEvent (int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType)

long TestJoinMostMessageEvent (int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType)

long TestJoinMostMessageEvent (int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId)

long TestJoinMostMessageEvent (int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage)

long TestJoinMostMessageEvent (char[] aSymbolicMessage, int aInstanceId)

long TestJoinMostMessageEvent (char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST message
(MOST control message or MOST spy message). This function does not wait.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostMessageEvent

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestJoinMostSpyMessageEvent | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestWaitForMostMessage |


TestWaitForMostReport | TestJoinMostReportEvent | TestGetWaitEventMostMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostPktEvent

TestJoinMostPktEvent
CAPL Function Overview » Test Feature Set » TestJoinMostPktEvent

Syntax long TestJoinMostPktEvent(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[], long aInstanceID)

long TestJoinMostPktEvent(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[])

long TestJoinMostPktEvent(char aPktDataDesc[], long aInstanceID)

long TestJoinMostPktEvent(char aPktDataDesc[])

Function Adds an event condition for MOST packets to the current set of joined event conditions.

This function does not wait.

Info

Note, that the first and third signatures are exclusively suited to set up wait
condition events for packets having function catalog format, whereas the
other signatures also allow the definition of raw packet events.

Parameters aSourceAddress

Source address

aDestinationAddress

Target address

aPktDataDesc

String containing a symbolic or numeric description of the packet data. Following formats
are allowed:

• <Raw data byte description>


• <FBlock>.<Instance>.<Function>.<OpType>
• <FBlock>.<Instance>.<Function>.<OpType>(<Raw data byte description>)
• <FBlock>.<Instance>.<Function>.<OpType> (<High Protocol frame description>)

For a detailed description of the allowed syntax, see Definition of MOST packets.

aInstanceId

Numeric value of InstanceID

Return values -6: Parse Error; on specification of a packet description string, that can’t be resolved with
the XML function catalog or that is flawed.

-3: Join error

-1: General error e.g. the functionality is not available

>0: number of joined events

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostPktEvent

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

|TestWaitForMostPkt | TestWaitForMostSpyPkt | TestJoinMostSpyPktEvent | TestGetWaitEventMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostReportEvent

TestJoinMostReportEvent
CAPL Function Overview » Test Feature Set » TestJoinMostReportEvent

Syntax long TestJoinMostReportEvent (int aFBlockId, int aInstanceId, int


aFunctionId)

long TestJoinMostReportEvent (char[] aSymbolicMessage, int aFunctionId)

long TestJoinMostReportEvent (char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST response
message (Report, OpType > 8, MOST control message or MOST spy message). This function
does not wait.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostReportEvent

Example

| TestJoinMostSpyReportEvent | TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestwaitForMostMessage


|TestWaitForMostReport | TestJoinMostMessageEvent | TestGetWaitEventMostMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyMessageEvent

TestJoinMostSpyMessageEvent
CAPL Function Overview » Test Feature Set » TestJoinMostSpyMessageEvent

Syntax TestJoinMostSpyMessageEvent(dbMessage aDBMsg, int aInstanceId)

TestJoinMostSpyMessageEvent(int aFBlockId, int aInstanceId)

TestJoinMostSpyMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId)

TestJoinMostSpyMessageEvent(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType)

TestJoinMostSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType)

TestJoinMostSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId)

TestJoinMostSpyMessageEvent(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage)

TestJoinMostSpyMessageEvent(char[] aSymbolicMessage, int aInstanceId)

TestJoinMostSpyMessageEvent(char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST Spy
message.

The first arriving control message, which fulfills the specified conditions, resolves the
wait point, irregardless of whether it is part of a segmented transmission. TelId is not
included in this process.

This function does not wait.

The wait point can be subsequently attached with TestWaitForAllJoinedEvents and


TestWaitForAnyJoinedEvent.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyMessageEvent

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestJoinMostMessageEvent | TestJoinMostSpyReportEvent |


TestJoinMostAMSSpyMessageEvent | TestWaitForMostSpyMessage | TestGetWaitEventMostMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyPktEvent

TestJoinMostSpyPktEvent
CAPL Function Overview » Test Feature Set » TestJoinMostSpyPktEvent

Syntax long TestJoinMostSpyPktEvent(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[], long aInstanceID)

long TestJoinMostSpyPktEvent(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[])

long TestJoinMostSpyPktEvent(char aPktDataDesc[], long aInstanceID)

long TestJoinMostSpyPktEvent(char aPktDataDesc[])

Function Adds an event condition for MOST spy packets to the current set of joined event
conditions.

This function does not wait.

The first and third signatures are exclusively suited to set up wait condition events for spy
packets having function catalog format, whereas the other signatures also allow the
definition of raw spy packet events.

Info

Spy packets, but also node packets (with any direction) will resolve a wait
condition set up by this function, since CANoe does not double an incoming
packet on a channel that has asynchronous spy activated.

Parameters aSourceAddress

Source address

aDestinationAddress

Target address

aPktDataDesc

String containing a symbolic or numeric description of the packet data. Following formats
are allowed:

• <Raw data byte description>


• <FBlock>.<Instance>.<Function>.<OpType>
• <FBlock>.<Instance>.<Function>.<OpType>(<Raw data byte description>)
• <FBlock>.<Instance>.<Function>.<OpType> (<High Protocol frame description>)

For a detailed description of the allowed syntax, see Definition of MOST packets.

aInstanceId

Numeric value of InstanceID

Return values -6: Parse Error; on specification of a packet description string, that can’t be resolved with
the XML function catalog or that is flawed

-3: Join error

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyPktEvent

-1: General error e. g. the functionality is not available

>0: number of joined events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

|TestWaitForMostSpyPkt | TestWaitForMostPkt | TestJoinMostPktEvent | TestGetWaitEventMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyReportEvent

TestJoinMostSpyReportEvent
CAPL Function Overview » Test Feature Set » TestJoinMostSpyReportEvent

Syntax TestJoinMostSpyReportEvent (int aFBlockId, int aInstanceId, int


aFunctionId)

TestJoinMostSpyReportEvent (char[] aSymbolicMessage, int aInstanceId)

TestJoinMostSpyReportEvent (char[] aSymbolicMessage)

Function Completes the current set of "joined events" with the transmitted event, a MOST Spy
response message (Report, OpType > 8).

The first arriving control message, which fulfills the specified conditions, resolves the
wait point, irregardless of whether it is part of a segmented transmission. TelId is not
included in this process.

This function does not wait.

The wait point can be subsequently attached with TestWaitForAllJoinedEvents and


TestWaitForAnyJoinedEvent.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-3: Join error

-1: General error e.g. the functionality is not available

>0: Number of joined events

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinMostSpyReportEvent

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForAllJoinedEvents | TestWaitForAnyJoinedEvent | TestJoinMostAMSSpyReportEvent | TestJoinMostReportEvent |


TestJoinMostSpyMessageEvent | TestWaitForMostSpyMessage | TestGetWaitEventMostMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalInRange

TestJoinSignalInRange
CAPL Function Overview » Test Feature Set » TestJoinSignalInRange

Syntax long TestJoinSignalInRange (dbSignal aSignal, float aLowLimit, float


aHighLimit)

long TestJoinSignalInRange (dbEnvVar aEnvVar, float aLowLimit, float


aHighLimit)

long TestJoinSignalInRange (sysvar aSysVar, float aLowLimit, float


aHighLimit)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

When the set of joined events is evaluated by TestWaitForAllJoinedEvents or


TestWaitForAnyJoinedEvent, this condition will be checked immediately and may not wait
for a value change.

Parameters aSignal

Signal that should be awaited with a value inside or equal the limits.

aEnvVar

Environment variable that should be awaited with a value inside or equal the limits.

aSysVar

System variable that should be awaited with a value inside or equal the limits.

aLowLimit

Lower limit of the value.

aHighLimit

Upper limit of the value.

Return values -3: Join error.

-2: Type of the system / environment variable is not valid – only float or integer are valid
– or signal is not valid or invalid limits of the given range.

-1: General error, for example, functionality is not available.

>0: Number of the joined event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Test nodes — •

Example
// waits until the value of signal ‚Velocity’ is in the given range
long result;
dword index = 0;
result = TestJoinSignalInRange(Velocity, 30, 50);
// ... other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinTextEvent("ErrorFrame occurred!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalInRange

index = TestWaitForAnyJoinedEvent(2000);

| TestWaitForSignalInRange | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalMatch

TestJoinSignalMatch
CAPL Function Overview » Test Feature Set » TestJoinSignalMatch

Syntax long TestJoinSignalMatch (dbSignal aSignal, float CompareValue)

long TestJoinSignalMatch (dbEnvVar aEnvVar, float CompareValue)

long TestJoinSignalMatch (sysvar aSysVar, float CompareValue)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

When the set of joined events is evaluated by TestWaitForAllJoinedEvents or


TestWaitForAnyJoinedEvent, this condition will be checked immediately and may not wait
for a value change.

Parameters aSignal

Signal that should be awaited with a value to which the given value matches.

aEnvVar

Environment variable that should be awaited with a value to which the given value
matches.

aSysVar

System variable that should be awaited with a value to which the given value matches.

aCompareValue

Value which is compared to the signal value.

Return values -3: Join error

-2: Signal is not valid

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

7.5: form 2, 3 Test nodes — •

Example
// waits until signal ‘Velocity’ matches to a specific value
long result;
dword index = 0;
result = TestJoinSignalMatch(Node_SUT::Velocity, 80);
// ... other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinTextEvent("ErrorFrame occurred!");

index = TestWaitForAllJoinedEvents(500);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalMatch

| TestWaitForSignalMatch |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalOutsideRange

TestJoinSignalOutsideRange
CAPL Function Overview » Test Feature Set » TestJoinSignalOutsideRange

Syntax long TestJoinSignalOutsideRange (dbSignal aSignal, float aLowLimit, float


aHighLimit)

long TestJoinSignalOutsideRange (dbEnvVar aEnvVar, float aLowLimit, float


aHighLimit)

long TestJoinSignalOutsideRange (sysvar aSysVar, float aLowLimit, float


aHighLimit)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

When the set of joined events is evaluated by TestWaitForAllJoinedEvents or


TestWaitForAnyJoinedEvent, this condition will be checked immediately and may not wait
for a value change.

Parameters aSignal

Signal that should be awaited with a value outside the given range.

aEnvVar

Environment variable that should be awaited with a value outside the given range.

aSysVar

System variable that should be awaited with a value outside the given range.

aLowLimit

Lower limit of the value.

aHighLimit

Upper limit of the value.

Return values -3: Join error.

-2: Type of the system / environment variable is not valid – only float or integer are valid
– or signal is not valid or invalid limits of the given range.

-1: General error, for example, functionality is not available.

>0: Number of the joined event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Test nodes — •

Example
// waits until the value of signal ‚Velocity’ is outside the given range
long result;
dword index = 0;
result = TestJoinSignalOutsideRange(Velocity, 30, 50);
// ... other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinTextEvent("ErrorFrame occurred!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSignalOutsideRange

index = TestWaitForAnyJoinedEvent(2000);

| TestWaitForSignalOutsideRange | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinSysVarEvent

TestJoinSysVarEvent
CAPL Function Overview » Test Feature Set » TestJoinSysVarEvent

Syntax long TestJoinSysVarEvent(sysvar aSysVar)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aSysVar

System variable that should be awaited.

Return values -3: Join error.

-1: General error, for example, functionality is not available.

>0: Number of the joined event.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// add sysVar event to the current set of “joined events” and get the
sysVar value
dword index = 0;
float sysValue = 0;
TestJoinSysVarEvent(MySysVar);
// … other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");
index = TestWaitForAnyJoinedEvent(2000);

TestGetWaitEventSysVarData(index, sysValue);

| TestWaitForSysVar | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestJoinTextEvent

TestJoinTextEvent
CAPL Function Overview » Test Feature Set » TestJoinTextEvent

Syntax long TestJoinTextEvent(char[]aText)

Function Completes the current set of "joined events" with the transmitted event. This function
does not wait.

Parameters aText

Textual event that should be awaited

Return values -3: Join error

-1: General error, for example, functionality is not available

>0: Number of the joined event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for a specified text event
long result;
dword index = 0;
result = TestJoinTextEvent("ErrorFrame occurred!");
// ... other join events
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);

index = TestWaitForAnyJoinedEvent(2000);

// on ErrorFrame handler
on errorFrame
{
TestSupplyTextEvent("ErrorFrame occurred!");
}

| TestWaitForTextEvent | TestSupplyTextEvent | TestWaitForAnyJoinedEvent | TestWaitForAllJoinedEvents |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestModuleDescription

TestModuleDescription
CAPL Function Overview » Test Feature Set » TestModuleDescription

Syntax TestModuleDescription (char description[])

Function With this function, a description text for the test module can be written into the report.
The function can be called several times in a row, the transmitted texts are then added
to one another without additional separation.

To obtain line breaks (in form of <br /> tags) in the HTML test report, "\n" may be
inserted at any place. The required replacement takes place during the transformation of
the XML test protocol into an HTML file by means of an XSLT style sheet, where it can also
be deactivated.

Parameters Description text for the test module.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestModuleTitle, TestModuleDescription

| TestModuleTitle |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestModuleTitle

TestModuleTitle
CAPL Function Overview » Test Feature Set » TestModuleTitle

Syntax TestModuleTitle (char title[])

Function The title of the test module is acquired automatically from the name of the test node in
the simulation structure. It can also be set explicitly with this function.

Parameters Title of the test module.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestModuleTitle, TestModuleDescription

| TestModuleDescription |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestMostReadReg

TestMostReadReg
CAPL Function Overview » Test Feature Set » TestMostReadReg

Syntax long TestMostReadReg(long aChannel, long aChip, DWORD aOffset, DWORD


aRegDataLen, unsigned long aTimeout)

Function Reads one or several chip registers in the MOST hardware and waits for the result. If the
operation is successful, the written register values can be read out using
TestMostRegGetData.

Parameters aChannel

Channel connected to the hardware.

aChip

MOST hardware chip ID. Possible values are:

1 : OS814 (other chips cannot be accessed as of yet)

aOffset

First register address.

aRegDataLen

Number of registers to be read. Values between 1 and 16 are possible.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

Return values -101 bis -129: Error codes like for MostReadReg, MostWriteReg

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestMostWriteReg | TestMostRegGetData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestMostRegGetData

TestMostRegGetData
CAPL Function Overview » Test Feature Set » TestMostRegGetData

Syntax long TestMostRegGetData(BYTE aBuffer[], long aBufferSize)

Function The TestMostRegGetData() function is used together with the TestMostReadReg and
TestMostWriteReg functions.

After initiating one of these two functions, the resulting register value can be copied into
a byte buffer. Ensure that the buffer size is as specified. A maximum of 16 bytes are
transported with the MostReg result.

Note that the register values are only held ready for call-up until the next wait condition
in the test program.

Parameters aBuffer[]

Data buffer in which the register values are written

aBufferSize

Size of the given data buffer (max. 16 bytes)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestMostReadReg | TestMostWriteReg |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestMostWriteReg

TestMostWriteReg
CAPL Function Overview » Test Feature Set » TestMostWriteReg

Syntax long TestMostWriteReg(long aChannel, long aChip, DWORD aOffset, DWORD


aRegDataLen, BYTE aRegData[], unsigned long aTimeout);

Function Writes one or several chip registers in the MOST hardware and waits for the result. If the
operational is successful, the written register values can be read out using
TestMostRegGetData.

Parameters aChannel

Channel connected to the hardware.

aChip

MOST hardware chip ID. Possible values are:

1 : OS814 (other chips cannot be accessed as of yet)

aOffset

First register address.

aRegDataLen

Number of registers to be read (maximum 1 byte with the Optolyzer Interface box;
maximum 16 bytes with VN2600/VN2610).

aRegData[]

Data buffer with data to write (minimum size aRegDataLen)

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestMostWriteReg

| TestMostReadReg | TestMostRegGetData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestRemoveCondition

TestRemoveCondition
CAPL Function Overview » Test Feature Set » TestRemoveCondition

Note

Conditions can only be removed in the test case or on the test module level on which they
were also added. If a test case is abandoned, then the constraints created in this test
case are removed automatically. Similarly, with the end of a test module, all constraints
are removed automatically.

Syntax long TestRemoveCondition (dword aAuxHandle)

long TestRemoveCondition (char aEventText[])

Function Removes an event object or an event text that was added as a condition.

This function can be used both within a test case and also on the test module level.

Parameters aAuxHandle

Event object, for example a check from the TestService Library. Specified is the handle
that is returned when a check is created.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

Return values 0: Constraint was removed successfully

< 0: Constraint could not be removed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);
// reset stored values of the check
ChkControl_Reset(checkId);

// start the check again without adding as condition,


// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestRemoveCondition

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check
ChkControl_Destroy(checkId);

| TestAddCondition | TestCheckConditon | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestRemoveConstraint

TestRemoveConstraint
CAPL Function Overview » Test Feature Set » TestRemoveConstraint

Note

Conditions can only be removed in the test case or on the test module level on which they
were also added. If a test case is abandoned, then the constraints created in this test
case are removed automatically. Similarly, with the end of a test module, all constraints
are removed automatically.

Syntax long TestRemoveConstraint (dword aAuxHandle)

long TestRemoveConstraint (char aEventText[])

Function Removes an event object or an event text that was added as a constraint.

This function can be used both within a test case and also on the test module level.

Parameters aAuxHandle

Event object, for example a check from the TestService Library. Specified is the handle
that is returned when a check is created.

aEventText

Textual name of an event whose occurrence should be monitored. This event can be
triggered with the function TestSupplyTextEvent.

Return values 0: Constraint was removed successfully

!= 0: Constraint could not be removed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as constraint,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddConstrait(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as constraint
TestRemoveConstraint(checkId);

// stop the check


ChkControl_Stop(checkId);
// reset stored values of the check
ChkControl_Reset(checkId);

// start the check again without adding as constraint,


// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestRemoveConstraint

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check
ChkControl_Destroy(checkId);

| TestAddConstraint | TestCheckConstraint | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddEngineerInfo, TestReportAddSetupInfo, TestReportAddSUTInfo

TestReportAddEngineerInfo, TestReportAddSetupInfo,
TestReportAddSUTInfo
CAPL Function Overview » Test Feature Set » TestReportAddEngineerInfo, TestReportAddSetupInfo, TestReportAddSUTInfo

Syntax TestReportAddEngineerInfo (char name[], char description[], ...)

TestReportAddSetupInfo (char name[], char description[], ...)

TestReportAddSUTInfo (char name[], char description[], ...)

Function With these functions, information pairs of name and description (e.g. "serial number" and
"S012345AB") can be taken up into the report in the areas TestEngineer, TestSetUp, and
device (SUT) to be tested. The three areas named must not be created; they are
automatically available in the report. In the course of the test execution, any number of
information pairs can be written.

Parameters Information pair of name and description.

The format string has the same meaning as with the write function and is described there.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestReportAdd* Functions

| TestReportAddMiscInfoBlock | TestReportAddMiscInfo | TestReportAddExtendedInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddExtendedInfo

TestReportAddExtendedInfo
CAPL Function Overview » Test Feature Set » TestReportAddExtendedInfo

Syntax TestReportAddExtendedInfo (char type[], char text[])

Function With this function, it is possible to take over information into the protocol that is not
subject to processing by CANoe. This way, for example, any HTML code can be copied
directly into the protocol. A corresponding type specification specifies the type of
information (e.g. HTML).

Parameters type

Defined are the following types for the information text:

html HTML code

text ASCII text without formatting instructions

other other Text, is ignored by CANoe

text

Information text

The format string has the same meaning as with the write function and is described there.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestReportAdd* Functions

| TestReportAddImage | TestReportAddMiscInfo | TestReportAddMiscInfoBlock | TestReportAddEngineerInfo |


TestReportAddSetupInfo | TestReportAddSUTInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddExternalRef

TestReportAddExternalRef
CAPL Function Overview » Test Feature Set » TestReportAddExternalRef

Syntax TestReportAddExternalRef(char[] type, char[] title, char[] ref) // form 1

TestReportAddExternalRef(char[] type, char[] title, char[] ref, char[]


owner) // form 2

Function Adds an external reference to the report (URL, DOORS or eASEE link), which appears as a
link in the HTML report.

Can be used in test cases (testcase functions), test groups or in MainTest functions.

Parameters type

"url" for any kinds of URLs, "doors" for links to DOORS, "easee" for links to eASEE.

title

Text with which the link generated in the HTML report is displayed. If not indicated the
URL indicated in ref is used.

ref

The URL of the external resource, which is referenced.

owner

This attribute is intended to be used by applications which maintain links to external


resources automatically so they can identify their external reference elements.
It’s recommended not to use it individually.

Return values —

Availability Since Restricted to Measurement Setup Simulation / Test Setup


Version

7.0 Test nodes — •

7.5: form 2 Test nodes — •

Example
testcase tc_1_1()
{
TestCaseTitle("tc_1_1", "Test Case 1.1");
TestReportAddExternalRef("url", "Requirement",
"doors://doorssrv:36677/?version=1,prodID=0,dbid=42d2481361dc551c,containe
r=00004600,object=19");
...
}

| TestGetVerdictModule |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddImage

TestReportAddImage
CAPL Function Overview » Test Feature Set » TestReportAddImage

Note

The image should be in JPEG, GIF or PNG format since during the transformation to HTML
only the reference to the file is written in the HTML file and the common HTML browsers
generally only support these file formats for images.

Syntax TestReportAddImage (char description[], char filename[])

TestReportAddImage (char description[], char filename[], char width[], char


height[])

Function With this function the reference to a file that contains an image can be taken over into
the protocol. This command can be used in the context of the test module and also in the
context of a test case.

The existence of the file is not checked.

To ensure that the image is displayed in all common browsers, the file name must be
given as a UNC path. Should an image from a local drive be displayed, the file:/// prefix
must precede the normal path.

A correct path, for example, is file:///C:/images/image.jpg or


www.canoeimages.com/image.jpg.

If backslashes are used as separators, a double backslash ('\\') must be used to separate
directories within the path.

The second variant of this function allows to set the width and/or height with which the
image should be displayed in the report. If width or height is specified, the HTML report
will automatically show the picture with a link which opens the picture in full size in a
new window. The width and height parameters are transferred to the HTML report, their
values can be given as pixels or percentage. See an HTML reference for details.

Parameters description

Description text for the picture

filename

Name of the picture file, possibly with path specification

width

Width of the image.

height

Height of the image.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

7.2 SP3: form 2 Test nodes — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddImage

Example

See example: TestReportAdd* Functions

| TestReportAddExtendedInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddMiscInfo

TestReportAddMiscInfo
CAPL Function Overview » Test Feature Set » TestReportAddMiscInfo

Syntax TestReportAddMiscInfo (char name[], char description[], ...)

Function With these functions, information pairs of name and description (e.g. "parameter value
V0" and "3.7 V") can be taken up into an additional information area in the report. The
additional information area must be created previously with TestReportAddMiscInfoBlock.
If this function is used and there is no corresponding information area, then a warning will
be generated in the write window and a new information area will be created
automatically. In this information area, any number of information pairs can be written
with this function.

Parameters Information pair of name and description.

The format string has the same meaning as with the write function and is described there.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestReportAdd* Functions

| TestReportAddMiscInfoBlock |TestReportAddExtendedInfo | TestReportAddEngineerInfo | TestReportAddSetupInfo |


TestReportAddSUTInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddMiscInfoBlock

TestReportAddMiscInfoBlock
CAPL Function Overview » Test Feature Set » TestReportAddMiscInfoBlock

Syntax TestReportAddMiscInfoBlock (char title[])

Function The function generates a new information block for additional information pairs in the
report. With the function TestReportAddMiscInfo information pairs can be taken up into
this block. This is possible until a new information block is opened with
TestReportAddMiscInfoBlock, the current test case is ended (if the information block was
opened within the test case) or a test case is called (if the information block was called in
the test module).

Parameters Title of the information block.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestReportAdd* Functions

| TestReportAddMiscInfo | TestReportAddExtendedInfo | TestReportAddEngineerInfo | TestReportAddSetupInfo |


TestReportAddSUTInfo |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddWindowCapture

TestReportAddWindowCapture
CAPL Function Overview » Test Feature Set » TestReportAddWindowCapture

Information about window captures during test preparation and completion:

Calling TestReportAddWindowCapture is not supported in the MainTest function.

If you want to capture windows during test preparation and completion within the
MainTest function, you must implement these calls as individual testcase functions that
are named e.g. preparation and completion (as with XML test modules). This also lets
you obtain the captured window images in their appropriate time sequence, e.g. at the
beginning and end of a report.

Syntax TestReportAddWindowCapture(char[] window, char[] tab, char[] title, char[]


file)

TestReportAddWindowCapture(char[] window, char[] tab, char[] title)

Function Creates a screen capture of a Graphics, Frame Histogram, Data or Trace window.

Can only be used within test cases (testcase function).

The test case verdict is not affected. Errors that occur during window capture are logged
in the report as warnings, but do not affect the test case verdict.

Parameters window

Name of the window to be captured (corresponds to the name of the measurement setup
block).

tab (optional, otherwise "")

Name of the tab to be captured.


Only applies to windows that have several tabs, e.g. the Statistics window in Tab View. If
a tab is not defined, the active tab is captured.

title

Text heading that precedes the captured window image in the test report.

file (optional)

Name of the file into which the captured image is to be saved.


If you do not specify a name, an automatic filename is generated. Existing files with the
same name will be overwritten without confirmation.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 Test nodes — •

Example
testcase tc_1_1()
{
TestCaseTitle("tc_1_1", "Test Case 1.1");
TestReportAddWindowCapture("Trace - Report", "",
"Trace before execution of test case:",
"tc-1.1-trace-before");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportAddWindowCapture

... execute Test Pattern(s) ...

if (TestGetVerdictLastTestCase() != 0) {
TestReportAddWindowCapture("Trace - Report", "",
"Testfall failed. Trace am Ende:",
"tc-1.1-trace-after");
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestReportFileName

TestReportFileName
CAPL Function Overview » Test Feature Set » TestReportFileName

Syntax TestReportFileName (char data name[])

Function The name of the report file can be set using the user interface. The setting can be
overwritten with this function. To be effective, the function must be called in a test
module before every other CAPL function that relates to the report and executed before
every test case.

Info

This command should only be used if the file name of the test report has to
be assigned dynamically by the test module.

Normally, the name of the test report is assigned in the settings dialog for
the test module. If the test report is assigned the name
testReportFileName, it will not be possible to open it via the CANoe user
interface (test run dialog).

Parameters Name of the output file, possibly with path.

Without path specification, the directory is used in which the configuration file is found.
The extension .xml or. .html is added automatically.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
void MainTest()
{
// report is written in a file with the name ‚DynamicName’ beside the
configuration
TestReportFileName("DynamicName");
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetAllFaultInjections

TestResetAllFaultInjections
CAPL Function Overview » Test Feature Set » TestResetAllFaultInjections

Syntax long TestResetAllFaultInjections (dbNode aNode)

Function Reset all fault injections setting of a node.

Parameters aNode

Node which fault injection settings should be reset.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// set some FaultInjections and reset them all
TestDisableMsg(MsgToManipulate1);
TestSetMsgCycleTime(MsgToManipulate2, 200);

TestWaitForTimeout(2000)

TestResetAllFaultInjections(NodeToManipulate);

| TestDisableMsg | TestEnableMsg | TestResetMsgCycleTime | TestSetMsgCycleTime | TestSetMsgEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetEnvVarValue

TestResetEnvVarValue
CAPL Function Overview » Test Feature Set » TestResetEnvVarValue

Syntax long TestResetEnvVarValue (dbEnvVar aEnvVar)

Function Resets the environment variable to initial value. If no initial value is available, the
environment variable is set to 0 or "".

Parameters aEnvVar

Environment variable that should be reset.

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Test nodes — •

Example
// check reaction of signal “LockState” after crash
@EnvErrorCrashDetected = 1;
TestWaitForTimeout(100);
if ($LockState != Unlocked)
TestStepFail(“Doors are locked after crash is detected!”);

// reset the crash environment variable


TestResetEnvVarValue(EnvErrorCrashDetected);
TestWaitForTimeout(200);

| TestResetNamespaceSysVarValues | TestResetNodeSignalValues | TestResetSignalValue | TestResetSysVarValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetMsgCycleTime

TestResetMsgCycleTime
CAPL Function Overview » Test Feature Set » TestResetMsgCycleTime

Syntax long TestResetMsgCycleTime (dbMessage aMessage)

long TestResetMsgCycleTime (dword aMessageId)

long TestResetMsgCycleTime (char aMessageName[])

Function Resets the cycle time of the message to the database cycle time, after having changed it
with TestSetMsgCycleTime(...).

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should get the database cycle time.

aMessageId

Numeric ID of the message that should get the database cycle time.

aMessageName

Name of the message that should get the database cycle time.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// reset the cycle time of message ‘MsgToManipulate’
TestSetMsgCycleTime(MsgToManipulate, 200);
TestWaitForTimeout(2000);
TestResetMsgCycleTime(MsgToManipulate);

| TestDisableMsg | TestEnableMsg | TestResetAllFaultInjections | TestSetMsgCycleTime | TestSetMsgEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetMsgDlc

TestResetMsgDlc
CAPL Function Overview » Test Feature Set » TestResetMsgDlc

Syntax long TestResetMsgDlc (dbMessage aMessage)

long TestResetMsgDlc (dword aMessageId)

long TestResetMsgDlc (char aMessageName[])

Function Resets the DLC to the DLC of the database.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message symbol.

aMessageId

Numeric ID of the message.

aMessageName

Name of the message symbol.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// reset the DLC of message ‘MsgToManipulate’
TestSetMsgDLC(MsgToManipulate, 4);
TestWaitForTimeout(2000);
TestResetMsgDLC(MsgToManipulate);

| TestSetMsgDlc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetNamespaceSysVarValues

TestResetNamespaceSysVarValues
CAPL Function Overview » Test Feature Set » TestResetNamespaceSysVarValues

Syntax long TestResetNamespaceSysVarValues (char aNamespace[])

Function Resets all system variables of the given namespace and all sub-namespaces to their initial
value. If no initial value is defined for a system variable, the system variable is not set.

aNamespace is not allowed to be empty. If system variables without namespace should be


reset, TestResetSysVarValue has to be used.

Parameters aNamespace

Namespace which system variables should be reset.

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Test nodes — •

Example
// check the warning lights
@sysvar::Lights::SysVarWarningLights = 1;
TestWaitForTimeout(100);
if (@sysvar::Lights::SysVarWarningLightsDsp != 1)
TestStepFail(“Warning lights do not flash!”);

// reset all “Lights” system variables


TestResetNamespaceSysVarValues(“Lights”);
TestWaitForTimeout(200);

| TestResetEnvVarValue | TestResetNodeSignalValues | TestResetSignalValue | TestResetSysVarValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetNodeSignalValues

TestResetNodeSignalValues
CAPL Function Overview » Test Feature Set » TestResetNodeSignalValues

Syntax long TestResetNodeSignalValues (dbNode aNode)

Function Resets all tx-signals of the given node to their initial value. The sending of the messages
depends on the messages send typ.

The reset-function does not contain a waiting time which guarantees that all signals are
sent out on the bus. If a waiting time is desired, the TestWaitForTimeout function has
additionally been executed.

Parameters aNode

Node which tx-signals should be reset.

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Test nodes — •

Example
// check reaction of signal “LockState” after crash
$CrashDetected = 1;
TestWaitForTimeout(100);
if ($LockState != Unlocked)
TestStepFail(“Doors are locked after crash is detected!”);

// reset test signals of node “SUT”


TestResetNodeSignalValues(SUT);
TestWaitForTimeout(200);

| TestResetEnvVarValue | TestResetNamespaceSysVarValues | TestResetSignalValue | TestResetSysVarValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetSignalValue

TestResetSignalValue
CAPL Function Overview » Test Feature Set » TestResetSignalValue

Syntax long TestResetSignalValue (dbSignal aSignal)

Function Resets the signal to initial value. The sending depends on the message send typ.

The reset-function does not contain a waiting time which guarantees that the signal is
sent out on the bus. If a waiting time is desired, the TestWaitForTimeout function has
additionally been executed.

Parameters aSignal

Signal that should be reset.

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Test nodes — •

Example
// check reaction of signal “LockState” after crash
$CrashDetected = 1;
TestWaitForTimeout(100);
if ($LockState != Unlocked)
TestStepFail(“Doors are locked after crash is detected!”);

// reset test signals


TestResetSignalValue(CrashDetected);
TestResetSignalValue(LockState);
TestWaitForTimeout(200);

| TestResetEnvVarValue | TestResetNamespaceSysVarValues | TestResetNodeSignalValues | TestResetSysVarValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestResetSysVarValue

TestResetSysVarValue
CAPL Function Overview » Test Feature Set » TestResetSysVarValue

Syntax long TestResetSysVarValue (sysvar aSysVar)

Function Resets the system variable to initial value. If no initial value is defined, the system
variable is not set.

Parameters aSysVar

System variable that should be reset.

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 Test nodes — •

Example
// check reaction of signal “LockState” after crash
@sysvar::Error::SysVarCrashDetected = 1;
TestWaitForTimeout(100);
if ($LockState != Unlocked)
TestStepFail(“Doors are locked after crash is detected!”);

// reset the crash system variable


TestResetSysVarValue(sysvar::Error::SysVarCrashDetected);
TestWaitForTimeout(200);

| TestResetEnvVarValue | TestResetNamespaceSysVarValues | TestResetNodeSignalValues | TestResetSignalValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSendMostAMSMessage

TestSendMostAMSMessage
CAPL Function Overview » Test Feature Set » TestSendMostAMSMessage

Syntax long TestSendMostAMSMessage(int aDestinationAddress, char[]


aSymbolicMessage, int aInstanceId)

long TestSendMostAMSMessage(char[] aSymbolicMessage, int aInstanceId)

long TestSendMostAMSMessage(char[] aSymbolicMessage)

Function This function immediately sends a symbolically-defined MOST message and waits for the
associated Tx acknowledgement from the recipient. The AckNack bit is evaluated and the
return value specifies whether the creation and sending of the message was successful or
not.

The symbolically-defined messages must be complete, that is, all absolutely necessary
details must be specified explicitly (without the use of wildcards) since a concrete
message will be sent. However, a parameter list may be shorter than specified in the
function catalog in order to be able to generate incomplete messages purposefully.

If possible, the message is always sent using the AMS service. However, if this is not
activated, the message, if short enough, will be sent as a normal control message (with
TelID = 0).

Parameters aDestinationAddressText

Destination address

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.Instance.Function.OpType(parameter list)
• FBlock.Instance.Function.OpType
• FBlock.Function.OpType(parameter list)
• FBlock.FunctionId.OpType

aInstanceId

Numeric specification of the InstanceID

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-5: The message is too long and had to be sent using the AMS service, but the AMS service
is not activated.

-3: Message was sent, however "not acknowledge" appears in the Tx acknowledgement.

-2: The wait condition was triggered due to a constraint violation.

-1: General error, for example, the functionality is not available

0: Resume due to timeout

1: Message could be sent, Tx acknowledgement received

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSendMostAMSMessage

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • MOST — •
• Test nodes

Example

| TestSetSendTimeout | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSendMostRawMessage

TestSendMostRawMessage
CAPL Function Overview » Test Feature Set » TestSendMostRawMessage

Syntax long TestSendMostRawMessage(long aDestinationAddress, long aRType, BYTE


aMsgData[], dword aMsgDataLength, dword aTimeout)

long TestSendMostRawMessage(long aDestinationAddress, long aRType, char


aMsgDataDesc[], dword aTimeout)

Function This function immediately sends a MOST raw control message with the specified data and
waits for the associated Tx acknowledgement from the recipient. The AckNack bit is
evaluated and the return value specifies whether the creation and sending of the message
was successful or not.

The first signature specifies the message data by a byte array, the second uses a string to
describe the data bytes as a hex dump.

Parameters aDestinationAddress

Target address

aRType

MOST control message subtypes.

Must be one of the following values:

0 Normal

1 RemoteRead

2 RemoteWrite

3 Allocate

4 Deallocate

5 GetSource

aMsgData

Byte array containing the data bytes of the raw message to be send.

aMsgDataLength

Length of byte array aMsgData.

Data bytes at positions larger than the value of this parameter will be set to 0
automatically.

aMsgDataDesc

String with hexadecimal values describing the message data bytes of the raw message to
be send, starting at byte position 0, f. e.

"0A 0B 0C 0D 0E 0F 10 11 12 13 FF"

Blanks will be ignored and can be used to enhance readability.

Data bytes at positions beyond the ones described in this parameter will be set to 0

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSendMostRawMessage

automatically.

aTimeout

Maximum wait time [ms]

Return values -6: Parse Error; on specification of a message data description string that contains other
characters than hexadecimal digits

-3: Message was sent, however "not acknowledged" appears in the Tx acknowledgement.

-2: The wait condition was triggered due to a constraint violation.

-1: General error e.g. the functionality is not available

0: Resume due to timeout

1: Message could be sent, Tx acknowledgement received

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 • MOST — •
• Test nodes

Example

|TestWaitForMostRawSpyMessage | TestGetWaitEventMostRawMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetEcuOffline

TestSetEcuOffline
CAPL Function Overview » Test Feature Set » TestSetEcuOffline

Syntax void testSetEcuOffline (dbNode aNode)

void testSetEcuOffline (char aNodeName[])

Function Disconnects the ECU from the bus. Messages being sent by the ECU will not be forwarded
to the bus.
With the testSetEcuOnline function the ECU can be reconnected to the bus.

This function interferes with the CAPL program and possible Nodelayer DLLs.

Parameters aNode

ECU to be switched offline (must be defined in the database).

aNodeName

Name of the ECU to be switched offline (must be defined in the database).

Node name can optionally specified by an additional qualifier:

• NodeName
• BusName::NodeName

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// cuts the node ‚SUT’ 5000 ms from the bus
TestSetEcuOffline(SUT);
TestWaitForTimeout(5000);
TestSetEcuOnline(SUT)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetEcuOnline

TestSetEcuOnline
CAPL Function Overview » Test Feature Set » TestSetEcuOnline

Syntax void testSetEcuOnline (dbNode aNode)

void testSetEcuOnline (char aNodeName[])

Function Connects the ECU to the bus.


After calling the testSetEcuOffline() function the ECU can be reconnected to the bus by
using the testSetEcuOnline() function. Messages being sent by the ECU will be forwarded
to the bus.

This function interferes with the CAPL program and possible Nodelayer DLLs.

Parameters aNode

ECU to be switched online (must be defined in the database).

aNodeName

Name of the ECU to be switched online (must be defined in the database).

Node name can optionally specified by an additional qualifier:

• NodeName
• BusName::NodeName

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// cuts the node ‚SUT’ 5000 ms from the bus
TestSetEcuOffline(SUT);
TestWaitForTimeout(5000);
TestSetEcuOnline(SUT)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetMsgCycleTime

TestSetMsgCycleTime
CAPL Function Overview » Test Feature Set » TestSetMsgCycleTime

Syntax long TestSetMsgCycleTime(dbMessage aMessage, float aNewCycleTime)

long TestSetMsgCycleTime(dword aMessageId, float aNewCycleTime)

long TestSetMsgCycleTime(char aMessageName[])

Function Assigns a new cycle time to the message.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should get a new cycle time.

aMessageId

Numeric ID of the message that should get a new cycle time.

aNewCycleTime

The new cycle time (in milliseconds) that should be assigned to the message.

aMessageName

Name of the message that should get a new cycle time.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error

-1: General error, for example, functionality is not available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// set the cycle time of message ‘MsgToManipulate’ to a specified value for
2000 ms
TestSetMsgCycleTime(MsgToManipulate, 200);
TestWaitForTimeout(2000);
TestResetMsgCycleTime(MsgToManipulate);

| TestDisableMsg | TestEnableMsg | TestResetAllFaultInjections | TestResetMsgCycleTime | TestSetMsgEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetMsgEvent

TestSetMsgEvent
CAPL Function Overview » Test Feature Set » TestSetMsgEvent

Syntax long TestSetMsgEvent (dbMessage aMessage)

long TestSetMsgEvent (dword aMessageId)

long TestSetMsgEvent (char aMessageName[])

Function Sends the transferred message directly to the bus if the network is active.

The send model is ignored.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be sent.

aMessageId

Numeric ID of the message that should be sent.

aMessageName

Name of the message that should be sent.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

Return values 0: No error

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// send a message event for the disabled message ‘MsgToManipulate’
TestDisableMsg(MsgToManipulate);
TestWaitForTimeout(5000);
TestSetMsgEvent(MsgToManipulate);
TestWaitForTimeout(5000);
TestEnableMsg(MsgToManipulate);

| TestDisableMsg | TestEnableMsg | TestResetAllFaultInjections | TestResetMsgCycleTime | TestSetMsgCycleTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetParseErrorConstraint

TestSetParseErrorConstraint
CAPL Function Overview » Test Feature Set » TestSetParseErrorConstraint

Syntax void TestSetParseErrorConstraint (long mode)

Function The function sets the behavior of the symbolic variants of TestWaitForMost... and
TestJoinMost... functions on the occurrence of errors during the parsing of the message
definitions.

Depending on whether the function is called within or outside of a test case, the setting
either has an effect on only all subsequent TestWaitForMost... and TestJoinMost...
function calls within the test case or generally on all subsequent calls. Therefore, the
behavior specified within a test case loses its validity with the end of the test case and
will be, if necessary, replaced by a previously externally-set behavior.

Parameters mode

0 The return value of the relevant function call indicates the problem that has
occurred and a corresponding note is entered in the report. This is the pre-set
default behavior.

1 The relevant test case is aborted and the verdict set to "fail". The aborting of the
test case is noted with the error in the report.

2 Measurement will be stopped. The relevant test case is aborted and the verdict set
to "fail". The aborting of the test case is noted with the error in the report.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

| TestSendMostAMSMessage | TestWaitForMostMessage | TestWaitForMostAMSMessage | TestWaitForMostReport |


TestWaitForMostAMSReport | TestWaitForMostAMSResponse | TestWaitForMostAMSResult | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetSendTimeout

TestSetSendTimeout
CAPL Function Overview » Test Feature Set » TestSetSendTimeout

Syntax void TestSetSendTimeout (long aTimeout)

Function This function sets the timeout up to which the TestSendMostAMSMessage functions wait
for a Tx acknowledgement for the sent message. This value is set to 5000 ms by default.

With the specification of a timeout value of 0, a wait of any length for the Tx
acknowledgement is possible, while the specification of -1 means that the waiting for the
acknowledgement is switched off, that is, there is no wait.

Parameters aTimeout

Maximum time that should be waited [ms]

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

| TestSendMostAMSMessage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetMsgDlc

TestSetMsgDlc
CAPL Function Overview » Test Feature Set » TestSetMsgDlc

Syntax long TestSetMsgDlc (dbMessage aMessage, dword dlc)

long TestSetMsgDlc (dword aMessageId, dword dlc)

long TestSetMsgDlc (char aMessageName[], dword dlc)

Function Assigns a new DLC to the message.

This function influences a simulation node with an assigned CANoe Interaction Layer.

Parameters aMessage

Message that should be manipulated.

aMessageId

Numeric ID of the message that should be manipulated.

aMessageName

Name of the message that should be manipulated.

Message name can optionally specified by additional qualifiers:

• MsgName
• BusName::MsgName
• TransmitterName::MsgName
• BusName::TransmitterName::MsgName

dlc

New DLC that is assigned to the message.

Return values 0: No error.

-1: General error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP4 Test nodes — •

Example
// set the DLC of message ‘MsgToManipulate’ for 2000 ms to a specified
length
TestSetMsgDLC(MsgToManipulate, 4);
TestWaitForTimeout(2000);
TestResetMsgDLC(MsgToManipulate);

| TestResetMsgDlc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSetVerdictModule

TestSetVerdictModule
CAPL Function Overview » Test Feature Set » TestSetVerdictModule

Syntax void TestSetVerdictModule (Verdict aVerdict)

Function This function sets the verdict of the test module. With this function the automatic verdict
propagation of test cases to the test module can be influenced later.

E.g. this function can be used within the test controlling to conduct a test case "on probe"
and to reset the verdict to "pass" in case "fail".

Parameters aVerdict

0 pass

1 fail

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example

See example: TestSetVerdictModule

| TestGetVerdictModule | TestGetVerdictLastTestCase |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestStep, TestStepPass, TestStepFail, TestStepWarning

TestStep, TestStepPass, TestStepFail, TestStepWarning


CAPL Function Overview » Test Feature Set » TestStep, TestStepPass, TestStepFail, TestStepWarning

Note

The forms without parameters or with only one parameter description should only be used
in combination with TestStepBegin.

Syntax TestStep (dword LevelOfDetail, char Identifier[], char Description[], ...)

TestStep (char Identifier[], char Description[], ...)

TestStepPass (dword LevelOfDetail, char Identifier[], char Description[],


...)

TestStepPass (char Identifier[], char Description[], ...)

TestStepPass (char Description[])

TestStepPass ()

TestStepFail (dword LevelOfDetail, char Identifier[], char Description[],


...)

TestStepFail (char Identifier[], char Description[], ...)

TestStepFail (char Description[])

TestStepFail ()

TestStepWarning (dword LevelOfDetail, char Identifier[], char


Description[], ...)

TestStepWarning (char Identifier[], char Description[], ...)

TestStepWarning (char Description[])

TestStepWarning ()

Function With these functions, test steps can be reported within a test case.

TestStep reports a test step without influence on the result.

TestStepPass reports a test step that was executed as expected. This is displayed
accordingly in the test report.

TestStepFail describes a test step that causes an error. Also this is displayed
accordingly in the test report. The verdict of the test case is hereby set automatically to
fail.

TestStepWarning describes a test case that was executed without errors but whose
result could contribute to a problem later on. This is represented appropriately in the test
protocol.

Parameters LevelOfDetail

It is possible to identify with a number how important this test step is. In the test
protocol, it is possible that only test steps up to a certain importance will be displayed. 0
means "very important", higher numbers indicate lower degrees of importance.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestStep, TestStepPass, TestStepFail, TestStepWarning

Without an explicit specification, a LevelOfDetail of 0 is assumed.

Identifier (e.g. a test step number) of the test step

Description of the test step

To obtain line breaks (in form of <br /> tags) in the HTML test report, "\n" may be
inserted at any place. The required replacement takes place during the transformation of
the XML test protocol into an HTML file by means of an XSLT style sheet, where it can also
be deactivated.

The description can also contain values that are read out of variables. For that the
corresponding sequences like the format string of snprintf are inserted in the description.
The corresponding variables are added to the parameter list.

The format string has the same meaning as with the write function and is described there.

Example
TestStepPass("10.2", "Output voltage ok (Uout = %d volts)",
voltage);

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 Test nodes — •

5.1: TestStepWarning Test nodes — •

Example

See example: TestCaseTitle, TestCaseDescription, TestStep

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestStepBegin

TestStepBegin
CAPL Function Overview » Test Feature Set » TestStepBegin

Note

TestStepBegin must be concluded with a second TestStepPass, TestStepFail or


TestStepWarning. Here the variants of these TestStep commands must be used without
parameters or with one parameter. Only if this second TestStep command is executed a
test step is noted in the report. If this second TestStep command is forgotten, then the
test step is concluded automatically as soon as another report command arises (this also
applies for the TestStep variants with two and three parameters).

Between TestStepBegin and the closing TestStepPass/TestStepFail/TestStepWarning no


kind of "wait" command (TestWaitFor...) must be used. This is due to possible report
output during wait commands (e.g. resume reasons, constraint/condition violation).

The variant TestStepBegin plus TestStepPass/TestStepFail/TestStepWarning for the


entry of test steps into the report offers the opportunity to structure the code more
clearly without additional comments. At the beginning of the program piece that
implements a test step (typically a short piece of code with a condition to determine the
test step result), it is now possible to specify with TestStepBegin the importance, the
test step identification, and the description of what is done in this test step. With this
TestStepBegin line it is possible to avoid a corresponding initial comment in front of the
test step implementation. As soon as the result has been determined within the test step
implementation, it is completed with TestStepPass, TestStepFail or TestStepWarning. At
this point the test step can also be taken over into the report. Potentially in this second
TestStep command, the descriptive test is also completed, usually with a precise
description of the problem that occurred.

Syntax TestStepBegin (dword Importance, char Identifier[], char Description[])

TestStepBegin (char Identifier[], char Description[])

Function With these functions, test steps can be logged within a test case. Such a test step is
introduced with TestStepBegin, which is then completed with TestStepPass, TestStepFail
or TestStepWarning. A test step is noted in the test report only with this conclusion.

Parameters Importance

It is possible to identify with a number how important this test step is. In the test report,
it is possible that only test steps up to a certain importance will be displayed. 0 means
"very important", higher numbers indicate lower degrees of importance.

Without an explicit specification, the importance 0 is assumed.

Identifier (e.g. a test step number) of the test step

Description of the test step

A possibly-specified descriptive text in the concluding TestStepPass, TestStepFail or


TestStepWarning is added to this descriptive text.

To obtain line breaks (in form of <br /> tags) in the HTML test report, "\n" may be
inserted at any place. The required replacement takes place during the transformation of
the XML test report into an HTML file by means of an XSLT style sheet, where it can also
be deactivated.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestStepBegin

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example
TestStepBegin (0, „3.1“, „Receipt of response message“);
if (result == 1)
TestStepPass ();
else
TestStepFail („failed because of Timeout“);

| TestStep, TestStepPass, TestStepFail, TestStepWarning |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestSupplyTextEvent

TestSupplyTextEvent
CAPL Function Overview » Test Feature Set » TestSupplyTextEvent

Syntax long TestSupplyTextEvent(char aText[])

Function Signals the specified event.

Consequently resolves a possibly-active wait condition on this event.

Parameters aText

Name of the event to be signaled

Return values 0: Event was signaled successfully

-1: Event could not be signaled

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// Signals the occurrence of an Error Frame as a text event
on errorFrame
{
TestSupplyTextEvent("ErrorFrame occurred!")
}

| TestWaitForTextEvent | TestJoinTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testValidateSignalInRange

testValidateSignalInRange
CAPL Function Overview » Test Feature Set / Signal Access » testValidateSignalInRange

Note

This function replaces testValidateSignalInRangeByTxNode.

Syntax long testValidateSignalInRange (char aTestStep[], dbSignal aSignal, float


aLowLimit, float aHighLimit)

long testValidateSignalInRange (char aTestStep[], EnvVarName, float


aLowLimit, float aHighLimit);

long testValidateSignalInRange (char aTestStep[], sysvar aSysVar, float


aLowLimit, float aHighLimit);

Function Checks the value of the signal, the environment variable value or the system variable
value against the condition:
aLowLimit <= Value <= aHighLimit

The test step is evaluated as either passed or failed depending on the results

Parameters aTestStep

Name of the test step for the test report

aSignal

The signal to be polled

EnvVarName

Environment variable to be queried

aSysVar

System Variable to be queried

aLowLimit

Lower limit of the value

aHighLimit

Upper limit of the value

Return values -1: General error

-2: Type of the environment or system variable is not valid – only float or integer are
valid- or invalid limits of the given range

0: Correct functionality

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

6.0: form 2 Test nodes — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testValidateSignalInRange

7.0: form 3 Test nodes — •

Example
// validates the value of the signal against the given range
long result;
result = testValidateSignalInRange(Node_SUT::Velocity, 60, 100);
if (result != 0)
TestStepFail("Error occurred!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestValidateSignalMatch

TestValidateSignalMatch
CAPL Function Overview » Test Feature Set / Signal Access » TestValidateSignalMatch

Syntax long TestValidateSignalMatch (char aTestStep[], dbSignal aSignal, float


aCompareValue)

long TestValidateSignalMatch (char aTestStep[], dbEnvVar aEnvVar, float


aCompareValue)

long TestValidateSignalMatch (char aTestStep[], sysvar aSysVar, float


aCompareValue)

Function Checks the given value against the value of the signal, the system variable or the
environment variable. The resolution of the signal is considered.

The test step is evaluated as either passed or failed depending on the results.

Parameters aTestStep

Name of the test step for the test report.

aSignal

The signal to be polled.

aEnvVar

The environment variable to be polled.

aSysVar

The system variable to be polled.

aCompareValue

Value which is compared to the signal value.

Return values 0: Correct functionality

-1: General error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

7.5: form 2, 3 Test nodes — •

Example
// validates the value of the signal against the given value
long result;
result = TestValidateSignalMatch(Node_SUT::Velocity, 80);
if (result != 0)
TestStepFail("Error occurred!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testValidateSignalOutsideRange

testValidateSignalOutsideRange
CAPL Function Overview » Test Feature Set / Signal Access » testValidateSignalOutsideRange

Note

This function replaces testValidateSignalOutsideRangeByTxNode.

Syntax long testValidateSignalOutsideRange (char aTestStep[], dbSignal aSignal,


float aLowLimit, float aHighLimit)

long testValidateSignalOutsideRange (char aTestStep[], EnvVarName, float


aLowLimit, float aHighLimit); (effective with CANoe 6.0)

long testValidateSignalOutsideRange (char aTestStep[], sysVar aSysVar,


float aLowLimit, float aHighLimit); (effective with CANoe 7.0)

Function Checks the signal value, the environment variable value or the system variable value
against the condition:

• Value < aLowLimit or


• Value > aHighLimit

The test step is evaluated as passed or failed depending on the results

Parameters aTestStep

Name of the test step for the test report

aSignal

The signal to be polled

EnvVarName

Environment variable to be queried

aSysVar

System Variable to be queried

aLowLimit

Lower limit of the value

aHighLimit

Upper limit of the value

Return values -1: General error

-2: Type of the environment or system variable is not valid – only float or integer are
valid- or invalid limits of the given range

0: Correct functionality

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testValidateSignalOutsideRange

6.0: form 2 Test nodes — •

7.0: form 3 Test nodes — •

Example
// validates the value of the signal against the given range
long result;
result = testValidateSignalOutsideRange(Node_SUT::Velocity, 60, 100);
if (result != 0)
TestStepFail("Error occurred!");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForAllJoinedEvents

TestWaitForAllJoinedEvents
CAPL Function Overview » Test Feature Set » TestWaitForAllJoinedEvents

Note

Regardless of how the wait point was discontinued, afterwards the set of "joined events"
is empty. That is, waiting for "joined events" always empties the previously defined set of
"joined events".

Syntax long TestWaitForAllJoinedEvents(dword aTimeout)

Function Waits for the current set of "joined events." The wait condition is resolved if all of the
joined events were signaled.

Should not all events occur before the expiration of the time aTimeout, the wait
condition is resolved nevertheless.

Parameters aTimeout

Maximum time that should be waited [ms]


(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

>0: Resume due to event occurred The return value returns the number of the joined
event that triggered the resolution.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for the fulfillment of all conditions
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");
TestWaitForAllJoinedEvents(5000);

| TestWaitForAnyJoinedEvent | TestJoinMessageEvent | TestJoinEnvVarEvent | TestJoinAuxEvent | TestJoinTextEvent |


TestJoinSignalInRange | TestJoinSignalOutsideRange | TestJoinSignalMatch |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForAnyJoinedEvent

TestWaitForAnyJoinedEvent
CAPL Function Overview » Test Feature Set » TestWaitForAnyJoinedEvent

Note

Regardless of how the wait point was discontinued, afterwards the set of "joined events"
is empty. That is, waiting for "joined events" always empties the previously defined set of
"joined events".

Syntax long TestWaitForAnyJoinedEvent(dword aTimeout)

Function Waits for the current set of "joined events." Each individual of these events can resolve
the wait state.

Should none of the events occur before the expiration of the time aTimeout, the wait
condition is resolved nevertheless.

Parameters aTimeout

Maximum time that should be waited [ms]


(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

>0: Resume due to event occurred The return value returns the number of the joined
event that triggered the resolution.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for the fulfillment of any condition
TestJoinEnvVarEvent(MyEnvVar);
TestJoinSignalInRange(Velocity, 80, 100);
TestJoinTextEvent("ErrorFrame occurred!");
TestWaitForAnyJoinedEvents(5000);

| TestWaitForAllJoinedEvents | TestJoinMessageEvent | TestJoinEnvVarEvent | TestJoinAuxEvent | TestJoinTextEvent |


TestJoinSignalInRange | TestJoinSignalOutsideRange | TestJoinSignalMatch |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForAuxEvent

TestWaitForAuxEvent
CAPL Function Overview » Test Feature Set » TestWaitForAuxEvent

Syntax long TestWaitForAuxEvent(dword aAuxEventId, dword aTimeout)

Function Waits for the signaling of the specified auxiliary event from a connected NodeLayer
module.

Should the event not occur before the expiration of the time aTimeout, the wait
condition is resolved nevertheless.

Parameters aAuxEventId

Numeric event ID as it is returned on the creation of a check, for example.

aTimeout

Maximum time that should be waited [ms]


(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// wait is resumed on check event
long result;
checkId = ChkStart_Timeout(1000);
result = TestWaitForAuxEvent(checked, 2000);

| TestJoinAuxEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForEnvVar

TestWaitForEnvVar
CAPL Function Overview » Test Feature Set » TestWaitForEnvVar

Note

If the value of an environment variable is changed before a wait instruction that waits for
a change to an environment variable, then the wait instruction rolls back, i.e. there is no
waiting. The reason for this is that the change to the environment variable does not take
effect in a CAPL program until the next wait point. In this case the change to the
environment variable occurs at the same time as waiting for the change, and this causes
the wait point to be discontinued immediately.

Syntax long TestWaitForEnvVar(dbEnvVar aEnvVar, dword aTimeout)

long TestWaitForEnvVar(char aEnvVarName[], dword aTimeout)

Function Waits for the description of the specified environment variable (aEnvVar or with the
name aEnvVarName). Should the event not occur before the expiration of the time
aTimeout, the wait condition is resolved nevertheless.

Parameters aEnvVar

Environment variable that should be awaited

aEnvVarName

Name of environment variable that should be awaited

aTimeout

Maximum time that should be waited [ms]


(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available or environment variable with
name aEnvVarName cannot be found

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

7.5: form 2 Test nodes — •

Example
// waiting point is discontinued immediately
long result;
putValue (evMyEnvVar, 1);
result = TestWaitForEnvVar (evMyEnvVar, 1000); // Does not wait, is
immediately discontinued by an environment variable change!

| TestJoinEnvVarEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrFrame

TestWaitForFrFrame
CAPL Function Overview » Test Feature Set » TestWaitForFrFrame

Syntax long TestWaitForFrFrame (dbFrame aFrame, dword aTimeout)

long TestWaitForFrFrame (dword aSlotId, dword aBaseCycle, int aCycleRepe-


tition, dword aChannelMask, dword aTimeout)

long TestWaitForFrFrame (dword aTimeout)

Function Waits for the occurrence of the valid specified FlexRay frame. Should the frame not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

When no frame is specified the wait condition is resolved on any valid FlexRay frame.

Parameters aFrame

Frame to be awaited as it is defined in the database.

aSlotId

Numeric slot identifier. Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrFrame

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

The following test program waits for the occurrence of one of two frames.

It is assumed that the database defines the frames Sync_Message_1_Ch_A and


Sync_Message_2_Ch_A on the cluster FlexRay A.
variables
{
dword gBusContextFr1;
long resTestWaitFor, resTestGetData, resTestJoin;
dword timeToWait = 10; // in ms
}
void InitBusContext ()
{
gBusContextFr1 = getBusNameContext("FlexRay A");
SetBusContext(gBusContextFr1);
}
testcase WaitForJoinedFrFrames_Any()
{
FrFrame Sync_Message_1_Ch_A frTest1;
FrFrame Sync_Message_2_Ch_A frTest2;
InitBusContext();
// join events
{
TestStepPass("Call TFS function",
"TestJoinFrFrameEvent(Sync_Message_1_Ch_A) for (SlotId=%d, BaseCycle=%d,
Repetition=%d)",
frTest1.FR_SlotID, frTest1.FR_CycleOffset,
frTest1.FR_CycleRepetition);
resTestJoin = TestJoinFrFrameEvent(Sync_Message_1_Ch_A);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining symbolic event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining symbolic event ok. Event
number = %d", resTestJoin);
}
TestStepPass("Call TFS function", "TestJoinFrFrameEvent(SlotId=%d,
BaseCycle=%d, Repetition=%d,...)",
frTest2.FR_SlotID, frTest2.FR_CycleOffset,
frTest2.FR_CycleRepetition);
resTestJoin = TestJoinFrFrameEvent(frTest2.FR_SlotID,
frTest2.FR_CycleOffset,
frTest2.FR_CycleRepetition,
frTest2.FR_ChannelMask);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining raw event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining raw event ok. Event number
= %d", resTestJoin);
}
}
TestStepPass("Call TFS function", "TestWaitForAnyJoinedEvent(timeout =

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrFrame

%d)", timeToWait);
// wait for any event
resTestWaitFor = TestWaitForAnyJoinedEvent(timeToWait);
if (resTestWaitFor > 0) // Resume due to event occurred
{
TestStepPass("Call TFS function",
"TestGetWaitFrFrameData(resTestWaitFor=%d, frTest)", resTestWaitFor);
// extract resume event's data
resTestGetData = TestGetWaitFrFrameData(resTestWaitFor, frTest1);
if (0 != resTestGetData)
{
TestStepFail("Data extraction", "resTestGetData = %d, Data access
to data of event %d could not be executed!", resTestGetData,
resTestWaitFor);
}
else
{
TestStepPass("Data extraction", "Data of event %d succefully
extracted. SlotId=%d", resTestWaitFor, frTest1.FR_SlotID);
}
}
else
{
TestStepFail("Wait condition", "resTestWaitFor = %d, Waiting for any
of joined events during %d [ms] failed!", resTestWaitFor, timeToWait);
}
}

| TestGetWaitFrFrameData | TestJoinFrFrameEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrFrameError

TestWaitForFrFrameError
CAPL Function Overview » Test Feature Set » TestWaitForFrFrameError

Syntax long TestWaitForFrFrameError (dbFrame aFrame, dword aTimeout)

long TestWaitForFrFrameError (dword aSlotId, dword aBaseCycle, dword


aCycleRepetition, dword aChannelMask, dword aTimeout)

long TestWaitForFrFrameError (dword aTimeout)

Function Waits for the occurrence of FlexRay frame error event. Should the event not occur before
the expiration of the time aTimeout, the wait condition is resolved nevertheless.

When no frame is specified the wait condition is resolved on any FlexRay frame error
event.

Parameters aFrame

Frame as it is defined in the database.

aSlotId

Numeric slot identifier.

Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrFrameError

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by


FrFrameError.

| TestGetWaitFrFrameErrorData | TestJoinFrFrameErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrNullFrame

TestWaitForFrNullFrame
CAPL Function Overview » Test Feature Set » TestWaitForFrNullFrame

Syntax long TestWaitForFrNullFrame (dbFrame aFrame, dword aTimeout)

long TestWaitForFrNullFrame (dword aSlotId, dword aBaseCycle, dword


aCycleRepetition, dword aChannelMask, dword aTimeout)

long TestWaitForFrNullFrame (dword aTimeout)

Function Waits for the occurrence of the specified FlexRay null frame. Should the event not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

When no Null-Frame is specified the wait condition is resolved on any FlexRay null frame.

Parameters aFrame

Frame to be awaited as it is defined in the database.

aSlotId

Numeric slot identifier. Value range: 1...2047

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aChannelMask

Channel of the transmission message.

Values:

1 Channel A

2 Channel B

3 Channel A+B

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrNullFrame

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

For an example see function TestWaitForFrFrame and replace all FrFrame by FrNullFrame.

| TestGetWaitFrNullFrameData | TestJoinFrNullFrameEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrPDU

TestWaitForFrPDU
CAPL Function Overview » Test Feature Set » TestWaitForFrPDU

Syntax long TestWaitForFrPDU (dbPDU aPDU, dword aTimeout)

long TestWaitForFrPDU (dword aTimeout)

Function Waits for the occurrence of the specified FlexRay PDU. Should the PDU not occur before
the expiration of the time aTimeout, the wait condition is resolved nevertheless.

When no PDU is specified the wait condition is resolved on any FlexRay PDU.

Parameters aPDU

PDU to be awaited as it is defined in the database.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

The following test program waits for the occurrence of one of two PDUs.

It is assumed that the database defines the PDUs PDU_NMF_NODE_C and


PDU_IN_CYCLE_REPETITION on the cluster FlexRay PDU.
variables
{
dword gBusContextFr;
long resTestWaitFor, resTestGetData, resTestJoin;
dword timeToWait = 10; // in ms
}
void InitBusContext ()
{
gBusContextFr = getBusNameContext("FlexRay_PDU");
SetBusContext(gBusContextFr);
}
testcase WaitForJoinedFrPDUs_Any()
{
FrPDU frTest;
TestStepPass("Library: WaitForFrPDU.can", "Testcase:
WaitForJoinedFrPDUs_Any");
InitBusContext();
// join events
{
TestStepPass("Call TFS function",

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrPDU

"TestJoinFrPDUEvent(name=PDU_IN_CYCLE_REPETITION)");
resTestJoin = TestJoinFrPDUEvent(PDU_IN_CYCLE_REPETITION);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining symbolic event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining symbolic event ok. Event
number = %d", resTestJoin);
}
TestStepPass("Call TFS function",
"TestJoinFrPDUEvent(name=PDU_NMF_NODE_C)");
resTestJoin = TestJoinFrPDUEvent(PDU_NMF_NODE_C);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining raw event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining raw event ok. Event number
= %d", resTestJoin);
}
}
// wait for all events
TestStepPass("Call TFS function",
"TestWaitForAnyJoinedEvent(timeout=%d)", timeToWait);
resTestWaitFor = TestWaitForAnyJoinedEvent(timeToWait);
if (resTestWaitFor > 0) // Resume due to event occurred
{
TestStepPass("Wait condition", "Waiting for any event is ok. Resume
event number = %d", resTestWaitFor);
TestStepPass("Call TFS function", "TestGetWaitFrPDUData(index=%d)",
resTestWaitFor);

// extract resume event's data


resTestGetData = TestGetWaitFrPDUData(resTestWaitFor, frTest);
if (0 != resTestGetData)
{
TestStepFail("Data extraction", "resTestGetData = %d, Data access
to data of event %d could not be executed!", resTestGetData,
resTestWaitFor);
}
else
{
TestStepPass("Data extraction", "Data of event %d successfully
extracted. SlotId=%d", resTestWaitFor, frTest.FR_SlotID);
}
}
else
{
TestStepFail("Wait condition", "resTestWaitFor = %d, Waiting for any
of joined events failed!", resTestWaitFor);
}
}

| TestGetWaitFrPDUData | TestJoinFrPDUEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrPOCState

TestWaitForFrPOCState
CAPL Function Overview » Test Feature Set » TestWaitForFrPOCState

Syntax long TestWaitForFrPOCState (dword aTimeout)

long TestWaitForFrPOCState (dword aPOCState, dword aTimeout)

long TestWaitForFrPOCState (dword aPOCState, dword aWUState, dword


aTimeout)

Function Waits for the occurrence of change of state on the FlexRay Communication Controller's
protocol operation state machine. Should the change not occur before the expiration of
the time aTimeout, the wait condition is resolved nevertheless.

Parameters aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

aPOCState

The POC state the function will wait for (see selector 'FR_POCState' in event procedure on
FrPOCState).

If set to '-1' in combination with a 'WUState' the function will wait only for a Wakeup state
(any POC state will be accepted).

Available from CANoe 7.2.

aWUState

The Wakeup state the function will wait for (see selector 'FR_Info2' in event procedure on
FrPOCState).

Available from CANoe 7.2.

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

7.2: extended • FlexRay — •


• Test nodes

Example

The following test program waits for the occurrence of one of two different POC state

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrPOCState

events.

It is assumed that the test is executed at the cluster FlexRay A.


variables
{
dword gBusContextFr1;
long resTestWaitFor, resTestGetData, resTestJoin;
dword timeToWait = 1000; // in ms
const int flexrayChannel = %CHANNEL%; // used by CAPL functions
stimulating events
}
void InitBusContext ()
{
gBusContextFr1 = getBusNameContext("FlexRay A");
SetBusContext(gBusContextFr1);
}
testcase WaitForJoinedFrPOCState_Any()
{
FrPOCState frPOCStateData;
InitBusContext();
// join events
{
TestStepPass("Call TFS function", "TestJoinFrPOCState()");
resTestJoin = TestJoinFrPOCState();
if (resTestJoin <= 0)
{
TestStepFail("Join event", "resTestJoin = %d, Failure on joining
first multi-cycle event", resTestJoin);
return;
}
else
{
TestStepPass("Join event", "Joining first multi-cycle event ok.
Event number = %d", resTestJoin);
}
TestStepPass("Call TFS function", "TestJoinFrPOCState()");
resTestJoin = TestJoinFrPOCState();
if (resTestJoin <= 0)
{
TestStepFail("Join event", "resTestJoin = %d, Failure on joining
second multi-cycle event", resTestJoin);
return;
}
else
{
TestStepPass("Join event", "Joining second multi-cycle event ok.
Event number = %d", resTestJoin);
}
}
StimulatePOCEvent();
// wait for any event
TestStepPass("Call TFS function",
"TestWaitForAnyJoinedEvent(timeout=%d)", timeToWait);
resTestWaitFor = TestWaitForAnyJoinedEvent(timeToWait);
if (resTestWaitFor > 0) // Resume due to event occurred
{
TestStepPass("Wait condition", "Waiting for any joined event is ok.
Resume event number = %d", resTestWaitFor);
TestStepPass("Call TFS function",
"TestGetWaitFrPOCStateData(index=%d, frPOCStateData)", resTestWaitFor);

// extract resume event's data


resTestGetData = TestGetWaitFrPOCStateData(resTestWaitFor,
frPOCStateData);
if (0 != resTestGetData)
{
TestStepFail("Data extraction", "resTestGetData = %d, Data access
to data of event %d could not be executed!", resTestGetData,
resTestWaitFor);
}
else
{
TestStepPass("Data extraction", "Data of event %d succefully
extracted. StateCode=%d", resTestWaitFor, frPOCStateData.FR_POCState);
}
}
else
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrPOCState

TestStepFail("Wait condition", "resTestWaitFor = %d, Waiting for any


joined event failed!", resTestWaitFor);
}
}
void StimulatePOCEvent ()
{
ResetFlexRayCC(flexrayChannel); // stimulate one POC event
TestStepPass("Event stimulation", "POC event(s) stimulated with
ResetFlexRayCC(channel=%d)", flexrayChannel);
}

| TestGetWaitFrPOCStateData | TestJoinFrPOCState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrStartCycle

TestWaitForFrStartCycle
CAPL Function Overview » Test Feature Set » TestWaitForFrStartCycle

Syntax long TestWaitForFrStartCycle (dword aCycle, dword aTimeout)

long TestWaitForFrStartCycle (dword aBaseCycle, dword aCycleRepetition,


dword aTimeout)

long TestWaitForFrStartCycle (dword aTimeout)

Function Waits for the occurrence of the specified FlexRay start cycle event. Should the event not
occur before the expiration of the time aTimeout, the wait condition is resolved
nevertheless.

When no numeric cycle is specified the wait condition is resolved on any FlexRay Start
Cycle event.

Parameters aCycle

Numeric cycle identifier. 0...63

aBaseCycle

Numeric base cycle. This value must be less than the repetition factor. Together with the
repetition factor this value determines the "Cycle Multiplexing".

Value range: 0...63

aCycleRepetition

Cycle repetition factor. Together with the base cycle this value determines the "Cycle
Multiplexing".

Value has to be a power to 2 (1, 2, 4, 8, 16, 32 or 64).

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP4 • FlexRay — •


• Test nodes

Example

The following test program waits for the occurrence of one of two different start of

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrStartCycle

cycles.

It is assumed that the test is executed at the cluster FlexRay A.


variables
{
dword gBusContextFr1;
long resTestWaitFor, resTestGetData, resTestJoin;
dword timeToWait = 100; // in ms
const dword gCycleOffset1 = 2;
const dword gCycleRepetition1 = 4;
const dword gCycleOffset2 = 3;
const dword gCycleRepetition2 = 4;
}
void InitBusContext ()
{
gBusContextFr1 = getBusNameContext("FlexRay A");
SetBusContext(gBusContextFr1);
}
testcase WaitForJoinedFrStartCycle_Any()
{
FrStartCycle frStartCycleData;
InitBusContext();
// join events
{
TestStepPass("Call TFS function",
"TestJoinFrStartCycleEvent(CycleOffset=%d, CycleRepetition=%d)",
gCycleOffset1, gCycleRepetition1);
resTestJoin = TestJoinFrStartCycleEvent(gCycleOffset1,
gCycleRepetition1);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining multi-cycle event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining multi-cycle event ok.
Event number = %d", resTestJoin);
}
TestStepPass("Call TFS function",
"TestJoinFrStartCycleEvent(CycleOffset=%d, CycleRepetition=%d)",
gCycleOffset2, gCycleRepetition2);
resTestJoin = TestJoinFrStartCycleEvent(gCycleOffset2,
gCycleRepetition2);
if (resTestJoin <= 0)
{
TestStepFail("Join condition", "resTestJoin = %d, Failure on
joining single-cycle event", resTestJoin);
return;
}
else
{
TestStepPass("Join condition", "Joining single-cycle event ok.
Event number = %d", resTestJoin);
}
}
// wait for any event
TestStepPass("Call TFS function",
"TestWaitForAnyJoinedEvent(timeout=%d)", timeToWait);
resTestWaitFor = TestWaitForAnyJoinedEvent(timeToWait);
if (resTestWaitFor > 0) // Resume due to event occurred
{
TestStepPass("Wait condition", "Waiting for any joined event is ok.
Resume event number = %d", resTestWaitFor);
TestStepPass("Call TFS function",
"TestGetWaitFrStartCycleData(index=%d, frStartCycleData)", resTestWaitFor);

// extract resume event's data


resTestGetData = TestGetWaitFrStartCycleData(resTestWaitFor,
frStartCycleData);
if (0 != resTestGetData)
{
TestStepFail("Data extraction", "resTestGetData = %d, Data access
to data of event %d could not be executed!", resTestGetData,
resTestWaitFor);
}
else

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrStartCycle

{
TestStepPass("Data extraction", "Data of event %d succefully
extracted. CycleId=%d", resTestWaitFor, frStartCycleData.FR_Cycle);
}
}
else
{
TestStepFail("Wait condition", "resTestWaitFor = %d, Waiting for any
joined event failed!", resTestWaitFor);
}
}

| TestGetWaitFrStartCycleData | TestJoinFrStartCycleEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

TestWaitForFrSymbol
CAPL Function Overview » Test Feature Set » TestWaitForFrSymbol

Syntax long TestWaitForFrSymbol (dword aTimeout)

long TestWaitForFrSymbol (dword aSymbolType, dword aChannelMask, dword


aTimeout)

Function Waits for the occurrence of a FlexRay symbol on the bus. Should the symbol not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

aSymbolType

Identifies the type of symbol the function will wait for.

0 unknown

1 CAS

2 MTS

3 Wakeup

aChannelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will wait for
the symbol on channel A, 2 will wait for it on channel B and 3 on any channel (A/B).

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Test nodes

Attention

If you want to wait for the reception or transmission of a wakeup pattern, then use
TestWaitForFrPOCState.

Example

The following test program waits for the occurrence of different POC state events and

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

symbols on one FlexRay bus.

Attention:

• The test requires two (2) FlexRay interfaces that are connected to one real cluster.
• The nodes of the cluster must implement to receive a special 'sleep' command that is
sent via a dedicated FlexRay frame.

variables
{
char bus1[20] = "FlexRay_1";
char bus2[20] = "FlexRay_2";
msTimer actionTimer;
int gAction = 0;
const int gActionDelay = 52; // [ms]
const int gTimeout = 300; // [ms]
const int gExtTimeout = 2700; // [ms] to be waited additionally after
cluster wakeup
const int cPossibleWakeupDelay = 1500; // [ms] to be waited after
possible cluster wakeup
const int cWakeupDelay = 1500; // [ms] to be waited after cluster wakeup
BYTE gSta1Id = 5; // slot ID for frame to send
BYTE gSta1Flags = 16; // event-triggered
BYTE gSta1Dlc = 4; // bytes
BYTE gSta1Chan = 3; // send on channel A+B
BYTE gSta1Base = 0; // base cycle
BYTE gSta1Rep = 1; // cycle repetition
}

testcase GoodCheckFlexRayWaitForSymbol_1 ()
{
long result;
FrSymbol frSymbolData;

TestStepPass("Library: FrTFS_Wait_Symbol_POC.can", "Testcase:


WaitForSymbol_Any");
InitBusContext();
_wakeupCluster(1);
TestStep("Wait","waiting to assure running cluster...");
TestWaitForTimeout(cPossibleWakeupDelay);
TestStep("Prepare","Defining 'FlexRay symbol to be sent' action and
triggering timer...");
gAction = 1;
actionTimer.set(gActionDelay);
TestStep("Wait","Waiting for any FlexRay symbol...");
TestStepPass("Call TFS function", "TestWaitForFrSymbol(timeout=%d)",
gTimeout+1000);

// The real test to be checked:


result = TestWaitForFrSymbol(gTimeout+1000);
if (result == 0)
{
TestStepFail("Timeout Occurred");
}
else if (result == -1)
{
TestStepFail("General Error");
}
else if (result == -2)
{
TestStepFail("Constraint Violation");
}
else
{
TestStepPass("Any FlexRay symbol successfully received!");
TestStepPass("Call TFS function",
"TestGetWaitFrSymbolData(frSymbolData)");
// Test for data extraction:
result = TestGetWaitFrSymbolData(frSymbolData);
if (0 != result)
{
TestStepFail("Data extraction", "result = %d, Data access could not
be executed.", result);
}
else
{
TestStepPass("Data extraction", "Data extraction works fine.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

Symbol=%d", frSymbolData.FR_Symbol);
}
}
}

testcase GoodCheckFlexRayWaitForPOC_1 ()
{
long result;
FrPOCState frPOCStateData;

TestStepPass("Library: FrTFS_Wait_Symbol_POC.can", "Testcase:


WaitForPOCState_Specific");
InitBusContext();
_wakeupCluster(1);
TestStep("Wait","waiting to assure running cluster...");
TestWaitForTimeout(cPossibleWakeupDelay);
TestStep("Prepare","Defining 'Cluster to sleep mode' action and
triggering timer...");
gAction = 2;
actionTimer.set(gActionDelay);
TestStep("Wait","Waiting for POC state 'Halt (4)'...");
TestStepPass("Call TFS function", "TestWaitForFrPOCState(4, timeout=%d)",
gTimeout);

// The real test to be checked:


result = TestWaitForFrPOCState(4, gTimeout);
if (result == 0)
{
TestStepFail("Timeout Occurred");
}
else if (result == -1)
{
TestStepFail("General Error");
}
else if (result == -2)
{
TestStepFail("Constraint Violation");
}
else
{
TestStepPass("FlexRay Interface is offline (asynchronous)!");
TestStepPass("Call TFS function",
"TestGetWaitFrPOCStateData(frPOCStateData)");
result = TestGetWaitFrPOCStateData(frPOCStateData);
if (0 != result)
{
TestStepFail("Data extraction", "result = %d, Data access could not
be executed.", result);
}
else
{
TestStepPass("Data extraction", "Data extraction works fine.
StateCode=%d", frPOCStateData.FR_POCState);
}
}
TestStep("Wait","Waiting to assure sleeping cluster to be ready for
wakeup...");
TestWaitForTimeout(cWakeupDelay); // wait minimum time that cluster
should sleep before wakeup
TestStep("Prepare","Defining 'Wakeup Cluster' action and triggering
timer...");
gAction = 3;
actionTimer.set(gActionDelay);
TestStep("Wait","Waiting for POC state 'Normal Active (2)'...");
TestStepPass("Call TFS function", "TestWaitForFrPOCState(2, timeout=%d)",
gTimeout+gExtTimeout);

// The real test to be checked:


result = TestWaitForFrPOCState(2, gTimeout+gExtTimeout);
if (result == 0)
{
TestStepFail("Timeout Occurred");
}
else if (result == -1)
{
TestStepFail("General Error");
}
else if (result == -2)
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

TestStepFail("Constraint Violation");
}
else
{
TestStepPass("FlexRay Interface is online (synced)!");
TestStepPass("Call TFS function",
"TestGetWaitFrPOCStateData(frPOCStateData)");
// Test for data extraction:
result = TestGetWaitFrPOCStateData(frPOCStateData);
if (0 != result)
{
TestStepFail("Data extraction", "result = %d, Data access could not
be executed.", result);
}
else
{
TestStepPass("Data extraction", "Data extraction works fine.
StateCode=%d", frPOCStateData.FR_POCState);
}
}
}

testcase GoodCheckFlexRayWaitForWUS_1 ()
{
long result;
FrPOCState frPOCStateData;

TestStepPass("Library: FrTFS_Wait_Symbol_POC.can", "Testcase:


WaitForWakeupState_Any");
InitBusContext();
_wakeupCluster(1);
TestStep("Wait","waiting to assure running cluster...");
TestWaitForTimeout(cPossibleWakeupDelay);
TestStep("Prepare","Defining 'Cluster to sleep mode' action and
triggering timer...");
gAction = 2;
actionTimer.set(gActionDelay);

TestStep("Wait","Waiting for POC state 'Halt (4)'...");


result = TestWaitForFrPOCState(4, gTimeout);
if (result == 0)
{
TestStepFail("Timeout Occurred");
}
else if (result == -1)
{
TestStepFail("General Error");
}
else if (result == -2)
{
TestStepFail("Constraint Violation");
}
else
{
TestStepPass("FlexRay Interface is offline (asynchronous)!");
}

TestStep("Wait","Waiting to assure sleeping cluster to be ready for


wakeup...");
TestWaitForTimeout(cWakeupDelay); // wait minimum time that cluster
should sleep before wakeup
TestStep("Prepare","Defining 'Wakeup Cluster' action and triggering
timer...");
gAction = 3;
actionTimer.set(gActionDelay);

TestStep("Wait","Waiting for any Wakeup state...");


TestStepPass("Call TFS function", "TestWaitForFrPOCState(-1, 0,
timeout=%d)", gTimeout+gExtTimeout);

// The real test to be checked:


result = TestWaitForFrPOCState(-1, 0, gTimeout+gExtTimeout);
if (result == 0)
{
TestStepFail("Timeout Occurred");
}
else if (result == -1)
{
TestStepFail("General Error");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

}
else if (result == -2)
{
TestStepFail("Constraint Violation");
}
else
{
TestStepPass("Any Wakeup state received!");
TestStepPass("Call TFS function",
"TestGetWaitFrPOCStateData(frPOCStateData)");
// Test for data extraction:
result = TestGetWaitFrPOCStateData(frPOCStateData);
if (0 != result)
{
TestStepFail("Data extraction", "result = %d, Data access could not
be executed.", result);
}
else
{
TestStepPass("Data extraction", "Data extraction works fine.
WUSCode=%d", frPOCStateData.FR_Info2);
}
}
}

on timer actionTimer
{
if (gAction == 1)
{
FrSendSymbol(0,0,1);
TestStepPass("FlexRay MTS Symbol sent!");
}
else if (gAction == 2)
{
_cmdClusterToSleep(1);
TestStepPass("Cmd 'Cluster to sleep mode' sent!");
}
else if (gAction == 3)
{
_wakeupCluster(1);
TestStepPass("Wakeup pattern sent!");
}
gAction = 0;
}

void _cmdClusterToSleep (int channel)


{
// ATTENTION: The command is sent via a FlexRay frame. The cluster's
nodes must implement this feature!

BYTE gSta1Msg[254]; // message buffer


gSta1Msg[0] = 0x95;
gSta1Msg[1] = 0x95;
gSta1Msg[2] = 0x0b;
gSta1Msg[3] = 0xb8;
FRSendFrame(gSta1Id /*frameId*/, gSta1Chan /*channelMask*/, gSta1Dlc
/*len*/, gSta1Base /*cycleStart*/, gSta1Rep /*cycleRepetition*/, gSta1Flags
/*flags*/, gSta1Msg /*dataBytes*/, channel);
}

void _wakeupCluster (int channel)


{
int wuChMask = 1; // send wakeup on channel A
int wuCount = 4; // send symbol 4 times (range 2-63)
int wuTxIdle = 180; // idle time of symbol in bit (range 0-255)
int wuTxLow = 60; // low time of symbol in bit (range 0-63)
char cfg[200];

ResetFlexRayCCEx(channel,wuChMask,wuCount,wuTxIdle,wuTxLow,cfg);
}

void InitBusContext ()
{
dword context;
TestStep("Prepare","Setting bus context..");
context = GetBusNameContext(bus2);
if (context > 0)
setBusContext(context);
else

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForFrSymbol

{
TestStepFail("Bus context cannot be set");
}
}

| TestGetWaitFrSymbolData | TestJoinFrSymbolEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinCSError

TestWaitForLinCSError
CAPL Function Overview » Test Feature Set » TestWaitForLinCSError

Syntax long TestWaitForLinCSError(dword aTimeout)

long TestWaitForLinCSError(dword aFrameId, dword aTimeout)

Function Waits for a checksum error for the specified amount of time.

Parameters aTimeout

Timeout in milliseconds

aFrameId

Frame identifier

Return values -2: Resume due to constraint violation

-1: General error, e.g. functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Test nodes

Example
testcase tcTFS_linCSError ()
{
linCSError linCSErrorData;
if (testWaitForLinCSError(5000) == 1)
{
if (testGetWaitLinCSErrorData(linCSErrorData) == 0)
{
testStep("Evaluation", "LIN CS Error event occurred for
FrameId=0x%X", linCSErrorData.ID);
}
}
}

| TestGetWaitLinCSErrorData | TestJoinLinCSErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinETFSingleResponse

TestWaitForLinETFSingleResponse
CAPL Function Overview » Test Feature Set » TestWaitForLinETFSingleResponse

Syntax long TestWaitForLinETFSingleResponse (dword aETFFrameId, dword


aAssocFrameId, dword aTimeout)

Function Waits for the occurrence of a LIN Event-triggered frame with a single response for the
specified associated frame. Should the event-triggered frame not occur before the
expiration of the specified timeout, the wait condition is resolved nevertheless.

Parameters aETFFrameId

Frame identifier of LIN event-triggered frame to be awaited.

aAssocFrameId

Frame identifier of a LIN unconditional frame associated with the awaited event-triggered
frame

aTimeout

Timeout in milliseconds.

Value 0: no timeout

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 • LIN — •
• Test nodes

Example
testcase tcTFS_linETFSingleResponse ()
{
linMessage 0 linETFSingleResponseData;

if (testWaitForLinETFSingleResponse(0x3A, 0x36, 5000) == 1)


{
if (testGetWaitLinETFSingleResponseData(linETFSingleResponseData) ==
0)
{
testStep("Evaluation", "LIN Event-triggered frame with a single
response occurred for FrameId=0x%X", linETFSingleResponseData.ID);
}
}
}

| TestGetWaitLinETFSingleResponseData | TestJoinLinETFSingleResponseEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinHeader

TestWaitForLinHeader
CAPL Function Overview » Test Feature Set » TestWaitForLinHeader

Syntax long TestWaitForLinHeader (dbMessage aFrame, dword aTimeout)

long TestWaitForLinHeader (dword aFrameId, dword aTimeout)

long TestWaitForLinHeader (dword aTimeout)

Function Waits for the Header occurrence of the specified LIN frame. Should the header not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

When no frame is specified the wait condition is resolved on any LIN header.

Parameters aFrame

Frame whose header should be awaited.

aFrameId

Numeric ID of a frame whose header should be awaited.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_linHdrEvent ()
{
linheader linHeaderData;

if (testWaitForLinHeader(5000) == 1)
{
if (TestGetWaitLinHdrData(linHeaderData) == 0)
{
testStep("Evaluation", "LIN Header event occurred for
FrameId=0x%X", linHeaderData.ID);
}
}
}

| TestGetWaitLinHdrData | TestJoinLinHeaderEvent | linHeader selectors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinReceiveError

TestWaitForLinReceiveError
CAPL Function Overview » Test Feature Set » TestWaitForLinReceiveError

Syntax long TestWaitForLinReceiveError (dword aFrameId, dword aTimeout)

long TestWaitForLinReceiveError (dword aTimeout)

Function Waits for the occurrence of LIN Receive Error event. Should the event not occur before
the expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aFrameId

Numeric ID of a frame whose Receive Error should be awaited.

Default value: wait for any ID

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_linReceiveErrorEvent ()
{
linReceiveError linReceiveErrorData;

if (testWaitForLinReceiveError(5000) == 1)
{
if (TestGetWaitLinReceiveErrData(linReceiveErrorData) == 0)
{
testStep("Evaluation", "LIN Receive Error event occurred for
FrameId=0x%X", linReceiveErrorData.ID);
}
}
}

| TestGetWaitLinReceiveErrData | TestJoinLinReceiveErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinSyncError

TestWaitForLinSyncError
CAPL Function Overview » Test Feature Set » TestWaitForLinSyncError

Syntax long TestWaitForLinSyncError(dword aTimeout)

Function Waits for a synchronisation error for the specified amount of time.

Parameters aTimeout

Timeout in milliseconds

Return values -2: Resume due to constraint violation

-1: General error, e.g. functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • LIN — •
• Test nodes

Example
testcase tcTFS_linSyncErrorEvent ()
{
linSyncError linSyncErrorData;

if (testWaitForLinSyncError(5000) == 1)
{
if (testGetWaitLinSyncErrorData(linSyncErrorData) == 0)
{
testStep("Evaluation", "LIN Sync Error event occurred.
SyncBreak=%d ns; SyncDel=%d ns", linSyncErrorData.breaklen,
linSyncErrorData.delimiterlen);
}
}
}

| TestGetWaitLinSyncErrorData | TestJoinLinSyncErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinTransmError

TestWaitForLinTransmError
CAPL Function Overview » Test Feature Set » TestWaitForLinTransmError

Syntax long TestWaitForLinTransmError (dword aFrameId, dword aTimeout)

long TestWaitForLinTransmError (dword aTimeout)

Function Waits for the occurrence of LIN Transmission Error event. Should the event not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aFrameId

Numeric ID of a frame whose Transmission Error should be awaited.

Default value: wait for any ID

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_linNoResponseEvent ()
{
linTransmError linTransmErrorData;

if (testWaitForLinTransmError(5000) == 1)
{
if (testGetWaitLinTransmErrData(linTransmErrorData) == 0)
{
testStep("Evaluation", "LIN No-Response event occurred for
FrameId=0x%X", linTransmErrorData.ID);
}
}
}

| TestGetWaitLinTransmErrData | TestJoinLinTransmErrorEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForLinWakeupFrame

TestWaitForLinWakeupFrame
CAPL Function Overview » Test Feature Set » TestWaitForLinWakeupFrame

Syntax long TestWaitForLinWakeupFrame (dword aTimeout)

Function Waits for the occurrence of LIN Wakeup frame. Should the frame not occur before the
expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • LIN — •
• Test nodes

Example
testcase tcTFS_linWakeupEvent ()
{
linWakeupFrame linWakeupData;

if (testWaitForLinWakeupFrame(5000) == 1)
{
if (testGetWaitLinWakeupData(linWakeupData) == 0)
{
testStep("Evaluation", "LIN Wakeup event occurred. Signal length
is %d ns", linWakeupData.length_ns);
}
}
}

| TestGetWaitLinWakeupData | TestJoinLinWakeupEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMeasurementEnd

TestWaitForMeasurementEnd
CAPL Function Overview » Test Feature Set » TestWaitForMeasurementEnd

Syntax long TestWaitForMeasurementEnd (dword aTimeout)

Function Waits for the end of the measurement. As the final command within a test module, this
function can be used to keep the test module and therefore the monitoring of constraints
and conditions active. With measurement end this wait condition can be resolved. The
test result and therefore also the report are not negatively impacted by the end of the
measurement, if the test module does not contain any further wait commands after this
one.

If a timeout time unequal to "0" is entered, the wait point is also resolved when the
specified waiting time expires.

Application:

The test module monitors constraints and conditions. This monitoring process should be
implemented precisely as long as the measurement runs.

Parameters aTimeout [ms]

Maximum time that should be waited.

Return values 0: Resume due to timeout

1: Exit the wait status; measurement ended

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 Test nodes — •

Example
// monitoring of condition is active until measurement end
dword checkId;
long result;
checkId = ChkStart_InconsistentDlc(VehicleMotion);
result = TestWaitForMeasurementEnd(5000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMessage

TestWaitForMessage
CAPL Function Overview » Test Feature Set » TestWaitForMessage

Syntax long TestWaitForMessage(dbMessage aMessage, dword aTimeout)

long TestWaitForMessage(dword aMessageId, dword aTimeout)

long TestWaitForMessage(dword aTimeout)

Function Waits for the occurrence of the specified message aMessage. Should the message not
occur before the expiration of the time aTimeout, the wait condition is resolved
nevertheless.

When no message is specified the wait condition is resolved on any message.

Parameters aMessage

Message that should be awaited

aMessageId

Numeric ID of the message that should be awaited

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for the occurrence of message ‚VehicleMotion’
long result;
result = TestWaitForMessage(VehicleMotion, 2000);

| TestJoinMessageEvent | TestGetWaitEventMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAllBypass

TestWaitForMostAllBypass
CAPL Function Overview » Test Feature Set » TestWaitForMostAllBypass

Syntax long TestWaitForMostAllBypass(long aValue, unsigned long aTimeout)

Function Use this function to determine whether the bypass on the MOST hardware connected to
the channel has been set to the specified condition within the waiting time. The wait
point is only triggered if a change to this condition takes place.

The following can be entered as possible condition values: 1 for closed bypass and 0 for
open bypass. In the case of a closed bypass, the MOST device can not be seen by the other
devices in the loop.

Parameters aValue

Bypass condition that should be waited for. Possible values are:

1 Bypass is closed

0 Bypass is opened

aTimeout

Maximum wait time [ms]

(Transmission of 0: no timeout controlling); test module waits infinitely long)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostApInstID | TestWaitForMostAsRegistry | TestWaitForMostNodeAdr | TestWaitForMostGroupAdr |


TestWaitForMostNPR | TestWaitForMostMPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSMessage

TestWaitForMostAMSMessage
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSMessage

Syntax long TestWaitForMostAMSMessage(dbMessage aDBMsg, int aInstanceId, dword


aTimeout)

long TestWaitForMostAMSMessage(int aFBlockId, int aInstanceId, dword


aTimeout)

long TestWaitForMostAMSMessage(int aFBlockId, int aInstanceId, int


aFunctionId, dword aTimeout)

long TestWaitForMostAMSMessage(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType, dword aTimeout)

long TestWaitForMostAMSMessage(int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType, dword
aTimeout)

long TestWaitForMostAMSMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId, unsigned long aTimeout)

long TestWaitForMostAMSMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, unsigned long aTimeout)

long TestWaitForMostAMSMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, unsigned long aTimeout)

long TestWaitForMostAMSMessage(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

Function Waits for the occurrence of the specified MOST AMS message. Should the message not
occur before the expiration of the time aTimeout, the wait condition is resolved
nevertheless.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

aOpType

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSMessage

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aTimeout

Maximum wait time [ms] (Transmission of 0: no timeout controlling)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForMostAMSSpyMessage | TestWaitForMostAMSReport | TestWaitForMostAMSResult | TestJoinMostAMSMessageEvent |


TestJoinMostAMSReportEvent | TestGetWaitEventMostAMSMsgData | Symbolic definition of MOST messages | Input assistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSReport

TestWaitForMostAMSReport
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSReport

Syntax long TestWaitForMostAMSReport(int aFBlockId, int aInstanceId, int


aFunctionId, dword aTimeout)

long TestWaitForMostAMSReport(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostAMSReport(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of a response message (Report, OpType > 8) of the specified
MOST AMS message. Should the message not occur before the expiration of the time
aTimeout, the wait condition is resolved nevertheless.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aTimeout

Maximum wait time [ms] (Transmission of 0: no timeout controlling)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: Resume based on Constraint Violation

0: Resume based on Timeout

1: Resume based on occurred event

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSReport

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForMostAMSSpyReport | TestWaitForMostAMSMessage | TestWaitForMostAMSResult | TestJoinMostAMSMessageEvent |


TestJoinMostAMSReportEvent | TestGetWaitEventMostAMSMsgData | Symbolic definition of MOST messages | Input assistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResponse

TestWaitForMostAMSResponse
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSResponse

Syntax long TestWaitForMostAMSResponse (int aDestinationAddress, char[]


aSymbolicMessage, int aInstanceId, unsigned long aTimeout)

long TestWaitForMostAMSResponse (char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostAMSResponse (char[] aSymbolicMessage, unsigned long


aTimeout)

long TestWaitForMostAMSResponse (int aDestinationAddress, char[]


aSymbolicMessage, int aInstanceId)

long TestWaitForMostAMSResponse (char[]aSymbolicMessage)

Function This function immediately sends a symbolically defined MOST message and waits for the
appropriate response message from the receiver. Thus, it combines the functionalities of
TestSendMostAMSMessage and TestWaitForMostAMSReport into one function call. The
response message can be read and evaluated after the return of the wait operation using
TestGetWaitEventMostAMSMsgData.

The symbolically defined messages must be complete, which means all mandatory data
must be specified explicitly (without use of wildcards), because an actual message is
sent. However, a parameter list may be shorter than specified in the function catalog, in
order to be able to generate intentionally incomplete messages.

If possible, the message is always sent via the AMS service. However, if this is not
activated, the message - if short enough - will be sent as a normal control message (with
TelID = 0).

If the message is longer than a control message, the function delivers the return value of -
5 and a wait point is not set up.

Parameters aDestinationAddress

Source address

aInstanceId

Numeric value of InstanceID

aTimeout

Maximum wait time [ms]

(Transmission of 0: no timeout controlling; test module waits infinitely long)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceID.Function.OpType(Parameterliste)
• FBlock.InstanceID.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function.OpType

An entry without parameter list yields an empty parameter list (see also Symbolic

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResponse

definition of MOST messages).

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed.

-5: The message is too long and had to be sent using the AMS service, but the AMS service
is not activated.

-4: Entered message definition is faulty and could not be resolved

-3: Message was sent, however "not acknowledge" appears in the Tx acknowledgement.

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

-10: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x1 FBlockID not available

0x2 InstanceID not available

0x3 FktID not available

0x4 OpType not available

You can find more information about the error codes in the MOST specification.

-11: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x5 Invalid length

0x6 Wrong parameter

0x8 Parameter missing

0x9 Too many parameters

-12: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x7 Parameter not available

0x40 Busy

0x041 Not available

-13: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x42 (Processing Error).

-14: The given MOST message was sent, but the receiver responded with an error message

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResponse

that contains the error code 0x20 (Function specific).

-15: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0A (Secondary node).

-16: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0B (Device malfunction).

-17: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0C (Segmentation error).

-18: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x43 (Method aborted).

0: Resume based on Timeout

1: Message was sent successfully and the appropriate response received

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 • MOST — •
• Test nodes

Example

| TestSendMostAMSMessage | TestWaitForMostMessage | TestWaitForMostAMSMessage | TestWaitForMostReport


|TestWaitForMostAMSResult | TestWaitForMostAMSReport | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResult

TestWaitForMostAMSResult
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSResult

Syntax long TestWaitForMostAMSResult(long aDestinationAddress, char


aSymbolicMessage[], long aInstanceID, dword aTimeoutMaxDuration, dword
aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2)

long TestWaitForMostAMSResult(long aDestinationAddress, char


aSymbolicMessage[], long aInstanceID, dword aTimeoutMaxDuration)

long TestWaitForMostAMSResult(char aSymbolicMessage[], long aInstanceID,


dword aTimeoutMaxDuration)

long TestWaitForMostAMSResult(char aSymbolicMessage[], dword


aTimeoutMaxDuration)

long TestWaitForMostAMSResult(char aSymbolicMessage[], long aInstanceID,


dword aTimeoutMaxDuration, dword aTimeoutWaitForProcessing1, dword
aTimeoutWaitForProcessing2)

long TestWaitForMostAMSResult(char aSymbolicMessage[],dword


aTimeoutMaxDuration, dword aTimeoutWaitForProcessing1, dword
aTimeoutWaitForProcessing2)

Function The function immediately sends a symbolically defined MOST message with OpType
'StartResult' or 'StartResultAck' and waits for the reception of the appropriate 'Result' or
'ResultAck' message from the receiver.

In contrast to the functionality provided by TestWaitForMostAMSResponse, this function


checks the correct reception of intermediate ‘Processing’ or ‘ProcessingAck’ as well as
the final ‘Result’ or ‘ResultAck’ messages using the provided timeouts for
tWaitForProcessing1 and tWaitForProcessing2. Signatures without these timeout
parameters use the default values specified in the MOST Specification
(tWaitForProcessing1 = 250ms and tWaitForProcessing2. = 200ms).

Additionally, in case of the 'StartResultAck' optype, the SenderHandle parameter is


constantly checked for each report message received. Messages having a different
SenderHandle than specified in the function call are ignored, since they must belong to a
different request for that method.

As soon as a report message doesn’t arrive within the specified timeouts of


tWaitForProcessing1 or tWaitForProcessing2, the function resumes and reports a timeout
for that parameter.

Parameters aDestinationAddress

Source address

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.Instance.Function.StartResult(parameter list)
• FBlock.Instance.Function.StartResult
• FBlock.Function.StartResult(parameter list)
• FBlock.Function.StartResult
• FBlock.Instance.Function.StartResultAck(SenderHandle, parameter list)
• FBlock.Instance.Function.StartResultAck(SenderHandle)
• FBlock.Function.StartResultAck(SenderHandle, parameter list)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResult

• FBlock.Function.StartResultAck(SenderHandle)

aInstanceId

Numeric value of InstanceID

aTimeoutMaxDuration

Maximum time [ms] to wait for the reception of a 'Result' ('ResultAck') message.

aTimeoutWaitForProcessing1

Maximum time [ms] to wait for the reception of the first 'Processing' ('ProcessingAck') or
immediate 'Result' ('ResultAck') message (tWait-ForProcessing1).

aTimeoutWaitForProcessing2

Maximum time [ms] to wait for the reception of the following 'Processing' ('ProcessingAck')
or 'Result' ('ResultAck') message (tWaitFor-Processing2).

Return values 1: Message was sent successfully and the appropriate response received

0: Resume based on Timeout

-1: General error e.g. the functionality is not available

-2: Resume based on Constraint Violation

-3: Message was sent, however "not acknowledge" appears in the Tx acknowledgement.

-5: The message is too long and had to be sent using the AMS service, but the AMS service
is not activated.

-6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed.

-7: Message with unexpected OpType received.

-8: Timeout of aTimeoutWaitForProcessing1 (tWaitForProcessing1)

-9: Timeout of aTimeoutWaitForProcessing2 (tWaitForProcessing2)

-10: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x1 FBlockID not available

0x2 InstanceID not available

0x3 FktID not available

0x4 OpType not available

You can find more information about the error codes in the MOST specification.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSResult

-11: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x5 Invalid length

0x6 Wrong parameter

0x8 Parameter missing

0x9 Too many parameters

-12: The given MOST message was sent, but the receiver responded with an error message
that contains one of the following error codes:

0x7 Parameter not available

0x40 Busy

0x041 Not available

-13: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x42 (Processing Error).

-14: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x20 (Function specific).

-15: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0A (Secondary node).

-16: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0B (Device malfunction).

-17: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x0C (Segmentation error).

-18: The given MOST message was sent, but the receiver responded with an error message
that contains the error code 0x43 (Method aborted).

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 • MOST — •
• Test nodes

Example

| TestSendMostAMSMessage | TestWaitForMostMessage | TestWaitForMostAMSMessage | TestWaitForMostReport |


TestWaitForMostAMSReport | Symbolic definition of MOST messages|

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSSpyMessage

TestWaitForMostAMSSpyMessage
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSSpyMessage

Syntax long TestWaitForMostAMSSpyMessage(dbMessage aDBMsg, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostAMSSpyMessage(int aFBlockId, int aInstanceId, unsigned


long aTimeout)

long TestWaitForMostAMSSpyMessage(int aFBlockId, int aInstanceId, int


aFunctionId, unsigned long aTimeout)

long TestWaitForMostAMSSpyMessage(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType, dword aTimeout)

long TestWaitForMostAMSSpyMessage(int aSourceAddress, int


aDestinationAddress, int aFBlockId, int aInstanceId, int aFunctionId, int
aOpType, unsigned long aTimeout)

long TestWaitForMostAMSSpyMessage(int aSourceAddress, int


aDestinationAddress, char[] aSymbolicMessage, int aInstanceId, unsigned
long aTimeout)

long TestWaitForMostAMSSpyMessage(int aSourceAddress, int


aDestinationAddress, char[] aSymbolicMessage, unsigned long aTimeout)

long TestWaitForMostAMSSpyMessage(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

TestWaitForMostAMSSpyMessage(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of the specified MOST-AMS spy message.

This may deal with transmission of individual frames (TelID=0) or segmented


transmissions. In the case of segmented transmission, the last control message of a
correct transmission resolves the wait conditions.

If the message does not occur by the time the aTimeout expires, the wait condition is still
resolved.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSSpyMessage

aFunctionId

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostSpyMessage | TestWaitForMostAMSMessage | TestJoinMostAMSSpyMessageEvent | TestWaitForMostAMSSpyReport |


TestGetWaitEventMostAMSMsgData | Symbolic definition of MOST messages | Input assistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSSpyReport

TestWaitForMostAMSSpyReport
CAPL Function Overview » Test Feature Set » TestWaitForMostAMSSpyReport

Syntax long TestWaitForMostAMSSpyReport(int aFBlockId, int aInstanceId, int


aFunctionId, unsigned long aTimeout)

long TestWaitForMostAMSSpyReport(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostAMSSpyReport(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of the spy response message (report, op-type > 8) of the
specified MOST-AMS message.

This may deal with transmission of individual frames (TelID=0) or segmented


transmissions. In the case of segmented transmission, the last control message of a
correct transmission resolves the wait conditions.

If the message does not arrive by the time the aTimeout expires, the wait condition is
still resolved.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAMSSpyReport

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostSpyReport | TestWaitForMostAMSReport | TestJoinMostAMSSpyReportEvent | TestWaitForMostAMSSpyMessage |


TestGetWaitEventMostAMSMsgData | Symbolic definition of MOST messages | Input assistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostApInstID

TestWaitForMostApInstID
CAPL Function Overview » Test Feature Set » TestWaitForMostApInstID

Syntax long TestWaitForMostApInstID(unsigned long aTimeout)

Function The function waits for the specified time period for a special application socket change
event, which is triggered as soon as the Fblock InstanceId has changed on its own channel.

Parameters aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostAsRegistry | TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostNPR | TestWaitForMostMPR |


TestWaitForMostSBC | TestWaitForMostNetState | TestWaitForMostAllBypass | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostAsRegistry

TestWaitForMostAsRegistry
CAPL Function Overview » Test Feature Set » TestWaitForMostAsRegistry

Syntax long TestWaitForMostAsRegistry(long aRegistry, unsigned long aTimeout)

Function The function waits for the specified time period for any change to a registry in the
application socket.

Parameters aRegistry

The following values are permitted:

1 Wait for changes in the local registry

2 Wait for changes in the global registry

-1 Wait for changes in all registries

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostApInstID | TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostNPR | TestWaitForMostMPR |


TestWaitForMostSBC | TestWaitForMostNetState | TestWaitForMostAllBypass | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostCriticalUnlock

TestWaitForMostCriticalUnlock
CAPL Function Overview » Test Feature Set » TestWaitForMostCriticalUnlock

Syntax long TestWaitForMostCriticalUnlock(dword aTimeout)

Function The function waits until the expiration of the time aTimout for the occurrence of a
LightLock event indicating "critical unlock" state.

A LightLock event with a "critical unlock" state is generated, when a single "light & no
lock" state occurs after a "stable lock" state and lasts longer than tUnlock (see MOST
specification), or several "light, no lock" states occur successively and add up to a
duration longer than tUnlock.

Parameters aTimeout

Maximum wait time [ms] (Specification of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, f. e. functionality is not available

0: Resume due to timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 • MOST — •
• Test nodes

Example

| TestWaitForMostLightOff | TestWaitForMostShortUnlock | TestWaitForMostStableLock |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostGroupAdr

TestWaitForMostGroupAdr
CAPL Function Overview » Test Feature Set » TestWaitForMostGroupAdr

Syntax long TestWaitForMostGroupAdr(long aValue, unsigned long aTimeout)

Function The function waits for the expiration of the time aTimeout for the occurrence of the
MOST event of a change of the own group address.

Parameters aValue

Expected value of the group address that should be in the MOST event.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: Resume based on Constraint Violation

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostNodeAdr | TestWaitForMostMPR | TestWaitForMostNPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostLightOff

TestWaitForMostLightOff
CAPL Function Overview » Test Feature Set » TestWaitForMostLightOff

Syntax long TestWaitForMostLightOff(dword aTimeout)

Function The function waits until the expiration of the time aTimout for the occurrence of a
LightLock event indicating "no light & no lock" state.

A LightLock event with a "no light & no lock" state is generated, when the hardware
connected to the channel no longer receives light at the Fiber Optical Receiver (FOR).

Parameters aTimeout

Maximum wait time [ms] (Specification of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, f. e. functionality is not available

0: Resume due to timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • MOST — •
• Test nodes

Example

| TestWaitForMostCriticalUnlock | TestWaitForMostShortUnlock | TestWaitForMostStableLock |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostMessage

TestWaitForMostMessage
CAPL Function Overview » Test Feature Set » TestWaitForMostMessage

Syntax long TestWaitForMostMessage(dbMessage aDBMsg, int aInstanceId, dword


aTimeout)

long TestWaitForMostMessage(int aFBlockId, int aInstanceId, dword aTimeout)

long TestWaitForMostMessage(int aFBlockId, int aInstanceId, int


aFunctionId, dword aTimeout)

long TestWaitForMostMessage(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType, dword aTimeout)

long TestWaitForMostMessage(int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType, dword
aTimeout)

long TestWaitForMostMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId, unsigned long aTimeout)

long TestWaitForMostMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, unsigned long aTimeout)

long TestWaitForMostMessage(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostMessage(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of the specified MOST message (MOST control message or MOST
spy message). Should the message not occur before the expiration of the time aTimeout,
the wait condition is resolved nevertheless.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

aOpType

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostMessage

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aTimeout

Maximum wait time [ms] (Transmission of 0: no timeout controlling)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForMostSpyMessage | TestWaitForMostReport | TestJoinMostMessageEvent | TestJoinMostReportEvent |


TestGetWaitEventMostMsgData | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostMPR

TestWaitForMostMPR
CAPL Function Overview » Test Feature Set » TestWaitForMostMPR

Syntax long TestWaitForMostMPR(long aValue, unsigned long aTimeout)

Function The function waits until the expiration of the time aTimeout for the occurrence of the
MOST event of a change of the Maximum Position Registers (MPR).

Parameters aValue

Expected value of the maximum position register that should be in the MOST event. The
specification -1 (wildcard) stands for any values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostNPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostNetState

TestWaitForMostNetState
CAPL Function Overview » Test Feature Set » TestWaitForMostNetState

Syntax long TestWaitForMostNetState(long aOldState, long aNewState, unsigned long


aTimeout)

Function The function waits until the expiration of the time aTimeout for a transfer of the MOST
NetState from the state aOldState into the state aNewState.

Parameters aOldState

Expected initial state of the NetState. The following values are allowed:

0 MostNetState_Undefined

2 MostNetState_PowerOff

3 MostNetState_NetInterfaceInit

4 MostNetState_ConfigNotOk

5 MostNetState_ConfigOk

-1 Wildcard, any NetState state

aNewState

Expected new state of the NetState. The value range corresponds to that of aOldState
Parameters.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostMPR | TestWaitForMostNPR | TestWaitForMostSBC |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostNodeAdr

TestWaitForMostNodeAdr
CAPL Function Overview » Test Feature Set » TestWaitForMostNodeAdr

Syntax long TestWaitForMostNodeAdr(long aValue, unsigned long aTimeout)

Function The function waits for the expiration of the time aTimeout for the occurrence of the
MOST event of a change of its own node address.

Parameters aValue

Expected value of the node address that should be in the MOST event. The specification -
1 (wildcard) stands for any values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostGroupAdr | TestWaitForMostMPR | TestWaitForMostNPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostNPR

TestWaitForMostNPR
CAPL Function Overview » Test Feature Set » TestWaitForMostNPR

Syntax long TestWaitForMostNPR(long aValue, unsigned long aTimeout)

Function The function waits for the expiration of the time aTimeout for the occurrence of the
MOST event of a change of the value in the Node Position Register (NPR).

Parameters aValue

Expected value of the NPR that should be in the MOST event. The specification -1
(wildcard) stands for any values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostMPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostPkt

TestWaitForMostPkt
CAPL Function Overview » Test Feature Set » TestWaitForMostPkt

Syntax long TestWaitForMostPkt(long aSourceAddress, long aDestinationAddress, char


aPktDataDesc[], long aInstanceID, dword aTimeout)

long TestWaitForMostPkt(long aSourceAddress, long aDestinationAddress, char


aPktDataDesc[], dword aTimeout)

long TestWaitForMostPkt(char aPktDataDesc[], long aInstanceID, dword


aTimeout)

long TestWaitForMostPkt(char aPktDataDesc[], dword aTimeout)

Function Waits for the occurrence of the specified MOST packet. Should the event not occur before
the expiration of the time aTimeout, the wait condition is resolved nevertheless.

Info

Note, that the first and third signatures are exclusively suited to set up wait
conditions for packets having function catalog format, whereas the other
signatures also allow the definition of raw packets.

Parameters aSourceAddress

Source address

aDestinationAddress

Target address

aPktDataDesc

String containing a symbolic or numeric description of the packet data. Following formats
are allowed:

• <Raw data byte description>


• <FBlock>.<Instance>.<Function>.<OpType>
• <FBlock>.<Instance>.<Function>.<OpType>(<Raw data byte description>)
• <FBlock>.<Instance>.<Function>.<OpType> (<High Protocol frame description>)

For a detailed description of the allowed syntax, see Definition of MOST packets.

aInstanceId

Numeric value of InstanceID

Return values -6: Parse Error; on specification of a packet description string, that can’t be resolved with
the XML function catalog or that is flawed

-2: Resume based on constraint violation

-1: General error e. g. the functionality is not available

0: Resume based on timeout

1: Resume based on occurred event

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostPkt

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

| TestWaitForMostSpyPkt| TestJoinMostPktEvent | TestJoinMostSpyPktEvent | TestGetWaitEventMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostRawSpyMessage

TestWaitForMostRawSpyMessage
CAPL Function Overview » Test Feature Set » TestWaitForMostRawSpyMessage

Syntax long TestWaitForMostRawSpyMessage(long aSourceAddress, long


aDestinationAddress, long aRType, BYTE aMsgData [], dword aMsgDataLength,
dword aTimeout)

long TestWaitForMostRawSpyMessage(long aSourceAddress, long


aDestinationAddress, long aRType, char aMsgDesc[], dword aTimeout)

Function This function waits for the occurrence of the specified MOST raw spy control message.
Should the message not occur before the expiration of the time aTimeout, the wait
condition is resolved nevertheless.

Parameters aSourceAddress

Source address

aDestinationAddress

Target address

aRType

MOST control message subtypes.

Must be one of the following values:

0 Normal

1 RemoteRead

2 RemoteWrite

3 Allocate

4 Deallocate

5 GetSource

aMsgData

Byte array containing the data bytes of the raw message to be matched.

aMsgDataLength

Length of byte array aMsgData.

Data bytes at positions larger than the value of this parameter will not be considered
when comparing with incoming messages.

aMsgDataDesc

String with hexadecimal values describing the message data bytes of the raw spy message
to be matched, starting at byte position 0, f. e.
"0A 0B 0C 0D 0E 0F 10 11 12 13 FF"

Blanks will be ignored and can be used to enhance readability.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostRawSpyMessage

Wildcards can be applied by replacing a nibble with "_", e.g.


"0A 0B 0C __ __ __ 10"

Data bytes at positions beyond the ones described in this parameter will not be
considered when comparing with incoming messages.

aTimeout

Maximum wait time [ms]

Return values -6: Parse Error; on specification of a message data description string that contains other
characters than hexadecimal digits or wildcards ("_").

-2: Resumed based on Constraint violation

-1: General error e. g. the functionality is not available

0: Resume based on timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

| TestSendMostRawMessage| TestGetWaitEventMostRawMsgData |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostReport

TestWaitForMostReport
CAPL Function Overview » Test Feature Set » TestWaitForMostReport

Syntax long TestWaitForMostReport(int aFBlockId, int aInstanceId, int aFunctionId,


dword aTimeout)

long TestWaitForMostReport(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostReport(char[] aSymbolicMessage, unsigned long aTimeout)

Function Waits for the occurrence of a response message (Report, OpType > 8) of the specified
MOST message (MOST control message or MOST spy message). Should the message not
occur before the expiration of the time aTimeout, the wait condition is resolved
nevertheless.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aTimeout

Maximum wait time [ms]

(Transmission of 0: no timeout controlling)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostReport

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • MOST — •
• Test nodes

Example

| TestWaitForMostSpyReport | TestWaitForMostMessage | TestJoinMostMessageEvent | TestJoinMostReportEvent |


TestGetWaitEventMostMsgData | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSBC

TestWaitForMostSBC
CAPL Function Overview » Test Feature Set » TestWaitForMostSBC

Syntax long TestWaitForMostSBC(long aValue, unsigned long aTimeout)

Function The function waits for the expiration of the time aTimeout for the occurrence of the
MOST event of a change of the value of the Synchronous Bandwidth Control (SBC)
Register.

Parameters aValue

Expected value of the Synchronous Bandwidth Control Registers that should be in the
MOST event. The specification -1 (wildcard) stands for any values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring)

Return values -2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 • MOST — •
• Test nodes

Example

| TestWaitForMostNodeAdr | TestWaitForMostGroupAdr | TestWaitForMostNPR | TestWaitForMostSBC | TestWaitForMostNetState |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostShortUnlock

TestWaitForMostShortUnlock
CAPL Function Overview » Test Feature Set » TestWaitForMostShortUnlock

Syntax long TestWaitForMostShortUnlock(dword aTimeout)

Function The function waits until the expiration of the time aTimout for the occurrence of a
LightLock event indicating "light & no lock" state.

A LightLock event with a "light & no lock" state is generated, when there is no
interpretable signal at the Optical Receiver (FOR) of the hardware for a brief moment (<
tUnlock, see also MOST specification) and the ring has been in a "light & lock" state
previously.

Parameters aTimeout

Maximum wait time [ms] (Specification of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, f. e. functionality is not available

0: Resume due to timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • MOST — •
• Test nodes

Example

| TestWaitForMostCriticalUnlock | TestWaitForMostLightOff | TestWaitForMostStableLock |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyMessage

TestWaitForMostSpyMessage
CAPL Function Overview » Test Feature Set » TestWaitForMostSpyMessage

Syntax long TestWaitForMostSpyMessage(dbMessage aDBMsg, int aInstanceId, dword


aTimeout)

long TestWaitForMostSpyMessage(int aFBlockId, int aInstanceId, unsigned


long aTimeout)

long TestWaitForMostSpyMessage(int aFBlockId, int aInstanceId, int


aFunctionId, unsigned long aTimeout)

long TestWaitForMostSpyMessage(int aFBlockId, int aInstanceId, int


aFunctionId, int aOpType, unsigned long aTimeout)

long TestWaitForMostSpyMessage(int aSourceAddress, int aDestinationAddress,


int aFBlockId, int aInstanceId, int aFunctionId, int aOpType, unsigned long
aTimeout)

long TestWaitForMostSpyMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, int aInstanceId, unsigned long aTimeout)

long TestWaitForMostSpyMessage(int aSourceAddress, int aDestinationAddress,


char[] aSymbolicMessage, unsigned long aTimeout)

long TestWaitForMostSpyMessage(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostSpyMessage(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of the specified MOST-Spy message.

The first arriving control message, which fulfills the specified conditions, resolves the
delay point, irregardless of whether it is part of a segmented transmission. TelId is not
included in this process.

If the message does not occur by the time the aTimeout expires, the wait condition is
still resolved.

Parameters aDBMsg

MOST function catalog MOST message (e.g. AudioDiskPlayer.TrackPosition.Status) or


message name from CANdb database (e.g. ADP_TrackPosition_Status).

aSourceAddress

Source address

aDestinationAddress

Target address

aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyMessage

aFunctionId

Numeric value of FunctionID

aOpType

Numeric value of OpTypes

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function.OpType(Parameterliste)
• FBlock.InstanceId.Function.OpType
• FBlock.Function.OpType(Parameterliste)
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostAMSSpyMessage | TestWaitForMostMessage | TestJoinMostSpyReportEvent | TestWaitForMostSpyReport |


TestGetWaitEventMostMsgData | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyPkt

TestWaitForMostSpyPkt
CAPL Function Overview » Test Feature Set » TestWaitForMostSpyPkt

Syntax long TestWaitForMostSpyPkt(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[], long aInstanceID, dword aTimeout)

long TestWaitForMostSpyPkt(long aSourceAddress, long aDestinationAddress,


char aPktDataDesc[], dword aTimeout)

long TestWaitForMostSpyPkt(char aPktDataDesc[], long aInstanceID, dword


aTimeout)

long TestWaitForMostSpyPkt(char aPktDataDesc[], dword aTimeout)

Function Waits for the occurrence of the specified MOST (spy) packet. Should the event not occur
before the expiration of the time aTimeout, the wait condition is resolved nevertheless.

The first and third signatures are exclusively suited to set up wait conditions for packets
having function catalog format, whereas the other signatures also allow the definition of
raw packets.

Info

Spy packets, but also node packets (with any direction) will resolve a wait
condition set up by this function, since CANoe does not double an incoming
packet on a channel that has asynchronous spy activated.

Parameters aSourceAddress

Source address

aDestinationAddress

Target address

aPktDataDesc

String containing a symbolic or numeric description of the packet data. Following formats
are allowed:

• <Raw data byte description>


• <FBlock>.<Instance>.<Function>.<OpType>
• <FBlock>.<Instance>.<Function>.<OpType>(<Raw data byte description>)
• <FBlock>.<Instance>.<Function>.<OpType> (<High Protocol frame description>)

For a detailed description of the allowed syntax, see Definition of MOST packets.

aInstanceId

Numeric value of InstanceID

Return values -6: Parse Error; on specification of a packet description string, that can’t be resolved with
the XML function catalog or that is flawed

-2: Resume based on constraint violation

-1: General error e.g. the functionality is not available

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyPkt

0: Resume based on timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 • MOST — •
• Test nodes

Example

| TestWaitForMostPkt| TestJoinMostPktEvent | TestJoinMostSpyPktEvent | TestGetWaitEventMostPkt |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyReport

TestWaitForMostSpyReport
CAPL Function Overview » Test Feature Set » TestWaitForMostSpyReport

Syntax long TestWaitForMostSpyReport(int aFBlockId, int aInstanceId, int


aFunctionId, unsigned long aTimeout)

long TestWaitForMostSpyReport(char[] aSymbolicMessage, int aInstanceId,


unsigned long aTimeout)

long TestWaitForMostSpyReport(char[] aSymbolicMessage, unsigned long


aTimeout)

Function Waits for the occurrence of the spy response message (report, op-type > 8) of the
specified MOST message.

The first arriving control message, which fulfills the specified conditions, resolves the
wait point, irregardless of whether it is part of a segmented transmission. TelId is not
included in this process.

If the message does not occur by the time the aTimeout expires, the wait condition is still
resolved.

Parameters aFBlockId

Numeric value of FBlockID

aInstanceId

Numeric value of InstanceID

aFunctionId

Numeric value of FunctionID

Info

If -1 is given for one of the above mentioned parameters, the corresponding


field can get any value. This is also the standard for not explicit set values.

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout monitoring; test module waits infinitely long)

aSymbolicMessage

Symbolic MOST message definition in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function
• FBlock

(see also Symbolic definition of MOST messages)

Return values -6: Parse Error; on specification of a symbolic message definition that cannot be resolved
with the available XML function catalog or that is flawed

-2: Resume based on Constraint Violation

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostSpyReport

-1: General error e.g. the functionality is not available

0: Resume based on Timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 • MOST — •
• Test nodes

Example

| TestWaitForMostAMSSpyReport | TestWaitForMostReport | TestJoinMostSpyReportEvent | TestWaitForMostSpyMessage |


TestGetWaitEventMsgData | Symbolic definition of MOST messages |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForMostStableLock

TestWaitForMostStableLock
CAPL Function Overview » Test Feature Set » TestWaitForMostStableLock

Syntax long TestWaitForMostStableLock(dword aTimeout)

Function The function waits until the expiration of the time aTimout for the occurrence of a
LightLock event indicating "stable lock" state.

A LightLock event with a "stable lock" state is generated, when a "light & Lock" state lasts
uninterrupted at the hardware for a period of time equal or longer than tLock (see MOST
specification).

Parameters aTimeout

Maximum wait time [ms] (Specification of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, f. e. functionality is not available

0: Resume due to timeout

1: Resume based on occurred event

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • MOST — •
• Test nodes

Example

| TestWaitForMostCriticalUnlock | TestWaitForMostLightOff | TestWaitForMostShortUnlock |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testWaitForScopeEvent

testWaitForScopeEvent
CAPL Function Overview » Scope » testWaitForScopeEvent

Syntax long testWaitForScopeEvent(dword aTimeout)

long testWaitForScopeEvent(enum ScopeEventType scopeEvent, dword aTimeout)

Function Waits for the occurrence of CANoe Scope event. Should the event not occur before the
expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aTimeout

scopeEvent (optional)

Type of the Scope event to be awaited.

If the type of the Scope event is not specified the function will resume on any Scope
event and the exact event type can be queried using testGetWaitScopeEventData()
function.

Supported values:

scopeConnected Occurs when the Connect Scope action initiated with the
scopeConnect() CAPL call is successfully completed.

scopeDisconnected Occurs when the Disconnect Scope action initiated with the
scopeDisconnect() CAPL call is successfully completed.

scopeTriggerActivated Occurs when the Scope trigger activation initiated with the
scopeActivateTrigger() CAPL call is successfully completed.

scopeTriggerDeactivated Occurs when the Scope trigger deactivation initiated with


the scopeDeactivateTrigger() CAPL call is successfully
completed.

scopeTriggered Occurs when the Scope triggering action initiated with the
scopeTriggerNow() CAPL call is successfully completed.

Return values 1: Resume due to event occurred

0: Resume due to timeout

-1: General error, for example, functionality is not available

-2: Resume due to constraint violation

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP3 • Scope — •


• Test nodes

Example
long res;

res = scopeTriggerNow();
if (res != 1)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: testWaitForScopeEvent

{
testStepFail("Initialization","Call to scopeTriggerNow() failed. Return
code =%d", res);
return;
}

// wait till action done


if (testWaitForScopeEvent(eScopeTriggered, 8000) != 1)
{
testStepFail("Initialization ","Scope event eScopeTriggered was not
received");
return;
}
testStep("Initialization","Scope hardware triggered successefully");

| Enumeration Values of ScopeEventType | ScopeEvent Selectors |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalAvailable

TestWaitForSignalAvailable
CAPL Function Overview » Test Feature Set » TestWaitForSignalAvailable

Info

This function replaces TestWaitForSignal that has been available since version 5.1.

Syntax long TestWaitForSignalAvailable (dbSignal aSignal, dword aTimeout)

Function Tests the availability of a specific signal and waits if necessary until its availability.
A signal that is received at least once from the bus after the measurement starts is
classified as "available".

This function is useful when you want to assure that single signals are available before
starting a signal-oriented test, i.e. to synchronize the tester with the bus.

Parameters aSignal

Signal whose availability is being tested or for which is waited

aTimeout

Maximum waiting time

Return values -2: Wait state is exited due to a constraint/condition violation

-1: General error, e.g. functionality is unavailable

0: Wait state is exited due to a timeout

1: Wait state is exited; signal is available for further tests

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 Test nodes — •

Example
// waits for the occurrence of signal ‚EngineRunning’
long result;
result = TestWaitForSignalAvailable(EngineRunning, 2000);

| TestWaitForSignalsAvailable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalInRange

TestWaitForSignalInRange
CAPL Function Overview » Test Feature Set » TestWaitForSignalInRange

Syntax long TestWaitForSignalInRange (sysvar aSysVar, float aLowLimit, float


aHighLimit, dword aTimeout)

long TestWaitForSignalInRange (dbEnvVar aEnvVar float aLowLimit, float


aHighLimit, dword aTimeout)

long TestWaitForSignalInRange (dbSignal aSignal, float aLowLimit, float


aHighLimit, dword aTimeout)

Function Checks the value of the signal, the system or the environment variable against the
condition:
aLowLimit <= Value <= aHighLimit

If this condition is already met when this function is called, it returns immediately
without waiting.

The test step is evaluated as either passed or failed depending on the results.

Parameters aSysVar

System Variable to be queried.

aEnvVar

Environment variable to be queried.

aSignal

Signal to be queried.

aLowLimit

Lower limit of the value.

aHighLimit

Upper limit of the value.

aTimeout

Maximum time that should be waited [ms].

Return values -1: General error.

-2: Type of the system / environment variable is not valid – only float or integer are valid
— or signal is not valid or invalid limits of the given range.

0: Wait state is exited due to a timeout.

1: Wait state is exited due to condition fulfilment.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 Test nodes — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalInRange

7.1 SP3: form 3 Test nodes — •

Example
// waits for a specified value range of signal ‘Velocity’
long result;
result = TestWaitForSignalInRange(Velocity, 80, 100, 2000);

| TestJoinSignalInRange |TestWaitForSignalOutsideRange |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalMatch

TestWaitForSignalMatch
CAPL Function Overview » Test Feature Set » TestWaitForSignalMatch

Syntax long TestWaitForSignalMatch (dbSignal aSignal, float aCompareValue, dword


aTimeout)

long TestWaitForSignalMatch (dbEnvVar aEnvVar, float aCompareValue, dword


aTimeout)

long TestWaitForSignalMatch (sysvar aSysVar, float aCompareValue, dword


aTimeout)

Function Checks the given value against the value of the signal, the system variable or the
environment variable. The resolution of the signal is considered.

If this condition is already met when this function is called, it returns immediately
without waiting.

The test step is evaluated as either passed or failed depending on the results.

Parameters aSignal

Signal to be queried.

aEnvVar

Environment variable to be queried.

aSysVar

System variable to be queried.

aCompareValue

Value which is compared to the signal value.

aTimeout

Maximum time that should be waited [ms].

Return values -1: General error

-2: Signal is not valid

0: Wait state is exited due to a timeout

1: Wait state is exited due to condition fulfillment

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

7.5: form 2, 3 Test nodes — •

Example
// waits for a specified value of signal ‘Velocity’
long result;
result = TestWaitForSignalMatch(Node_SUT::Velocity, 80, 1000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalMatch

| TestJoinSignalMatch |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalOutsideRange

TestWaitForSignalOutsideRange
CAPL Function Overview » Test Feature Set » TestWaitForSignalOutsideRange

Syntax long TestWaitForSignalOutsideRange (sysvar aSysVar, float aLowLimit, float


aHighLimit, dword aTimeout)

long TestWaitForSignalOutsideRange (dbEnvVar aEnvVar, float aLowLimit,


float aHighLimit, dword aTimeout)

long TestWaitForSignalOutsideRange (dbSignal aSignal, float aLowLimit,


float aHighLimit, dword aTimeout)

Function Checks the signal, the system or the environment variable value against the condition:

• Value < aLowLimit or


• Value > aHighLimit

If this condition is already met when this function is called, it returns immediately
without waiting.

The test step is evaluated as passed or failed depending on the results.

Parameters aSysVar

System Variable to be queried.

aEnvVar

Environment variable to be queried.

aSignal

Signal to be queried.

aLowLimit

Lower limit of the value.

aHighLimit

Upper limit of the value.

aTimeout

Maximum time that should be waited [ms].

Return values -1: General error.

-2: Type of the system or environment variable is not valid – only float or integer are valid
— or signal is not valid or invalid limits of the given range.

0: Wait state is exited due to a timeout.

1: Wait state is exited due to condition fulfilment.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalOutsideRange

7.1 SP3: form 3 Test nodes — •

Example
// waits for a specified value range of signal ‘Velocity’
long result;
result = TestWaitForSignalOutsideRange(Velocity, 80, 100, 2000);

| TestJoinSignalOutsideRange |TestWaitForSignalInRange |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSignalsAvailable

TestWaitForSignalsAvailable
CAPL Function Overview » Test Feature Set » TestWaitForSignalsAvailable

Info

This function replaces TestWaitForSignals that has been available since version 5.1.

Syntax long TestWaitForSignalsAvailable (dbNode aNode, dword aTimeout)

Function Tests the availability of all the send signals of a node and waits if necessary until all the
send signals of the node are available. Signals that are received at least once from the
bus after the measurement starts are classified as "available".

This function is useful when you want to assure that all signals are available before
starting a signal-oriented test, i.e. to synchronize the tester with the bus.

Parameters aNode

Node whose send signals should all be available

aTimeout [ms]

Maximum waiting time

Return values -2: Wait state is exited due to a constraint/condition violation

-1: General error, e.g. functionality is unavailable

0: Wait state is exited due to a timeout; not all signals are available

1: The wait state is exited; all of the node’s send signals are available for further tests

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 Test nodes — •

Example
// waits for the availability of all tx signals of node ‘SUT’
long result;
result = TestWaitForSignalsAvailable(SUT, 2000);

| TestWaitForSignalAvailable |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForStringInput

TestWaitForStringInput
CAPL Function Overview » Test Feature Set » TestWaitForStringInput

Syntax long TestWaitForStringInput (char aQuery[])

long TestWaitForStringInput (char aQuery[], dword aTimeout)

Function It creates a dialog window which displays the transferred string. The tester can enter a
text in this dialog. This entry can be queried with the command TestGetStringInput after
a successful call, i.e. with the return value "1". It is also possible to enter a comment in
the dialog which is automatically adopted into the test protocol.

The first wait function without timeout waits until the confirmation by the tester. If the
second wait function is used with the timeout, the dialog is automatically closed after the
timeout. Whether the dialog was closed due to a timeout or by the tester, can be
determined by using the return value.

The function TestGetLastWaitResult can be queried after calling the return value of the
function if no other TestWaitForStringInput call occurred in the interim.

Only one dialog window is open at a time, even though TestWaitForStringInput is


called by different test modules.

Parameters aQuery

Text to be displayed in the entry dialog. Up to 255 characters can be displayed in the
dialog.

aTimeOut

Time in milliseconds after which the dialog is to be cancelled automatically.

Return values <0: General error, e.g. by calling outside of a test sequence

0: Timeout occurred

1: Dialog was closed by pressing the button [Ok] (successful call)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// ask for the users name and report it in the Write window
char answer[100];
if (1== TestWaitForStringInput("Please enter your name", 5000))
{
TestGetStringInput(answer, 100);
Write("name = %s", answer);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSyscall

TestWaitForSyscall
CAPL Function Overview » Test Feature Set » TestWaitForSyscall

Note on Exitcode

Windows supplies exitcodes for applications in the range from 0 to 255. 255 is always
supplied for applications which generate internal values outside this range (e.g., negative
values). You might need to take this into account when setting the aExitcode parameter.

Note on application directory

If no application directory has been set, the working directory of the external application
is set by default as follows:

• Execution on a local PC, test module in the test setup:


directory that contains the .TSE file of the test environment.
• Execution on a local PC, test module in the simulation setup:
directory that contains the .CFG file of the configuration.
• Execution on a remote PC (CANoe RT):
Exec32 directory of the CANoe installation on the remote PC.

Syntax long TestWaitForSyscall(char aCommandline[], long aExitcode, dword


aTimeout)

long TestWaitForSyscall(char aWorkingdir[], char aCommandline[], long


aExitcode, dword aTimeout)

Function This function can be used to start an external application and check its exit code. Once
the application has been started successfully the system waits for it to exit at the end of
the specified wait time. The result depends on whether the application's exit code
matches the specified expected value.

You should either use the absolute path to the external application or use the call with
the declaration of the working directory. To keep the configuration independent of
installation paths on a concrete PC you can use <workingdir> alternatively to reference an
environment variable of the target system, e.g. %MYAPP_DIR%.

Parameters aWorkingdir

The working directory for the external application. The directory name may include
spaces.

aCommandline

The command line for the application including any parameters which might be required.

Path names or parameters containing blank spaces must be enclosed in quotation marks
(as an escape sequence \").

aExitcode

The expected exit code for the application. If the application is exited within the wait
time, the result of the call will also depend on whether it was exited with this exit code.

aTimeout [ms]

The maximum wait time at the end of which the application is expected to exit.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSyscall

Return values 1: The application exited with the expected exit code.

0: The application did not exit within the wait time.

-1: The application could not be started, e.g., due to an error in the command line.

2: The application exited with an exit code other than the one expected.

-999: Waiting aborted due to end of measurement (this does not cause the application to
be aborted).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

7.0 SP4: form 2 Test nodes — •

Example
//starts an external application
long ret;
TestStepBegin("tc1", "syscall");
ret = TestWaitForSyscall("C:\\My Project", "\"My Tester.exe\" 0", 0, 1000);
if (ret != 1) {
TestStepFail("Syscall failed or timed out.");
TestCaseFail();
} else {
TestStepPass("Syscall succeeded.");
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForSysVar

TestWaitForSysVar
CAPL Function Overview » Test Feature Set » TestWaitForSysVar

Syntax long TestWaitForSysVar(sysvar aSysVar, dword aTimeout)

Function Waits for the next system variable aSysVar. Should the event not occur before the
expiration of the time aTimeout, the wait condition is resolved nevertheless.

Parameters aSysVar

System variable that should be awaited.

aTimeout

Maximum time that should be waited [ms].

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation.

-1: General error, for example, functionality is not available.

0: Resume due to timeout.

1: Resume due to event occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 Test nodes — •

Example
// waits for the occurrence of SysVar ‚MySysVar’
long result;
result = TestWaitForSysVar(sysvar::Test::MySysVar, 2000);

|TestJoinSysVarEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForTesterConfirmation

TestWaitForTesterConfirmation
CAPL Function Overview » Test Feature Set » TestWaitForTesterConfirmation

Syntax long TestWaitForTesterConfirmation(char text[])

long TestWaitForTesterConfirmation(char[] text, unsigned long timeout);

long TestWaitForTesterConfirmation(char[] text, unsigned long timeout,


char[] heading, char[] resource, char[] resourceCaption)

Function Creates a popup window that presents the given string to the tester. The tester can
acknowledge the window with Yes or No.

The window contains a field for entering a comment that is automatically adopted into
the test protocol.

Even when this function is called by different test modules maximum only one of these
popup windows is active.

The 1st wait function has no timeout so it waits for the confirmation of the tester.
The 2nd wait function has a timeout, i.e. the dialog is automatically terminated after the
timeout expires.
The 3rd wait function has a timeout and can show a resource, i.e. the dialog can show
additional information.

Parameters text

This is shown in the popup window. The maximum length of the string is limited (4096
characters).

timeout

Time in milliseconds after which the dialog is automatically ended.

heading

A heading above the dialog text. The maximum length of the string is limited (256
characters).

resource

A URL or file path. The maximum length of the string is limited (512 characters).
Pictures are shown in the dialog itself, for other resources a link is shown. Supported
picture types are: bmp, jpg, png, gif. For arbitrary files, the application registered for
that file type on the computer is used to open it when the user clicks the link. Relative
file paths are based on the configuration or test setup which contains the test module.

resourceCaption

A caption respectively a description for the resource. The maximum length of the string is
limited (256 characters).

Return values 0: Timeout occurred.

1: The tester pressed Yes.

2: The tester pressed No.

-1: General error, e.g. due to a call outside of a test sequence.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForTesterConfirmation

-2: Constraint occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example
// waits for the answer of the user
long result;
result = TestWaitForTesterConfirmation("Any text or question", 10000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForTextEvent

TestWaitForTextEvent
CAPL Function Overview » Test Feature Set » TestWaitForTextEvent

Syntax long TestWaitForTextEvent(char aText[], dword aTimeout)

Function Waits for the signaling of the specified textual event from the individual test module. A
signaling from another test module does not effect this wait instruction.

Should this event not occur before the expiration of the time aTimeout, the wait
condition is resolved nevertheless.

Parameters aText

Any (meaningful) textual event name

aTimeout

Maximum time that should be waited [ms]

(Transmission of 0: no timeout controlling)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: Resume due to event occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for the occurrence of text event „ErrorFrame occurred!“
long result;
result = TestWaitForTextEvent("ErrorFrame occurred!", 3000);

// handler ‘on errorFrame’ signals event


on errorFrame
{
TestSupplyTextEvent("ErrorFrame occurred!");
}

| TestJoinTextEvent | TestSupplyTextEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForTimeout

TestWaitForTimeout
CAPL Function Overview » Test Feature Set » TestWaitForTimeout

Syntax long TestWaitForTimeout(dword aTimeout)

Function Waits until the expiration of the specified timeout time.

Parameters aTimeout

Maximum time that should be waited [ms].

(Transmission of 0: no timeout controlling. In this function this results in a hang up of the


test module)

Return values -2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 Test nodes — •

Example
// waits for 3000 ms
long result;
result = TestWaitForTimeout(3000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: TestWaitForValueInput

TestWaitForValueInput
CAPL Function Overview » Test Feature Set » TestWaitForValueInput

Syntax long TestWaitForValueInput (char aQuery [])

long TestWaitForValueInput (char aQuery [], dword aTimeout)

Function It creates a dialog window which displays the transferred string. The tester can enter a
number in this dialog. The number can be entered in decimal as well as hexadecimal
form. Only characters allowed for numeric values are allowed. Upon closing the dialog, an
additional check of the number entered is performed. If the entry cannot be converted to
a valid number, an error message is generated and the dialog is exited. The entry can be
queried after a successful call with the commands TestGetValueInput (number value) and
TestGetStringInput (entry as String). It is also possible to enter a comment in the dialog
which is automatically adopted into the test protocol.

The first wait function without timeout waits until the confirmation by the tester. If the
second wait function is used with the timeout, the dialog is automatically closed after the
timeout. Whether the dialog was closed due to a timeout or by the tester, can be
determined by using the return value.

The function TestGetLastWaitResult can be queried after calling the return value of the
function if no other TestWaitForValueInput call occurred in the interim.

Only one dialog window is open at a time, even though TestWaitForValueInput is called
by different test modules.

Parameters aQuery

Text to be displayed in the entry dialog

aTimeOut

Time in milliseconds after which the dialog is to be cancelled.

Return values <0: General error, e.g. by calling outside of a test sequence

0: Timeout occurred

1: Dialog was closed by pressing the button [Ok] (successful call)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 Test nodes — •

Example
// ask for the test ID and report it in the Write window
TestWaitForValueInput("Please enter the test ID", 5000);
Write("Test ID = %f", TestGetValueInput());

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set: Definition of MOST packets

Test Feature Set: Definition of MOST packets


CAPL Function Overview » Test Feature Set » Symbolic definition of MOST messages

Several Test Feature Set functions for processing MOST packets take a string parameter for the
specification of packet data. This string description must have one of the following formats:

1. <Raw data byte description>


2. <FBlock>.<Instance>.<Function>.<OpType>
3. <FBlock>.<Instance>.<Function>.<OpType>(<Raw data byte description>)
4. <FBlock>.<Instance>.<Function>.<OpType>(<High Protocol frame description>)

A raw data byte description is always enclosed by curly brackets and may contain only hexadecimal digits,
blanks or the wildcard symbol "_" as a placeholder for a single hexadecimal digit. Additionally, the
wildcard symbol "*" can be used exclusively at the end of a byte description to specify that all data bytes
after the last one specified are ignored in a message to be matched. In other words, if there’s no "*" at the
end of the description, the length of the data to match must exactly match the length of the description,
even if there are single hex digit placeholders at the end. Note, that in most cases it is reasonable to add
a "*" at the end, since packets may be filled up with zero bytes at the end to full quadlets size.

Blanks are always ignored and can be used for formatting in order to gain a better readability.

When using a raw data byte description to specify a raw packet (1. form), the first byte in the string
describes the first byte in the packet data.

Example
// packet must only contain the specified 8 bytes
TestWaitForMostPkt(“{ F0 F1 F2 F3 F4 F5 F6 F7}”, 500);
// packet must begin with specified 8 bytes; Byte at 5th position may have any
value
TestWaitForMostPkt(“{ F0 F1 F2 F3 __ F5 F6 F7 *}”, 500);

FBlock, Instance, Function and OpType can be specified numerically or symbolically based on the function
catalog information available (see also Symbolic definition of MOST messages > Specification of names for
FBlock, Function and OpType).

Example
TestWaitForMostPkt("AudioDiskPlayer.1.DeckStatus.Get", 500);
TestWaitForMostPkt("0x31.0x01.0x200.0x1", 500);

When using FBlock, Instance, Function and OpType in conjunction with a raw data byte description for the
user data bytes, the first data byte in the raw data description corresponds to the first user data byte
(which is the 7. byte in the packet).

Example
TestWaitForMostPkt(“NetBlock.1.FBlockIDList.Status({ 31 01 *})”, 500);

When using a High Protocol frame description to specify the user data bytes of a packet, a set of case-
sensitive key words is offered to specify the different High Protocol frame types. Each key word has a
defined number of allowed parameters that may follow the key word in a bracket-enclosed, comma-
separated list. The meaning of each parameter depends on the frame type and position in the message
data (for a detailed description of the frame types and parameters, please consult the MOST High Protocol
Specification). The following keywords and parameters are recognized:

• REQUEST CONNECTION(Prio, NDF, RevID)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set: Definition of MOST packets

• START CONNECTION(Scale, RevID, PrioAck, NDFAck, AIR)


• READY FOR DATA
• HOLD CONNECTION Tx(Event)
• HOLD CONNECTION Rx(Event)
• END CONNECTION Tx(Event)
• END CONNECTION Rx(Event)
• FRAME ACK(FrAckHi, FrAckLo, BlockCnt)
• REQUEST(FrameID)
• MULTIPLE FRAMES REQUEST(FrameID, FrameID, FrameID, …)
• ADJUST RATE(Operation)
• DATA FRAME(FrAckHi, FrAckLo, <Raw data byte description>)
• 0-FRAME(FrAckLo, SegID, Options, BlockCnt)

Example
// Test: Start of MHP transmission
// hexadecimal frame parameter values
TestWaitForMostPkt(“Navigation.Waypoints.Status(REQUEST CONNECTION(0x7f, 0x30,
0x1))”, 100);
// blanks in key words are ignored
TestWaitForMostPkt(“Navigation.Waypoints.Status(READYFORDATA)”, 100);
// decimal frame parameter values
TestWaitForMostPkt(“Navigation.Waypoints.Status(0-FRAME(255, 1, 1, 0))”, 100);

Each parameter in a list can be set to a numerical value (hex or decimal), or to wildcard value by using "*".
Parameters omitted at the end of a list are automatically set to wildcard value.

Example
// Wait for 0-FRAME of 200. block
TestWaitForMostPkt(“Navigation.Waypoints.Status(0-FRAME(*, *, *, 200))”, 100);

It is also possible to insert a raw data byte description instead of a direct numerical value at any
parameter position in the list. In this case however, this must always be last parameter in the list, since
the variable length of a raw byte description prevents any further parameter position matching. In the
special case of the DATA FRAME, the last parameter corresponds to the actual data payload of a data
frame and must always be described via a raw data byte description. Note that the same rules for
wildcards apply here as mentioned above. So if messages longer than specified also should match, it is
required to add a "*" wildcard at the end.

Example
// Wait for 0-Frame of block with 255 frames and BlockCnt == 5
TestWaitForMostPkt(“Navigation.Waypoints.Status(0-FRAME(0xFF, {__ __ 05})”,
100);
// Raw data parameter at first position always starts directly after high
command byte
TestWaitForMostPkt(“Navigation.Waypoints.Status(HOLD CONNECTION Tx({00 83 *})”,
100);
// First three bytes of 6. data frame must be 0x20, 0x21, 0x22
TestWaitForMostPkt(“Navigation.Waypoints.Status(DATA FRAME(0x06, 0xFF, {20 21 22
*})”, 100);

Note, that the TelID also matters for matching incoming packets. DATA FRAME and 0-FRAME specifications
only match packets with TelID = 8, whereas all other frame types only consider packets with TelID = 9.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set: Symbolic definition of MOST messages

Test Feature Set: Symbolic definition of MOST messages


CAPL Function Overview » Test Feature Set » Symbolic definition of MOST messages

In many send and wait commands for MOST, MOST messages can be specified symbolically. Here the
relevant MOST message, which under some circumstances can also contain wildcards and parameters, is
defined by a character string. The MOST message is resolved by the incorporated XML function catalog.

Symbolic definition of MOST messages

The symbolic definition of the message essentially follows the syntax that is used in the MOST
specification. All variants are derived from the following basic form:
FBlock.Instance.Function.OpType(Parameter,Parameter,Parameter)

In some commands, parts of this can be omitted; these are then regarded as "arbitrary". However, not all
conceivable forms are permitted, as this would prevent the specifications being distinguished uniquely
from one another. For information about which forms are permitted, see the description of the relevant
commands.

Essentially it is possible to set raw data for the user data. Accordingly, the parameter bytes have to be set
as hexadecimal values in curly brackets. This facilitates, for example, the sending of messages which do
not comply with the definition in the function catalog.

Example
Diagnosis.1.KeywordRec.Set({AABB11223344})

or pure numerical:
0x06.1.0x050.0x0({AABB11223344})

Specification of names for FBlock, Function and OpType

The following special separators are used:

• Commas (to separate parameters in the parameter list)


• Dots (to separate the FBlockID, FunctionID etc.)
• Round brackets (to identify the parameter list)

These separators cannot be used in names.

All characters between separators belong to the specification in question. Blank spaces are also permitted
in symbolic names. Without additional specifications, numeric specifications are decimal numbers; with
leading 0x, they are hexadecimal specifications. The numeric values to be transferred must be specified
here. Information that may be stored in the function catalog about units and conversion factors is not
taken into consideration. String parameters are enclosed in simple quotation marks.

Info

In hexadecimal mode, hexadecimal specifications are displayed in the trace window in the inline
disassembly column without a leading 0x; in decimal mode, they are displayed with a 0x.
Therefore, these lines can be used in decimal mode directly as a message definition
(copy&paste).

FBlock, Function, OpType can each be specified as symbolic names or numeric IDs. The symbolic names
cannot, therefore, completely take on the form of decimal or hexadecimal numbers. By contrast, the form
of partial strings will work. The InstanceID must be a numeric value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set: Symbolic definition of MOST messages

The name * has a special role. It stands for any value (wildcard). Since for the resolution of function
names in the XML function catalog the FBlock must be known, a wildcard for the FBlock is only permitted
if the function is arbitrary or specified numerically. The parameter list contains the parameters of the
message in the sequence they are stored in the message and defined in the XML function catalog. The
parameters are separated by commas. The parameters can represent numeric values or symbolic values
(e.g., in case of enumerations) that are resolved using the XML function catalog. * is also permitted for an
arbitrary value. The parameter list does not have to be complete; however, for reasons of clarity only an
omission at the end of the list is possible. Specifications that are not present always count as "arbitrary".

Expanded wait functions

An expanded wait condition arises only for the wait instructions for which the message definition contains
a parameter list. Here, as well as a message that fits the specified signature of FBlock, Instance, Function,
and OpType being expected, in addition, the specified parameters must correspond with the parameters
of the message received. As with all wait instructions, all received messages that fit only a part of the
specified signature are ignored. This means that the reception of such messages does not cause the wait
condition to be abandoned.

Error handling

In the event of an error during parsing and resolution of the message string, all functions show a return
value. In this case the function returns immediately without waiting. The error is displayed in the Write
window and recorded in the report, but the measurement is not aborted.

This behavior can be changed with the TestSetParseErrorConstraint command for all subsequent test
commands with symbolic message definition so that these set the verdict of the test case to "fail".

The command must not be used in the context of a test case; however, it can be used at test module level
(that is, in main test). However, if the command is used in the context of a test case, at the end of the
test case the mode reverts to what it was at the beginning of the test case. This ensures the locality of
the test case. The execution of a test case does not affect test cases that may be executed subsequently.

The InstanceID can be specified in each case as a parameter or as a part of the symbolic message
definition. If both specifications are present, a warning will be output at runtime and the parameter value
used. The value in the string is ignored (no measurement abort). If no InstanceID is specified explicitly,
then this is regarded as "arbitrary".

Example
TestWaitForMostMessage ("AudioAmplifier.2.Mute.Status", 200);
SUTInstID = ...;
TestWaitForMostAMSMessage ("AudioAmplifier.Mute.Status(MuteOn)", SUTInstID,
200);
TestJoinMostReportEvent ("NetBlock.2.Shutdown");

Example

Press <Ctrl>+<M> or select Message input with MOST function catalog... from the shortcut menu
to open an input assistant which displays a data entry field in the current program line listing a
selection of all MOST messages described in the function catalog. The selection takes in all
function catalogs assigned to the CAPL node.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Feature Set: Symbolic definition of MOST messages

In this context, the input assistant permits the description of messages up to parameter values
and adds the resulting description to the program text in quotation marks.

In the event of an error during parsing and resolution of the message string, all functions show a
return value. In this case the function returns immediately without waiting. The error is
displayed in the write window and recorded in the report.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library Functions

Test Service Library Functions


CAPL Function Overview » Test Service Library Functions

Functions Short description

Types of functions Check functions shall be identifiable easily. So the functions are to be prefixed.

Status Report In order to query information about a check, generic and check specific status
functions report functions are implemented.

Stimulus functions Stimulus Generators allow the user to stimulate signals or environment variables -
referred to as data sinks in the following - according to a specific time behavior.

Check overview Each function specification ChkStart_ implies a specification of a ChkCreate_


function. This ChkStart_ function creates and additionally starts the check.

Commands to These functions can be used to turn off checking in not relevant time, and to
control checks continue checking. The control functions can also be used to setup dependencies
between checks.

Configuration The ChkConfig* functions permit configuration of the TestServiceLibrary.


Functions

Error codes For all status report functions, the return values and raised error classes are
applied.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkConfig_Init

ChkConfig_Init
CAPL Function Overview » Test Service Library » Configuration Functions » ChkConfig_Init

Syntax long ChkConfig_Init (char aRole[])

Function Initializes TSL to be used subsequently.

The tests are executed in the context of a specific tester-role. Dependent to the setting
of the role, the error handling is more or less strict. This setting influences the
transformation from an error class to an impact.

Available tester-roles:

• developer
Less strict error handling, additional information during test execution.
• user
More strict error handling

Intended usage:

During development of a test module, the TSL can be set more verbose and some
problems in the test program are tolerated to get a longer list of issues before the test
module is stopped. Purpose is to reduce the count of iterations between test module
implementation and test module execution.
Once the test module is completed, the role should be set to user. Then the TSL is less
verbose and possible errors do have bigger impact.
Purpose: The tester really notices problems in the test configuration.

If the function is used, then it is recommended to perform the initialization once during
preStart section of the CAPL program.

Parameters aRole

Allowed value range: developer, user

Return values -1: invalid arguments

0: arguments accepted

Possible Called during measurement


errors

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

Example
// test is executed in the role of a developer
on preStart
{
ChkConfig_Init(“developer”);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkConfig_SetPrecision

ChkConfig_SetPrecision
CAPL Function Overview » Test Service Library » Configuration Functions » ChkConfig_SetPrecision

Syntax long ChkConfig_SetPrecision(unsigned int aPrecision)

Function This function configures the TSL time basis for the current node. The time basis
(precision) affects all future times that are passed when creating checks, and it affects
the time basis for queries (status report functions).

This function allows you to configure the time basis for new checks to be created.
The time bases of checks that have already been created are not changed by this
function. They can be polled by a special query.

Parameters aPrecision

Describes the decimal power of the precision

value range: 2 < aPrecision < 10

3 10 –3 seconds = ms (default)

4 10 –4 seconds

5 10 –5 seconds = 10 us: e.g. used in trace export

6 10 –6 seconds = us

7 10 –7 seconds

8 10 –8 seconds

9 10 –9 seconds = ns

Return values 0: successful

long -1: invalid range of precision

-3: TSL was not initialized

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

Example
// precision of the test is set to us
chkConfig_SetPrecision(6);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkConfig_SetTitle

ChkConfig_SetTitle
CAPL Function Overview » Test Service Library » Configuration Functions » ChkConfig_SetTitle

Syntax long ChkConfig_SetTitle (Check aCheckId, char aTitle[])

Method check.SetTitle(char aTitle[])

Function Sets the title of a check.

The check is displayed in the write window and the test report with this title.

Parameters aCheckId

Identifier of the check

aTitle

Title of the check

Return values 0: Title is set successfully

-1: Title could not be set due to invalid title parameter, e.g. empty title

-4: Title could not be set due to invalid check identifier

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 — — •

Example
// set title of the check
dword mCheckId;
mCheckId = ChkCreate_Timeout(1000);
ChkConfig_SetTitle(mCheckId, "Check Timeout");
ChkControl_Start(mCheckId);

TestCheck tc;
tc = TestCheck::CreateTimeout(1000);
tc.SetTitle("Check Timeout");
tc.Start();

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Destroy

ChkControl_Destroy
CAPL Function Overview » Test Service Library » Commands to Control Checks » ChkControl_Destroy

Syntax long ChkControl_Destroy(Check aCheckId)

As destructor check.Destroy()

Function The check is destroyed and cannot be accessed anymore. Its resources are freed.

Parameters aCheckId

Must exist

Return values 0: successful

< 0: error

Possible Check for given id does not exist


errors

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);

// destroy check
ChkControl_Destroy(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Reset

ChkControl_Reset
CAPL Function Overview » Test Service Library » Commands to Control Checks » ChkControl_Reset

Syntax long ChkControl_Reset(Check aCheckId)

Method check.Reset()

Function The status (stored values) of the check is initialized. The check does not have to be
stopped for this function to work.

Parameters aCheckId

Must exist

Return values 0: successful

< 0: error

Possibel Check for given id does not exist


errors
Check was already in the resulting lifecycle state (was reset)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);

// reset stored values of the check


ChkControl_Reset(checkId);

// start the check again without adding as condition


ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Start

ChkControl_Start
CAPL Function Overview » Test Service Library » Commands to Control Checks » ChkControl_Start

Syntax long ChkControl_Start(Check aCheckId)

Method check.Start()

Function Begin or continue checking the event condition. May work on a check stopped earlier, or
on a check only created previously (e.g. in 'on prestart'). Ignored for active checks.

Parameters aCheckId

Must exist

Return values 0: successful

< 0: error

Possible Check for given id does not exist


errors
Check was already in the resulting lifecycle state (was started)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);

// reset stored values of the check


ChkControl_Reset(checkId);
// start the check again without adding as condition,
// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Start

ChkControl_Destroy(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Stop

ChkControl_Stop
CAPL Function Overview » Test Service Library » Commands to Control Checks » ChkControl_Stop

Syntax long ChkControl_Stop(Check aCheckId)

Method check.Stop()

Function Turns off the checking of the event condition.

Parameters aCheckId

Must exist

Return values 0: successful

< 0: error

Possible Check for given id does not exist


errors
Check was already in the resulting lifecycle state (was stopped)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
dword checkId;
dword numCheckEvents;

// start the error frame observation


checkId = ChkStart_ErrorFramesOccured();
// Add check as condition,
// that means that check violations are reported and
// the verdict of the test case is set to "failed"
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// Remove check as condition
TestRemoveCondition(checkId);

// stop the check


ChkControl_Stop(checkId);

// reset stored values of the check


ChkControl_Reset(checkId);

// start the check again without adding as condition,


// that means that error frames are observed, but violations
// are not reported and do not set the test case verdict to "failed"
ChkControl_Start(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
// stop the check
ChkControl_Stop(checkId);

// analysis of check
numCheckEvents = ChkQuery_NumEvents(checkId);
if (numCheckEvents > 0)
TestStepFail("Error Frame occurred!");

// destroy check
ChkControl_Destroy(checkId);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkControl_Stop

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_AllNodesBabbling, ChkStart_AllNodesBabbling

ChkCreate_AllNodesBabbling, ChkStart_AllNodesBabbling
CAPL Function Overview » Test Service Library » Checks » ChkCreate_AllNodesBabbling, ChkStart_AllNodesBabbling

Syntax dword ChkCreate_AllNodesBabbling (Duration aMinQuietTime, char []


CaplCallback)

dword ChkStart_AllNodesBabbling (Duration aMinQuietTime, char []


CaplCallback)

As constructor TestCheck::CreateAllNodesBabbling (Duration aMinQuietTime, char []


function CaplCallback)

TestCheck::StartAllNodesBabbling (Duration aMinQuietTime, char []


CaplCallback)

Check name | Node Inactive check |

Function There is a time interval where transmissions are tolerated. After the interval has
been passed, all nodes may no longer send messages. From now on, each transmission
of the nodes is reported.

If the min. quiet time is 0, then each message sent by any node leads to the event.

Possible application:
Supervises the end of a communication.
Supervises the transition of nodes’ or busses’ state to "sleep active".

Gateway nodes require that the bus context corresponds to the network that is being
observed.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aMinQuietTime

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned
(handle-) value.

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 CAN, FlexRay — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_AllNodesBabbling, ChkStart_AllNodesBabbling

7.0 SP5: method CAN, FlexRay — •

7.2: extended CAN, FlexRay — •

Example
// checks that after 300 ms no transmission are available
checkId = ChkStart_AllNodesBabbling(300);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_AllNodesDead, ChkStart_AllNodesDead

ChkCreate_AllNodesDead, ChkStart_AllNodesDead
CAPL Function Overview » Test Service Library » Checks » ChkCreate_AllNodesDead, ChkStart_AllNodesDead

Syntax dword ChkCreate_AllNodesDead (Duration aMaxQuietTime, char []


CaplCallback)

dword ChkStart_AllNodesDead (Duration aMaxQuietTime, char []


CaplCallback)

As constructor TestCheck::CreateAllNodesDead (Duration aMaxQuietTime, char []


function CaplCallback)

TestCheck::StartAllNodesDead (Duration aMaxQuietTime, char []


CaplCallback)

Check name | Node Active check |

Function All monitored nodes must send at least one of their Tx messages within a specified
interval. Otherwise an event will be triggered.

Each node is checked separately, so a dead node is recognized even if others are
alive.

Gateway nodes require that the bus context corresponds to the network that is being
observed.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aMaxQuietTime

Upper limit of time interval.

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned
(handle-) value.

Check-specific ChkQuery_EventInterval
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2: extended CAN, FlexRay — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_AllNodesDead, ChkStart_AllNodesDead

Example
// checks that at least one message is sent in each 100 ms
checkId = ChkStart_AllNodesDead (100);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_BurstTimeLimitViolation, ChkStart_BurstTimeLimitViolation

ChkCreate_BurstTimeLimitViolation, ChkStart_BurstTimeLimitViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_BurstTimeLimitViolation, ChkStart_BurstTimeLimitViolation

Syntax dword ChkCreate_BurstTimeLimitViolation (char[] aBusName, duration


aMaxTime)

dword ChkStart_BurstTimeLimitViolation (char[] aBusName, duration


aMaxTime)

As constructor TestCheck::CreateBurstTimeLimitViolation (char[] aBusName, duration


function aMaxTime)

TestCheck::StartBurstTimeLimit (char[] aBusName, duration aMaxTime)

Check name | Burst Time Limit check |

Function Checks the maximum burst time on a bus.

Parameters aBusName

Name of the bus.

aMaxTime

Maximum burst time. Default unit [ms], if not changed with ChkConfig_SetPrecision.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned
(handle-) value

Possible errors Bus name is not available for the test module.
Maximum burst time is 0.
Check-specific —
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 CAN — •

Example
// observes the maximum burst time 3 ms
checkId = ChkStart_BurstTimeLimitViolation ("CAN", 3);
TestAddCondition(checkId);

// sequence of different actions and waiting conditions


TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_ErrorFramesOccured, ChkStart_ErrorFramesOccured

ChkCreate_ErrorFramesOccured, ChkStart_ErrorFramesOccured
CAPL Function Overview » Test Service Library » Checks » ChkCreate_ErrorFramesOccured, ChkStart_ErrorFramesOccured

Syntax dword ChkCreate_ErrorFramesOccured (long MinCountOfErrorFrames, long


MaxCountOfErrorFrames, dword Timeout, char CaplCallbackFunction[])

dword ChkStart_ErrorFramesOccured (long MinCountOfErrorFrames, long


MaxCountOfErrorFrames, dword Timeout, char CaplCallbackFunction[])

dword ChkCreate_ErrorFramesOccured (char CaplCallbackFunction[])

dword ChkStart_ErrorFramesOccured (char CaplCallbackFunction[])

As constructor TestCheck::CreateErrorFramesOccured (long MinCountOfErrorFrames, long


function MaxCountOfErrorFrames, dword Timeout, char CaplCallbackFunction[])

TestCheck::StartErrorFramesOccured (long MinCountOfErrorFrames, long


MaxCountOfErrorFrames, dword Timeout, char CaplCallbackFunction[])

TestCheck::CreateErrorFramesOccured (char CaplCallbackFunction[])

TestCheck::StartErrorFramesOccured (char CaplCallbackFunction[])

Check name | Error Frame check |

Function Checks the occurrence of error frames on the bus. The event is generated if fewer than
MinCountOfErrorFrames or more than MaxCountOfErrorFrames are received.

The minimum condition is only checked when 'Timeout != 0'

Parameters MinCountOfErrorFrames

Minimum number of error frames that must be received.

Only check when 'Timeout != 0'

MaxCountOfErrorFrames

Maximum number of error frames that may occur.

Timeout

The check is automatically stopped after this time. The check is no longer in progress.
If the timeout is specified with zero, it behaves like all other checks. It runs until the
ChkControl_Stop(id) function is called.

Default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallbackFunction

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_ErrorFramesOccured, ChkStart_ErrorFramesOccured

Possible errors MinCountOfErrorFrames > MaxCountOfErrorFrames

CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN — •

7.0 SP5: method CAN — •

Example
// observes that less than 3 Error Frames occurs
checkId = ChkStart_ErrorFramesOccured (0, 2);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_InconsistentDLC, ChkStart_InconsistentDLC

ChkCreate_InconsistentDLC, ChkStart_InconsistentDLC
CAPL Function Overview » Test Service Library » Checks » ChkCreate_InconsistentDLC, ChkStart_InconsistentDLC

Syntax dword ChkCreate_InconsistentDLC(Message aMessage, char [] aCallback)

dword ChkStart_InconsistentDLC(Message aMessage, char [] aCallback)

dword ChkCreate_InconsistentDlc(dword aMessageId, char aCallback[])

dword ChkStart_InconsistentDlc(dword aMessageId, char aCallback[])

As constructor TestCheck::CreateInconsistentDLC(Message aMessage, char [] aCallback)


function
TestCheck::StartInconsistentDLC(Message aMessage, char [] aCallback)

TestCheck::CreateInconsistentDlc(dword aMessageId, char aCallback[])

TestCheck::StartInconsistentDlc(dword aMessageId, char aCallback[])

TestCheck::CreateInconsistentDlc (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask, char[] aCallback)

TestCheck::StartInconsistentDlc (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask, char[] aCallback)

TestCheck::CreateInconsistentDlc (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask)

TestCheck::StartInconsistentDlc (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask)

Check name | DLC Monitoring check |

Function Checks the DLC, respectively the payload length of a message.

The check condition is violated if the DLC of the message does not agree with the
specified DLC of the database.
Can only be started in the "on start" area of CAPL or during the measurement. However,
the check may be set up as early as in the "pre start" area.

The numeric functions/constructors with the parameter 'aMessageId' cannot be used for
FlexRay. Instead use the numeric constructors with the parameter 'slotID' (that can only
be applied to a FlexRay bus).

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aMessage

Must exist in the database.

aCallback

This parameter must be specified in simulation nodes; it is optional in test modules.

aMessageId

message ID to be observed. The corresponding message shall be defined in the


database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_InconsistentDLC, ChkStart_InconsistentDLC

slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

Return values 0: Check could not be created and may not be referenced.

CheckId [dword]
> 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.

Possible errors Specified message object does not exist in the database.

CAPL Callback does not exist.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2: extended CAN, FlexRay — •

Example
// checks the DLC of the message
checkId = ChkStart_InconsistentDlc (MsgToObserve);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_InconsistentRxDLC, ChkStart_InconsistentRxDLC

ChkCreate_InconsistentRxDLC, ChkStart_InconsistentRxDLC
CAPL Function Overview » Test Service Library » Checks » ChkCreate_InconsistentRxDLC, ChkStart_InconsistentRxDLC

Syntax dword ChkCreate_InconsistentRxDLC(Node aNode, char [] aCallback);

dword ChkStart_InconsistentRxDLC(Node aNode, char [] aCallback);

As constructor TestCheck::CreateInconsistentRxDLC(Node aNode, char [] aCallback);


function
TestCheck::StartInconsistentRxDLC(Node aNode, char [] aCallback);

Check name | DLC Monitoring check |

Function Checks the DLC of all Rx messages of a node.

The check condition is violated if the DLC of the message does not agree with the DLC
specified in the database.
Can only be started in the "on start" area of CAPL or during the measurement.
However, the check may be set up as early as in the "pre start" area.

Parameters aNode

Must exist in the database.

aCallback

This parameter must be specified in simulation nodes; it is optional in test modules.

Return values 0: Check could not be created and may not be referenced.

CheckId [dword] > 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.

Possible errors Specified node object does not exist in the database.

CAPL Callback does not exist.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2: extended CAN, FlexRay — •

Example
// checks the DLC of all Rx messages of the node
checkId = ChkStart_InconsistentRxDlc (NodeToObserve);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_InconsistentTxDLC, ChkStart_InconsistentTxDLC

ChkCreate_InconsistentTxDLC, ChkStart_InconsistentTxDLC
CAPL Function Overview » Test Service Library » Checks » ChkCreate_InconsistentTxDLC, ChkStart_InconsistentTxDLC

Syntax dword ChkCreate_InconsistentTxDLC(Node aNode, char [] aCallback);

dword ChkStart_InconsistentTxDLC(Node aNode, char [] aCallback);

As construtor TestCheck::CreateInconsistentTxDLC(Node aNode, char [] aCallback);


function
TestCheck::StartInconsistentTxDLC(Node aNode, char [] aCallback);

Check name | DLC Monitoring check |

Function Checks the DLC of all Tx messages of a node.

The check condition is violated if the DLC of the message does not agree with the DLC
specified in the database.
Can only be started in the "on start" area of CAPL or during the measurement.
However, the check may be set up as early as in the "pre start" area.

Parameters aNode

Must exist in the database.

aCallback

This parameter must be specified in simulation nodes; it is optional in test modules.

Return values 0: Check could not be created and may not be referenced.

> 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.

Possible errors Specified node object does not exist in the database.

CAPL Callback does not exist.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2: extended CAN, FlexRay — •

Example
// checks the DLC of all Tx messages of the node
checkId = ChkStart_InconsistentTxDlc (NodeToObserve);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostCriticalUnlock, ChkStart_MostCriticalUnlock

ChkCreate_MostCriticalUnlock, ChkStart_MostCriticalUnlock
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostCriticalUnlock, ChkStart_MostCriticalUnlock

Syntax dword ChkCreate_MostCriticalUnlock()

dword ChkStart_MostCriticalUnlock()

dword ChkCreate_MostCriticalUnlock(Callback aCallback)

dword ChkStart_MostCriticalUnlock(Callback aCallback)

As constructor TestCheck::CreateMostCriticalUnlock()
function
TestCheck::StartMostCriticalUnlock()

TestCheck::CreateMostCriticalUnlock(Callback aCallback)

TestCheck::StartMostCriticalUnlock(Callback aCallback)

Check name | MOST Light & Lock Observation check |

Function The check function monitors the occurrence of "CriticalUnlock" events.

A "CriticalUnlock" event is generated as soon an unlock occurs after a "Stable Lock"


condition, which is longer than tUnlock (70 ms), or several unlocks occur successively,
which together are longer than tUnlock (see MOST specification for more information).

This check always works on events. Therefore, it will not detect a current
"CriticalUnlock" state, if this state has been entered before the check’s activation.

Parameters aCallback

Name of the callback function, which should be called as soon as a "CriticalUnlock"


event occurs.

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage

ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage

Syntax dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aInstanceId, dword aErrorCode, Callback aCallback)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, char[] aName,


dword aInstanceId, dword aErrorCode, Callback aCallback)

dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aErrorCode, Callback aCallback)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, char[] aName,


dword aErrorCode, Callback aCallback)

dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode, Callback aCallback)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode, Callback aCallback)

dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aInstanceId, dword aErrorCode)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, char[] aName,


dword aInstanceId, dword aErrorCode)

dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aErrorCode)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, char[] aName,


dword aErrorCode)

dword ChkCreate_MostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode)

dword ChkStart_MostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode)

As constructor TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, char[]


function aName, dword aInstanceId, dword aErrorCode, Callback aCallback)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aInstanceId, dword aErrorCode, Callback aCallback)

TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aErrorCode, Callback aCallback)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aErrorCode, Callback aCallback)

TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode, Callback aCallback)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode, Callback aCallback)

TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aInstanceId, dword aErrorCode)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aInstanceId, dword aErrorCode)

TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, char[]

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage

aName, dword aErrorCode)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, char[]


aName, dword aErrorCode)

TestCheck::CreateMostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode)

TestCheck::StartMostErrorMessage(dword aSourceDeviceAddress, dword


aErrorCode)

Check name | MOST Error Messages check |

Function This check can be used to monitor the occurrence of MOST error messages (OpType 0xF
or 0x9).

The check can be implemented for a MOST device address, function block or function.
In addition, monitoring can be limited to error messages with a specific error code.

Parameters aSourceDeviceAddress

Device node address for which the occurrence of error messages is to be monitored,
i.e., only those error messages with a source address equal to the value specified here
are taken into consideration.

Group or broadcast addresses may not be specified here.

aName

Symbolic FBlock or function address for which the occurrence of error messages is to be
monitored. The following formats are allowed (wildcards are not permitted):

• "FBlock.Instance.Function”
• "FBlock.Function"
• "FBlock"

aInstance

The instance of the FBlock specified in aName. If an instance is already specified in


aName, this is overwritten by aInstance.

aErrorCode

The error code that must be set in an observed error message in order for a check
violation to be triggered.

If 0 is specified, all error messages are monitored regardless of their error codes.

aCallback

Name of the callback function to be called when an error message with the specified
criteria occurs.

Return values 0: Check was not created and may not be referenced.

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage

Possible errors CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostLightOff, ChkStart_MostLightOff

ChkCreate_MostLightOff, ChkStart_MostLightOff
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostLightOff, ChkStart_MostLightOff

Syntax dword ChkCreate_MostLightOff()

dword ChkStart_MostLightOff()

dword ChkCreate_MostLightOff(Callback aCallback)

dword ChkStart_MostLightOff(Callback aCallback)

As constructor TestCheck::CreateMostLightOff()
function
TestCheck::StartMostLightOff()

TestCheck::CreateMostLightOff(Callback aCallback)

TestCheck::StartMostLightOff(Callback aCallback)

Check name | MOST Light & Lock Observation check |

Function The check function monitors the occurrence of "LightOff" events.

A "LightOff" event occurs if the hardware connected to the channel no longer receives
light at the input.

Parameters aCallback

Name of the callback function, which should be called as soon as a "LightOff" event
occurs.

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostMethodProtocolError, ChkStart_MostMethodProtocolError

ChkCreate_MostMethodProtocolError,
ChkStart_MostMethodProtocolError
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostMethodProtocolError, ChkStart_MostMethodProtocolError

Syntax dword ChkCreate_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

dword ChkStart_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

dword ChkCreate_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

dword ChkStart_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

dword ChkCreate_MostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

dword ChkStart_MostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

dword ChkCreate_MostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

dword ChkStart_MostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

dword ChkCreate_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration, Callback aCallback)

dword ChkStart_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration, Callback aCallback)

dword ChkCreate_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration)

dword ChkStart_MostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration)

dword ChkCreate_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration, Callback aCallback)

dword ChkStart_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration, Callback aCallback)

dword ChkCreate_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration)

dword ChkStart_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration)

As constructor TestCheck::CreateMostMethodProtocolError(char aMethod[], long


function aInstanceID, dword aTimeoutWaitForProcessing1, dword
aTimeoutWaitForProcessing2, dword aTimeoutMaxDuration, Callback
aCallback)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostMethodProtocolError, ChkStart_MostMethodProtocolError

TestCheck::StartMostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

TestCheck::CreateMostMethodProtocolError(char aMethod[], long


aInstanceID, dword aTimeoutWaitForProcessing1, dword
aTimeoutWaitForProcessing2, dword aTimeoutMaxDuration)

TestCheck::StartMostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

TestCheck::CreateMostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

TestCheck::StartMostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration, Callback aCallback)

TestCheck::CreateMostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

TestCheck::StartMostMethodProtocolError(char aMethod[], dword


aTimeoutWaitForProcessing1, dword aTimeoutWaitForProcessing2, dword
aTimeoutMaxDuration)

TestCheck::CreateMostMethodProtocolError(char aMethod[], long


aInstanceID, dword aTimeoutMaxDuration, Callback aCallback)

TestCheck::StartMostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration, Callback aCallback)

TestCheck::CreateMostMethodProtocolError(char aMethod[], long


aInstanceID, dword aTimeoutMaxDuration)

TestCheck::StartMostMethodProtocolError(char aMethod[], long aInstanceID,


dword aTimeoutMaxDuration)

TestCheck::Create_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration, Callback aCallback)

TestCheck::Start_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration, Callback aCallback)

TestCheck::Create_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration)

TestCheck::Start_MostMethodProtocolError(char aMethod[], dword


aTimeoutMaxDuration)

Check name | MOST Method Protocol Observation check |

Function This check monitors MOST protocol compliance for a given method supporting the
optypes "StartResult" or "StartResultAck". This includes monitoring of the messages
sequences and timeout conditions on answer times and send intervals.

Parameters aMethod

Name of the method to be monitored in one of the following formats:

• FBlock.InstanceID.Function
• FBlock.Function

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostMethodProtocolError, ChkStart_MostMethodProtocolError

aInstanceID

InstanceID of the method to be monitored.

Since command messages are often addressed to wildcard InstanceID (0x00) it is


recommended to set this parameter to 0x00. The check includes requests/responses
with InstanceIDs from 0x00 to 0xFE then. If a signature without InstanceID parameter is
choosen, 0x00 is applied.

InstanceID=0xFF=All observes requests with InstanceID=0xFF only. In this case it cannot


be checked if all FBlock instances reply, because the number of instances in a device is
not known to the algorithm.

aTimeoutWaitForProcessing1

Timeout to wait for the observation of the first "Processing" or "ProcessingAck"


message. The unit can be set with ChkConfig_SetPrecision.

Signatures that do not provide this parameter, assume the maximum value of 250 ms
given for tWaitForProcessing1 in the MOST specification.

aTimeoutWaitForProcessing2

Timeout to wait for the following Processing messages. The unit can be set with
ChkConfig_SetPrecision.

Signatures that do not provide this parameter, assume the typical value of 200 ms given
for tWaitForProcessing2 in the MOST specification.

aTimeoutMaxDuration

Maximum response time for the observed method to return a "Result"/ "Resul-tAck" or
"Error"/ "ErrorAck" message. The unit can be set with ChkConfig_SetPrecision.

aCallback

Name of the callback function, which should be called as soon as a protocol violation is
detected.

In simulation nodes this parameter has to be set. In test modules this parameter is
optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Check-specific ChkQuery_NumRequests
queries
ChkQuery_NumTimedoutRequests

ChkQuery_RequestDstAdr

ChkQuery_RequestFBlockId

ChkQuery_RequestFunctionId

ChkQuery_RequestInstId

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostMethodProtocolError, ChkStart_MostMethodProtocolError

ChkQuery_RequestOpType

ChkQuery_RequestSrcAdr

ChkQuery_RequestTimestamp

ChkQuery_StatAvResponseTime

ChkQuery_StatMaxValidResponseTime

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostNetState, ChkStart_MostNetState

ChkCreate_MostNetState, ChkStart_MostNetState
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostNetState, ChkStart_MostNetState

Syntax dword ChkCreate_MostNetState(long aOldState, long aNewState)

dword ChkStart_MostNetState(long aOldState, long aNewState)

dword ChkCreate_MostNetState(long aOldState, long aNewState, Callback


aCallback)

dword ChkStart_MostNetState(long aOldState, long aNewState, Callback


aCallback)

As constructor TestCheck::CreateMostNetState(long aOldState, long aNewState)


function
TestCheck::StartMostNetState(long aOldState, long aNewState)

TestCheck::CreateMostNetState(long aOldState, long aNewState, Callback


aCallback)

TestCheck::StartMostNetState(long aOldState, long aNewState, Callback


aCallback)

Check name | MOST NetState Observation check |

Function This check is used to monitor the NetState state of the MOST hardware interface.

Concrete checks can be implemented for any NetState state changes, and are triggered
when a NetState event having the corresponding target state occurs with a specified
initial state.

The wildcard value –1 can be specified for one of the netstate parameters, if the check
should monitor only the beginning or ending of a netstate. Both parameters can be set
to wildcard value, if the check should detect any occurring netstate change.

This check always works on events. Therefore, it will not detect a current netstate that
has been established before the time of the check’s activation, as a new netstate.

Parameters aCallback

Name of the callback function that is to be called when a specified state change
occurs. This parameter must be set for simulation nodes; it is optional for test modules.

aOldState

Initial state of the state change to be monitored. Possible values are:

0 MostNetState_Undefined

2 MostNetState_PowerOff

3 MostNetState_NetInterfaceInit

4 MostNetState_ConfigNotOk

5 MostNetState_ConfigOk

-1 Wildcard value (any state is matched)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostNetState, ChkStart_MostNetState

aNewState

Target state of the state change to be monitored. Possible values the same as those for
aOldState.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist.

Invalid value specified for aOldState or aNewState.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError

ChkCreate_MostPropertyProtocolError,
ChkStart_MostPropertyProtocolError
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError

Syntax dword ChkCreate_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout, Callback aCallback)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout, Callback aCallback)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout, Callback aCallback)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout, Callback aCallback)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, Callback aCallback)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, Callback aCallback)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, Callback


aCallback)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, Callback


aCallback)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty, int


aInstanceID)

dword ChkStart_MostPropertyProtocolError(char[] aProperty, int


aInstanceID)

dword ChkCreate_MostPropertyProtocolError(char[] aProperty)

dword ChkStart_MostPropertyProtocolError(char[] aProperty)

As constructor TestCheck::CreateMostPropertyProtocolError(char[] aProperty, int


function aInstanceID, unsigned long aAnswerTimeout, Callback aCallback)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout, Callback aCallback)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, unsigned


long aAnswerTimeout, Callback aCallback)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout, Callback aCallback)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, int

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError

aInstanceID, Callback aCallback)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, int


aInstanceID, Callback aCallback)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, Callback


aCallback)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, Callback


aCallback)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, int


aInstanceID, unsigned long aAnswerTimeout)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, unsigned


long aAnswerTimeout)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, unsigned long


aAnswerTimeout

TestCheck::CreateMostPropertyProtocolError(char[] aProperty, int


aInstanceID)

TestCheck::StartMostPropertyProtocolError(char[] aProperty, int


aInstanceID)

TestCheck::CreateMostPropertyProtocolError(char[] aProperty)

TestCheck::StartMostPropertyProtocolError(char[] aProperty)

Check name | MOST Property Protocol Observation check |

Function This check monitors MOST protocol compliance for a given property. This includes
monitoring the response times along with the allowable message sequences.

Parameters aProperty

Name of the property to be monitored in one of the following formats:

• FBlock.InstanceId.Function
• FBlock.Function

aInstanceID

InstanceID of the property to be monitored

aAnswerTimeout

Maximum response time [ms], within which a response message for a request message
is expected. Signatures that these parameters do not provide, assume the minimum
standard value tWaitForProperty = 250 ms as response time (see MOST specification
2.4).

aCallback

Name of the callback function, which should be called as soon as a protocol violation is
detected.

In simulation nodes this parameter has to be set.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError

In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Check-specific ChkQuery_NumRequests
queries
ChkQuery_NumTimedoutRequests

ChkQuery_RequestDstAdr

ChkQuery_RequestFBlockId

ChkQuery_RequestFunctionId

ChkQuery_RequestInstId

ChkQuery_RequestOpType

ChkQuery_RequestSrcAdr

ChkQuery_RequestTimestamp

ChkQuery_StatAvResponseTime

ChkQuery_StatMaxValidResponseTime

ChkQuery_StatMinResponseTime

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostShortUnlock, ChkStart_MostShortUnlock

ChkCreate_MostShortUnlock, ChkStart_MostShortUnlock
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostShortUnlock, ChkStart_MostShortUnlock

Syntax dword ChkCreate_MostShortUnlock()

dword ChkStart_MostShortUnlock()

dword ChkCreate_MostShortUnlock(Callback aCallback)

dword ChkStart_MostShortUnlock(Callback aCallback)

As cunstructor TestCheck::CreateMostShortUnlock()
function
TestCheck::StartMostShortUnlock()

TestCheck::CreateMostShortUnlock(Callback aCallback)

TestCheck::StartMostShortUnlock(Callback aCallback)

Check name | MOST Light & Lock Observation check |

Function The check function monitors the occurrence of "ShortUnlock" events.

A "ShortUnlock" event occurs if there is no interpretable signal for a brief moment on


the input of the connected MOST hardware (< tUnlock, see also MOST specification) and
the ring has been in a Light&Lock state before.

This check always works on events. Therefore, it will not detect a current "ShortUnlock"
state, if this state has been entered before the check’s activation.

Parameters aCallback

Name of the callback function, which should be called as soon as a "LightOff" event
occurs.

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MostStableLock, ChkStart_MostStableLock

ChkCreate_MostStableLock, ChkStart_MostStableLock
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MostStableLock, ChkStart_MostStableLock

Syntax dword ChkCreate_MostStableLock(Callback aCallback)

dword ChkStart_MostStableLock(Callback aCallback)

As constructor TestCheck::CreateMostStableLock(Callback aCallback)


function
TestCheck::StartMostStableLock(Callback aCallback)

Check name | MOST Light & Lock Observation check |

Function The check function monitors the occurrence of "StableLock" events.

A "StableLock" event is generated as soon as the hardware has been in the "Lock"
condition for a period of time equal to or longer than tLock (see MOST Specification V
2.4), provided that no "Unlock" events have occurred.

This check always works on events. Therefore, it will not detect a current "StableLock"
state, if this state has been entered before the check’s activation.

Parameters aCallback

Name of the callback function, which should be called as soon as a "StableLock" event
occurs.

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgAbsCycleTimeViolation, ChkStart_MsgAbsCycleTimeViolation

ChkCreate_MsgAbsCycleTimeViolation,
ChkStart_MsgAbsCycleTimeViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgAbsCycleTimeViolation, ChkStart_MsgAbsCycleTimeViolation

Syntax dword ChkCreate_MsgAbsCycleTimeViolation (Message aObservedMessage,


duration aMinCycleTime, duration aMaxCycleTime, char[] aCallback)

dword ChkStart_MsgAbsCycleTimeViolation (Message aObservedMessage,


duration aMinCycleTime, duration aMaxCycleTime, char[] aCallback)

As constructor TestCheck::CreateMsgAbsCycleTimeViolation (Message aObservedMessage,


function duration aMinCycleTime, duration aMaxCycleTime, char[] aCallback)

TestCheck::StartMsgAbsCycleTimeViolation (Message aObservedMessage,


duration aMinCycleTime, duration aMaxCycleTime, char[] aCallback)

TestCheck::CreateMsgAbsCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, duration aMinAbsCycleTime, duration
aMaxAbsCycleTime, char[] aCallback)

TestCheck::StartMsgAbsCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, duration aMinAbsCycleTime, duration
aMaxAbsCycleTime, char[] aCallback)

TestCheck::CreateMsgAbsCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, duration aMinAbsCycleTime, duration
aMaxAbsCycleTime)

TestCheck::StartMsgAbsCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, duration aMinAbsCycleTime, duration
aMaxAbsCycleTime)

Check name | Cycle Time check |

Function Checks the occurrences of cyclic messages.

Event is generated if the time between sends of the message is smaller than
aMinCycleTime or larger than aMaxCycleTime.

Not to be checked limits are set to 0; there must be at least on limit specified.

Can be started only in the 'on start' section of CAPL or during measurement.

The numeric constructors with the parameter 'slotID' can only be applied to a FlexRay
bus.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aObservedMessage

Must exist in DB

aMinCycleTime

0: Limit is not checked


0 < x < aMaxCycleTime: Limit is checked

Default unit [ms], if not changed with ChkConfig_SetPrecision.

aMaxCycleTime

0: Limit is not checked

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgAbsCycleTimeViolation, ChkStart_MsgAbsCycleTimeViolation

aMinCycleTime < x < ∞: Limit is checked

Default unit [ms], if not changed with ChkConfig_SetPrecision.

aCallback

In simulation nodes this parameter has to be set.

In test modules this parameter is optional.

slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors Message object does not exist in DB

Both relative limits are 0

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
errors
ChkQuery_EventMessageId

ChkQuery_EventMessageName

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgAbsCycleTimeViolation, ChkStart_MsgAbsCycleTimeViolation

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the cycle time of the message
checkId = ChkStart_MsgAbsCycleTimeViolation (MsgToObserve, 90, 110);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation

ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation

Syntax dword ChkCreate_MsgDistViolation (Message aReferenceMessage, Message


aObservedMessage, duration aMinDistance, duration aMaxDistance, Callback
aCallback)

dword ChkStart_MsgDistViolation (Message aReferenceMessage, Message


aObservedMessage, duration aMinDistance, duration aMaxDistance, Callback
aCallback)

dword ChkCreate_MsgDistViolation (Message aReferenceMessage, char


aReferenceBus[], Message aObservedMessage, char aObservedBus[], duration
aMinDistance, duration aMaxDistance, Callback aCallback)

dword ChkStart_MsgDistViolation (Message aReferenceMessage, char


aReferenceBus[], Message aObservedMessage, char aObservedBus[], duration
aMinDistance, duration aMaxDistance, Callback aCallback)

As constructor TestCheck::CreateMsgDistViolation (Message aReferenceMessage, Message


function aObservedMessage, duration aMinDistance, duration aMaxDistance, Callback
aCallback)

TestCheck::StartMsgDistViolation (Message aReferenceMessage, Message


aObservedMessage, duration aMinDistance, duration aMaxDistance, Callback
aCallback)

TestCheck::CreateMsgDistViolation (Message aReferenceMessage, char


aReferenceBus[], Message aObservedMessage, char aObservedBus[], duration
aMinDistance, duration aMaxDistance, Callback aCallback)

TestCheck::StartMsgDistViolation (Message aReferenceMessage, char


aReferenceBus[], Message aObservedMessage, char aObservedBus[], duration
aMinDistance, duration aMaxDistance, Callback aCallback)

TestCheck::CreateMsgDistViolation (dword slotID1, dword cycleOffs1, dword


cycleRep1, dword channelMask1, dword slotID2, dword cycleOffs2, dword
cycleRep2, dword channelMask2, duration aMinDistance, duration
aMaxDistance)

Check name | Message Distance check |

Function Event is generated if the time interval that starts on receipt of the reference message
and ends with the receipt of the observed message is smaller than aMinDistance or is
larger than aMaxDistance.

The numeric constructors with the parameter 'slotID1/2' can only be applied to a
FlexRay bus.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aReferenceMessage

Must exist in DB

aObservedMessage

Must exist in DB

aMinDistance

Default unit [ms], if not changed with ChkConfig_SetPrecision.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation

aMinDistance < aMaxDistance

aMaxDistance

Default unit [ms], if not changed with ChkConfig_SetPrecision.


aMinDistance < aMaxDistance

aCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional

aReferenceBus

Name of the bus on that should be received the reference message

aObservedBus

Name of the bus that should receive the observed message

slotID1/2

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs1/2

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep1/2

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask1/2

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors Value range(s) exceeded

Any specified message object do not exist in the DB

CAPL callback does not exist

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation

Observed message received without preceding reference message

Message Ids identical for aReferenceMessage and aObservedMessage, if both messages


are expected at the same bus

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the distance between two messages
checkId = ChkStart_MsgDistViolation (ReferenceMsg, MsgToObserve, 90,
110);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount

ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount

Syntax dword ChkCreate_MsgOccurrenceCount(dbMessage aMessage, long aMaxCount);

dword ChkStart_MsgOccurrenceCount(dbMessage aMessage, long aMaxCount);

dword ChkCreate_MsgOccurrenceCount(dword aMessageId, long aMaxCount);

dword ChkStart_MsgOccurrenceCount(dword aMessageId, long aMaxCount);

dword ChkCreate_MsgOccurrenceCount(dword aSourceAdr, dword aDestAdr,


char[] aSymbolicMsg, dword aInstanceId, long aMaxCount)

dword ChkStart_MsgOccurrenceCount(dword aSourceAdr, dword aDestAdr,


char[] aSymbolicMsg, dword aInstanceId, long aMaxCount)

As constructor TestCheck::CreateMsgOccurrenceCount(dbMessage aMessage, long aMaxCount);


function
TestCheck::StartMsgOccurrenceCount(dbMessage aMessage, long aMaxCount);

TestCheck::CreateMsgOccurrenceCount(dword aMessageId, long aMaxCount);

TestCheck::StartMsgOccurrenceCount(dword aMessageId, long aMaxCount);

TestCheck::CreateMsgOccurrenceCount(dword aSourceAdr, dword aDestAdr,


char[] aSymbolicMsg, dword aInstanceId, long aMaxCount)

TestCheck::StartMsgOccurrenceCount(dword aSourceAdr, dword aDestAdr,


char[] aSymbolicMsg, dword aInstanceId, long aMaxCount)

TestCheck::CreateMsgOccurrenceCount (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask, dword aMaxCount)

TestCheck::StartMsgOccurrenceCount (dword slotID, dword cycleOffs, dword


cycleRep, dword channelMask, dword aMaxCount)

TestCheck::CreateMsgOccurrenceCount (Node aNode, dword aMaxCount, char[]


aCaplCallbackFunction)

TestCheck::StartMsgOccurrenceCount (Node aNode, dword aMaxCount, char[]


aCaplCallbackFunction)

TestCheck::CreateMsgOccurrenceCount (Node aNode, dword aMaxCount)

TestCheck::StartMsgOccurrenceCount (Node aNode, dword aMaxCount)

Check name | Absence of Defined Message |

Function Checks the absence of the specified message on the bus. An event is created if more
than aMaxCount of the specified message were sent.

The numeric functions/constructors with the parameter 'aMessageId/aSourceAdr' cannot


be used for FlexRay. Instead use the numeric constructors with the parameter 'slotID'
(that can only be applied to a FlexRay bus).

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aMessage

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount

The message whose occurrence is to be monitored in symbolic form, e.g.: "EngineData".

aMessageId

The ID of the message whose occurrence is to be monitored.

aMaxCount

The maximum number of message that may be sent without the check to fail.

aSourceAdr

The source address of the message whose occurrence is to be monitored.

aDestAdr

The destination address of the message whose occurrence is to be monitored.

aSymbolicMsg

Symbolic message definition of the message which has to be monitored in the format
"FBlock.Function.OpType". Widcards can also be used (e.g. "AudioDiskPlayer.*.Status").

aInstanceId

The instance ID of the message whose occurrence is to be monitored.

slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

aNode

The node from the DB whose TX messages should be observed.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount

aCaplCallbackFunction

This parameter must be specified in simulation nodes; it is optional in test modules.

Return values 0: Check could not be created and may not be referenced.

CheckId [dword]
> 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.

Check-specific ChkQuery_EventMessageId
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 CAN, MOST, FlexRay — •

7.0 SP5: CAN, MOST, FlexRay — •


method

7.2 CAN, MOST, FlexRay — •

Example
// checks that the message is sent less than 3 times
checkId = ChkStart_MsgOccurrenceCount (MsgToObserve, 2);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelCycleTimeViolation, ChkStart_MsgRelCycleTimeViolation

ChkCreate_MsgRelCycleTimeViolation,
ChkStart_MsgRelCycleTimeViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgRelCycleTimeViolation, ChkStart_MsgRelCycleTimeViolation

Syntax dword ChkCreate_MsgRelCycleTimeViolation (Message aObservedMessage,


double aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

dword ChkStart_MsgRelCycleTimeViolation (Message aObservedMessage, double


aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

As constructor TestCheck::CreateMsgRelCycleTimeViolation (Message aObservedMessage,


function double aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

TestCheck::StartMsgRelCycleTimeViolation (Message aObservedMessage,


double aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

TestCheck::CreateMsgRelCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime, Callback aCallback)

TestCheck::StartMsgRelCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime, Callback aCallback)

TestCheck::CreateMsgRelCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime)

TestCheck::StartMsgRelCycleTimeViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime)

Check name | Cycle Time check |

Function Checks the occurrences of cyclic messages.

Event is generated if the time between sends of the message is smaller than
minRelCycleTime * GenMsgCycleTime (DB-attribute) or larger than maxRelCycleTime *
GenMsgCycleTime.

Not to be checked limits are set to 0; there must be at least one limit specified.

Can be started only in the 'on start' section of CAPL or during measurement.

The numeric constructors with the parameter 'slotID' can only be applied to a FlexRay
bus.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aObservedMessage

Must exist in DB

aMinRelCycleTime

0: Limit is not checked


0 < x < 1: Limit is checked

aMaxRelCycleTime

0: Limit is not checked

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelCycleTimeViolation, ChkStart_MsgRelCycleTimeViolation

1 < x < ∞: Limit is checked

aCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors Value range(s) exceeded

Message object does not exist in DB

Message object is not a cyclic message

There are messages specified as cyclic but the cycle time is 0 or not available

Both relative limits are 0

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelCycleTimeViolation, ChkStart_MsgRelCycleTimeViolation

ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the cycle time of the message
checkId = ChkStart_MsgRelCycleTimeViolation (MsgToObserve, 0.9, 1.1);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelOccurrenceViolation, ChkStart_MsgRelOccurrenceViolation

ChkCreate_MsgRelOccurrenceViolation,
ChkStart_MsgRelOccurrenceViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgRelOccurrenceViolation,
ChkStart_MsgRelOccurrenceViolation

Syntax dword ChkCreate_MsgRelOccurrenceViolation(Message observedMsg, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

dword ChkStart_MsgRelOccurrenceViolation(Message observedMsg, double


aMin-RelCycleTime, double aMaxRelCycleTime, char[] aCallback);

dword ChkCreate_MsgRelOccurrenceViolation(dword aMessageId, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback)

dword ChkStart_MsgRelOccurrenceViolation(dword aMessageId, double


aMinRelCycleTime , double aMaxRelCycleTime, char[] aCllback)

As constructor TestCheck::CreateMsgRelOccurrenceViolation(Message observedMsg, double


function aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

TestCheck::StartMsgRelOccurrenceViolation(Message observedMsg, double


aMin-RelCycleTime, double aMaxRelCycleTime, char[] aCallback);

TestCheck::CreateMsgRelOccurrenceViolation(dword aMessageId, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback)

TestCheck::StartMsgRelOccurrenceViolation(dword aMessageId, double


aMinRelCycleTime , double aMaxRelCycleTime, char[] aCllback)

TestCheck::CreateMsgRelOccurrenceViolation (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, double aMinRelCycleTime,
double aMaxRelCycleTime, char[] aCllback)

TestCheck::StartMsgRelOccurrenceViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime, char[] aCllback)

TestCheck::CreateMsgRelOccurrenceViolation (dword slotID, dword


cycleOffs, dword cycleRep, dword channelMask, double aMinRelCycleTime,
double aMaxRelCycleTime)

TestCheck::StartMsgRelOccurrenceViolation (dword slotID, dword cycleOffs,


dword cycleRep, dword channelMask, double aMinRelCycleTime, double
aMaxRelCycleTime)

Check name | Occurrence of a Message check |

Function Checks for the occurrence of a periodic message.

The check condition is violated if the time between transmissions of the message is less
than aMinRelCycleTime * GenMsgDelayTime or greater than aMaxRelCycleTime * Cycle
Time.
Cycle time is calculated from GenMsgCycleTime and GenSigCycleTime.
Limits that should not be checked must be set to 0. At least one limit must be
specified.
Can only be started in the "on start" area of CAPL or during the measurement. However,
the check may be set up as early as in the "pre start" area.

The numeric functions/constructors with the parameter 'aMessageId' cannot be used for
FlexRay. Instead use the numeric constructors with the parameter 'slotID' (that can only
be applied to a FlexRay bus).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelOccurrenceViolation, ChkStart_MsgRelOccurrenceViolation

Parameters observedMessage

Must exist in the database.

aMinRelCycleTime

0: Limit is not checked.

0 < x < 1: Limit is checked.

aMaxRelCycleTime

0: Limit is not checked.

1 < x < ∞: Limit is checked.

aCallback

This parameter must be specified in simulation nodes; it is optional in test modules.

aMessageId

message ID to be observed. The corresponding message shall be defined in the


database.

slotID

This number designates a specific FlexRay slot.

Its value must be between 1 and 2047.

cycleOffs

This number designates the base cycle.

This value must be smaller than the repetition factor and lies in the range between 0
and 63.

This value, together with the repetition factor, determines the "Cycle Multiplexing" of a
FlexRay frame.

cycleRep

This number designates the cycle repetition factor.

The value must be between 1 and 64 and be a multiple of 2 (e.g. 1, 2, 4, 8, 16, 32 or


64).

This value, together with the base cycle, determines the "Cycle Multiplexing" of a
FlexRay frame.

channelMask

Identifies the FlexRay channel of the communication controller. A value of 1 will check
the frame on channel A, 2 will check it on channel B and 3 on any channel (A/B).

Return values 0: Check could not be created and may not be referenced.

CheckId [dword] > 0: Check was created successfully and can be referenced by the returned (Handle)
value.

Possible errors Value(s) outside of value range(s).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgRelOccurrenceViolation, ChkStart_MsgRelOccurrenceViolation

Specified message object does not exist in the database.

Message object is not a periodic message.

Messages were specified as periodic, but their cycle time is either 0 or unavailable.

Both relative limits are 0.

CAPL Callback does not exist.

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageNam

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the periodic occurrence of the message
checkId = ChkStart_MsgRelOccurrenceViolation (MsgToObserve, 0.9, 1.1);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid

ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid

Syntax dword ChkCreate_MsgSignalValueInvalid (dbSignal aObservedSignal, double


aMinValue, double aMaxValue, Callback aCallback)

dword ChkStart_MsgSignalValueInvalid (dbSignal aObservedSignal, double


aMinValue, double aMaxValue, Callback aCallback)

dword ChkCreate_MsgSignalValueInvalid (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

dword ChkStart_MsgSignalValueInvalid (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

dword ChkCreate_MsgSignalValueInvalid (EnvVarName, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 6.0)

dword ChkStart_MsgSignalValueInvalid (EnvVarName, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 6.0)

dword ChkCreate_MsgSignalValueInvalid (sysVar aSysVar, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 7.2 SP3)

dword ChkStart_MsgSignalValueInvalid (sysVar aSysVar, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 7.2 SP3)

As constructor TestCheck::CreateMsgSignalValueInvalid (dbSignal aObservedSignal, double


function aMinValue, double aMaxValue, Callback aCallback)

TestCheck::StartMsgSignalValueInvalid (dbSignal aObservedSignal, double


aMinValue, double aMaxValue, Callback aCallback)

TestCheck::CreateMsgSignalValueInvalid (char aMessageName[], char


aSignalNamel[], double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::StartMsgSignalValueInvalid (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::CreateMsgSignalValueInvalid (EnvVarName, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 6.0)

TestCheck::StartMsgSignalValueInvalid (EnvVarName, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 6.0)

TestCheck::CreateMsgSignalValueInvalid (sysVar aSysVar, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 7.2 SP3)

TestCheck::StartMsgSignalValueInvalid (sysVar aSysVar, double aMinValue,


double aMaxValue, Callback aCallback) (available with CANoe 7.2 SP3)

Check name | Signal Value check |

Function Check the value of a signal, of an environment variable or a system variable. The value
should be outside the given value range (inclusive the limits).

An event will be generated, if the value of the physical signal, the environment
variable or the system variable is inside the given value range.

Parameters aObservedSignal

Name of the Signal to be checked.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid

Must exist in DB.

aMessageName

Name of the message of which the signal should be observed.


Must exist in DB.

aSignalName

Name of the Signal to be checked.


Must exist in the DB and mus be mapped to aMessageName.

EnvVarName

Environment variable to be checked.

aSysVar

System variable to be checked.

aMinValue

aMinValue <= aMaxValue

aMaxValue

aMinValue <= aMaxValue

aCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors Value range(s) exceeded

Message does not exist in the DB

Signal is not mapped to message

CAPL callback does not exist

Check-specific ChkQuery_EventMessageId
queries
ChkQuery_EventMessageName

ChkQuery_EventSignalValue

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

6.0, 6.1 SP3, 7.2 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid

SP3

7.0 SP5: method — — •

Example
// checks the value of the signal (should be outside the given range)
checkId = ChkStart_MsgSignalValueInvalid (SignalToObserve, 2.5, 3.7);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueRangeViolation, ChkStart_MsgSignalValueRangeViolation

ChkCreate_MsgSignalValueRangeViolation,
ChkStart_MsgSignalValueRangeViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_MsgSignalValueRangeViolation,
ChkStart_MsgSignalValueRangeViolation

Syntax dword ChkCreate_MsgSignalValueRangeViolation (dbSignal aObservedSignal,


double aMinValue, double aMaxValue, Callback aCallback)

dword ChkStart_MsgSignalValueRangeViolation (dbSignal aObservedSignal,


double aMinValue, double aMaxValue, Callback aCallback)

dword ChkCreate_MsgSignalValueRangeViolation (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

dword ChkStart_MsgSignalValueRangeViolation (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

dword ChkCreate_MsgSignalValueRangeViolation (EnvVarName, double


aMinValue, double aMaxValue, Callback aCallback) (available with CANoe
6.0)

dword ChkStart_MsgSignalValueRangeViolation (EnvVarName, double


aMinValue, double aMaxValue, Callback aCall-back) (available with CANoe
6.0)

dword ChkCreate_MsgSignalValueRangeViolation (sysVar aSysVar, double


aMinValue, double aMaxValue, Callback aCallback) (available with CANoe
7.2 SP3)

dword ChkStart_MsgSignalValueRangeViolation (sysVar aSysVar, double


aMinValue, double aMaxValue, Callback aCall-back) (available with CANoe
7.2 SP3)

As constructor TestCheck::CreateMsgSignalValueRangeViolation (dbSignal aObservedSignal,


function double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::StartMsgSignalValueRangeViolation (dbSignal aObservedSignal,


double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::CreateMsgSignalValueRangeViolation (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::StartMsgSignalValueRangeViolation (char aMessageName[], char


aSignalName[], double aMinValue, double aMaxValue, Callback aCallback)

TestCheck::CreateMsgSignalValueRangeViolation (EnvVarName, double


aMinValue, double aMaxValue, Callback aCallback) (available with CANoe
6.0)

TestCheck::StartMsgSignalValueRangeViolation (EnvVarName, double


aMinValue, double aMaxValue, Callback aCall-back) (available with CANoe
6.0)

TestCheck::CreateMsgSignalValueRangeViolation (sysVar aSysVar, double


aMinValue, double aMaxValue, Callback aCallback) (available with CANoe
7.2 SP3)

TestCheck::StartMsgSignalValueRangeViolation (sysVar aSysVar, double


aMinValue, double aMaxValue, Callback aCall-back) (available with CANoe
7.2 SP3)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueRangeViolation, ChkStart_MsgSignalValueRangeViolation

Check name | Signal Value check |

Function Checks the value of a signal, an environment variable or a system variable. The value
should be inside the given value range (inclusive the limits).

An event will be generated, if the value of physical signal, the environment variable or
the system variable is outside the given value range.

Parameters aObservedSignal

Name of the Signal to be checked.


Must exist in DB.

aMessageName

Name of the message of which the signal should be observed.


Must exist in DB.

aSignalName

Name of the Signal to be checked.


Must exist in the DB and mus be mapped to aMessageName.

EnvVarName

Environment variable to be checked.

aSysVar

System variable to be checked.

aMinValue

aMinValue <= aMaxValue

aMaxValue

aMinValue <= aMaxValue

aCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Value range(s) exceeded

Message does not exist in the DB

Signal is not mapped to message

CAPL callback does not exist

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_MsgSignalValueRangeViolation, ChkStart_MsgSignalValueRangeViolation

Check-specific ChkQuery_EventMessageId
queries
ChkQuery_EventMessageName

ChkQuery_EventSignalValue

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

6.0, 6.1 SP3, 7.2 — — •


SP3

7.0 SP5: method — — •

Example
// checks the value of the signal (should be inside the given range)
checkId = ChkStart_MsgSignalValueRangeViolation (SignalToObserve, 2.5,
3.7);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeBabbling, ChkStart_NodeBabbling

ChkCreate_NodeBabbling, ChkStart_NodeBabbling
CAPL Function Overview » Test Service Library » Checks » ChkCreate_NodeBabbling, ChkStart_NodeBabbling

Syntax dword ChkCreate_NodeBabbling (Node n, Duration aMinQuietTime, char []


CaplCallback)

dword ChkStart_NodeBabbling (Node n, Duration aMinQuietTime, char []


CaplCallback)

As constructor TestCheck::CreateNodeBabbling (Node n, Duration aMinQuietTime, char []


function CaplCallback)

TestCheck::StartNodeBabbling (Node n, Duration aMinQuietTime, char []


CaplCallback)

Check name | Node Inactive check |

Function This check supervises the end of a communication: There is a time interval where node-
transmissions are tolerated. After the interval has been passed, the node may no longer
send messages. From now on, each transmission of the node is reported.

If the min. quiet time is 0, then each message sent by the node leads to the event.

Use Cases:
Supervise the transition of nodes’ or busses’ state to 'sleep active'.

Gateway nodes require that the bus context corresponds to the bus that is being
observed. This means that the check only works correctly if the current bus context
corresponds to the database in which the node is defined.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters n

Must exist in DB

aMinQuietTime

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

ChkQuery_EventMessageName

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeBabbling, ChkStart_NodeBabbling

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks that after 300 ms no transmission of the node is available
checkId = ChkStart_NodeBabbling(NodeToObserve, 300);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeDead, ChkStart_NodeDead

ChkCreate_NodeDead, ChkStart_NodeDead
CAPL Function Overview » Test Service Library » Checks » ChkCreate_NodeDead, ChkStart_NodeDead

Syntax dword ChkCreate_NodeDead (Node n, Duration aMaxQuietTime, char []


CaplCallback)

dword ChkStart_NodeDead (Node n, Duration aMaxQuietTime, char []


CaplCallback)

As constructor TestCheck::CreateNodeDead (Node n, Duration aMaxQuietTime, char []


function CaplCallback)

TestCheck::StartNodeDead (Node n, Duration aMaxQuietTime, char []


CaplCallback)

Check name | Node Active check |

Function All monitored nodes must send at least one of their Tx messages within a specified
interval. Otherwise an event will be triggered.

Gateway nodes require that the bus context corresponds to the bus that is being
observed. This means that the check only works correctly if the current bus context
corresponds to the database in which the node is defined.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters n

Must exist in DB

aMaxQuietTime

Upper limit of time interval.

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Check-specific ChkQuery_EventInterval
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeDead, ChkStart_NodeDead

Example
// checks that at least one message of the node is sent in each 100 ms
checkId = ChkStart_NodeDead (100);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsAbsDistViolation, ChkStart_ NodeMsgsAbsDistViolation

ChkCreate_NodeMsgsAbsDistViolation, ChkStart_
NodeMsgsAbsDistViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_NodeMsgsAbsDistViolation, ChkStart_ NodeMsgsAbsDistViolation

Syntax dword ChkCreate_NodeMsgsAbsDistViolation (Node aNode, Duration aMinTime,


long aViolationsMaxCount, Duration aRatingPeriod)

dword ChkStart_NodeMsgsAbsDistViolation (Node aNode, Duration aMinTime,


long aViolationsMaxCount, Duration aRatingPeriod)

dword ChkCreate_NodeMsgsAbsDistViolation (Node aNode, Duration aMinTime)

dword ChkStart_NodeMsgsAbsDistViolation (Node aNode, Duration aMinTime)

As constructor TestCheck::CreateNodeMsgsAbsDistViolation (Node aNode, Duration aMinTime,


function long aViolationsMaxCount, Duration aRatingPeriod)

TestCheck::StartNodeMsgsAbsDistViolation (Node aNode, Duration aMinTime,


long aViolationsMaxCount, Duration aRatingPeriod)

TestCheck::CreateNodeMsgsAbsDistViolation (Node aNode, Duration aMinTime)

TestCheck::StartNodeMsgsAbsDistViolation (Node aNode, Duration aMinTime)

Check name | Occurrence Distance check |

Function This check allows the supervision of the minimum send distance of all Tx-messages of a
node on one bus.

If no rating period and maximal number of distance undercuts is specified, the check
condition fails if the time interval between two messages of the node undercuts the
MinTime.

If the rating period and the maximal number of distance undercuts (> 0) are specified,
the check observes the number of distance undercuts in a time slot. Exceeds the
number of distance undercuts the allowed number in a time slot, the check fails.

Parameters aNode

Must exist in DB. For Gateways the node name has to be prefixed by the bus name.

aMinTime

Minimum send distance of all Tx-messages of the node.

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

aViolationsMaxCount

The number of allowed distance undercuts.

aRatingPeriod

Duration of the time slot, in which the maximal allowed number of distance undercuts
is checked.

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsAbsDistViolation, ChkStart_ NodeMsgsAbsDistViolation

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP3 CAN — •

Example
// checks the send distance between all Tx messages of the node
checkId = ChkStart_NodeMsgsAbsDistViolation(NodeToObserve, 30, 2, 40);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsRelCycleTimeViolation, ChkStart_NodeMsgsRelCycleTimeViolation

ChkCreate_NodeMsgsRelCycleTimeViolation,
ChkStart_NodeMsgsRelCycleTimeViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_NodeMsgsRelCycleTimeViolation,
ChkStart_NodeMsgsRelCycleTimeViolation

Syntax dword ChkCreate_NodeMsgsRelCycleTimeViolation (Node aNode, double


aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

dword ChkStart_NodeMsgsRelCycleTimeViolation (Node aNode, double


aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

As constructor TestCheck::CreateNodeMsgsRelCycleTimeViolation (Node aNode, double


function aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

TestCheck::StartNodeMsgsRelCycleTimeViolation (Node aNode, double


aMinRelCycleTime, double aMaxRelCycleTime, Callback aCallback)

Check name | Cycle Time check |

Function Checks the occurrences of cyclic messages of the given send node.

Event is generated if the time between sends of the (same) message is smaller than
minRelCycleTime * GenMsgCycleTime (DB-attribute) or larger than maxRelCycleTime *
GenMsgCycleTime.

Not to be checked limits are set to 0; there must be at least on limit specified.

Not checked are send messages with a specified cycle time equal to 0 or network
management messages or diagnostic messages.

Can be started only in the start-section of CAPL or during measurement.

For FlexRay only valid data frames and PDUs are recognized as communication, Null
frames and Erroneous frames are ignored.

Parameters aNode

Must exist in DB

aMinRelCycleTime

0: Limit is not checked


0 < x < 1: Limit is checked

aMaxRelCycleTime

0: Limit is not checked


1 < x < ∞: Limit is checked

aCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsRelCycleTimeViolation, ChkStart_NodeMsgsRelCycleTimeViolation

Possible errors Value range(s) exceeded

Node object does not exist in the DB

There are no cyclic messages in the specified node

There are messages specified as cyclic but the cycle time is 0 or not available

Both relative limits are 0

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the cycle time of all messages of the node
checkId = ChkStart_NodeMsgsRelCycleTimeViolation (NodeToObserve, 0.9,
1.1);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsRelOccurrenceViolation, ChkStart_NodeMsgsRelOccurrenceViolation

ChkCreate_NodeMsgsRelOccurrenceViolation,
ChkStart_NodeMsgsRelOccurrenceViolation
CAPL Function Overview » Test Service Library » Checks » ChkCreate_NodeMsgsRelOccurrenceViolation,
ChkStart_NodeMsgsRelOccurrenceViolation

Syntax dword ChkCreate_NodeMsgsRelOccurrenceViolation(Node observedNode, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

dword ChkStart_NodeMsgsRelOccurrenceViolation(Node observedNode, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

As constructor TestCheck::CreateNodeMsgsRelOccurrenceViolation(Node observedNode, double


function aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

TestCheck::StartNodeMsgsRelOccurrenceViolation(Node observedNode, double


aMinRelCycleTime, double aMaxRelCycleTime, char[] aCallback);

Check name | Occurrence of a Message check |

Function Checks for the occurrence of periodic message of the specified send node.
The check condition is violated if the time between transmissions of the message is less
than aMinRelCycleTime * GenMsgDelayTime or greater than aMaxRelCycleTime * Cycle
Time.
Cycle time is calculated from GenMsgCycleTime and GenSigCycleTime.
Limits that should not be checked must be set to 0. At least one limit must be
specified.
Can only be started in the "on start" area of CAPL or during the measurement. However,
the check may be set up as early as in the "pre start" area.

Parameters observedNode

Must exist in the database.

aminRelCycleTime

0: Limit is not checked.

0 < x < 1: Limit is checked.

aMaxRelCycleTime

0: Limit is not checked.

1 < x < ∞: Limit is checked.

aCallback

This parameter must be specified in simulation nodes; it is optional in test modules.

Return values 0: Check could not be created and may not be referenced.

CheckId [dword] > 0: Check was created successfully and can be referenced with the help of the
returned (Handle) value.

Possible errors Value(s) outside of value range(s).

Specified node object does not exist in the database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_NodeMsgsRelOccurrenceViolation, ChkStart_NodeMsgsRelOccurrenceViolation

No periodic messages exist in the specified node.

Messages were specified as cyclic, but their cycle times are either 0 or unavailable.

Both relative limits are 0.

CAPL Callback does not exist.

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// checks the periodic occurrence of all messages of the node
checkId = ChkStart_NodeMsgsRelOccurrenceViolation (NodeToObserve, 0.9,
1.1);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_SignalValueChange, ChkStart_SignalValueChange

ChkCreate_SignalValueChange, ChkStart_SignalValueChange
CAPL Function Overview » Test Service Library » Checks » ChkCreate_SignalValueChange, ChkStart_SignalValueChange

Syntax dword ChkCreate_SignalValueChange (Signal aObservedSignal, char []


CaplCallback)

dword ChkStart_SignalValueChange (Signal aObservedSignal, char []


CaplCallback)

dword ChkCreate_SignalValueChange (EnvVarName, char [] CaplCallback)

dword ChkStart_SignalValueChange (EnvVarName, char [] CaplCallback)

As constructor TestCheck::CreateSignalValueChange (Signal aObservedSignal, char []


function CaplCallback)

TestCheck::StartSignalValueChange (Signal aObservedSignal, char []


CaplCallback)

TestCheck::CreateSignalValueChange (EnvVarName, char [] CaplCallback)

TestCheck::StartSignalValueChange (EnvVarName, char [] CaplCallback)

Check name | Signal Value Constancy check |

Function Checks the physical value of a signal or an environment variable.

An event will be generated, if the value will be changed.

Parameters aObservedSignal

EnvVarName

Environment variable to be checked

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors Signal is not mapped to message

CAPL callback does not exist

Check-specific ChkQuery_EventMessageId
queries
ChkQuery_EventMessageName

ChkQuery_EventSignalValue

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_SignalValueChange, ChkStart_SignalValueChange

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 CAN, FlexRay — •

6.0, 6.1 SP3 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

Example
// checks that there is no change of the value of the signal
checkId = ChkStart_SignalValueChange (SignalToObserve);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_Timeout, ChkStart_Timeout

ChkCreate_Timeout, ChkStart_Timeout
CAPL Function Overview » Test Service Library » Checks » ChkCreate_Timeout, ChkStart_Timeout

Syntax dword ChkCreate_Timeout (Duration aTimeout, char [] CaplCallback)

dword ChkStart_Timeout (Duration aTimeout, char [] CaplCallback)

As cunstructor TestCheck::CreateTimeout (Duration aTimeout, char [] CaplCallback)


function
TestCheck::StartTimeout (Duration aTimeout, char [] CaplCallback)

Check name | Timeout check |

Function The check fires an event if the time has expired.

Parameters aTimeout

> 0; default unit [ms], if not changed with ChkConfig_SetPrecision.

CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned (handle-
) value

Possible errors CAPL callback does not exist

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test modules — •

7.0 SP5: method Test modules — •

Example
// checks the maximum duration of a sequence of actions
checkId = ChkStart_Timeout (2000);
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_UndefinedMessageReceived, ChkStart_UndefinedMessageReceived

ChkCreate_UndefinedMessageReceived,
ChkStart_UndefinedMessageReceived
CAPL Function Overview » Test Service Library » Checks » ChkCreate_UndefinedMessageReceived,
ChkStart_UndefinedMessageReceived

Syntax dword ChkCreate_UndefinedMessageReceived (char [] CaplCallback)

dword ChkStart_UndefinedMessageReceived (char [] CaplCallback)

As constructor TestCheck::CreateUndefinedMessageReceived (char [] CaplCallback)


function
TestCheck::StartUndefinedMessageReceived (char [] CaplCallback)

Check name | Unknown Message Received check |

Function Observes the current bus and reports messages that are not defined.

If the CANoe configuration contains multiple buses, the current bus context has to be
specified (SetBusContext) before the check configuration.

For FlexRay either only valid data frames or PDUs (according to the database type) are
recognized as communication. Null frames and Erroneous frames are ignored.

Caution

For a FlexRay PDU database this check also ignores all received frames! For
a PDU database only PDUs are considered. For a FlexRay PDU database this
test makes no sense, because only those PDUs, which are defined in the
database, can be retrieved from frames. There cannot exist PDUs that are
not defined in the database! Therefore, for a PDU database this check will
always pass.

Parameters CaplCallback

In simulation nodes this parameter has to be set.


In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 CAN, FlexRay — •

7.0 SP5: method CAN, FlexRay — •

7.2 CAN, FlexRay — •

Example
// observes the bus ‘CAN1’ for undefined messages
SetBusContext(getBusNameContext("CAN1"));
checkId = ChkStart_UndefinedMessageReceived();
TestAddCondition(checkId);
// sequence of different actions and waiting conditions
TestWaitForTimeout(1000);
TestRemoveCondition(checkId);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkCreate_UndefinedMessageReceived, ChkStart_UndefinedMessageReceived

checkId = ChkCreate_UndefinedMessageReceived("CallbackUnknownMsg");

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventInterval

ChkQuery_EventInterval
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventInterval

Syntax long ChkQuery_EventInterval (dword checkId)

Method check.QueryEventInterval()

Function Returns the last time-interval that has led to the event.

Parameters checkId

Return values -101: The interval for the last event has been started but not yet terminated.

< 0: Refers the query error codes in this chapter

≥ 0: Time interval in the precision of the check

Applicable for ChkCreate_MsgDistViolation

Result: last bad message distance

ChkCreate_MsgRelCycleTimeViolation

Result: last bad cycle time

ChkCreate_MsgRelOccurrenceViolation

Result: the last message with a bad cycle time

ChkCreate_NodeMsgsRelCycleTimeViolation

Result: last bad cycle time

ChkCreate_NodeMsgsRelOccurrenceViolation

Result: the last message with a bad cycle time

ChkStart_SignalCycleTimeViolation

Result: last invalid cycle time

ChkStart_LINSchedTableViolation

Result: Last measured slot delay time

ChkStart_LINSyncBreakTimingViolation

Result: Retrieves the value of the last measured length of the break low phase

ChkStart_LINSyncDelTimingViolation

Result: Retrieves the value of the last measured length of the break delimiter

ChkStart_LINDiagDelayTimesViolation

Result: Retrieves last measured P2_min or ST_min time

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventInterval

ChkStart_LINHeaderToleranceViolation

Result: Last measured header transmission time

ChkStart_LINRespToleranceViolation

Result: Last measured response transmission time

ChkStart_LINMasterInitTimeViolation

Result: Last measured Master initialization time

ChkStart_LINWakeupReqLengthViolation

Result: Last measured length of the wakeup request

ChkStart_LINWakeupRetryViolation

Result: Last measured timeout between two consecutive LIN WakeUp signals

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventInterval(checkId);
Write("result = %d", result);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventMessageContents

ChkQuery_EventMessageContents
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventMessageContents

Syntax long ChkQuery_EventMessageContents (dword CheckId, byte buffer[], dword


bufferlen)

Method check.QueryEventMessageContents (byte buffer[], dword bufferlen)

Function Stores the data bytes of the message, for which the event has been sent, in the buffer
and returns the number of stored data bytes (DLC).

Parameters CheckId

Identifier of the queried Check.

buffer

bufferlen

Return values < 0: Refers the query error codes

> 0: Number of stored data bytes (DLC)

Applicable for ChkStart_LINReconfRequestFormatViolation

Result: All data bytes of the LIN reconfiguration request, which caused the event

ChkStart_LINETFViolation

Result: All data bytes of the last invalid ETF single response

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventMessageId

ChkQuery_EventMessageId
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventMessageId

Syntax long ChkQuery_EventMessageId (dword aCheckId)

Method check.QueryEventMessageId()

Function Returns the Id of the message that has forced the event

Parameters aCheckId

Return values < 0: Refers the query error codes

> 0: Id of the name

Applicable for ChkCreate_MsgRelCycleTimeViolation

Result: the observed message

ChkCreate_NodeMsgsRelCycleTimeViolation

Result: the last message with a bad cycle time

ChkCreate_MsgDistViolation

Result: the last message with a bad distance

ChkCreate_MsgSignalValueRangeViolation

Result: the observed message

ChkCreate_MsgSignalValueInvalid

Result: the observed message

ChkStart_LINRespErrorSignal

Result: the ID of the LIN frame carrying the fired Response_Error signal

ChkStart_LINHeaderToleranceViolation

Result: the ID of the last LIN frame with violated header length

ChkStart_LINSyncBreakTimingViolation

Result: the ID of the last LIN frame with violated timing

ChkStart_LINSyncDelTimingViolation

Result: the ID of the last LIN frame with violated timing

ChkStart_LINRespToleranceViolation

Result: the ID of the last LIN frame with violated response length

ChkStart_SignalCycleTimeViolation

Result: the ID of the last frame with a bad signal cycle time

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventMessageId

ChkCreate_MsgOccurrenceCount

Result: the ID of the last defined message that occurred

ChkStart_LINETFViolation

Result: the ID of the last LIN associated frame violating the process of collision
resolution (if applicable)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventMessageId(checkId);
Write("result = %d", result);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventMessageName

ChkQuery_EventMessageName
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventMessageName

Syntax double ChkQuery_EventMessageName (dword aCheckId, char buffer[], dword


bufferlen)

Method check.QueryEventMessageName (char buffer[], dword bufferlen)

Function Stores the name of the message, that has led to the event, in the buffer and returns
the length of the name, or 0 if specified for a range.

Parameters aCheckId

buffer

bufferlen

Return values < 0: Refers the query error codes

> 0: Length of the message name

Applicable for ChkCreate_MsgDistViolation

Result: the last message with a bad distance

ChkCreate_MsgRelCycleTimeViolation

Result: the observed message

ChkCreate_MsgRelOccurrenceViolation

Result: the last message with a bad cycle time

ChkCreate_NodeMsgsRelCycleTimeViolation

Result: the last message with a bad cycle time

ChkCreate_NodeMsgsRelOccurrenceViolation

Result: the last message with a bad cycle time

ChkCreate_MsgSignalValueRangeViolation

Result: the observed message

ChkCreate_MsgSignalValueInvalid

Result: the observed message

ChkStart_LINRespErrorSignal

Result: the name of the LIN frame carrying fired the Response_Error signal

ChkStart_LINRespToleranceViolation

Result: the name of the last LIN frame with violated response length

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventMessageName

ChkStart_SignalCycleTimeViolation

Result: the name of the last frame with a bad signal cycle time

ChkStart_LINETFViolation

Result: the name of the last LIN associated frame violating the process of collision
resolution (if applicable)

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
char messageName[100];
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventMessageName(checkId, messageName, 100);
Write("result = %d", result);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventNodeName

ChkQuery_EventNodeName
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventNodeName

Syntax long ChkQuery_EventNodeName (dword CheckId, char buffer[], dword


bufferlen)

Method check.QueryEventNodeName (char buffer[], dword bufferlen)

Function Stores the name of the node, for which the event has been sent, in the buffer and
returns the length of the name, or 0 if specified for a range of nodes.

Parameters CheckId

Identifier of the queried Check.

buffer

bufferlen

Return values < 0: Refers the query error codes

> 0: Length of the node name

Applicable for ChkStart_LINDiagDelayTimesViolation

Result: Node name for which the diagnostic delay has been violated

ChkStart_LINRespToleranceViolation

Result: name of the node which caused response tolerance violation

ChkStart_LINRespErrorSignal

Result: the name of the node, for which the Response_Error has been notified

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventReason

ChkQuery_EventReason
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventReason

Syntax long ChkQuery_EventReason (dword checkId)

Method check.QueryEventReason()

Function Retrieves the exact reason of firing event in the LIN specific check.

Parameters CheckId

Identifier of the queried Check.

Return values < 0: Refers the query error codes

>= 0: Index of an event reason

Applicable for ChkStart_LINDiagDelayTimesViolation

Result: 1 - P2_min has been violated; 2- ST_min has been violated

ChkStart_LINReconfRequestFormatViolation

Result: Bit-mask is used. Indexing: least significant bit is 1.

Bit 1 Initial NAD is out of range

Bit 2 NAD references undefined Slave

Bit 3 Supplier ID does not match

Bit 4 Function ID does not match

Bit 5 Variant ID does not match

Bit 6 Message ID does not match

Bit 7 Protected ID does not match

Bit 8 ID Byte does not match (Conditional change NAD command)

Bit 9 BYTE Byte does not match (Conditional change NAD command)

ChkStart_LINSchedTableViolation

Result: 1 – Cannot synchronize during one cycle time; 2- Slot frame violated; 3- Slot
delay violated; 4- Invalid empty slot

ChkStart_LINETFViolation

Result: 1 – Invalid format of single response (PID doesn’t match); 2 - No response during
collision resolution; 3 - Wrong order of associated frames during collision resolution; 4 –
Too many associated frames during collision resolution; 5 – Collision resolution is
incomplete

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventReason

ChkStart_LINWakeupRetryViolation

Result: 1 – Maximum number of retransmissions has been exceeded. 2..N: Timeout


between retransmissions N-1..N has been exceeded

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
testcase tcTSL_LINReconfRequest()
{
dword checkId;
long rqViolationReason;

checkId = ChkStart_LINReconfRequestFormatViolation();
testWaitForTimeout(5000);
ChkControl_Stop(checkId);

rqViolationReason = ChkQuery_EventReason(checkId);
if (rqViolationReason & 0x1)
{
testStep("Evaluation", "Initial NAD is out of range");
}
if (rqViolationReason & 0x2)
{
testStep("Evaluation", "NAD references undefined Slave");
}
if (rqViolationReason & 0x4)
{
testStep("Evaluation", "Supplier ID does not match");
}
if (rqViolationReason & 0x8)
{
testStep("Evaluation", "Function ID does not match");
}
if (rqViolationReason & 0x10)
{
testStep("Evaluation", "Variant ID does not match");
}
}

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventSchedSlotIndex

ChkQuery_EventSchedSlotIndex
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventSchedSlotIndex

Syntax long ChkQuery_EventSchedSlotIndex (dword CheckId)

Method check.QueryEventSchedSlotIndex()

Function Retrieves slot index of a schedule table for which the event has been sent.

Parameters CheckId

Identifier of the queried Check.

Return values < 0: Refers the query error codes

> 0: Slot index

Applicable for ChkStart_LINSchedTableViolation

Result: Index of slot, where the violation took place

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventSignalValue

ChkQuery_EventSignalValue
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventSignalValue

Syntax double ChkQuery_EventSignalValue (dword checkId, double pValue[])

Method check.QueryEventSignalValue (double pValue[])

Function This function enables access to the signal value which was last reported by a check as
invalid.

The signature of the function with the same name without the pValue parameter
enables access only to positive signal values.

This function enables access to signal values in any directory.

Parameters checkId

double *pValue

Info

This requires the transfer of an array.

Return values <= 0: Refers the query error codes in this chapter

Applicable for ChkCreate_MsgSignalValueRangeViolation

Result: Value of the last signal that was bad

ChkCreate_MsgSignalValueInvalid

Result: Value of the last signal that was bad

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
CallbackOnSignalXyzViolation(dword aCheckId)
{
double lBadValue[1]; // use an array to allow "call-by-reference";
lenght: 1 element
ChkQuery_EventSignalValue(aCheckId, lBadValue[0]);
write("Last bad signal value=%g", lBadValue[0]);
}

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventSignalValue (for signals with positive values)

ChkQuery_EventSignalValue (for signals with positive values)


CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventSignalValue (for signals with positive
values)

Syntax double ChkQuery_EventSignalValue (dword checkId)

Method check.QueryEventSignalValue()

Function This function enables access to the signal value which was last reported by a check as
invalid.

This function enables access only to positive signal values.

Parameters checkId

Return values < 0: Refers the query error codes in this chapter

>= 0: Retrieved signal value

Applicable for ChkCreate_MsgSignalValueRangeViolation

Result: Value of the last signal that was bad

ChkCreate_MsgSignalValueInvalid

Result: Value of the last signal that was bad

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgSignalValueInvalid(Velocity, 80, 100);
// ... execute test sequenc
result = ChkQuery_EventSignalValue(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventStatus

ChkQuery_EventStatus
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventStatus

Syntax long ChkQuery_EventStatus (dword aCheckId, char aBuffer[], dword


aBufferLength)

Method check.QueryEventStatus (char aBuffer[], dword aBufferLength)

Function Converts the status into a string that can be printed. Returns the number of characters
written (<= length).

Parameters aCheckId

aBuffer

aBufferLength

Return values < 0: Refers the query error codes

>= 0: Number of characters

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
char eventStatus[256];
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventStatus(checkId, eventStatus, 256);
Write("result = %d", result);
Write("Event Status = %s", eventStatus);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventStatusToLog

ChkQuery_EventStatusToLog
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventStatusToLog

Syntax long ChkQuery_EventStatusToLog (dword aCheckId)

Method check.QueryEventStatusToLog()

Function Uses the output of ChkQuery_EventStatus and writes the result to the log file.

Parameters aCheckId

Return values < 0: Refers the query error codes

>= 0: See description

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventStatusToLog(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventStatusToWrite

ChkQuery_EventStatusToWrite
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventStatusToWrite

Syntax long ChkQuery_EventStatusToWrite (dword aCheckId)

Method check.QueryEventStatusToWrite()

Function Uses the output of ChkQuery_EventStatus and writes the result to the write window.

Parameters aCheckId

Return values < 0: Refers the query error codes

>= 0: See description

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventStatusToWrite(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventTimeStamp

ChkQuery_EventTimeStamp
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventTimeStamp

Syntax long ChkQuery_EventTimestamp (dword CheckId)

Method check.QueryEventTimestamp()

Function Retrieves timestamp of last fired event.

Parameters CheckId

Identifier of the queried Check.

Return values < 0: Refers the query error codes

> 0: Event timestamp in units set for the queried Check with ChkConfig_SetPrecision

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_EventTimeStamp(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_EventTiming

ChkQuery_EventTiming
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_EventTiming

Syntax float ChkQuery_EventTiming (dword checkId)

Method check.QueryEventTiming()

Function Retrieves the timing value that has been violated in the LIN specific check.

Parameters checkId

Identifier of the queried Check.

Return values < 0: Refers the query error codes

>= 0: Timing value depending on the check type

Applicable for ChkStart_LINSyncBreakTimingViolation

Result: Last measured break length [in bit times]

ChkStart_LINSyncDelTimingViolation

Result: Last measured delimiter length [in bit times]

ChkStart_LINMasterBaudrateViolation

Result: Last measured baud rate [in bit times]

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
testcase tcTSL_LINSyncBreak()
{
dword checkId;
float lastMeasuredSyncBreakLength;

checkId = ChkStart_LINSyncBreakTimingViolation (18, 20);


testWaitForTimeout(5000);
ChkControl_Stop(checkId);

lastMeasuredSyncBreakLength = ChkQuery_EventTiming(checkId);
testStep("Evaluation", "Last measured sync break length is %.2f bits",
lastMeasuredSyncBreakLength);
}

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_NumEvents

ChkQuery_NumEvents
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_NumEvents

Syntax long ChkQuery_NumEvents (dword aCheckId)

Method check.QueryNumEvents()

Function Returns the number of events generated by this check since its initialization.

Parameters aCheckId

Return values < 0: Refers the query error codes

0: No event has occurred

> 0: Number of events

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_NumEvents(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_NumRequests

ChkQuery_NumRequests
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_NumRequests

Syntax long ChkQuery_NumRequests (dword aCheckId)

Method check.QueryNumRequests()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation check |

Function Returns the total number of requests that occurred during the current observation period.

Parameters aCheckId

Reference to check context.

Return values < 0: Refer the query error codes

>=0: Number of requests that occurred

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_NumTimedoutRequests

ChkQuery_NumTimedoutRequests
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_NumTimedoutRequests

Syntax long ChkQuery_NumTimedoutRequests (dword aCheckId)

Method check.QueryNumTimedoutRequests()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation check |

Function Returns the number of requests within the current observation period for which no
corresponding response message was observed during the specified timeout.

In the context of a method protocol check, an occurred timeout of tWaitForProcessing1 or


tWaitForProcessing2 will also count that request to the number returned by this function,
regardless whether the final "Result"/"ResultAck" or "Error"/"ErrorAck" response is
observed within tMaxDuration or not.

Parameters aCheckId

Reference to check context.

Return values < 0: Refer the query error codes.

>=0: Number of requests that incurred a timeout.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_Precision

ChkQuery_Precision
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_Precision

Syntax double ChkQuery_Precision (dword aCheckId)

Method check.QueryPrecision()

Function Returns a factor that can be multiplied with the return value of the statistical queries to
convert the timestamp to the standard unit milliseconds.

Parameters aCheckId

Return values double: 100 to 10-6

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_Precision(checkId);

| ChkConfig_SetPrecision | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestDstAdr

ChkQuery_RequestDstAdr
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestDstAdr

Syntax long ChkQuery_RequestDstAdr(dword aCheckId)

Method check.QueryRequestDstAdr()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the destination address of the request message, which last led to a protocol
violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: target address

Apllicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestFBlockId

ChkQuery_RequestFBlockId
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestFBlockId

Syntax long ChkQuery_RequestFBlockId(dword aCheckId)

Method check.QueryRequestFBlockId()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the FBlock of the request message, which last led to a protocol violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codesText

>= 0: Id of the FBlock.

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestFunctionId

ChkQuery_RequestFunctionId
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestFunctionId

Syntax long ChkQuery_RequestFunctionId(dword aCheckId)

Method check.QueryRequestFunctionId()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the function of the request message, which last led to a protocol violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: Id of the function.

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestInstId

ChkQuery_RequestInstId
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestInstId

Syntax long ChkQuery_RequestInstId(dword aCheckId)

Method check.QueryRequestInstId()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the InstanceId of the request message, which last led to a protocol violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: InstanceId.

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestOpType

ChkQuery_RequestOpType
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestOpType

Syntax long ChkQuery_RequestOpType(dword aCheckId)

Method check.QueryRequestOpType()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the OpType of the request message, which last led to a protocol violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: Id of the OpType.

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestSrcAdr

ChkQuery_RequestSrcAdr
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestSrcAdr

Syntax long ChkQuery_RequestSrcAdr(dword aCheckId)

Method check.QueryRequestSrcAdr()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the source address of the request message, which last led to a protocol
violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: source address

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_RequestTimestamp

ChkQuery_RequestTimestamp
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_RequestTimestamp

Syntax long ChkQuery_RequestTimestamp(dword aCheckId)

Method check.QueryRequestTimestamp()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation
check |

Function Returns the reception time stamp of the request message, which last led to a protocol
violation.

Parameters aCheckId

Reference to check context.

Return values < 0: Refers the query error codes

>= 0: Time stamp in the time base of the check

Applicable for ChkCreate_MostPropertyProtocolError

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatAvResponseTime

ChkQuery_StatAvResponseTime
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatAvResponseTime

Syntax long ChkQuery_StatAvResponseTime (dword aCheckId)

Method check.QueryStatAvResponseTime()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation check |

Function Returns the average time lag between the request and corresponding response messages.
Only those requests that were resolved within the specified maximum response time are
taken into consideration here.

Parameters aCheckId

Reference to check context.

Return values < 0: Refer the query error codes.

>=0: Average response time during the current time period.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • MOST — •
• Test modules

7.0 SP5: method • MOST — •


• Test modules

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatEventFreePeriodAvg

ChkQuery_StatEventFreePeriodAvg
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatEventFreePeriodAvg

Syntax double ChkQuery_StatEventFreePeriodAvg (dword aCheckId)

Method check.QueryStatEventFreePeriodAvg()

Function Returns the average timely distance between events and check starts/stops.

Info

Among other things with this function the average cycle time of a cyclic
message can be queried.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

>= 0: Average timely distance in the current precision


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatEventFreePeriodAvg(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatEventFreePeriodMax

ChkQuery_StatEventFreePeriodMax
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatEventFreePeriodMax

Syntax double ChkQuery_StatEventFreePeriodMax (dword aCheckId)

Method check.QueryStatEventFreePeriodMax()

Function Returns the maximum timely distance between events and check starts/stops.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

>= 0: Maximum timely distance in the current precision [ms]

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatEventFreePeriodMax(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatEventFreePeriodMed

ChkQuery_StatEventFreePeriodMed
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatEventFreePeriodMed

Syntax double ChkQuery_StatEventFreePeriodMed (dword aCheckId)

Method check.QueryStatEventFreePeriodMed()

Function Returns the average timely distance between events and check starts/stops.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

>= 0: Average timely distance in the current precision

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatEventFreePeriodMed(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatEventFreePeriodMin

ChkQuery_StatEventFreePeriodMin
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatEventFreePeriodMin

Syntax double ChkQuery_StatEventFreePeriodMin (dword aCheckId)

Method check.QueryStatEventFreePeriodMin()

Function Returns the minimum timely distance between events and check starts/stops.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

>= 0: Minimum timely distance current precision

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatEventFreePeriodMin(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatMaxValidResponseTime

ChkQuery_StatMaxValidResponseTime
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatMaxValidResponseTime

Syntax long ChkQuery_StatMaxValidResponseTime (dword aCheckId)

Method check.QueryStatMaxValidResponseTime()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation check |

Function Returns the longest time lag between the request and corresponding response message
that occurred during the current observation period. Only those requests that were
resolved within the specified maximum response time are taken into consideration here.

Parameters aCheckId

Reference to check context.

Return values < 0: Refer the query error codes.

>=0: Longest response time during the current time period.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.0 MOST — •

7.0 SP5: method MOST — •

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatMinResponseTime

ChkQuery_StatMinResponseTime
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatMinResponseTime

Syntax long ChkQuery_StatMinResponseTime (dword aCheckId)

Method check.QueryStatMinResponseTime()

Check name | MOST Property Protocol Observation check | MOST Method Protocol Observation check |

Function Returns the shortest time lag between the request and corresponding response message
that occurred during the current observation period.

Parameters aCheckId

Reference to check context.

Return values < 0: Refer the query error codes.

>=0: Shortest response time during the current time period.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • MOST — •
• Test modules

7.0 SP5: method • MOST — •


• Test modules

Example

| ChkCreate_MostPropertyProtocolError, ChkStart_MostPropertyProtocolError | ChkCreate_MostMethodProtocolError,


ChkStart_MostMethodProtocolError | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatNumProbes

ChkQuery_StatNumProbes
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatNumProbes

Syntax long ChkQuery_StatNumProbes (dword aCheckId)

Method check.QueryStatNumProbes()

Function Returns the number of probes (measurements) that have been considered by the check. In
general this is the count of messages that have been analyzed by the check.

Parameters aCheckId

Return values < 0: Refers the query error codes

0: No event has occurred

> 0: Number of probes

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatNumProbes(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatProbeIntervalAvg

ChkQuery_StatProbeIntervalAvg
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatProbeIntervalAvg

Syntax double ChkQuery_StatProbeIntervalAvg (dword aCheckId)

Method check.QueryStatProbeIntervalAvg()

Function Returns the average timely distance between 2 consumed message events.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

> 0: Maximum timely distance

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatProbeIntervalAvg(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatProbeIntervalMax

ChkQuery_StatProbeIntervalMax
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatProbeIntervalMax

Syntax double ChkQuery_StatProbeIntervalMax (dword aCheckId)

Method check.QueryStatProbeIntervalMax()

Function Returns the maximum timely distance between 2 consumed message events.

Info

Among other things with this function this function the maximum occurred
cycle time of a cyclic message can be queried.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

> 0: Maximum timely distance

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatProbeIntervalMax(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_StatProbeIntervalMin

ChkQuery_StatProbeIntervalMin
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_StatProbeIntervalMin

Syntax double ChkQuery_StatProbeIntervalMin (dword aCheckId)

Method check.QueryStatProbeIntervalMin()

Function Returns the minimum timely distance between 2 consumed message events.

Info

Among other things with this function this function the minimum occurred
cycle time of a cyclic message can be queried.

Parameters aCheckId

Return values < 0: Refers the query error codes

Info

There is a meaningful value available and a positive return value is supplied


even if the check has not generated any event.

> 0: Minimum timely distance

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
double result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_StatProbeIntervalMin(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkQuery_Valid

ChkQuery_Valid
CAPL Function Overview » Test Service Library » Status Report Functions » ChkQuery_Valid

Syntax long ChkQuery_Valid (dword aCheckId)

Method check.QueryValid()

Function Examines whether a check with particular Id is valid.

Parameters aCheckId

Return values = 0: Refer the query error codes

> 0: Valid Id

Applicable for All checks

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
long result;
dword checkId;
checkId = ChkStart_MsgRelCycleTimeViolation(VehicleMotion, 0.9, 1.1);
// ... execute test sequence
result = ChkQuery_Valid(checkId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINDiagDelayTimesViolation

ChkStart_LINDiagDelayTimesViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINDiagDelayTimesViolation

Syntax dword ChkStart_LINDiagDelayTimesViolation (Node ObservedNode)

dword ChkStart_LINDiagDelayTimesViolation ()

dword ChkStart_LINDiagDelayTimesViolation(Node ObservedNode, char[]


CaplCallback)

dword ChkStart_ LINDiagDelayTimesViolation(char[] CaplCallback)

As constructor TestCheck::StartLINDiagDelayTimesViolation (Node ObservedNode)


function
TestCheck::StartLINDiagDelayTimesViolation ()

TestCheck::StartLINDiagDelayTimesViolation(Node ObservedNode, char[]


CaplCallback)

TestCheck::StartLINDiagDelayTimesViolation(char[] CaplCallback)

Function Checks the values of P2_min and ST_min for a specified LIN Slave node or for all LIN
Slaves defined in LDF.

An event will be generated, if the measured P2_min or ST_min value is smaller than
one specified in the database (LDF).

Info

The check monitors bus traffic and automatically recognizes diagnostic


frames.

Parameters ObservedNode

Slave node to be checked.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors The specified node is Master

Specified node does not appear under "Node Attributes" section in LDF or P2_min,
ST_min are not defined

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventReason

ChkQuery_EventNodeName

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINDiagDelayTimesViolation

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
// Create and start the check for LIN diagnostic delay times
checkId =
ChkStart_LINDiagDelayTimesViolation("LINDiagDelayTimesCallback");
...
// CAPL callback for violation notification
void LINDiagDelayTimesCallback (dword aCheckId)
{ ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINETFViolation

ChkStart_LINETFViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINETFViolation

Syntax dword ChkStart_LINETFViolation (dword ETFFrameId, char[] CaplCallback)

dword ChkStart_LINETFViolation (dword ETFFrameId)

As cunstructor TestCheck::StartLINETFViolation (dword ETFFrameId, char[] CaplCallback)


function
TestCheck::StartLINETFViolation (dword ETFFrameId)

Function Checks the format of a single response to ETF. An event will be generated, if the first
data byte does not match protected ID of any of the associated frames (Slave failure).

Checks the collision resolution process. An event will be generated during collision
resolution, if one of the following is detected:

• No response for an associated frame (Slave failure)


• Wrong order of the associated frames. (Master failure)
• Associated frame is repeated (Master failure)
• Not all headers of associated frames are transmitted (Master failure)

Parameters ETFFrameId

Frame identifier (8 bits) of an event triggered frame to verify

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Specified frame ID doesn’t match any of symbolic event-triggered frames

Specified event-triggered frame contains no associated frames, i.e. nothing to verify

CAPL callback does not exist

Check-specific ChkQuery_EventReason
queries
ChkQuery_EventMessageContents

ChkQuery_EventMessageId

ChkQuery_EventMessageName

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 LIN — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINETFViolation

7.0 SP5: method LIN — •

Example
...
dword checkId;
// Create and start the check for LIN Event-triggered frame
// Parameters: Frame identifier of event-triggered frame to verify and
optional CAPL
// callback
checkId = ChkStart_LINETFViolation (0x3A, "CallbackLINETFViolation");
...
// CAPL callback for violation notification
void CallbackLINETFViolation (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINHeaderToleranceViolation

ChkStart_LINHeaderToleranceViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINHeaderToleranceViolation

Syntax dword ChkStart_LINHeaderToleranceViolation (float Tolerance)

dword ChkStart_LINHeaderToleranceViolation (float Tolerance, char[]


CaplCallback)

As constructor TestCheck::StartLINHeaderToleranceViolation (float Tolerance)


function
TestCheck::StartLINHeaderToleranceViolation (float Tolerance, char[]
CaplCallback)

Function Checks the LIN header transmission time.

An event will be generated, if the measured header transmission time is over specified
tolerance.

Info

For a LIN 2.0 compliance the Tolerance has to be in the range [0 .. 40]%.

Parameters Tolerance

Allowed tolerance for Header transmission time.

Value range: [0 .. 40]


Unit: percents [%]

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventMessageId

ChkQuery_EventTiming

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
// Create and start the check for LIN Header tolerance
checkId = ChkStart_LINHeaderToleranceViolation(40.0,
"LINHeaderToleranceCallback");
...
// CAPL callback for violation notification

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINHeaderToleranceViolation

void LINHeaderToleranceCallback (dword aCheckId)


{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINMasterBaudrateViolation

ChkStart_LINMasterBaudrateViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINMasterBaudrateViolation

Syntax dword ChkStart_LINMasterBaudrateViolation (float ClockTolerance)

dword ChkStart_LINMasterBaudrateViolation (float ClockTolerance, char[]


CaplCallback)

As constructor TestCheck::StartLINMasterBaudrateViolation (float ClockTolerance)


function
TestCheck::StartLINMasterBaudrateViolation (float ClockTolerance, char[]
CaplCallback)

Function Checks the LIN Master baud rate, by analyzing frame headers.

An event will be generated, if the measured baud rate is outside of the specified range.
The expected baud rate is taken from DB.

Info

For a LIN 2.0 compliance the Master clock tolerance has to be in the range:

[-0.5 .. 0.5] %.

The actual baud rate is done in Synch Field with the sample rate of 1
second.

This check works only when LIN hardware is not in Master mode, i.e. when
an external Master is used.

Parameters ClockTolerance

Allowed Master clock tolerance. Measured baud rate expected to be in the range:

B – B*aClockTolerance/100 <= M <= B + B* aClockTolerance/100; where M is measured


baud rate and B is expected baud rate [specified in DB]

Unit: percents [%]

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Check-specific ChkQuery_EventTiming
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINMasterBaudrateViolation

Example
...
dword checkId;
// Create and start the check for LIN Master baud rate violation
checkId = ChkStart_LINMasterBaudrateViolation(0.5,
"LINMasterBaudrateCallback");
...
// CAPL callback for violation notification
void LINMasterBaudrateCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINMasterInitTimeViolation

ChkStart_LINMasterInitTimeViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINMasterInitTimeViolation

Syntax dword ChkStart_LINMasterInitTimeViolation (duration MinTime, duration


MaxTime)

dword ChkStart_LINMasterInitTimeViolation (duration MinTime, duration


MaxTime, char[] CaplCallback)

As constructor TestCheck::StartLINMasterInitTimeViolation (duration MinTime, duration


function MaxTime)

TestCheck::StartLINMasterInitTimeViolation (duration MinTime, duration


MaxTime, char[] CaplCallback)

Function Checks an initialization time of LIN Master. The initialization state is entered on
switching on and on waking up.

An event will be generated, if the initialization time is out of the specified range.

Info

This function verifies the initialization time on waking up only, i.e. a time
between getting Wakeup signal and the first header transmitted by the
Master.

For a LIN 2.0 compliance the initialization time has to be in the range [100
.. 150] ms.

Parameters MinTime

0 Minimum time shall not be checked

>0 Minimum allowed initialization time

Unit: Can be set with ChkConfig_SetPrecision.

MaxTime

0 Maximum time shall not be checked

>0 Maximum allowed initialization time

Unit: Can be set with ChkConfig_SetPrecision.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINMasterInitTimeViolation

Possible errors Range specified for initialization time is invalid

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
// Create and start the check for LIN Master initialization time
violation
checkId = ChkStart_LINMasterInitTimeViolation(100, 150,
"LINMasterInitTimeCallback");
...
// CAPL callback for violation notification
void LINMasterInitTimeViolation (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINReconfRequestFormatViolation

ChkStart_LINReconfRequestFormatViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINReconfRequestFormatViolation

Syntax dword ChkStart_LINReconfRequestFormatViolation ()

dword ChkStart_LINReconfRequestFormatViolation (char[] CaplCallback)

As constructor TestCheck::StartLINReconfRequestFormatViolation ()
function
TestCheck::StartLINReconfRequestFormatViolation (char[] CaplCallback)

Function Checks the format of LIN reconfiguration requests.

An event will be generated, if in a detected reconfiguration request at least one Slave


attribute is violated.

Info

As reconfiguration request considered frames with ID=0x3C, carrying the


Service Identifier byte (SID) in the range [0xB0..0xB7]

Checked attributes: NAD, supplier ID, function ID, variant ID, message ID,
protected ID, StartIndex.

Parameters CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId
> 0: Check was created successfully and may be referenced using the returned (handle-)
[dword] value.

Possible errors CAPL callback does not exist

Check-specific ChkQuery_EventReason
queries
ChkQuery_EventMessageContents

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: LIN — •


method

Example
...
dword checkId;
// Create and start the check for LIN reconfiguration request format
violation
checkId =
ChkStart_LINReconfRequestFormatViolation("LINReconfRequestFormatCallback"
);
...
// CAPL callback for violation notification
void LINReconfRequestFormatCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINReconfRequestFormatViolation

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINRespErrorSignal

ChkStart_LINRespErrorSignal
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINRespErrorSignal

Syntax dword ChkStart_LINRespErrorSignal (Node ObservedNode)

dword ChkStart_LINRespErrorSignal ()

dword ChkStart_LINRespErrorSignal ( Node ObservedNode, char[]


CaplCallback)

dword ChkStart_LINRespErrorSignal (char[] CaplCallback)

As constructor TestCheck::StartLINRespErrorSignal (Node ObservedNode)


function
TestCheck::StartLINRespErrorSignal ()

TestCheck::StartLINRespErrorSignal ( Node ObservedNode, char[]


CaplCallback)

TestCheck::StartLINRespErrorSignal (char[] CaplCallback)

Function Checks the LIN Response_Error signal for a specified LIN Slave node or for all LIN nodes.

An event will be generated, if the Response_Error signal value changes from FALSE (0)
to TRUE (1).

J2602 specific: Bit 7 of Status Byte serves as Response_Error signal.

Parameters ObservedNode

Node to be checked.
Only Slave nodes are allowed.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword] > 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possibel errors The specified node is Master

The Response_Error signal for the specified node is not defined or the signal is not
defined for any Slave node

CAPL callback does not exist

Check-specific ChkQuery_EventMessageName
queries
ChkQuery_EventMessageId

ChkQuery_EventNodeName

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINRespErrorSignal

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
// Create and start the check for LIN response_error signal
checkId = ChkStart_LINRespErrorSignal("LINRespErrCallback");
...
// CAPL callback for violation notification
void LINRespErrCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINRespToleranceViolation

ChkStart_LINRespToleranceViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINRespToleranceViolation

Syntax dword ChkStart_LINRespToleranceViolation (Message Frame, float Tolerance)

dword ChkStart_LINRespToleranceViolation (Node ObservedNode, float


Tolerance)

dword ChkStart_LINRespToleranceViolation (Message Frame, float Tolerance,


char[] CaplCallback)

dword ChkStart_LINRespToleranceViolation (Node ObservedNode, float


Tolerance, char[] CaplCallback)

As constructor TestCheck::StartLINRespToleranceViolation (Message Frame, float


function Tolerance)

TestCheck::StartLINRespToleranceViolation (Node ObservedNode, float


Tolerance)

TestCheck::StartLINRespToleranceViolation (Message Frame, float


Tolerance, char[] CaplCallback)

TestCheck::StartLINRespToleranceViolation (Node ObservedNode, float


Tolerance, char[] CaplCallback)

Function Checks the LIN response transmission time.

An event will be generated, if the measured response transmission time is over allowed
tolerance.

Info

This function monitors frames transmitted without a failure only

Components influencing response tolerance: inter-byte space, response


space

For a LIN 2.0 compliance the Tolerance has to be in the range [0 .. 40]%.

Parameters Frame

Unconditional LIN frame to verify

ObservedNode

Node, whose published frames shall be verified.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINRespToleranceViolation

Check-specific ChkQuery_EventMessageName
queries
ChkQuery_EventMessageId

ChkQuery_EventNodeName

ChkQuery_EventInterval

ChkQuery_EventTiming

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(9); // switch to ns precision
// Create and start the check for LIN response tolerance violation in
“Motor1” node
checkId = ChkStart_LINRespToleranceViolation(LIN20db::Motor1, 40.0 ,
"LINRespToleranceCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINRespToleranceCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSchedTableViolation

ChkStart_LINSchedTableViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINSchedTableViolation

Syntax dword ChkStart_LINSchedTableViolation (dword TableIndex, duration Jitter)

dword ChkStart_LINSchedTableViolation (dword TableIndex)

dword ChkStart_LINSchedTableViolation (dword TableIndex, duration Jitter,


char[] CaplCallback)

dword ChkStart_LINSchedTableViolation (dword TableIndex, char[]


CaplCallback)

As constructor TestCheck::StartLINSchedTableViolation (dword TableIndex, duration


function Jitter)

TestCheck::StartLINSchedTableViolation (dword TableIndex)

TestCheck::StartLINSchedTableViolation (dword TableIndex, duration


Jitter, char[] CaplCallback)

TestCheck::StartLINSchedTableViolation (dword TableIndex, char[]


CaplCallback)

Function Checks a certain LIN schedule table for correspondence with the database definition.

An event will be generated, if

• Slot frame is violated, i.e. transmitted frameID doesn’t match one defined in the
corresponding time slot
• Slot delay is not satisfied, i.e. the delay between two consecutive LIN headers is
out of the range specified by the corresponding time slot and allowed Jitter.

Info

The check has to be started only when the specified schedule table is
already running. That is to allow run-time synchronization, which may take
maximum one schedule cycle time.

This is not an appropriate function to check diagnostic schedule tables


because dependent on the application silent slots can occur.

Parameters TableIndex

Zero based index of schedule table to be checked.

Jitter

Allowed deviation from the timing defined by schedule tables. For this value usually
Master’s Jitter is used. Measured slot delay should be in the range:

D - Jitter <= M <= D + Jitter; where M is measured delay and D is expected delay.

Unit: Can be set with ChkConfig_SetPrecision.


Default: Master’s Jitter defined in LDF.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSchedTableViolation

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Schedule table with specified index cannot be found

CAPL callback does not exist

Check-specific ChkQuery_EventSchedSlotIndex
queries
ChkQuery_EventInterval

ChkQuery_EventReason

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(6); // switch to µs precision
// Create and start the check for LIN schedule table with index 0
checkId = ChkStart_LINSchedTableViolation(0, "LINSchedTableCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINSchedTableCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSyncBreakTimingViolation

ChkStart_LINSyncBreakTimingViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINSyncBreakTimingViolation

Syntax dword ChkStart_LINSyncBreakTimingViolation (float MinBreakLen, float


MaxBreakLen)

dword ChkStart_LINSyncBreakTimingViolation (float MinBreakLen, float


MaxBreakLen, char[] CaplCallback)

As constructor TestCheck::StartLINSyncBreakTimingViolation (float MinBreakLen, float


function MaxBreakLen)

TestCheck::StartLINSyncBreakTimingViolation (float MinBreakLen, float


MaxBreakLen, char[] CaplCallback)

Function Checks the timing of the synchronization break field in LIN headers.

An event will be generated, if the measured length [in bit times] of break low phase is
outside of the specified range.

Parameters MinBreakLen

0 Minimum length of break low phase shall not be checked

>0 Minimum allowed length of break low phase

Unit: bit time

MaxBreakLen

0 Maximum length of break low phase shall not be checked

>0 Maximum allowed length of break low phase

Unit: bit time

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Range specified for synch break length is invalid

CAPL callback does not exist

Check-specific ChkQuery_EventTiming
queries
ChkQuery_EventInterval

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSyncBreakTimingViolation

ChkQuery_EventMessageId

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(9); // switch to ns precision
// Create and start the check for LIN break low phase violation
checkId = ChkStart_LINSyncBreakTimingViolation(13, 20,
"LINSyncBreakCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINSyncBreakCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSyncDelTimingViolation

ChkStart_LINSyncDelTimingViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINSyncDelTimingViolation

Syntax dword ChkStart_LINSyncDelTimingViolation (float MinDelLen, float


MaxDelLen)

dword ChkStart_LINSyncDelTimingViolation (float MinDelLen, float


MaxDelLen, char[] CaplCallback)

As constructor TestCheck::StartLINSyncDelTimingViolation (float MinDelLen, float


function MaxDelLen)

TestCheck::StartLINSyncDelTimingViolation (float MinDelLen, float


MaxDelLen, char[] CaplCallback)

Function Checks the timing of the synchronization break field in LIN headers.

An event will be generated, if the measured length [in bit times] of break delimiter is
outside of the specified range.

Parameters MinDelLen

0 Minimum length of break delimiter shall not be checked

>0 Minimum allowed length of break delimiter

Unit: bit time

MaxDelLen

0 Maximum length of break delimiter shall not be checked

>0 Maximum allowed length of break delimiter

Unit: bit time

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Range specified for delimiter length is invalid

CAPL callback does not exist

Check-specific ChkQuery_EventTiming
queries
ChkQuery_EventInterval

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSyncDelTimingViolation

ChkQuery_EventMessageId

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(9); // switch to ns precision
// Create and start the check for LIN Synch Delimiter violation
checkId = ChkStart_LINSyncDelTimingViolation(1, 5,
"LINSyncDelimiterCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINSyncDelimiterCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSynchBreakTimingViolation

ChkStart_LINSynchBreakTimingViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINSynchBreakTimingViolation

Syntax dword ChkStart_LINSynchBreakTimingViolation (dword MinBreakLen, dword


MaxBreakLen)

dword ChkStart_LINSynchBreakTimingViolation (dword MinBreakLen, dword


MaxBreakLen, char[] CaplCallback)

Function Checks the timing of the synchronization break field in LIN headers.

An event will be generated, if the measured length [in bit times] of break low phase is
outside of the specified range.

Parameters MinBreakLen

0 Minimum length of break low phase shall not be checked

>0 Minimum allowed length of break low phase

Unit: bit time

MaxBreakLen

0 Maximum length of break low phase shall not be checked

>0 Maximum allowed length of break low phase

Uni: bit time

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Range specified for synch break length is invalid

CAPL callback does not exist

Check-specific ChkQuery_EventTiming
queries
ChkQuery_EventInterval

ChkQuery_EventMessageId

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSynchBreakTimingViolation

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(9); // switch to ns precision
// Create and start the check for LIN break low phase violation
checkId = ChkStart_LINSynchBreakTimingViolation(13, 20,
"LINSynchBreakCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINSynchBreakCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSynchDelTimingViolation

ChkStart_LINSynchDelTimingViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINSynchDelTimingViolation

Syntax dword ChkStart_LINSynchDelTimingViolation (dword MinDelLen, dword


MaxDelLen)

dword ChkStart_LINSynchDelTimingViolation (dword MinDelLen, dword


MaxDelLen, char[] CaplCallback)

Function Checks the timing of the synchronization break field in LIN headers.

An event will be generated, if the measured length [in bit times] of break delimiter is
outside of the specified range.

Parameters MinDelLen

0 Minimum length of break delimiter shall not be checked

>0 Minimum allowed length of break delimiter

Unit: bit time

MaxDelLen

0 Maximum length of break delimiter shall not be checked

>0 Maximum allowed length of break delimiter

Unit: bit time

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Range specified for delimiter length is invalid

CAPL callback does not exist

Check-specific ChkQuery_EventTiming
queries
ChkQuery_EventInterval

ChkQuery_EventMessageId

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINSynchDelTimingViolation

Example
...
dword checkId;
ChkConfig_SetPrecision(9); // switch to ns precision
// Create and start the check for LIN Synch Delimiter violation
checkId = ChkStart_LINSynchDelTimingViolation(1, 5,
"LINSynchDelimiterCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINSynchDelimiterCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINWakeupReqLengthViolation

ChkStart_LINWakeupReqLengthViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINWakeupReqLengthViolation

Syntax dword ChkStart_LINWakeupReqLengthViolation (duration MinLength, duration


MaxLength)

dword ChkStart_LINWakeupReqLengthViolation (duration MinLength, duration


MaxLength, char[] CaplCallback)

As constructor TestCheck::StartLINWakeupReqLengthViolation (duration MinLength, duration


function MaxLength)

TestCheck::StartLINWakeupReqLengthViolation (duration MinLength, duration


MaxLength, char[] CaplCallback)

Function Checks the length of LIN Wake-up request.

An event will be generated, if a measured length of the Wake-up request is out of the
specified range.

Info

According to the LIN specification the Wake-up request is a dominant signal


in the range of a minimum of 250µs and a maximum of 5ms.

Parameters MinLength

0 Minimum length shall not be checked

>0 Minimum allowed length

Unit: Can be set with ChkConfig_SetPrecision.

MaxLength

0 Maximum length shall not be checked

>0 Maximum allowed length time

Unit: Can be set with ChkConfig_SetPrecision.

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Range specified for Wake-up request length is invalid

CAPL callback does not exist

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINWakeupReqLengthViolation

Check-specific ChkQuery_EventInterval
queries

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(6); // switch to µs precision
// Create and start the check for LIN Wake-up request
checkId = ChkStart_LINWakeupReqLengthViolation(250, 1000,
"LINWakeupLenCallback");
ChkConfig_SetPrecision(3); // switch to ms precision (default)
...
// CAPL callback for violation notification
void LINWakeupLenCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINWakeupRetryViolation

ChkStart_LINWakeupRetryViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_LINWakeupRetryViolation

Syntax dword ChkStart_LINWakeupRetryViolation (duration TimeoutAfterWakeup,


duration TimeoutAfterThreeWakeups, float Tolerance, dword MaxRetryNum,
char[] CaplCallback)

dword ChkStart_LINWakeupRetryViolation (duration TimeoutAfterWakeup,


duration TimeoutAfterThreeWakeups, float Tolerance, dword MaxRetryNum)

dword ChkStart_LINWakeupRetryViolation (dword MaxRetryNum, char[]


CaplCallback)

dword ChkStart_LINWakeupRetryViolation (dword MaxRetryNum)

As constructor TestCheck::StartLINWakeupRetryViolation (duration TimeoutAfterWakeup,


function duration TimeoutAfterThreeWakeups, float Tolerance, dword MaxRetryNum,
char[] CaplCallback)

TestCheck::StartLINWakeupRetryViolation (duration TimeoutAfterWakeup,


duration TimeoutAfterThreeWakeups, float Tolerance, dword MaxRetryNum)

TestCheck::StartLINWakeupRetryViolation (dword MaxRetryNum, char[]


CaplCallback)

TestCheck::StartLINWakeupRetryViolation (dword MaxRetryNum)

Function Checks number of LIN wakeup signals and the time between them.

An event will be generated, if

• Number of wakeup signals exceeds the specified maximum


• Timeout between two consecutive wakeup signals is out of the specified range.

Parameters TimeoutAfterWakeup

0 Timeout between two consecutive retransmissions shall not be checked

>0 Timeout between two consecutive retransmissions

Unit: Can be set with ChkConfig_SetPrecision.

Default: 150 ms.

TimeoutAfterThreeWakeups

0 Timeout after each three retransmissions shall not be checked

>0 Timeout after each three retransmissions

Unit: Can be set with ChkConfig_SetPrecision.

Default: 1.5 sec.

Tolerance

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_LINWakeupRetryViolation

Allowed tolerance for timeout values

Value range: [0 .. 100]

Unit: percents [%]

Default: 14%.

MaxRetryNum

0 Maximum number of retransmissions shall not be checked

>0 Maximum allowed number of retransmissions

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors No parameters to validate

CAPL callback does not exist

Check-specific ChkQuery_EventInterval
queries
ChkQuery_EventReaso

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 LIN — •

7.0 SP5: method LIN — •

Example
...
dword checkId;
ChkConfig_SetPrecision(3); // set precision to ms
// Create and start the check for LIN Wake-Up signals
// Parameters to validate: Timeout between two wake-up signals – 150 ms,
// Timeout after each three wake-up signals – 1.5 sec, Allowed tolerance
2%, maximum
// expected number of retransmitted Wake-Up signals - 4
checkId = ChkStart_LINWakeupRetryViolation (150, 1500, 2, 4, "
LINWakeupRetryCallback");
...
// CAPL callback for violation notification
void LINWakeupRetryCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_SignalCycleTimeViolation

ChkStart_SignalCycleTimeViolation
CAPL Function Overview » Test Service Library » Checks » ChkStart_SignalCycleTimeViolation

Syntax dword ChkStart_SignalCycleTimeViolation (Signal ObservedSignal, duration


MinCycleTime, duration MaxCycleTime)

dword ChkStart_SignalCycleTimeViolation (Signal ObservedSignal, duration


MinCycleTime, duration MaxCycleTime, char[] CaplCallback)

Function Checks the occurrences of a signal.

An event will be generated, if the time between two consecutive signal occurrences is
out of the specified range.

Info

Limit set to 0 is considered as "cycle time is undefined";

At least one limit has to be more than 0.

Parameters ObservedSignal

Signal to observe. It must exist in DB

MinCyc

0 Minimum cycle time shall not be checked

>0 Minimum allowed cycle time

Unit: Is set with ChkConfig_SetPrecision()

MaxCycleTime

0 Maximum cycle time shall not be checked

>0 Maximum allowed cycle time

Unit: Is set with ChkConfig_SetPrecision()

CaplCallback

Name of CAPL callback function to be called on generated event. In simulation nodes


this parameter has to be set. In test modules this parameter is optional.

Return values 0: Check could not be created and must not be referenced

CheckId [dword]
> 0: Check was created successfully and may be referenced using the returned (handle-
) value.

Possible errors Signal does not exist in DB

Range specified for cycle time is invalid

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ChkStart_SignalCycleTimeViolation

Signal is not mapped to a message

CAPL callback does not exist

Check-specific ChkQuery_EventMessageName
queries
ChkQuery_EventMessageId

ChkQuery_EventInterval

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 LIN — •

7.5 LIN, CAN — •

Example
...
dword checkId;
// Create and start the check for LIN Wake-up request
checkId = ChkStart_SignalCycleTimeViolation(Motor1State_Cycl::Motor1Temp,
29, // min. cycle time in ms
32, // max cycle time in ms
"SigCycleTimeCallback");
...
// CAPL callback for violation notification
void SigCycleTimeCallback (dword aCheckId)
{
ChkQuery_EventStatusToWrite(aCheckId);
}

| Classes and Objects in CAPL | Functions to Configure Checks | Commands to Control Checks |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmControl_Start, StmControl_Stop, StmControl_Reset, StmControl_Destroy

StmControl_Start, StmControl_Stop, StmControl_Reset,


StmControl_Destroy
CAPL Function Overview » Test Service Library » Stimulus Functions » StmControl_Start, StmControl_Stop, StmControl_Reset,
StmControl_Destroy

Syntax long StmControl_Start(Stimulus::TstimulusId)

long StmControl_Stop(Stimulus::TstimulusId)

long StmControl_Reset(Stimulus::TstimulusId)

long StmControl_Destroy(Stimulus::TstimulusId)

As destructor stimulus.Destroy()

Method stimulus.Start()

stimulus.Stop()

stimulus.Reset()

Function The four control functions have the same Parameter. They only need an ID that refers to
the specific stimulus.

Parameters Stimulus::TStimulusId

Must exist

Return values 0: Successful

-1: Stimulus for given ID does not exist

-2: Node-Layer module is deactivated and cannot process the request

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

7.0 SP5: method — — •

Example

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_CSV (cyclical)

StmCreate_CSV (cyclical)
CAPL Function Overview » Test Service Library » Configuration Functions » StmCreate_CSV (cyclical)

Syntax To stimulate signals


dword StmCreate_CSV(message aMessage, dbsignal aDBSignal, dword
CycleTime, const char *aFile)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_CSV(dbsignal aDBSignal, dword CycleTime, const char
*aFile)

To stimulate environment variables


dword StmCreate_CSV(dbenvvar EnvVarHandle, dbsignal aDBSignal, dword
CycleTime, const char *aFile)

To stimulate system variables


dword StmCreate_CSV(sysvar SystemVariable, dbsignal aDBSignal, dword
CycleTime, const char *aFile)

As constructor TestStimulus::CreateCSV(message aMessage, dbsignal aDBSignal, dword


function CycleTime, const char *aFile)

TestStimulus::CreateCSV(dbsignal aDBSignal, dword CycleTime, const char


*aFile)

TestStimulus::CreateCSV(dbenvvar EnvVarHandle, dbsignal aDBSignal, dword


CycleTime, const char *aFile)

TestStimulus::CreateCSV(sysvar SystemVariable, dbsignal aDBSignal, dword


CycleTime, const char *aFile)

Function Creates stimulus generator with csv file as data source.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

aFile

Must exist
If file not exists: EDI Invalid data input (measurement stops)

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

CycleTime

ms; 1 < x < ∞

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_CSV (cyclical)

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Defines the cycle in which the value of the environment or system variable is being
updated.

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Later this ID can be used to control the stimuli

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Example

To stimulate signals:
mId = StmCreate_CSV(MsgBuf, Msg::Sig, CycleTime, File);

To stimulate signals with the Interaction Layer:


mId = StmCreate_CSV(Msg::Sig, CycleTime, File);

To stimulate environment variables:


mId = StmCreate_CSV(EnvVarToStimulate, Msg::Sig, CycleTime, File);

To stimulate system variables:


mId = StmCreate_CSV(SysVarToStimulate, Msg::Sig, CycleTime, File);

| Stimulus Generator: CSV File as Data Source | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_CSV (non-cyclical)

StmCreate_CSV (non-cyclical)
CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_CSV (non-cyclical)

Syntax To stimulate signals


dword StmCreate_CSV(message aMessage, dbsignal aDBSignal, const char
*aFile)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_CSV(dbsignal aDBSignal, const char *aFile)

To stimulate environment variables


dword StmCreate_CSV(dbenvvar EnvVarHandle, dbsignal aDBSignal, const char
*aFile)

To stimulate system variables


dword StmCreate_CSV(sysvar SystemVariable, dbsignal aDBSignal, const char
*aFile)

As constructor TestStimulus::CreateCSV(message aMessage, dbsignal aDBSignal, const char


function *aFile)

TestStimulus::CreateCSV(dbsignal aDBSignal, const char *aFile)

TestStimulus::CreateCSV(dbenvvar EnvVarHandle, dbsignal aDBSignal, const


char *aFile)

TestStimulus::CreateCSV(sysvar SystemVariable, dbsignal aDBSignal, const


char *aFile)

Function Creates stimulus generator with csv file as data source.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

aFile

Must exist
If file not exists: EDI Invalid data input (measurement stops)

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

Return values 0: Stimulus could not be created and must not be referenced

dword
>0: Stimulus was created successfully and may be referenced using the handle

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_CSV (non-cyclical)

Later this ID can be used to control the stimuli

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Example

To stimulate signals:
mId = StmCreate_CSV(MsgBuf, Msg::Sig, File);

To stimulate signals with the Interaction Layer:


mId = StmCreate_CSV(Msg::Sig, File);

To stimulate environment variables:


mId = StmCreate_CSV(EnvVarToStimulate, Msg::Sig, File);

To stimulate system variables:


mId = StmCreate_CSV(SysVarToStimulate, Msg::Sig, File);

| Stimulus Generator: CSV File as Data Source | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_EnvVar

StmCreate_EnvVar
CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_EnvVar

Syntax To stimulate signals


dword StmCreate_EnvVar(message aMessage, dbsignal aDBSignal, dbEnvVar
aEnvVar, dword CycleTime)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_EnvVar(dbsignal aDBSignal, dbEnvVar aEnvVar, dword
CycleTime)

As constructor TestStimulus::CreateEnvVar(message aMessage, const dbsignal aDBSignal,


function dbEnvVar aEnvVar, dword CycleTime)

TestStimulus::CreateEnvVar(const dbsignal aDBSignal, dbEnvVar aEnvVar,


dword CycleTime)

Function Creates the stimulus with environment variables as data source.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

aEnvVar

Must exist in DB

CycleTime

ms; 1 < x < ∞

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Later this ID can be used to control the stimuli

Availability Since Version Restricted to Measurement Simulation / Test


Setup Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

Example

To stimulate signals:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_EnvVar

mId = StmCreate_EnvVar(MsgBuf, Msg::Sig, EnvVar, CycleTime);

To stimulate signals with the Interaction Layer:


mId = StmCreate_EnvVar(Msg::Sig, EnvVar, CycleTime);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Ramp (limits taken from database)

StmCreate_Ramp (limits taken from database)


CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_Ramp (limits taken from database)

Syntax To stimulate signals


dword StmCreate_Ramp(message aMessage, dbsignal aDBSignal, dword
CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_Ramp(dbsignal aDBSignal, dword CycleTime, dword TimeUp,
dword TimeHigh, dword TimeDown, dword TimeLow)

To stimulate environment variables


dword StmCreate_Ramp(dbenvvar EnvVarHandle, dword CycleTime, dword
TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

To stimulate system variables


dword StmCreate_Ramp(sysvar SystemVariable, dword CycleTime, dword
TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

As constructor TestStimulus::CreateRamp(message aMessage, dbsignal aDBSignal, dword


function CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

TestStimulus::CreateRamp(dbsignal aDBSignal, dword CycleTime, dword


TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

TestStimulus::CreateRamp(dbenvvar EnvVarHandle, dword CycleTime, dword


TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

TestStimulus::CreateRamp(sysvar SystemVariable, dword CycleTime, dword


TimeUp, dword TimeHigh, dword TimeDown, dword TimeLow)

Function Creates a stimulus generator that creates a ramp.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

CycleTime

ms; 1 < x < ∞

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Defines the cycle in which the value of the environment or system variable is being
updated.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Ramp (limits taken from database)

TimeUp

ms; 0 < x < ∞

TimeHigh

ms; 0 < x < ∞

TimeDown

ms; 0 < x < ∞

Info

Time Up = Time High = Time Down = 0: ESE Invalid stimuli effect


(measurement stops)

TimeLow

ms; 0 < x < ∞

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Later this ID can be used to control the stimuli

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Example

To stimulate signals:
mId = StmCreate_Ramp(MsgBuf, Msg::Sig, CycleTime, Tup, Thigh, Tdown,
Tlow);
To stimulate signals with the Interaction Layer:
mId = StmCreate_Ramp(Msg::Sig, CycleTime, Tup, Thigh, Tdown, Tlow);

To stimulate environment variables:


mId = StmCreate_Ramp(EnvVarToStimulate, CycleTime, Tup, Thigh, Tdown,
Tlow);

To stimulate system variables:


mId = StmCreate_Ramp(SysVarToStimulate, CycleTime, Tup, Thigh, Tdown,
Tlow);

| Stimulus Generator: Sample Code StmCreate_Ramp | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Ramp (limits user defined)

StmCreate_Ramp (limits user defined)


CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_Ramp (limits user defined)

Syntax To stimulate signals


dword StmCreate_Ramp(message aMessage, dbsignal aDBSignal, double ValueA,
double ValueB, dword CycleTime, dword TimeUp, dword TimeHigh, dword
TimeDown, dword TimeLow)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_Ramp(dbsignal aDBSignal, double ValueA, double ValueB,
dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown, dword
TimeLow)

To stimulate environment variables


dword StmCreate_Ramp(dbenvvar EnvVarHandle, double ValueA, double ValueB,
dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown, dword
TimeLow)

To stimulate system variables


dword StmCreate_Ramp(sysvar SystemVariable, double ValueA, double ValueB,
dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown, dword
TimeLow)

As constructor TestStimulus::CreateRamp(message aMessage, dbsignal aDBSignal, double


function ValueA, double ValueB, dword CycleTime, dword TimeUp, dword TimeHigh,
dword TimeDown, dword TimeLow)

TestStimulus::CreateRamp(dbsignal aDBSignal, double ValueA, double


ValueB, dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown,
dword long TimeLow)

TestStimulus::CreateRamp(dbenvvar EnvVarHandle, double ValueA, double


ValueB, dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown,
dword TimeLow)

TestStimulus::CreateRamp(sysvar SystemVariable, double ValueA, double


ValueB, dword CycleTime, dword TimeUp, dword TimeHigh, dword TimeDown,
dword TimeLow)

Function Creates a stimulus generator that creates a ramp.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

ValueA and ValueB

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Ramp (limits user defined)

Info

Value A = Value B: ESE Invalid stimuli effect (measurement stops)

Attention

Value A and Value B are physical values, not raw values. They can be user-
defined or will be taken from the CANdb++ database (dbc-file) that is
assigned to the CANoe configuration and are called Minimum and Maximum
of the signal.

CycleTime

ms; 1 < x < ∞

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Defines the cycle in which the value of the environment or system variable is being
updated.

TimeUp

ms; 0 < x < ∞

TimeHigh

ms; 0 < x < ∞

TimeDown

ms; 0 < x < ∞

Info

Time Up = Time High = Time Down = 0: ESE Invalid stimuli effect


(measurement stops)

TimeLow

ms; 0 < x < ∞

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Later this ID can be used to control the stimuli.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Ramp (limits user defined)

Example 1

To stimulate signals:
mId = StmCreate_Ramp(MsgBuf, Msg::Sig, ValueA, ValueB, CycleTime, Tup,
Thigh, Tdown, Tlow);
To stimulate signals with the Interaction Layer:
mId = StmCreate_Ramp(Msg::Sig, ValueA, ValueB, CycleTime, Tup, Thigh,
Tdown, Tlow);

To stimulate environment variables:


mId = StmCreate_Ramp(EnvVarToStimulate, ValueA, ValueB, CycleTime, Tup,
Thigh, Tdown, Tlow);

To stimulate system variables:


mId = StmCreate_Ramp(SysVarToStimulate, ValueA, ValueB, CycleTime, Tup,
Thigh, Tdown, Tlow);

Example 2: Stimulate a signal without using the Interaction Layer


variables
{
message NeueBotschaft aNeueBotschaft;
mstimer mytimer;
dword yMin = 0;
dword yMax = 100;
dword ramp_cycletime = 50;
long stm_ramp;
}

on preStart
{
chkConfig_Init ("user");
stm_ramp = StmCreate_Ramp(aNeueBotschaft, NeueBotschaft::NeuesSignal,
yMin, yMax, ramp_cycletime, 5000, 100, 0, 0);
}

on start
{
long ret;
ret = StmControl_Start(stm_ramp);
settimer (mytimer, ramp_cycletime);
}

on timer mytimer
{
if (yMax == aNeueBotschaft.NeuesSignal) stmControl_Stop (stm_ramp);
output (aNeueBotschaft);
settimer (mytimer, ramp_cycletime);
}

on preStop
{
StmControl_Destroy (stm_ramp);
}

| Stimulus Generator: Sample Code StmCreate_Ramp | Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Toggle (limits taken from database)

StmCreate_Toggle (limits taken from database)


CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_Toggle (limits taken from database)

Syntax To stimulate signals


dword StmCreate_Toggle(message aMessage, dbsignal aDBSignal, dword
CycleTime)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_Toggle(dbsignal aDBSignal, dword CycleTime)

To stimulate environment variables


dword StmCreate_Toggle(dbenvvar EnvVarHandle, dword CycleTime)

To stimulate system variables


dword StmCreate_Toggle(sysvar SystemVariable, dword CycleTime)

As constructor TestStimulus::CreateToggle(message aMessage, dbsignal aDBSignal, dword


function CycleTime)

TestStimulus::CreateToggle(dbsignal aDBSignal, dword CycleTime)

TestStimulus::CreateToggle(dbenvvar EnvVarHandle, dword CycleTime)

TestStimulus::CreateToggle(sysvar SystemVariable, dword CycleTime)

Function Creates a stimulus generator that toggles between two values.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

CycleTime

ms; 1 < x < ∞

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Defines the cycle in which the value of the environment or system variable is being
updated.

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Toggle (limits taken from database)

Later this ID can be used to control the stimuli.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Example

To stimulate signals:
mId = StmCreate_Toggle(MsgBuf, Msg::Sig, CycleTime);
To stimulate signals with the Interaction Layer:
mId = StmCreate_Toggle(Msg::Sig, CycleTime);

To stimulate environment variables:


mId = StmCreate_Toggle(EnvVarToStimulate, CycleTime);

To stimulate system variables:


mId = StmCreate_Toggle(SysVarToStimulate, CycleTime);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Toggle (limits user defined)

StmCreate_Toggle (limits user defined)


CAPL Function Overview » Test Service Library » Stimulus Functions » StmCreate_Toggle (limits user defined)

Syntax To stimulate signals


dword StmCreate_Toggle(message aMessage, dbsignal aDBSignal, double
ValueA, double ValueB, dword CycleTime)

To stimulate signals with the Interaction Layer (IL)


dword StmCreate_Toggle(dbsignal aDBSignal, double ValueA, double ValueB,
dword CycleTime)

To stimulate environment variables


dword StmCreate_Toggle(dbenvvar EnvVarHandle, double ValueA, double
ValueB, dword CycleTime)

To stimulate system variables


dword StmCreate_Toggle(sysvar SystemVariable, double ValueA, double
ValueB, dword CycleTime)

As constructor TestStimulus::CreateToggle(message aMessage, dbsignal aDBSignal, double


function ValueA, double ValueB, dword CycleTime)

TestStimulus::CreateToggle(dbsignal aDBSignal, double ValueA, double


ValueB, dword CycleTime)

TestStimulus::CreateToggle(dbenvvar EnvVarHandle, double ValueA, double


ValueB, dword CycleTime)

TestStimulus::CreateToggle(sysvar SystemVariable, double ValueA, double


ValueB, dword CycleTime)

Function Creates a stimulus generator that toggles between two values.

Parameters aMessage

Must exist in DB

aDBSignal

Must exist in DB

EnvVarHandle

Must exist in DB

SystemVariable

Must be available in the configuration.

ValueA and ValueB

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmCreate_Toggle (limits user defined)

Info

Value A = Value B: ESE Invalid stimuli effect (measurement stops)

Attention

Value A and Value B are physical values, not raw values. They can be user-
defined or will be taken from the CANdb++ database (dbc-file) that is
assigned to the CANoe configuration and are called Minimum and Maximum
of the signal.

CycleTime

ms; 1 < x < ∞

Defines the cycle in which the signal value in the message buffer is being updated.
There is no affect to the bus.

Defines the cycle in which the value of the environment or system variable is being
updated.

Return values 0: Stimulus could not be created and must not be referenced

dword >0: Stimulus was created successfully and may be referenced using the handle

Later this ID can be used to control the stimuli.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 — — •

5.1: stimulate with IL — — •

7.0 SP5: method — — •

7.5: system variable — — •


support

Example

To stimulate signals:
mId = StmCreate_Toggle(MsgBuf, Msg::Sig, ValueA, ValueB, CycleTime);
To stimulate signals with the Interaction Layer:
mId = StmCreate_Toggle(Msg::Sig, ValueA, ValueB, CycleTime);

To stimulate environment variables:


mId = StmCreate_Toggle(EnvVarToStimulate, ValueA, ValueB, CycleTime);

To stimulate system variables:


mId = StmCreate_Toggle(SysVarToStimulate, ValueA, ValueB, CycleTime);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StmQuery_Valid

StmQuery_Valid
CAPL Function Overview » Test Service Library » Stimulus Functions » StmQuery_Valid

Syntax long StmQuery_Valid (Check aStimulusId)

Method stimulus.QueryValid()

Function Examines whether a stimulus with particular Id is valid.

Parameters Dword aStimulusId

Return values = 0: Refer the query error codes

> 0: Valid Id

Applicable for All stimuli

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 SP5: method — — •

Example
double result;
dword stmId;
stmId = StmCreate_Toggle(Velocity, 60, 80, 100);
// ... execute test sequence
result = StmQuery_Valid(stmId);

| Classes and Objects in CAPL |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Types of Functions

Test Service Library: Types of Functions


CAPL Function Overview » Test Service Library » Types of Functions

Check functions shall be identifiable easily. So the functions are to be prefixed in the following way:

• ChkCreate /ChkStart_
for check creation and check start functions

• ChkControl_

for check control functions

• ChkQuery_

for check result query functions

• ChkConfig_

for TSL configuration functions

Function and user interface

Types of arguments (defined in CAPL) that can be handed over.

Type Explanation

Network Network database symbol (or case sensitive string).

Node Node database symbol (or case sensitive string).

Message ID or database symbol of the message to check (or case sensitive string).

Signal Database symbol of the signal to check, qualified with the message (or case sensitive signal
short name).

Callback Name of the function to call (signature is fixed).

Duration Length of an interval with the unit of the current precision.


(Default: milliseconds)

Check Reference-ID of a check (type "dword"), returned on check creation.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Commands to Control Checks

Test Service Library: Commands to Control Checks


CAPL Function Overview » Test Service Library » Status Report Functions

Usage in Test Modules as Constraints/Conditions

In CAPL Test Modules it's recommended to use Checks as Constraints or Conditions and to create and start
them straight before their usage (ChkStart_...).
testcase TC ()
{
...
chkid = ChkStart_MsgRelCycleTimeViolation (StatusMsg, 0.8, 1.2);
TestAddConstraint (chkid);
...
TestRemoveConstraint (chkid);
}

In this case there's no need to use Callback functions. In addition it's usually not necessary to query test
results since violations of the test specification directly influence the test result and will be documented
in the test report together with some relevant information.

In CAPL Simulation Nodes Checks can be used and controlled directly. In principle this works in CAPL Test
Modules, too. Nevertheless it is not recommended and - apart from some rare special cases - there are no
advantages in doing so.

Using checks in CAPL Simulation Nodes

• Define a new check and start immediately after you finished the definition
• Define a new check for later use (recommended!)
• Start a predefined check (recommended!)

Recommendation

You can define all checks "on_prestart" and use the control functions during a measurement to start/stop
a check.

Check lifecycle control

Checks may be stopped, (re-)started, reset and destroyed:

• Once stopped, the check will no longer test the occurrence of the event condition. Its state is
guaranteed to stay the same until it is restarted.
• A check that has been stopped or created earlier and has not been activated yet, can be activated
again and will generate events if error conditions occur.
• The state of the check may be reset, initializing it.
• When destroyed, the reference to the check looses validity and no information on its previous state
can be queried. Any later access to the check will lead to a fatal error.

Remark

For test programs of typical size and duration, there is no necessity to destroy the checks in CAPL. Only
those rare cases with extremely long running tests and dynamic check creation need to destroy checks to
prevent a lack of memory.

• Checks are automatically deleted on stop of measurement.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Commands to Control Checks

Check control CAPL functions

For the check control there are the following functions to influence. These functions can be used to turn
off checking in not relevant time (e.g. with changes of the network hardware), and to continue checking.
These control functions can also be used to setup dependencies between checks:

Functions Short description

ChkControl_Start Begins or continues checking the event condition.

ChkControl_Stop Turns off the checking of the event condition.

ChkControl_Reset Initializes the status of the check.

ChkControl_Destroy Destroys the check.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Checks

Test Service Library: Checks


CAPL Function Overview » Test Service Library » Check Overview

The following checks are available with CANoe:

Absence of defined messages Short description

ChkCreate_MsgOccurrenceCount, ChkStart_MsgOccurrenceCount The check is useful to observe the


absence of defined messages on
the bus.

Absence of a FlexRay Erroneous Frame Short description

TestCheck::CreateFlexRayFrameErrorOccurrenceCount, Checks the absence of erroneous


TestCheck::StartFlexRayFrameErrorOccurrenceCount frames for the specified frame/slot
on the bus.
TestCheck::CreateNodeFlexRayFrameErrorsOccurrenceCount,
TestCheck::StartNodeFlexRayFrameErrorsOccurrenceCount
Absence of a FlexRay Null Frame Short description

TestCheck::CreateFlexRayNullFrameOccurrenceCount, Checks the absence of Null frames


TestCheck::StartFlexRayNullFrameOccurrenceCount for the specified frame/slot on the
bus.
TestCheck::CreateNodeFlexRayNullFramesOccurrenceCount,
TestCheck::StartNodeFlexRayNullFramesOccurrenceCount
Burst time limit Short description

ChkCreate_BurstTimeLimitViolation, Checks the maximum burst time on


ChkStart_BurstTimeLimitViolation a bus.

Cycle time Short description

ChkCreate_MsgAbsCycleTimeViolation, This check is useful to supervise a


ChkStart_MsgAbsCycleTimeViolation particular range in message cycle
time changes.
ChkCreate_MsgRelCycleTimeViolation,
ChkStart_MsgRelCycleTimeViolation

ChkCreate_NodeMsgsRelCycleTimeViolation,
ChkStart_NodeMsgsRelCycleTimeViolation

DLC monitoring Short description

ChkCreate_InconsistentDLC, ChkStart_InconsistentDLC This check monitors the DLC,


respectively payload length of a
ChkCreate_InconsistentRxDLC, ChkStart_InconsistentRxDLC message.

ChkCreate_InconsistentTxDLC, ChkStart_InconsistentTxDLC

Error frame Short description

ChkCreate_ErrorFramesOccured, ChkStart_ErrorFramesOccured This check is suited to supervise


the occurrence of error frames on
the bus.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Checks

LIN Baudrate Short description

ChkStart_LINMasterBaudrateViolation Checks the LIN Master baud rate.

LIN Configuration Requests Short description

ChkStart_LINReconfRequestFormatViolation Checks the format of LIN


configuration requests.

LIN Diagnostic Delay Times Short description

ChkStart_LINDiagDelayTimesViolation Checks the values of P2_min and


ST_min.

LIN Event-triggered frame format Short description

ChkStart_LINETFViolation Checks the format LIN Event-


triggered frame response.

LIN Header Duration Short description

ChkStart_LINHeaderToleranceViolation Checks the LIN header transmission


time.

LIN Master Initialization Time Short description

ChkStart_LINMasterInitTimeViolation Checks an initialization time of LIN


Master.

LIN Response Error Flag Short description

ChkStart_LINRespErrorSignal Checks the LIN Response_Error


signal.

LIN Schedule Table Short description

ChkStart_LINSchedTableViolation Checks LIN schedule table for


correspondence with the database
definition.

LIN Sync Break (dominant phase) Short description

ChkStart_LINSyncBreakTimingViolation Checks the timing of the


synchronization break field
(dominant phase) in LIN headers.

LIN Sync Break (recessive phase) Short description

ChkStart_LINSyncDelTimingViolation Checks the timing of the


synchronization break field
(recessive phase) in LIN headers.

LIN Wakeup-Request Length Short description

ChkStart_LINWakeupReqLengthViolation Checks the length of LIN Wakeup


request.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Checks

LIN Wakeup-Request Retries Short description

ChkStart_LINWakeupRetryViolation Checks number of LIN Wakeup


requests and the time between
them.

Message Count Observation (FlexRay only) Short description

TestCheck::CreateMsgSendCountViolation, Check is used to monitor the


TestCheck::StartMsgSendCountViolation minimum and/or maximum number
for each of the defined messages
TestCheck::CreateNodeMsgSendCountViolation,
within a specified cyclic time
TestCheck::StartNodeMsgSendCountViolation
interval.
Message distance Short description

ChkCreate_MsgDistViolation, ChkStart_MsgDistViolation This check is useful for


spontaneous messages where one
message depends to another
message; e.g. for token-ring
initializations for network
management.

MOST error messages Short description

ChkCreate_MostErrorMessage, ChkStart_MostErrorMessage This check is used to monitor


occurrence of MOST error
messages.

MOST Light&Lock observation Short description

ChkCreate_MostCriticalUnlock, ChkStart_MostCriticalUnlock This check is used to observe the


Light & Lock condition of the MOST
ChkCreate_MostLightOff, ChkStart_MostLightOff hardware interface.

ChkCreate_MostShortUnlock, ChkStart_MostShortUnlock

ChkCreate_MostStableLock, ChkStart_MostStableLock

MOST NetState observation Short description

ChkCreate_MostNetState, ChkStart_MostNetState This check is used to monitor the


NetState state of the MOST
hardware interface.

MOST property protocol observation Short description

ChkCreate_MostPropertyProtocolError, This check observes the


ChkStart_MostPropertyProtocolError compliance to the MOST protocol
with regard to message sequences
and response times for a given
property function.

MOST method protocol observation Short description

ChkCreate_MostMethodProtocolError, This check observes the


ChkStart_MostMethodProtocolError compliance to the MOST protocol
with regard to message sequences

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Checks

and response times for a given


method function.

Node active Short description

ChkCreate_AllNodesDead, ChkStart_AllNodesDead This check reports a problem, if


the node has not send any of its Tx
ChkCreate_NodeDead, ChkStart_NodeDead messages within a given time-
interval.

Node inactive Short description

ChkCreate_AllNodesBabbling, ChkStart_AllNodesBabbling This check allows the observation


of the end of the activity of nodes.
ChkCreate_NodeBabbling, ChkStart_NodeBabbling

Occurrence Distance Short description

ChkCreate_NodeMsgsAbsDistViolation, ChkStart_ This check allows the supervision


NodeMsgsAbsDistViolation of the minimum send distance of
all Tx messages of a node on one
bus.

Occurrence of a message Short description

ChkCreate_MsgRelOccurrenceViolation, Checks are used to monitor the


ChkStart_MsgRelOccurrenceViolation sending delay of messages which
allow both cyclic and spontaneous
ChkCreate_NodeMsgsRelOccurrenceViolation, transmission.
ChkStart_NodeMsgsRelOccurrenceViolation

Signal value Short description

ChkCreate_MsgSignalValueInvalid, ChkStart_MsgSignalValueInvalid This check is useful to supervise


the value of signals.
ChkCreate_MsgSignalValueRangeViolation,
ChkStart_MsgSignalValueRangeViolation

Signal value constancy Short description

ChkCreate_SignalValueChange, ChkStart_SignalValueChange The check is useful to observe the


constancy of a signal value.

Timeout Short description

ChkCreate_Timeout, ChkStart_Timeout This checks creates an error event


if particular time is expired.

Unknown message received Short description

ChkCreate_UndefinedMessageReceived, This check listens to the bus and


ChkStart_UndefinedMessageReceived reports a violation, if a message
was received that is not defined in
any of the databases that are
associated to the current bus.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Configuration Functions

Test Service Library: Configuration Functions


CAPL Function Overview » Test Service Library » Configuration Functions

The functions ChkConfig_Init and ChkConfig_SetPrecision permit node-wide configuration of the


TestServiceLibrary.

If the TSL is to be used in Simulation Nodes (not CAPL Test Modules!), the initialization function
ChkConfig_Init should be called. With this function behavior of the TSL in error cases can also be
configured there in roughly outlined steps.

The time base of the TSL can be modified for the node in question.

The function ChkConfig_SetTitle permits the configuration of a check.

Functions Short description

ChkConfig_Init Initializes TSL to be used subsequently.

ChkConfig_SetPrecision Configures the TSL time basis for the current node.

ChkConfig_SetTitle Sets the title of a check.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Status Report Functions

Test Service Library: Status Report Functions


CAPL Function Overview » Test Service Library » Status Report Functions

In order to query information about a check, generic and check specific status report functions are
implemented. The general status report functions are working with all types of checks. The check specific
status report functions are working only with a special part of the checks. If a check specific status report
function is called for a check that does not support this function, a warning will be displayed in the Write
window.

Mode of Operation

The goal of the following functions is to give a value for the quality of the system, but the quality depends
hardly from the runtime of the check. For statistical reasons, all values are derived in a way that an error
event is supposed just before the check has been started and just after the check has been stopped. So
the maximum time between events will be never greater than the time between the event and check start
and the time between the event and check stop.

The following figure explains the statistical data collection in more detail:

At first, session 1 is performed. The red arrows are marking error events, the yellow triangles are marking
particular times, the following description will refer.

After the first session, the following statistical values could be queried at the time "query #1":

• min distance = t1
• max distance = t2

Then the session 2 is started without resetting the check. At the time "query #2", the following statistical
values could be queried (while the check is running).

• min distance = t1
• max distance = t10a

After this session at "query #3", the following results will occur:

• min distance = t12


• max distance = t10

Generic Status Report functions Short description


These functions return statistics on the number of events that any check generated since its creation or
reset. They also include functions to convert the check status to a string, for logging.
Generic status report functions are available for all check types.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Status Report Functions

These query functions may not raise an error class that leads to a measurement stop.

ChkQuery_NumEvents Returns the number of events generated by this check since


its initialization.

ChkQuery_Valid Examines whether a check with particular Id is valid.

StmQuery_Valid Examines whether a stimulus with particular Id is valid.

Statistic Data Collection

The following functions return a timely distance given in the actual precision. The decimal places are cut.
To get a value with more decimals (more exact value), the precision can be modified with
ChkConfig_SetPrecision.

ChkQuery_StatEventFreePeriodAvg Returns the average timely distance between events and


check starts/stops.

ChkQuery_StatEventFreePeriodMax Returns the maximum timely distance between events and


check starts/stops.

ChkQuery_StatEventFreePeriodMed Returns the average timely distance between events and


check starts/stops.

ChkQuery_StatEventFreePeriodMin Returns the minimum timely distance between events and


check starts/stops.

ChkQuery_StatProbeIntervalAvg Returns the average timely distance between 2 consumed


message events.

ChkQuery_StatProbeIntervalMax Returns the maximum timely distance between 2 consumed


message events.

ChkQuery_StatProbeIntervalMin Returns the minimum timely distance between 2 consumed


message events.

Generic textual Status report functions

ChkQuery_EventStatus Converts the status into a string that can be printed.

The following functions allow the easy writing of the status text to different output sinks.

ChkQuery_EventStatusToLog Uses the output of ChkQuery_EventStatus and writes the


result to the log file.

ChkQuery_EventStatusToWrite Uses the output of ChkQuery_EventStatus and writes the


result to the Write window.

ChkQuery_StatNumProbes Returns the number of probes (measurements) that have


been considered by the check.

Check specific Status Report functions Short description

The check-specific status report functions permit querying of information that is only available for some
types of checks. Which queries are possible and meaningful depend on the purposes of the individual
checks.
Included in the description of individual check types are definitions of which check-specific Status Report

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Status Report Functions

functions are supported.

ChkQuery_EventInterval Returns the last time-interval that has led to the event.

ChkQuery_EventMessageId Returns the Id of the message that has forced the event.

ChkQuery_EventMessageName Stores the name of the message in a buffer.

ChkQuery_EventSignalValue Enables access to the signal value which was last reported
by a check as invalid.

ChkQuery_EventSignalValue (for signals Enables access to the signal (only with positive) value which
with positive values) was last reported by a check as invalid.

ChkQuery_EventTimeStamp Retrieves timestamp of last fired event.

MOST specific functions

ChkQuery_NumRequests Returns the total number of requests that occurred during


the current observation period.

ChkQuery_NumTimedoutRequests Returns the number of requests within the current


observation period for which no corresponding response
message was observed during the specified timeout.

ChkQuery_RequestDstAdr Returns the destination address of the request message,


which last led to a protocol violation.

ChkQuery_RequestFBlockId Returns the FBlock of the request message, which last led to
a protocol violation.

ChkQuery_RequestFunctionId Returns the FunctionID of the request message, which last


led to a protocol violation.

ChkQuery_RequestInstId Returns the InstID of the request message, which last led to
a protocol violation.

ChkQuery_RequestOpType Returns the OpType of the request message, which last led
to a protocol violation.

ChkQuery_RequestSrcAdr Returns the source address of the request message, which


last led to a protocol violation.

ChkQuery_RequestTimestamp Returns the reception time stamp of the request message,


which last led to a protocol violation.

ChkQuery_StatAvResponseTime Returns the average time lag between the request and
corresponding response messages.

ChkQuery_StatMaxValidResponseTime Returns the longest time lag between the request and
corresponding response message that occurred during the
current observation period.

ChkQuery_StatMinResponseTime Returns the shortest time lag between the request and
corresponding response message that occurred during the
current observation period.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Status Report Functions

LIN specific functions

ChkQuery_EventMessageContents Stores the data bytes of the message into a buffer.

ChkQuery_EventNodeName Stores the name of the node into a buffer.

ChkQuery_EventSchedSlotIndex Retrieves slot index of a schedule table for which the event
has been sent.

ChkQuery_EventReason Retrieves the exact reason of firing event in the LIN specific
check.

ChkQuery_EventTiming Retrieves the timing value that has been violated in the LIN
specific check.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Error Codes

Test Service Library: Error Codes


CAPL Function Overview » Test Service Library » Error Codes

For all status report functions, the following return values and raised error classes are applied. The query
functions always use a wider range of return values. In most cases the particular check of the return value
isn't necessary. A simple check to a value >0 (stands for valid) is enough.

Please refer the specification of each query function to get the complete value range of return values.

Return values Return value meanings and raised error class

0 Query has been performed successfully

-1 Check does not exist


Class: Access to non-existing check

-2 Check does not support this query


Class: Invalid query on check

-3 The Check was never active


Class: Invalid query on check

-4 No event has occurred


Class: Information

-5 Pointer to CAPL-Argument is NULL


Class: Invalid test specification

-6 There are multiple objects that match on this query


Class: Ambiguous query. Multiple objects match on this query

-7 Node-Layer module is deactivated and cannot process the query

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Stimulus Functions

Test Service Library: Stimulus Functions


CAPL Function Overview » Test Service Library » Stimulus Functions

Stimulus Generators are part of the Test Service Library. They allow the user to stimulate signals or
environment variables - referred to as data sinks in the following - according to a specific time behavior.

With the exception of StmCreate_CSV (non-cyclic) all Stimulus Generators have a cycle time. This
cycle time indicates the cycle at which the value of the data sink is updated.

With the exception of StmCreate_EnvVar each Stimulus Generator has a period length T after which the
values are repeated for the data sink. The program supports user-defined integers up to 32 bit.

The following types of Stimulus Generators are available:

Stimulus Generator: Toggle Short description


between two values

StmCreate_Toggle(limits taken Create a stimulus generator that toggles between two values.
from database)

StmCreate_Toggle(limits user
defined)

Stimulus Generator: Generate a Short description


ramp

StmCreate_Ramp(limits taken Create a stimulus generator that creates a ramp.


from database)

StmCreate_Ramp(limits user
defined)
Stimulus Generator: Short description
Environment variable as data
source

StmCreate_EnvVar Create the stimulus with environment variables as data source.

Stimulus Generator: CSV file as Short description


data source

StmCreate_CSV(non-cyclical) Create stimulus generator with CSV file as data source.

StmCreate_CSV(cyclical)

Data sink Short description

Stimulus Generator with a signal The message is sent onto the bus independent of the Stimulus
as data sink – Signal is sent in Generator and sending must be executed separately, e.g. in CAPL
CAPL. using a cyclic timer. If the signal value needs to be set before the
first start of the Stimulus Generator it may also be set in CAPL.

Stimulus Generator with a signal The message is sent out onto the bus independent of the Stimulus
as data sink – Signal is sent over Generator, and this is executed automatically via the Interaction
Interaction Layer. Layer. The signal value before the first start of the Stimulus
Generator is also set by the Interaction Layer. A precondition is that
the Interaction Layer must be loaded as a Nodelayer module in the

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Test Service Library: Stimulus Functions

simulation node and in a conformant database, since sending of the


signal depends on the signal type for example.

Stimulus Generator with an


environment variable as data sink.

The Stimulus Generators are created and controlled by the following functions in CAPL:

In a CAPL Simulation Node the Test Service Library must be initialized at the beginning. In CAPL or XML
Test Modules this is neither necessary nor even possible.

Function Short description

ChkConfig_Init The Test Service Library must always be initialized at the


beginning:

Initializing with the user or developer role in CAPL's "pre-


start".

StmCreate_xxx Creation of Stimulus Generators.

StmControl_Start, StmControl_Stop, During the measurement the Generators can be started,


StmControl_Reset, StmControl_Destroy stopped, reset or destroyed in CAPL programs with the
functions.

Info

• Once the Stimulus Generator has been destroyed the stimulus can no longer be used.
If necessary a new stimulus must be generated by another means.
• All given signal values are always physical values.
Physical value = raw value * factor + offset
The values for "factor" and "offset" are defined in the database.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Stimulus Generator: Creating a Ramp

Stimulus Generator: Creating a Ramp


CAPL Function Overview » Test Service Library » Stimulus Generator: Creating a Ramp

This Stimulus Generator generates a ramp. After the start the Stimulus Generator updates the data sink
(signal or environment variable) periodically. Value A and value B describe the upper and lower limits of
the ramp, respectively. The Reset Function of the Generator can be used either after a Generator stop or
while it is operating (see below). In both cases the Reset Function causes the value of the data sink to
immediately assume value A and the ramp begins anew. The Reset Function has no effect on the cycle
time.

Info

At least Time Up, Time High or Time Down have to be set to a value > 0. If check failed the
measurement will be stopped.

Functions that create the Stimulus Generator for stimulating signals and environment/system
variables

• StmCreate_Ramp (limits taken from database)


• StmCreate_Ramp (limits user defined)

| Stimulus Generator: Sample Code StmCreate_Ramp |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Stimulus Generator: CSV File as Data Source

Stimulus Generator: CSV File as Data Source


CAPL Function Overview » Test Service Library » Stimulus Generator: CSV File as Data Source

This generator takes values for updating the data sink (signal or environment variable) from a CSV file.
Output of all values from the CSV file defines one period T of the Stimulus Generator. These periods are
automatically repeated. The Reset Function causes a new period to begin immediately, i.e. values are
taken from the beginning of the CSV file again.
If a Cycle Time is specified for generation by the Stimulus Generator, the data sink is updated periodically
with the next value from the CSV file.
If the Stimulus Generator is operating non periodically, the time stamps associated with the values are
taken from the CVS file to control updating of the data sink. The format of the CSV file is exactly the same
in both cases.

First Example of a csv file:


Time,DB1::Msg1::Sig1,Msg2::Sig2,Sig3
0.500000,0.000000,1.000000,0.000000
0.800000,,2.000000,
1.000000,0.000000,3.000000,
1.700000,,4.000000,
1.800000,0.000000,5.000000,
2.000000,,6.000000,

Non-cyclical

Info

The time stamps are absolute data in reference to the start of a new period.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Stimulus Generator: CSV File as Data Source

Cyclical

Info

File format: Two backslashes "\\" or one forward slash "/" must be inserted after the drive
characters and between the folders, e.g.:

• C:\\path\\to\\the\\file\\testfile.csv

or

• C:/path/to/the/file/testfile.csv

There are various restrictions with regard to formatting the CSV file. These restrictions are derived from
Trace Window Export Options.

Second Example of a csv file: (same effect as first example)

Time , DB1::Msg1::Sig1, Msg2::Sig2, Sig3


50000 , 0.000000 , 1.000000 , 0.000000
80000 , , 2.000000 ,
100000 , 0.000000 , 3.000000 ,
1.700000; ; 4.000000 ;
1.800000; 0.000000 ; 5.000000 ;
2.000000; ; 6.000000 ;

Info

Blank characters are ignored

Functions that create the Stimulus Generator for stimulating signals and environment/system
variables

• StmCreate_CSV (non-cyclical)
• StmCreate_CSV (cyclical)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Stimulus Generator: Environment variable as Data Source

Stimulus Generator: Environment variable as Data Source


CAPL Function Overview » Test Service Library » Stimulus Generator: Environment variable as Data Source

This Generator offers the option of setting any desired time characteristic for the data sink.

After the start of the Stimulus Generator the data sink (signal or environment variable) is updated
periodically with the momentary value of the environment variable.

The Reset Function always causes the value of the data sink to be immediately set to zero. It has no effect
on the cycle time.

Function to create the Stimulus Generator: StmCreate_EnvVar

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Requirements for the settings of the Trace window export

Requirements for the settings of the Trace window export


CAPL Function Overview » Test Service Library » Stimulus Generator: Requirements for the settings of the Trace window export

If the output of the trace shall be used as input for this stimuli, you have to do the following settings in
the Advanced options dialog (Export shortcut menu of the Trace window – [Advanced…]):

Format

Time format The identifier for the time column can be 't, 'T' or 'Time'

Signal format Stimulus supports the 3 possibilities of the trace export

Name delimiter The limiter has to be '::'

Timestamps Stimulus supports two formats:

• Check box active (unit: s)


• Check box inactive (unit: 10us)

CSV Settings

List limiter The limiter has to be Comma ',' or Semi-colon ';'

Decimal The limiter has to be a point, not a comma.


separator

Decimal places No constraints about this.

Layout The CSV file has to contain one table with a time column if necessary and columns for
every signal (first and second option of the window below).

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Sample Code: StmCreate_Ramp

Sample Code: StmCreate_Ramp


CAPL Function Overview » Test Service Library » Stimulus Generator: Sample Code StmCreate_Ramp

variables
{
// Local message buffer
message StmMsg lStmMsg;
// Defines the cycle for output of the stimulated signals
dword gOutTime;
msTimer tOutStmMsg;
// Remember the handles for the different stimuli:
dword mRampId = 0;
// Description of the stimuli functions in the demo.
// - Creation of stimuli in the pre-start event
// - Control of the stimulated signals by environment variable
}

on preStart
{
// Initialize the TSL functionality.
// TSL should be initialized with "user" or "developer".
// The "user" setting is very silent and reports only severe problems.
// The "developer" setting is more verbose and reports useful information
ChkConfig_Init("user");
// Set precison of timers to us (10-6 seconds)
SetPrecision(6);
// Create the ramp stimulus
mRampId = StmCreate_Ramp(lStmMsg, StmMsg::RampSig,-10,10,5,300,200,100,400);
}

on start
{
gOutTime = getValue(EnvOutTime);
SetTimer(tOutStmMsg, gOutTime);
}

on timer tOutStmMsg
{
// Output of the message
output(lStmMsg);
SetTimer(tOutStmMsg, gOutTime);
}

// Start and stop the ramp stimuli


on envVar EnvCtrlRamp
{
long lRet;
if(getValue(this))
{
lRet = StmControl_Start(mRampId);
}
else
{
lRet = StmControl_Stop(mRampId);
}
}

// Reset the ramp stimuli


on envVar EnvResetRamp
{
long lRet;
if(getValue(this))
{
if(mRampId)
lRet = StmControl_Reset(mRampId);
}
}

// New settings for the ramp stimuli

on envVar EnvRampApply
{
long lRet;
if(getValue(this))
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Sample Code: StmCreate_Ramp

if(mRampId)
{
lRet = StmControl_Destroy(mRampId);
mRampId = 0;
}
mRampId = StmCreate_Ramp( lStmMsg,
StmMsg::RampSig,
getValue(EnvRampValueA),
getValue(EnvRampValueB),
getValue(EnvRampCycleTime),
getValue(EnvRampTimeUp),
getValue(EnvRampTimeHigh),
getValue(EnvRampTimeDown),
getValue(EnvRampTimeLow));
if(getValue(EnvCtrlRamp))
{
lRet = StmControl_Start(mRampId);
}
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Stimulus Generator: Toggle Between Two Values

Stimulus Generator: Toggle Between Two Values


CAPL Function Overview » Test Service Library » Stimulus Generator: Toggle Between Two Values

This Stimulus Generator toggles the data sink (signal or environment variable) periodically between two
values. These two values are user-defined (Values A and B) or they are taken directly from the database.
The Reset Function causes the data sink to be immediately set to the value A. It does not have any effect
on the cycle of the Stimulus Generator.

In this special case the cycle time is exactly half as large as the period T of the Generator.

Functions that create the Stimulus Generator for stimulating signals and environment/system
variables

• StmCreate_Toggle (limits taken from database)


• StmCreate_Toggle (limits user defined)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

VT System CAPL Functions


CAPL Function Overview » VT System CAPL Functions

Info

The methods/functions listed on this site can only be called in connection with system
variables.

The following methods/functions are available for the VT System.


Information about the differences between methods and functions can be found here.

Method / Function Short description

SetTransferCycle Sets the cycle time for retrieving the corresponding value from the
VT System.
vtsSetTransferCycle

VT1004 related methods / Short description


functions

ResetMinMax Resets the minimum and maximum value.

vtsResetMinMax

SetLoadMode Sets the mode for internal load.

vtsSetLoadMode

SetMeasurementMode Sets the mode for voltage measurement.

vtsSetMeasurementMode

SetLoadControlTimeout Sets the timeout for the internal load.

vtsSetLoadControlTimeout

SetPWMMeasurementDuration Sets the PWM evaluation raster.

vtsSetPWMMeasurementDuration

SetPWMThreshold Sets the PWM trigger threshold.

vtsSetPWMThreshold

SetIntegrationTime Sets the integration time for average and RMS values.

vtsSetIntegrationTime

VT2004 related methods / Short description


functions

LoadWFResistance Loads a resistance curve for a channel from a specified file.

vtsLoadWFResistance

LoadWFVoltage Loads a voltage curve for a channel from a specified file.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

vtsLoadWFVoltage

SetCurveType Sets the mode of the curve.

vtsSetCurveType

SetStimulationMode Sets stimulation mode.

vtsSetStimulationMode

StartStimulation Starts stimulation output.

vtsStartStimulation

StopStimulation Stops stimulation output.

vtsStopStimulation

SetPWMResistanceLow Sets the resistance value for low on PWM output.

vtsSetPWMResistanceLow

SetPWMResistanceHigh Sets the resistance value for high on PWM output.

vtsSetPWMResistanceHigh

SetPWMVoltageLow Sets the low voltage on PWM output.

vtsSetPWMVoltageLow

SetPWMVoltageHigh Sets the high voltage on PWM output.

vtsSetPWMVoltageHigh

SetPWMRepeats Sets the number of stimulated PWM periods after the start of
stimulation.
vtsSetPWMRepeats

SetWFParams Configures the parameters for the output of a voltage or resistance


curve.
vtsSetWFParams

VT2516 related methods / Short description


functions

LoadWFBitStream The function loads a bit stream for the channel from the specified
file.
vtsLoadWFBitStream

SetCurveType Sets the mode of the bit stream.

vtsSetCurveType

SetIntegrationTime Sets the integration time for average values.

vtsSetIntegrationTime

SetPWMMeasurementDuration Sets the max evaluation time for PWM signals.

vtsSetPWMMeasurementDuration

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

SetPWMRepeats Sets the number of stimulated PWM periods after the start of
stimulation.
vtsSetPWMRepeats

SetPWMVoltageHigh Sets the high voltage on digital output.

vtsSetPWMVoltageHigh

SetPWMVoltageLow Sets the low voltage on digital output.

vtsSetPWMVoltageLow

SetStimulationMode Sets stimulation mode.

vtsSetStimulationMode

SetThreshold1_8 Sets the threshold value for differentiating between high and low
levels of the channels 1…8 of a digital module VT2516.
vtsSetThreshold1_8

SetThreshold9_16 Sets the threshold value for differentiating between high and low
levels of the channels 9…16 of a digital module VT2516.
vtsSetThreshold9_16

SetWFParams Configures the parameters for the output of a bit stream.

vtsSetWFParams

StartStimulation Starts stimulation output.

vtsStartStimulation

StopStimulation Stops stimulation output.

vtsStopStimulation

VT2816 related methods / Short description


functions

LoadWFVoltage Loads a voltage curve for a channel from a specified file.

vtsLoadWFVoltage

ResetMinMax Resets the minimum and maximum value.

vtsResetMinMax

SetCurveType Sets the mode of the bit stream.

vtsSetCurveType

SetIntegrationTime Sets the integration time for average and RMS values.

vtsSetIntegrationTime

SetMeasurementMode Sets the mode for voltage measurement.

vtsSetMeasurementMode

SetOutputRange Sets the range that is used for analog output on output channels of

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

vtsSetOutputRange VT2816 modules.

SetWFParams Configures the parameters for the output of a bit stream.

vtsSetWFParams

StartStimulation Starts stimulation output.

vtsStartStimulation

StopStimulation Stops stimulation output.

vtsStopStimulation

VT2848 related methods / Short description


functions

LoadWFBitStream The function loads a bit stream for the channel from the specified
file.
vtsLoadWFBitStream

SetCurveType Sets the mode of the bit stream.

vtsSetCurveType

SetOutputMode Sets the mode for output on the channel.

vtsSetOutputMode

SetOutputSource Sets the source for the high voltage level for output.

vtsSetOutputSource

SetPWMMeasurementDuration Sets the max evaluation time for PWM signals.

vtsSetPWMMeasurementDuration

SetPWMRepeats Sets the number of stimulated PWM periods after the start of
stimulation.
vtsSetPWMRepeats

SetThreshold Sets the threshold value for differentiating between high and low
levels of a group of channels on a VT2848 module.
vtsSetThreshold

SetWFParams Configures the parameters for the output of a bit stream.

vtsSetWFParams

StartStimulation Starts stimulation output.

vtsStartStimulation

StopStimulation Stops stimulation output.

vtsStopStimulation

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

VT7001 related methods / Short description


functions

<OnSerialError> Is called when an error has occurred in an operation on a serial port.

<OnSerialReceive> Is called when data has been received from the assigned serial port.

<OnSerialSend> Is called when a send operation has been completed on the assigned
serial port.

LoadWFVoltage Loads a control voltage curve for a power supply from a specified
file.
vtsLoadWFVoltage

ResetMinMax Resets the minimum and maximum value.

vtsResetMinMax

SerialClose Closes the serial port of the VT System channel.

vtsSerialClose

SerialConfigure Configures the serial port of the VT System channel.

vtsSerialConfigure

SerialOpen Opens the serial port of the VT System channel.

vtsSerialOpen

SerialReceive Receives blocks of bytes from the serial port.

vtsSerialReceive

SerialSend Sends a block of bytes to the serial port.

vtsSerialSend

SetIntegrationTime Sets the integration time for average values.

vtsSetIntegrationTime

SetInterconnectionMode Sets the mode for interconnection of the three possible power
supplies and the two power outputs of the power module VT7001.
vtsSetInterconnectionMode

SetMaxCurrentMode Sets the mode for the control voltage output to control the power
supply's maximal output current.
vtsSetMaxCurrentMode

SetRefVoltageMode Sets the mode for the reference voltage output to control the power
supply's output voltage.
vtsSetRefVoltageMode

SerialSetOnErrorHandler Sets the callback that notifies when an error occurred during a send
or receive operation.
vtsSerialSetOnErrorHandler

SerialSetOnReceiveHandler Sets the callback that notifies when data has been received on the
serial port of the specified channel.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System CAPL Functions

vtsSerialSetOnReceiveHandler

SerialSetOnSendHandler Sets the callback that notifies when a send operation on the serial
port of the specified channel is completed successfully.
vtsSerialSetOnSendHandler

SetWFParams Configures the parameters for the output of a control voltage curve.

vtsSetWFParams

StartStimulation Starts stimulation output.

vtsStartStimulation

StopStimulation Stops stimulation output.

vtsStopStimulation

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: VT System: Differences between Functions and Methods

VT System: Differences between Functions and Methods


CAPL Function Overview » VT System: Differences between Functions and Methods » Differences between Functions and Methods

CAPL offers two different notations for calling the functions of the VT System. On the one hand they can
be called as methods on the namespaces of the modules and channels. On the other hand it is also
possible to call them as global functions. In this case the namespace of the module resp. channel is
passed as a string argument. Both notations will be illustrated with two simple examples in the following.

VT System methods

This is the notation recommended in most cases. Its advantage is that the CAPL compiler can verify the
namespace of the module resp. channel already at compile time.

Example

In this example one channel of a VT1004 module is configured for PWM measurement.
ConfigurePWMMeasurement()
{
// Configure channel for PWM measurement
sysvar::VTS::RPMSensor.SetPWMMeasurementDuration(0.1); // 100ms
sysvar::VTS::RPMSensor.SetPWMThreshold(2.5); // 2.5V
}

VT System functions

For every method of the VT System there is a function with the same name. To allow differentiating these
two each function starts with the prefix vts. The main difference to the methods is that the functions take
the name of their target namespace as a string argument. Because of that the function notation is well
suited for creating generic test functions.

Example

In this example the code for PWM initialization is implemented in a generic way so that it can be
reused for different channels.
testcase TestSensors ()
{
// Initialize PWM measurement on channels
ConfigurePWMMeasurement("VTS::RPMSensor");
ConfigurePWMMeasurement("VTS::TempSensor");
...
}

ConfigurePWMMeasurement(char channelName[])
{
// Configure channel for PWM measurement
vtsSetPWMMeasurementDuration(channelName, 0.1); // 100ms
vtsSetPWMThreshold(channelName, 2.5); // 2.5V
}

| VT System CAPL Functions |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFBitStream

vtsLoadWFBitStream
CAPL Function Overview » VT System » vtsLoadWFBitStream

Note

The function may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Syntax long vtsLoadWFBitStream (char Target[], char filepath[])

Function The function loads a bit stream (a sequence of bit values) for the channel from the
specified file.
The bit stream is used to stimulate the ECU using a digital signal.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

filepath

Path of the file containing the bit stream.


The path can be given absolute or relative to the CANoe configuration.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 SP2 Main method of test — •


nodes

Example

The following example demonstrates how to use the bit stream voltage output of a
VT2516 channel for digital stimulation. In this example a bit stream is loaded from the file
BitStream.txt and played back on channel DOut. More details for the output of bit
streams can be found on CANoe online help topics VT2516: Bit Stream Output and VT2848:
Bit Stream Output.

Example BitStream.txt
// Sample bit stream
001100110010101100

Sample Code CAPL


BitstreamOutput ()
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFBitStream

// Choose voltage stimulation and bitstream curve type


vtsSetStimulationMode("VTS::DOut", 1);
vtsSetCurveType("VTS::DOut", 3);

// Set high and low state voltages (12V and 0V)


vtsSetPWMVoltageHigh("VTS::DOut", 12.0);
vtsSetPWMVoltageLow("VTS::DOut", 0.0);

// Load bitstream (the contents of BitStream.txt are listed below)


vtsLoadWFBitStream("VTS::DOut", "C:\\BitStream.txt");

// Configure bitstream. Parameters:


// TimeIncrement (time to hold each sample) = 10µs
// Pause (pause between two waveform repetitions) = 5ms
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
vtsSetWFParams("VTS::DOut", 0.0001, 0.005, 0);

// Output the configured bitstream for 10 seconds


vtsStartStimulation("VTS::DOut");
TestWaitForTimeout(10000);
vtsStopStimulation("VTS::DOut");
}

Sample Code .NET


public void BitstreamOutput()
{
// Get VTS interface and VT2516 channel
IVTSystem vts = VTSystem.Instance;
IVT2516Channel digiOut = vts.GetChannel("DOut") as IVT2516Channel;

// Choose voltage stimulation and bitstream curve type


digiOut.SetStimulationMode(StimulationMode.Voltage,
CurveType.BitStream);

// Set high and low state voltages (12V and 0V)


digiOut.PWMVoltageHigh.Value = 12.0f;
digiOut.PWMVoltageLow.Value = 0.0f;

// Load bitstream (the contents of BitStream.txt are listed below)


digiOut.LoadWFBitStream("C:\\BitStream.txt");

// Configure bitstream. Parameters:


// TimeIncrement (time to hold each sample) = 10µs
// Pause (pause between two waveform repetitions) = 5ms
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
digiOut.SetWFParams(0.0001, 0.005, 0);
// Output the configured bitstream for 10 seconds
digiOut.StartStimulation();
Vector.CANoe.Threading.Execution.Wait(10000);
digiOut.StopStimulation();
}

Sample Code XML


<testcase title="BitstreamOutput" ident="">
<vtsystem_configure title="Initialize bitstream output">
<stimulation_mode channel="VTS::DOut" mode="voltage" />
<curve_type channel="VTS::DOut" type="bit_stream" />
<pwm_voltage_low channel="VTS::DOut">0.0</pwm_voltage_low>
<pwm_voltage_high channel="VTS::DOut">12.0</pwm_voltage_high>
<load_wave_form channel="VTS::DOut"
type="bit_stream">c:\BitStream.txt</load_wave_form>
<wave_form_params channel="VTS::DOut" time_increment="0.0001"
pause="0.005" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::DOut" num_of_repeats="0" />
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::DOut" />
</vtsystem_configure>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFBitStream

</testcase>

| LoadWFBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFResistance

vtsLoadWFResistance
CAPL Function Overview » VT System » vtsLoadWFResistance

Note

The function may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Syntax long vtsLoadWFResistance (char Target[], char filepath[])

Function This function loads a resistance curve for a VT2004 channel from the specified file.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

filepath

Path of the file containing the resistance curve. The path can be given absolute or
relative to the CANoe configuration.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 SP2 Main method of test — •


nodes

Example

See example vtsSetWFParams

| LoadWFResistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFVoltage

vtsLoadWFVoltage
CAPL Function Overview » VT System » vtsLoadWFVoltage

Note

The function may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Syntax long vtsLoadWFVoltage (char Target[], char filepath[])

Function The function loads a voltage curve for the channel from the specified file.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

filepath

Path of the file containing the voltage curve. The path can be given absolute or relative
to the CANoe configuration.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 SP2 Main method of test — •


nodes

Example

The following example demonstrates how to use the waveform voltage output of a VT2004
channel to simulate a sensor. In the example a waveform called WaveForm.txt is loaded
and replayed on channel Temp_Sensor. More details on waveforms can be found on
CANoe online help topic VT2004: Arbitrary Wave Forms.

The second part of the example shows how a waveform can be output on a VT7001 power
supply channel. An external power supply unit (namespace ExtSupply) is used in this
example. The ECU is connected to OUT1 (namespace ECUpower) and GND1; the VT7001
module is named Power-Supply. The output voltage is determined by a predefined curve
(powercycle.txt). The time increment for the curve's interpolation points is 65 ms; the
curve is for 10 seconds.

Example WaveForm.txt
// Example of an arbitrary wave form
0 // Next value is an interpolation point
1.0; 2 // Two sampling points lie between the next interpolation point

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFVoltage

4
2 // Also possible
3; 1
1; 1
2

Sample Code CAPL


SimulateSensorVoltageWF ()
{
// Choose voltage stimulation and waveform curve type
vtsSetStimulationMode("VTS::Temp_Sensor", 1);
vtsSetCurveType("VTS::Temp_Sensor", 2);

// Load waveform (the contents of WaveForm.txt are listed below)


vtsLoadWFVoltage("VTS::Temp_Sensor", "C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
vtsSetWFParams("VTS::Temp_Sensor", 0.065, 2.0, 0);

// Output the configured waveform for 10 seconds


vtsStartStimulation("VTS::Temp_Sensor");
TestWaitForTimeout(10000);
vtsStopStimulation("VTS::Temp_Sensor");
}

ExternalSupplyWithCurve ()
{
// Set mode to one power supply only -> external power supply 1
vtsSetInterconnectionMode("VTS::PowerSupply", 1);

// Load waveform from file


// Factor is set to 0.2: 1 V control voltage -> 5 V output at power
supply
vtsSetRefVoltageMode("VTS::ExtSupply", 2, 0.2);
vtsLoadWFVoltage("VTS::ExtSupply", "powercycle.txt");
vtsSetWFParams("VTS::ExtSupply", 0.00005, 0.2, 0);

// Switch outputs on and start output curve


@sysvar::VTS::Clamp30::Active = 1;
vtsStartStimulation("VTS::ExtSupply");

// Wait for 5 seconds, the stop the curve playback


TestWaitForTimeOut(5000);
vtsStopStimulation("VTS::ExtSupply");
}

Sample Code .NET


public void SimulateSensorVoltageWF()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose voltage stimulation and a constant curve type


tempSensor.SetStimulationMode(StimulationMode.Voltage,
CurveType.AnalogWaveform);

// Load waveform (the contents of waveform.txt are listed below)


tempSensor.LoadWFVoltage("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
tempSensor.SetWFParams(0.065, 2.0, 0);

// Output the configured waveform for 10 seconds


tempSensor.StartStimulation();
Vector.CANoe.Threading.Execution.Wait(10000);
tempSensor.StopStimulation();

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFVoltage

public void ExternalSupplyWithCurve()


{
// Get VTS interface, VT7001 module, external supply and output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Load waveform from file


// Factor is set to 0.2: 1 V control voltage -> 5 V output at power
supply
extSupply.SetRefVoltageMode(RefVoltageMode.AnalogWaveForm, 0.2);
extSupply.LoadWFVoltage("powercycle.txt");
extSupply.SetWFParams(0.00005, 0.2, 0);

// Switch outputs on and start output curve


clamp30.Active.Value = OutputMode.Active;
extSupply.StartStimulation();

// Wait for 5 seconds, the stop the curve playback


Vector.CANoe.Threading.Execution.Wait(5000);
extSupply.StopStimulation();
}

Sample Code XML


<testcase title="SimulateSensorVoltageWF" ident="">
<vtsystem_configure title="Initialize waveform">
<stimulation_mode channel="VTS::Temp_Sensor" mode="voltage" />
<curve_type channel="VTS::Temp_Sensor" type="wave_form" />
<load_wave_form channel="VTS::Temp_Sensor"
type="voltage">C:\WaveForm.txt</load_wave_form>
<wave_form_params channel="VTS::Temp_Sensor"
time_increment="0.065" pause="2.0" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" num_of_repeats="0"
/>
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

<testcase title="ExternalSupplyWithCurve" ident="">


<vtsystem_configure title="Set interconnection mode">
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<vtsystem_configure title="Setup power supply">
<load_wave_form channel="VTS::ExtSupply"
type="voltage">Powercycle.txt</load_wave_form>
<wave_form_params channel="VTS::ExtSupply"
time_increment="0.00005" pause="0.2" />
<ref_voltage_mode channel="VTS::ExtSupply" mode="wave_form"
factor="0.2" />
</vtsystem_configure>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::ExtSupply" num_of_repeats="0" />
</vtsystem_configure>
<wait time="5000" title="Wait 5s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::ExtSupply" />
</vtsystem_configure>
</testcase>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsLoadWFVoltage

| LoadWFVoltage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsResetMinMax

vtsResetMinMax
CAPL Function Overview » VT System » vtsResetMinMax

Syntax long vtsResetMinMax (char Target[])

Function Resets the measurement of the minimum and maximum value.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

This example demonstrates how to measure the minimum and maximum voltages at a
VT1004 channel. After the test is started, the old min and max values are reset. Then the
input voltage is analyzed for 5 seconds. After that the new min and max voltages are
output to CANoe's Write window / the test report.

Sample Code CAPL


PerformMinMaxMeasurement ()
{
// Initialize and wait for 5 seconds
vtsResetMinMax("VTS::TempSensor");
TestWaitForTimeOut(5000);
// Print measurement results to write window
write("Measured voltage minimum: %0.2fV",
@sysvar::VTS::TempSensor::Min);
write("Measured voltage maximum: %0.2fV",
@sysvar::VTS::TempSensor::Max);
}

Sample Code .NET


public void PerformMinMaxMeasurement()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as
IVT1004Channel;

// Initialize and wait for 5 seconds


tempSensor.ResetMinMax();
Vector.CANoe.Threading.Execution.Wait(5000);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsResetMinMax

// Print measurement results to write window


Vector.Tools.Output.WriteLine("Measured voltage minimum: " +
tempSensor.Min.Value.ToString() + "V");
Vector.Tools.Output.WriteLine("Measured voltage maximum: " +
tempSensor.Max.Value.ToString() + "V");
}

Sample Code XML


<testcase title="PerformMinMaxMeasurement" ident="">
<vtsystem_configure title="Reset min and max values">
<reset_min_max channel="VTS::TempSensor" />
</vtsystem_configure>
<wait time="5000" title="Wait 5s" />
<valuecomment>
<description>Minimum value that occurred during the last
5s</description>
<sysvar name="VTS::TempSensor::Min" />
</valuecomment>
<valuecomment>
<description>Maximum value that occurred during the last
5s</description>
<sysvar name="VTS::TempSensor::Max"></sysvar>
</valuecomment>
</testcase>

| ResetMinMax |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialClose

vtsSerialClose
CAPL Function Overview » VT System » vtsSerialClose

Syntax long vtsSerialClose (char Target[])

Function Closes the serial port of the VT System channel that is specified by the system variable
namespace.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialClose |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialConfigure

vtsSerialConfigure
CAPL Function Overview » VT System » vtsSerialConfigure

Note

To make sure the correct settings are used execute a wait command between the call of
this function and the following sending or receiving of data.

Syntax long vtsSerialConfigure (char Target[],dword baudrate, dword numberOfDa-


taBits, dword numberOfStopBits, dword parity)

Function Configures the serial port of the VT System channel that is specified by the system
variable namespace.

Without setting up a configuration explicitly, the default configuration is used.


Default baud rate: 1200, 8 data bits, 1 stop bit, no parity.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

baudrate

The symbol rate to use for reception and transmission. The serial ports of the VT7001
module support rates of 1200, 2400, 4800, 9600, 19200 and 38400 baud.

numberOfDataBits

The number of data bits within a transmission frame. The serial ports of the VT7001
module support a value of 7 or 8.

numberOfStopBits

The number of stop bits within a transmission frame. The serial ports of the VT7001
module support a value of 1 or 2.

parity

Specifies which parity mode should be used.

0 no parity used, i.e. frame contains no parity bit

1 odd parity

2 even parity

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialConfigure

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

This example shows how to use the RS232 functionality of the VT7001 module. It is
assumed, that power supply 1 of the VT7001 is connected to a proper counterpart (e.g. a
PC) via a serial connection. In this example the string “Hello World!” is sent by the
VT7001. After that all incoming characters are output to the write window. After 10
seconds the connection is closed.

Sample Code CAPL


RS232Example ()
{
// Declare variables for RS232 communication
char stringToSend[20] = "Hello World !"; // String to send
byte sendBuffer[20]; // Byte array to hold send data
byte receiveBuffer[20]; // Buffer for received data
int i; // Counter variable

// Register the RS232 callback functions


vtsSerialSetOnErrorHandler("VTS::ECUPowerSupply", "OnRS232Error");
vtsSerialSetOnReceiveHandler("VTS::ECUPowerSupply", "OnRS232Receive");
vtsSerialSetOnSendHandler("VTS::ECUPowerSupply", "OnRS232Sent");

// Configure the serial port i.e. for communication with an external


// ECU power supply to 9600 baud, 8 data bits, 1 stop bit, no parity
vtsSerialConfigure("VTS::ECUPowerSupply", 9600, 8, 1, 0);

// Open the serial port i.e. for communication with an external ECU
power supply
vtsSerialOpen("VTS::ECUPowerSupply");

// Wait briefly to make sure settings are applied and port is ready
TestWaitForTimeOut(10);

// **** Send data ****

// Copy the string to a byte array and send it


for (i=0; i<strlen(stringToSend); ++i) sendBuffer[i] = stringToSend[i];
vtsSerialSend("VTS::ECUPowerSupply", sendBuffer, strlen(stringToSend));
// **** Receive data ****

// For 10s output all received data to the write window


Write("Waiting for incomming data...");
vtsSerialReceive("VTS::ECUPowerSupply", receiveBuffer,
elcount(receiveBuffer));
TestWaitForTimeOut(10000);

// Close the serial port


vtsSerialClose("VTS::ECUPowerSupply");
}

void OnRS232Error(dword flags)


{
// Write error details to the write window
Write("Error occurred on serial port of VT7001 module (Error code:
%d).", flags);
}

void OnRS232Receive(byte buffer[], dword number)


{
long i;
char string[256];

// Create a string from the given byte array


for(i=0; i<elcount(buffer); ++i)
string[i] = buffer[i];

// Write received data to the write window


Write("Received '%s' (%d bytes) on ECU power supply port.", string,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialConfigure

number);
}

void OnRS232Sent(byte buffer[], dword number)


{
long i;
char string[256];

// Create a string from the given byte array


for(i=0; i<elcount(buffer); ++i)
string[i] = buffer[i];

// Write sent data to the write window


Write("Sent '%s' (%d bytes) on ECU power supply port.", string, number);
}

Sample Code .NET


public void RS232Example()
{
// Get VTS interface and external power supply 1
IVTSystem vts = VTSystem.Instance;
IVT7001Supply1 ecuPowerSupply = vts.GetChannel("ECUPowerSupply") as
IVT7001Supply1;

// Register the event handlers


ecuPowerSupply.OnSerialSentEvent += new
OnSerialSentHandler(this.SendHandler);
ecuPowerSupply.OnSerialReceivedEvent += new
OnSerialReceivedHandler(this.ReceiveHandler);
ecuPowerSupply.OnSerialErrorEvent += new
OnSerialErrorHandler(this.ErrorHandler);

// Configure the serial port i.e. for communication with an external


// ECU power supply to 9600 baud, 8 data bits, 1 stop bit, no parity
ecuPowerSupply.SerialConfigure(BaudRate.BaudRate9600, DataBits.Eight,
StopBits.One, Parity.None);

// Open the serial port i.e. for communication with an external ECU
power supply
ecuPowerSupply.SerialOpen();

// Wait briefly to make sure settings are applied and port is ready
Vector.CANoe.Threading.Execution.Wait(10);

// **** Send data ****

// Send a string via RS232


ecuPowerSupply.SerialSend("Hello world!");

// **** Receive data ****

// For 10s output all received data to the write window


byte[] receiveBuffer = new byte[32];
ecuPowerSupply.SerialReceive(receiveBuffer);
Vector.CANoe.Threading.Execution.Wait(10000);

// Close the serial port


ecuPowerSupply.SerialClose();
}

public void SendHandler(object sender, SerialSentEventArgs e)


{
// Print sent data to write window
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
Vector.Tools.Output.WriteLine("The following data was sent: " +
enc.GetString(e.Buffer));
}

public void ReceiveHandler(object sender, SerialReceivedEventArgs e)


{
// Print received data to write window
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
Vector.Tools.Output.WriteLine("Received the following data: " +
enc.GetString(e.Buffer));
}

public void ErrorHandler(object sender, SerialErrorEventArgs e)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialConfigure

{
// Print error to write window
Vector.Tools.Output.WriteLine("An error occurred in the serial
connection: " + e.ErrorFlags.ToString());
}

Sample Code XML

| SerialConfigure |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialOpen

vtsSerialOpen
CAPL Function Overview » VT System » vtsSerialOpen

Note

To make sure that no is lost execute a wait command between the call of this function
and the following sending or receiving of data.

Syntax long vtsSerialOpen (char Target[])

Function Opens the serial port of the VT System channel that is specified by the system variable
namespace.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialOpen |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialReceive

vtsSerialReceive
CAPL Function Overview » VT System » vtsSerialReceive

Syntax long vtsSerialReceive (char Target[],byte buffer[], dword size)

Function Starts receiving blocks of bytes from the serial port of the specified VT7001 channel.
Received data is copied to the specified buffer. The data can only be accessed in the
OnSerialReceive callback.

• The operation works continuous if issued once


• If another receive operation will be given, the result buffer will change to that one
given by the last receive operation.
• A callback handler has to be set for notification when data has been received. See
SerialSetOnReceiveHandler.
• Another callback handler can be set to notify of errors in later stages of the send
operation. See SerialSetOnErrorHandler.

The used serial port has to be opened first.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

buffer

An array of bytes where received data is copied to.

The buffer is only valid within the OnSerialReceive callback.

size

Maximum number of Bytes which can be received at a time. Must have a value > 0 and <
65.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

-5: Serial port is not open.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialReceive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialSend

vtsSerialSend
CAPL Function Overview » VT System » vtsSerialSend

Syntax long vtsSerialSend (char Target[],byte buffer[], dword number)

Function Sends a block of bytes to the serial port of the specified VT7001 channel

• The operation starts the sending of a block.


• A callback handler can be set to notify when the send operation is completed. See
SerialSetOnSendHandler.
• Another callback handler can be set to notify of errors in later stages of the send
operation. See SerialSetOnErrorHandler. There are no automatic retrials in case of
error.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

buffer

An array of bytes that contains the data to be sent.

number

Number of bytes to send from the buffer. Number must have a value > 0 and < 65.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

-5: Serial port is not open.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialSend |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialSetOnErrorHandler

vtsSerialSetOnErrorHandler
CAPL Function Overview » VT System » vtsSerialSetOnErrorHandler

Syntax long vtsSerialSetOnErrorHandler (char Target[], char onErrorCallback[])

Function Sets the callback that notifies when an error occurred during a send or receive operation.

The set callback has to have following signature: void <OnSerialError>( dword
errorFlags)

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

onErrorCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialSetOnErrorHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialSetOnReceiveHandler

vtsSerialSetOnReceiveHandler
CAPL Function Overview » VT System » vtsSerialSetOnReceiveHandler

Syntax long vtsSerialSetOnReceiveHandler (char Target[], char onReceiveCallback


[])

Function Sets the callback that notifies when data has been received on the serial port of the
specified channel.

The set callback has to have following signature: void <OnSerialReceive>( byte
bffer[], dword number)

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

onReceiveCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialSetOnReceiveHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSerialSetOnSendHandler

vtsSerialSetOnSendHandler
CAPL Function Overview » VT System » vtsSerialSetOnSendHandler

Syntax long vtsSerialSetOnSendHandler (char Target[], char onSendCallback [])

Function Sets the callback that notifies when a send operation on the serial port of the specified
channel is completed successfully.

The set callback must have following signature: void <OnSerialSend>( byte
sendBuffer[], dword number)

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

onSendCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature, i.e. number or type of the
parameters are different than expected.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSerialConfigure

| SerialSetOnSendHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetCurveType

vtsSetCurveType
CAPL Function Overview » VT System » vtsSetCurveType

Syntax long vtsSetCurveType (char Namespace [],dword Type)

Function Specifies the form (the dynamic) of the stimulation signal.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Type

0 Constant value, determined by the corresponding output system variable.


Nevertheless, this value can also be used dynamically by changing the value of the
variable in CANoe.

1 PWM

2 Analog wave form; loaded using LoadWFVoltage (for VT2004 and VT2816 only) or
LoadWFResistance (for VT2004 only), then started using StartStimulation

3 Bit stream (= digital wave form); loaded using LoadWFBitStream, then started using
StartStimulation (for VT2516 and VT2848 only)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified type is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| SetCurveType |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetIntegrationTime

vtsSetIntegrationTime
CAPL Function Overview » VT System » vtsSetIntegrationTime

Syntax long vtsSetIntegrationTime (char Target[], double IntTime)

Function Mean and RMS values are calculated in a moving measurement time window.
The length of the time window can be set with this function.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

IntTime

Measurement time window in seconds.


VT1004: The only permissible time settings are 128 µs (= 0.000128; mean value only), 1
ms (mean value only), 10 ms, 100 ms, and 1 s.
VT2516/VT7001: The permissible time settings depend on the concrete measurement
values and are similar to the possible settings in the VT System configuration dialog.
If an invalid value is specified, the call will fail.

Return values 0: Successful call

-1: Call error, e.g., system variable does not belong to the VT system or integration time
is invalid

-2: The system variable on which the command was called is not valid

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

This example demonstrates how to change the integration time of a VT System system
variable during the measurement. The integration time is set to 1s to cancel out noise in
the sensor readings. It is assumed that the sensor to be read is connected to a channel
called TempSensor of the VT1004 module.

Sample Code CAPL


SetIntegrationTime ()
{
// Set integration time to 1 second
vtsSetIntegrationTime("VTS::TempSensor", 1.0);

// Output sensor readings to the write window every second


while(1)
{
write("Average sensor value: %fV", @sysvar::VTS::TempSensor::Avg);
TestWaitForTimeOut(1000);
}
}

Sample Code .NET


public void SetIntegrationTime()
{
// Get VTS interface and temperature sensor channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetIntegrationTime

IVT1004Channel;
// Set integration time to 1 second
tempSensor.Avg.IntegrationTime = 1.0;
// Output sensor readings to the write window every second
while (true)
{
Vector.Tools.Output.WriteLine("Average sensor value: " +
tempSensor.Avg.Value.ToString() + "V");
Vector.CANoe.Threading.Execution.Wait(1000);
}
}

Sample Code XML


<testcase title="SetIntegrationTime" ident="">
<vtsystem_configure title="Set integration time to 1s">
<integration_time channel="VTS::TempSensor"
sysvar="Avg">1.0</integration_time>
</vtsystem_configure>
<wait time="1000" title="Wait 1s" />
<valuecomment>
<description>Average value of the sensor</description>
<sysvar name="VTS::TempSensor::Avg"></sysvar>
</valuecomment>
</testcase>

| SetIntegrationTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetInterconnectionMode

vtsSetInterconnectionMode
CAPL Function Overview » VT System » vtsSetInterconnectionMode

Note

This function may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module. Use a test module that
automatically runs at measurement start to set an initial state.

Syntax long vtsSetInterconnectionMode (char Target[],dword Mode)

Function Sets the mode for interconnection of the three possible power supplies and the two power
outputs of the power module VT7001.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

0 Internal Power Supply only (mode supint)

1 Power Supply 1 only (mode sup1)

2 Power Supply 2 only (mode sup2)

3 Two independent power supplies for OUT1 and OUT2: internal power supply and
power supply 1 (mode supint_sup1)

4 Two independent power supplies for OUT1 and OUT2: internal power supply and
power supply 2 (mode supint_sup2)

5 Two independent power supplies for OUT1 and OUT2: power supply 1 and internal
power supply (mode sup1_supint)

6 Two independent power supplies for OUT1 and OUT2: power supply 1 and power
supply 2 (mode sup1_sup2)

7 Two independent power supplies for OUT1 and OUT2: power supply 2 and internal
power supply (mode sup2_supint)

8 Two independent power supplies for OUT1 and OUT2: power supply 2 and power
supply 1 (mode sup2_sup1)

9 Power supply 1 and power supply 2 are connected in series (sup_series)

10 Power supply 1 and power supply 2 are connected parallel (sup_parallel)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetInterconnectionMode

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The internal power supply unit delivers power and the ECU is connected to OUT1 (clamp
30), OUT2 (clamp 15) and GND1 (clamp 31). In this example, the channel for the internal
power sup-ply unit is named “IntSupply”, the two output channels are named “Clamp30”
and “Clamp15”, and the VT7001 module is named “PowerSupply”.

Sample Code CAPL


InternalPowerSupply ()
{
// Set mode to one power supply only -> internal power supply
vtsSetInterconnectionMode("VTS::PowerSupply", 0);

// Set voltage to 12.0 V


vtsSetRefVoltageMode("VTS::IntSupply", 1);
@sysvar::VTS::IntSupply::RefVoltage = 12.0;
// Switch both outputs on
@sysvar::VTS::Clamp30::Active = 1;
@sysvar::VTS::Clamp15::Active = 1;

// Measure the current consumed by the ECU via clamp 15


// after 2 seconds (result is written to the write window)
TestWaitForTimeOut(2000);
write("ECU is consuming %fmA.", @sysvar::VTS::Clamp30::AvgCurrent);
}

Sample Code .NET


public void InternalPowerSupply()
{
// Get VTS interface, VT7001 module, internal supply and two output
channels
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyInternal intSupply = vts.GetChannel("IntSupply") as
IVT7001SupplyInternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;
IVT7001Channel clamp15 = vts.GetChannel("Clamp15") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.SupInt;

// Set voltage to 12.0 V


intSupply.SetRefVoltageMode(RefVoltageMode.Constant);
intSupply.RefVoltage.Value = 12.0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetInterconnectionMode

// Switch both outputs on


clamp30.Active.Value = OutputMode.Active;
clamp15.Active.Value = OutputMode.Active;

// Measure the current consumed by the ECU via clamp 15


// after 2 seconds (result is written to the write window)
Vector.CANoe.Threading.Execution.Wait(2000);
Vector.Tools.Output.WriteLine("ECU is consuming " +
clamp30.AvgCurrent.Value + "mA");
}

Sample Code XML


<testcase title="InternalPowerSupply" ident="">
<vtsystem_configure title="Initialize">
<ref_voltage_mode channel="VTS::IntSupply" mode="static" />
<interconnection_mode channel="VTS::PowerSupply" mode="supint" />
</vtsystem_configure>
<set title="Set voltage">
<sysvar name="VTS::IntSupply::RefVoltage">12</sysvar>
</set>
<set title="Activate outputs">
<sysvar name="VTS::Clamp15::Active">1</sysvar>
<sysvar name="VTS::Clamp30::Active">1</sysvar>
</set>
<wait time="2000" title="Wait 2s" />
<valuecomment>
<description>Measure current going through clamp 30</description>
<sysvar name="VTS::Clamp30::AvgCurrent"></sysvar>
</valuecomment>
</testcase>

| SetInterconnectionMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetLoadControlTimeout

vtsSetLoadControlTimeout
CAPL Function Overview » VT System » vtsSetLoadControlTimeout

Syntax long vtsSetLoadControlTimeout (char Target[], double Timeout)

Function When signals with brief interruptions are created (especially PWM signals), it is possible to
set a hold time (a control timeout) so that the electronic load does not have be corrected
again on every signal edge. Thus, if the input voltage rises again before the timeout
expires, the electronic load is still adjusted to the old value and only has to be corrected
minimally, if at all. Because the settling time is eliminated, very rapidly changing PWM
signals can also be operated with the electronic load.

The timeout time selected should be approximately 10 to 100 times higher than the
frequency of the control unit output signal. For a PWM signal with a frequency starting
from 10 Hz, a timeout time of 1 to 10 seconds is sufficient. If this functionality is not
required, the timeout time should be set to 0, because it slows down the corrections.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Timeout

Defines the timeout time for the internal load in seconds.

Permissible range of values: 1...255 s, resolution 1 s, 0: no timeout (default).

If an invalid value is specified, the command will fail.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified timeout is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example
vtsSetLoadControlTimeout (sysvar::VTS::LowBeamRight, 10.0);

The following figure illustrates the control response using an example:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetLoadControlTimeout

A timeout of 2 s was set here. The input voltage (yellow) and the current flowing at the
input (red) are presented qualitatively. At the first pulse, the input voltage is not applied
for only approximately 1 s. In this case, a timeout does not occur and the set current
continues flowing when the input voltage is applied again. At the second pulse, a timeout
occurs. In this case, the input voltage is not applied for a period lasting more than 2 s.
The internal load is then connected with high resistance. If the input voltage is restored,
the internal load must first adjust to the set current, which is apparent from the slow rise
in the current.

| SetLoadControlTimeout |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetLoadMode

vtsSetLoadMode
CAPL Function Overview » VT System » vtsSetLoadMode

Syntax long vtsSetLoadMode (char Target[], dword Mode)

Function Switches the internal load to a specific mode.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

0 Internal load not active

1 Current control

2 Resistance control

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates the usage of the internal load of a VT1004 channel.
In this example the channel is called LowBeamLeft. The internal load is configured for
resistance-control-mode with a resistance of 120 Ohm. So the electronic load functions as
a constant resistor against the input.

The second part of the example shows how to use the current control mode. Here the
electronic load is regulated so that a constant current flows between the two ECU lines.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetLoadMode

Sample Code CAPL


InternalLoad_ResistanceControl ()
{
// Set the resistor of the internal load to 120Ohm
@sysvar::VTS::LowBeamLeft::IntLoadResistor = 120;

// Set internal load mode to resistance control


vtsSetLoadMode("VTS::LowBeamLeft", 2);

// Connect ECU with internal load


@sysvar::VTS::LowBeamLeft::RelayIntLoadA = 1;
@sysvar::VTS::LowBeamLeft::RelayIntLoadB = 1;
}

InternalLoad_CurrentControl ()
{
// Set the current of the internal load to 1A
@sysvar::VTS::LowBeamLeft::IntLoadCurrent = 1;

// Set internal load mode to current control


vtsSetLoadMode("VTS::LowBeamLeft", 1);

// Connect ECU with internal load


@sysvar::VTS::LowBeamLeft::RelayIntLoadA = 1;
@sysvar::VTS::LowBeamLeft::RelayIntLoadB = 1;
}

Sample Code .NET


public void InternalLoad_ResistanceControl()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel lowBeamLeft = vts.GetChannel("LowBeamLeft") as
IVT1004Channel;

// Set the resistor of the internal load to 120Ohm


lowBeamLeft.IntLoadResistor.Value = 120.0;

// Set internal load mode to resistance control


lowBeamLeft.LoadMode.Value = LoadMode.ResistanceControl;

// Connect ECU with internal load


lowBeamLeft.RelayIntLoadA.Value = true;
lowBeamLeft.RelayIntLoadB.Value = true;
}

public void InternalLoad_CurrentControl()


{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel lowBeamLeft = vts.GetChannel("LowBeamLeft") as
IVT1004Channel;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetLoadMode

// Set the current of the internal load to 1A


lowBeamLeft.IntLoadCurrent.Value = 1.0;

// Set internal load mode to current control


lowBeamLeft.LoadMode.Value = LoadMode.CurrentControl;

// Connect ECU with internal load


lowBeamLeft.RelayIntLoadA.Value = true;
lowBeamLeft.RelayIntLoadB.Value = true;
}

Sample Code XML


<testcase title="InternalLoad_ResistanceControl" ident="">
<set title="Set the resistor of the internal load to 120Ohm">
<sysvar name="IntLoadResistor"
namespace="VTS::LowBeamLeft">120</sysvar>
</set>
<vtsystem_configure title="Set internal load mode to resistor
control">
<load_mode channel="VTS::LowBeamLeft" mode="resistor" />
</vtsystem_configure>
<set title="Connect ECU with internal load">
<sysvar name="RelayIntLoadA"
namespace="VTS::LowBeamLeft">1</sysvar>
<sysvar name="RelayIntLoadB"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
</testcase>

<testcase title="InternalLoad_CurrentControl" ident="">


<set title="Set the current of the internal load to 1A">
<sysvar name="IntLoadCurrent"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
<vtsystem_configure title="Set internal load mode to current
control">
<load_mode channel="VTS::LowBeamLeft" mode="current" />
</vtsystem_configure>
<set title="Connect ECU with internal load">
<sysvar name="RelayIntLoadA"
namespace="VTS::LowBeamLeft">1</sysvar>
<sysvar name="RelayIntLoadB"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
</testcase>

| SetLoadMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetMaxCurrentMode

vtsSetMaxCurrentMode
CAPL Function Overview » VT System » vtsSetMaxCurrentMode

Syntax long vtsSetMaxCurrentMode (char Target[], dword Mode, double Factor)

long vtsSetMaxCurrentMode (char Target[], dword Mode)

Function Sets the mode for the control voltage output to control the power supply's maximal
output current.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

0 Max current control voltage output not active

1 Constant value, determined by the corresponding output system variable

Factor

Factor to determine the control voltage from the defined (using the system variable or
the wave form) power supply max current value.
Power Supply Max Current * Factor = Control Voltage

The factor has a default value of 1.0 at measurement start. If the function is called
without factor parameter the currently set factor is kept.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

In the following example the maximum current mode is activated on the power supply
channel ExtSupply of a VT7001 module. The max. current output is set to 10 A. Finally
the output Clamp30 of the VT7001 is activated. To set a max current of 10 A, e.g. a
control voltage of 5.0 V has to be given to the power supply. Therefore a factor of 0.5 has
to be used.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetMaxCurrentMode

Sample Code CAPL


SetMaxCurrentMode ()
{
// Set mode to one power supply only -> external power supply 1
vtsSetInterconnectionMode("VTS::PowerSupply", 1);

// Activate the maximum current mode with constant value mode


// and a factor of 0.5
vtsSetMaxCurrentMode("VTS::ExtSupply", 1, 0.5);

// Set power supply to max 10A


@sysvar::VTS::ExtSupply::MaxCurrent = 10.0;

// Switch output on
@sysvar::VTS::Clamp30::Active = 1;
}

Sample Code .NET


public void SetMaxCurrentMode()
{
// Get VTS interface, VT7001 module, internal supply and a output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Activate the maximum current mode with constant value mode


// and a factor of 0.5
extSupply.SetMaxCurrentMode(MaxCurrentMode.Constant, 0.5);

// Set power supply to max 10A


extSupply.MaxCurrent.Value = 10.0;

// Switch output on
clamp30.Active.Value = OutputMode.Active;
}

Sample Code XML


<testcase title="MaxCurrentMode" ident="">
<vtsystem_configure title="Initialize">
<max_current_mode channel="VTS::ExtSupply" mode="static"
factor="0.5" />
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<set title="Set maximum current">
<sysvar name="MaxCurrent" namespace="VTS::ExtSupply">10</sysvar>
</set>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
</testcase>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetMaxCurrentMode

| SetMaxCurrentMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetMeasurementMode

vtsSetMeasurementMode
CAPL Function Overview » VT System » vtsSetMeasurementMode

Syntax long vtsSetMeasurementMode (char Target[], dword Mode)

Function Controls the internal measuring instrument.

VT1004: It is possible to switch between direct and filtered differential voltage


measurement as well as measurement of pin a or b to reference ground (AGND).

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

Modes for VT1004 module:

0 Differential voltage, unfiltered

1 Differential voltage, 10 kHz filter active

2 Voltage line A to ground

3 Voltage line B to ground

Modes for VT2816 module:

0 Differential voltage, range +/- 60V

1 Differential voltage, range +/- 10V

2 Voltage line A to ground (single-ended), range +/- 60V

3 Voltage line A to ground (single-ended), range +/- 10V

4 Current, range +/-5A

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetMeasurementMode

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

This example demonstrates how change the measurement mode of a VT1004 channel. By
default the voltage is measured between the two input lines A and B. This example shows
how to configure a measurement between input line A and the VT1004 module’s AGND.

Sample Code CAPL


{
// Change measurement mode from differential
// to line A against ground (AGND)
vtsSetMeasurementMode("VTS::TempSensor", 2);
// Measure the voltage between line A and AGND
write("Current voltage: %0.2fV", @sysvar::VTS::TempSensor::Cur);
}

Sample Code .NET


public void MeasurementAToAGnd()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as
IVT1004Channel;

// Change measurement mode from differential


// to line A against ground (AGND)
tempSensor.MeasurementMode.Value = MeasurementMode.LineAToGnd;

// Print measurement results to write window


Vector.Tools.Output.WriteLine("Current voltage: " +
tempSensor.Cur.Value + "V");
}

Sample Code XML


<testcase title="MeasurementAToAGnd" ident="">
<vtsystem_configure title="Set measurement mode">
<measurement_mode channel="VTS::TempSensor" mode="a_only" />
</vtsystem_configure>
<valuecomment>
<description>Current sensor voltage</description>
<sysvar name="VTS::TempSensor::Cur" />
</valuecomment>
</testcase>

| SetMeasurementMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputMode

vtsSetOutputMode
CAPL Function Overview » VT System » vtsSetOutputMode

Syntax long vtsSetOutputMode (char Target[], dword Mode)

Function Sets the mode for output on the channel.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

Modes of VT2848 module:

0 Output off

1 High side switch

2 Low side switch

3 Push pull

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

The following example demonstrates how to use the PWM output of a VT2848 channel to
simulate a PWM based sensor (e.g. a RPM sensor). The channel used in this example is
called RPM_Sensor.

Sample Code CAPL


SimulateSensorPWM ()
{
// The current value of the frequency (100Hz)
float currentFrequency = 100.0;

// Choose ′l ow s i d e s wi t ch ′, PWM cur


// Vext as source for high value
vtsSetOutputMode ("VTS::RPM_Sensor", 2);
vtsSetCurveType("VTS::RPM_Sensor", 1);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputMode

vtsSetOutputSource("VTS::SensorModule1", 0, 0);

// Set the number of repeats to unlimited


vtsSetPWMRepeats("VTS::RPM_Sensor", 0);

// Set initial frequency (100Hz) and duty cycle (50%) values


@sysvar::VTS::RPM_Sensor::PWMOutputFreq = currentFrequency;
@sysvar::VTS::RPM_Sensor::PWMOutputDC = 50.0;

// Start the stimulation


vtsStartStimulation("VTS::RPM_Sensor");

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
TestWaitForTimeOut(100);
currentFrequency += 1;
@sysvar::VTS::RPM_Sensor::PWMOutputFreq = currentFrequency;
}

// Stop the stimulation


StopStimulation();
}

Sample Code .NET


public void SimulateSensorPWM()
{
// Get VTS interface, module and channel
IVTSystem vts = VTSystem.Instance;
IVT2848 sensorModule1 = vts.GetChannel<IVT2848>("Sensor_Module1");
IVT2848PWMStimChannel rpmSensor =
vts.GetChannel<IVT2848PWMStimChannel>("RPM_Sensor");

// The current value of the frequency (100Hz)


double currentFrequency = 100.0;

// Choose the source for high voltage on channels 1-4


sensorModule1.OutputSource1To4.Value = OutputSource.VExt;

// Choose a PWM curve


rpmSensor.CurveType.Value = CurveType.PWM;
// Set the number of repeats to unlimited
rpmSensor.PWMRepeats.Value = 0;

// Set initial frequency (100Hz) and duty cycle (50%) values


rpmSensor.PWMOutputFreq.Value = currentFrequency;
rpmSensor.PWMOutputDC.Value = 50.0;

// Start the stimulation


rpmSensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while (currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
Vector.CANoe.Threading.Execution.Wait(100);
currentFrequency += 1;
rpmSensor.PWMOutputFreq.Value = currentFrequency;
}

// Stop the stimulation


rpmSensor.StopStimulation();
}

Sample Code XML


<testcase title="SimulateSensorPWM" ident="">
<vtsystem_configure title="Initialize PWM">
<output_mode channel="VTS::RPM_Sensor" mode="low_side_switch" />
<curve_type channel="VTS::RPM_Sensor" type="pwm" />
<output_source channel="VTS::RPM_Sensor" source="v_ext" />
</vtsystem_configure>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputMode

<set title="Set frequency and duty cycle">


<sysvar name="VTS::RPM_Sensor::PWMOutputDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMOutputFreq">100.0</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::RPM_Sensor" />
</vtsystem_configure>
</testcase>

| SetOutputMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputRange

vtsSetOutputRange
CAPL Function Overview » VT System » vtsSetOutputRange

Syntax long vtsSetOutputRange (char Target[], dword Range)

Function Sets the range that is used for analog output on output channels of VT2816 modules.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Range

0 0..28V

1 -10V..+10V

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example
vtsSetOutputRange ("VTS::TempSensor”, 1);

| SetOutputRange |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputSource

vtsSetOutputSource
CAPL Function Overview » VT System » vtsSetOutputSource

Syntax long vtsSetOutputSource (char Target[], dword Group, dword Source)

Function Sets the source for the high voltage level for output. This settings can only be set for
groups of channels.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Group

0 Channels 1-4

1 Channels 5-8

2 Channels 9-12

3 Channels 13-16

4 Channels 17-20

5 Channels 21-24

6 Channels 25-28

7 Channels 29-32

8 Channels 33-36

9 Channels 37-40

10 Channels 41-44

11 Channels 45-48

Source

0 Vext

1 Vbatt

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified group or source is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetOutputSource

not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

See example vtsSetOutputMode

| SetOutputSource |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMMeasurementDuration

vtsSetPWMMeasurementDuration
CAPL Function Overview » VT System » vtsSetPWMMeasurementDuration

Syntax long vtsSetPWMMeasurementDuration (char Target[], double Duration)

Function The PWM parameters are calculated in a measurement time window of a defined (VT1004)
resp. maximum (VT2516 and VT2848) length, which can be set with this function.
For maximum accuracy during measurement, the time window should be at least 10 times
larger than the PWM signal's duration.
Please note that measurement duration effects latency. PWM parameters are determined
within the defined measurement duration and updated after this period of time. This
means that a change of a PWM signal will be reflected in the measurement values not
before a measurement period defined by this function has expired (exception: VT2516
updates PWM parameters immediately after a full signal period is determined). The
determined PWM parameters are updated on the module and can then be fetched by
CANoe (cyclically done defined by the cycle time).

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Duration

Time window in seconds during which PWM signals are measured.


VT1004: Time windows can be set between 1 µs (0.000001) and 50 s in increments of 1, 2,
and 5.
VT2516 and VT2848: Time windows can be set between 10 ms (0.01) and 11 min (660) in
steps of 10 ms.
If an invalid value is specified, the setting is rounded up to the next highest value.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified measurement duration is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

This example demonstrates how to do a PWM measurement on a channel of a VT1004


module. In this example the channel is called RPMSensor and assumed to be connected to
a sensor which generates a PWM signal. Every second the measured frequency and duty
cycle are written to CANoe's Write window / once to the test report.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMMeasurementDuration

Sample Code CAPL


PerformPWMMeasurement ()
{
// Declare variables to hold measured data
float frequency;
float dutyCycle;

// Configure channel for PWM measurement


vtsSetPWMMeasurementDuration("VTS::RPMSensor", 0.1); // 100ms
vtsSetPWMThreshold("VTS::RPMSensor", 2.5); // 2.5V

// Print measurement results to write window every second


while(1)
{
// Get measured values from VT System system variables
frequency = @sysvar::VTS::RPMSensor::PWMFreq;
dutyCycle = @sysvar::VTS::RPMSensor::PWMDC;

write("Frequency: %0.2fHz, Duty Cycle: %0.2f%%.", frequency,


dutyCycle);
TestWaitForTimeOut(1000);
}
}

Sample Code .NET


public void PerformPWMMeasurement()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel rpmSensor = vts.GetChannel("RPMSensor") as
IVT1004Channel;

// Configure channel for PWM measurement


rpmSensor.PWMMeasurementDuration.Value = 0.1; // 100ms
rpmSensor.PWMThreshold.Value = 2.5; // 2.5V

// Print measurement results to write window every second


while (true)
{
Vector.Tools.Output.WriteLine("Frequency: " +
rpmSensor.PWMFreq.Value + "Hz");
Vector.Tools.Output.WriteLine("DutyCycle: " +
rpmSensor.PWMDC.Value + "%");
Vector.CANoe.Threading.Execution.Wait(1000);
}
}

Sample Code XML


<testcase title="PerformPWMMeasurement" ident="">

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMMeasurementDuration

<vtsystem_configure title="Configure PWM measurement">


<pwm_measurement_duration
channel="VTS::RPMSensor">0.1</pwm_measurement_duration>
<pwm_threshold channel="VTS::RPMSensor">2.5</pwm_threshold>
</vtsystem_configure>
<wait time="100" title="Wait 100ms" />
<valuecomment>
<description>RPM sensor duty cycle</description>
<sysvar name="VTS::RPMSensor::PWMDC"></sysvar>
</valuecomment>
<valuecomment>
<description>RPM sensor frequency</description>
<sysvar name="VTS::RPMSensor::PWMFreq"></sysvar>
</valuecomment>
</testcase>

| SetPWMMeasurementDuration |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMRepeats

vtsSetPWMRepeats
CAPL Function Overview » VT System » vtsSetPWMRepeats

Syntax long vtsSetPWMRepeats (char Target[], dword numOfRepeats)

Function This function sets the number of stimulated PWM periods after the start of stimulation. If
the number of cycles output is not limited, numOfRepeats must be set to 0.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

numOfRepeats

Number of PWM periods to be stimulated.


Valid values: 0…65535.

Return values 0: Successful call

-1: Error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The specified number of repeats is not valid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| SetPWMRepeats |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMResistanceHigh

vtsSetPWMResistanceHigh
CAPL Function Overview » VT System » vtsSetPWMResistanceHigh

Syntax long vtsSetPWMResistanceHigh (char Target[], double Resistance)

Function Specifies the resistance value of a high signal on PWM output in "Resistance output PWM"
mode.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Resistance

Resistance value in ohms.


Resistance may have values from 1.0 (1 Ω) up to 250000.0 (250 kΩ). This range is only
supported by channel 4 of the VT2004 module. The other channels can handle values from
10.0 (10 Ω) up to 150000.0 (150 kΩ).
In special cases Resistance may be set to -1 on each channel to get infinite resistance.

Values outside the hardware's possible range of values are rounded up to the next highest
value or the highest or lowest possible value is used.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified resistance is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates how to use the internal resistor decade of a VT2004
channel to simulate a PWM based sensor. On channel Temp_Sensor the resistor is toggled
between 100 Ohm and 140 Ohm with a frequency of 20 Hz and a duty cycle of 50%.

Sample Code CAPL


SimulateSensorPWMResistance ()
{
// Choose resistor stimulation and a PWM curve type
vtsSetStimulationMode("VTS::Temp_Sensor", 3);
vtsSetCurveType("VTS::Temp_Sensor", 1);

// Configure low (100Ohm) and high (140Ohm) resistance values


vtsSetPWMResistanceLow("VTS::Temp_Sensor", 100);
vtsSetPWMResistanceHigh("VTS::Temp_Sensor", 140);

// Set the number of repeats to unlimited

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMResistanceHigh

vtsSetPWMRepeats("VTS::Temp_Sensor", 0);

// Create a PWM signal with frequency 20Hz and DC 50%


@sysvar::VTS::Temp_Sensor::PWMFreq = 20.0;
@sysvar::VTS::Temp_Sensor::PWMDC = 50.0;

// Start the stimulation


vtsStartStimulation("VTS::Temp_Sensor");
}

Sample Code .NET


public void SimulateSensorPWMResistance()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose resistor stimulation and a PWM curve type


tempSensor.SetStimulationMode(StimulationMode.ResistanceLower,
CurveType.PWM);

// Configure low (100Ohm) and high (140Ohm) resistance values


tempSensor.PWMResistanceLow.Value = 100.0;
tempSensor.PWMResistanceHigh.Value = 140.0;

// Set the number of repeats to unlimited


tempSensor.PWMRepeats.Value = 0;

// Start the stimulation


tempSensor.StartStimulation();

// Create a PWM signal with frequency 20Hz and DC 50%


tempSensor.PWMFreq.Value = 20.0;
tempSensor.PWMDC.Value = 50.0;
}

Sample Code XML


<testcase title="SimulateSensorPWMResistance" ident="">
<vtsystem_configure title="Initialize PWM">
<stimulation_mode channel="VTS::Temp_Sensor" mode="resistor_gt" />
<curve_type channel="VTS::Temp_Sensor" type="pwm" />
<pwm_resistance_low
channel="VTS::Temp_Sensor">100</pwm_resistance_low>
<pwm_resistance_high
channel="VTS::Temp_Sensor">140</pwm_resistance_high>
</vtsystem_configure>
<set title="Set frequency and duty cycle">
<sysvar name="VTS::RPM_Sensor::PWMDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMFreq">20</sysvar>
</set>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

| SetPWMResistanceHigh |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMResistanceLow

vtsSetPWMResistanceLow
CAPL Function Overview » VT System » vtsSetPWMResistanceLow

Syntax long vtsSetPWMResistanceLow (char Target[], double Resistance)

Function Specifies the resistance value of a low signal on PWM output in Resistance output PWM
mode.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Resistance

Resistance value in ohms.


Resistance may have values from 1.0 (1 Ω) up to 250000.0 (250 kΩ). This range is only
supported by channel 4 of the VT2004 module. The other channels can handle values from
10.0 (10 Ω) up to 150000.0 (150 kΩ).
In special cases Resistance may be set to -1 on each channel to get infinite resistance.

Values outside the hardware's possible range of values are rounded up to the next highest
value or the highest or lowest possible value is used.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified resistance is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetPWMResistanceHigh

| SetPWMResistanceLow |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMThreshold

vtsSetPWMThreshold
CAPL Function Overview » VT System » vtsSetPWMThreshold

Syntax long vtsSetPWMThreshold (char Target[], double Threshold)

Function Sets the threshold value for differentiating between high and low levels.

Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Threshold

Voltage value in volts in the range from -32 V to +32 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetPWMMeasurementDuration

| SetPWMThreshold |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMVoltageHigh

vtsSetPWMVoltageHigh
CAPL Function Overview » VT System » vtsSetPWMVoltageHigh

Syntax long vtsSetPWMVoltageHigh (char Target[], double Voltage)

Function Specifies the high level on output of a digital output signal, especially a PWM signal.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Voltage

Voltage of the high level in volts in the range 0 ... 28 V (VT2004) resp. 0 ... 25 V
(VT2516).

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified voltage is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| SetPWMVoltageHigh |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetPWMVoltageLow

vtsSetPWMVoltageLow
CAPL Function Overview » VT System » vtsSetPWMVoltageLow

Syntax long vtsSetPWMVoltageLow (char Target[], double Voltage)

Function Specifies the low level on output of a digital output signal, especially a PWM signal.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Voltage

Voltage of the low level in volts in the range 0 ... 28 V (VT2004) resp. 0 ... 25 V (VT2516).

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified voltage is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| SetPWMVoltageLow |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetRefVoltageMode

vtsSetRefVoltageMode
CAPL Function Overview » VT System » vtsSetRefVoltageMode

Syntax long vtsSetRefVoltageMode (char Target[], dword Mode, double Factor)

long vtsSetRefVoltageMode (char Target[], dword Mode)

Function Sets the mode for the reference voltage output to control the power supply's output
voltage.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

0 Reference voltage output not active

1 Constant value, determined by the corresponding output system variable

2 Analog wave form; loaded using LoadWFVoltage, then started using


StartStimulation

Factor

Factor to determine the control voltage from the defined (using the system variable or
the wave form) power supply output voltage.

Info

The factor is given by the external power supply. This factor is the ratio of
the control voltage to the output voltage. For example, if a power supply
outputs 50 V at a control voltage of 5 V, its factor is 0.1 (5/50).

Use form 1 for the internal power supply - the factor is always 1.

Use form 2 with explicitly given factor for the external power supplies. The default factor
is 1.0.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetRefVoltageMode

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

In order to output a control voltage (VControl) which leads to the desired output voltage VOut,
the VT7001 must know the power supply factor.

In the following example, the factor of the external power supply is 0.1 and the desired
output voltage VOut is 15 V.

To achieve the desired output voltage (VOut), the VT7001 calculates and sets the control
voltage (VControl) automatically (1.5 V =15 * 0.1), which results in an output voltage of 15 V.

Sample Code CAPL


SetRefVoltageMode ()
{
// Set mode to one power supply only -> external power supply 1
vtsSetInterconnectionMode("VTS::PowerSupply", 1);

// The factor 0.1 of the external power supply is transmitted to the


VT7001
vtsSetRefVoltageMode("VTS::ExtSupply", 1, 0.1);

// The following line sets the output voltage to 15 V,


// VControl (1.5 V) is calculated with the given factor automatically
@sysvar::VTS::ExtSupply::RefVoltage = 15;

// Switch output on
@sysvar::VTS::Clamp30::Active = 1;
}

Sample Code .NET


public void SetRefVoltageMode()
{
// Get VTS interface, VT7001 module, internal supply and a output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Activate the reference voltage mode with constant value mode


// and a factor of 0.1
extSupply.SetRefVoltageMode(RefVoltageMode.Constant, 0.1);

// The following line sets the output voltage to 15 V,


// VControl (1.5 V) is calculated with the given factor automatically
extSupply.RefVoltage.Value = 15.0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetRefVoltageMode

// Switch output on
clamp30.Active.Value = OutputMode.Active;
}

Sample Code XML


<testcase title="RefVoltageMode" ident="">
<vtsystem_configure title="Initialize">
<ref_voltage_mode channel="VTS::ExtSupply" mode="static"
factor="0.1" />
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<set title="Set reference voltage">
<sysvar name="MaxCurrent" namespace="VTS::ExtSupply">15</sysvar>
</set>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
</testcase>

| SetRefVoltageMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetStimulationMode

vtsSetStimulationMode
CAPL Function Overview » VT System » vtsSetStimulationMode

Syntax long vtsSetStimulationMode (char Target[],dword Mode)

Function Sets the mode for internal voltage or resistance stimulation.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Mode

0 Internal stimulation not active

1 Voltage stimulation

2 Potentiometer stimulation (VT2004 only)

3 Resistance stimulation R> (on switching between resistance values, only


intermediate states with resistance values higher than the output or target
resistance will occur) (VT2004 only)

4 Resistance stimulation R< (on switching between resistance values, only


intermediate states with lower resistance values will occur) (VT2004 only)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates how to use the PWM output of a VT2004 channel to
simulate a PWM based sensor (e.g. a RPM sensor). The channel used in this example is
called RPM_Sensor.

Sample Code CAPL


SimulateSensorPWM ()
{
// The current value of the frequency (100Hz)
float currentFrequency = 100.0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetStimulationMode

// Choose voltage stimulation and a PWM curve type


vtsSetStimulationMode("VTS::RPM_Sensor", 1);
vtsSetCurveType("VTS::RPM_Sensor", 1);

// PWM signal will toggle between 0V and 5V


vtsSetPWMVoltageLow("VTS::RPM_Sensor", 0.0);
vtsSetPWMVoltageHigh("VTS::RPM_Sensor", 5.0);

// Set the number of repeats to unlimited


vtsSetPWMRepeats("VTS::RPM_Sensor", 0);

// Set initial frequency (100Hz) and duty cycle (50%) values


@sysvar::VTS::RPM_Sensor::PWMFreq = currentFrequency;
@sysvar::VTS::RPM_Sensor::PWMDC = 50.0;

// Start the stimulation


vtsStartStimulation("VTS::RPM_Sensor");

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
TestWaitForTimeOut(100);
currentFrequency += 1;
@sysvar::VTS::RPM_Sensor::PWMFreq = currentFrequency;
}

// Stop the stimulation


vtsStopStimulation("VTS::RPM_Sensor");
}

Sample Code .NET


public void SimulateSensorPWM()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel rpmSensor = vts.GetChannel("RPM_Sensor") as
IVT2004Channel;

// The current value of the frequency (100Hz)


double currentFrequency = 100.0;

// Choose voltage stimulation and a PWM curve type


rpmSensor.SetStimulationMode(StimulationMode.Voltage, CurveType.PWM);

// PWM signal will toggle between 0V and 5V


rpmSensor.PWMVoltageLow.Value = 0.0;
rpmSensor.PWMVoltageHigh.Value = 5.0;

// Set the number of repeats to unlimited


rpmSensor.PWMRepeats.Value = 0;

// Set initial frequency (100Hz) and duty cycle (50%) values


rpmSensor.PWMFreq.Value = currentFrequency;
rpmSensor.PWMDC.Value = 50.0;

// Start the stimulation


rpmSensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
Vector.CANoe.Threading.Execution.Wait(100);
currentFrequency += 1;
rpmSensor.PWMFreq.Value = currentFrequency;
}

// Stop the stimulation


rpmSensor.StopStimulation();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetStimulationMode

Sample Code XML


<testcase title="SimulateSensorPWM" ident="">
<vtsystem_configure title="Initialize PWM">
<stimulation_mode channel="VTS::RPM_Sensor" mode="voltage" />
<curve_type channel="VTS::RPM_Sensor" type="pwm" />
<pwm_voltage_low channel="VTS::RPM_Sensor">0.0</pwm_voltage_low>
<pwm_voltage_high channel="VTS::RPM_Sensor">5.0</pwm_voltage_high>
</vtsystem_configure>
<set title="Set frequency and duty cycle">
<sysvar name="VTS::RPM_Sensor::PWMDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMFreq">100.0</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::RPM_Sensor" />
</vtsystem_configure>
</testcase>

| SetStimulationMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetThreshold

vtsSetThreshold
CAPL Function Overview » VT System » vtsSetThreshold

Syntax long vtsSetThreshold (char Target[], dword Group, double Threshold)

Function Sets the threshold value for differentiating between high and low levels of a group of
channels on a VT2848 module.
There is only one threshold setting for each group.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Group

0 Channels 1-8

1 Channels 9-16

2 Channels 17-24

3 Channels 25-32

4 Channels 33-40

5 Channels 41-48

Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

The following example demonstrates how to configure the first channel of a VT2848
module for PWM measurement. The channel used in this example is called RPM_Sensor,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetThreshold

the VT2848 is called Sensors.


PWMMeasurement ()
{
// Set the PWM thresholds of channels 1 to 8 to 2.5V
sysvar::VTS::Sensors.SetThreshold(0, 2.5);

// Set the PWM measurement duration of the first channel to 100ms


sysvar::VTS::RPM_Sensor.SetPWMMeasurementDuration(0.1);

// Wait 500ms and output the measured PWM frequency and duty cycle
TestWaitForTimeout(500);
write("Measured frequency %fHz and DC %f",
@sysvar::VTS::RPM_Sensor::PWMFreq, @sysvar::VTS::RPM_Sensor::PWMDC);
}

| SetThreshold |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetThreshold1_8

vtsSetThreshold1_8
CAPL Function Overview » VT System » vtsSetThreshold1_8

Syntax long vtsSetThreshold1_8 (char Namespace [],double Threshold)

Function Sets the threshold value for differentiating between high and low levels of the channels
1…8 of a digital module VT2516.
There is only one threshold setting for all eight channels together.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates how to measure a PWM signal on a VT2516 channel
(e.g. a ECU output that controls an LED). The measured frequency and duty cycle is then
output to the Write window / the test report.

Sample Code CAPL


PWMMeasurement ()
{
// Declare variables to hold measured data
float frequency;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetThreshold1_8

float dutyCycle;

// Set threshold for channels 1-8 to 2.5 V


vtsSetThreshold1_8("VTS::DigitalSignals", 3.5);

// Set maximum measurement duration to 100 ms


// (because the lowest PWM frequency is 100 Hz)
vtsSetPWMMeasurementDuration("VTS::LED", 0.1);

// Wait 100 ms and read measured PWM parameters


TestWaitForTimeout (100);
frequency = @sysvar::VTS::LED::PWMFreq;
dutyCycle = @sysvar::VTS::LED::PWMDC;

// Output measured values to the write window


write("Frequency: %0.2fHz, Duty Cycle: %0.2f%%.", frequency, dutyCycle);
}

Sample Code .NET


public void PWMMeasurement()
{
// Get VTS interface, VT2516 module and VT2516 channel
IVTSystem vts = VTSystem.Instance;
IVT2516 vt2516 = vts.GetModule("DigitalSignals") as IVT2516;
IVT2516Channel led = vts.GetChannel("LED") as IVT2516Channel;

// Set threshold for channels 1-8 to 2.5 V


vt2516.Threshold1To8.Value = 3.5;

// Set maximum measurement duration to 100 ms


// (because the lowest PWM frequency is 100 Hz)
led.PWMMeasurementDuration.Value = 0.1;

// Wait 100 ms and read measured PWM parameters


Vector.CANoe.Threading.Execution.Wait(100);
double frequency = led.PWMFreq.Value;
double dutyCycle = led.PWMDC.Value;

// Output measured values to the write window


Vector.Tools.Output.WriteLine("Frequency: " + frequency + "Hz");
Vector.Tools.Output.WriteLine("DutyCycle: " + dutyCycle + "%");
}

Sample Code XML


<testcase title="PWMMeasurement" ident="">
<vtsystem_configure title="Initialize PWM measurement">
<pwm_measurement_duration
channel="VTS::LED">0.1</pwm_measurement_duration>
<group_threshold channel="VTS::DigitalSignals" group="1-
8">3.5</group_threshold>
</vtsystem_configure>
<wait time="100" title="Wait 100ms" />
<valuecomment>
<description>Measured PWM duty cycle</description>
<sysvar name="VTS::LED::PWMDC"></sysvar>
</valuecomment>
<valuecomment>
<description>Measured PWM frequency</description>
<sysvar name="VTS::LED::PWMFreq"></sysvar>
</valuecomment>
</testcase>

| SetThreshold1_8 |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetThreshold9_16

vtsSetThreshold9_16
CAPL Function Overview » VT System » vtsSetThreshold9_16

Syntax long vtsSetThreshold9_16 (char Namespace[],double Threshold)

Function Sets the threshold value for differentiating between high and low levels of the channels
9…16 of a digital module VT2516.
There is only one threshold setting for all eight channels together.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetThreshold1_8

| SetThreshold9_16 |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetTransferCycle

vtsSetTransferCycle
CAPL Function Overview » VT System » vtsSetTransferCycle

Syntax long vtsSetTransferCycle (char Target[], double CycleTime)

Function Sets the cycle time for retrieving the measured value of a system variable from the VT
System and writing it to the corresponding system variable.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

CycleTime

Defines the cycle time in seconds.


The only available cycle times are 1 ms (= 0,001), 2 ms, 5 ms, 10 ms, 20 ms, 50 ms, 100
ms, 200 ms, 500 ms, 1 s, 2 s, 5 s and 10 s. Please note that not all cycle times are
available for all measurement values. See possible settings in the VT System configuration
dialog.
If an invalid cycle time is specified, the call will fail with a feedback value of -1.

Return values 0: Successful call

-1: Call error, e.g., system variable does not belong to the VT System or cycle time is
invalid.

-4: Invalid system variable

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates how to change the transfer cycle of a VT System
system variable during the measurement. Here the transfer cycle is reduced to 1 ms while
the function waits for the input signal to change. This allows for a fast reaction. After the
event has occurred the transfer cycle is set back to 100 ms.

Sample Code CAPL


testfunction WaitForECUSignalChange ()
{
// Change transfer cycle to 1ms to allow fast reaction
vtsSetTransferCycle("VTS::ECU_Dout_1::CurBit", 0.001);

// Wait for digital ECU output to rise


while(1)
{
if(@sysvar::VTS::ECU_Dout_1::CurBit == 1) break;
TestWaitForTimeOut(1);
}

// Change transfer cycle back to 100ms


vtsSetTransferCycle("VTS::ECU_Dout_1::CurBit", 0.1);
}

Sample Code .NET


public void WaitForECUSignalChange()
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetTransferCycle

// Get VTS interface and digital input channel


IVTSystem vts = VTSystem.Instance;
IVT2516Channel ecuDOut1 = vts.GetChannel("ECU_Dout_1") as
IVT2516Channel;

// Change transfer cycle to 1ms to allow fast reaction


ecuDOut1.CurBit.TransferCycle = 0.001;

// Wait for digital ECU output to change


bool initialValue = ecuDOut1.CurBit.Value;
while (ecuDOut1.CurBit.Value == initialValue)
Vector.CANoe.Threading.Execution.Wait(1);

// Change transfer cycle back to 100ms


ecuDOut1.CurBit.TransferCycle = 0.1;
}

Sample Code XML


<testcase title="SetTransferCycle" ident="">
<vtsystem_configure title="Set transfer cycle to 1ms">
<transfer_cycle channel="VTS::ECU_Dout_1"
sysvar="CurBit">0.001</transfer_cycle>
</vtsystem_configure>
<awaitvaluematch timeout="5000" title="Wait for input value to go to
1">
<sysvar name="VTS::ECU_Dout_1::CurBit">1</sysvar>
</awaitvaluematch>
<completion>
<vtsystem_configure title="Set transfer cycle to back to 100ms">
<transfer_cycle channel="VTS::ECU_Dout_1"
sysvar="CurBit">0.1</transfer_cycle>
</vtsystem_configure>
</completion>
</testcase>

| SetTransferCycle |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetWFParams

vtsSetWFParams
CAPL Function Overview » VT System » vtsSetWFParams

Syntax long vtsSetWFParams (char Target[], double timeIncrement, double pause,


dword numOfRepeats)

long SysVarNamespace.SetWFParams (char Target[], double timeIncrement,


double pause, dword numOfRepeats, double startDelay, dword startPoint)

Function The function configures the parameters for the output of a voltage or resistance curve or
bitstream.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

timeIncrement

Specifies how long the value of a specified interpolation point is to be stimulated before
transitioning to the next interpolation point.
Depending on the module and the wave form different ranges for timeIncrement are
valid:

Voltage curves: 0.00001 (10 µs)…0.065 (65 ms)

Voltage curves on a VT2816 module: timeIncrement can be -0.065 (-65ms)…0.065 (65


ms). If the value is negative, the wave form is output backwards. Note that output
accuracy depends highly on environmental conditions for values between -0.00001(-10µs)
and 0.00001 (10µs).

Resistance curves: 0.0005 (500 µs)…0.065 (65 ms) in R> mode and 0.001 (1 ms)…0.065
(65 ms) in R< mode.

BitStreams on a VT2516 module: timeIncrement can be 0.000002 (2 µs)…0.065 (65 ms).

BitStreams on a VT2848 module: timeIncrement can be -0.065 (-65ms)…0.065 (65 ms). If


the value is negative, the bit stream is output backwards.
Note that output accuracy depends highly on environmental conditions for values
between -0.00001(-10µs) and 0.00001 (10µs).

pause

Specifies how long the stimulation is interrupted between two repetitions of the wave
form.
Valid values: 0.0…4294.0 (4294 s).

numOfRepeats

Specifies how many times in a row the curve is to be stimulated.


Valid values: 0…65535 (0 means unlimited repetition of the curve)

startDelay

Specifies a delay for the start of the stimulation in seconds. This makes it possible to start
multiple curves in a defined sequence. This parameter is only supported by the VT2816
and VT2848 modules.
Valid values: 0.0..4.0 (4 s)

startPoint

Specifies the point of the stimulated curve the stimulation should begin with. This makes

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetWFParams

it possible e.g. to start multiple curves with different phase shifts without changing the
curves.
Valid values: 0..4096

Return values 0: Successful call

-1: Error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The specified number of repeats is not valid

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

The following example demonstrates how to use the waveform resistance output of a
VT2004 channel to simulate a sensor. In the example a waveform called WaveForm.txt is
loaded and replayed on channel Temp_Sensor. More details on waveforms can be found
on CANoe online help topic VT2004: Arbitrary Wave Forms.

Example WaveForm.txt
// Example of an arbitrary wave form for resistance stimulation
100
120 ; 2
140 ; 1
100
160 ; 4
100

Sample Code CAPL


SimulateSensorResistanceWF ()
{
// Choose resistor stimulation and waveform curve type
vtsSetStimulationMode("VTS::Temp_Sensor", 3);
vtsSetCurveType("VTS::Temp_Sensor", 2);

// Load waveform (the contents of waveform.txt are listed below)


vtsLoadWFResistance("VTS::Temp_Sensor", "C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 3
vtsSetWFParams("VTS::Temp_Sensor", 0.065, 2.0, 3);

// Start stimulation with the previously configured waveform


vtsStartStimulation("VTS::Temp_Sensor");
}

Sample Code .NET


public void SimulateSensorResistanceWF()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose voltage stimulation and a constant curve type


tempSensor.SetStimulationMode(StimulationMode.ResistanceLower,
CurveType.AnalogWaveform);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsSetWFParams

// Load waveform (the contents of waveform.txt are listed below)


tempSensor.LoadWFResistance("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 3
tempSensor.SetWFParams(0.065, 2.0, 3);

// Start stimulation with the previously configured waveform


tempSensor.StartStimulation();
}

Sample Code XML


<testcase title="SimulateSensorResistanceWF" ident="">
<vtsystem_configure title="Initialize waveform">
<stimulation_mode channel="VTS::Temp_Sensor" mode="resistor_lt" />
<curve_type channel="VTS::Temp_Sensor" type="wave_form" />
<load_wave_form channel="VTS::Temp_Sensor"
type="resistor">C:\WaveForm.txt</load_wave_form>
<wave_form_params channel="VTS::Temp_Sensor"
time_increment="0.065" pause="2.0" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" num_of_repeats="0"
/>
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

| SetWFParams |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsStartStimulation

vtsStartStimulation
CAPL Function Overview » VT System » vtsStartStimulation

Syntax long vtsStartStimulation (char Target[])

Function Starts the output of a stimulation signal. A corresponding output mode must be set in
advance.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| StartStimulation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: vtsStopStimulation

vtsStopStimulation
CAPL Function Overview » VT System » vtsStopStimulation

Syntax long vtsStopStimulation (char Target[])

Function Stops the output of a stimulation signal. This resets the output mode.

At the end of the execution of the command there is a short break before other
commands will be executed. This means that the next functions will be executed after a
short delay.
With this procedure ensures that the stop command is executed effectively. The
command should be called only in context of a test module setup but not in handler
functions. In handler functions the correct execution of the stop command can not be
ensured.

Parameters Target

Name of the system variable/namespace that will be affected by this function call.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 SP2 Test nodes — •

Example

See example vtsSetStimulationMode

| StopStimulation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFBitStream

LoadWFBitStream
CAPL Function Overview » VT System » LoadWFBitStream

Note

The method can only be called on system variable namespaces of appropriate channels of
VT System modules.

The method may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Method long SysVarNamespace.LoadWFBitStream (char filepath[])

Function The function loads a bit stream (a sequence of bit values) for the channel from the
specified file.
The bit stream is used to stimulate the ECU using a digital signal.

Parameters filepath

Path of the file containing the bit stream.


The path can be given absolute or relative to the CANoe configuration.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 Main method of test — •


nodes

Example

The following example demonstrates how to use the bit stream voltage output of a
VT2516 channel for digital stimulation. In this example a bit stream is loaded from the file
BitStream.txt and played back on channel DOut. More details for the output of bit
streams can be found on CANoe online help topics VT2516: Bit Stream Output and VT2848:
Bit Stream Output.

Example BitStream.txt
// Sample bit stream
001100110010101100

Sample Code CAPL


BitstreamOutput ()
{
// Choose voltage stimulation and bitstream curve type

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFBitStream

sysvar::VTS::DOut.SetStimulationMode(1);
sysvar::VTS::DOut.SetCurveType(3);

// Set high and low state voltages (12V and 0V)


sysvar::VTS::DOut.SetPWMVoltageHigh(12.0);
sysvar::VTS::DOut.SetPWMVoltageLow(0.0);

// Load bitstream (the contents of BitStream.txt are listed below)


sysvar::VTS::DOut.LoadWFBitStream("C:\\BitStream.txt");

// Configure bitstream. Parameters:


// TimeIncrement (time to hold each sample) = 10µs
// Pause (pause between two waveform repetitions) = 5ms
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
sysvar::VTS::DOut.SetWFParams(0.0001, 0.005, 0);

// Output the configured bitstream for 10 seconds


sysvar::VTS::DOut.StartStimulation();
TestWaitForTimeout(10000);
sysvar::VTS::DOut.StopStimulation();
}

Sample Code .NET


public void BitstreamOutput()
{
// Get VTS interface and VT2516 channel
IVTSystem vts = VTSystem.Instance;
IVT2516Channel digiOut = vts.GetChannel("DOut") as IVT2516Channel;

// Choose voltage stimulation and bitstream curve type


digiOut.SetStimulationMode(StimulationMode.Voltage,
CurveType.BitStream);

// Set high and low state voltages (12V and 0V)


digiOut.PWMVoltageHigh.Value = 12.0f;
digiOut.PWMVoltageLow.Value = 0.0f;

// Load bitstream (the contents of BitStream.txt are listed below)


digiOut.LoadWFBitStream("C:\\BitStream.txt");

// Configure bitstream. Parameters:


// TimeIncrement (time to hold each sample) = 10µs
// Pause (pause between two waveform repetitions) = 5ms
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
digiOut.SetWFParams(0.0001, 0.005, 0);

// Output the configured bitstream for 10 seconds


digiOut.StartStimulation();
Vector.CANoe.Threading.Execution.Wait(10000);
digiOut.StopStimulation();
}

Sample Code XML


<testcase title="BitstreamOutput" ident="">
<vtsystem_configure title="Initialize bitstream output">
<stimulation_mode channel="VTS::DOut" mode="voltage" />
<curve_type channel="VTS::DOut" type="bit_stream" />
<pwm_voltage_low channel="VTS::DOut">0.0</pwm_voltage_low>
<pwm_voltage_high channel="VTS::DOut">12.0</pwm_voltage_high>
<load_wave_form channel="VTS::DOut"
type="bit_stream">c:\BitStream.txt</load_wave_form>
<wave_form_params channel="VTS::DOut" time_increment="0.0001"
pause="0.005" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::DOut" num_of_repeats="0" />
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::DOut" />
</vtsystem_configure>
</testcase>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFBitStream

| vtsLoadWFBitStream |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFResistance

LoadWFResistance
CAPL Function Overview » VT System » LoadWFResistance

Note

The method can only be called on system variable namespaces of channels belonging to
the VT System module VT2004.

The method may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Method long SysVarNamespace.LoadWFResistance (char filepath[])

Function This function loads a resistance curve for a VT2004 channel from the specified file.

Parameters filepath

Path of the file containing the resistance curve. The path can be given absolute or
relative to the CANoe configuration.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 SP3 Main method of test — •


nodes

Example

See example SetWFParams

| vtsLoadWFResistance |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFVoltage

LoadWFVoltage
CAPL Function Overview » VT System » LoadWFVoltage

Note

The method can only be called on system variable namespaces of appropriate channels
ofVT System modules.

The method may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module.

Method long SysVarNamespace.LoadWFVoltage (char filepath[])

Function The function loads a voltage curve for the channel from the specified file.

Parameters filepath

Path of the file containing the voltage curve. The path can be given absolute or relative
to the CANoe configuration..

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace.

-3: Error when accessing the file. This can mean, for example, that the file was not found
or the file format was different than expected.

-4: Transfer error – The wave form could not be transferred correctly.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.1 SP3 Main method of test — •


nodes

Example

The following example demonstrates how to use the waveform voltage output of a VT2004
channel to simulate a sensor. In the example a waveform called WaveForm.txt is loaded
and replayed on channel Temp_Sensor. More details on waveforms can be found on
CANoe online help topic VT2004: Arbitrary Wave Forms.

The second part of the example shows how a waveform can be output on a VT7001 power
supply channel. An external power supply unit (namespace ExtSupply) is used in this
example. The ECU is connected to OUT1 (namespace ECUpower) and GND1; the VT7001
module is named Power-Supply. The output voltage is determined by a predefined curve
(powercycle.txt). The time increment for the curve's interpolation points is 65 ms; the
curve is for 10 seconds.

Example WaveForm.txt
// Example of an arbitrary wave form
0 // Next value is an interpolation point
1.0; 2 // Two sampling points lie between the next interpolation point
4
2 // Also possible

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFVoltage

3; 1
1; 1
2

Sample Code CAPL


SimulateSensorVoltageWF ()
{
// Choose voltage stimulation and waveform curve type
sysvar::VTS::Temp_Sensor.SetStimulationMode(1);
sysvar::VTS::Temp_Sensor.SetCurveType(2);

// Load waveform (the contents of WaveForm.txt are listed below)


sysvar::VTS::Temp_Sensor.LoadWFVoltage("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
sysvar::VTS::Temp_Sensor.SetWFParams(0.065, 2.0, 0);

// Output the configured waveform for 10 seconds


sysvar::VTS::Temp_Sensor.StartStimulation();
TestWaitForTimeout(10000);
sysvar::VTS::Temp_Sensor.StopStimulation();
}

ExternalSupplyWithCurve ()
{
// Set mode to one power supply only -> external power supply 1
sysvar::VTS::PowerSupply.SetInterconnectionMode(1);

// Load waveform from file


// Factor is set to 0.2: 1 V control voltage -> 5 V output at power
supply
sysvar::VTS::ExtSupply.SetRefVoltageMode(2, 0.2);
sysvar::VTS::ExtSupply.LoadWFVoltage("powercycle.txt");
sysvar::VTS::ExtSupply.SetWFParams(0.00005, 0.2, 0);

// Switch outputs on and start output curve


@sysvar::VTS::Clamp30::Active = 1;
sysvar::VTS::ExtSupply.StartStimulation();

// Wait for 5 seconds, the stop the curve playback


TestWaitForTimeOut(5000);
sysvar::VTS::ExtSupply.StopStimulation();
}

Sample Code .NET


public void SimulateSensorVoltageWF()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose voltage stimulation and a constant curve type


tempSensor.SetStimulationMode(StimulationMode.Voltage,
CurveType.AnalogWaveform);

// Load waveform (the contents of waveform.txt are listed below)


tempSensor.LoadWFVoltage("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 0 (unlimited)
tempSensor.SetWFParams(0.065, 2.0, 0);

// Output the configured waveform for 10 seconds


tempSensor.StartStimulation();
Vector.CANoe.Threading.Execution.Wait(10000);
tempSensor.StopStimulation();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFVoltage

public void ExternalSupplyWithCurve()


{
// Get VTS interface, VT7001 module, external supply and output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Load waveform from file


// Factor is set to 0.2: 1 V control voltage -> 5 V output at power
supply
extSupply.SetRefVoltageMode(RefVoltageMode.AnalogWaveForm, 0.2);
extSupply.LoadWFVoltage("powercycle.txt");
extSupply.SetWFParams(0.00005, 0.2, 0);

// Switch outputs on and start output curve


clamp30.Active.Value = OutputMode.Active;
extSupply.StartStimulation();

// Wait for 5 seconds, the stop the curve playback


Vector.CANoe.Threading.Execution.Wait(5000);
extSupply.StopStimulation();
}

Sample Code XML


<testcase title="SimulateSensorVoltageWF" ident="">
<vtsystem_configure title="Initialize waveform">
<stimulation_mode channel="VTS::Temp_Sensor" mode="voltage" />
<curve_type channel="VTS::Temp_Sensor" type="wave_form" />
<load_wave_form channel="VTS::Temp_Sensor"
type="voltage">C:\WaveForm.txt</load_wave_form>
<wave_form_params channel="VTS::Temp_Sensor"
time_increment="0.065" pause="2.0" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" num_of_repeats="0"
/>
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

<testcase title="ExternalSupplyWithCurve" ident="">


<vtsystem_configure title="Set interconnection mode">
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<vtsystem_configure title="Setup power supply">
<load_wave_form channel="VTS::ExtSupply"
type="voltage">Powercycle.txt</load_wave_form>
<wave_form_params channel="VTS::ExtSupply"
time_increment="0.00005" pause="0.2" />
<ref_voltage_mode channel="VTS::ExtSupply" mode="wave_form"
factor="0.2" />
</vtsystem_configure>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::ExtSupply" num_of_repeats="0" />
</vtsystem_configure>
<wait time="5000" title="Wait 5s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::ExtSupply" />
</vtsystem_configure>
</testcase>

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: LoadWFVoltage

| vtsLoadWFVoltage |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnSerialError

OnSerialError
CAPL Function Overview » VT System » OnSerialError

Note

This callback function must be implemented in the CAPL program by the user to get
notifications when an error has occurred in an operation on a serial port of the VT7001
module. The callback can be installed using the CAPL function SerialSetOnErrorHandler.

Method void <OnSerialError> (dword errorFlags)

Function The function is called when an error has occurred in an operation on a serial port of the
VT7001 module.

Parameters errorFlags

Cumulative summary of what went wrong. Bits are set to flag conditions.

Bit Error

0 Send operation failed.

1 Receive operation failed.

2 Frame error. May be caused by parity mismatch or any other frame mismatch (e.g.
number of stop bits).

3 Frame parity error. Is caused by parity mismatch.

4 Buffer overrun. It is not specified if the driver of the sender cannot send fast
enough, if it is up to the receiver which got too much data in too short time or
anything else.

5 Buffer overrun at receiver.

6 Break state. Other end requested to pause.

7 Timeout. May be caused by wrongly set too short timeout.

Info

Several error bits may be set at the same time. Some error flags are up to the
driver manufacturer what they mean and when they are issued.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP3 Main method of test — •


nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnSerialError

See example SerialConfigure

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnSerialReceive

OnSerialReceive
CAPL Function Overview » VT System » OnSerialReceive

Note

This callback function must be implemented in the CAPL program by the user to get
notifications when data has been received on a serial port of a VT7001 module. The
callback can be installed using the CAPL function SerialSetOnReceiveHandler.

Method void <OnSerialReceive> ( byte buffer[], dword number)

Function The function is called when data has been received from the assigned VT7001 serial port.

Parameters buffer

Receive buffer for the assigned VT7001 serial port (set with SerialReceive).

The buffer is only valid within the callback.

number

Number of Bytes that have been received.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP3 Main method of test — •


nodes

Example

See example SerialConfigure

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: OnSerialSend

OnSerialSend
CAPL Function Overview » VT System » OnSerialSend

Note

This callback function must be implemented in the CAPL program by the user to get
notifications when send operations on a serial port of a VT7001 module have been
completed. The callback can be installed using the CAPL function
SerialSetOnSendHandler.

Method void <OnSerialSend> ( byte buffer[], dword number)

Function The function is called when a send operation has been completed on the assigned VT7001
serial port.

Parameters buffer

Buffer with the data that has been sent.

number

Number of Bytes that have been sent.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetMinMax

ResetMinMax
CAPL Function Overview » VT System » ResetMinMax

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.ResetMinMax ()

Function Resets the measurement of the minimum and maximum value.

Parameters —

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

This example demonstrates how to measure the minimum and maximum voltages at a
VT1004 channel. After the test is started, the old min and max values are reset. Then the
input voltage is analyzed for 5 seconds. After that the new min and max voltages are
output to CANoe's Write window / the test report.

Sample Code CAPL


PerformMinMaxMeasurement ()
{
// Initialize and wait for 5 seconds
sysvar::VTS::TempSensor.ResetMinMax();
TestWaitForTimeOut(5000);

// Print measurement results to write window


write("Measured voltage minimum: %0.2fV",
@sysvar::VTS::TempSensor::Min);
write("Measured voltage maximum: %0.2fV",
@sysvar::VTS::TempSensor::Max);
}

Sample Code .NET


public void PerformMinMaxMeasurement()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as
IVT1004Channel;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ResetMinMax

// Initialize and wait for 5 seconds


tempSensor.ResetMinMax();
Vector.CANoe.Threading.Execution.Wait(5000);

// Print measurement results to write window


Vector.Tools.Output.WriteLine("Measured voltage minimum: " +
tempSensor.Min.Value.ToString() + "V");
Vector.Tools.Output.WriteLine("Measured voltage maximum: " +
tempSensor.Max.Value.ToString() + "V");
}

Sample Code XML


<testcase title="PerformMinMaxMeasurement" ident="">
<vtsystem_configure title="Reset min and max values">
<reset_min_max channel="VTS::TempSensor" />
</vtsystem_configure>
<wait time="5000" title="Wait 5s" />
<valuecomment>
<description>Minimum value that occurred during the last
5s</description>
<sysvar name="VTS::TempSensor::Min" />
</valuecomment>
<valuecomment>
<description>Maximum value that occurred during the last
5s</description>
<sysvar name="VTS::TempSensor::Max"></sysvar>
</valuecomment>
</testcase>

| vtsResetMinMax |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialClose

SerialClose
CAPL Function Overview » VT System » SerialClose

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialClose()

Function Closes the serial port of the VT System channel that is specified by the system variable
namespace.

Parameters —

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialClose |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialConfigure

SerialConfigure
CAPL Function Overview » VT System » SerialConfigure

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.
To make sure the correct settings are used execute a wait command between the call of
this function and the following sending or receiving of data.

Method long SysVarNamespace.SerialConfigure(dword baudrate, dword numberOfDa-


taBits, dword numberOfStopBits, dword parity )

Function Configures the serial port of the VT System channel that is specified by the system
variable namespace.

Without setting up a configuration explicitly, the default configuration is used.


Default baud rate: 1200, 8 data bits, 1 stop bit, no parity.

Parameters baudrate

The symbol rate to use for reception and transmission. The serial ports of the VT7001
module support rates of 1200, 2400, 4800, 9600, 19200 and 38400 baud.

numberOfDataBits

The number of data bits within a transmission frame. The serial ports of the VT7001
module support a value of 7 or 8.

numberOfStopBits

The number of stop bits within a transmission frame. The serial ports of the VT7001
module support a value of 1 or 2.

parity

Specifies which parity mode should be used.

0 no parity used, i.e. frame contains no parity bit

1 odd parity

2 even parity

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialConfigure

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 SP3 Test nodes — •

Example

This example shows how to use the RS232 functionality of the VT7001 module. It is
assumed, that power supply 1 of the VT7001 is connected to a proper counterpart (e.g. a
PC) via a serial connection. In this example the string “Hello World!” is sent by the
VT7001. After that all incoming characters are output to the write window. After 10
seconds the connection is closed.

Sample Code CAPL


RS232Example ()
{
// Declare variables for RS232 communication
char stringToSend[20] = "Hello World !"; // String to send
byte sendBuffer[20]; // Byte array to hold send data
byte receiveBuffer[20]; // Buffer for received data
int i; // Counter variable

// Register the RS232 callback functions


sysvar::VTS::ECUPowerSupply.SerialSetOnErrorHandler("OnRS232Error");
sysvar::VTS::ECUPowerSupply.SerialSetOnReceiveHandler("OnRS232Receive");
sysvar::VTS::ECUPowerSupply.SerialSetOnSendHandler("OnRS232Sent");

// Configure the serial port i.e. for communication with an external


// ECU power supply to 9600 baud, 8 data bits, 1 stop bit, no parity
sysvar::VTS::ECUPowerSupply.SerialConfigure(9600, 8, 1, 0);

// Open the serial port i.e. for communication with an external ECU
power supply
sysvar::VTS::ECUPowerSupply.SerialOpen();

// Wait briefly to make sure settings are applied and port is ready
TestWaitForTimeOut(10);

// **** Send data ****

// Copy the string to a byte array and send it


for (i=0; i<strlen(stringToSend); ++i) sendBuffer[i] = stringToSend[i];
sysvar::VTS::ECUPowerSupply.SerialSend(sendBuffer,
strlen(stringToSend));

// **** Receive data ****

// For 10s output all received data to the write window


Write("Waiting for incomming data...");
sysvar::VTS::ECUPowerSupply.SerialReceive(receiveBuffer,
elcount(receiveBuffer));
TestWaitForTimeOut(10000);

// Close the serial port


sysvar::VTS::ECUPowerSupply.SerialClose();
}

void OnRS232Error(dword flags)


{
// Write error details to the write window
Write("Error occurred on serial port of VT7001 module (Error code:
%d).", flags);
}

void OnRS232Receive(byte buffer[], dword number)


{
long i;
char string[256];
// Create a string from the given byte array
for(i=0; i<elcount(buffer); ++i)
string[i] = buffer[i];

// Write received data to the write window

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialConfigure

Write("Received '%s' (%d bytes) on ECU power supply port.", string,


number);
}

void OnRS232Sent(byte buffer[], dword number)


{
long i;
char string[256];

// Create a string from the given byte array


for(i=0; i<elcount(buffer); ++i)
string[i] = buffer[i];

// Write sent data to the write window


Write("Sent '%s' (%d bytes) on ECU power supply port.", string, number);
}

Sample Code .NET


public void RS232Example()
{
// Get VTS interface and external power supply 1
IVTSystem vts = VTSystem.Instance;
IVT7001Supply1 ecuPowerSupply = vts.GetChannel("ECUPowerSupply") as
IVT7001Supply1;

// Register the event handlers


ecuPowerSupply.OnSerialSentEvent += new
OnSerialSentHandler(this.SendHandler);
ecuPowerSupply.OnSerialReceivedEvent += new
OnSerialReceivedHandler(this.ReceiveHandler);
ecuPowerSupply.OnSerialErrorEvent += new
OnSerialErrorHandler(this.ErrorHandler);

// Configure the serial port i.e. for communication with an external


// ECU power supply to 9600 baud, 8 data bits, 1 stop bit, no parity
ecuPowerSupply.SerialConfigure(BaudRate.BaudRate9600, DataBits.Eight,
StopBits.One, Parity.None);

// Open the serial port i.e. for communication with an external ECU
power supply
ecuPowerSupply.SerialOpen();

// Wait briefly to make sure settings are applied and port is ready
Vector.CANoe.Threading.Execution.Wait(10);

// **** Send data ****


// Send a string via RS232
ecuPowerSupply.SerialSend("Hello world!");

// **** Receive data ****

// For 10s output all received data to the write window


byte[] receiveBuffer = new byte[32];
ecuPowerSupply.SerialReceive(receiveBuffer);
Vector.CANoe.Threading.Execution.Wait(10000);

// Close the serial port


ecuPowerSupply.SerialClose();
}

public void SendHandler(object sender, SerialSentEventArgs e)


{
// Print sent data to write window
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
Vector.Tools.Output.WriteLine("The following data was sent: " +
enc.GetString(e.Buffer));
}

public void ReceiveHandler(object sender, SerialReceivedEventArgs e)


{
// Print received data to write window
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
Vector.Tools.Output.WriteLine("Received the following data: " +
enc.GetString(e.Buffer));
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialConfigure

public void ErrorHandler(object sender, SerialErrorEventArgs e)


{
// Print error to write window
Vector.Tools.Output.WriteLine("An error occurred in the serial
connection: " + e.ErrorFlags.ToString());
}

Sample Code XML

| vtsSerialConfigure |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialOpen

SerialOpen
CAPL Function Overview » VT System » SerialOpen

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.
To make sure that no is lost execute a wait command between the call of this function
and the following sending or receiving of data.

Method SysVarNamespace.SerialOpen()

Function Opens the serial port of the VT System channel that is specified by the system variable
namespace.

Parameters —

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialOpen |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialReceive

SerialReceive
CAPL Function Overview » VT System » SerialReceive

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialReceive( byte buffer[], dword size)

Function Starts receiving blocks of bytes from the serial port of the specified VT7001 channel.
Received data is copied to the specified buffer. The data can only be accessed in the
OnSerialReceive callback.

• The operation works continuous if issued once


• If another receive operation will be given, the result buffer will change to that one
given by the last receive operation.
• A callback handler has to be set for notification when data has been received. See
SerialSetOnReceiveHandler.
• Another callback handler can be set to notify of errors in later stages of the send
operation. See SerialSetOnErrorHandler.

The used serial port has to be opened first.

Parameters buffer

An array of bytes where received data is copied to.

The buffer is only valid within the OnSerialReceive callback.

number

Maximum number of Bytes which can be received at a time. Must have a value > 0 and <
65.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

-5: Serial port is not open.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialReceive

| vtsSerialReceive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialSend

SerialSend
CAPL Function Overview » VT System » SerialSend

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialSend( byte buffer[], dword number)

Function Sends a block of bytes to the serial port of the specified VT7001 channel

• The operation starts the sending of a block.


• A callback handler can be set to notify when the send operation is completed. See
SerialSetOnSendHandler.
• Another callback handler can be set to notify of errors in later stages of the send
operation. See SerialSetOnErrorHandler. There are no automatic retrials in case of
error.

Parameters buffer

An array of bytes that contains the data to be sent.

number

Number of bytes to send from the buffer. Number must have a value > 0 and < 65.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: One of the parameters has an invalid value.

-5: Serial port is not open.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialSend |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialSetOnErrorHandler

SerialSetOnErrorHandler
CAPL Function Overview » VT System » SerialSetOnErrorHandler

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialSetOnErrorHandler( char onErrorCallback[])

Function Sets the callback that notifies when an error occurred during a send or receive operation.

The set callback has to have following signature: void <OnSerialError>( dword
errorFlags)

Parameters onErrorCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialSetOnErrorHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialSetOnReceiveHandler

SerialSetOnReceiveHandler
CAPL Function Overview » VT System » SerialSetOnReceiveHandler

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialSetOnReceiveHandler( char onReceiveCallback[])

Function Sets the callback that notifies when data has been received on the serial port of the
specified channel.

The set callback has to have following signature: void <OnSerialReceive>( byte
bffer[], dword number)

Parameters onReceiveCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialSetOnReceiveHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SerialSetOnSendHandler

SerialSetOnSendHandler
CAPL Function Overview » VT System » SerialSetOnSendHandler

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001 respectively the system variable
namespace that represents functionality common for the entire VT7001 module.

Method long SysVarNamespace.SerialSetOnSendHandler( char onSendCallback[])

Function Sets the callback that notifies when a send operation on the serial port of the specified
channel is completed successfully.

The set callback must have following signature: void <OnSerialSend>( byte
sendBuffer[], dword number)

Parameters onSendCallback

CAPL callback function name.

Return values 0: Successful call

-1: Non-specific error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The passed callback does not have the required signature, i.e. number or type of the
parameters are different than expected.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 SP3 Test nodes — •

Example

See example SerialConfigure

| vtsSerialSetOnSendHandler |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetCurveType

SetCurveType
CAPL Function Overview » VT System » SetCurveType

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetCurveType (dword Type)

Function Specifies the form (the dynamic) of the stimulation signal.

Parameters Type

0 Constant value, determined by the corresponding output system variable.


Nevertheless, this value can also be used dynamically by changing the value of the
variable in CANoe.

1 PWM

2 Analog wave form; loaded using LoadWFVoltage (for VT2004 and VT2816 only) or
LoadWFResistance (for VT2004 only), then started using StartStimulation

3 Bit stream (= digital wave form); loaded using LoadWFBitStream, then started using
StartStimulation (for VT2516 and VT2848 only)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified type is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetStimulationMode

| vtsSetCurveType |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetIntegrationTime

SetIntegrationTime
CAPL Function Overview » VT System » SetIntegrationTime

Note

The function can only be called on system variables for average and RMS measurement of
appropriate channels on a VT System module.

Method long SystemVariable.SetIntegrationTime (double IntTime)

Function Mean and RMS values are calculated in a moving measurement time window.
The length of the time window can be set with this function.

Parameters IntTime

Measurement time window in seconds.


VT1004: The only permissible time settings are 128 µs (= 0.000128; mean value only), 1
ms (mean value only), 10 ms, 100 ms, and 1 s.
VT2516/VT7001: The permissible time settings depend on the concrete measurement
values and are similar to the possible settings in the VT System configuration dialog.
If an invalid value is specified, the call will fail.

Return values 0: Successful call

-1: Call error, e.g., system variable does not belong to the VT system or integration time
is invalid

-2: The system variable on which the command was called is not valid

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

This example demonstrates how to change the integration time of a VT System system
variable during the measurement. The integration time is set to 1s to cancel out noise in
the sensor readings. It is assumed that the sensor to be read is connected to a channel
called TempSensor of the VT1004 module.

Sample Code CAPL


SetIntegrationTime ()
{
// Set integration time to 1 second
sysvar::VTS::TempSensor::Avg.SetIntegrationTime(1.0);

// Output sensor readings to the write window every second


while(1)
{
write("Average sensor value: %fV", @sysvar::VTS::TempSensor::Avg);
TestWaitForTimeOut(1000);
}
}

Sample Code .NET


public void SetIntegrationTime()
{
// Get VTS interface and temperature sensor channel
IVTSystem vts = VTSystem.Instance;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetIntegrationTime

IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as


IVT1004Channel;
// Set integration time to 1 second
tempSensor.Avg.IntegrationTime = 1.0;
// Output sensor readings to the write window every second
while (true)
{
Vector.Tools.Output.WriteLine("Average sensor value: " +
tempSensor.Avg.Value.ToString() + "V");
Vector.CANoe.Threading.Execution.Wait(1000);
}
}

Sample Code XML


<testcase title="SetIntegrationTime" ident="">
<vtsystem_configure title="Set integration time to 1s">
<integration_time channel="VTS::TempSensor"
sysvar="Avg">1.0</integration_time>
</vtsystem_configure>
<wait time="1000" title="Wait 1s" />
<valuecomment>
<description>Average value of the sensor</description>
<sysvar name="VTS::TempSensor::Avg"></sysvar>
</valuecomment>
</testcase>

| vtsSetIntegrationTime |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetInterconnectionMode

SetInterconnectionMode
CAPL Function Overview » VT System » SetInterconnectionMode

Note

The function can only be called on system variable namespaces of the VT System power
module VT7001 (namespace that represents the whole module).

This function may not be called in any CAPL handler routines or in ECU nodes. It may only
be called in the context of the MainTest method of a test module. Use a test module that
automatically runs at measurement start to set an initial state.

Method Long SysVarNamespace.SetInterconnectionMode (dword Mode)

Function Sets the mode for interconnection of the three possible power supplies and the two power
outputs of the power module VT7001.

Parameters Mode

0 Internal Power Supply only (mode supint)

1 Power Supply 1 only (mode sup1)

2 Power Supply 2 only (mode sup2)

3 Two independent power supplies for OUT1 and OUT2: internal power supply and
power supply 1 (mode supint_sup1)

4 Two independent power supplies for OUT1 and OUT2: internal power supply and
power supply 2 (mode supint_sup2)

5 Two independent power supplies for OUT1 and OUT2: power supply 1 and internal
power supply (mode sup1_supint)

6 Two independent power supplies for OUT1 and OUT2: power supply 1 and power
supply 2 (mode sup1_sup2)

7 Two independent power supplies for OUT1 and OUT2: power supply 2 and internal
power supply (mode sup2_supint)

8 Two independent power supplies for OUT1 and OUT2: power supply 2 and power
supply 1 (mode sup2_sup1)

9 Power supply 1 and power supply 2 are connected in series (sup_series)

10 Power supply 1 and power supply 2 are connected parallel (sup_parallel)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetInterconnectionMode

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example

The internal power supply unit delivers power and the ECU is connected to OUT1 (clamp
30), OUT2 (clamp 15) and GND1 (clamp 31). In this example, the channel for the internal
power sup-ply unit is named “IntSupply”, the two output channels are named “Clamp30”
and “Clamp15”, and the VT7001 module is named “PowerSupply”.

Sample Code CAPL


InternalPowerSupply ()
{
// Set mode to one power supply only -> internal power supply
sysvar::VTS::PowerSupply.SetInterconnectionMode(0);

// Set voltage to 12.0 V


sysvar::VTS::IntSupply.SetRefVoltageMode(1);
@sysvar::VTS::IntSupply::RefVoltage = 12.0;

// Switch both outputs on


@sysvar::VTS::Clamp30::Active = 1;
@sysvar::VTS::Clamp15::Active = 1;
// Measure the current consumed by the ECU via clamp 15
// after 2 seconds (result is written to the write window)
TestWaitForTimeOut(2000);
write("ECU is consuming %fmA.", @sysvar::VTS::Clamp30::AvgCurrent);
}

Sample Code .NET


public void InternalPowerSupply()
{
// Get VTS interface, VT7001 module, internal supply and two output
channels
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyInternal intSupply = vts.GetChannel("IntSupply") as
IVT7001SupplyInternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;
IVT7001Channel clamp15 = vts.GetChannel("Clamp15") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.SupInt;

// Set voltage to 12.0 V


intSupply.SetRefVoltageMode(RefVoltageMode.Constant);
intSupply.RefVoltage.Value = 12.0;

// Switch both outputs on


clamp30.Active.Value = OutputMode.Active;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetInterconnectionMode

clamp15.Active.Value = OutputMode.Active;

// Measure the current consumed by the ECU via clamp 15


// after 2 seconds (result is written to the write window)
Vector.CANoe.Threading.Execution.Wait(2000);
Vector.Tools.Output.WriteLine("ECU is consuming " +
clamp30.AvgCurrent.Value + "mA");
}

Sample Code XML


<testcase title="InternalPowerSupply" ident="">
<vtsystem_configure title="Initialize">
<ref_voltage_mode channel="VTS::IntSupply" mode="static" />
<interconnection_mode channel="VTS::PowerSupply" mode="supint" />
</vtsystem_configure>
<set title="Set voltage">
<sysvar name="VTS::IntSupply::RefVoltage">12</sysvar>
</set>
<set title="Activate outputs">
<sysvar name="VTS::Clamp15::Active">1</sysvar>
<sysvar name="VTS::Clamp30::Active">1</sysvar>
</set>
<wait time="2000" title="Wait 2s" />
<valuecomment>
<description>Measure current going through clamp 30</description>
<sysvar name="VTS::Clamp30::AvgCurrent"></sysvar>
</valuecomment>
</testcase>

| vtsSetInterconnectionMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetLoadControlTimeout

SetLoadControlTimeout
CAPL Function Overview » VT System » SetLoadControlTimeout

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT1004.

Method long SysVarNamespace.SetLoadControlTimeout (double Timeout)

Function When signals with brief interruptions are created (especially PWM signals), it is possible to
set a hold time (a control timeout) so that the electronic load does not have be corrected
again on every signal edge. Thus, if the input voltage rises again before the timeout
expires, the electronic load is still adjusted to the old value and only has to be corrected
minimally, if at all. Because the settling time is eliminated, very rapidly changing PWM
signals can also be operated with the electronic load.

The timeout time selected should be approximately 10 to 100 times higher than the
frequency of the control unit output signal. For a PWM signal with a frequency starting
from 10 Hz, a timeout time of 1 to 10 seconds is sufficient. If this functionality is not
required, the timeout time should be set to 0, because it slows down the corrections.

Parameters Timeout

Defines the timeout time for the internal load in seconds.

Permissible range of values: 1...255 s, resolution 1 s, 0: no timeout (default).

If an invalid value is specified, the command will fail.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified timeout is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example
sysvar::VTS::LowBeamRight.SetLoadControlTimeout (10.0);

The following figure illustrates the control response using an example:

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetLoadControlTimeout

A timeout of 2 s was set here. The input voltage (yellow) and the current flowing at the
input (red) are presented qualitatively. At the first pulse, the input voltage is not applied
for only approximately 1 s. In this case, a timeout does not occur and the set current
continues flowing when the input voltage is applied again. At the second pulse, a timeout
occurs. In this case, the input voltage is not applied for a period lasting more than 2 s.
The internal load is then connected with high resistance. If the input voltage is restored,
the internal load must first adjust to the set current, which is apparent from the slow rise
in the current.

| vtsSetLoadControlTimeout |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetLoadMode

SetLoadMode
CAPL Function Overview » VT System » SetLoadMode

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT1004.

Method long SysVarNamespace.SetLoadMode (dword Mode)

Function Switches the internal load to a specific mode.

Parameters Mode

0 Internal load not active

1 Current control

2 Resistance control

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.0 SP5 Test nodes — •

Example

The following example demonstrates the usage of the internal load of a VT1004 channel.
In this example the channel is called LowBeamLeft. The internal load is configured for
resistance-control-mode with a resistance of 120 Ohm. So the electronic load functions as
a constant resistor against the input.

The second part of the example shows how to use the current control mode. Here the
electronic load is regulated so that a constant current flows between the two ECU lines.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetLoadMode

Sample Code CAPL


InternalLoad_ResistanceControl ()
{
// Set the resistor of the internal load to 120Ohm
@sysvar::VTS::LowBeamLeft::IntLoadResistor = 120;

// Set internal load mode to resistance control


sysvar::VTS::LowBeamLeft.SetLoadMode(2);

// Connect ECU with internal load


@sysvar::VTS::LowBeamLeft::RelayIntLoadA = 1;
@sysvar::VTS::LowBeamLeft::RelayIntLoadB = 1;
}

InternalLoad_CurrentControl ()
{
// Set the current of the internal load to 1A
@sysvar::VTS::LowBeamLeft::IntLoadCurrent = 1;

// Set internal load mode to current control


sysvar::VTS::LowBeamLeft.SetLoadMode(1);

// Connect ECU with internal load


@sysvar::VTS::LowBeamLeft::RelayIntLoadA = 1;
@sysvar::VTS::LowBeamLeft::RelayIntLoadB = 1;
}

Sample Code .NET


public void InternalLoad_ResistanceControl()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel lowBeamLeft = vts.GetChannel("LowBeamLeft") as
IVT1004Channel;

// Set the resistor of the internal load to 120Ohm


lowBeamLeft.IntLoadResistor.Value = 120.0;

// Set internal load mode to resistance control


lowBeamLeft.LoadMode.Value = LoadMode.ResistanceControl;

// Connect ECU with internal load


lowBeamLeft.RelayIntLoadA.Value = true;
lowBeamLeft.RelayIntLoadB.Value = true;
}

public void InternalLoad_CurrentControl()


{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel lowBeamLeft = vts.GetChannel("LowBeamLeft") as
IVT1004Channel;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetLoadMode

// Set the current of the internal load to 1A


lowBeamLeft.IntLoadCurrent.Value = 1.0;

// Set internal load mode to current control


lowBeamLeft.LoadMode.Value = LoadMode.CurrentControl;

// Connect ECU with internal load


lowBeamLeft.RelayIntLoadA.Value = true;
lowBeamLeft.RelayIntLoadB.Value = true;
}

Sample Code XML


<testcase title="InternalLoad_ResistanceControl" ident="">
<set title="Set the resistor of the internal load to 120Ohm">
<sysvar name="IntLoadResistor"
namespace="VTS::LowBeamLeft">120</sysvar>
</set>
<vtsystem_configure title="Set internal load mode to resistor
control">
<load_mode channel="VTS::LowBeamLeft" mode="resistor" />
</vtsystem_configure>
<set title="Connect ECU with internal load">
<sysvar name="RelayIntLoadA"
namespace="VTS::LowBeamLeft">1</sysvar>
<sysvar name="RelayIntLoadB"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
</testcase>

<testcase title="InternalLoad_CurrentControl" ident="">


<set title="Set the current of the internal load to 1A">
<sysvar name="IntLoadCurrent"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
<vtsystem_configure title="Set internal load mode to current
control">
<load_mode channel="VTS::LowBeamLeft" mode="current" />
</vtsystem_configure>
<set title="Connect ECU with internal load">
<sysvar name="RelayIntLoadA"
namespace="VTS::LowBeamLeft">1</sysvar>
<sysvar name="RelayIntLoadB"
namespace="VTS::LowBeamLeft">1</sysvar>
</set>
</testcase>

| vtsSetLoadMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetMaxCurrentMode

SetMaxCurrentMode
CAPL Function Overview » VT System » SetMaxCurrentMode

Note

The function can only be called on system variable namespaces of channels that represent
an external power supply in a power module VT7001.

Method long SysVarNamespace.SetMaxCurrentMode (dword Mode, double Factor)

long SysVarNamespace.SetMaxCurrentMode (dword Mode)

Function Sets the mode for the control voltage output to control the power supply's maximal
output current.

Parameters Mode

0 Max current control voltage output not active

1 Constant value, determined by the corresponding output system variable

Factor

Factor to determine the control voltage from the defined (using the system variable or
the wave form) power supply max current value.
Power Supply Max Current * Factor = Control Voltage

The factor has a default value of 1.0 at measurement start. If the function is called
without factor parameter the currently set factor is kept.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example

In the following example the maximum current mode is activated on the power supply
channel ExtSupply of a VT7001 module. The max. current output is set to 10 A. Finally
the output Clamp30 of the VT7001 is activated. To set a max current of 10 A, e.g. a
control voltage of 5.0 V has to be given to the power supply. Therefore a factor of 0.5 has
to be used.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetMaxCurrentMode

Sample Code CAPL


SetMaxCurrentMode ()
{
// Set mode to one power supply only -> external power supply 1
sysvar::VTS::PowerSupply.SetInterconnectionMode(1);
// Activate the maximum current mode with constant value mode
// and a factor of 0.5
sysvar::VTS::ExtSupply.SetMaxCurrentMode(1, 0.5);
// Set power supply to max 10A
@sysvar::VTS::ExtSupply::MaxCurrent = 10.0;
// Switch output on
@sysvar::VTS::Clamp30::Active = 1;
}

Sample Code .NET


public void SetMaxCurrentMode()
{
// Get VTS interface, VT7001 module, internal supply and a output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Activate the maximum current mode with constant value mode


// and a factor of 0.5
extSupply.SetMaxCurrentMode(MaxCurrentMode.Constant, 0.5);
// Set power supply to max 10A
extSupply.MaxCurrent.Value = 10.0;

// Switch output on
clamp30.Active.Value = OutputMode.Active;
}

Sample Code XML


<testcase title="MaxCurrentMode" ident="">
<vtsystem_configure title="Initialize">
<max_current_mode channel="VTS::ExtSupply" mode="static"
factor="0.5" />
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<set title="Set maximum current">
<sysvar name="MaxCurrent" namespace="VTS::ExtSupply">10</sysvar>
</set>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
</testcase>

| vtsSetMaxCurrentMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetMeasurementMode

SetMeasurementMode
CAPL Function Overview » VT System » SetMeasurementMode

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT1004.

Method long SysVarNamespace.SetMeasurementMode (dword Mode)

Function Controls the internal measuring instrument.

VT1004: It is possible to switch between direct and filtered differential voltage


measurement as well as measurement of pin a or b to reference ground (AGND).

Parameters Mode

Modes for VT1004 module:

0 Differential voltage, unfiltered

1 Differential voltage, 10 kHz filter active

2 Voltage line A to ground

3 Voltage line B to ground

Modes for VT2816 module:

0 Differential voltage, range +/- 60V

1 Differential voltage, range +/- 10V

2 Voltage line A to ground (single-ended), range +/- 60V

3 Voltage line A to ground (single-ended), range +/- 10V

4 Current, range +/-5A

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid.

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetMeasurementMode

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

This example demonstrates how change the measurement mode of a VT1004 channel. By
default the voltage is measured between the two input lines A and B. This example shows
how to configure a measurement between input line A and the VT1004 module’s AGND.

Sample Code CAPL


MeasurementAToAGnd ()
{
// Change measurement mode from differential
// to line A against ground (AGND)
sysvar::VTS::TempSensor.SetMeasurementMode(2);

// Measure the voltage between line A and AGND


write("Current voltage: %0.2fV", @sysvar::VTS::TempSensor::Cur);
}

Sample Code .NET


public void MeasurementAToAGnd()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel tempSensor = vts.GetChannel("TempSensor") as
IVT1004Channel;

// Change measurement mode from differential


// to line A against ground (AGND)
tempSensor.MeasurementMode.Value = MeasurementMode.LineAToGnd;

// Print measurement results to write window


Vector.Tools.Output.WriteLine("Current voltage: " +
tempSensor.Cur.Value + "V");
}

Sample Code XML


<testcase title="MeasurementAToAGnd" ident="">
<vtsystem_configure title="Set measurement mode">
<measurement_mode channel="VTS::TempSensor" mode="a_only" />
</vtsystem_configure>
<valuecomment>
<description>Current sensor voltage</description>
<sysvar name="VTS::TempSensor::Cur" />
</valuecomment>
</testcase>

| vtsSetMeasurementMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputMode

SetOutputMode
CAPL Function Overview » VT System » SetOutputMode

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetOutputMode (dword Mode)

Function Sets the mode for output on the channel.

Parameters Mode

Modes of VT2848 module:

0 Output off

1 High side switch

2 Low side switch

3 Push pull

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

The following example demonstrates how to use the PWM output of a VT2848 channel to
simulate a PWM based sensor (e.g. a RPM sensor). The channel used in this example is
called RPM_Sensor.

Sample Code CAPL


SimulateSensorPWM ()
{
// The current value of the frequency (100Hz)
float currentFrequency = 100.0;

// Choose ′l ow s i d e s wi t ch ′, PWM cur


// Vext as source for high value
sysvar::VTS::RPM_Sensor.SetOutputMode (2);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputMode

sysvar::VTS::RPM_Sensor.SetCurveType(1);
sysvar::VTS::SensorModule1.SetOutputSource(0, 0);

// Set the number of repeats to unlimited


sysvar::VTS::RPM_Sensor.SetPWMRepeats(0);

// Set initial frequency (100Hz) and duty cycle (50%) values


@sysvar::VTS::RPM_Sensor::PWMOutputFreq = currentFrequency;
@sysvar::VTS::RPM_Sensor::PWMOutputDC = 50.0;

// Start the stimulation


sysvar::VTS::RPM_Sensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
TestWaitForTimeOut(100);
currentFrequency += 1;
@sysvar::VTS::RPM_Sensor::PWMOutputFreq = currentFrequency;
}

// Stop the stimulation


sysvar::VTS::RPM_Sensor.StopStimulation();
}

Sample Code .NET


public void SimulateSensorPWM()
{
// Get VTS interface, module and channel
IVTSystem vts = VTSystem.Instance;
IVT2848 sensorModule1 = vts.GetChannel<IVT2848>("Sensor_Module1");
IVT2848PWMStimChannel rpmSensor =
vts.GetChannel<IVT2848PWMStimChannel>("RPM_Sensor");

// The current value of the frequency (100Hz)


double currentFrequency = 100.0;

// Choose the source for high voltage on channels 1-4


sensorModule1.OutputSource1To4.Value = OutputSource.VExt;

// Choose a PWM curve


rpmSensor.CurveType.Value = CurveType.PWM;
// Set the number of repeats to unlimited
rpmSensor.PWMRepeats.Value = 0;
// Set initial frequency (100Hz) and duty cycle (50%) values
rpmSensor.PWMOutputFreq.Value = currentFrequency;
rpmSensor.PWMOutputDC.Value = 50.0;

// Start the stimulation


rpmSensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while (currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
Vector.CANoe.Threading.Execution.Wait(100);
currentFrequency += 1;
rpmSensor.PWMOutputFreq.Value = currentFrequency;
}

// Stop the stimulation


rpmSensor.StopStimulation();
}

Sample Code XML


<testcase title="SimulateSensorPWM" ident="">
<vtsystem_configure title="Initialize PWM">
<output_mode channel="VTS::RPM_Sensor" mode="low_side_switch" />
<curve_type channel="VTS::RPM_Sensor" type="pwm" />
<output_source channel="VTS::RPM_Sensor" source="v_ext" />

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputMode

</vtsystem_configure>
<set title="Set frequency and duty cycle">
<sysvar name="VTS::RPM_Sensor::PWMOutputDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMOutputFreq">100.0</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::RPM_Sensor" />
</vtsystem_configure>
</testcase>

| vtsSetOutputMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputRange

SetOutputRange
CAPL Function Overview » VT System » SetOutputRange

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetOutputRange (dword Range)

Function Sets the range that is used for analog output on output channels of VT2816 modules.

Parameters Range

0 0..28V

1 -10V..+10V

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example
sysvar::VTS::TempSensor.SetOutputRange (1);

| vtsSetOutputRange |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputSource

SetOutputSource
CAPL Function Overview » VT System » SetOutputSource

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetOutputSource (dword Group, dword Source)

Function Sets the source for the high voltage level for output. This settings can only be set for
groups of channels.

Parameters Group

0 Channels 1-4

1 Channels 5-8

2 Channels 9-12

3 Channels 13-16

4 Channels 17-20

5 Channels 21-24

6 Channels 25-28

7 Channels 29-32

8 Channels 33-36

9 Channels 37-40

10 Channels 41-44

11 Channels 45-48

Source

0 Vext

1 Vbatt

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified group or source is not valid

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetOutputSource

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

See example SetOutputMode

| vtsSetOutputSource |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMMeasurementDuration

SetPWMMeasurementDuration
CAPL Function Overview » VT System » SetPWMMeasurementDuration

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetPWMMeasurementDuration (double Duration)

Function The PWM parameters are calculated in a measurement time window of a defined (VT1004)
resp. maximum (VT2516 and VT2848) length, which can be set with this function.
For maximum accuracy during measurement, the time window should be at least 10 times
larger than the PWM signal's duration.
Please note that measurement duration effects latency. PWM parameters are determined
within the defined measurement duration and updated after this period of time. This
means that a change of a PWM signal will be reflected in the measurement values not
before a measurement period defined by this function has expired (exception: VT2516
updates PWM parameters immediately after a full signal period is determined). The
determined PWM parameters are updated on the module and can then be fetched by
CANoe (cyclically done defined by the cycle time).

Parameters Duration

Time window in seconds during which PWM signals are measured.


VT1004: Time windows can be set between 1 µs (0.000001) and 50 s in increments of 1, 2,
and 5 (1 µs, 2 µs, 5 µs, 10 µs, 20 µs, 50 µs, ...).
VT2516 and VT2848: Time windows can be set between 10 ms (0.01) and 11 min (660) in
steps of 10 ms.
If an invalid value is specified, the setting is rounded up to the next highest value.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified measurement duration is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

This example demonstrates how to do a PWM measurement on a channel of a VT1004


module. In this example the channel is called RPMSensor and assumed to be connected to
a sensor which generates a PWM signal. Every second the measured frequency and duty
cycle are written to CANoe's Write window / once to the test report.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMMeasurementDuration

Sample Code CAPL


PerformPWMMeasurement ()
{
// Declare variables to hold measured data
float frequency;
float dutyCycle;

// Configure channel for PWM measurement


sysvar::VTS::RPMSensor.SetPWMMeasurementDuration(0.1); // 100ms
sysvar::VTS::RPMSensor.SetPWMThreshold(2.5); // 2.5V

// Print measurement results to write window every second


while(1)
{
// Get measured values from VT System system variables
frequency = @sysvar::VTS::RPMSensor::PWMFreq;
dutyCycle = @sysvar::VTS::RPMSensor::PWMDC;

write("Frequency: %0.2fHz, Duty Cycle: %0.2f%%.", frequency,


dutyCycle);
TestWaitForTimeOut(1000);
}
}

Sample Code .NET


public void PerformPWMMeasurement()
{
// Get VTS interface and VT1004 channel
IVTSystem vts = VTSystem.Instance;
IVT1004Channel rpmSensor = vts.GetChannel("RPMSensor") as
IVT1004Channel;

// Configure channel for PWM measurement


rpmSensor.PWMMeasurementDuration.Value = 0.1; // 100ms
rpmSensor.PWMThreshold.Value = 2.5; // 2.5V

// Print measurement results to write window every second


while (true)
{
Vector.Tools.Output.WriteLine("Frequency: " +
rpmSensor.PWMFreq.Value + "Hz");
Vector.Tools.Output.WriteLine("DutyCycle: " +
rpmSensor.PWMDC.Value + "%");
Vector.CANoe.Threading.Execution.Wait(1000);
}
}

Sample Code XML


<testcase title="PerformPWMMeasurement" ident="">

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMMeasurementDuration

<vtsystem_configure title="Configure PWM measurement">


<pwm_measurement_duration
channel="VTS::RPMSensor">0.1</pwm_measurement_duration>
<pwm_threshold channel="VTS::RPMSensor">2.5</pwm_threshold>
</vtsystem_configure>
<wait time="100" title="Wait 100ms" />
<valuecomment>
<description>RPM sensor duty cycle</description>
<sysvar name="VTS::RPMSensor::PWMDC"></sysvar>
</valuecomment>
<valuecomment>
<description>RPM sensor frequency</description>
<sysvar name="VTS::RPMSensor::PWMFreq"></sysvar>
</valuecomment>
</testcase>

| vtsSetPWMMeasurementDuration |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMRepeats

SetPWMRepeats
CAPL Function Overview » VT System » SetPWMRepeats

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetPWMRepeats (dword numOfRepeats)

Function This function sets the number of stimulated PWM periods after the start of stimulation. If
the number of cycles output is not limited, numOfRepeats must be set to 0.

Parameters numOfRepeats

Number of PWM periods to be stimulated.


Valid values: 0…65535.

Return values 0: Successful call

-1: Error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The specified number of repeats is not valid.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Test nodes — •

Example

See example SetStimulationMode

| vtsSetPWMRepeats |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMResistanceHigh

SetPWMResistanceHigh
CAPL Function Overview » VT System » SetPWMResistanceHigh

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT2004.

Method long SysVarNamespace.SetPWMResistanceHigh (double Resistance)

Function Specifies the resistance value of a high signal on PWM output in "Resistance output PWM"
mode.

Parameters Resistance

Resistance value in ohms.


Resistance may have values from 1.0 (1 Ω) up to 250000.0 (250 kΩ). This range is only
supported by channel 4 of the VT2004 module. The other channels can handle values from
10.0 (10 Ω) up to 150000.0 (150 kΩ).
In special cases Resistance may be set to -1 on each channel to get infinite resistance.

Values outside the hardware's possible range of values are rounded up to the next highest
value or the highest or lowest possible value is used.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified resistance is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

The following example demonstrates how to use the internal resistor decade of a VT2004
channel to simulate a PWM based sensor. On channel Temp_Sensor the resistor is toggled
between 100 Ohm and 140 Ohm with a frequency of 20 Hz and a duty cycle of 50%.

Sample Code CAPL


SimulateSensorPWMResistance ()
{
// Choose resistor stimulation and a PWM curve type
sysvar::VTS::Temp_Sensor.SetStimulationMode(3);
sysvar::VTS::Temp_Sensor.SetCurveType(1);

// Configure low (100Ohm) and high (140Ohm) resistance values


sysvar::VTS::Temp_Sensor.SetPWMResistanceLow(100);
sysvar::VTS::Temp_Sensor.SetPWMResistanceHigh(140);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMResistanceHigh

// Set the number of repeats to unlimited


sysvar::VTS::Temp_Sensor.SetPWMRepeats(0);

// Create a PWM signal with frequency 20Hz and DC 50%


@sysvar::VTS::Temp_Sensor::PWMFreq = 20.0;
@sysvar::VTS::Temp_Sensor::PWMDC = 50.0;

// Start the stimulation


sysvar::VTS::Temp_Sensor.StartStimulation();
}

Sample Code .NET


public void SimulateSensorPWMResistance()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose resistor stimulation and a PWM curve type


tempSensor.SetStimulationMode(StimulationMode.ResistanceLower,
CurveType.PWM);

// Configure low (100Ohm) and high (140Ohm) resistance values


tempSensor.PWMResistanceLow.Value = 100.0;
tempSensor.PWMResistanceHigh.Value = 140.0;

// Set the number of repeats to unlimited


tempSensor.PWMRepeats.Value = 0;

// Start the stimulation


tempSensor.StartStimulation();

// Create a PWM signal with frequency 20Hz and DC 50%


tempSensor.PWMFreq.Value = 20.0;
tempSensor.PWMDC.Value = 50.0;
}

Sample Code XML


<testcase title="SimulateSensorPWMResistance" ident="">
<vtsystem_configure title="Initialize PWM">
<stimulation_mode channel="VTS::Temp_Sensor" mode="resistor_gt" />
<curve_type channel="VTS::Temp_Sensor" type="pwm" />
<pwm_resistance_low
channel="VTS::Temp_Sensor">100</pwm_resistance_low>
<pwm_resistance_high
channel="VTS::Temp_Sensor">140</pwm_resistance_high>
</vtsystem_configure>
<set title="Set frequency and duty cycle">
<sysvar name="VTS::RPM_Sensor::PWMDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMFreq">20</sysvar>
</set>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

| vtsSetPWMResistanceHigh |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMResistanceLow

SetPWMResistanceLow
CAPL Function Overview » VT System » SetPWMResistanceLow

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT2004.

Method long SysVarNamespace.SetPWMResistanceLow (double Resistance)

Function Specifies the resistance value of a low signal on PWM output in Resistance output PWM
mode.

Parameters Resistance

Resistance value in ohms.


Resistance may have values from 1.0 (1 Ω) up to 250000.0 (250 kΩ). This range is only
supported by channel 4 of the VT2004 module. The other channels can handle values from
10.0 (10 Ω) up to 150000.0 (150 kΩ).
In special cases Resistance may be set to -1 on each channel to get infinite resistance.

Values outside the hardware's possible range of values are rounded up to the next highest
value or the highest or lowest possible value is used.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified resistance is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetPWMResistanceHigh

| vtsSetPWMResistanceLow |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMThreshold

SetPWMThreshold
CAPL Function Overview » VT System » SetPWMThreshold

Note

The function can only be called on system variable namespaces of channels belonging to
the VT System module VT1004.

Method long SysVarNamespace.SetPWMThreshold (double Threshold)

Function Sets the threshold value for differentiating between high and low levels.

Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Threshold

Voltage value in volts in the range from -32 V to +32 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetPWMMeasurementDuration

| vtsSetPWMThreshold |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMVoltageHigh

SetPWMVoltageHigh
CAPL Function Overview » VT System » SetPWMVoltageHigh

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetPWMVoltageHigh (double Voltage)

Function Specifies the high level on output of a digital output signal, especially a PWM signal.

Parameters Voltage

Voltage of the high level in volts in the range 0 ... 28 V (VT2004) resp. 0 ... 25 V
(VT2516).

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified voltage is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetStimulationMode

| vtsSetPWMVoltageHigh |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetPWMVoltageLow

SetPWMVoltageLow
CAPL Function Overview » VT System » SetPWMVoltageLow

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetPWMVoltageLow (double Voltage)

Function Specifies the low level on output of a digital output signal, especially a PWM signal.

Parameters Voltage

Voltage of the low level in volts in the range 0 ... 28 V (VT2004) resp. 0 ... 25 V (VT2516).

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified voltage is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetStimulationMode

| vtsSetPWMVoltageLow |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetRefVoltageMode

SetRefVoltageMode
CAPL Function Overview » VT System » SetRefVoltageMode

Note

The function can only be called on system variable namespaces of channels that represent
a power supply in a power module VT7001.

Method long SysVarNamespace.SetRefVoltageMode (dword Mode) // form 1

long SysVarNamespace.SetRefVoltageMode (dword Mode, double Factor) // form


2

Function Sets the mode for the reference voltage output to control the power supply's output
voltage.

Parameters Mode

0 Reference voltage output not active

1 Constant value, determined by the corresponding output system variable

2 Analog wave form; loaded using LoadWFVoltage, then started using


StartStimulation

Factor

Factor to determine the control voltage from the defined (using the system variable or
the wave form) power supply output voltage.

Info

The factor is given by the external power supply. This factor is the ratio of
the control voltage to the output voltage. For example, if a power supply
outputs 50 V at a control voltage of 5 V, its factor is 0.1 (5/50).

Use form 1 for the internal power supply - the factor is always 1.

Use form 2 with explicitly given factor for the external power supplies. The default factor
is 1.0.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetRefVoltageMode

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example

In order to output a control voltage (VControl) which leads to the desired output voltage VOut,
the VT7001 must know the power supply factor.

In the following example, the factor of the external power supply is 0.1 and the desired
output voltage VOut is 15 V.

To achieve the desired output voltage (VOut), the VT7001 calculates and sets the control
voltage (VControl) automatically (1.5 V =15 * 0.1), which results in an output voltage of 15 V.

Sample Code CAPL


SetRefVoltageMode ()
{
// Set mode to one power supply only -> external power supply 1
sysvar::VTS::PowerSupply.SetInterconnectionMode(1);

// The factor 0.1 of the external power supply is transmitted to the


VT7001
sysvar::VTS::ExtSupply.SetRefVoltageMode(1, 0.1);

// The following line sets the output voltage to 15 V,


// VControl (1.5 V) is calculated with the given factor automatically
@sysvar::VTS::ExtSupply::RefVoltage = 15;

// Switch output on
@sysvar::VTS::Clamp30::Active = 1;
}

Sample Code .NET


public void SetRefVoltageMode()
{
// Get VTS interface, VT7001 module, internal supply and a output
channel
IVTSystem vts = VTSystem.Instance;
IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as
IVT7001SupplyExternal;
IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

// Set mode to one power supply only -> external power supply 1
powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

// Activate the reference voltage mode with constant value mode


// and a factor of 0.1
extSupply.SetRefVoltageMode(RefVoltageMode.Constant, 0.1);

// The following line sets the output voltage to 15 V,


// VControl (1.5 V) is calculated with the given factor automatically
extSupply.RefVoltage.Value = 15.0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetRefVoltageMode

// Switch output on
clamp30.Active.Value = OutputMode.Active;
}

Sample Code XML


<testcase title="RefVoltageMode" ident="">
<vtsystem_configure title="Initialize">
<ref_voltage_mode channel="VTS::ExtSupply" mode="static"
factor="0.1" />
<interconnection_mode channel="VTS::PowerSupply" mode="sup1" />
</vtsystem_configure>
<set title="Set reference voltage">
<sysvar name="MaxCurrent" namespace="VTS::ExtSupply">15</sysvar>
</set>
<set title="Activate output">
<sysvar name="Active" namespace="VTS::Clamp30">1</sysvar>
</set>
</testcase>

| vtsSetRefVoltageMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetStimulationMode

SetStimulationMode
CAPL Function Overview » VT System » SetStimulationMode

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetStimulationMode (dword Mode)

Function Sets the mode for internal voltage or resistance stimulation.

Parameters Mode

0 Internal stimulation not active

1 Voltage stimulation

2 Potentiometer stimulation (VT2004 only)

3 Resistance stimulation R> (on switching between resistance values, only


intermediate states with resistance values higher than the output or target
resistance will occur) (VT2004 only)

4 Resistance stimulation R< (on switching between resistance values, only


intermediate states with lower resistance values will occur) (VT2004 only)

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-3: The specified mode is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

The following example demonstrates how to use the PWM output of a VT2004 channel to
simulate a PWM based sensor (e.g. a RPM sensor). The channel used in this example is
called RPM_Sensor.

Sample Code CAPL


SimulateSensorPWM ()
{
// The current value of the frequency (100Hz)
float currentFrequency = 100.0;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetStimulationMode

// Choose voltage stimulation and a PWM curve type


sysvar::VTS::RPM_Sensor.SetStimulationMode(1);
sysvar::VTS::RPM_Sensor.SetCurveType(1);

// PWM signal will toggle between 0V and 5V


sysvar::VTS::RPM_Sensor.SetPWMVoltageLow(0.0);
sysvar::VTS::RPM_Sensor.SetPWMVoltageHigh(5.0);

// Set the number of repeats to unlimited


sysvar::VTS::RPM_Sensor.SetPWMRepeats(0);

// Set initial frequency (100Hz) and duty cycle (50%) values


@sysvar::VTS::RPM_Sensor::PWMFreq = currentFrequency;
@sysvar::VTS::RPM_Sensor::PWMDC = 50.0;

// Start the stimulation


sysvar::VTS::RPM_Sensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
TestWaitForTimeOut(100);
currentFrequency += 1;
@sysvar::VTS::RPM_Sensor::PWMFreq = currentFrequency;
}

// Stop the stimulation


sysvar::VTS::RPM_Sensor.StopStimulation();
}

Sample Code .NET


public void SimulateSensorPWM()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel rpmSensor = vts.GetChannel("RPM_Sensor") as
IVT2004Channel;

// The current value of the frequency (100Hz)


double currentFrequency = 100.0;

// Choose voltage stimulation and a PWM curve type


rpmSensor.SetStimulationMode(StimulationMode.Voltage, CurveType.PWM);
// PWM signal will toggle between 0V and 5V
rpmSensor.PWMVoltageLow.Value = 0.0;
rpmSensor.PWMVoltageHigh.Value = 5.0;

// Set the number of repeats to unlimited


rpmSensor.PWMRepeats.Value = 0;

// Set initial frequency (100Hz) and duty cycle (50%) values


rpmSensor.PWMFreq.Value = currentFrequency;
rpmSensor.PWMDC.Value = 50.0;

// Start the stimulation


rpmSensor.StartStimulation();

// To stimulate different sensor readings increase


// frequency of the PWM signal over time
while(currentFrequency < 200)
{
// Increase the frequency by 1Hz every 100ms
Vector.CANoe.Threading.Execution.Wait(100);
currentFrequency += 1;
rpmSensor.PWMFreq.Value = currentFrequency;
}

// Stop the stimulation


rpmSensor.StopStimulation();
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetStimulationMode

Sample Code XML


<testcase title="SimulateSensorPWM" ident="">
<vtsystem_configure title="Initialize PWM">
<stimulation_mode channel="VTS::RPM_Sensor" mode="voltage" />
<curve_type channel="VTS::RPM_Sensor" type="pwm" />
<pwm_voltage_low channel="VTS::RPM_Sensor">0.0</pwm_voltage_low>
<pwm_voltage_high channel="VTS::RPM_Sensor">5.0</pwm_voltage_high>
</vtsystem_configure>
<set title="Set frequency and duty cycle">
<sysvar name="VTS::RPM_Sensor::PWMDC">50.0</sysvar>
<sysvar name="VTS::RPM_Sensor::PWMFreq">100.0</sysvar>
</set>
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::RPM_Sensor" />
</vtsystem_configure>
</testcase>

| vtsSetStimulationMode |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetThreshold

SetThreshold
CAPL Function Overview » VT System » SetThreshold

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetThreshold (dword Group, double Threshold)

Function Sets the threshold value for differentiating between high and low levels of a group of
channels on a VT2848 module.
There is only one threshold setting for each group.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Group

0 Channels 1-8

1 Channels 9-16

2 Channels 17-24

3 Channels 25-32

4 Channels 33-40

5 Channels 41-48

Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 SP4 Test nodes — •

Example

The following example demonstrates how to configure the first channel of a VT2848
module for PWM measurement. The channel used in this example is called RPM_Sensor,

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetThreshold

the VT2848 is called Sensors.

Sample Code CAPL


PWMMeasurement ()
{
// Set the PWM thresholds of channels 1 to 8 to 2.5V
vtsSetThreshold("Sensors", 0, 2.5);

// Set the PWM measurement duration of the first channel to 100ms


vtsSetPWMMeasurementDuration("RPM_Sensor", 0.1);

// Wait 500ms and output the measured PWM frequency and duty cycle
TestWaitForTimeout(500);
write("Measured frequency %fHz and DC %f",
@sysvar::VTS::RPM_Sensor::PWMFreq, @sysvar::VTS::RPM_Sensor::PWMDC);
}

Sample Code .NET


private void Example3()
{
IVTSystem vts = VTSystem.Instance;
// Get the VT2848 module
IVT2848 sensors = vts.GetModule<IVT2848>("Sensors");
// Set the PWM thresholds of channels 1 to 8 to 2.5V
sensors.Threshold1To8.Value = 2.5;

// Set the PWM measurement duration of the first channel to 100ms


sensors.Channel1.PWMMeasurementDuration.Value = 0.1;

// Wait 500ms and output the measured PWM frequency and duty cycle
Execution.Wait(500);
Output.WriteLine(string.Format("Measured frequency {0}Hz and DC
{0}%", sensors.Channel1.PWMFreq.Value, sensors.Channel1.PWMDC.Value));
}

Sample Code XML


<vtsystem_configure title="Initialize">
<pwm_measurement_duration
channel="VTS::RPM_Sensor">0.1</pwm_measurement_duration>
<group_threshold channel="VTS::Sensors" group="1-
8">2.5</group_threshold>
</vtsystem_configure>
<wait title="Wait 500ms" time="500" />
<valuecomment>
<description>Write measured frequency</description>
<sysvar name="PWMFreq" namespace="VTS::RPM_Sensor" />
</valuecomment>
<valuecomment>
<description>Write measured duty cycle</description>
<sysvar name="PWMDC" namespace="VTS::RPM_Sensor" />
</valuecomment>

| vtsSetThreshold |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetThreshold1_8

SetThreshold1_8
CAPL Function Overview » VT System » SetThreshold1_8

Note

The function can only be called on system variable namespaces of a VT System module
VT2516 (namespace for the whole module).

Method long SysVarNamespace.SetThreshold1_8 (double Threshold)

Function Sets the threshold value for differentiating between high and low levels of the channels
1…8 of a digital module VT2516.
There is only one threshold setting for all eight channels together.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example

The following example demonstrates how to measure a PWM signal on a VT2516 channel
(e.g. a ECU output that controls an LED). The measured frequency and duty cycle is then
output to the Write window / the test report.

Sample Code CAPL


PWMMeasurement ()
{
// Declare variables to hold measured data

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetThreshold1_8

float frequency;
float dutyCycle;

// Set threshold for channels 1-8 to 2.5 V


sysvar::VTS::DigitalSignals.SetThreshold1_8(3.5);

// Set maximum measurement duration to 100 ms


// (because the lowest PWM frequency is 100 Hz)
sysvar::VTS::LED.SetPWMMeasurementDuration(0.1);

// Wait 100 ms and read measured PWM parameters


TestWaitForTimeout (100);
frequency = @sysvar::VTS::LED::PWMFreq;
dutyCycle = @sysvar::VTS::LED::PWMDC;

// Output measured values to the write window


write("Frequency: %0.2fHz, Duty Cycle: %0.2f%%.", frequency, dutyCycle);
}

Sample Code .NET


public void PWMMeasurement()
{
// Get VTS interface, VT2516 module and VT2516 channel
IVTSystem vts = VTSystem.Instance;
IVT2516 vt2516 = vts.GetModule("DigitalSignals") as IVT2516;
IVT2516Channel led = vts.GetChannel("LED") as IVT2516Channel;

// Set threshold for channels 1-8 to 2.5 V


vt2516.Threshold1To8.Value = 3.5;

// Set maximum measurement duration to 100 ms


// (because the lowest PWM frequency is 100 Hz)
led.PWMMeasurementDuration.Value = 0.1;

// Wait 100 ms and read measured PWM parameters


Vector.CANoe.Threading.Execution.Wait(100);
double frequency = led.PWMFreq.Value;
double dutyCycle = led.PWMDC.Value;

// Output measured values to the write window


Vector.Tools.Output.WriteLine("Frequency: " + frequency + "Hz");
Vector.Tools.Output.WriteLine("DutyCycle: " + dutyCycle + "%");
}

Sample Code XML


<testcase title="PWMMeasurement" ident="">
<vtsystem_configure title="Initialize PWM measurement">
<pwm_measurement_duration
channel="VTS::LED">0.1</pwm_measurement_duration>
<group_threshold channel="VTS::DigitalSignals" group="1-
8">3.5</group_threshold>
</vtsystem_configure>
<wait time="100" title="Wait 100ms" />
<valuecomment>
<description>Measured PWM duty cycle</description>
<sysvar name="VTS::LED::PWMDC"></sysvar>
</valuecomment>
<valuecomment>
<description>Measured PWM frequency</description>
<sysvar name="VTS::LED::PWMFreq"></sysvar>
</valuecomment>
</testcase>

| vtsSetThreshold1_8 |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetThreshold9_16

SetThreshold9_16
CAPL Function Overview » VT System » SetThreshold9_16

Note

The function can only be called on system variable namespaces of a VT System module
VT2516 (namespace for the whole module).

Method long SysVarNamespace.SetThreshold9_16 (double Threshold)

Function Sets the threshold value for differentiating between high and low levels of the channels
9…16 of a digital module VT2516.
There is only one threshold setting for all eight channels together.
Voltages at the input exceeding this threshold value are evaluated as high level and
voltages undershooting it are evaluated as low level.

Parameters Threshold

Voltage value in volts in the range from 0…25 V.

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace

-3: The specified threshold is not valid

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT System. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 Test nodes — •

Example

See example SetThreshold1_8

| vtsSetThreshold9_16 |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetTransferCycle

SetTransferCycle
CAPL Function Overview » VT System » SetTransferCycle

Note

This function is available to all "read" system variables created in the VT System.

Method long SystemVariable.SetTransferCycle (double CycleTime)

Function Sets the cycle time for retrieving the measured value of a system variable from the VT
System and writing it to the corresponding system variable.

Parameters CycleTime

Defines the cycle time in seconds.


The only available cycle times are 1 ms (= 0,001), 2 ms, 5 ms, 10 ms, 20 ms, 50 ms, 100
ms, 200 ms, 500 ms, 1 s, 2 s, 5 s and 10 s. Please note that not all cycle times are
available for all measurement values. See possible settings in the VT System configuration
dialog.
If an invalid cycle time is specified, the call will fail with a feedback value of -1.

Return values 0: Successful call

-1: Call error, e.g., system variable does not belong to the VT System or cycle time is
invalid.

-4: Invalid system variable

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

The following example demonstrates how to change the transfer cycle of a VT System
system variable during the measurement. Here the transfer cycle is reduced to 1 ms while
the function waits for the input signal to change. This allows for a fast reaction. After the
event has occurred the transfer cycle is set back to 100 ms.

Sample Code CAPL


testfunction WaitForECUSignalChange ()
{
// Change transfer cycle to 1ms to allow fast reaction
sysvar::VTS::ECU_Dout_1::CurBit.SetTransferCycle(0.001);

// Wait for digital ECU output to rise


while(1)
{
if(@sysvar::VTS::ECU_Dout_1::CurBit == 1) break;
TestWaitForTimeOut(1);
}

// Change transfer cycle back to 100ms


sysvar::VTS::ECU_Dout_1::CurBit.SetTransferCycle(0.1);
}

Sample Code .NET


public void WaitForECUSignalChange()
{

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetTransferCycle

// Get VTS interface and digital input channel


IVTSystem vts = VTSystem.Instance;
IVT2516Channel ecuDOut1 = vts.GetChannel("ECU_Dout_1") as
IVT2516Channel;

// Change transfer cycle to 1ms to allow fast reaction


ecuDOut1.CurBit.TransferCycle = 0.001;

// Wait for digital ECU output to change


bool initialValue = ecuDOut1.CurBit.Value;
while (ecuDOut1.CurBit.Value == initialValue)
Vector.CANoe.Threading.Execution.Wait(1);

// Change transfer cycle back to 100ms


ecuDOut1.CurBit.TransferCycle = 0.1;
}

Sample Code XML


<testcase title="SetTransferCycle" ident="">
<vtsystem_configure title="Set transfer cycle to 1ms">
<transfer_cycle channel="VTS::ECU_Dout_1"
sysvar="CurBit">0.001</transfer_cycle>
</vtsystem_configure>
<awaitvaluematch timeout="5000" title="Wait for input value to go to
1">
<sysvar name="VTS::ECU_Dout_1::CurBit">1</sysvar>
</awaitvaluematch>
<completion>
<vtsystem_configure title="Set transfer cycle to back to 100ms">
<transfer_cycle channel="VTS::ECU_Dout_1"
sysvar="CurBit">0.1</transfer_cycle>
</vtsystem_configure>
</completion>
</testcase>

| vtsSetTransferCycle |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetWFParams

SetWFParams
CAPL Function Overview » VT System » SetWFParams

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.SetWFParams (double timeIncrement, double pause, dword


numOfRepeats)

long SysVarNamespace.SetWFParams (double timeIncrement, double pause, dword


numOfRepeats, double startDelay, dword startPoint)

Function The function configures the parameters for the output of a voltage or resistance curve or
bitstream.

Parameters timeIncrement

Specifies how long the value of a specified interpolation point is to be stimulated before
transitioning to the next interpolation point.
Depending on the module and the wave form different ranges for timeIncrement are
valid:

Voltage curves: 0.00001 (10 µs)…0.065 (65 ms)

Voltage curves on a VT2816 module: timeIncrement can be -0.065 (-65ms)…0.065 (65


ms). If the value is negative, the wave form is output backwards. Note that output
accuracy depends highly on environmental conditions for values between -0.00001(-10µs)
and 0.00001 (10µs).

Resistance curves: 0.0005 (500 µs)…0.065 (65 ms) in R> mode and 0.001 (1 ms)…0.065
(65 ms) in R< mode.

BitStreams on a VT2516 module: timeIncrement can be 0.000002 (2 µs)…0.065 (65 ms).

BitStreams on a VT2848 module: timeIncrement can be -0.065 (-65ms)…0.065 (65 ms). If


the value is negative, the bit stream is output backwards.
Note that output accuracy depends highly on environmental conditions for values
between -0.00001(-10µs) and 0.00001 (10µs).

pause

Specifies how long the stimulation is interrupted between two repetitions of the wave
form.
Valid values: 0.0…4294.0 (4294 s).

numOfRepeats

Specifies how many times in a row the curve is to be stimulated.


Valid values: 0…65535 (0 means unlimited repetition of the curve)

startDelay

Specifies a delay for the start of the stimulation in seconds. This makes it possible to start
multiple curves in a defined sequence. This parameter is only supported by the VT2816
and VT2848 modules.
Valid values: 0.0..4.0 (4 s)

startPoint

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetWFParams

Specifies the point of the stimulated curve the stimulation should begin with. This makes
it possible e.g. to start multiple curves with different phase shifts without changing the
curves.
Valid values: 0..4096

Return values 0: Successful call

-1: Error

-2: The namespace on which the command was called does not exist or is not a valid VT
System namespace.

-3: The specified number of repeats is not valid

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP3 Test nodes — •

Example

The following example demonstrates how to use the waveform resistance output of a
VT2004 channel to simulate a sensor. In the example a waveform called WaveForm.txt is
loaded and replayed on channel Temp_Sensor. More details on waveforms can be found
on CANoe online help topic VT2004: Arbitrary Wave Forms.

Example WaveForm.txt
// Example of an arbitrary wave form for resistance stimulation
100
120 ; 2
140 ; 1
100
160 ; 4
100

Sample Code CAPL


SimulateSensorResistanceWF ()
{
// Choose resistor stimulation and waveform curve type
sysvar::VTS::Temp_Sensor.SetStimulationMode(3);
sysvar::VTS::Temp_Sensor.SetCurveType(2);

// Load waveform (the contents of waveform.txt are listed below)


sysvar::VTS::Temp_Sensor.LoadWFResistance("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 3
sysvar::VTS::Temp_Sensor.SetWFParams(0.065, 2.0, 3);

// Start stimulation with the previously configured waveform


sysvar::VTS::Temp_Sensor.StartStimulation();
}

Sample Code .NET


public void SimulateSensorResistanceWF()
{
// Get VTS interface and VT2004 channel
IVTSystem vts = VTSystem.Instance;
IVT2004Channel tempSensor = vts.GetChannel("Temp_Sensor") as
IVT2004Channel;

// Choose voltage stimulation and a constant curve type

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: SetWFParams

tempSensor.SetStimulationMode(StimulationMode.ResistanceLower,
CurveType.AnalogWaveform);

// Load waveform (the contents of waveform.txt are listed below)


tempSensor.LoadWFResistance("C:\\WaveForm.txt");

// Configure waveform. Parameters:


// TimeIncrement (time to hold each sample) = 65ms
// Pause (pause between two waveform repetitions) = 2s
// NumberOfRepeats (number of repetitions) = 3
tempSensor.SetWFParams(0.065, 2.0, 3);

// Start stimulation with the previously configured waveform


tempSensor.StartStimulation();
}

Sample Code XML


<testcase title="SimulateSensorResistanceWF" ident="">
<vtsystem_configure title="Initialize waveform">
<stimulation_mode channel="VTS::Temp_Sensor" mode="resistor_lt" />
<curve_type channel="VTS::Temp_Sensor" type="wave_form" />
<load_wave_form channel="VTS::Temp_Sensor"
type="resistor">C:\WaveForm.txt</load_wave_form>
<wave_form_params channel="VTS::Temp_Sensor"
time_increment="0.065" pause="2.0" />
</vtsystem_configure>
<wait time="10" title="Wait 10ms" />
<vtsystem_configure title="Start stimulation">
<start_stimulation channel="VTS::Temp_Sensor" num_of_repeats="0"
/>
</vtsystem_configure>
<wait time="10000" title="Wait 10s" />
<vtsystem_configure title="Stop stimulation">
<stop_stimulation channel="VTS::Temp_Sensor" />
</vtsystem_configure>
</testcase>

| vtsSetWFParams |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StartStimulation

StartStimulation
CAPL Function Overview » VT System » StartStimulation

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.StartStimulation ()

Function Starts the output of a stimulation signal. A corresponding output mode must be set in
advance.

Parameters —

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetStimulationMode

| vtsStartStimulation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: StopStimulation

StopStimulation
CAPL Function Overview » VT System » StopStimulation

Note

The function can only be called on system variable namespaces of appropriate channels of
VT System modules.

Method long SysVarNamespace.StopStimulation ()

Function Stops the output of a stimulation signal. This resets the output mode.

At the end of the execution of the command there is a short break before other
commands will be executed. This means that the next functions will be executed after a
short delay.
With this procedure ensures that the stop command is executed effectively. The
command should be called only in context of a test module setup but not in handler
functions. In handler functions the correct execution of the stop command can not be
ensured.

Parameters —

Return values 0: Successful call

-1: Call error

-2: The namespace on which the command was called does not exist or is not a valid VT
system namespace

-4: The function wasn't called in the context of the main method of a test module. So it is
not possible to wait until the setting will be taken over from the VT system. Otherwise
the call was successful but it is not sure if the settings have been taken over already when
the call returns.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP5 Test nodes — •

Example

See example SetStimulationMode

| vtsStopStimulation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Scope CAPL Functions

Scope CAPL Functions


CAPL Function Overview » Scope CAPL Functions

Functions Short description

scopeActivateTrigger Performs Activate Trigger action for Scope window.

scopeConnect Performs Connect Scope action for Scope window.

scopeDeactivateTrigger Performs Deactivate Trigger action for Scope window.

scopeDisconnect Performs Disconnect Scope action for Scope window.

scopeTriggerNow Performs Trigger Now action for Scope window.

Test Feature Set for Scope Short description

testGetWaitScopeEventData Retrieves the data of CANoe Scope event.

testWaitForScopeEvent Waits for the occurrence of CANoe Scope event.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: scopeActivateTrigger

scopeActivateTrigger
CAPL Function Overview » Scope » scopeActivateTrigger

Syntax long scopeActivateTrigger ()

Function Performs Activate Trigger action for Scope window. This action is equivalent to activating
the trigger via the GUI.

The completion of this action is reported with an internal event which can be awaited via
TFS-function testWaitForScopeEvent() in CAPL programs for test modules.

Parameters —

Return values 2 (success): Trigger is already active. This might be a case when the trigger has been
activated by a previous CAPL call or manually.

1 (success): Trigger activation process started. On success an internal Scope event will be
generated (see above). Failure can be recognized implicitly by not receiving the
corresponding Scope event during certain timeout, e.g. during one second.

-1 (failure): There is no valid Scope hardware device configured.

-2 (failure): The Scope connection is not established.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • Scope — •


• Real bus mode

Example
long res;

res = scopeActivateTrigger();
if (res <= 0 || res > 2)
{
testStepFail("Initialization","Call to scopeActivateTrigger() failed.
Return code =%d", res);
return;
}
else if (res == 1)
{ // wait till action done
if (testWaitForScopeEvent(eScopeTriggerActivated, 8000) != 1)
{
testStepFail("Initialization ","Scope event eScopeTriggerActivated
was not received");
return;
}
}
testStep("Initialization","Scope trigger activation succeeded");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: scopeConnect

scopeConnect
CAPL Function Overview » Scope » scopeConnect

Syntax long scopeConnect()

Function Performs Connect Scope action for Scope window. This action is equivalent to connecting
Scope via the GUI. The Scope window will be opened automatically if not yet opened.

The completion of this action is reported with an internal event which can be awaited via
TFS-function testWaitForScopeEvent() in CAPL programs for test modules.

Parameters —

Return values 2 (success): Connection is already established. This might be a case when connection has
been established by a previous CAPL call or manually.

1 (success): Connection process started. On success an internal Scope event will be


generated (see above). Failure can be recognized implicitly by not receiving the
corresponding Scope event during certain timeout, e.g. during one second.

-1 (failure): Failure on connection request.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • Scope — •


• Real bus mode

Example
long res;

res = scopeConnect();
if (res < 0 || res > 2)
{
testStepFail("Initialization"," Call to scopeConnect() failed. Return
code =%d", res);
return;
}
else if (res == 1)
{ // wait till action done
if (testWaitForScopeEvent(eScopeConnected, 8000) != 1)
{
testStepFail("Initialization ","Scope event eScopeConnected was not
received");
return;
}
}
testStep("Initialization","USB connection with the scope hardware is
established");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: scopeDeactivateTrigger

scopeDeactivateTrigger
CAPL Function Overview » Scope » scopeDeactivateTrigger

Syntax long scopeDeactivateTrigger()

Function Performs Deactivate Trigger action for Scope window. This action is equivalent to
deactivating the trigger via the GUI.

The completion of this action is reported with an internal event which can be awaited via
TFS-function testWaitForScopeEvent() in CAPL programs for test modules.

Parameters —

Return values 2 (success): Trigger is already inactive. This might be a case when the trigger has been
deactivated by a previous CAPL call or manually.

1 (success): Trigger deactivation process started. On success an internal Scope event will
be generated (see above). Failure can be recognized implicitly by not receiving the
corresponding Scope event during certain time-out, e.g. during one second.

-1 (failure): Failure on stop capture request.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • Scope — •


• Real bus mode

Example
long res;

res = scopeDeactivateTrigger();
if (res <= 0 || res > 2)
{
testStepFail("Initialization","Call to scopeDeactivateTrigger() failed.
Return code =%d", res);
return;
}
else if (res == 1)
{ // wait till action done
if (testWaitForScopeEvent(eScopeTriggerDeactivated, 8000) != 1)
{
testStepFail("Initialization ","Scope event eScopeTriggerDeactivated
was not received");
return;
}
}
testStep("Initialization","Scope trigger deactivation succeeded");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: scopeDisconnect

scopeDisconnect
CAPL Function Overview » Scope » scopeDisconnect

Syntax long scopeDisconnect ()

Function Performs Disconnect Scope action for Scope window. This action is equivalent to
disconnecting Scope via the GUI.

The completion of this action is reported with an internal event which can be awaited via
TFS-function testWaitForScopeEvent() in CAPL programs for test modules.

Parameters —

Return values 2 (success): Scope is already disconnected. This might be a case when the disconnection
has been done by a previous CAPL call or manually.

1 (success): Disconnection process started. On success an internal Scope event will be


generated (see above). Failure can be recognized implicitly by not receiving the
corresponding Scope event during certain timeout, e.g. during one second.

-1 (failure): Failure on disconnection request.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • Scope — •


• Real bus mode

Example
long res;

res = scopeDisconnect();
if (res <= 0 || res > 2)
{
testStepFail("Initialization","Call to scopeDisconnect() failed. Return
code =%d", res);
return;
}
else if (res == 1)
{ // wait till action done
if (testWaitForScopeEvent(eScopeDisconnected, 8000) != 1)
{
testStepFail("Initialization ","Scope event eScopeDisconnected was
not received");
return;
}
}
testStep("Initialization","USB connection with the scope hardware is
interrupted");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: scopeTriggerNow

scopeTriggerNow
CAPL Function Overview » Scope » scopeTriggerNow

Syntax long scopeTriggerNow()

Function Performs Trigger Now action for Scope window. This action is equivalent to immediate
triggering via the GUI.

The completion of this action is reported with an internal event which can be awaited via
TFS-function testWaitForScopeEvent() in CAPL programs for test modules.

Parameters —

Return values 1 (success): Trigger signal has been generated. On trigger completion an internal Scope
event will be generated (see above). Failure can be recognized implicitly by not receiving
the corresponding Scope event during certain timeout, e.g. during one second.

-1 (failure): The Scope connection is not established.

-2 (failure): The data fetching is not completed yet.

-3 (failure): Memory overflow.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP3 • Scope — •


• Real bus mode

Example
long res;

res = scopeTriggerNow();
if (res != 1)
{
testStepFail("Initialization","Call to scopeTriggerNow() failed. Return
code =%d", res);
return;
}

// wait till action done


if (testWaitForScopeEvent(eScopeTriggered, 50000) != 1)
{
testStepFail("Initialization ","Scope event eScopeTriggered was not
received");
return;
}
testStep("Initialization","Scope hardware triggered successfully");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ScopeEvent Seletors

ScopeEvent Seletors
CAPL Function Overview »Scope » ScopeEvent Seletors

Keyword Description Type Access


limitation

Type Type of scope event - see enum ScopeEventType enum Read-only


ScopeEventType

DataID Data identifier of the captured data created after re- int Read-only
quest to trigger on Scope hardware completed.

Time Timestamp of the captured data created after request to int64 Read-only
trigger on Scope hardware completed.

| testGetWaitScopeEventData| testWaitForScopeEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Enumeration Values of ScopeEventType (enum ScopeEventType)

Enumeration Values of ScopeEventType (enum ScopeEventType)


CAPL Function Overview »Scope » Enumeration Values of ScopeEventType (enum ScopeEventType)

Value Description

eScopeConnected Request to establish connection to Scope hardware successfully completed.

eScopeDisconnected Request to interrupt connection to Scope hardware successfully completed.

eScopeTriggerActivated Request to activate Scope trigger conditions successfully completed.

eScopeTriggerDeactivated Request to deactivate Scope trigger conditions successfully completed.

eScopeTriggered Request to trigger on Scope hardware successfully completed.

| testWaitForScopeEvent |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: XCP CAPL Functions
(Only available with Option .XCP!)

XCP CAPL Functions


(Only available with Option .XCP!)
CAPL Function Overview » XCP CAPL Functions

Info

The functions can be used for XCP and CCP devices.

Functions Short description

xcpActive Activates a a2l signal for upload, download and DAQ measurement.

xcpConnect Establishes a connection to the XCP/CCP device and starts the configured
DAQ measurement.

xcpDeactive Upload, download and DAQ measurement will be deactivated.

xcpDisconnect Disconnects from a XCP/CCP device.

xcpIsConnected Returns the connection status of a XCP/CCP device.

xcpUpload Upload of the system variable.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpActive

xcpActive
CAPL Function Overview » XCP » xcpActive

Syntax long xcpActivate (char namespace[], char variable[])

long xcpActivate (sysvar sysvar)

Function Activates a a2l signal for upload, download and DAQ measurement.

Parameters namespace

Namespace of the corresponding system variable.

variable

Name of the corresponding system variable.

sysVar

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sys-Var::"

Return values 0: OK

-1: System variable was not found

-2: Operation not allowed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 XCP — •

Example

| xcpDeactive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpConnect

xcpConnect
CAPL Function Overview » XCP » xcpConnect

Syntax long xcpConnect (char ecuQualifier[])

Function Establishes a connection to the XCP/CCP device and starts the configured DAQ
measurement.

If the connection is successfully depends on the response of the device.

Use xcpIsConnected to be aware of the connection.

Parameters ecuQualifier

Name of the device – configured within the XCP/CCP configuration dialog.

Return values 0: OK

-1: Device with this name is not existing

-2: Operation not allowed – already connected

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 XCP — •

Example

| xcpDisconnect |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpDeactive

xcpDeactive
CAPL Function Overview » XCP » xcpDeactive

Syntax long xcpDeactivate (char namespace[], char variable[])

long xcpDeactivate (sysvar sysvar)

Function Upload, download and DAQ measurement will be deactivated.

Parameters namespace

Namespace of the corresponding system variable

variable

Name of the corresponding system variable

sysvar

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sys-Var::"

Return values 0: OK

-1: System variable was not found

-2: Operation not allowed

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.5 XCP — •

Example

| xcpActive |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpDisconnect

xcpDisconnect
CAPL Function Overview » XCP » xcpDisconnect

Syntax long xcpDisconnect(char ecuQualifier[])

Function Disconnects from a XCP/CCP device.

Use xcpIsConnected to be aware of the disconnection.

Parameters ecuQualifier

Name of the device – configured within the XCP/CCP configuration dialog.

Return values 0: OK

-1: Device with this name is not existing

-2: Operation not allowed – already disconnected

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 XCP — •

Example

| xcpConnect |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpIsConnected

xcpIsConnected
CAPL Function Overview » XCP » xcpIsConnected

Syntax long xcpIsConnected (char ecuQualifier[])

Function Returns the current connection status of a XCP/CCP device.

Parameters ecuQualifier

Name of the device – configured within the XCP/CCP configuration dialog.

Return values 0: Not connected

1: Connected

-2: Device with this name is not existing

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 XCP — •

Example

| xcpConnect | xcpDisconnect |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpUpload

xcpUpload
CAPL Function Overview » XCP » xcpUpload

Syntax long xcpUpload(char namespace[], char variable[])

long xcpUpload(sysvar sysvar)

Callback void OnXcpUpload (namespace[], char variable[], long errorIndication)

Function Initiates an upload of the XCP signal from ECU and updates the dedicated system variable.

After finishing of the upload the callback function OnXcpUplad is called to indicate the
upload status.

Use the return value of xcpUpload to check if an error occurred during initiation of the
upload.

Use the errorIndication parameter of the OnXcpUpload callback function to check for
errors occurred during the upload, if an error during call of xcpUpload occurs
OnXcpUpload is not called.

Parameters namespace

Namespace of the corresponding system variable

variable

Name of the corresponding system variable.

sysvar

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::".
The name must be preceded by "sysvar::"

errorIndication

0: OK
-4: Device is not connected

Return values 0: OK

-1: System variable of the signal was not found

-2: Operation not allowed

-3: System variable of the signal is inactive


-4: Device is not connected
Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.6 XCP — •

Example
testcase TC_SignalInactive ()
{
xcpUpload("XCP::ECU","testword0");
....

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: xcpUpload

}
//Callback function:
void OnXcpUpload (char namespace[], char variable[], long returnValue)
{
if (returnValue==0)
write("Systemvariable updated: %s %s", namespace,variable);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

ASAM-MCD: Error Code


(Only available with ASAM-MCD, CANoe and CANape!)
CAPL Function Overview » ASAM-MCD » Error Code

1 AEC_CMD_NOT_SUP Command not supported.

2 AEC_INTERFACE_NOTSUPPORTED Interface type not supported.

3 AEC_CREATE_MEM_MAPPED_FILE Error creating memory mapped file.

4 AEC_WRITE_CMD Error writing data to memory mapped file.

5 AEC_READ_RESPONSE Error reading response from memory mapped file.

6 AEC_ASAP2_FILE_NOT_FOUND ASAP2 file not found.

7 AEC_INVALID_MODULE_HDL Invalid module handle.

8 AEC_ERR_OPEN_FILE Open file error.

9 AEC_UNKNOWN_OBJECT Unknown object name.

10 AEC_NO_DATABASE No database assigned.

11 AEC_PAR_SIZE_OVERFLOW Parameter 'size' too large.

12 AEC_NOT_WRITE_ACCESS Object has no write access.

13 AEC_OBJECT_TYPE_DOESNT_MATCH Object type does not match.

14 AEC_NO_TASKS_OVERFLOW Number of tasks overflow.

15 AEC_CCP_RESPONSE_SIZE_INVALID Invalid CCP response size.

16 AEC_TIMEOUT_RESPONSE Timeout reading response from memory mapped file.

17 AEC_NO_VALUES_SAMPLED FIFO does not contain any values.

18 AEC_ACQ_CHNL_OVERRUN Too much channels defined relating to single raster.

19 AEC_NO_RASTER_OVERFLOW Too much raster selected for data acquisition


(overflow of internal parameter).

20 AEC_CANAPE_CREATE_PROC_FAILED CreateProcess of CANape failed.

21 AEC_EXIT_DENIED_WHILE_ACQU Asap3Exit denied because data acquisition is still


running.

22 AEC_WRITE_DATA_FAILED Error writing data to application RAM.

23 AEC_NO_RESPONSE_FROM_ECU No response from ECU (attach Asap2 failed).

24 AEC_ACQUIS_ALREADY_RUNNING Asap3StartDataAcquisition denied: data acquisition


already running.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

25 AEC_ACQUIS_NOT_STARTED Asap3StopAcquisition denied: data acquisition not


started.

26

27 AEC_NO_AXIS_PTS_NOT_VALID Invalid number of axis points (see following note).

28 AEC_SCRIPT_CMD_TO_LARGE Script command size overflow.

29 AEC_SCRIPT_CMD_INVALID Invalid/unknown script command.

30 AEC_UNKNOWN_MODULE_NAME Unknown module.

31 AEC_FIFO_INTERNAL_ERROR CANape internal error concerning FIFO management.

32 AEC_VERSION_ERROR Access denied: incompatible CANape version.

33 AEC_ILLEGAL_DRIVER Illegal driver type.

34 AEC_CALOBJ_READ_FAILED Read of calibration object failed.

35 AEC_ACQ_STP_INIT_FAILED Initialization of data acquisition failed.

36 AEC_ACQ_STP_PROC_FAILED Data acquisition failed.

37 AEC_ACQ_STP_OVERFLOW Buffer overflow at data acquisition.

38 AEC_ACQ_STP_TIME_OVER Data acquisition stopped because selected time is


elapsed.

39

40 AEC_NOSERVER_ERRCODE No Server application available.

41 AEC_ERR_OPEN_DATADESCFILE Unable to open data description file, maybe not exist.

42 AEC_ERR_OPEN_DATAVERSFILE Unable to open a data file.

43 AEC_TO_MUCH_DISPLAYS_OPEN Maximal count of displays are opened.

44 AEC_INTERNAL_CANAPE_ERROR Attempt to create a module was failed.

45 AEC_CANT_OPEN_DISPLAY Unable to open a display.

46 AEC_ERR_NO_PATTERNFILE_DEFINED No parameterfilename.

47 AEC_ERR_OPEN_PATTERNFILE Unable to open patternfile.

48 AEC_ERR_CANT_RELEASE_MUTEX Release of a mutex failed.

49 AEC_WRONG_CANAPE_VERSION Canape do not fit dll version.

50 AEC_TCP_SERV_CONNECT_FAILED Connect to ASAP3 server failed.

51 AEC_TCP_MISSING_CFG Missing CANape TCP Server configuration.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

52 AEC_TCP_SERV_NOT_CONNECTED Connection between ASAP3 Server and TCP CANapeAPI


is not active.

53 AEC_TCP_EXIT_NOTCLOSED

54 AEC_FIFO_ALREADY_INIT The FIFO Memory was already created. Close all


connection to reconfigure.

55 AEC_ILLEGAL_OPERATION It's not possible to operate this command.

56 AEC_WRONG_TYPE The given type is not supported.

57 AEC_NO_CANAPE_LICENSE CANape is not licensed.

58 AEC_REG_OPEN_KEY_FAILED Key
"HKEY_LOCAL_MACHINE\\SOFTWARE\\VECTOR\\CANape"
missing at Windows Registry, maybe CANape setup has
not been correctly performed.

59 AEC_REG_QUERY_VALUE_FAILED Value "Path" missing at Windows Registry, maybe


CANape setup has not been correctly performed.

60 AEC_WORKDIR_ACCESS_FAILED CreateProcess of CANape failed: working directory not


accessible/exists.

61 AEC_INIT_COM_FAILED Internal error: Asap3InitCom() failed

62 AEC_INIT_CMD_FAILED Negative Response from CANape: Init() failed.

63 AEC_CANAPE_INVALID_PRG_PATH CreateProcess of CANape failed: program directory not


accessible/exists.

64 AEC_INVALID_ASAP3_HDL Invalid asap3 handle.

65 AEC_LOADING_FILE File loading failed.

66 AEC_SAVING_FILE File saving failed.

67 AEC_UPLOAD Upload failed.

68 AEC_WRITE_VALUE_ERROR Value could not be written.

69 AEC_TMTF_NOT_FINSHED Other file transmission in process.

70 AEC_TMTF_SEQUENCE_ERROR TransmitFile: sequence error (internal error).

71 AEC_LAST_ERRCODE

| CANape Documentation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD CAPL Functions
(Only available with ASAM-MCD, CANoe and CANape!)

ASAM-MCD CAPL Functions


(Only available with ASAM-MCD, CANoe and CANape!)
CAPL Function Overview » ASAM-MCD CAPL Functions

To use ASAM-MCD functionality CANape has to be installed in your system.

The ASAM-MCD/CAPL API makes available the following functions for MCD control:

Functions Short description

MCDCreateModule Creates a module.

MCDEcuOnOffline Sets a controller into online or offline mode.

MCDExit Ends the connection to the MCD server.

MCDGetCurrentValue Get one of the values which was configured with the data
acquisition.

MCDGetECUParam Reading of a parameter.

MCDGetLastError Returns the last occurred error.

MCDInit Initialisation of the MCD server. CANape will be started in non


modal mode.

MCDInitEx Initialisation of the MCD server. CANape will be started in non


modal mode.

MCDMapECUParamToSysVariableRead Maps an ECU parameter to a system variable so that it the


system variable changes whenever the parameter is updated.

MCDMapECUParamToSysVariableWrite Maps an ECU parameter to a system variable so that it is


changed whenever the system variable changes.

MCDParamIsValid Checks, if a parameter is valid.

MCDParamResponse Callback handler on a MCDParamRead request.

MCDQuitCANape Executes implicit a MCDInitEx and closes CANape.

MCDSetECUParam Writing of a parameter.

MCDStartDataAcq/ Configure and start the data acquisition. / The data acquisition
MCDStartDataAcqAsync is started asynchronous.

MCDStatusIndication Callback handler for different MCD status.

MCDStopDataAcq Stops the data acquisition explicitly.

Explicit read functions are not available. The response of the MCD server will be given in the callback
function MCDParamResponse. Here the user can implement his specific code.

| MCD Error Codes |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDCreateModule

MCDCreateModule
CAPL Function Overview » ASAM-MCD » MCDCreateModule

Syntax long MCDCreateModule (char moduleName[])

Function Creates a module.

Parameters moduleName

Module name (has to be defined in the module list).

Return values 0: OK

- 1: Error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDEcuOnOffline

MCDEcuOnOffline
CAPL Function Overview » ASAM-MCD » MCDEcuOnOffline

Syntax long MCDEcuOnOffline ( char moduleName[], long ecuState)

Function Sets a controller into online or offline mode.

Parameters moduleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

ecuState

0: Sets the controller offline


1: Sets the controller online

Return values 1: OK

0: Error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDExit

MCDExit
CAPL Function Overview » ASAM-MCD » MCDExit

Syntax long MCDExit ()

Function Ends the connection to the MCD server.

Parameters —

Return values 0: OK

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDGetCurrentValue

MCDGetCurrentValue
CAPL Function Overview » ASAM-MCD » MCDGetCurrentValue

Syntax double MCDGetCurrentValue( char moduleName[], char parameterName[])

Function Get one of the values which was configured with the data acquisition.

Parameters ModuleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter to be set.

Return values The value of the requested parameter.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDGetECUParam

MCDGetECUParam
CAPL Function Overview » ASAM-MCD » MCDGetECUParam

Syntax long MCDGetECUParam ( char moduleName[], char parameterName[], int format)

Function Reading of a parameter. The read parameter value will be available in the
MCDParamResponse callback handler.

Parameters ModuleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter to be read.

format

Read out format:

0 – hex, ECU intern


1 – physical representation

Return values 0: OK

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDGetLastError

MCDGetLastError
CAPL Function Overview » ASAM-MCD » MCDGetLastError

Syntax long MCDGetLastError ()

Function Returns the last occurred error.

Parameters —

Return values <Error number>: See Error Codes for the description.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDInit

MCDInit
CAPL Function Overview » ASAM-MCD » MCDInit

Syntax long MCDInit ()

Function Initialisation of the MCD server. CANape will be started in non modal mode.

This function must only be called during the initialisation phase of the measurement
(MeasurementInit).

Parameters —

Return values 0: OK

- 1: Error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDInitEx

MCDInitEx
CAPL Function Overview » ASAM-MCD » MCDInitEx

Syntax long MCDInitEx (long driverType)

long MCDInitEx (long driverType, long autoCreate)

long MCDInitEx (dword driverType, dword autoCreate, dword sampleSize)

Function Initialisation of the MCD server. CANape will be started in non modal mode.

This function must only be called during the initialisation phase of the measurement
(MeasurementInit).

Parameters driverType

0: Driver initialisation as CCP session


1: Driver initialisation as XCP session

autoCreate

0: Only the MCD server is started; the module is not created implicitly.
1: The module is created implicitly; MCDCreateModule is not needed afterwards.

sampleSize

Number of values of the data acquisition. The default in the other functions is 32.

Info

Depending on your PC, a huge number of values can cause performance


problems.

Return values 0: OK

- 1: Error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDMapECUParamToSysVariableRead

MCDMapECUParamToSysVariableRead
CAPL Function Overview » ASAM-MCD » MCDMapECUParamToSysVariableRead

Syntax long MCDMapECUParamToSysVariableRead(char moduleName[], char


parameterName[], SysVarName)

Function Maps an ECU parameter to a system variable so that it the system variable changes
whenever the parameter is updated. The MCD data acquisition must already be started.

Parameters moduleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter.

SysVarName

System variable.

Return values 0: No error.

1: The system variable is already mapped as read target of a different parameter.

2: The system variable is already mapped as read target of this parameter.

3: The parameter is already mapped as read source of a different system variable.

4: The system variable is already mapped as write source of a different parameter.

5: The system variable is not of type float.

6: The system variable is read-only.

7: The MCD data acquisition is not currently active.

-1: An internal error occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 ASAM-MCD — •

Example

| MCDMapECUParamToSysVariableWrite | MCDStartDataAcq | MCDGetCurrentValue |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDMapECUParamToSysVariableWrite

MCDMapECUParamToSysVariableWrite
CAPL Function Overview » ASAM-MCD » MCDMapECUParamToSysVariableWrite

Syntax long MCDMapECUParamToSysVariableWrite(char moduleName[], char


parameterName[], SysVarName)

Function Maps an ECU parameter to a system variable so that it is changed whenever the system
variable changes.

Parameters moduleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter.

SysVarName

System variable.

Return values 0: No error.

1: The parameter is already mapped as write target of another system variable.

2: The parameter is already mapped as write target of this system variable.

3: The system variable is already mapped as write source of a different parameter.

4: The system variable is already mapped as read target of a different parameter.

5: The system variable is not of type float.

-1: An internal error occurred.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 SP3 ASAM-MCD — •

Example

| MCDMapECUParamToSysVariableRead | MCDSetECUParam |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDParamIsValid

MCDParamIsValid
CAPL Function Overview » ASAM-MCD » MCDParamIsValid

Syntax long MCDParamIsValid ( char moduleName[], char paramName[])

Function Checks, if a parameter is valid. The value has to be from the MCD communication.

Parameters moduleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter.

Return values 1: Valid in the meaning of the functional description

0: Not valid, e.g. default value

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDParamResponse

MCDParamResponse
CAPL Function Overview » ASAM-MCD » MCDParamResponse

Syntax long MCDParamResponse ( char moduleName[], char parameterName[], double


value)

Function Callback handler on a MCDGetECUParam request. This function must be defined in the
CAPL program to get a response on a read request.

Parameters moduleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter.

value

Value of the parameter.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDQuitCANape

MCDQuitCANape
CAPL Function Overview » ASAM-MCD » MCDQuitCANape

Syntax long MCDQuitCANape ()

Function Executes implicit a MCDInitEx and closes CANape.

Parameters —

Return values 0: OK

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDSetECUParam

MCDSetECUParam
CAPL Function Overview » ASAM-MCD » MCDSetECUParam

Syntax long MCDSetECUParam ( char moduleName[], char parameterName[], double


value)

Function Writing of a parameter.

Parameters ModuleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

parameterName

Name of the parameter to be set.

value

New value of the parameter to be set.

Return values 0: OK

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDStartDataAcq/ MCDStartDataAcqAsync

MCDStartDataAcq/ MCDStartDataAcqAsync
CAPL Function Overview » ASAM-MCD » MCDStartDataAcq/ MCDStartDataAcqAsync

Syntax long MCDStartDataAcq( char moduleName[], int taskId, int pollingRate, char
parameters[])

long MCDStartDataAcqAsync( char moduleName[], int taskId, int pollingRate,


char parameters[])

Function Configure and start the data acquisition. After a data acquisition is started the configured
parameters are transferred to CANoe with the specified polling rate. The values can be
obtained with MCDGetCurrentValue.

Using MCDStartDataAcqAsync the data acquisition is started asynchronous. This means


that the current measuring is not interrupted during the call of this function.

Parameters ModuleName

Name of the module that is configured in the global options dialog Configuration
Settings|MCD Server.

taskId

Id of the task which is available.

pollingRate

Cycle time with which the values are reported to CANoe internally.

parameters

A string that specifies the parameters which are cyclically reported to CANoe. The
parameters are separated with ';'.

Note: the size of the string must contain the null terminator.

Example for a string that specifies a0, b0 and c0 as parameters:

char paramStr[9] = "a0;b0;c0";

Return values 0

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

6.1: form 2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDStatusIndication

MCDStatusIndication
CAPL Function Overview » ASAM-MCD » MCDStatusIndication

Syntax MCDStatusIndication( char moduleName[], long operation, long status)

Function Callback handler for different MCD status.

The function provides the status of successful/ not successful data acquisition starts.

Parameters modulName

Module name configured in the global option dialog. Configuration settings |MCD Server.

operation

Operation ID, which shows the status.

1 – Start Data Acq

Status

1: Successful
0: Fail

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: MCDStopDataAcq

MCDStopDataAcq
CAPL Function Overview » ASAM-MCD » MCDStopDataAcq

Syntax long MCDStopDataAcq()

Function Stops the data acquisition explicitly. An active data acquisition is stopped implicitly on
measurement stop.

Parameters —

Return values 0

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.2 ASAM-MCD — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

ASAM-MCD: Error Code


(Only available with ASAM-MCD, CANoe and CANape!)
CAPL Function Overview » ASAM-MCD » Error Code

1 AEC_CMD_NOT_SUP Command not supported.

2 AEC_INTERFACE_NOTSUPPORTED Interface type not supported.

3 AEC_CREATE_MEM_MAPPED_FILE Error creating memory mapped file.

4 AEC_WRITE_CMD Error writing data to memory mapped file.

5 AEC_READ_RESPONSE Error reading response from memory mapped file.

6 AEC_ASAP2_FILE_NOT_FOUND ASAP2 file not found.

7 AEC_INVALID_MODULE_HDL Invalid module handle.

8 AEC_ERR_OPEN_FILE Open file error.

9 AEC_UNKNOWN_OBJECT Unknown object name.

10 AEC_NO_DATABASE No database assigned.

11 AEC_PAR_SIZE_OVERFLOW Parameter 'size' too large.

12 AEC_NOT_WRITE_ACCESS Object has no write access.

13 AEC_OBJECT_TYPE_DOESNT_MATCH Object type does not match.

14 AEC_NO_TASKS_OVERFLOW Number of tasks overflow.

15 AEC_CCP_RESPONSE_SIZE_INVALID Invalid CCP response size.

16 AEC_TIMEOUT_RESPONSE Timeout reading response from memory mapped file.

17 AEC_NO_VALUES_SAMPLED FIFO does not contain any values.

18 AEC_ACQ_CHNL_OVERRUN Too much channels defined relating to single raster.

19 AEC_NO_RASTER_OVERFLOW Too much raster selected for data acquisition


(overflow of internal parameter).

20 AEC_CANAPE_CREATE_PROC_FAILED CreateProcess of CANape failed.

21 AEC_EXIT_DENIED_WHILE_ACQU Asap3Exit denied because data acquisition is still


running.

22 AEC_WRITE_DATA_FAILED Error writing data to application RAM.

23 AEC_NO_RESPONSE_FROM_ECU No response from ECU (attach Asap2 failed).

24 AEC_ACQUIS_ALREADY_RUNNING Asap3StartDataAcquisition denied: data acquisition


already running.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

25 AEC_ACQUIS_NOT_STARTED Asap3StopAcquisition denied: data acquisition not


started.

26

27 AEC_NO_AXIS_PTS_NOT_VALID Invalid number of axis points (see following note).

28 AEC_SCRIPT_CMD_TO_LARGE Script command size overflow.

29 AEC_SCRIPT_CMD_INVALID Invalid/unknown script command.

30 AEC_UNKNOWN_MODULE_NAME Unknown module.

31 AEC_FIFO_INTERNAL_ERROR CANape internal error concerning FIFO management.

32 AEC_VERSION_ERROR Access denied: incompatible CANape version.

33 AEC_ILLEGAL_DRIVER Illegal driver type.

34 AEC_CALOBJ_READ_FAILED Read of calibration object failed.

35 AEC_ACQ_STP_INIT_FAILED Initialization of data acquisition failed.

36 AEC_ACQ_STP_PROC_FAILED Data acquisition failed.

37 AEC_ACQ_STP_OVERFLOW Buffer overflow at data acquisition.

38 AEC_ACQ_STP_TIME_OVER Data acquisition stopped because selected time is


elapsed.

39

40 AEC_NOSERVER_ERRCODE No Server application available.

41 AEC_ERR_OPEN_DATADESCFILE Unable to open data description file, maybe not exist.

42 AEC_ERR_OPEN_DATAVERSFILE Unable to open a data file.

43 AEC_TO_MUCH_DISPLAYS_OPEN Maximal count of displays are opened.

44 AEC_INTERNAL_CANAPE_ERROR Attempt to create a module was failed.

45 AEC_CANT_OPEN_DISPLAY Unable to open a display.

46 AEC_ERR_NO_PATTERNFILE_DEFINED No parameterfilename.

47 AEC_ERR_OPEN_PATTERNFILE Unable to open patternfile.

48 AEC_ERR_CANT_RELEASE_MUTEX Release of a mutex failed.

49 AEC_WRONG_CANAPE_VERSION Canape do not fit dll version.

50 AEC_TCP_SERV_CONNECT_FAILED Connect to ASAP3 server failed.

51 AEC_TCP_MISSING_CFG Missing CANape TCP Server configuration.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: ASAM-MCD: Error Code
(Only available with ASAM-MCD, CANoe and CANape!)

52 AEC_TCP_SERV_NOT_CONNECTED Connection between ASAP3 Server and TCP CANapeAPI


is not active.

53 AEC_TCP_EXIT_NOTCLOSED

54 AEC_FIFO_ALREADY_INIT The FIFO Memory was already created. Close all


connection to reconfigure.

55 AEC_ILLEGAL_OPERATION It's not possible to operate this command.

56 AEC_WRONG_TYPE The given type is not supported.

57 AEC_NO_CANAPE_LICENSE CANape is not licensed.

58 AEC_REG_OPEN_KEY_FAILED Key
"HKEY_LOCAL_MACHINE\\SOFTWARE\\VECTOR\\CANape"
missing at Windows Registry, maybe CANape setup has
not been correctly performed.

59 AEC_REG_QUERY_VALUE_FAILED Value "Path" missing at Windows Registry, maybe


CANape setup has not been correctly performed.

60 AEC_WORKDIR_ACCESS_FAILED CreateProcess of CANape failed: working directory not


accessible/exists.

61 AEC_INIT_COM_FAILED Internal error: Asap3InitCom() failed

62 AEC_INIT_CMD_FAILED Negative Response from CANape: Init() failed.

63 AEC_CANAPE_INVALID_PRG_PATH CreateProcess of CANape failed: program directory not


accessible/exists.

64 AEC_INVALID_ASAP3_HDL Invalid asap3 handle.

65 AEC_LOADING_FILE File loading failed.

66 AEC_SAVING_FILE File saving failed.

67 AEC_UPLOAD Upload failed.

68 AEC_WRITE_VALUE_ERROR Value could not be written.

69 AEC_TMTF_NOT_FINSHED Other file transmission in process.

70 AEC_TMTF_SEQUENCE_ERROR TransmitFile: sequence error (internal error).

71 AEC_LAST_ERRCODE

| CANape Documentation |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress CAPL Functions
(Only available with CANstress!)

CANstress CAPL Functions


(Only available with CANstress!)
CAPL Function Overview » CANstress CAPL Functions

The following CAPL functions are available for controlling CANstress:

Functions Short Description

CANstressCreateServer Starts the CANstress software and establishes


a connection via the COM interface to this
COM server.

CANstressCreateServer(DeviceAlias) Starts the CANstress software and establishes


a connection to this COM server via the COM
interface.

CANstressCreateServer(Device number) Starts the CANstress software and establishes


a connection to this COM server via the COM
This function must be called before all other CANstress interface.
CAPL functions!

CANstressAvailableDevices Indicates the number of configured CANstress


devices.

CANstressConnect Establishes a connection between the


CANstress software and the CANstress
hardware.

CANstressGetDevice Sends back the handle for the current


CANstress device.

CANstressGetInfo Delivers information about CANstress software


and the connected CAN hardware.

CANstressGetPerformedDisturbances Acquires the number of disturbances that


were executed by CANstress.

CANstressIsFinished Serves to query whether the CANstress


hardware is in the state Finished.

CANstressIsIdle Serves to query whether the CANstress


hardware is in the state Idle.

CANstressIsPending Serves to query whether the CANstress


hardware is in the state Pending.

CANstressOnFinished Registers a CAPL function as callback that is


called if CANstress is switched into the state
Finished.

CANstressOnIdle Registers a CAPL function as callback that is


called if CANstress is switched into the state
Idle.

CANstressOnPending Registers a CAPL function as callback that is


called if CANstress is switched into the state

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress CAPL Functions
(Only available with CANstress!)

Pending.

CANstressOpen Opens a CANstress configuration file.

CANstressQuit Ends the CANstress software.

CANstressSetBTR Sets the value of the Bus Timing Register.

CANstressSetContinuousDisturbanceTimeLimited Sets the Continuous disturbance (time


limited) mode.

CANstressSetContinuousDisturbanceUntilStop Sets the Continuous disturbance (until stop)


mode.

CANstressSetContinuousDisturbanceWhileTrigger Sets the Continuous disturbance (while


trigger) mode.

CANstressSetDevice Defines the active device for further


functions.

CANstressSetDisturbanceSequence Sets the disturbance sequence.

CANstressSetLimitedDisturbanceNumber Sets the Limited number of disturbances


disturbance mode.

CANstressSetResistor Sets the value of a resistor for analog


disturbances.

CANstressSetTriggerId Sets the message ID, which will activate the


trigger.

CANstressSetTriggerRange Sets a range for message IDs, which will


activate triggers.

CANstressSetUnlimitedDisturbanceNumber Sets the Unlimited number of disturbances


disturbance mode.

CANstressStart Orders the CANstress COM server to activate


the hardware for the error disturbance
activity.

CANstressStop Orders the CANstress COM server to end the


current disturbance activity of the hardware.

CANstressStopTrigger Deactivates the CANstress software triggers if


this is still active.

CANstressTrigger Activates the CANstress software trigger.

CANstressWaitForFinished Waits until the CANstress hardware is in the


state Finished.

CANstressWaitForIdle Waits until the CANstress hardware is in the


state Idle.

CANstressWaitForPending Waits until the CANstress hardware is in the

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress CAPL Functions
(Only available with CANstress!)

state Pending.

| Access Multiple CANstress Devices from a Single Test Module |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressAvailableDevices

CANstressAvailableDevices
CAPL Function Overview » CANstress » CANstressAvailableDevices

Syntax dword CANstressAvailableDevices();

Function Indicates the number of configured CANstress devices. This number is defined in the
canstress.ini file, which is located in the CANstress installation directory.

Parameters —

Return values Number of configured CANstress devices.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressConnect

CANstressConnect
CAPL Function Overview » CANstress » CANstressConnect

Syntax long CANstressConnect();

Function Establishes a connection between the CANstress software and the CANstress hardware.

Parameters —

Return values 0: If successful.

-1: In case of error (due to an internal error).

-2: In case of error (due to an internal timeout during the connection establishment).

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressCreateServer

CANstressCreateServer
CAPL Function Overview » CANstress » CANstressCreateServer

Note

This function must be called before all other CANstress CAPL functions!

Syntax long CANstressCreateServer();

Function Starts the CANstress software and establishes a connection via the COM interface to this
COM server. If no registered CANstress COM server is found, the ongoing measurement is
stopped.

Parameters —

Return values 0: If successful.

-1: In case of error.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressCreateServer(DeviceAlias)

CANstressCreateServer(DeviceAlias)
CAPL Function Overview » CANstress » CANstressCreateServer(DeviceAlias)

Note

This function must be called before all other CANstress CAPL functions!

Syntax long CANstressCreateServer (char[] deviceAlias);

Function Starts the CANstress software and establishes a connection to this COM server via the COM
interface. The COM server generated only establishes a connection to the CANstress
device defined in deviceAlias. Connected CANstress devices are mapped to an alias using
the canstress.ini file. You will find this file in the CANstress software’s installation
directory. If the call is successful, the device defined in deviceAlias will be set as the
current device.

Parameters —

Return values > 0: If successful.


If the attempt to establish a connection to a COM server is successful, a handle required
for the CANstressSetDevice function will be returned for the device. This handle will be a
value greater than 0.

-1: In case of error.


If the call is not successful (because the CANstress software has not been registered as a
COM server, for example), the value -1 will be returned. The result of the test currently
in progress will also be set to failed.
Availability Since Version Restricted to Measurement Setup Simulation / Test
Setup

6.0 • CANstress — •
• Test modules

Example

| CANstressCreateServer() | CANstressCreateServer(Device number) |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressCreateServer(Device number)

CANstressCreateServer(Device number)
CAPL Function Overview » CANstress » CANstressCreateServer(Device number)

Note

This function must be called before all other CANstress CAPL functions!

Syntax long CANstressCreateServer (DWORD deviceNr);

Function Starts the CANstress software and establishes a connection to this COM server via the COM
interface. The COM server generated only establishes a connection to the CANstress
device defined in deviceNr. Connected CANstress devices are mapped to a number using
the canstress.ini file. You will find this file in the CANstress software’s installation
directory. If the call is successful, the device defined in deviceNr will be set as the
current device.

Parameters —

Return values > 0: If successful.


If the attempt to establish a connection to a COM server is successful, a handle required
for the CANstressSetDevice function will be returned for the device. This handle will be a
value greater than 0.

-1: In case of error.


If the call is not successful (because the CANstress software has not been registered as a
COM server, for example), the value -1 will be returned. The result of the test currently
in progress will also be set to failed.
Availability Since Version Restricted to Measurement Setup Simulation / Test
Setup

6.0 • CANstress — •
• Test modules

Example

| CANstressCreateServer() | CANstressCreateServer(DeviceAlias) |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressGetDevice

CANstressGetDevice
CAPL Function Overview » CANstress » CANstressGetDevice

Syntax long CANstressGetDevice ();

Function Sends back the handle for the current CANstress device.

Parameters —

Return values > 0: If successful.


Handle for the current CANstress device.

-1: In case of error.


DeviceId does not contain a valid handle for a CANstress device. You might get this result,
for example, if CANstressCreateServer has not yet been called.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressGetInfo

CANstressGetInfo
CAPL Function Overview » CANstress » CANstressGetInfo

Note

So that the call can be executed successfully, there must be a connection between the
CANstress software and the CANstress hardware. Only in this case can the information for
the CANstress hardware (firmware, CAN interface, serial number) be acquired correctly.

Syntax long CANstressGetInfo( char softwareVersion[], long swVersionBufLen, char


firmwareVersion[], long fwVersionBufLen, char serialNumber[], long
snBufLen, char canInterface1[], long if1BufLen, char canInterface2[], long
if2BufLen );

Function Delivers information about CANstress software and the connected CAN hardware.

Parameters softwareVersion

Buffer in which the version of the software is written (recommended buffer size: 20
Byte).

swVersionBufLen

Size of the buffer in which the software version is written (in bytes).

firmwareVersion

Buffer in which the version of the firmware is written (recommended buffer size: 10
Byte).

fwVersionBufLen

Size of the buffer in which the firmware version is written (in bytes).

serialNumber

Buffer in which the serial number of the CANstress hardware is written (recommended
buffer size: 20 Byte).

snBufLen

Size of the buffer in which the hardware serial number is written (in bytes).

canInterface1

Buffer in which the type of the CAN interface 1 of the CANstress hardware is written
(recommended buffer size: 40 Byte).

if1BufLen

Size of the buffer in which the type of the CAN interface1 is written (in bytes).

canInterface2

Buffer in which the type of the CAN interface 2 of the CANstress hardware is written
(recommended buffer size: 40 Byte).

if2BufLen

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressGetInfo

Size of the buffer in which the type of the CAN interface 2 is written (in bytes).

Return values 0: On successful call.

-1: In case of error.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressGetPerformedDisturbances

CANstressGetPerformedDisturbances
CAPL Function Overview » CANstress » CANstressGetPerformedDisturbances

Syntax long CANstressGetPerformedDisturbances;

Function Acquires the number of disturbances that were executed by CANstress.

Parameters —

Return values Number of disturbances that were executed since the last call to disturb.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressIsFinished

CANstressIsFinished
CAPL Function Overview » CANstress » CANstressIsFinished

Syntax long CANstressIsFinished();

Function Serves to query whether the CANstress hardware is in the state Finished.

Parameters —

Return values 1: If the CANstress hardware is in the state Finished.

0: If the hardware is in another state (Idle or Pending)

-1: On occurrence of an error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressIsIdle

CANstressIsIdle
CAPL Function Overview » CANstress » CANstressIsIdle

Syntax long CANstressIsIdle();

Function Serves to query whether the CANstress hardware is in the state Idle.

Parameters —

Return values 1: If the CANstress hardware is in the state Idle.

0: If the hardware is in another state (Pending or Finished).

-1: On occurrence of an error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressIsPending

CANstressIsPending
CAPL Function Overview » CANstress » CANstressIsPending

Syntax long CANstressIsPending();

Function Serves to query whether the CANstress hardware is in the state Pending.

Parameters —

Return values 1: If the CANstress hardware is in the state Pending.

0: If the hardware is in another state (Idle or Finished).

-1: On occurrence of an error.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressOnFinished

CANstressOnFinished
CAPL Function Overview » CANstress » CANstressOnFinished

Syntax long CANstressOnFinished( char fnctCallback[] );

Function Registers a CAPL function as callback that is called if CANstress is switched into the state
Finished.

Parameters fnctCallback

Name of the function that should be used as callback.

Info

• The callback functions must correspond to the following syntax: long


FunctionName ( dword );
• Should the CAPL function used as callback not longer be called when
CANstress changes into the Finished condition, an empty string must be
passed as parameter to CANstressOnPending.

// delete or switch off present callback


CANstressOnFinished( " " );

Return values 0: On successful call.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressOnIdle

CANstressOnIdle
CAPL Function Overview » CANstress » CANstressOnIdle

Syntax long CANstressOnIdle( char fnctCallback[] );

Function Registers a CAPL function as callback that is called if CANstress is switched into the state
Idle.

Parameters fnctCallback

Name of the function that should be used as callback.

Info

• The callback functions must correspond to the following syntax: long


FunctionName( dword );
• Should the CAPL function used as callback not longer be called when
CANstress changes into the Idle condition, an empty string must be
passed as parameter to CANstressOnPending.

// delete or switch off present callback


CANstressOnIdle( " " );

Return values 0: On successful call.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressOnPending

CANstressOnPending
CAPL Function Overview » CANstress » CANstressOnPending

Syntax long CANstressOnPending( char fnctCallback[] );

Function Registers a CAPL function as callback that is called if CANstress is switched into the state
Pending.

Parameters fnctCallback

Name of the function that should be used as callback.

Info

• The callback functions must correspond to the following syntax: long


FunctionName( dword );
• Should the CAPL function used as callback not longer be called when
CANstress changes into the Pending condition, an empty string must be
passed as parameter to CANstressOnPending.

// delete or switch off present callback


CANstressOnPending( " " );

Return values 0: On successful call.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressOpen

CANstressOpen
CAPL Function Overview » CANstress » CANstressOpen

Syntax void CANstressOpen( char fileName[] );

Function Opens a CANstress configuration file.

Parameters fileName

If the passed configuration file is configured as a User File, only the file name is passed
here. Otherwise either an absolute path or a relative path relating to the folder of the
CANoe configuration must be passed.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

| CANstress and CANoe RT/VN890 |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressQuit

CANstressQuit
CAPL Function Overview » CANstress » CANstressQuit

Syntax dword CANstressQuit();

Function Ends the CANstress software. All following CANstress CAPL functions cause error messages
(if previously a CANstress server was not created a new).

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetBTR

CANstressSetBTR
CAPL Function Overview » CANstress » CANstressSetBTR

Syntax void CANstressSetBTR (DWORD btr1, DWORD btr2);

Function Sets the value of the Bus Timing Register. This setting affects the baud rate of the CAN
bus set in CANstress. The CAN controller data sheet will list valid pairs of values.

Parameters btr0

New value for BTR0.

btr1

New value for BTR1.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetContinuousDisturbanceTimeLimited

CANstressSetContinuousDisturbanceTimeLimited
CAPL Function Overview » Canisters » CANstressSetContinuousDisturbanceTimeLimited

Syntax void CANstressSetContinuousDisturbanceWhileTrigger (DWORD duration, DWORD


type);

Function Sets the Continuous disturbance (time limited) mode. If the disturbance has not
previously been terminated by means of an explicit command such as CANstressStop, the
end of the test module or the end of the measurement, it will prevail for the period of
time set in duration.

Parameters time

Defines the maximum length of the continuous disturbance. The length is specified in ms
and must be greater than 0.

type

Defines the type of continuous disturbance. The disturbance can be associated with
dominant or recessive bits or it can be an analog disturbance. 2 indicates a dominant
disturbance, 3 a recessive disturbance and 4 an analog disturbance (only in conjunction
with CANstress DR).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetContinuousDisturbanceUntilStop

CANstressSetContinuousDisturbanceUntilStop
CAPL Function Overview » CANstress » CANstressSetContinuousDisturbanceUntilStop

Syntax void CANstressSetContinuousDisturbanceUntilStop (DWORD type);

Function Sets the Continuous disturbance (until stop) mode. Once the trigger has been activated,
the continuous disturbance will prevail until the CANstress device is deactivated (e.g. by
means of the CANstressStop function) and/or the measurement or test module is
terminated.

Parameters type

Defines the type of continuous disturbance. The disturbance can be associated with
dominant or recessive bits or it can be an analog disturbance. 2 indicates a dominant
disturbance, 3 a recessive disturbance and 4 an analog disturbance (only in conjunction
with CANstress DR).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetContinuousDisturbanceWhileTrigger

CANstressSetContinuousDisturbanceWhileTrigger
CAPL Function Overview » CANstress » CANstressSetContinuousDisturbanceWhileTrigger

Syntax void CANstressSetContinuousDisturbanceWhileTrigger (DWORD type);

Function Sets the Continuous disturbance (while trigger) mode. The continuous disturbance will
prevail for as long as the trigger is active. Please note that this mode is generally only
useful in conjunction with a software trigger.

Parameters type

Defines the type of continuous disturbance. The disturbance can be associated with
dominant or recessive bits or it can be an analog disturbance. 2 indicates a dominant
disturbance, 3 a recessive disturbance and 4 an analog disturbance (only in conjunction
with CANstress DR).

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetDevice

CANstressSetDevice
CAPL Function Overview » CANstress » CANstressSetDevice

Syntax long CANstressSetDevice (DWORD deviceId);

Function Defines the active device for further functions.

Parameters deviceId

Handle for the CANstress device on which further functions are to run. This handle is sent
back by the CANstressCreateServer function.

Return values 0: If successful.

-1: In case of error.

This means that deviceId is not a valid handle for a CANstress device. Only handles sent
back by the CANstressCreateServer function and for which the connection to the COM
server has not yet been terminated with CANstressQuit are valid.

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetDisturbanceSequence

CANstressSetDisturbanceSequence
CAPL Function Overview » CANstress » CANstressSetDisturbanceSequence

Syntax void CANstressSetDisturbanceSequence (char sequence[], DWORD resolution);

Function Sets the disturbance sequence.

Parameters sequence

Describes the sequence as a string of 0, 1, a, and u characters, whereby 0 stands for


dominant, 1 for recessive, a for an analog disturbance and u for undisturbed. A
disturbance sequence can contain up to 2048 characters.

resolution

Sets the resolution of the disturbance sequence. Possible values are 0 for bit times and 1
for BTL cycles.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example
CANstressSetDisturbanceSequence(“uuuu1111“, 0);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetLimitedDisturbanceNumber

CANstressSetLimitedDisturbanceNumber
CAPL Function Overview » CANstress » CANstressSetLimitedDisturbanceNumber

Syntax void CANstressSetLimitedDisturbanceNumber (DWORD cycles, DWORD


distPerCycle, DWORD cyclePause);

Function Sets the Limited number of disturbances disturbance mode. In this mode, the number n
of disturbances in a disturbance cycle is limited. n disturbances will be followed by a
configurable pause p as long as this is not a single disturbance cycle.

Parameters cycles

Defines the number of disturbance cycles. Values from 1 to 65,535 are valid.

distPerCycles

Defines the number of disturbances per disturbance cycle. Values from 1 to 255 are valid.

cyclePause

Defines the length of the pause between two disturbance cycles. The length is defined in
ms and may be between 1 and 65,535.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetResistor

CANstressSetResistor
CAPL Function Overview » CANstress » CANstressSetResistor

Syntax void CANstressSetResistor (DWORD resId, float value);

Function Sets the value of a resistor for analog disturbances. This command will only take effect if
permitted by the resistor layout set in the basic configuration. If the R_H layout is active,
it will only be possible to set the RH resistor. If the CANstress device is inactive at this
point, settings will only be applied once the CANstress device is active, i.e., once the
trigger has been activated.

Parameters resId

Sets the resistor whose value is to be defined:

1 for RH

2 for RSH

3 for RHL

4 for RSL

5 for RL

value

New resistor value. The value is specified in ohms, whereby only multiples of 2.5 in the
range between 0 and 10,237.5 are valid. In the event of values that may be invalid, a
warning will appear in the test report. If an invalid value is transferred, it will be ignored
(i.e., not applied) by the COM server.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetTriggerId

CANstressSetTriggerId
CAPL Function Overview » CANstress » CANstressSetTriggerId

Syntax void CANstressSetTriggerId (DWORD id);

Function Sets the message ID, which will activate the trigger.

Parameters Id

Message ID for trigger. Both simple and complex CAN message IDs can be specified.
However, the corresponding mode must be set in the basic configuration!

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetTriggerRange

CANstressSetTriggerRange
CAPL Function Overview » CANstress » CANstressSetTriggerRange

Syntax void CANstressSetTriggerRange (DWORD fromId, DWORD toId);

Function Sets a range for message IDs, which will activate triggers. Both simple and complex CAN
message IDs can be specified. However, the corresponding mode must be set in the basic
configuration!

Parameters fromId

Sets the lower limit of the trigger range.

toId

Sets the upper limit of the trigger range.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressSetUnlimitedDisturbanceNumber

CANstressSetUnlimitedDisturbanceNumber
CAPL Function Overview » CANstress » CANstressSetUnlimitedDisturbanceNumber

Syntax void CANstressSetUnlimitedDisturbanceNumber();

Function Sets the Unlimited number of disturbances disturbance mode. In this mode, a
disturbance occurs on every trigger event. There is no limit to the total number of
disturbances.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

6.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressStart

CANstressStart
CAPL Function Overview » CANstress » CANstressStart

Syntax long CANstressStart();

Function Orders the CANstress COM server to activate the hardware for the error disturbance
activity. If there is no connection between the CANstress software and the CANstress
hardware, this is established previously.

Parameters —

Return values 0: If successful.

-1: In case of error (due to an internal error).

-2: In case of error (due to an internal timeout).

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressStop

CANstressStop
CAPL Function Overview » CANstress » CANstressStop

Syntax void CANstressStop();

Function Orders the CANstress COM server to end the current disturbance activity of the hardware.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressStopTrigger

CANstressStopTrigger
CAPL Function Overview » CANstress » CANstressStopTrigger

Syntax long CANstressStopTrigger();

Function Deactivates the CANstress software triggers if this is still active.

Parameters —

Return values 0: On successful call.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressTrigger

CANstressTrigger
CAPL Function Overview » CANstress » CANstressTrigger

Syntax long CANstressTrigger();

Function Activates the CANstress software trigger.

Parameters —

Return values 0: On successful call.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressWaitForFinished

CANstressWaitForFinished
CAPL Function Overview » CANstress » CANstressWaitForFinished

Syntax long CANstressWaitForFinished( dword timeout );

Function Waits until the CANstress hardware is in the state Finished.

Parameters timeoutText

Specifies a maximal time in milliseconds that is waited. At the latest after the expiration
of this time, the function returns.

Info

With timeout = 0 an infinite time is waited until the state Finished occurs.
Thus the additional test procedure is blocked if the state Finished is not
reached.

Return values 0: If successful.

-1: On occurrence of an internal error.

-2: On return of the function due to a timeout.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressWaitForIdle

CANstressWaitForIdle
CAPL Function Overview » CANstress » CANstressWaitForIdle

Syntax long CANstressWaitForIdle( dword timeout );

Function Waits until the CANstress hardware is in the state Idle.

Parameters timeout

Specifies a maximal time in milliseconds that is waited. At the latest after the expiration
of this time, the function returns.

Info

With timeout = 0 an infinite time is waited until the state Idle occurs. Thus
the additional test procedure is blocked if the state Idle is not reached.

Return values 0: If successful.

-1: On occurrence of an internal error.

-2: On return of the function due to a timeout.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstressWaitForPending

CANstressWaitForPending
CAPL Function Overview » CANstress » CANstressWaitForPending

Syntax long CANstressWaitForPending( dword timeout);

Function Waits until the CANstress hardware is in the state Pending.

Parameters timeout

Specifies a maximal time in milliseconds that is waited. At the latest after the expiration
of this time, the function returns.

Info

With timeout = 0 an infinite time is waited until the state Pending occurs.
Thus the additional test procedure is blocked if the state Pending is not
reached.

Return values 0: If successful.

1: On occurrence of an internal error.

-2: On return of the function due to a timeout.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.0 • CANstress — •
• Test modules

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress: Access Multiple CANstress Devices from a Single Test Module

CANstress: Access Multiple CANstress Devices from a Single Test Module


CAPL Function Overview » CANstress » Access Multiple CANstress Devices from a Single Test Module

With previous versions of CANstress NL DLL, it was only possible to access a single CANstress device from a
single test module. With Version 2.0, it is now possible to control as many CANstress devices as you like
from a single test module. To do this, you need to start by configuring the connected CANstress devices in
the CANstress.ini file. You will find this file in the CANstress application’s installation directory. For
more information, see online help of the CANstress application.

To establish a connection to a specific CANstress device, you need to use the CANstressCreateServer
command with the alias or number of a configured CANstress device as a parameter. You will then obtain
a handle, which you can use to switch between different devices. To do this, you need to use the
CANstressSetDevice function with the relevant handle as a parameter.

The NodeLayer DLL will recognize the set CANstress device. When CANstressCreateServer or
CANstressSetDevice is called, the following calls to CANstress CAPL functions are executed on the set
device.

Example
// Check that CANstress devices have been configured
if (CANstressAvailableDevices() < 2)
{
TestCaseFail();
Write("Number of configured CANstress devices is less than 2!");
}

// Establish connection to "cstCAN1"


deviceId1 = CANstressCreateServer("cstCAN1");
CANstressConnect();

// Establish connection to "cstCAN2"


deviceId2 = CANstressCreateServer("cstCAN2");
CANstressConnect();

// The following commands are executed on "cstCAN2"


CANstressOpen(".\\CANstress\\EngineData_BusOff.cst");

CANstressSetDevice(deviceId1);
// The following commands are executed on "cstCAN1"
CANstressOpen(".\\CANstress\\EngineData_BusOff.cst");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress: CANstress and CANoe RT/VN8900

CANstress: CANstress and CANoe RT/VN8900


CAPL Function Overview » CANstress » CANstress and CANoe RT/VN8900

Since version 7.5 SP2 of CANoe, the use of CANstress integration in combination with CANoe RT is
simplified. Use with VN8900 modules is also now possible.

Important changes

• The CANstressOpen command now supports the specification of CANstress configuration files as
application data.
• For access to CANstress devices via CANstress commands in CANoe, it is no longer necessary to install
the CANstress application. All necessary components are now part of CANoe. The CANstress
application is now needed only to create configuration files. In CANoe version 7.5 SP2 and higher, the
access to CANstress devices that are connected to VN8900 is also supported.

The following must be noted for use of CANstress commands together with CANoe RT or the VN8900:

• All CANstress configuration files used must be entered in the CANoe configuration as user files. They
are transferred automatically to the RT Server or the VN8900 at the start of a measurement.
• The calls of CANstressOpen specify just the file name, instead of a relative or absolute path.
• For example, if a configuration is needed for access to multiple devices, access to the correct device
can be configured using the configuration page for CANstress. This requires the CANstress devices to
first be connected to the correct system. When CANoe RT is used, this is the RT Server, e.g., a VT6010
module. If a VN8900 is used, CANstress devices must be connected there. With CANoe RT, the
connection to the RT server is then established in the Options. With VN8900, only the correct
configuration of the channels used is needed to establish the connection automatically. If Options is
now reopened and the CANstress configuration page is displayed, the CANstress devices are searched
for on the correct system, and the configuration on that system is displayed. Changes to the
configuration are then saved on the correct system.

A configuration in which the first two points are observed can be operated either with or without CANoe
RT. The use of relative or absolute paths continues to be supported, but will likely lead to problems when
CANoe RT is used.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: CANstress: Main Test Function Example

CANstress: Main Test Function Example


CAPL Function Overview » CANstress » Main Test Function Example

Example
MainTest ()
{
dword ret = 0;
dword numDisturbances = 0;

// Create a CANstress Instance


CANstressCreateServer();

// Test if we could establish a connection to the CANstress hardware.


CANstressConnect();

// Load a prepared CANstress configuration, which disturbs the message 0x100


// 31 times in the RTR-bit.
CANstressOpen( "F:\\Develop\\usr\\addons\\CANstress-NL\\Disturb_100_RTR.cst" );

// Now activate the CANstress hardware.


CANstressStart();

// Now, wait until the CANstress has been finished or the timeout has been
elapsed
ret = CANstressWaitForFinished( 5000 );
if (ret == 0)
{
Write( "All disturbances of the configuration has been performed." );
}
else
{
numDisturbances = CANstressGetPerformedDisturbances();
Write( "Disturb_100_RTR.cst : Not all disturbances has been performed:" );
Write( "Performed Disturbances: %d", numDisturbances );
}

// Stop CANstress ...


CANstressStop();

// ... and load the next test-configuration


// CANstressOpen(...);
// .... and start the next test
// CANstressStart();
// ...
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRstress CAPL Functions
(Only available with Option .FlexRay!)

FRstress CAPL Functions


(Only available with Option .FlexRay!)
CAPL Function Overview » FRstress CAPL Functions

In Option .FlexRay the following functions are available with FRstress hardware:

Control Short description

FRSEnableTrigDist Activates a trigger/disturbance page of FRstress.

FRSInit Initializes FRstress and starts the COM server.

FRSQuit Ends the FRstress software.

FRSStart Orders the FRstress COM server to activate the hardware


for the error disturbance activity.

FRSStop Orders the FRstress COM server to end the current


disturbance activity of the hardware.

FRSSoftwareTrigger Activates the FRstress software trigger.

General configuration Short description

FRSClear Clears the content of the current configuration.

FRSGetDevice Indicates the device number of the available FRstress


hardware.

FRSOpen Opens an FRstress configuration file.

FRSSetDevice Sets the device number for FRstress.

Operating mode configuration - Can only be Short description


called after FRSClear

FRSSetAnalogMode Activates the analog disturbance mode.

FRSSetDigitalMode Activates the digital disturbance mode.

FRSSetScopeMode Activates the Scope mode.

Trigger configuration - Can only be called Short description


after FRSClear

FRSSetTrig Adds frame elements (bit sequence) to a trigger


condition.

FRSSetTrigElem Adds frame elements (numerical input) to a trigger


condition.

FRSSetTrigPayload Adds frame payload areas to a trigger condition.

FRSSetTrigPort Sets the input port for the trigger condition in digital
mode.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRstress CAPL Functions
(Only available with Option .FlexRay!)

Disturbance configuration - Can only be Short description


called after FRSClear

FRSActivateCRCCalc Activates the automatic CRC computation.

FRSSetBitstreamDist Configures a bit sequence as disturbance.

FRSSetDistCount Configures the number of disturbances.

FRSSetDistPayload Adds frame Payload areas to a disturbance.

FRSSetFrmDist Adds frame elements (bit sequence) to a bit accuracy


disturbance.

FRSSetFrmDistElem Adds frame elements (numeric input) to a bit accuracy


disturbance.

Trigger output configuration - Can only be Short description


called after FRSClear

FRSSetTrigOutput Configures the trigger output.

Event procedures Short description

FRSOnFinished Registers a callback.

FRSOnStopped

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSOnFinished

FRSOnFinished
CAPL Function Overview » FRstress » FRSOnFinished

Note

The function is only supported with an installed FRstress.

Syntax long FRSOnFinished(char CallbackName[])

Function Registers a callback. The callback will be executed when the dedicated disturbance
counter is 0. The callback function must be added in the CAPL section callback.

Parameters CallbackName

Any desired name can be used as name of the callback function.

Callback <name>(long unit, long page)

Callback unit
parameter
Device number: 1 or 2

page

Trigger/Disturbance page: 1 - 4

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSOnStopped

FRSOnStopped
CAPL Function Overview » FRstress » FRSOnStopped

Note

The function is only supported with an installed FRstress.

Syntax long FRSOnStopped(char CallbackName[])

Function Registers a callback. The callback will be executed when the session ends. The callback
function must be added in the CAPL section callback.

Parameters CallbackName

Any desired name can be used as name of the callback function.

Callback <name>(void)

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSActivateCRCCalc

FRSActivateCRCCalc
CAPL Function Overview » FRstress » FRSActivateCRCCalc

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax FRSActivateCRCCalc (int index, int calculateCRC);

Function Activates the automatic CRC computation based on the disturbance data (FRSSetFrmDist,
FRSSetFrmDistElem, FRSSetDistPayload) and the real frame.

Parameters index

Values: 1-4

calculateCRC

Values:

0 no calculation
1 calculate header crc
2 calculate frame crc
3 calculate header and frame crc
Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Digital mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSClear

FRSClear
CAPL Function Overview » FRstress » FRSClear

Note

The function is only supported with an installed FRstress.

Syntax long FRSClear()

Function Clears the content of the current configuration.


For a defined initial state, the function has to be called as the first configuration
function.

Parameters —

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSEnableTrigDist

FRSEnableTrigDist
CAPL Function Overview » FRstress » FRSEnableTrigDist

Note

The function is only supported with an installed FRstress.

Syntax long FRSEnableTrigDist(int triggerCondition, int iEnable)

Function Activates a trigger/disturbance page of FRstress. This function can be called out of a
measurement session.

Parameters triggerCondition

Values: 1-4

iEnable

Enable = 1
Disable = 0

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSGetDevice

FRSGetDevice
CAPL Function Overview » FRstress » FRSGetDevice

Note

The function is only supported with an installed FRstress.

Syntax long FRSGetDevice()

Function Indicates the device number of the FRstress hardware, set with FRSSetDevice.

Parameters —

Return values Returns the device number of the currently active hardware unit.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSInit

FRSInit
CAPL Function Overview » FRstress » FRSInit

Note

The function is only supported with an installed FRstress.

Syntax long FRSInit()

Function Initializes FRstress and starts the COM server. The function must be called once in on
prestart.

Parameters —

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSOpen

FRSOpen
CAPL Function Overview » FRstress » FRSOpen

Note

The function is only supported with an installed FRstress.

Syntax long FRSOpen(char sFileName[])

Function Opens an FRstress configuration file.

Parameters sFileName

Name of the FRstress configuration file.

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSQuit

FRSQuit
CAPL Function Overview » FRstress » FRSQuit

Note

The function is only supported with an installed FRstress.

Syntax void FRSQuit()

Function Ends the FRstress software.

Parameters —

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetAnalogMode

FRSSetAnalogMode
CAPL Function Overview » FRstress » FRSSetAnalogMode

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetAnalogMode (float baudrate, int channel, int payloadLength)

Function Activates the analog disturbance mode of FRstress.


Configuration functions that belong to another operating mode are ignored.

Parameters baudrate

Values: 10, 5, 2.5, 1.25 Mbit/s

channel

Values: 1=A, 2=B

payloadLength

Values: 0-254 bytes

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetBitstreamDist

FRSSetBitstreamDist
CAPL Function Overview » FRstress » FRSSetBitstreamDist

Note

The function is only supported with an installed FRstress.


The function must be called before FRSStart.

Syntax long FRSSetBitstreamDist (int triggerCondition, char disturbanceSequence[],


int disturbanceLength, int delayAfterTrigger, int autoincrement);

Function Generates a bit sequence that is applied to the bus as a disturbance after the trigger is
detected. In addition, a delay between the trigger and disturbance can be set. The
autoincrement value increases the delay by the specified amount at each additional
trigger.

Parameters triggerCondition

Values: 1…4

disturbanceSequence

Bite sequence of length disturbanceLength. Possible value in the sequence: 0,1,u


(undisturbed).

disturbanceLength

Number of bits to be disturbed.

delayAfterTrigger

Values: 0…16777 bit times.

autoincrement

Values: 0…4095 bit times.

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Digital, analog mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetDevice

FRSSetDevice
CAPL Function Overview » FRstress » FRSSetDevice

Note

The function is only supported with an installed FRstress.

Syntax void FRSSetDevice(int iDeviceNo)

Function Sets the device number for FRstress. All subsequent calls will be addressed to this unit.

Parameters iDeviceNo

Device number: 1 or 2

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetDigitalMode

FRSSetDigitalMode
CAPL Function Overview » FRstress » FRSSetDigitalMode

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetDigitalMode (float baudrate, int channel, int payloadLength,


double macrotickLengthUs, int TSSLengthBit, int cycleLengthUs, int
numberStaticSlots, int actionPointOffsetMT, int staticSlotLengthMT, int
TSSExtension)

Function Activates the digital disturbance mode of FRstress.


Configuration functions that belong to another operating mode are ignored.

Info

There are dependencies between the parameters according to the FlexRay


specification.

Parameters baudrate

Values: 10, 5, 2.5, 1.25 Mbit/s

channel

Values: 1=A, 2=B

payloadLength

Values: 0-254 Bytes

macrotickLengthUs

Values: 1-6 us

TSSLengthBit

Values3-15 Bit

cycleLengthUs

Values: 26 – 16000 us

numberStaticSlots

Values: 2-1023

actionPointOffsetMT

Values: 1-63 Macrotick

staticSlotLengthMT

Values: 4 – 661 Macrotick

TSSExtension

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetDigitalMode

Values: 0-14 Bit

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRstressSetDistCount

FRstressSetDistCount
CAPL Function Overview » FRstress » FRstressSetDistCount

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax FRSSetDistCount (int index, int disturbanceCount);

Function Configures the number of disturbances.

Parameters index

Values: 1-4

disturbanceCount

Values: 0-254, -1 = infinite

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.2 • FlexRay — •
• Digital, analog mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetDistPayload

FRSSetDistPayload
CAPL Function Overview » FRstress » FRSSetDistPayload

Note

The function is only supported with an installed FRstress.


The function must be called before FRSStart.

Syntax long FRSSetDistPayload (int triggerCondition, int


disturbancePayloadElement, int byteIndex, char disturbanceValue[]);

Function Modifies the Payload with bit accuracy. The disturbance is defined as a bit sequence. A
complex disturbance can be configured through multiple calls.
The associated trigger condition must not overlap with the disturbance.
If the function is called in analog mode, it has no effect.

Parameters triggerCondition

Values: 1…4

disturbancePayloadElement

Values: 0=Payload Byte, 1=BSS

byteIndex

Values: 0…254 start index in the payload

disturbanceValue

Bit sequence of the respective payload byte. The possible elements of the sequence are
0,1,x (don’t care).

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Digital mode
• Test nodes

Example

| FRSActivateCRCCalc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetFrmDist

FRSSetFrmDist
CAPL Function Overview » FRstress » FRSSetFrmDist

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetFrmDist (int triggerCondition, int disturbanceElement, char


disturbanceValue[]);

Function Modifies the specified frame element with bit accuracy. The disturbance is defined as a
bit sequence. A complex disturbance can be configured through multiple calls.

The associated trigger condition must not overlap with the disturbance.

If the function is called in analog mode, it has no effect.

Parameters triggerCondition

Values: 1-4

disturbanceElement

Values:

1 PPI

2 NFI

3 SFI

4 SUPFI

5 FrameId

6 PayloadLength

7 HeaderCR

8 cycleCount

9 BSS1

10 BSS2

11 BSS3

12 BSS4

13 BSS5

14 TrailerBSS1

15 TrailerBSS2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetFrmDist

16 TrailerBSS3

17 TrailerCRCByte1

18 TrailerCRCByte2

19 TrailerCRCByte

20 FES

disturbanceValue

Values: 0,1, u (undisturbed)

Bit sequence of the disturbance. e.g.: FrameId=01u

The respective maximum lengths must be noted. For example, the PayloadLength field
must not exceed the maximum length of 7 bits.

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Digital mode
• Test nodes

Example

| FRSActivateCRCCalc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetFrmDistElem

FRSSetFrmDistElem
CAPL Function Overview » FRstress » FRSSetFrmDistElem

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetFrmDistElem (int triggerCondition, int disturbanceElement, int


disturbanceValue);

Function Modifies the specified frame element with bit accuracy. A complex disturbance can be
configured through multiple calls.

The associated trigger condition must not overlap with the disturbance.

If the function is called in analog mode, it has no effect.

Parameters triggerCondition

Values: 1-4

disturbanceElement

Values:

1 PPI

2 NFI

3 SFI

4 SUPFI

5 FrameId

6 PayloadLength

7 HeaderCRC

8 cycleCount

9 BSS1

10 BSS2

11 BSS3

12 BSS4

13 BSS5

14 TrailerBSS1

15 TrailerBSS2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetFrmDistElem

16 TrailerBSS3

17 TrailerCRCByte1

18 TrailerCRCByte2

19 TrailerCRCByte3

20 FES

disturbanceValue

Numerical value of disturbance. e.g.: FrameId=5

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.2 • FlexRay — •
• Digital mode
• Test nodes

Example

| FRSActivateCRCCalc |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetScopeMode

FRSSetScopeMode
CAPL Function Overview » FRstress » FRSSetScopeMode

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetScopeMode( float baudrate, int channel, int payloadLength);

Function Activates the Scope mode of FRstress.


Configuration functions that belong to another operating mode are ignored.

Parameters baudrate

Values: 10, 5, 2.5, 1.25 Mbit/s

channel

Values: 1=A, 2=B

payloadLength

Values: 0-254 Bytes

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Simulation / Test


Version Setup Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrig

FRSSetTrig
CAPL Function Overview » FRstress » FRSSetTrig

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetTrig( int triggerCondition, int triggerElement, int


triggerValue);

Function Adds a bit sequence to the respective trigger condition as a trigger value. A complex
trigger condition can be created through multiple calls.

Parameters triggerCondition

Values: 1-4

triggerElement

Values:

0 reservedBit

1 PPI

2 NFI

3 SFI

4 SUPFI

5 FrameId

6 PayloadLength

7 HeaderCRC

8 cycleCount

9 BSS1

10 BSS2

11 BSS3

12 BSS4

13 BSS5

14 TrailerBSS1

15 TrailerBSS2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrig

16 TrailerBSS3

17 TrailerCRCByte1

18 TrailerCRCByte2

19 TrailerCRCByte3

20 FES

triggerValue

Bit sequence of the respective frame field. The possible elements of the sequence are
0,1,x (don’t care). The respective maximum lengths must be noted. For example, the
PayloadLength field must not exceed the maximum length of 7 bits.

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrigElem

FRSSetTrigElem
CAPL Function Overview » FRstress » FRSSetTrigElem

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetTrigElem( int triggerCondition, int triggerElement, int


triggerValue);

Function Adds a numerical trigger value to the respective trigger condition. A complex trigger
condition can be created through multiple calls.

Parameters triggerCondition

Values: 1-4

triggerElement

Values:

0 reservedBit

1 PPI

2 NFI

3 SFI

4 SUPFI

5 FrameId

6 PayloadLength

7 HeaderCRC

8 cycleCount

9 BSS1

10 BSS2

11 BSS3

12 BSS4

13 BSS5

14 TrailerBSS1

15 TrailerBSS2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrigElem

16 TrailerBSS3

17 TrailerCRCByte1

18 TrailerCRCByte2

19 TrailerCRCByte3

20 FES

triggerValue

Numerical value of the respective frame field. The respective maximum values must be
noted. For example, the Payload Length must not exceed the maximum value of 127
words.

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrigOutput

FRSSetTrigOutput
CAPL Function Overview » FRstress » FRSSetTrigOutput

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax FRSSetTrigOutput (int triggermask, int triggerlevel);

Function Activates the trigger output of FRsstress. The trigger output can react to individual trigger
lowerings or to a combination of sources.

Parameters triggermask

Values:

1 Trigger1
2 Trigger2
4 Trigger3
8 Trigger4
16 SW Trigger
32 External Trigger
triggerlevel

Values: 0=Low, 1=High

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrigPayload

FRSSetTrigPayload
CAPL Function Overview » FRstress » FRSSetTrigPayload

Note

The function is only supported with an installed FRstress.


The function must be called before FRSStart.

Syntax long FRSSetTrigPayload (int triggerCondition, int triggerPayloadElement,


int byteIndex, char triggerValue[]);

Function Adds a bit sequence to the respective trigger condition as a trigger value. A complex
trigger condition can be created through multiple calls.

Parameters triggerCondition

Values: 1…4

triggerPayloadElement

Values: 0=Payload Byte, 1=BSS

byteIndex

Values: 0…254 start index in the payload

triggerValue

Bit sequence of the respective Payload byte. The possible elements of the sequence are
0,1,x (don’t care).

Return values 0: successful

-1: in case of error

Availability Since Restricted to Measurement Setup Simulation / Test


Version Setup

7.2 • FlexRay — •
• Digital, analog, Scope
mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSetTrigPort

FRSSetTrigPort
CAPL Function Overview » FRstress » FRSSetTrigPort

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetTrigPort (int triggerCondition, int portMask);

Function Adds a bit sequence to the the respective trigger condition as a trigger value. A complex
trigger condition can be created through multiple calls.

Parameters triggerCondition

Values: 1-4

portMask

Values: 3= both ports, 1= Port A (Channel1), 2= Port B (Channel2)

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

7.2 • FlexRay — •
• Digital mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSSoftwareTrigger

FRSSoftwareTrigger
CAPL Function Overview » FRstress » FRSSoftwareTrigger

Note

The function is only supported with an installed FRstress.

Syntax long FRSSoftwareTrigger(int iEnable)

Function Activates the FRstress software trigger.

Parameters iEnable

Enable = 1
Disable = 0

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSStart

FRSStart
CAPL Function Overview » FRstress » FRSStart

Note

The function is only supported with an installed FRstress.

Syntax long FRSStart()

Function Orders the FRstress COM server to activate the hardware for the error disturbance
activity.

Parameters —

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: FRSStop

FRSStop
CAPL Function Overview » FRstress » FRSStop

Note

The function is only supported with an installed FRstress.

Syntax long FRSStop()

Function Orders the FRstress COM server to end the current disturbance activity of the hardware.

Parameters —

Return values 0: successful

-1: in case of error

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.0 • FlexRay — •
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIB CAPL Functions
(Only available with GPIB & CANoe!)

GPIB CAPL Functions


(Only available with GPIB & CANoe!)
CAPL Function Overview » GPIB CAPL Functions

GPIB is a bus protocol for networking measurement devices.


Equivalent names are:

• IEEE 488
• HP-IB
• IEC

In order to be able to use GPIB functionality, a GPIB controller must be installed on the system.

The GPIB/CAPL API makes available the following functions for GPIB control:

Functions Short description

GPIBDevChangePrimAddr Changes the primary address of a device.

GPIBDevChangeSecAddr Changes the secondary address of a device.

GPIBDevClear Resets a device.

GPIBDevGotoLocal Sets a device into local mode.

GPIBDevOnline Activates/deactivates the device.

GPIBDevOpen Opens a GPIB device and returns a device ID.

GPIBGetCnt Returns the number of bytes transferred by the last GPIB operation.

GPIBGetCtrlLineStatus Returns the status of the GPIB control lines.

GPIBGetError Returns the error variable.

GPIBGetFloatResult Helps functions for extracting numeric values from GPIB response
strings.

GPIBGetIntResult Helps functions for extracting numeric values from GPIB response
strings.

GPIBGetStatus Returns the status word.

GPIBOnError Is called if a query or a write operation raised an error condition.


GPIBQuery Query to the device.

GPIBQueryEx Query to the device.

GPIBReqRelSysCtrl Sets or deletes the permission to send interface clear (IFC) or remote
enabler (REN).

GPIBResponse Is called when the query returns.

GPIBWriteNum Writes GPIB command and numeric value to the device.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIB CAPL Functions
(Only available with GPIB & CANoe!)

GPIBWriteStr Writes GPIB command to the device.

Info

No explicit read functions are available. The response of GPIB devices is announced in the
callback function GPIBResponse. Here users can implement their specific code.

| Error Code | Status |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevChangeSecAddr

GPIBDevChangeSecAddr
CAPL Function Overview » GPIB » GPIBDevChangeSecAddr

Syntax long GPIBDevChangeSecAddr (long deviceDescriptor, long newAddr)

Function Changes the secondary address of a device.

Parameters deviceDescriptor

Device ID

newAddr

New secondary address

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevChangePrimAddr

GPIBDevChangePrimAddr
CAPL Function Overview » GPIB » GPIBDevChangePrimAddr

Syntax long GPIBDevChangePrimAddr (long deviceDescriptor, long newAddr)

Function Changes the primary address of a device.

Parameters deviceDescriptor

Device ID

newAddr

New primary address

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevClear

GPIBDevClear
CAPL Function Overview » GPIB » GPIBDevClear

Syntax long GPIBDevClear (long deviceDescriptor)

Function Resets a device.

Parameters deviceDescriptor

Device ID

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevGotoLocal

GPIBDevGotoLocal
CAPL Function Overview » GPIB » GPIBDevGotoLocal

Syntax long GPIBDevGotoLocal (long deviceDescriptor)

Function Sets a device into local mode. A successor GPIB command sets the device back into
remote mode.

Parameters deviceDescriptor

Device ID

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevOnline

GPIBDevOnline
CAPL Function Overview » GPIB » GPIBDevOnline

Syntax long GPIBDevOnline (long deviceDescriptor, long mode)

Function Activates/deactivates the device.

Parameters deviceDescriptor

Device ID

mode

1: online
0: offline

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevOpen

GPIBDevOpen
CAPL Function Overview » GPIB » GPIBDevOpen

Syntax long GPIBDevOpen (long boardIdx, long primAddr, long secAddr, long timeout,
long eot, long eos)

Function Opens a GPIB device and returns a device ID.

Parameters boardIdx

Index of the GPIB board (e.g.0)

primAddr

Primary address of the GPIB device (0..30)

secAddr

Secondary address of the GPIB device (96..126, typical: 0)

timeout

Timeout of the device.

This indicates the maximum duration of an I/O operation. If this time expires before the
operation has ended the function rolls back with a timeout error in the status word.

Attention: The value for Timeout must be > 0! (typically: 10 s)

0 Timeout disabled. Do not use!


1 Timeout = 10 us
2 Timeout = 30 us
3 Timeout = 100 us
4 Timeout = 300 us
5 Timeout = 1 ms
6 Timeout = 3 ms
7 Timeout = 10 ms
8 Timeout = 30 ms
9 Timeout = 100 ms
10 Timeout = 300 ms
11 Timeout = 1 s
12 Timeout = 3 s
13 Timeout = 10 s
14 Timeout = 30 s
15 Timeout = 100 s
16 Timeout = 300 s
17 Timeout = 1000 s
eot

Indicates whether the GPIB EOI line should be set at the end of a write operation.

Values: 0, 1 (typical: 1)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBDevOpen

eos

Configuration of "end-of-string" behavior.

For further information please refer to documentation for your GPIB controller.

Typical value: 0

Return values Device ID

-1: on error

• if no GPIB driver is available, or


• if the driver is not properly installed, or configured incorrectly, or
• if the function is called outside the PreStart function of a CAPL program.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetCnt

GPIBGetCnt
CAPL Function Overview » GPIB » GPIBGetCnt

Syntax long GPIBGetCnt (void)

Function Returns the number of bytes transferred by the last GPIB operation.

Parameters —

Return values Number of bytes transmitted.

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetCtrlLineStatus

GPIBGetCtrlLineStatus
CAPL Function Overview » GPIB » GPIBGetCtrlLineStatus

Syntax long GPIBGetCtrlLineStatus (long boardIdx)

Function Returns the status of the GPIB control lines.

Parameters boardIdx

GPIB Board ID

Return values Line Status Bytes

The value consists of 2 bytes. The low-order byte (bits 0 through 7) contains a mask
indicating the capability of the GPIB interface to sense the status of each GPIB control
line. The high-order byte (bits 8 through 15) contains the GPIB control line state
information. If a bit is set (1), the corresponding control line can be monitored by the
interface or is asserted, respectively. The following is a pattern of each byte.

7 6 5 4 3 2 1 0

EOI ATN SRQ REN IFC NRFd NDAC DAV

-1 (all bits set in 4 bytes) is returned on error, if no GPIB driver is available.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetError

GPIBGetError
CAPL Function Overview » GPIB » GPIBGetError

Syntax long GPIBGetError (void)

Function Returns the error variable. It is meaningful only when the ERR bit in the status word is set

Parameters —

Return values Current error status

28: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example
// “40” is not a valid GPIB address
GPIBDevChangePrimAddr(devDescr, 40);
if ( ( 1 << 15) & GPIBGetStatus() )
{
write("ERR bit set in status word");
if ( 4 == GPIBGetError() )
{
write("error is EARG: Invalid argument to function call");
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetFloatResult

GPIBGetFloatResult
CAPL Function Overview » GPIB » GPIBGetFloatResult

Syntax double GPIBGetFloatResult (char[] buffer)

Function Helper functions for extracting numeric values from GPIB response strings.

Parameters buffer

The string in buffer, which may have been obtained by the GPIBResponse function, is
searched for a floating-point number, using the function strtod of C/C++. If a space
character is present in the string, the search for the number starts at the first such
character.

Return values Extracted float value.

0: no representation of a value has been found.

-1: buffer is an empty string.

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetIntResult

GPIBGetIntResult
CAPL Function Overview » GPIB » GPIBGetIntResult

Syntax long GPIBGetIntResult (char[] buffer)

Function Helper functions for extracting numeric values from GPIB response strings.

Parameters buffer

The string in buffer, which may have been obtained by the GPIBResponse function, is
searched for an integer number: All non-digit characters in the string as well as all digits
found after the first comma character or decimal point are ignored, when assembling the
integer number.

Return values Extracted integer value

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBGetStatus

GPIBGetStatus
CAPL Function Overview » GPIB » GPIBGetStatus

Syntax long GPIBGetStatus (void)

Function Returns the status word.

Parameters —

Return values Current status

-1: on error, if no GPIB driver is available


Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBOnError

GPIBOnError
CAPL Function Overview » GPIB » GPIBOnError

Syntax GPIBOnError (long deviceDescriptor, char query[], char response[], long


status, long error)

Function This optional function is called if a query or a write operation (GPIBWriteStr or


GPIBWriteNum) raised an error condition.

Users may implement this function and then receive the original query string or the data
to be written, respectively. The result string, if any, is also returned, as well as the GPIB
status word, the error code and the device descriptor.

Parameters deviceDescriptor

The descriptor of the device that transmitted the response.

query

The data transmitted in the failed GPIBQuery… or GPIBWrite… call, respectively

response

The data received from the device so far. The empty string if a write operation failure is
reported.

status

The GPIB status word.

error

The GPIB error code.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

7.1 SP4 GPIB — •

Example

The GPIBOnError callback function is used very much like GPIBResponse. Refere to it for
an example.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBQuery

GPIBQuery
CAPL Function Overview » GPIB » GPIBQuery

Note

Data up to the size of 1000 bytes are read with this function. To read more data bytes
please use function GPIBQueryEx.

Syntax long GPIBQuery (long deviceDescriptor, char cmdStr[])

Function Query to the device.

The cmdStr is put to a queue, and then the function returns immediately. When the
cmdStr has been sent to the device, and a response has been received, the user-supplied
function GPIBResponse is called.

Parameters deviceDescriptor

Device ID

cmdStr

Query string

Return values Status

-1: on error, if no GPIB driver is available, or if no GPIBResponse function was supplied

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example
Query of the voltage: GPIBQuery(myDev, "V?")

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBQueryEx

GPIBQueryEx
CAPL Function Overview » GPIB » GPIBQueryEx

Syntax long GPIBQueryEx (long deviceDescriptor, char cmdStr[], long size)

Function Query to the device.

The cmdStr is put to a queue, and then the function returns immediately. When the
cmdStr has been sent to the device, and a response has been received, the user-supplied
function GPIBResponse is called.

Parameters deviceDescriptor

Device ID

cmdStr

Query string

Size

Maximum expected size of the data to be read.

Return values Status

-1: on error, if no GPIB driver is available, or if no GPIBResponse function was supplied

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

6.1 GPIB — •

Example
Query after wave form: GPIBQuery(myDev, "WAVF?", 1024)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBReqRelSysCtrl

GPIBReqRelSysCtrl
CAPL Function Overview » GPIB » GPIBReqRelSysCtrl

Syntax long GPIBReqRelSysCtrl (long boardIdx, long mode)

Function Sets or deletes the permission to send interface clear (IFC) or remote enable (REN). If
mode is "0," the GPIB board surrenders system control and all controller-specific
commands are not allowed. If mode = "1," then controller-specific commands are allowed.

Parameters boardIdx

GPIB Board ID

mode

(0..1)

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBResponse

GPIBResponse
CAPL Function Overview » GPIB » GPIBResponse

Syntax GPIBResponse (long deviceDescriptor, char queryString[], char


resultString[])

Function This function is called when the query returns. Users must implement this function and
receive the original query string, the result as a string and the device ID.

Parameters deviceDescriptor

The Device Descriptor of the device, that transmitted the response.

queryString

The data transmitted in the GPIBQuery or GPIBQueryEx call, respectively.

resultString

The device response.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example
char myQuery[3] = "V?";
GPIBQuery(myDevice, "V?");
...
GPIBResponse (long deviceDescriptor, char queryString[], char
resultString[])
{
if (deviceDescriptor == myDevice)
{
if ( !strncmp(queryStr, myQuery))
{
putValue(EnvVoltage, GPIBGetFloatResult(resultString));
}
}
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBWriteNum

GPIBWriteNum
CAPL Function Overview » GPIB » GPIBWriteNum

Syntax long GPIBWriteNum (long deviceDescriptor, char cmdStr[], double value)

Function Writes cmdStr + numeric value to the device.

The function returns immediately and does not wait for the end of the command
transmission.

Parameters deviceDescriptor

Device ID

cmdStr

GPIB command

value

Numeric value of the parameter

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example
Setting of a voltage of 1.23 V: GPIBWriteStr(myDev, "V", 1.23)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIBWriteStr

GPIBWriteStr
CAPL Function Overview » GPIB » GPIBWriteStr

Syntax long GPIBWriteStr (long deviceDescriptor, char cmdStr[])

Function Writes cmdStr to the device.

The function returns immediately and does not wait for the end of the command
transmission.

Parameters deviceDescriptor

Device ID

cmdStr

GPIB command

Return values Status

-1: on error, if no GPIB driver is available

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 GPIB — •

Example
Setting of a voltage of 1.23 V: GPIBWriteStr(myDev, "V 1.23")

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIB: Error Code
(Only available with GPIB & CANoe!)

GPIB: Error Code


(Only available with GPIB & CANoe!)
CAPL Function Overview » GPIB » Error Code

Error Code

Contains the error code of the current bus/device situation. It can be obtained using the function
GPIBGetError.
Integer, Range: 0..28

Explanation

0 System error

1 Function requires GPIB board to be CIC

2 Write function detected no Listeners

3 Interface board not addressed correctly

4 Invalid argument to function call

5 Function requires GPIB board to be System Controller

6 I/O operation aborted

7 Non-existent interface board

8 Error performing DMA

10 I/O operation started before previous operation completed

11 No capability for intended operation

12 File system operation error

14 Command error during device call

15 Serial poll status byte lost

16 SRQ remains asserted

20 The return buffer is full

21 Address or board is locked

22 The ibnotify Callback failed to rearm

23 The input handle is invalid

26 Wait already in progress on input ud

27 The event notification was cancelled due to a reset of the interface

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIB: Error Code
(Only available with GPIB & CANoe!)

28 CANoe spec.: no GPIB Bus available

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: GPIB: Status
(Only available with GPIB & CANoe!)

GPIB: Status
(Only available with GPIB & CANoe!)
CAPL Function Overview » GPIB » Status

Status Word

Contains the status bits of the current bus/device situation.


Integer, 2 Bytes

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

ERR TIMO END SRQI RQS — — CMPL LOK REM CIC ATN TACS LACS DTAS DCAS

Explanation

ERR Error detected

TIMO Timeout

END EOI or EOS detected

SRQI SRQ detected by CIC

RQS Device needs service

CMPL I/O completed

LOK Local lockout state

REM Remote state

CIC Controller-in-Charge

ATN Attention asserted

TACS Talker active

LACS Listener active

DTAS Device trigger state

DCAS Device clear state

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Obsolete CAPL Functions


CAPL Function Overview » Obsolete CAPL Functions

All obsolete functions are marked with .

Functions those were canceled/renamed

Functions Short description

beep Tone output.

checkSignalInRangeByTxNode Checks the signal value against a condition.

fileReadArray Searches for a variable entry in a file section.

fileReadFloat

fileReadInt

fileReadString

fileWriteFloat Opens a file, finds a special section and writes the variable entry with a
special value.
fileWriteInt

fileWriteString

getSignalByTxNode Gets the value of a signal.

getSignalTimeByTxNode Gets the time point relative to the measurement start at which the signal
was last sent on the bus.

inport Reads a byte from the specified parallel port.

inportLPT

outport Writes a byte to the specified parallel port.

outportLPT

RegisterSignalDriverByTxNode Registers the given callback as a 'signal driver' for the signal.

SetSignalByTxNode Sets the transmitted signal to the accompanying value.

SysGetVariableIntArray Returns the value of a variable of the int[] type.

SysSetVariableIntArray Sets the value of a variable of the int[] type.

CAN Bus Statistics

Functions Short description

canGetBusLoad Returns the current busload.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetChipState Returns the current chip state.

canGetErrorCount Returns the number of error frames.

canGetErrorRate Returns the current rate of CAN error messages.

canGetExtData Returns the number of extended CAN frames.

canGetExtDataRate Returns the current rate of extended CAN frames.

canGetExtRemote Returns the number of extended remote CAN messages.

canGetExtRemoteRate Returns the current rate of extended remote CAN messages.

canGetOverloadCount Returns the number of CAN overload frames.

canGetOverloadRate Returns the current rate of CAN overload frames.

canGetPeakLoad Returns the peakload.

canGetRxErrorCount Returns the current error count.

canGetStdData Returns the number of standard CAN frames.

canGetStdDataRate Returns the current rate of standard CAN frames.

canGetStdRemote Returns the number of standard remote CAN frames.

canGetStdRemoteRate Returns the current rate of standard remote CAN frames.

canGetTxErrorCount Returns the current number of errors.

Diagnostics

Functions Short description

DiagGetParameterSize Returns the size of a parameter in bits.

FlexRay

Functions Short description

FlexRayRcvV6Frame A function defined in CAPL with this signature receives all FlexRay
messages.

FlexRayRcvV6StartCycle A function defined in CAPL with this signature receives all FlexRay
StartCycle events.

FrSendMsg Generates a FlexRay message and sends it to the hardware.

FrSendV6Frame

FrSendV6Msg

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSetSendMsg Configures the hardware for sending the specified message.

FrSetSendV6Frame

FrSetSendV6Msg

FRSSetDistMode Configures the disturbance type.

FRStress

Functions Short description

FRSSetDistMode Configures the disturbance type.

LIN

Functions Short description

getChecksum Returns the currently set checksum of a LIN message or LIN checksum
error.

linCalcChecksum Calculates the correct checksum for the transferred data.

linCalcCRC Calculates the correct checksum for the passed data.

linInitBegin Starts the CAPL controlled LIN initialization procedure.

linInitEnd Terminates the LIN initialization procedure and starts transmission of


initialization data to the hardware.

linInitGetRs232Baud Returns the current transmission speed of the RS232 port to the hardware.

linInitSetBaseBaud Sets the transmission speed in baud on the LIN bus.

linInitSetMaster Activates or deactivates the Master mode and the terminating resistor on
the LIN hardware.

linMrSchedGetMode Returns the current Scheduler mode.

linMrSchedSetGlobal Configures the basic parameters of the Scheduler.

linMrSchedSetMode Switches the Scheduler to a mode.

linMrSchedSetRqId Creates an entry for the Scheduler.

linMrSchedSetSyncT Configures the synchronization timing.

linMrSendRequest Sends a transmit request on the LIN bus for the specified LIN message
identifer.

linRcvFrame A function defined in CAPL with this signature receives all LIN frames that
are occurring on the bus and are not filtered out by a global message filter.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSetDlc Initializes the Data Length Code of a LIN frame.

linSetHeaderError Sets invalid parameters in a transmitted LIN header.

linSetResponseData Sets the response data for a transmit request.

linSetResponseMsg Sets the response data for a transmit request.

linSleepModeEvent Is called whenever a SleepModeEvent is received.

linSlFSMSetGlobal Sets the number of states.

linSlFSMSetState Switches the Slave to the state.

linSlFSMSetStBegin Prepares the configuration of the state.

linSlFSMSetStEnd Ends the configuration of the state.

linSlFSMSetStMFUp Sets up a comparison operation for the state of the Slave.

linSlFSMSetStSFUp Causes the Slave to respond to the transmit request for the message.

linSlFSMSetStTO Sets a timeout for the state specified by the Slave.

linSlSimulate Activates the Slave with the passed identifier for simulation.

linWakeupFrame Is called whenever a Wakeup frame is recognized.

resetManualChecksum Turns the correct checksum back on for a LIN message.

setManualChecksum Sets a checksum for a LIN message.

MOST

Functions Short description

MostGetLight Gets the Ring state.

MostSetLight Sets the Ring state.

MostGetOptoMode Returns the operation mode of the Optolyzer connected to the given
channel.

MostSetOptoMode Sets the operation mode of the Optolyzer to the specified value.

MostGetFBlockID Returns the FBlockID of the message.

MostGetFunctionID Returns the FunctionID of the message.

MostGetOpType Returns the OpType of the message.

MostSetFBlockID Sets the FBlockID of the message.

MostSetFunctionID Sets the FunctionD of the message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

MostSetOpType Sets the OpType of the message.

getThisMessage Copies the data of an AMS message into a message variable.

RS232

Functions Short description

RS232ByteCallback Handler will be called if a byte has been received.

RS232CloseHandle Closes serial port.

RS232EscapeCommExt Sets signal lines on all serial ports.

RS232EscapeCommFunc Sets signal lines on serial port.

RS232SetCommState Opens and configures serial port.

RS232WriteBlock Writes block of data to serial port.

RS232WriteByte Writes byte to serial port.

Test

Functions Short description

TestReportSetLoggingBlock This function annotates a logging file to a report.

testValidateSignalInRangeByTxNode Checks the signal value against a condition.

testValidateSignalOutsideRangeByTxNode

TestWaitForSignal Tests the availability of a specific signal.

TestWaitForSignals Tests the availability of all send signals of a node.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

beep
CAPL Function Overview » Obsolete » beep

Obsolete function

Replaced by msgBeep

Syntax void beep(int freq, int duration);

Function Tone output. In the Windows Version the parameter duration has no effect.

Parameters freq

Integer for tone pitch.

In the Windows version, the parameters freq defines the tone output. Different sounds
are defined in the section [SOUND] in the file WIN.INI:

freq 0x0000 (SystemDefault)

freq 0x0010 (SystemHand)

freq 0x0020 (SystemQuestion)

freq 0x0030 (SystemExclamation)

freq 0x0040 (SystemAsterisk)

freq 0xFFFF Standard Beep

Info

Windows always generates the same system beep, if you have no sound card
installed on your PC. In this case, the parameter freq has no effect.

duration

integer for tone length

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

2.5 — • •

Example
void sound() {
// with sound card: 400 Hz tone / 500ms long
// without sound card: Default signal tone
beep (400,500);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetChipState
CAPL Function Overview » Obsolete » canGetChipState

Obsolete function

Replaced by ChipState.

Syntax long canGetChipState (long channel)

Function Returns the current chip state of the specified CAN controller.

Parameters channel

CAN channel.

Return values Chip state of the specified CAN controller. See the following table for a description of the
return values.

0 Value not available

1 Simulated

3 Error Active

4 Warning Level

5 Error Passive

6 Bus Off

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetErrorCount
CAPL Function Overview » Obsolete » canGetErrorCount

Obsolete function

Replaced by ErrorFrameCount.

Syntax long canGetErrorCount (long channel)

Function Returns the number of error frames on the specified channel since start of measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of error frames on the specified channel since start of measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetErrorRate
CAPL Function Overview » Obsolete » canGetErrorRate

Obsolete function

Replaced by ErrorFrameRate.

Syntax long canGetErrorRate(long channel)

Function Returns the current rate of CAN error messages of the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current Rate of CAN error messages on the specified channel in messages per second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetExtData
CAPL Function Overview » Obsolete » canGetExtData

Obsolete function

Replaced by ExtendedFrameCount.

Syntax long canGetExtData (long channel)

Function Returns the number of extended CAN frames on the specified channel since start of
measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of extended CAN frames on the specified channel since start of measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetExtDataRate
CAPL Function Overview » Obsolete » canGetExtDataRate

Obsolete function

Replaced by ExtendedFrameRate.

Syntax long canGetExtDataRate(long channel)

Function Returns the current rate of extended CAN frames on the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current rate of extended CAN frames on the specified channel in messages per second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetExtRemote
CAPL Function Overview » Obsolete » canGetExtRemote

Obsolete function

Replaced by ExtendedRemoteFrameCount.

Syntax long canGetExtRemote (long channel)

Function Returns the number of extended remote CAN messages on the specified channel since
start of measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of extended remote CAN messages on the specified channel since start of
measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetExtRemoteRate
CAPL Function Overview » Obsolete » canGetExtRemoteRate

Obsolete function

Replaced by ExtendedRemoteFrameRate.

Syntax long canGetExtRemoteRate (long channel)

Function Returns the current rate of extended remote CAN messages on the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current rate of extended remote CAN messages on the specified channel in frames per
second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetOverloadCount
CAPL Function Overview » Obsolete » canGetOverloadCount

Obsolete function

Replaced by OverloadFrameCount.

Syntax long canGetOverloadCount (long channel)

Function Returns the number of CAN overload frames on the specified channel since start of
measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of CAN overload frames on the specified channel since start of measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetOverloadRate
CAPL Function Overview » Obsolete » canGetOverloadRate

Obsolete function

Replaced by OverloadFrameRate.

Syntax long canGetOverloadRate (long channel)

Function Returns the current rate of CAN overload frames on the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current rate of CAN overload frames on the specified channel in messages per second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetPeakLoad
CAPL Function Overview » Obsolete » canGetPeakLoad

Obsolete function

Replaced by PeakLoad.

Syntax long canGetPeakLoad (long channel)

Function Returns the peakload of the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Peakload of the specified channel in percent.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetRxErrorCount
CAPL Function Overview » Obsolete » canGetRxErrorCount

Obsolete function

Replaced by RxChipErrorCount.

Syntax long canGetRxErrorCount (long channel)

Function Returns the current RX error count in the receiver of the specified CAN channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current error count in the receiver of the specified CAN channel.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetStdData
CAPL Function Overview » Obsolete » canGetStdData

Obsolete function

Replaced by StandardFrameCount.

Syntax long canGetStdData (long channel)

Function Returns the number of standard CAN frames on the specified channel since start of
measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of standard CAN frames on the specified channel since start of measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetStdDataRate
CAPL Function Overview » Obsolete » canGetStdDataRate

Obsolete function

Replaced by StandardFrameRate.

Syntax long canGetStdDataRate (long channel)

Function Returns the current rate of standard CAN frames on the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current rate of standard CAN frames on the specified channel in messages per second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetStdRemote
CAPL Function Overview » Obsolete » canGetStdRemote

Obsolete function

Replaced by StandardRemoteFrameCount.

Syntax long canGetStdRemote (long channel)

Function Returns the number of standard remote CAN frames on the specified channel since start
of measurement.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Number of standard remote CAN frames on the specified channel since start of
measurement.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetStdRemoteRate
CAPL Function Overview » Obsolete » canGetStdRemoteRate

Obsolete function

Replaced by StandardRemoteFrameRate.

Syntax long canGetStdRemoteRate (long channel)

Function Returns the current rate of standard remote CAN frames of the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current rate of standard remote CAN frames of the specified channel in messages per
second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetTxErrorCount
CAPL Function Overview » Obsolete » canGetTxErrorCount

Obsolete function

Replaced by TxChipErrorCount.

Syntax long canGetTxErrorCount (long channel)

Function Returns the current number of TX errors in the CAN receiver of the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current number of errors in the CAN receiver of the specified channel.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 CAN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

checkSignalInRangeByTxNode
CAPL Function Overview » Obsolete » checkSignalInRangeByTxNode

Obsolete function

This function replaces the function checkSignalInRangeGM.

Version 7.1: Replaced by checkSignalInRange.

Syntax long checkSignalInRangeByTxNode (dbSignal aSignal, dbNode aTxNode, float


aLowLimit, float aHighLimit);

Function Checks the signal value against the condition:

aLowLimit <= Value <= aHighLimit

Parameters aSignal

The signal to be polled

aTxNode

Send node of the message whose signal should be polled

aLowLimit

Lower limit of the signal value

aHighLimit

Upper limit of the signal value

Return values 1: If the condition is TRUE

0: If the condition is violated or the signal is unavailable, i.e. was not on the bus yet

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

DiagGetParameterSize
CAPL Function Overview » Obsolete » DiagGetParameterSize

Obsolete function

This function should not longer be used, use DiagGetParameterSizeCoded and


DiagGetParameterSizeRaw.

Syntax long DiagGetParameterSize (diagResponse obj, char parameterName[])

long DiagGetParameterSize (diagRequest obj, char parameterName[])

Method diagResponse.GetParameterSize (char parameterName[])

diagRequest.GetParameterSize (char parameterName[])

Function Returns the size of a parameter in bits.

Parameters obj

Diagnostics object

parameterName

Parameter qualifier

Return values Error code

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileReadArray
CAPL Function Overview » Obsolete » fileReadArray

Obsolete function

Replaced by getProfileArray

Syntax long fileReadArray(char section[], char entry[], char buffer[], long


bufferlen, char file[]);

Function Searches for the variable entry in the section section of the file file. Its contents are
interpreted as a list of byte values. The number format is decimal or with the prefix 0x it
is hexadecimal. Numbers are separated by spaces, tabs, a comma, semi-colon or slash.
The buffer is filled up to a quantity of bufferlen bytes.

Parameters section

Section of file

entry

Name of variable

buffer

buffer for characters to be read

bufferlen

Size of buffer in byte

filename

Name of file

Return values Number of characters read.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
File TEST.INI:
[DATA]
FIELD=1,2,3,0x20,100
...
int len;
char buf[20];
len = fileReadArray("DATA", "FIELD", buf, elCount(buf), "TEST.INI");
...

Result:

len = 5. The array buf is filled with the values 1,2,3,32,100.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileReadFloat
CAPL Function Overview » Obsolete » fileReadFloat

Obsolete function

Replaced by getProfileFloat

Syntax float fileReadFloat(char section[], char entry[], float def, char ile);

Function Analogous to fileReadInt for floats.

Parameters section

Section of file

entry

Name of variable

def

Value

file

Name of file

Return values Number of characters read.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
File TEST.INI:
[DATA]
FIELD=1,2,3,0x20,100
..
int len;
char buf[20];
len = fileReadArray("DATA", "FIELD", buf, elCount(buf), "TEST.INI");
...

Result:

len = 5. The array buf is filled with the values 1,2,3,32,100.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileReadInt
CAPL Function Overview » Obsolete » fileReadInt

Obsolete function

Replaced by getProfileInt

Syntax long fileReadInt(char section[], char entry[], long def, char file[]);

Function Searches for the variable entry in the section section of the file filename. If its value is a
number, this number is returned as the functional result. If the file or entry is not found,
or if entry does not contain a valid number, the default value def is returned as the
functional result.

Parameters section

Section of file

entry

Name of variable

def

Value

file

Name of file

Return values Integer read

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
File TEST.INI:
[DATA]
NAME=Feld
ADDR=200
FIELD=1,2,3,0x20,100
...
myAddress=fileReadInt("DATA", "ADDR", 0, "TEST.INI");
...

Result:

The value 200 is assigned to the variable myAddress. If the entry ADDR does not exist in
the file TEST.INI the default value 0 is assigned to myAddress.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileReadString
CAPL Function Overview » Obsolete » fileReadString

Obsolete function

Replaced by getProfileString

Syntax long fileReadString(char section[], char entry[], char def[], char


buffer[], long bufferlen, char filename[]);

Function Searches for the variable entry in the section section of the file filename. Its content
(value) is written to the buffer buffer. Its length must be passed correctly to bufferlen. If
the file or entry is not found, the default value def is copied to buffer.

Parameters section

Section of file

entry

Name of variable

def

Value

buffer

Buffer for characters to be read

bufferlen

Size of buffer in byte

filename

Name of file

Return values Number of bytes read

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
ile TEST.INI:
[DATA]
NAME=Feld
ADDR=200
FIELD=1,2,3,0x20,100
...
int len;
char buf[20];
fileReadString("DATA", "NAME", "DefaultString", buf, elCount(buf),
"TEST.INI");
...

Result:

buf is filled with the characters "Feld".

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileWriteFloat
CAPL Function Overview » Obsolete » fileWriteFloat

Obsolete function

Replaced by writeProfileFloat

Syntax long fileWriteFloat(char section[], char entry[], float def, char file[]);

Function Analogous to fileWriteInt, but writes a float variable to the file instead of a text.

Parameters section

Section of file

entry

Name of variable

def

Value

file

Name of file

Return values 0 if an error has occurred else 1

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
...
if(!fileWriteInt("DeviceData","DeviceAddr",2.2, "TEST.INI"))
write("file error");
...
This call writes the following entry in the file TEST.INI:
[DeviceData]
DeviceAddr=2.2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileWriteInt
CAPL Function Overview » Obsolete » fileWriteInt

Obsolete function

Replaced by writeProfileInt

Syntax long fileWriteInt(char section[], char entry[], long def, char file[]);

Function Analogous to fileWriteString, but writes a long variable to the file instead of a text.

Parameters section

Section of file

entry

Name of variable

def

Value

file

Name of file

Return values 0 if an error has occurred else 1

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
...
if(!fileWriteInt("DeviceData","DeviceAddr",2, "TEST.INI"))
write("file error");
...
This call writes the following entry in the file TEST.INI:
[DeviceData]
DeviceAddr=2

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

fileWriteString
CAPL Function Overview » Obsolete » fileWriteString

Obsolete function

Replaced by writeProfileString

Syntax long fileWriteString(char section[], char entry[], char value[], char


filename[]);

Function Opens the file filename, finds the section section and writes the variable entry with the
value value. If entry already exists, the old value is overwritten. The functional result is
the number of characters written, or 0 for an error.

Parameters section

Section of file

entry

Name of variable

value

filename

Name of file

Return values Number of written characters of 0 if an error has occurred.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 — • •

Example
...
if(!fileWriteString("Device","DeviceName","LPT1","test.ini"))
write("file error");
...
This call writes the following entry in the file TEST.INI:
[Device]
DeviceName=LPT1

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FlexRayRcvV6Frame
CAPL Function Overview » Obsolete » FlexRayRcvV6Frame

Obsolete function

This callback is obsolete and has been replaced by on FrFrame

Syntax FlexRayRcvV6Frame( long msgTime, word channel, word frameID, byte cycle,
byte len, byte data[], int sync, int NMIndication, int ReservedFlag, word
headerCRC, word status, int rcv )

Function A function defined in CAPL with this signature receives all FlexRay messages.

Parameters msgTime

Time stamp of the FlexRay message.

channel

Channel of the send message


Value: 1 or 2.

frameID

Identifier of message to be sent, identifies the time window.

cycle

Current cycle.

len

Number of data bytes (Maximum 64 bytes).

data[]

Data bytes.

sync

Sync Flag.
Indicates whether this message is used for time synchronization.

NMIndication

Network Management Bit.


When this bit is set the first two data bytes contain the local NM vector.

ReservedFlag

headerCRC

Checksum of the header.

status

Status field of the message.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

rcv

Send direction:

1 Tx

0 Rx

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.1 FlexRay • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FlexRayRcvV6StartCycle
CAPL Function Overview » Obsolete » FlexRayRcvV6StartCycle

Obsolete function

This callback is deprecatedand has been replaced by on FrStartCycle

Note

This function is not used with the BusDoctor.

Syntax FlexRayRcvV6StartCycle(long msgTime, byte nmlen, byte nmdata[])

Function A function defined in CAPL with this signature receives all FlexRay StartCycle events.
The event is generated at the beginning of a communication cycle.
It contains the NM vector that is valid for this round.

Parameters msgTime

Time stamp of the FlexRay message.

nmlen

Length of the NM vector.

Nmdata[]

Network Management vector.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.1 FlexRay • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSendMsg
CAPL Function Overview » Obsolete » FrSendMsg

Obsolete function

Use function FRUpdateStatFrame or FROutputDynFrame instead

Syntax FrSendMsg ( class VIMessage* const message, unsigned int channel, unsigned
char dataBytes[] )

Function This function generates a FlexRay frame and places it in the appropriate Tx register of the
xModule/PC104.

The xModule/PC104 sends the frame at the next possible transmission time.

Parameters message

Database message to be transmitted.

channel

Channel over which transmission should occur.

dataBytes []

Data bytes that should be sent.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

FlexRay — •

Example
variables
{
message Identifier_01 msg_01;
int gChannel_2 = 2 ;
int gId_02 = 2 ;
int gMux = 1 ;
int gNoSync = 0 ;
int gLen_Id2 = 4;
Byte gData2a[12] =
{0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c};
Byte gData1a[12] =
{0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c};
}
on key 'z'
{
FrSendFrame(gId_02, gNoMux, gChannel_2, gNoSync, gLen_Id2, gData2a, -1
);
FrSendMsg (msg_01, gChannel_2, gData1a );
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSendV6Frame
CAPL Function Overview » Obsolete » FrSendV6Frame

Obsolete function

Use function FRUpdateStatFrame or FROutputDynFrame instead

Syntax FrSendV6Frame( int frameId, int channel, int sync, int len, dataBytes [],
int nmIndication, int sendcounter );

Function This function generates a FlexRay message and sends it to the hardware.
The hardware transmits the message at the next possible time point.

Parameters frameId

Identifier of message to be sent; refers to the time window.

channel

Channel of the send message.


Value: 1 or 2.

sync

Sync Flag.
Indicates whether this message is used for time synchronization.

len

Number of data bytes (Maximum 64 Bytes).

databytes[]

Data bytes.

nmIndication

Network Management Bit.


When this bit is set the first two data bytes contain the local NM vector.

sendcounter

Describes the number of messages to be sent.

-1 unlimited

n Number of messages

0 Stops send operation

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

FlexRay — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSendV6Msg
CAPL Function Overview » Obsolete » FrSendV6Msg

Obsolete function

Use function FRUpdateStatFrame or FROutputDynFrame instead

Syntax FrSendV6Msg( VIMessage * const message, int channel, BYTE dataBytes [], int
nmIndication, int sendcounter );

Function This function generates a FlexRay message and sends it to the hardware. The hardware
transmits the message at the next available time point. The symbolic name from the
database is used to activate message parameters.

Parameters message

Identifier of the message to be sent.


Refers to the time window.

channel

Channel of the send message


Value: 1 or 2.

databytes[]

Data bytes

nmIndication

Network Management Bit.


When this bit is set the first two data bytes contain the local NM vector.

sendcounter

Describes the number of messages to be sent.

-1 Unlimited

n Number of messages

0 Stops send operation

Return values

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 FlexRay • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSetSendMsg
CAPL Function Overview » Obsolete » FrSetSendMsg

Obsolete function

Use function FRSetSendFrame instead

Syntax FrSetSendMsg ( class VIMessage* const message, unsigned int channel )

Function Frames to be transmitted by the xModule/PC104 must first be registered in the Service
Module.

The message can be selected via the associated databases.

The registration must occur in the OnPreStart routine in the Tx branch.

Parameters message

Identifies the message selected from the database.

channel

Channel over which the message should be transmitted.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 4.1 FlexRay — •

Example
variables
{
message Identifier_01 msg_01;
int gChannel_2 = 2;
int gId_02 = 2;
int gMux = 1;
int gNoSync = 0;
int gLen_Id2 = 4;
Byte gData2a[12] =
{0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c};
Byte gData1a[12] =
{0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c};
}
on key 'z'
{
FrSendFrame(gId_02, gNoMux, gChannel_2, gNoSync, gLen_Id2, gData2a, -1
);
FrSendMsg (msg_01, gChannel_2, gData1a );
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSetSendV6Frame
CAPL Function Overview » Obsolete » FrSetSendV6Frame

Obsolete function

Use function FRSetSendFrame instead

Note

This function may only be used in the Tx branch!

You should use this function if no database is available.


If a database is available you can work with symbolic values.
In this case you can also use the function FrSetSendV6Msg.

When using the BusDoctor this function is not necessary and is ignored.

Syntax FrSetSendV6Frame( int frameId, int channel, int sync, int len, int
nmIndication );

Function Configures the hardware for sending the specified message.

The registration must occur in the OnPreStart routine in the Tx branch.

Parameters frameId

Identifier of the message to be sent, refers to the time window.

channel

Channel of the send message.


Value: 1 or 2.

sync

Sync Flag.
Indicates whether this message is used for time synchronization.

len

Number of data bytes (Maximum 64 bytes).

nmIndication

Network Management Bit (NM bit).


When this bit is set the first two data bytes contain the local NM vector.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.1 FlexRay — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FrSetSendV6Msg
CAPL Function Overview » Obsolete » FrSetSendV6Msg

Obsolete function

Use function FRSetSendFrame instead

Note

This function may only be used in the Tx branch!

You should use this function if a database is available and you can therefore work with
symbolic values.
If no database is available you cannot work with symbolic values.
In this case you must use the function FrSetSendV6Frame.

When using the BusDoctor this function is not necessary and is ignored.

Syntax FrSetSendV6Msg( message msg, int channel, int nmIndication );

Function Configures the hardware for sending the specified message.


This involves using the symbolic message name to assume the following information from
the database: Message ID, Sync flag and the number of data bytes.

The registration must occur in the OnPreStart routine in the Tx branch.

Parameters msg

Variable of type message.

channel

Channel of the send message.


Value: 1 or 2.

nmIndication

Network Management Bit.


When this bit is set the first two data bytes contain the local NM vector.

Return values

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 FlexRay — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

FRSSetDistMode
CAPL Function Overview » Obsolete » FRSSetDistMode

Obsolete function

Note

The function is only supported with an installed FRstress.

The function must be called before FRSStart.

Syntax long FRSSetDistMode (int triggerCondition, int mode);

Function Sets the disturbance type. A bitstream disturbance generates the disturbance sequence
after the trigger is detected. The frame disturbance changes individual bits within a
frame with bit accuracy.

Parameters triggerCondition

Values: 1-4

mode

Values:

1=Bitstream disturbance (analog & digital mode), the disturbance is configured using
FRSSetBitstreamDist.
2=Frame disturbance (only digital mode), the disturbance is configured using
FRSSetFrmDistElem, FRSSetFrmDist and FRSSetDistPayload.

Return values 0: successful

-1: in case of error

Availability Up to Version Restricted to Measurement Setup Simulation / Test


Setup

7.6 SP4 • FlexRay — •


• Digital, analog mode
• Test nodes

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

canGetBusLoad
CAPL Function Overview » Obsolete » canGetBusLoad

Obsolete function

Replaced by BusLoad.

Syntax long canGetBusLoad (long channel)

Function Returns the current busload of the specified channel.

Parameters channel

CAN channel.

Vector API driver Values 1 ... 32

Softing API driver Values 1, 2

Return values Current busload of the specified channel in percent.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

getChecksum
CAPL Function Overview » Obsolete » getChecksum

Obsolete function

The name of this function is obsolete and has been replaced by linGetChecksum

Syntax int getChecksum(linMessage msg)

int getChecksum(linCSError error)

Function Returns the currently set checksum of a LIN message or LIN checksum error.

In the case of a LIN message, the correct value derived from the message data is returned
by default, even after the message data has been modified. The user can, however set a
deviating value with setManualChecksum to generate checksum errors on the LIN bus. This
value is then constant and will not be affected by changes in the message data. To turn
off this behavior for a given message, the user must call resetManualChecksum.

Parameters msg

LIN message for which the checksum will be queried.

error

The LIN checksum error for which the checksum will be queried.

Return values Calculated checksum.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 - 5.1 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

getSignalByTxNode
CAPL Function Overview » Obsolete » getSignalByTxNode

Obsolete function

This function replaces the function getSignalGM.

Version 7.1: Replaced by getSignal.

Syntax float getSignalByTxNode (dbSignal aSignal, dbNode aTxNode);

Function Gets the value of a signal.

Parameters aSignal

The signal to be polled.

aTxNode

Send node of the message whose signal should be polled.

Return values Value of the signal or 0 if the signal was not on the bus yet.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

getSignalTimeByTxNode
CAPL Function Overview » Obsolete » getSignalTimeByTxNode

Obsolete function

This function replaces the function getSignalTimeGM.

Version 7.1: Replaced by getSignalTime.

Syntax dword getSignalTimeByTxNode (dbSignal aSignal, dbNode aTxNode);

Function Gets the time point relative to the measurement start at which the signal was last sent on
the bus.

Parameters aSignal

The signal to be polled.

aTxNode

Send node of the message whose signal should be polled.

Return values Time point or 0 if the signal was not sent yet.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

inport
CAPL Function Overview » Obsolete » inport

Obsolete function

The Parallel Port is only supported with Windows XP 32 bit.

For simple control applications you can use the IOcab, the IOpiggy or a simple
measurement hardware, e.g. the Meilhaus-RedLab series or an appropriate NI card.

Note

Before you can use the CAPL functions outport, inport(), outportLPT and inportLPT, you
must install the generic I/O port driver for Windows. You will find this driver and its
description (ReadMe.Txt) in the directory Exec32\GpIoDrv.

For more information please contact the Vector Support.

Vector Informatik GmbH - Support

Our business hours are Monday to Friday from 9:00 am to 5:00 pm (CET):

• Phone: +49.711.80670.200
• Fax: +49.711.80670.111
• E-Mail: support@vector.com
• Online Report Form:
https://www.vector.com/vi_problem_report_en.html

Syntax byte inport( word addr);

Function Reads a byte from the specified port. If you want to read from a parallel port the port has
to be in a bi-directional mode (PS/2 or "Byte" Modus). Please check this in the CMOS setup
(BIOS).

Parameters Port address or a predefined LPTx constant.

Symbolic assignment:

LPT1 -> 0x378

LPT2 -> 0x278

LPT3 -> 0x3BC

The LPT constant could not be used in arithmetic expression!

The following expression is inadmissible:


// Read the parallel port control registers
byte ctrl;
ctrl = inport( LPT1 + 2);

Please write:
word addr = 0x378;
byte ctrl;
// Read the parallel port control registers
ctrl = inport( addr + 2);

Return values Byte that was read in.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Example
// This example reads some bytes from LPT1
// The LPT port is first changed to input if necessary.
word addr = 0x378;
byte ctrl;
byte b;
// Read the parallel port control registers
ctrl = inport( addr + 2);
if ( ( ctrl & 0x20) == 0)
{
// Output mode is active -> change
ctrl |= 0x20;
outport( addr + 2, ctrl);
// Check
ctrl = inport( addr + 2);
if ( ( ctrl & 0x20) == 0)
{
// Error!!!
write( "Parallel port (0x%x) could not be changed to input mode!!!", addr);
return;
}
}
b = inport( addr);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

inportLPT
CAPL Function Overview » Obsolete » inportLPT

Obsolete function

Replaced by inport

Before you can use the CAPL functions outport, inport, outportLPT and inportLPT, you
must install the generic I/O port driver for Windows. You will find this driver and its
description (ReadMe.Txt) in the directory Exec32\GpIoDrv.

Syntax byte inportLPT( word addr);

Function Reads a byte from the specified parallel port. This function changes the transmission
mode of the parallel port automatically to input. If you want to read from a parallel port
the port has to be in a bi-directional mode (PS/2 or "Byte" Modus). Please check this in
the CMOS setup (BIOS).

Parameters Port address or a predefined LPTx constant.

Symbolic assignment:

LPT1 -> 0x378

LPT2 -> 0x278

LPT3 -> 0x3BC

Return values Byte that was read in

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 — • •

Example
// This example reads a character from LPT1.
// The mode of LPT1 is set automatically.

byte b;

b = inportLPT( LPT1);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linCalcChecksum
CAPL Function Overview » Obsolete » linCalcChecksum

Obsolete function

Replaces linCalcCRC

Syntax unsigned int linCalcChecksum (unsigned long numberOfDataBytes, unsigned


char dataBytes[]);

Function Calculates the correct checksum for the transferred data.

Parameters numberOfDataBytes

The number of valid bytes to be taken into consideration in the following data field.

dataBytes

The data bytes from which the checksum will be determined.

Return values Calculated checksum.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 - 5.1 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linCalcCRC
CAPL Function Overview » Obsolete » linCalcCRC

Obsolete function

Replaced by linCalcChecksum

Syntax unsigned int linCalcCRC(unsigned long numberOfDataBytes, unsigned char


dataBytes[]);

Function Calculates the correct checksum for the passed data.

Parameters numberOfDataBytes

Number of valid bytes to be considered in the data field that follows.

dataBytes

Data bytes over which the checksum should be determined.

Return values Calculated checksum.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linInitBegin
CAPL Function Overview » Obsolete » linInitBegin

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax long linInitBegin();

Function Starts the CAPL-controlled LIN initialization procedure.

After initialization has been completed linInitEnd() must be called.

Parameters —

Return values 0: Initialization is not possible.


In this case initialization should not be continued.

!=0: Call was successful

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linInitEnd
CAPL Function Overview » Obsolete » linInitEnd

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax long linInitEnd();

Function Terminates the LIN initialization procedure and starts transmission of initialization data to
the hardware.

After LINInitEnd() has been called it is not possible to execute another LIN initialization.

Parameters —

Return values !=0: Call was successful

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linInitGetRs232Baud
CAPL Function Overview » Obsolete » linInitGetRs232Baud

Obsolete function

No replacement

Syntax long linInitGetRs232Baud();

Function Returns the current transmission speed of the RS232 port to the hardware.

Parameters —

Return values Current transmission speed of the RS232 port in bits per second.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linInitSetBaseBaud
CAPL Function Overview » Obsolete » linInitSetBaseBaud

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linInitSetBaseBaud(long baudrate);

Function Sets the transmission speed in baud on the LIN bus. This overwrites the value from the LIN
database.

Parameters baudrate

Permitted are values from 0,2 - 20 kBaud.

The default value is 9600 Baud.

Baud rates < 1 kBaud are not LIN compliant.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linInitSetMaster
CAPL Function Overview » Obsolete » linInitSetMaster

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linInitSetMaster(long masterMode, long masterResistor)

Function This function activates or deactivates the Master mode and the terminating resistor on
the LIN hardware.

It is of particular significance to the LIN hardware whether an internal Master (a Master


modeled in the LIN hardware) or an external Master is used, since when an external
Master is used the LIN hardware synchronizes to its pulse, but with an internal master it
prescribes the pulse itself.

The default setting is to deactivate both of these parameters when no Master node is
modeled.

Parameters masterMode

This parameter specifies whether Master mode on the LIN hardware has to be enabled or
disabled.

0: Disable
1: Enable

masterResistor

This parameter specifies whether terminating resistor on the LIN hardware has to be
enabled or disabled.

0: Disable
1: Enable

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example
on linReceiveError
{
linInitSetMaster(1, 1); // manually activate Master mode on LIN hardware
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSchedGetMode
CAPL Function Overview » Obsolete » linMrSchedGetMode

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax unsigned int linMrSchedGetMode();

Function Returns the current Scheduler mode.

Parameters —

Return values Current SchedulerMode.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSchedSetGlobal
CAPL Function Overview » Obsolete » linMrSchedSetGlobal

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linMrSchedSetGlobal(unsigned int cycleTime, unsigned int


numberOfModes);

Function Configures the basic parameters of the Scheduler.

Parameters cycleTime

Frequency with which the Scheduler works through its task lists.
With a value of 0 it arranges the working steps directly after one another.
Entries are made in milliseconds.

numberOfModes

Number of individually configurable modes of the Scheduler.


A maximal of 256 modes are allowed.
During the measurement it is possible to switch between two modes with
linMrSchedSetMode.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSchedSetMode
CAPL Function Overview » Obsolete » linMrSchedSetMode

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linMrSchedSetMode(unsigned int mode);

Function Switches the Scheduler to the mode mode.

Parameters mode

Mode to be activated.
The highest mode is activated if mode is too large.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSchedSetRqId
CAPL Function Overview » Obsolete » linMrSchedSetRqId

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linMrSchedSetRqId (unsigned int requestId, unsigned long period,


unsigned char modeFlags[]);

Function Creates an entry for the Scheduler.

Info

linMrSchedSetRqId may only be called once for each LIN Message Identifier.
During a processing step of the Scheduler the outstanding transmit requests
are serviced in the order in which they were configured by
linMrSchedSetRqId.

Parameters requestId

LIN Message Identifier for which transmit requests should be placed.

period

Regulates the frequency of the request. The duration between two requests is the
period * cycle time of the Scheduler.

modeFlags

Bit field that must be large enough to take up a bit for each Scheduler mode.
The least significant bit of Byte 0 refers to Mode 0, the least significant bit of Byte 1
refers to Mode 8, etc.
One entry is made for each mode for which a corresponding flag is set.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSchedSetSyncT
CAPL Function Overview » Obsolete » linMrSchedSetSyncT

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linMrSchedSetSyncT(unsigned int syncBreakLength, unsigned int


syncDelimiterLength);

Function Configures the synchronization timing.

Parameters syncBreakLength

Length of the SyncBreak signal in bit times.


Values between 10 and 30 are permitted.

The default value is 18.

syncDelimiterLength

Length of the next SyncDelimiter in bit times.


Values between 1 and 30 are permitted.

The default value is 2.

To conform to the LIN specification the following conditions must also be satisfied:

• syncBreakLength >= 13 and


• syncBreakLength + syncDelimiterLength <= 29.

The configured values are only used when the LIN hardware is operating in Master mode.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linMrSendRequest
CAPL Function Overview » Obsolete » linMrSendRequest

Obsolete function

Replaced by the function output

Such a call is only meaningful while a measurement is running.


If no Slaves respond to a transmit request this leads to a LIN transmission error.

Syntax void linMrSendRequest(unsigned long requestId);

Function When Master mode is activated this function sends a transmit request on the LIN bus for
the specified LIN message identifer.

Parameters requestId

6 bit transmit identifier.

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linRcvFrame
CAPL Function Overview » Obsolete » linRcvFrame

Obsolete function

Replaced by the event procedure on linMessage

Syntax void linRcvFrame (long syncTimeStamp, long origTimeStamp, int msgId, int
frameDlc, int frameDir, int bytecount, byte data[])

Function A function defined in CAPL with the exact signature shown above receives all LIN frames
that are occurring on the bus and are not filtered out by a global message filter.

Parameters syncTimeStamp

Time stamp of the LIN frame that was synchronized with the global time basis in the PC
(CAN hardware or PC system clock).

Units: 10 microseconds.

This time stamp must be used if time relationships with events from other sources are to
be evaluated.
This time stamp is also output in the Trace window.

origTimeStamp

Time stamp generated by the LIN hardware.

Units: 10 microseconds.

In individual cases it may be advisable to use this unsynchronized - and therefore still
original - time stamp. However, its use is only meaningful for time comparisons between
two LIN hardware generated events.

msgId

6 bit identifier of the LIN frame.

frameDlc

DLC of the LIN frame (2, 4 or 8).

frameDir

Direction of the LIN frame:

frameDir == 0 LIN frame was only received by the LIN hardware

frameDir == 1 LIN frame was sent by the LIN hardware

bytecount

Number of valid data bytes (may be less than frameDlc in error situations).

data

Always 8 bytes long.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSetDlc
CAPL Function Overview » Obsolete » linSetDlc

Obsolete function

No replacement

Note

This function is only available with the LIN specification 1.2.

This function does not have any effect in the event procedure on preStart.

Syntax long linSetDlc(long frameID, long dlc)

Function Initializes the Data Length Code (i.e. length in bytes) of a LIN frame. This function must
be called in the event procedure on prestart. The DLC of each frame ID can only be
initialized once using this function.

To change the DLC of a LIN frame during the measurement, use the function
linChangeDlc().

Per default the DLC of LIN frames is initialized according to the LIN Description File (LDF).
This function is therefore only needed if you are simulating LIN nodes without using an
LDF.

Context Master or Slave node (in on preStart only)

Parameters frameID

LIN frame identifier in the range 0 ... 63.

DLC

Frame length in bytes in the range 1 ... 8

Return values If successful a value unequal to zero. Zero will be returned if for example the DLC has
already been set for the selected ID.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Set DLC of a LIN frame not defined in the database.


on preStart
{
...
linSetDLC(0x22, 5); // set DLC of frame with identifier 0x22 to be 5
...
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSetHeaderError
CAPL Function Overview » Obsolete » linSetHeaderError

Obsolete function

No replacement

Syntax dword linSetHeaderError(byte syncByte, byte idwithParity, byte


StopAfterError)

Function With this function it is possible to set invalid parameters in a transmitted LIN header.
These invalid parameters will be used until changed by another call to linSetHeaderError()
for the same identifier (specified by the lower 6 bits of idWithParity). Setting the correct
values with this function will of course disable all header errors for the specified id.

Info

This function will not be supported with the CANCard XLe.

If the LIN hardware is not in Master mode calling this function will have no
effect.

The invalid header is not reported on the transmitting channel. To get the
error notified an additional channel has to be configured and connected to
the transmitting channel.

Parameters syncByte

Data value to be sent in the Synch byte field.

Correct value is 0x55.

Value range: 0..0xFF

idwithParity

Data value to be sent in the Protected Identifier filed. The lower 6 bits specify the
identifier to be used. The upper 2 bits specify the identifier parity to be used.

The correct value can be calculated using linGetProtectedID() function.

Value range: 0..0xFF

StopAfterError

Specifies whether the transmission should be stopped after an error. If an incorrect synch
byte is set by this function and StopAfterError is 1, the identifier will not be sent. The
same is true for the message response (has to be activated independently) and an
incorrect parity.

Value range: 0..1

Return values On success, a value unequal to zero, otherwise zero.

Availability Since Version Restricted to Measurement Setup Simulation / Test


Setup

5.1 • LIN — •
• Real bus mode

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Example

// Force an error in header of LIN frame with ID=0x33 by setting wrong protected ID
on key 'h'
{
byte linID, protectedID, corParity, errParity, errPID;
// calculate protected ID with wrong parity bits
linID = 0x33; // use frame ID=0x33
protectedID = linGetProtectedID(linID); // get protected ID
corParity = (protectedID & 0xC0) >> 6; // extract parity (0xC=0=11000000)
errParity = (corParity ^ 0x2) & 0x3; // calculate wrong parity using
XOR
errPID = linID | (errParity << 6); // calculate PID with wrong parity
linSetHeaderError(0x55, errPID, 0);
}
...
or
...
// Force an error in header of LIN frame with ID=0x33 by setting wrong
Synch byte
linSetHeaderError(0x50, linGetProtectedID(0x33), 0);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSetResponseData
CAPL Function Overview » Obsolete » linSetResponseData

Obsolete function

Replaced by the function output

Syntax long linSetResponseData(int sendId, int dataLength, byte data[]);

long linSetResponseData(int sendId, int dlc, byte data[], byte checksum);

Function Sets the response data for a transmit request. The LIN hardware is instructed to respond
from now on to the transmit request sendID with the data data. The used data length
code is passed in dlc.

• If no DLC has been set by the data base, the DLC will be set by the dlc parameter of
the function.
• If the DLC already has been set by the data base, this value must be handover
correctly on every call of this function.

The functionality to set the DLC is only available with LIN specification 1.2 (or above)!

LIN specification 1.1 presets the DLC of an identifier.

DLC value range: 0…8 (bytes)When you use the first alternative of the syntax (see above),
the checksum is automatically generated correctly. When you use the second alternative
of the syntax (see above), you can set any checksum. If this function is called in the event
procedure on preStart then the LIN hardware is configured so that the response is made
to a suitable transmit request. During the measurement this method may only be called
for transmit identifiers that were already configured in the event procedure on preStart
or in the LIN database.

Parameters sendId

Transmit identifier to which this call refers.

dlc

DLC of the message

data

Data bytes which should be sent immediately upon a sendId requests.

checksum

Checksum that has to be used

Return values If a DLC has been set, a value unequal "0" will be returned.

If no DLC has been set, the value "0" will be returned.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 LIN — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSetResponseMsg
CAPL Function Overview » Obsolete » linSetResponseMsg

Obsolete function

Replaced by the function output

Syntax long linSetResponseData(message msg);

long linSetResponseMsg(message msg, byte checksum);

Function Sets the response data for a transmit request. The LIN hardware is instructed to
immediately respond to the transmit request with the same identifier as msg with the data
bytes of msg.

When you use the first alternative of the syntax (see above), the checksum is automatically
generated correctly.

When you use the second alternative of the syntax (see above), you can set any checksum.

If this function is called in the event procedure on preStart then the LIN hardware is
configured so that the response is made to a suitable transmit request. During the
measurement this method may only be called for transmit identifiers that were already
configured in the event procedure on preStart or in the LIN database.

Parameters msg

Pattern for the transmitting behavior of the LIN hardware. In the future, in response to the
transmit identifier that is defined by this message, the data bytes of this message will be
sent.
In general msg will be a message contained in the database created for LIN. This offers an
easy way to access the individual signal values.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.0 LIN — •

Example
message LinSlaveLeft sLinSlaveLeft;
sLinSlaveLeft.Angle = 50;
linSetResponseMsg(sLinSlaveLeft);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSleepModeEvent
CAPL Function Overview » Obsolete » linSleepModeEvent

Obsolete function

Replaced by the event procedure on linSleepModeEvent

Syntax void linSleepModeEvent(long syncTimeStamp, long origTimeStamp, int


wasAwake, int isAwake, int externalCause, int reason)

Function Is called whenever a SleepModeEvent (not SleepModeFrame) is received. The time stamps
are the same as by LINRcvFrame.

Parameters wasAwake

If this flag is set, the LIN hardware was active before the Event occurred.
If not, the LIN hardware was in Sleep mode before the Event occurred.

isAwake

If this flag is set, the LIN hardware's present state is active.


If not, the LIN hardware's present state is Sleep mode.

externalCause

If this flag is set, the Event is caused by an external event (e.g. SleepModeFrame,
WakeupFrame or bus traffic).
If not, the Event is caused by an internal event (e.g. SleepModeFrame, WakeupFrame,
SilentSleepMode command or BusIdle timeout).

reason

This value returns the cause of the Event. One of the following values can be returned.

General values:

0 Start state

Values while switching to Sleep mode:

1 SleepModeFrame

2 BusIdle timeout

3 "silent SleepMode" command (to reduce the BusIdle timeout)

Values while leaving the Sleep mode:

9 External Wakeup signal

10 Internal Wakeup signal

11 Bus traffic (only occurs while the LIN hardware is not the Master)

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Values, if the LIN hardware does not switch to Sleep mode in spite of a request:

18 Bus traffic (only occurs while the LIN hardware is not the Master)

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetGlobal
CAPL Function Overview » Obsolete » linSlFSMSetGlobal

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linSlFSMSetGlobal(unsigned int slaveId, unsigned int numberOfStates);

Function Sets the number of states given in numberOfStates for the Slave with identifier slaveId.

This function must be called before the Slave's states are configured.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId, that was defined with
linSlSimulate.

numberOfStates

Number of states that the Finite State Machine (FSM) which implements the Slave should
have.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetState
CAPL Function Overview » Obsolete » linSlFSMSetState

Obsolete function

No replacement

Note

This function does not have any effect in the event procedure on preStart. A Slave always
starts in the 0 state.

Syntax void linSlFSMSetState(unsigned int slaveId, unsigned int stateId);

Function Switches the Slave with identifier slaveId to the state stateId.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId, that was defined with
linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range that
was defined by linSlFSMSetGlobal.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetStBegin
CAPL Function Overview » Obsolete » linSlFSMSetStBegin

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linSlFSMSetStBegin(unsigned int slaveId, unsigned int stateId);

Function Prepares the configuration of the state specified by stateId of the Slave with the
identifier slaveId.

The entire configuration of a state must appear within one linSlFSMSetStBegin /


linSlFSMSetStEnd pair.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId that was defined with
linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range that
was defined by linSlFSMSetGlobal.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetStEnd
CAPL Function Overview » Obsolete » linSlFSMSetStEnd

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linSlFSMSetStEnd(unsigned int slaveId, unsigned int stateId);

Function Ends the configuration of the state specified by stateId of the Slave with the identifier
slaveId.

The entire configuration of a state must appear within a linSlFSMSetStBegin /


linSlFSMSetStEnd pair.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId, that was defined with
linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range that
was defined by linSlFSMSetGlobal.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetStMFUp
CAPL Function Overview » Obsolete » linSlFSMSetStMFUp

Obsolete function

No replacement

Syntax unsigned long linSlFSMSetStMFUp (unsigned int slaveId, unsigned int


stateId, unsigned int uniqueKey, unsigned int patternRequestId, unsigned
long dlc, unsigned char maskBytes[], unsigned char patternBytes[], unsigned
int followUpState);

Function Sets up a comparison operation for the state stateId of the Slave slaveId.

• If no DLC has been set by the data base, the DLC will be set by the dlc parameter of
the function.
• If the DLC already has been set by the data base, this value must be handover
correctly on every call of this function.

DLC value range: 0 ... 8 (bytes)

The functionality to set the DLC is only available with LIN specification 1.2 (or above)!

LIN specification 1.1 presets the DLC of an identifier.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the , that was defined with linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range
defined by linSlFSMSetGlobal.

uniqueKey

Dummy differentiation code for multiple comparison operations with the same
slaveId/stateId pair (see below)

patternRequestId

If this transmit identifier was placed on the bus by the Master, the condition described
here is evaluated.

dlc

DLC of the message

maskBytes

Mask with which the bytes/bits of interest can be filtered out.

patternBytes

Pattern with which the comparison is made after masking.

followUpState

State to be switched to after successful comparison

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Return values Nonzero if the comparison operator was configured; else 0.

The contents of messages with the identifier pattern RequestId that are sent on the LIN
bus are linked bitwise with maskBytes by an AND operation. If the result of this
comparison is identical to patternBytes, the Slave transitions to the state followUpState.

Since multiple comparisons may be configured for the same message identifier for a given
Slave state, a code uniqueKey is also necessary to permit identification of the various
comparison operations.

This code must be unique within the Slave state. If there are multiple comparison
operations for a message identifier within a state of a Slave, they are processed in the
order of their specification until all comparisons have been performed or a comparison
was successful.

During a measurement this function can be used to change the following data of a
comparison operation already configured in the on preStart event procedure:

• Comparison mask
• Results pattern
• Resulting state

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetStSFUp
CAPL Function Overview » Obsolete » linSlFSMSetStSFUp

Obsolete function

No replacement

Syntax long linSlFSMSetStSFUp (unsigned int slaveId, unsigned int stateId,


unsigned int requestId, unsigned long dlc, unsigned char dataBytes[],
unsigned char checksum, unsigned int followUpState);

Function Causes the Slave with identifier slaveId that is in the specified state stateId to respond to
the transmit request for the message with identifier requestId. This involves using the
data specified in dataBytes and the checksum.

• If no DLC has been set by the data base, the DLC will be set by the dlc parameter of
the function.
• If the DLC already has been set by the data base, this value must be handover
correctly on every call of this function.

DLC value range: 0 ... 8 (bytes)

The functionality to set the DLC is only available with LIN specification 1.2 (or above)!

LIN specification 1.1 presets the DLC of an identifier.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId, that was defined with
linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range
defined by linSlFSMSetGlobal.

requestId

Condition: If this transmit identifier was placed on the bus by the Master, the action
described here triggers.

dlc

DLC of the message

dataBytes

Data bytes to be sent as a response to requestId

checksum

Checksum that should be used in the response. It should be noted that the CRC might also
be incorrect! In this case a checksum error is generated.

followUpState

State to be switched to after the action has occurred. This could be the same as the
current state.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Return values Nonzero if the action was configured, else 0.

During a measurement the following data can be modified for an action already
configured in the on preStart event procedure:

• Transmission data
• Checksum
• Resulting state

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlFSMSetStTO
CAPL Function Overview » Obsolete » linSlFSMSetStTO

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linSlFSMSetStTO (unsigned int slaveId, unsigned int stateId, unsigned
int timeout, unsigned int followUpState);

Function Sets a timeout for the state specified by stateId of the Slave with the identifier slaveId.

Parameters slaveId

Identifier of the relevant Slave. Corresponds to the slaveId, that was defined with
linSlSimulate.

stateId

Identifier of the relevant state of the Finite State Machine (FSM). Lies in the range that
was defined by linSlFSMSetGlobal.

timeout

Timeout in milliseconds after which the state should automatically be ended.

followUpState

State that should be assumed if the current state is ended with a timeout.
After a timeout has occurred the hardware sends a Slave Timeout message and switches
the Slave to the followUpState state.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linSlSimulate
CAPL Function Overview » Obsolete » linSlSimulate

Obsolete function

No replacement

Note

This function may only be called in the event procedure on preStart.

Syntax void linSlSimulate(unsigned int slaveId);

Function Activates the Slave with the passed identifier for simulation. This function must be called
before the Slave is further configured.

Parameters slaveId

User selectable identifier for a Slave or a Finite State Machine (FSM).


Valid Slave identifiers run from 0 to 63.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.1 - 5.1 LIN — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

linWakeupFrame
CAPL Function Overview » Obsolete » linWakeupFrame

Obsolete function

Replaced by the event procedure on linWakeupFrame

Syntax void linWakeupFrame(long syncTimeStamp, long origTimeStamp, byte signal,


int external)

Function Is called whenever a Wakeup frame is recognized. The time stamps are the same as by
LINRcvFrame.

Parameters signal

The actually received byte (0x00, 0x80 or 0xC0) when the baud rate is correct. Signals
(Wakeup frames) with different byte values will not be recognized.
The bytes 0x00 and 0xC0 are the result of a deviation in their baud rate (caused by Sleep
mode).

external

If this flag is set, the Wakeup frame has been sent from an external device.
If not, the LIN hardware sent the Wakeup frame.

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

MostGetFBlockID, MostGetFunctionID, MostGetOpType


CAPL Function Overview » Obsolete » MostGetFBlockID, MostGetFunctionID, MostGetOpType

Obsolete function

Please use the mostMessage and mostAMSMessage selectors FBlockID, FunctionID and
OpType instead.

Syntax long MostGetFBlockID(mostMessage msg)

long MostGetFBlockID(mostAMSMessage msg)

long MostGetFunctionID(mostMessage msg)

long MostGetFunctionID(mostAMSMessage msg)

long MostGetOpType(mostMessage msg)

long MostGetOpType(mostAMSMessage msg)

Function These functions return the FBlockID, FunctionID or OpType of the message.

Parameters msg

Message variable of type mostMessage or mostAMSMessage

Return values FblockId, FunctionId, OpType

Info

These values are determined independent of the message type and if


applicable independent of the TelId. The Values are only valid if the message
is out of the function catalog.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

MostGetLight, MostSetLight
CAPL Function Overview » Obsolete » MostGetLight, MostSetLight

Obsolete function

No replacement

Syntax long MostGetLight(long channel)

long MostSetLight(long channel, long mode)

Function Get and set the Ring state.

Parameters channel

Channel of the interface to be requested or to be accessed

Return values 1: light on

0: light out

<0: See error codes

Availability Up to Restricted to Measurement Simulation / Test


Version Setup Setup

• MOST — •
• After measurement start
• Not in Stop
measurement

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

MostSetFBlockID, MostSetFunctionID, MostSetOpType


CAPL Function Overview » MOST » MostSetFBlockID, MostSetFunctionID, MostSetOpType

Obsolete function

The following function are obsolete! Please use the mostMessage and mostAMSMessage
selectors FBlockID, FunctionID and OpType instead.

Syntax void MostSetFBlockID(mostMessage msg, long value)

void MostSetFBlockID(mostAMSMessage msg, long value)

void MostSetFunctionID(mostMessage msg, long value)

void MostSetFunctionID(mostAMSMessage msg, long value)

void MostSetOpType(mostMessage msg, long value)

void MostSetOpType(mostAMSMessage msg, long value)

Function Set the FBlockID, FunctionID or OpType of the message.

Info

Since the FBlockID, FunctionID and OpType are part of the message ID these
functions change the ID as well.

Parameters msg

Variable of type mostMessage or mostAMSMessage.

value

Value to be set for FBlockID, FunctionID or OpType.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

3.2 MOST • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

MostSetOptoMode, MostGetOptoMode
CAPL Function Overview » Obsolete » MostSetOptoMode, MostGetOptoMode

Obsolete function

No replacement

Syntax long MostSetOptoMode(long channel,long optoMode)

long MostGetOptoMode(long channel)

Function Sets the operation mode of the Optolyzer to the specified value.

Returns the operation mode of the Optolyzer connected to the given channel.

Parameters channel

Channel of the connected interface

Refer to the OptoControl helpfile for further explanations of the values for optoMode.
This function only works in the "Prestart" Section of the CAPL program.

optoMode = 1 Spy Mode

optoMode = 4 Slave Mode

optoMode = 6 Master Mode

Return values <0: See error codes

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 - 5.0 • MOST — •


• Prestart section

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

outport
CAPL Function Overview » Obsolete » outport

Obsolete function

The Parallel Port is only supported with Windows XP 32 bit.

For simple control applications you can use the IOcab, the IOpiggy or a simple
measurement hardware, e.g. the Meilhaus-RedLab series or an appropriate NI card.

Note

Before you can use the CAPL functions outport, inport, outportLPT and inportLPT, you
must install the generic I/O port driver for Windows. You will find this driver and its
description (ReadMe.Txt) in the directory Exec32\GpIoDrv.

For more information please contact the Vector Support:

Vector Informatik GmbH - Support

Our business hours are Monday to Friday from 9:00 am to 5:00 pm (CET):

• Phone: +49.711.80670.200
• Fax: +49.711.80670.111
• E-Mail: support@vector.com
• Online Report Form:
https://www.vector.com/vi_problem_report_en.html

Syntax void outport( word addr, byte value);

Function Output of a byte to a port.

Parameters addr

Port address or a predefined LPTx constant.

value

Output value

Symbolic assignment:

LPT1 -> 0x378

LPT2 -> 0x278

LPT3 -> 0x3BC

The LPT constant could not be used in arithmetic expression!

The following expression is inadmissible:


byte ctrl;
...
// Output mode is active -> change
ctrl |= 0x20;
outport( LPT1 + 2, ctrl);
...

Please write:
word addr = 0x378;

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

byte ctrl;
...
// Output mode is active -> change
ctrl |= 0x20;
outport( addr + 2, ctrl);
...

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Example
// These example sends some characters to the first LPT port.
// The LPT port is first changed to output if necessary.
word addr = 0x378;
byte ctrl;
int i;
byte b;
// Read the parallel port control register
ctrl = inport( addr + 2);
if ( ctrl & 0x20)
{
// Input mode is active -> change
ctrl &= 0xdf;
outport( addr + 2, ctrl);
}
b = 0x01;
for ( i = 0; i < 8; i++)
{
// Output
outport( addr, b);
b <<= 1;
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

outportLPT
CAPL Function Overview » Obsolete » outportLPT

Obsolete function

Replaced by outport

Note

Before you can use the CAPL functions outport, inport, outportLPT and inportLPT, you
must install the generic I/O port driver for Windows. You will find this driver and its
description (ReadMe.Txt) in the directory Exec32\GpIoDrv.

Syntax void outportLPT( word addr, byte value);

Function Writes a byte to the specified parallel port. This function changes the transmission mode
of the parallel port automatically to output.

Parameters addr

Port address or a predefined LPTx constant

value

Output value

Symbolic assignment:

LPT1 -> 0x378

LPT2 -> 0x278

LPT3 -> 0x3BC

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Example
// This example triggers a external device via the parallel port. (e.g:
CANscope)
on start
{
// reset LPT1 output
outportLPT( LPT1, 0);
}
on message ABSdata
{
if ( this.CarSpeed.phys > 200)
{
// trigger CANscope (running with external Trigger "low->high" enabled)
outportLPT( LPT1, 1);
// reset LPT1 output
outportLPT( LPT1, 0);
}
// dispatch original CAN message
output( this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RegisterSignalDriverByTxNode
CAPL Function Overview » Obsolete » RegisterSignalDriverByTxNode

Obsolete function

No replacement

Syntax long RegisterSignalDriver (dbSignal aSignal , dbNode aTxNode, char


aCallbackFunction[])

Function Registers the given callback as a 'signal driver' for the signal.

Parameters aSignal

DB signal to be queried.

aTxNode

DB node that should send the signal. It is only necessary if several send nodes are
approved for a message.

aCallbackFunction

Name of a callback function that should be defined as follows: void function(double


value).

Return values 1: Correct functionality

0: CAPL 'signal driver' could not be registered

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

resetManualChecksum
CAPL Function Overview » Obsolete » resetManualChecksum

Obsolete function

Replaced by linResetManualChecksum

Syntax void resetManualChecksum(linMessage msg)

Function Turns the correct checksum back on for a LIN message, automatically adjusted to match
the message data.

Parameters msg

The LIN message for which the correct checksum will be used again.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 - 5.2 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232ByteCallback
CAPL Function Overview » Obsolete » RS232ByteCallback

Obsolete function

Replaced by RS232Receive and RS232OnReceive

Syntax RS232ByteCallback( dword port, dword datum, dword note )

Function Callback handler for reception of data from serial ports.

Each node which implements this handler will receive data. The handler receives data
from all opened ports (i.e. opened by CANoe/CANalyzer).

It is cumbersome and slower by design since it gets one byte time by time. Block handlers
receive blocks of data at an instant of time.

Parameters port

A number between 1 and 255 identifying a serial port.

datum

Byte which has been received (lowest 8 bits).

note

Constant 1 (for sake of interface compatibility).

Return values 0: error

The error occurs if no serial port has been opened.

1: success

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example
if ( 0!=RS232WriteByte(2,65) )
write(“Written byte to port 2.”);
// port 2 may be connected with port 1
...
// at node which listens to port 1 is connected to port 2
RS232ByteCallback(dword port, dword datum, dword note)
{
// receive value 65 with port==1
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232CloseHandle
CAPL Function Overview » Obsolete » RS232CloseHandle

Obsolete function

Replaced by RS232Close

Syntax dword RS232CloseHandle( dword port )

Function Closes a serial port.

Parameters port

A number between 1 and 255 identifying a serial port.

Return values 0: error

The error occurs if the serial port with the given number does not exist on the system.

1: success

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232EscapeCommExt
CAPL Function Overview » Obsolete » RS232EscapeCommExt

Obsolete function

Replaced by RS232SetSignalLine

Syntax dword RS232EscapeCommExt( dword modemControl, dword port )

Function Sets signal line on a specific serial port.

Info

If you use hardware handshake, then this function may conflict with the
automatic handshaking.

It is the only RS232 function which takes port as second parameter.

Parameters port

A number between 1 and 255 identifying a serial port.

modemControl

Signal lines and levels to bet set on all open ports (opened by CANoe/CANalyzer).

Value State of DTR State of RTS

0 0 0

1 1 0

2 0 1

3 1 1

DTR: Data-Terminal-Ready (from sender)

RTS: Request-To-Send (from sender)

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

1: success

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232EscapeCommFunc
CAPL Function Overview » Obsolete » RS232EscapeCommFunc

Obsolete function

Replaced by RS232SetSignalLine

Syntax dword RS232EscapeCommFunc( dword modemControl )

Function Sets signal lines on all open serial ports (opened by CANoe/CANalyzer).

Info

If you use hardware handshake, then this function may conflict with the
automatic handshaking.

It is the only function of the RS232 API which does not take a port as
parameter.

Parameters modemControl

Signal lines and levels to bet set on all open ports (opened by CANoe/CANalyzer).

Value State of DTR State of RTS

0 0 0

1 1 0

2 0 1

3 1 1

DTR: Data-Terminal-Ready (from sender)

RTS: Request-To-Send (from sender)

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened

1: success

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232SetCommState
CAPL Function Overview » Obsolete » RS232SetCommState

Obsolete function

Replaced by RS232Open and RS232Configure

Syntax dword RS232SetCommState( dword port, dword baudrate, dword


numberOfDataBits, dword numberOfStopBits, dword parity)

Function Opens and configures a serial port.

Parameters port

A number between 1 and 255 identifying a serial port.

baudrate

The symbol rate to use for reception and transmission.

Typically, 9600 is used. There is a list of possible values which depends on the serial port.
Normally, 115.200 is the allowed maximum.

numberOfDataBits

The number of data bits within a transmission frame.

8 is used at most. Only values between 5 and 8 are possible. Not all values and not all
combinations with other frame parameters may be supported by the serial port.

numberOfStopBits

A code which sets the number of stop bits within a transmission frame.

0 means 1 stop bit is used

it the typical and most reasonable value

1 means 1.5 stop bits are used

2 means 2 stop bits are used

parity

A code which identifies the parity mode to use.

0 no parity used, i.e. frame contains no parity bit

1 odd parity

2 even parity

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened
• another program uses the serial port according to the port number

1: success

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example

| RS232 CAPL Functions: Deprecated INI File |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232WriteBlock
CAPL Function Overview » Obsolete » RS232WriteBlock

Obsolete function

Replaced by RS232Send

Syntax dword RS232WriteBlock( dword port, byte buffer[], dword number )

Function Sends a block of bytes to a serial port.

• The operation starts the sending of a block.


• By default the function works blocking, i.e. it waits for completion.
• A CAN.INI switch allows for non-blocking behavior. The non-blocking behavior does
not block the RT kernel and allows accurate and timely operation of the RT kernel.
Therefore, it is very recommendable to use non-blocking behavior.
INI entry:

[RS232]
BlockingWrite=0

Values: integer
0=non-Blocking, 1=blocking

• The callback handler RS232OnSend will notify the node of completion.


• To get informed about errors occurring in later stages of the operation use
RS232OnError. There are no automatic retrials in case of error.

Parameters port

A number between 1 and 255 identifying a serial port.

buffer

An array of bytes of which number will be sent.

number

Number of bytes to send.

Return values 0: error

The error occurs if

• the serial port with the given number does not exist on the system
• the port has not been opened
• only relevant for non-blocking usage:
if another send operation (this one,RS232WriteByte or RS232Send) has been used
shortly before, then the previous send operation may not have finished which leads to
an error. Use the RS232OnSend callback handler to synchronize operations.

For non-blocking usage, see accoding section under RS232Send.

1: success

In contrast to RS232Send success means here that the operation has really succeeded to
transmit data.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

2: time out, i.e. write access could not be completed till timeout (only relevant for
blocking variant, see RS232SetHandshake for setting timeout).

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example
char text[20] = “Hello World !”;
byte buffer[20];
int i;
int length;
length=strlen(text)+1;
for (i=0;i<length;i++) buffer[i]=text[i];
if ( 0!=RS232WriteBlock(1,buffer,length) )
write(“It works with port 1.”);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

RS232WriteByte
CAPL Function Overview » Obsolete » RS232WriteByte

Obsolete function

Replaced by RS232Send

Syntax dword RS232WriteByte( dword port, dword datum )

Function Sends one bytes to a serial port.

• The operation starts sending a byte.


• By default the function works blocking, i.e. it waits for completion.
• A CAN.INI switch allows for non-blocking behavior. The non-blocking behavior does
not block the RT kernel and allows accurate and timely operation of the RT kernel.
Therefore, it is very recommendable to use non-blocking behavior.
INI entry:

[RS232]
BlockingWrite=0

Values: integer
0=non-Blocking, 1=blocking

• The callback handler RS232OnSend will notify the node of completion.


• To get informed about errors occurring in later stages of the operation use
RS232OnError. There are no automatic retrials in case of error.

Parameters port

A number between 1 and 255 identifying a serial port.

datum

Byte to be sent (lowest 8 bits).

Return values 0: error

The error occurs if

• if the serial port with the given number does not exist on the system, then the call
will fail.
• if the port has not been opened, then the call will fail.
• only relevant for non-blocking usage:
if another send operation (this one,RS232WriteBlock or RS232Send) has been used
shortly before, then the previous send operation may not have finished which leads to
an error. Use the RS232OnSend callback handler to synchronize operations.

For non-blocking usage, see accoding section under RS232Send.

1: success

In contrast to RS232Send success means here that the operation has really succeeded to
transmit data.

2: time out, i.e. write access could not be completed till timeout (only relevant for

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

blocking variant, see RS232SetHandshake for setting timeout.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

7.0 — — •

Example
if ( 0!=RS232WriteByte(1,65) )
write("It works with port 1.");

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileClose
CAPL Function Overview » Obsolete » seqFileClose

Obsolete function

Replaced by fileClose

Syntax long seqFileClose(long file);

Function The function closes the file specified by handle file. All System-allocated buffers are
freed upon closing.

Parameters file

Return values The function returns zero on success. If the operation fails, it returns an non-zero error
code.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileGetBlock
CAPL Function Overview » Obsolete » seqFileGetBlock

Obsolete function

Replaced by fileGetBinaryBlock

Syntax long seqFileGetBlock(char buffer[], dword bufferSize, long file);

Function The function reads at most bufferSize characters from the file specified by handle file
into the array buffer. The file position indicator is advanced by the number of characters
successfully read. It is indeterminate after an error.

Parameters buffer

bufferSize

file

Return values The return value is the number of characters successfully read, which may be less than
bufferSize, if an error or end-of-file is encountered.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileGetLine
CAPL Function Overview » Obsolete » seqFileGetLine

Obsolete function

Replaced by fileGetString

Syntax long seqFileGetLine(char buffer[], dword bufferSize, long file);

Function The function reads at most bufferSize-1 characters from the file with the handle file into
the array buffer. No additional characters are read after a newline character or after end-
of-file.

The function retains the newline character, but the line is not zero-terminated.

Parameters buffer

bufferSize

file

Return values Return value is the number of characters successfully read, or a negative error code, if
the operation fails.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileGetLineSZ
CAPL Function Overview » Obsolete » seqFileGetLineSZ

Obsolete function

Replaced by fileGetStringSZ

Syntax long seqFileGetLineSZ(char buffer[], dword bufferSize, long file, long


cStyle);

Function The function reads at most bufferSize-1 characters from the file with the handle file into
the array buffer. No additional characters are read after a newline character or after end-
of-file.The function retains the newline character. If cStyle is set to 1 the line is
terminated by a null character, if cStyle is set to 0 not.

Parameters buffer

bufferSize

file

cStyle

Return values Return value is the number of characters successfully read, or a negative error code, if
the operation fails.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileLoad
CAPL Function Overview » Obsolete » seqFileLoad

Obsolete function

Replaced by openFileRead

Note

The function searches the file in the path given by the SeqFilePath entry in the [CAPL]
section of the CAN.INI initialization file. If the entry does not exist the file is searched in
the application directory (Exec/Exec32). Any drive and path information provided in the
parameter is ignored.

Syntax long seqFileLoad(char fileName);

Function The function opens the file whose name is the string pointed to by name. The file will be
opened as read-only.

Parameters filename

Return values The return value is the file handle. The return value is <= 0 if an error occurs.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

seqFileRewind
CAPL Function Overview » Obsolete » seqFileRewind

Obsolete function

Replaced by fileRewind

Syntax long seqFileRewind(long file);

Function The function sets the file position indicator to the beginning of the file specified by
handle file.

Parameters file

Return values The function returns zero on success. If the operation fails, it returns an non-zero error
code.

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 — — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

setManualChecksum
CAPL Function Overview » Obsolete » setManualChecksum

Obsolete function

Replaced by linSetManualChecksum

Syntax void setManualChecksum(linMessage msg, int checksum)

Function Sets a checksum for a LIN message (that is different that the correct one).

Parameters msg

LIN message for which a checksum will be set.

checksum

The checksum to be set.

Return values

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

3.2 - 5.2 LIN • •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

setMsgTime
CAPL Function Overview » Obsolete » setMsgTime

Obsolete function

No replacement

Syntax void setMsgTime(message m, NOW);

void setMsgTime(message m1, message m2);

Function Assigns to one message the capture time of another message or the current time. This
function is obsolete and only serves to establish compatibility with older versions.

Parameters Variable of type "message" or "now".

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Example
setMsgTime(m100, this); // CANalyzer 1.xx & 2.xx
m100.time = this.time; // CANalyzer 2.xx
setMsgTime (m101, now);

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

setPortBits - Lowspeed and CANcab 1041


CAPL Function Overview » Obsolete » setPortBits - Lowspeed and CANcab 1041

Obsolete function

Replaced by setCanCabsMod

Note

For transceiver:

• 252
• 1041
• 1053
• 1054
• opto variations

Syntax void setPortBits (byte Mode);

Function To enable the different CAN bus tranceiver modes Normal Mode (standard at start) or
Sleep Mode.

For this function you have to take care that the channel number is the logical one which
is used by CANalyzer / CANoe according to the assignment in CAN Driver Configuration.

Parameters 8 bit parameter with the following, lowspeed CANcab specific meaning:

Bit 0 and 1 Linemode of channel 1 CANcabs

Bit 2 and 3 Linemode of channel 2 CANcabs

Bit 4 – 7 Reserved and must be set to "0"

To enable one mode, the parameter has to contain one of the following bit combinations:

Channel 1/Channel 2 Bit 1/ Bit 3 Bit 0/ Bit 2

Normal Mode 0 1

Sleep Mode 1 0

No change 1 1

No change 0 0

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Example

Changing the mode of two lowspeed CANcabs:


variables {
}
on key '1'
{
write ("CAN1 Lowspeed: Normal Mode");
setPortBits (0x01);
}
on key '2'
{
write ("CAN1 Lowspeed: Sleep Mode");
setPortBits (0x02);
}
on key '3'
{
write ("CAN2 Lowspeed: Normal Mode");
setPortBits (0x04);
}
on key '4'
{
write ("CAN2 Lowspeed: Sleep Mode");
setPortBits (0x08);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

setPortBits - Single Wire


CAPL Function Overview » Obsolete » setPortBits - Single Wire

Obsolete function

Replaced by setCanCabsMod

Note

For transceiver:

• CANcab 5790
• 5790 opto

Syntax void setPortBits (byte Mode);

Function To enable the different CAN bus transceiver modes.

For this function you have to take care that the channel number is the logical one which
is used by CANalyzer / CANoe according to the assignment in CAN Driver Configuration.
Further on, setting the mode explicitly for one channel is not possible, you always have to
set the modes for both channels (which can be different modes of course).

Parameters 8 bit parameter with the following, single wire CANcab specific meaning:

Bit 0 and 1 Linemode of CANcab on channel 1

Bit 2 and 3 Linemode of CANcab on channel 2

Bit 4 High priority for channel 1

Bit 5 High priority for channel 2

Bits 6 and 7 Reserved, must be set to "0"

There are 4 different linemodes, coded as below:

Channel 1/Channel 2 Bit 1/ Bit 3 Bit 0/ Bit 2

Sleep Mode 0 0

HighVoltage Mode 0 1

Fast Mode 1 0

Normal Mode 1 1

For normal data interchange the Normal-Mode with baud rates up to 40 kBaud is used. A
Fast-Mode, which allows only a limited number of bus nodes (e.g. for flash programming),
with baud rates up to 100 kBaud is supported. The HighVoltage-Mode is used to send
HighVoltage-WakeUp messages (12 V); in Sleep-Mode the transceiver is switched off.

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

Additionally there is a High Priority flag to clear all transmit buffers.

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

— • •

Example

Sending a HighVoltage-WakeUp message on logical CAN channel 1:


variables {
message 0x100 msg;
}
on start
{
msg.CAN = 1;
msg.DLC = 0;
}
on key 'w'
{
// sets the transceiver of channel 1 in HighVoltage mode
// and the transceiver of channel 2 in Normal mode.
setPortBits(0x0D);
// sends the message.
output(msg);
// After sending the Wakeup message the transceiver
// of both channels will be set to Normal mode.
setPortBits(0x0F);
}
on message *
{
output(this);
}

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

SetSignalByTxNode
CAPL Function Overview » Obsolete » SetSignalByTxNode

Obsolete function

Replaced by SetSignal

Syntax void SetSignalByTxNode(dbSignal aSignal, dbNode aNode, double aValue)

Function Sets the transmitted signal aSignal to the accompanying value.

If no suitable signal driver exists and thus no signal can be stimulated, then the verdict of
the test module is set to "fail".

GM special (several send nodes)

Parameters aSignal

Signal to be set.

aNode

Send node.

aValue

Physical value to be accepted.

Return values —

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

SysGetVariableIntArray
CAPL Function Overview » Obsolete » SysGetVariableIntArray

Obsolete function

Replaced by SysGetVariableLongArray

Syntax long SysGetVariableIntArray(char namespace[], char variable[], int


values[], long arraySize) // form 1

long SysGetVariableIntArray(SysVarName, int values[], long arraySize) //


form 2

Function Returns the value of a variable of the int[] type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

Gets the values of the variable (both forms)

arraySize

Size of the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 — • •
Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

SysSetVariableIntArray
CAPL Function Overview » Obsolete » SysSetVariableIntArray

Obsolete function

Replaced by SysSetVariableLongArray.

Syntax long SysSetVariableIntArray(char namespace[], char variable[], int


values[], long arraySize) // form 1

long SysSetVariableIntArray(SysVarName, int values[], long arraySize) //


form 2

Function Sets the value of a variable of the int[] type.

Parameters namespace

Name of the name space (form 1)

variable

Name of the variable (form 1)

values

New values of the variable (both forms)

arraySize

Number of values in the array (both forms)

SysVarName

Name of the fully qualified name of the system variable, including all name spaces,
separated by "::". The name must be preceded by "sysVar::". (form 2)

Return values 0: no error, function successful

1: name space was not found or second try to define the same name space

2: variable was not found or second try to define the same variable

3: no writing right for the name space available

4: the variable has no suitable type for the function

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.1 — — •

7.0 — • •
Example
long lVarArr[10];
...
sysSetVariableIntArray(sysvar::MyNamespace::IntArrayVar, lVarArr,
elcount(lVarArr));

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

TestReportSetLoggingBlock
CAPL Function Overview » Test Feature Set » TestReportSetLoggingBlock

Obsolete function

This command is still retained for compatibility reasons since the logging files used are
automatically annotated in the XML log after version 5.2.

Syntax TestReportSetLoggingBlock (char data name[])

Function This function annotates a logging file to a report, e.g. to HTML reports created with
extendedNavigation.xslt.

Parameters Data name

Path of the logging file.


This must always be relative to the XML test protocol, e.g. "logfile.asc" or
"log/logfile.asc".
If a logging file is not displayed correctly, you should check the specified path since it is
not automatically checked whether the specified file actually exists.

Use "/" as a separator to prevent problems in some browsers.

Return values —

Availability Up to Version Restricted to Measurement Setup Simulation / Test Setup

5.2 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

testValidateSignalInRangeByTxNode
CAPL Function Overview » Obsolete » testValidateSignalInRangeByTxNode

Obsolete function

This function replaces the function testValidateSignalInRangeGM.

Version 7.1: Replaced by testValidateSignalInRange.

Syntax long testValidateSignalInRangeByTxNode (char aTestStep[], dbSignal aSignal,


dbNode aTxNode, float aLowLimit, float aHighLimit)

Function Checks the signal value against the condition:

aLowLimit <= Value <= aHighLimit

The test step is then evaluated as passed or failed, depending on the results

Parameters aTestStep

Name of the test step for the test report

aSignal

The signal to be polled

aTxNode

Send node of the message whose signal should be polled

aLowLimit

Lower limit of the signal value

aHighLimit

Upper limit of the signal value

Return values -1: General error

0: Correct functionality

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

testValidateSignalOutsideRangeByTxNode
CAPL Function Overview » Obsolete » testValidateSignalOutsideRangeByTxNode

Obsolete function

This function replaces the function testValidateSignalOutsideRangeGM.

Version 7.1: Replaced by testValidateSignalOutsideRange.

Syntax long testValidateSignalOutsideRangeByTxNode (char aTestStep[], dbSignal


aSignal, dbNode aTxNode, float aLowLimit, float aHighLimit)

Function Checks the signal value against the condition:

• Value < aLowLimit

or

• Value > aHighLimit

The test step is evaluated as passed or failed depending on the results.

Parameters aTestStep

Name of the test step for the test report

aSignal

The signal to be polled

aTxNode

Send node of the message whose signal should be polled

aLowLimit

Lower limit of the signal value

aHighLimit

Upper limit of the signal value

Return values -1: General error

0: Correct functionality

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

TestWaitForSignal
CAPL Function Overview » Obsolete » TestWaitForSignal

Obsolete function

Replaced by TestWaitForSignalAvailable

Syntax long TestWaitForSignal (dbSignal aSignal, dword aTimeout)

Function Tests the availability of a specific signal and waits if necessary until its availability.
A signal that is received at least once from the bus after the measurement starts is
classified as "available".

This function is useful when you want to assure that single signals are available before
starting a signal-oriented test, i.e. to synchronize the tester with the bus.

Parameters aSignal

Signal whose availability is being tested or for which is waited

aTimeout

Maximum waiting time

Return values -2: Wait state is exited due to a constraint/condition violation

-1: General error, e.g. functionality is unavailable

0: Wait state is exited due to a timeout

1: Wait state is exited; signal is available for further tests

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

| TestWaitForSignals |

Version: 7.6 SP4 | © Vector Informatik GmbH


User Manual
Topic: Obsolete CAPL Functions

TestWaitForSignals
CAPL Function Overview » Obsolete » TestWaitForSignals

Obsolete function

Replaced by TestWaitForSignalsAvailable

Syntax long TestWaitForSignals (dbNode aNode, dword aTimeout)

Function Tests the availability of all the send signals of a node and waits if necessary until all the
send signals of the node are available. Signals that are received at least once from the
bus after the measurement starts are classified as "available".

This function is useful when you want to assure that all signals are available before
starting a signal-oriented test, i.e. to synchronize the tester with the bus.

Parameters aNode

Node whose send signals should all be available

aTimeout [ms]

Maximum waiting time

Return values -2: Wait state is exited due to a constraint/condition violation

-1: General error, e.g. functionality is unavailable

1: General error, e.g. functionality is unavailable

0: Wait state is exited due to a timeout; not all signals are available

1: The wait state is exited; all of the node’s send signals are available for further tests

Availability Since Version Restricted to Measurement Setup Simulation / Test Setup

5.1 Test nodes — •

Example

| TestWaitForSignal |

Version: 7.6 SP4 | © Vector Informatik GmbH


Get more Information!

Visit our Website for:


> News
> Products
> Demo Software
> Support
> Training Classes
> Addresses

www.vector.com

You might also like