Use these functions to retrieve Power Capture parameters by time. Power capture parameters are displayed by the Power Tracker view in the USB Suite application.
Note: MANY power samples can occur before the first packet in a capture, and after the last packet in a capture. The samples are taken from the start of recording until the end at 20 microsecond intervals.
IsPowerCaptured ()
Use this function to determine if power parameters were captured for the trace being processed.
IsPowerCaptured()
Example
if( IsPowerCaptured() )
{
# retrieve some power parameters by time
…
}
GetPwrPowerValue()
This function returns the captured value of the Power (in microwatts) at the specified time.
GetPwrPowerValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Power sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Power with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - Power: %d microwatts",
TimeToText( start_time ), GetPwrPowerValue( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrVoltageValue()
This function returns the captured value of the Voltage (in microvolts) at the specified time.
GetPwrVoltageValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Voltage sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Voltage with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - Voltage: %d microvolts",
TimeToText( start_time ), GetPwrVoltageValue( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCurrentValue()
This function returns the captured value of the Current (in microamperes) at the specified time.
GetPwrCurrentValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Current sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Current with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - Current: %d microampers",
TimeToText( start_time ), GetPwrCurrentValue( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1LeftPowerValue()
This function returns the captured value of the Power (in microwatts) for CC1 channel left port at the specified time.
GetPwrCC1LeftPowerValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Power sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Power with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel left port Power: %d microwatts",
TimeToText( start_time ), GetPwrCC1LeftPowerValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1LeftVoltageValue ()
This function returns the captured value of the Voltage (in microvolts) for CC1 channel left port at the specified time.
GetPwrCC1LeftVoltageValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Voltage sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Voltage with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel left port Voltage: %d microvolts",
TimeToText( start_time ), GetPwrCC1LeftVoltageValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1LeftCurrentValue ()
This function returns the captured value of the Current (in microampers) for CC1 channel left port at the specified time.
GetPwrCC1LeftCurrentValue ( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Current sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Current with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel left port Current: %d microamperes",
TimeToText( start_time ), GetPwrCC1LeftCurrentValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2LeftPowerValue()
This function returns the captured value of the Power (in microwatts) for CC2 channel left port at the specified time.
GetPwrCC2LeftPowerValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Power sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Power with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel left port Power: %d microwatts",
TimeToText( start_time ), GetPwrCC2LeftPowerValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2LeftVoltageValue ()
This function returns the captured value of the Voltage (in microvolts) for CC2 channel left port at the specified time.
GetPwrCC2LeftVoltageValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Voltage sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Voltage with 1 second step from the start of trace for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel left port Voltage: %d microvolts",
TimeToText( start_time ), GetPwrCC2LeftVoltageValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2LeftCurrentValue ()
This function returns the captured value of the Current (in microampers) for CC2 channel left port at the specified time.
GetPwrCC2LeftCurrentValue ( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Current sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Current with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel left port Current: %d microamperes",
TimeToText( start_time ), GetPwrCC2LeftCurrentValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1RightPowerValue()
This function returns the captured value of the Power (in microwatts) for CC1 channel right port at the specified time.
GetPwrCC1RightPowerValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Power sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Power with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel right port Power: %d microwatts",
TimeToText( start_time ), GetPwrCC1RightPowerValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1RightVoltageValue ()
This function returns the captured value of the Voltage (in microvolts) for CC1 channel right port at the specified time.
GetPwrCC1RightVoltageValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Voltage sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Voltage with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel right port Voltage: %d microvolts",
TimeToText( start_time ), GetPwrCC1RightVoltageValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC1RightCurrentValue ()
This function returns the captured value of the Current (in microamperes) for CC1 channel right port at the specified time.
GetPwrCC1RightCurrentValue ( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Current sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Current with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC1 channel right port Current: %d microampers",
TimeToText( start_time ), GetPwrCC1RightCurrentValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2RightPowerValue()
This function returns the captured value of the Power (in microwatts) for CC2 channel right port at the specified time.
GetPwrCC2RightPowerValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Power sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime()
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Power with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel right port Power: %d microwatts",
TimeToText( start_time ), GetPwrCC2RightPowerValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2RightVoltageValue ()
This function returns the captured value of the Voltage (in microvolts) for CC2 channel right port at the specified time.
GetPwrCC2RightVoltageValue( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Voltage sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Voltage with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel right port Voltage: %d microvolts",
TimeToText( start_time ), GetPwrCC2RightVoltageValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrCC2RightCurrentValue ()
This function returns the captured value of the Current (in microampers) for CC2 channel right port at the specified time.
GetPwrCC2RightCurrentValue ( time )
|
Parameters |
|
|---|---|
|
time |
The VSE Time object representing a time at which the Current sample value should be returned. Null value will be returned if power wasn’t caputured or time is out of range. |
Example
start_time = GetTraceStartTime();
step = Time( 1, 0 ); # 1 second
# Prints out 5 samples of Current with 1 second step from the start of trace
for( i=0; i<5; i++ )
{
ReportText( FormatEx( "At time %s - CC2 channel right port Current: %d microamperes",
TimeToText( start_time ), GetPwrCC2RightCurrentValue ( start_time ) ) );
start_time = AddTime( start_time, step );
}
GetPwrMinValue ()
This function returns the minimum value of the specified parameter on the specified pin and in the specified time range.
GetPwrMinValue ( type_c_pin, power_param, from_time, to_time )
Parameters
type_c_pin
|
Type-C Pins Constants |
Description |
|
_TYPE_C_PIN_VBUS |
Vbus pin |
|
_TYPE_C_PIN_CC1 |
CC1 pin |
|
_TYPE_C_PIN_CC2 |
CC2 pin |
|
_TYPE_C_PIN_CC1_LEFT |
Analyzer left CC1 pin |
|
_TYPE_C_PIN_CC1_RIGHT |
Analyzer right CC1 pin |
|
_TYPE_C_PIN_CC2_LEFT |
Analyzer left CC2 pin |
|
_TYPE_C_PIN_CC2_RIGHT |
Analyzer right CC2 pin |
power_param
|
Power Parameter Constants |
Description |
|
_PWR_VOLTAGE |
Voltage |
|
_PWR_CURRENT |
Current |
|
_PWR_POWER |
Power |
from_time The start time of the time range.
to_time The end time of the time range.
Example
start_time = GetTraceStartTime();
end_time = GetTraceEndTime();
min_voltage = GetPwrMinValue( _TYPE_C_PIN_VBUS, _PWR_VOLTAGE, start_time, end_time );
ReportText( FormatEx( "Min Voltage On Vbus : %d", min_voltage ) );
GetPwrMaxValue ()
This function returns the maximum value of the specified parameter on the specified pin and in the specified time range.
GetPwrMaxValue ( type_c_pin, power_param, from_time, to_time )
Parameters
type_c_pin
|
Type-C Pins Constants |
Description |
|
_TYPE_C_PIN_VBUS |
Vbus pin |
|
_TYPE_C_PIN_CC1 |
CC1 pin |
|
_TYPE_C_PIN_CC2 |
CC2 pin |
|
_TYPE_C_PIN_CC1_LEFT |
Analyzer left CC1 pin |
|
_TYPE_C_PIN_CC1_RIGHT |
Analyzer right CC1 pin |
|
_TYPE_C_PIN_CC2_LEFT |
Analyzer left CC2 pin |
|
_TYPE_C_PIN_CC2_RIGHT |
Analyzer right CC2 pin |
power_param
|
Power Parameter Constants |
Description |
|
_PWR_VOLTAGE |
Voltage |
|
_PWR_CURRENT |
Current |
|
_PWR_POWER |
Power |
from_time The start time of the time range.
to_time The end time of the time range.
Example
start_time = GetTraceStartTime();
end_time = GetTraceEndTime();
max_current = GetPwrMaxValue( _TYPE_C_PIN_VBUS, _PWR_CURRENT, start_time, end_time );
ReportText( FormatEx( "Max Current On Vbus : %d", max_current ) );