Opened 4 years ago

Closed 4 years ago

#5970 closed defect (fixed)

Compile error on array of models with expandable connector

Reported by: ijknabla@… Owned by: perost
Priority: normal Milestone: 1.16.0
Component: New Instantiation Version: v1.14.0
Keywords: expandable connector array Cc:

Description

Hi, all

I want to run array of model, each model has Bus as expandable connector.

model ArrayWithBus

  expandable connector Bus
  end Bus;

  model Something
    connector RealOutput = output Real;
    RealOutput y = 0;
    Bus bus;
  equation
    connect(bus.y, y);
  end Something;

  Something[4] things;

end ArrayWithBus;

This code is OK with old frontend (Before OpenModelica 1.13.2)
But, have not worked with new frontend (After OpenModelica 1.14.0)

I tested code by 1.14.0, 1.14.1, and nightly build 1.16.0-dev.
All test shows dialog that indicate new frontend raises compile error.

I think, this code did not violate Modelica language standard.
Is it possible to compile this code with New frontend?

Best regerds.

Change History (2)

comment:1 Changed 4 years ago by casella

  • Component changed from Frontend to New Instantiation
  • Milestone changed from NeedsInput to 1.16.0
  • Owner changed from somebody to perost
  • Status changed from new to assigned

@perost, the model flattened with the NF reads

class ArrayWithBus
  Real things[1].bus.y "virtual variable in expandable connector";
  Real things[1].y = 0.0;
  Real things[2].y = 0.0;
  Real things[3].y = 0.0;
  Real things[4].y = 0.0;
equation
  things[1].bus.y = things[1].y;
  things[2].bus.y = things[2].y;
  things[3].bus.y = things[3].y;
  things[4].bus.y = things[4].y;
end ArrayWithBus;

It seems to me that the following declarations are missing:

  Real things[2].bus.y "virtual variable in expandable connector";
  Real things[3].bus.y "virtual variable in expandable connector";
  Real things[4].bus.y "virtual variable in expandable connector";

do I miss something?

comment:2 Changed 4 years ago by perost

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in bca2d571.

Note: See TracTickets for help on using tickets.