From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

Content Type
Programming Language
Current manual

TDMS_CreatePolynomialScalingInfo

TDMS_CreatePolynomialScalingInfo

int TDMS_CreatePolynomialScalingInfo (TDMSAnyHandle handle, double coefficients[], size_t numberOfCoefficients, int inputSource, int *scaleID);

Purpose

Creates polynomial scaling information for one or more channels. A polynomial scale uses an nth-order polynomial equation of the form:
P(x) = a0 + a1x + a2x2 + ... + anxn

Once scaling information has been created for a channel, TDMS_GetDataType will report the type of the channel as TDMS_Double and TDMS_GetDataValues will return the scaled data values. The read functions in the Advanced Synchronous and Asynchronous I/O class will still return the unscaled data values.

(Linux) This function is not supported.

Parameters

Input
Name Type Description
handle TDMSAnyHandle A file, channel group, or channel handle. The scaling information is stored as properties of the specified file, channel group, or channel.

If you pass a channel handle, the scaling information will apply only to that channel. If you pass a channel group handle, the scaling information will apply to all channels in that channel group. If you pass a file handle, the scaling information will apply to all channels in that file. If scaling information has been created at multiple levels, the scaling information at the most specific level will take precedence. For example, scaling information on a channel will take precedence over scaling information on the containing channel group or the containing file.
coefficients double [] The coefficients for the polynomial scale. Each element of the array corresponds to a term of the equation. For example, if the fourth item in the array (at index three) is 9, the fourth term of the equation is 9x3.
numberOfCoefficients size_t The number of coefficients in the array specified by the coefficients parameter.
inputSource int The scale ID representing the scaling information that will be applied before the scaling information added by this function is applied. Pass -1 if no scaling information should be applied first. When you pass -1 the scaling information added by this function will replace any existing scaling information for the specified file, channel group, or channel.

You can use this parameter to combine multiple scales to create a compound scale. You do this by passing the value of the scaleID output parameter from one scaling function as the value of the inputSource input parameter of another scaling function.
Output
Name Type Description
scaleID int A scale ID representing the scaling information created by this function. If you passed a value other than -1 for the inputSource parameter, then this scale ID represents the cumulative scaling information represented by that parameter plus the scaling information created by this function.

You only need this value if you want to pass it as the value of the inputSource parameter to another scaling function. If you do not need this value you can pass NULL for this parameter.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. Unless otherwise stated, zero represents successful execution and a negative number represents the error code.

Error codes are defined in cvi\include\cvitdms.h.

Additional Information

Library: TDM Streaming Library

Include file: cvitdms.h

LabWindows/CVI compatibility: LabWindows/CVI 2013 and later

© 2016 National Instruments. All rights reserved.

Was this information helpful?

Help us improve your future ni.com experience.

What are you trying to do?

Submit