CAPL Script

AddTimeToMeasurementStartTime

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.

Syntax

long addTimeMeasurementStartTime(int64 timeSpan, long time[]);

Function

Calculates the absolute date/time of the measurement start plus an offset (e.g. a timestamp).

Parameters

timeSpan Time to be added to the measurement start time, e.g. a timestamp of a measured frame.

time

An array of type long with at least 8 entries. The entries of the array will be filled with the following information:

Return Values

1 if successful, 0 if not (e.g. array to small).

on errorframe {
  long time[8];
  addTimeToMeasurementStartTime(timeNowNS(), time);
  write("ErrorFrame occured on %02d/%02d/%02d %02d:%02d:%02d.%-3d",time[5]+1, time[4], time[6]-100,
  time[3], time[2], time[1], time[0]);
  getMeasurementStartTime(time);
  write("Measurement was started on %02d/%02d/%02d %02d:%02d:%02d.%-3d",time[5]+1, time[4], time[6]-100,
  time[3], time[2], time[1], time[0]);
}
// Output e.g.:
// ErrorFrame occured on 08/15/17 14:39:46.787
// Measurement was started on 08/15/17 14:39:29.547

Related reference: getMeasurementStartTime