Opened 7 years ago

Closed 7 years ago

#4686 closed defect (fixed)

Problems with C-code generated from NF regarding boolean variables

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check https://libraries.openmodelica.org/branches/newInst/Modelica_3.2.2/files/Modelica_3.2.2_Modelica.Electrical.Analog.Examples.SwitchWithArc.err

The following error is reported:

Modelica_3.2.2_Modelica.Electrical.Analog.Examples.SwitchWithArc_02nls.c:45:94: error: no member named 'nominal' in 'struct BOOLEAN_ATTRIBUTE'
  sysData->nominal[i] = data->modelData->booleanVarsData[3].attribute /* switch2.quenched */.nominal;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        ^
Modelica_3.2.2_Modelica.Electrical.Analog.Examples.SwitchWithArc_02nls.c:46:94: error: no member named 'min' in 'struct BOOLEAN_ATTRIBUTE'
  sysData->min[i]     = data->modelData->booleanVarsData[3].attribute /* switch2.quenched */.min;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        ^
Modelica_3.2.2_Modelica.Electrical.Analog.Examples.SwitchWithArc_02nls.c:47:94: error: no member named 'max' in 'struct BOOLEAN_ATTRIBUTE'
  sysData->max[i++]   = data->modelData->booleanVarsData[3].attribute /* switch2.quenched */.max;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        ^
3 errors generated.

In fact, switch2.quenched has type Boolean, so it doesn't have max, min, nor nominal attributes. Why is the gnerated code referring to that?

Change History (1)

comment:1 by Francesco Casella, 7 years ago

Resolution: fixed
Status: newclosed

Fixed as of 07-02-2018, the reported model simulates and verifies successfully

Note: See TracTickets for help on using tickets.