Admin Production ni-theme
Current Publication

CompareCVITimeIntervalsWithTolerance

LabWindows/CVI

CompareCVITimeIntervalsWithTolerance

int CompareCVITimeIntervalsWithTolerance (CVITimeInterval interval1, CVITimeInterval interval2, CVITimeInterval tolerance, int *result);

Purpose

Compares two time interval values and returns 0 if they within the specified tolerance value, -1 if the first value is less than the second value, and 1 if the first value is greater than the second value.

Parameters

Input
Name Type Description
interval1 CVITimeInterval Time interval value in National Instruments Binary Time Format.
interval2 CVITimeInterval Time interval value in National Instruments Binary Time Format.
tolerance CVITimeInterval The time interval value used for equality comparison. Valid tolerance values must be zero or positive.
Output
Name Type Description
result int The result of the comparison. The function returns 0 if the first value is within the tolerance interval of the second value, -1 if the first value is less than the second value, and 1 if the first value is greater than the second value.

Return Value

Name Type Description
status int The result of the function call. Negative values represent errors.

The following table describes the results that this function returns.

Code Constant Description
0 or positive values Success.
–1 kCVITimeInvalidArgumentError An argument passed to the function is invalid.
–2 kCVITimeNullPointerError A NULL pointer was passed to the function instead of a valid memory address.
–3 kCVITimeOverflowError A numerical calculation resulted in an overflow.
–4 kCVITimeDateOutOfRangeError A time value passed to the function is not in the supported range.
–5 kCVITimeOperationFailedError The operation failed due to an unspecified system error.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 9.0 and later