DAQmxCreateTableScale
int32 DAQmxCreateTableScale (const char name[], float64 prescaledVals[], uInt32 numPrescaledValsIn, float64 scaledVals[], uInt32 numScaledValsIn, int32 preScaledUnits, const char scaledUnits[]);
Purpose
Creates and configures a scale that maps an array of prescaled values to an array of corresponding scaled values. NI-DAQmx applies linear interpolation to values that fall between the values in the table. Read operations clip scaled samples that are outside the maximum and minimum scaled values found in the table. Write operations generate errors for samples that are outside the minimum and maximum scaled values found in the table.
Parameters
Input
|
Name |
Type |
Description |
name
|
const char []
|
Identifies the custom scale for later use, such as when you create channels. |
prescaledVals
|
float64 []
|
An array of prescaled values. These values map directly to the values in scaledVals. |
numPrescaledValsIn
|
uInt32 |
The number of elements in prescaledVals. |
scaledVals
|
float64 []
|
An array of scaled values. These values map directly to the values in prescaledVals. |
numScaledValsIn
|
uInt32 |
The number of elements in scaledVals. |
preScaledUnits
|
int32 |
The units of the values to scale.
Value |
|
Description |
DAQmx_Val_Volts
|
|
volts |
DAQmx_Val_Amps
|
|
amperes |
DAQmx_Val_DegF
|
|
degrees Fahrenheit |
DAQmx_Val_DegC
|
|
degrees Celsius |
DAQmx_Val_DegR
|
|
degrees Rankine |
DAQmx_Val_Kelvins
|
|
kelvins |
DAQmx_Val_Strain
|
|
strain |
DAQmx_Val_Ohms
|
|
ohms |
DAQmx_Val_Hz
|
|
hertz |
DAQmx_Val_Seconds
|
|
seconds |
DAQmx_Val_Meters
|
|
meters |
DAQmx_Val_Inches
|
|
inches |
DAQmx_Val_Degrees
|
|
degrees |
DAQmx_Val_Radians
|
|
radians |
DAQmx_Val_g
|
|
G. 1 g is approximately equal to 9.81 m/s2. |
DAQmx_Val_Pascals
|
|
pascals |
DAQmx_Val_FromTEDS
|
|
Units defined by TEDS information associated with the channel. |
|
scaledUnits
|
const char []
|
The units you want to use for the scaled value. You can use an arbitrary value. |
Return Value
Name |
Type |
Description |
status
|
int32 |
The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. |