Admin Production ni-theme
Current Publication

CVITimeIntervalToTimeUnit

LabWindows/CVI

CVITimeIntervalToTimeUnit

int CVITimeIntervalToTimeUnit (CVITimeInterval interval, CVITimeUnit unit, CVITimeRoundMethod rounding, __int64 *value);

Purpose

Converts a time interval value to the specified time unit using the specified rounding method.

Parameters

Input
Name Type Description
interval CVITimeInterval Time interval value in National Instruments Binary Time Format.
unit CVITimeUnit The time unit of the argument you pass to the value parameter.

You can specify the following values:

Constant Value
CVITimeUnitAttoseconds CVITimeUnitBase + 30UL
CVITimeUnitFemtoseconds CVITimeUnitBase + 33UL
CVITimeUnitPicoseconds CVITimeUnitBase + 36UL
CVITimeUnitNanoseconds CVITimeUnitBase + 39UL
CVITimeUnit100Nanoseconds CVITimeUnitBase + 41UL
CVITimeUnitMicroseconds CVITimeUnitBase + 42UL
CVITimeUnitMilliseconds CVITimeUnitBase + 45UL
CVITimeUnitSeconds CVITimeUnitBase + 48UL
CVITimeUnitMinutes CVITimeUnitBase + 50UL
CVITimeUnitHours CVITimeUnitBase + 52UL
CVITimeUnitDays CVITimeUnitBase + 54UL

CVITimeUnitBase is defined as 919263177UL - 48UL.
rounding CVITimeRoundMethod The rounding method to apply when converting a time interval value to the specified units.

You can specify the following values:

Contant Description
CVITimeRoundMethodNear Round toward nearest value or if equidistant, round toward even value.
CVITimeRoundMethodTruncate Truncate fraction and round toward zero.
CVITimeRoundMethodUp Round toward positive infinity.
CVITimeRoundMethodDown Round toward negative infinity.
Output
Name Type Description
value __int64 The value of the time interval in the specified units.

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