Manipulating Model Components in Flattened Format

Format data as flattened 1D arrays in column-major order for inports, outports, signals, and vector parameters.

When you use the LabVIEW Model Interface Toolkit VIs to transfer data to model components, such as inports and parameters, in several cases you must format the data as flattened 1D arrays of values in column-major order.

Format of Inport, Outport, and Signal Values

You must format the data as flattened arrays when you perform the following tasks with the LabVIEW Model Interface Toolkit VIs:

  • Setting inport values—Specify all inport values in a flattened array.
  • Getting outport values—LabVIEW returns all outport values in a flattened array.
  • Getting signal values—LabVIEW returns all signal values from a particular time step in a flattened array.
  • In the following table each row represents a separate component of the same type, such as an inport, outport, or signal:

    Table 5. Model Components
    Index in model Value
    0 1
    1 [-0.777778, 0.5;-0.666667, 0]
    2 3

    The Model Interface API represents these components with the following flattened 1D array in column-major order: [1, -0.777778, -0.666667, 0.5, 0, 3].

    Format of Vector Parameters

    To set or get the value of a particular element within a 2D vector parameter, you must identify the offset of that specific element within the flattened 1D array that represents the vector. Consider the following 2 × 2 vector parameter:

    [-0.777778, 0.5;

    -0.666667, 0]

    The following table lists the offset values you use to identify each element in the parameter:

    Table 6. Offset Values
    Value Column number Row number Offset within parameter
    -0.777778 0 0 0
    0.5 1 0 2
    -0.666667 0 1 1
    0 1 1 3