v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha
v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha

Information Functions

GetTraceName()

Returns the full path and filename of the trace file being processed by VSE.

GetTraceName(filepath_compatible)

Parameters

filepath_compatible

If this parameter is present and not equal to 0, the returned value may be used as part of the filename.

Example

ReportText("Trace path and name = " + GetTraceName());
…
File = OpenFile("C:\\My Files\\" + GetTraceName(1) + "_log.log");
# For trace file with path "D:\Some Traces\Data.usb"
# GetTraceName(1) returns "D_Some Traces_Data.usb"

GetTraceFilePath()

Returns the file path of the trace file being processed by VSE. Does NOT include the filename itself.

GetTraceFilePath()

Example

ReportText("Trace path = " + GetTraceFilePath());
…
File = OpenFile("GetTraceFilePath() + "log.txt");
# For trace file with path "D:\Some_Traces\Data.usb"
# GetTraceFilePath() returns "D:\Some_Traces\"

GetTraceNameOnly()

Returns the filename of the trace file being processed by VSE. No path is included.

GetTraceNameOnly()

Example

ReportText("Trace filename = " + GetTraceNameOnly ());
…
File = OpenFile("D:\" + GetTraceNameOnly ()); // D:\Data.usb 
# For trace file with path "D:\Some_Traces\Data.usb"
# GetTraceNameOnly() returns "Data.usb"

GetScriptName()

Returns the name of the verification script where this function is called. The path is not included when the Verification script is executed by USBSuite UI.

GetScriptName()

Example

ReportText("Current script = " + GetScriptName());

GetApplicationFolder()

Returns the full path to the folder where the application was started.

GetApplicationFolder()

Example

ReportText("Application folder = " + GetApplicationFolder ());

GetCurrentTime()

Returns the string representation of the current system time.

GetCurrentTime()

Example

# Yields current time in format "May 18, 2006, 5:49 PM"
ReportText(GetCurrentTime()); 

GetTraceStartTime()

Returns the VSE Time object representing the starting time of the events in the trace being processed. Can be used to get the USB power values within the captured range.

GetTraceStartTime()

Example

# Prints out starting time of the trace
start_time = GetTraceStartTime();
ReportText( TimeToText( start_time ) );

GetTraceEndTime()

Returns the VSE Time object representing the ending time of the events in the trace being processed. Can be used to get the USB power values within the captured range.

GetTraceEndTime()

Example

# Prints out ending time of the trace
end_time = GetTraceEndTime();
ReportText( TimeToText( end_time ) );

GetTriggerPacketNumber ()

Returns triggered packet number in scenarios where you know the maximum number of packets is < 2 billion. If the number of packets may be greater than 2 billion, then you must also retrieve the high order 32 bits via the GetTriggerPacketNumberHi() function, and concatenate the bits into the 64-bit value.

GetTriggerPacketNumber ()

Example

# Prints out triggered packet number in the trace in cases where < 2 billion packets are acquired.
trigger_packet_number = GetTriggerPacketNumber ();
ReportText( " triggered packet number = %d", trigger_packet_number );

GetTriggerPacketNumberHi ()

Returns the triggered packet number’s upper 32 bits in 32 bit format. You will need to concatenate this value with the value returned from GetTriggerPacketNumber() to obtain the full 64-bit packet number. This is not necessary if you know your scenario only captures < 2 billion packets. In that case, you can use the GetTriggerPacketNumber() by itself to get the 32-bit value.

GetTriggerPacketNumberHi ()

Example

# Prints out triggered packet number in the trace
trigger_packet_number_high_order_32_bits = GetTriggerPacketNumberHi ();
ReportText( " Upper 32 bits of triggered packet number = %d", trigger_packet_number_high_order_32_bits );

GetTriggerTime ()

Returns the trigger timestamp. The value is returned in the VSE Time Object format.

GetTriggerTime ()

Example

# Prints out trigger time stamp in the trace
trigger_time = GetTriggerTime ();
ReportText( TimeToText(trigger_time ) );

GetLastPacketNumber ()

Returns the number of the last packet in a trace file.

GetLastPacketNumber ()

Example

# Prints out the number of the last packet in the trace
ReportText(FormatEx("Last Packet Number: %llu", GetLastPacketNumber()));

GetLastPacketNumberHi ()

Returns the last packet in a trace file number’s upper 32 bits in 32 bit format. You will need to concatenate this value with the value returned from GetLastPacketNumber() to obtain the full 64-bit packet number. This is not necessary if you know your scenario only captures < 2 billion packets. In that case, you can use the GetLastPacketNumber() by itself to get the 32-bit value.

GetLastPacketNumberHi()

Example

# Prints out the number of the last packet in the trace
ReportText(FormatEx("Last Packet Number (High): %llu", GetLastPacketNumberHi()));