Admin Production ni-theme
Current Publication

Ramp

LabWindows/CVI

Ramp

Advanced Analysis Library Only

AnalysisLibErrType Ramp (ssize_t numberOfElements, double initialValue, double finalValue, double ramp[]);

Purpose

Generates an output array that represents a ramp pattern. Ramp obtains the ith element of the output array using the formula:

rampi = initial + iΔx where

Setting the final value less than the initial value generates a negatively sloped ramp pattern.

Example Code

/* The following code generates the pattern {-5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0}. */
double rampvals[11], first, last;
int n;
n = 11;
first = -5.0;
last = 5.0;
Ramp (n, first, last, rampvals);

Parameters

Input
Name Type Description
numberOfElements ssize_t Number of elements to generate in the ramp pattern.
initialValue double Base value of the ramp pattern to generate.

Default Value: 0.0.
finalValue double Final value of the ramp pattern to generate.

If finalValue is greater than initialValue, Ramp generates a positively sloped ramp. To generate a negatively sloped ramp pattern, set finalValue less than initialValue.

Default Value: 1.0.
Output
Name Type Description
ramp double [] Generated ramp pattern.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later

Examples

Refer to the following examples that use the Ramp function:

  • analysis\narrowbandfilter.cws

    Open example
  • analysis\polyfit1.cws

    Open example
  • analysis\pulse.cws

    Open example