SetPWMMeasurementDuration
Valid for: CANoe DE • CANoe:lite DE Note The function can only be called on system variable namespaces of appropriate channels of VT System modules.Method Syntax
Description
During measurement of PMW Parameters with the Modules VT1004/VT1104, VT2516 or VT2848 a Duty Cycle of 0 or 100% is shown if during the defined time no edge was recognized. This time is set with SetPWMMeasurementDuration (vtsSetPWMMeasurementDuration). The set time should be greater than the period of the lowest frequency to be measured. To identify 0% or 100% duty cycle quickly, the time should not be set too high as old values are still displayed in the meantime.Parameters
- Duration: Time window in seconds during which PWM signals are measured. VT1004/VT1104, VT2516, and VT2848: Time windows can be set between 10 ms (0.01) and 1 min (60) 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, is not a valid VT System namespace or does not support this command.
- -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. It is not possible to wait until the setting is 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.
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 the Write Window of the CANoe DE Family / once to the test report.CAPL
.NET (C#)
VT System Control
Select RPMSensor Set Sidebar | PWM Measurement | Meas. Duration to 0.1Set Sidebar | PWM Measurement | Threshold to 2.5
Check measurement values ‘PWMFreq’ and ‘PWMDC’ vtsSetPWMMeasurementDuration