LoadWFVoltage
Valid for: CANoe DE • CANoe:lite DE NoteThe 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 Syntax
Description
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 DE Family configuration.
Return Values
- 0: Successful call
- -1: Non-specific error
- -2: The namespace on which the command was called does not exist, is not a valid VT System namespace or does not support this command.
- -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.
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 DE Family 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
CAPL
.NET (C#)
VT System Control
Select Temp_SensorSet Sidebar | General | Stim Mode to Active
Set Sidebar | General | Curve Type to Waveform
Set Sidebar | Waveform Output | WF Voltage to Waveform.txt
Set Sidebar | Waveform Output | Parameters | Time Increment to 0.065
Set Sidebar | Waveform Output | Parameters | Pause to 2.0
Set Sidebar | Waveform Output | Parameters | Repeats to 0
Click Sidebar | General | Start Stimulation
Wait for 10 seconds
Click Sidebar | General | Stop Stimulation vtsLoadWFVoltage