Test Service Library: Stimulus Functions
Open topic with navigation CAPL Functions » Test Service Library » Stimulus Functions Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE 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 ofStmCreate_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 Between Two Values
- StmCreate_Toggle (limits taken from database)
- StmCreate_Toggle (limits user-defined)
- Short Description: Create a stimulus generator that toggles between two values.
-
Stimulus Generator: Generate a Ramp
- StmCreate_Ramp (limits taken from database)
- StmCreate_Ramp (limits user-defined)
- Short Description: Create a stimulus generator that creates a ramp.
-
Stimulus Generator: Environment Variable as Data Source
- StmCreate_EnvVar
- Short Description: Create the stimulus with environment variables as data source.
-
Stimulus Generator: CSV File as Data Source
- StmCreate_CSV (non-cyclical)
- StmCreate_CSV (cyclical)
- Short Description: Create stimulus generator with CSV file as data source.
-
ASAM XIL API
- HILAPICreateSignalGenerator
- Short Description: Creates a Signal Generator from an ASAM HILAPI Signal Generator definition file.
- testWaitForHILAPISignalGeneratorLoaded: Waits until a signal generator is fully loaded and ready to start.
The Stimulus Generators are created and controlled by the following functions in CAPL:
- Functions
- ChkConfig_Init
- Short Description: The Test Service Library must always be initialized at the beginning.
- StmCreate_xxx
- Short Description: Creation of Stimulus Generators.
- StmControl_Start, StmControl_Stop, StmControl_Reset, StmControl_Destroy
- Short Description: During the measurement the Generators can be started, stopped, reset or destroyed in CAPL programs with the functions.
- ChkConfig_Init
- 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.