niHWS_GetScalingCoefficients

NI-HWS C Function Reference

niHWS_GetScalingCoefficients

C Function Prototype

tHWS_Status niHWS_GetScalingCoefficients (tHWS_WfmRef wfmReference, long numCoeffs, double* coeffArray, long* actualNumCoeffs);

Purpose

Retrieves the coefficients of an nth degree polynomial scaling function.

When an analog waveform stored as integer data is retrieved by a floating-point read or retrieve function, the data is scaled according to this polynomial scaling function.

Parameters

Name Type Description
wfmReference tHWS_WfmRef A reference to the waveform. Waveforms are identified by reference for purposes of setting and getting waveform attributes and reading and writing data.
numCoeffs long The number of coefficients to return in coeffArray.

If numCoeffs is 0, the number of coefficients in the polynomial are returned in the actualNumCoeffs.

If the number of coefficients in the polynomial is greater than the nonzero value of numCoeffs, then as many coefficients as can fit are returned in the coeffArray along with an error.

The actual number of coefficients returned in the coeffArray is always returned in actualNumCoeffs.

coeffArray double* The array of polynomial scaling coefficients. The coefficient for the nth term of the polynomial is returned in the nth index of the coeffArray.

For example, the coefficients for a 2nd-degree polynomial,

y = ax2 + bx + c

would be

coeffArray[0] = c
coeffArray[1] = b
coeffArray[2] = a

actualNumCoeffs long* The actual number of coefficients returned in coeffArray.

If numCoeffs is 0, the number of coefficients in the polynomial are returned in actualNumCoeffs.

If the number of coefficients in the polynomial is greater than the nonzero value of numCoeffs, then as many coefficients as can fit are returned in the coeffArray parameter along with an error.

Return Value