CAPL Script

Selector TIME

This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.

TIME is the CAN event timestamp expressed in units of 10 microseconds. TIME_NS represents an event timestamp in nanoseconds as a signed 64-bit value in the available reference. Check support in the installed tool version. A finer numeric unit does not establish finer hardware accuracy.

Read and convert one timestamp

on message CAN1.0x200
{
  float eventMs;
  if (this.DIR != Rx || this.RTR != 0) return;
  eventMs = this.TIME / 100.0;
  write("Event timestamp: %.2f ms", eventMs);
}

This reads the event's timestamp, not the current execution time. For example, 10,000 TIME ticks correspond to 100 ms, not 10 ms or 10 seconds. Avoid integer division if the fractional result is important.

Comparing two frames

Keep previous timestamp state outside the handler body, distinguish the first frame with an explicit flag, and compare only one channel/ID/direction/frame-type stream. Do not assume a timestamp greater than zero is the only valid first sample. Check decreasing and equal timestamps before interpreting the difference.

The complete timestamp walkthrough demonstrates this with TIME_NS, including discontinuity handling. The interval analyzer compares exported timestamps without sorting them. Convert the legacy TIME ticks to a supported unit before pasting them; its microsecond option expects microseconds, not 10-microsecond ticks.

Audit the clock before diagnosing the sender

Consider two constructed records for an original frame and its forwarded counterpart: one at a source capture point and one after gateway forwarding. Their difference combines the two observation points and any clock offset. It is not automatically a forwarding delay. A timing claim needs a documented common clock or synchronization method, known timestamp origins and a definition of what each timestamp represents. Displaying both columns in nanoseconds does not supply these conditions.

Within one recording, keep the original row numbers alongside exported timestamps. If a reported long interval spans rows 140 and 142, inspect row 141: was it another ID, a rejected short payload, or a target frame accidentally excluded? A timestamp-only list cannot answer this after that context has been discarded. Retain the original trace and a separate filtering record even when the calculator receives only one column.

Check Useful comparison Limit of the result
Unit conversion TIME difference of 10,000 versus TIME_NS difference of 100,000,000 both produce 100 ms This checks arithmetic, not capture accuracy
Equal timestamps Compare original row identity, frame fields and exported precision Equality alone does not prove a duplicate transmission
Time reversal Locate the recording boundary or clock reset before forming another interval Sorting can hide the boundary and create a false comparison
Alleged missing frame Compare a long gap with raw capture continuity and a specified payload counter A gap alone does not locate a loss or prove the sender emitted the frame

The stream-filtering guide shows how a counter can strengthen this inspection while still leaving reset, repeated payload and capture-loss explanations open. Timestamp resolution, timestamp accuracy and correctness of the selected stream are separate questions; a more precise display only addresses the first of them at best.

Source and validation

API signatures and behavior follow the authorized Vector reference. The explanations and inspection examples are site guidance, not recorded CANoe test results. Check the installed help for your tool version and node type. See sources and validation limits.