Indexer Function

Simulation VI and Function

Indexer Function

Owning Palette: Utilities Functions

Installed With: Control Design and Simulation Module

Indexes a waveform or array by the current simulation time.

Details  Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Place on the block diagram  Find on the Functions palette

Dialog Box Options

ParameterDescription
Polymorphic instanceSpecifies whether the type of the Input to this function is an Array, Point Array, Waveform, XY Graph, 2D Array, or 2D Point Array.
ParametersLists all the parameters associated with this function. Select a parameter from this list to configure the parameter. When you select a parameter, the parameter and its associated Parameter source control appear in the Parameter Information section of the configuration dialog box.
PreviewDisplays a graphical preview, if available, of the function output or configuration.
Parameter InformationContains the parameters you can configure for this function. You must select a parameter from the Parameters list to make that parameter and its associated Parameter source control visible in the Parameter Information section of the configuration dialog box.
Parameter sourceSpecifies whether you configure this parameter using the Configuration Dialog Box or a Terminal on the simulation diagram. The default value is Configuration Dialog Box. If you select Terminal, LabVIEW displays an input for that parameter on the simulation diagram, and you can wire values to that input to configure this function programmatically. If you select Configuration Dialog Box, LabVIEW removes that input from the simulation diagram. You then must set the value for this parameter inside the configuration dialog box.
Extrapolate?Extrapolate? is TRUE if you want this function to extrapolate linearly values outside of the values you specify in the Input. Extrapolate? is FALSE if you do not want this function to extrapolate linearly values outside the value you specify in the Input. The default value is FALSE.
Indexing ModeSpecifies the method by which this function indexes the Input. The available methods depend the value you specify for the Polymorphic instance parameter. If you specify the Array or 2D Array version of this function, you can select from the following methods:
  • Fraction of Simulation Time Interval—(Default) Specifies that this function determines the time interval, or duration, between data points in the array by dividing the interval between the initial time and the final time of the simulation by the number of data points in the array.
  • Base Time Step—Specifies that this function uses the time step of the simulation as the time interval, or duration, between data points in the array.
If you specify the Waveform version of the function, you can select from the following methods:
  • Set Waveform t0 to Simulation Initial Time—(Default) Specifies that this function equates the simulation initial time to the t0 of the waveform and indexes the waveform as the simulation time progresses. If the simulation time exceeds the waveform time, the function fixes the output to the final value of the waveform.
  • Use actual Waveform t0 and assume Simulation Time in seconds—Specifies that this function indexes the waveform directly from the simulation time. If the simulation time is less than the t0 of the waveform, the function sets the output equal to the t0 waveform value. If the simulation time exceeds the waveform time, the function fixes the output to the final value of the waveform.
Indexed DimensionSpecifies which dimension of this two-dimensional array contains the array index. You can choose from Columns or Rows. This parameter is valid only when you select 2D Array from the Polymorphic instance pull-down menu.

Block Diagram Inputs

ParameterDescription
Extrapolate?Extrapolate? is TRUE if you want this function to extrapolate linearly values outside of the values you specify in the Input. Extrapolate? is FALSE if you do not want this function to extrapolate linearly values outside the value you specify in the Input. The default value is FALSE.
InputSpecifies the input to this function. This input either is a waveform, XY graph, point array, array, two-dimensional array, or two-dimensional point array, depending on the value you select from the Polymorphic instance parameter on the configuration dialog box of this function. You can choose from the following options:
  • Array—Specifies an array of values to index by the current simulation time step. This function returns the nth value of the array where n is the current time step of the simulation. This function indexes the array according to the Indexing Mode you specify. You also can select the 2D Array option to specify the input is a two-dimensional array.
  • Point Array—Specifies an array of x, y points to index by simulation time. This function returns the y value corresponding to the x value that matches the current simulation time. If the simulation time lies between two x values, this function linearly interpolates the result. You also can select the 2D Point Array option to specify a two-dimensional point array.
  • Waveform—(Default) Specifies a waveform containing Y values to index by simulation time. This function outputs the Y value corresponding to the point in the waveform whose time matches to the current simulation time. If the simulation time lies between two time steps in the waveform, this function linearly interpolates the result. This function indexes the array according to the Indexing Mode you specify. Waveform inputs include the following components:
    • t0—Specifies the start time of the waveform.
    • Y—Contains the data values of the waveform.
    • dt—Specifies the time interval, or duration, between data points in the waveform.
  • XY Graph—Specifies an XY graph containing an array of x, y points to index by simulation time. This function returns the y value corresponding to the x value that matches to the current simulation time. If the simulation time lies between two x values, this function linearly interpolates the result. XY graph inputs include the following components:
    • X Array—Contains the time values of the XY graph that correspond to the data values stored in Y Array.
    • Y Array—Contains the data values of the XY graph that correspond to the time values stored in X Array.
Indexing ModeSpecifies the method by which this function indexes the Input. The available methods depend the value you specify for the Polymorphic instance parameter. If you specify the Array or 2D Array version of this function, you can select from the following methods:
  • Fraction of Simulation Time Interval—(Default) Specifies that this function determines the time interval, or duration, between data points in the array by dividing the interval between the initial time and the final time of the simulation by the number of data points in the array.
  • Base Time Step—Specifies that this function uses the time step of the simulation as the time interval, or duration, between data points in the array.
If you specify the Waveform version of the function, you can select from the following methods:
  • Set Waveform t0 to Simulation Initial Time—(Default) Specifies that this function equates the simulation initial time to the t0 of the waveform and indexes the waveform as the simulation time progresses. If the simulation time exceeds the waveform time, the function fixes the output to the final value of the waveform.
  • Use actual Waveform t0 and assume Simulation Time in seconds—Specifies that this function indexes the waveform directly from the simulation time. If the simulation time is less than the t0 of the waveform, the function sets the output equal to the t0 waveform value. If the simulation time exceeds the waveform time, the function fixes the output to the final value of the waveform.
Indexed DimensionSpecifies which dimension of this two-dimensional array contains the array index. You can choose from Columns or Rows. This parameter is valid only when you select 2D Array from the Polymorphic instance pull-down menu.

Block Diagram Outputs

ParameterDescription
Interpolated valueReturns the output value associated with the current simulation time using the method you specify for the Indexing Mode parameter.

Indexer Details

This function operates like the auto-indexing input tunnel of a While Loop or For Loop. However unlike the auto-indexing input tunnel, this function indexes the waveform or array based on the simulation time rather than the iteration of the loop.

This function linearly interpolates the value if there is no point in the signal that directly corresponds to the current simulation time.

Feedthrough Behavior

All input/output pairs of this function have direct feedthrough behavior.

Example

Refer to the indexer VI in the labview\examples\Control and Simulation\Simulation\Utilities directory for an example of using the Indexer VI.

 Open example  Browse related examples