Manipulating Model Components in Flattened Format

When you use the Model Interface 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

When you perform the following tasks with the Model Interface VIs, you must format the data as flattened arrays:

  • Setting inport values—You 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.

Consider the following table, where each row represents a separate component of the same type, such as an inport, outport, or signal.

Table 11.
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]

Related Links

Probing Signal Values

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 12.
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

Related Links

Initializing Parameter Values

Updating Parameters While the Model Runs