Skip to content

Lookup 2D Table Column and Row Parameters exchanged in FMU Interface #37

@erlinghs

Description

@erlinghs

Hello together,

we just noticed that the column and row are exchanged from a Lookup 2D Table in Simulink in the FMU Parameter interface (XML).
This issue is just concerning the parameter "name" in the XML. The parameter "valueReference " is totally fine.

For example, if the table in Simulink Lookup 2D Table looks like this:
A=[
0 1 2
0 1 2
0 1 2
0 1 2]

So 4 rows and 3 columns.
In the XML the tunable Parameter "name" A should be listed with its default parameters like this if I'm correct.

A[1,1]=0
A[1,2]=1
A[1,3]=2

A[2,1]=0
A[2,2]=1
A[2,3]=2

A[3,1]=0
A[3,2]=1
A[3,3]=2

A[4,1]=0
A[4,2]=1
A[4,3]=2

But what happens with the parameter "name" is this in the XML:

A[1,1]=0
A[1,2]=0
A[1,3]=0

A[2,1]=0
A[2,2]=1
A[2,3]=1

A[3,1]=1
A[3,2]=1
A[3,3]=2

A[4,1]=2
A[4,2]=2
A[4,3]=2

For the row entries it reads out the column and if the last index of the row is reached A[1,3]=0 it just writes the next index of the column in the next row A[ 2,1] = 0. Then it has read one full column and writes the next first column entry where it stopped in the row A[2,2]=1

To reproduce this just create a Lookup 2D Table in Simulink and make the table parameter tunable.
Generate the FMU and check the XML with its Parameters.

The simulation results between Simulink model and FMU are the same. Therefore, i guess the generated Code is correct. Just the connection between tunable parameter index and actual table in the code is off.

Is there a way to correct this?

Thanks alot in advance.

Best Regards
Stefan

Expected behaviour and actual Simulink Lookup 2D Table parametrization from a more complex table:
image
Read out from XML or loaded FMU in Simulink Parameter interface:
image

Simulink 2017b, 2018b, 2020b
Simulix Version 1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions