Opened 5 years ago

Closed 5 years ago

#5970 closed defect (fixed)

Compile error on array of models with expandable connector

Reported by: ijknabla@… Owned by: Per Östlund
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 by Francesco Casella, 5 years ago

Component: FrontendNew Instantiation
Milestone: NeedsInput1.16.0
Owner: changed from somebody to Per Östlund
Status: newassigned

@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 by Per Östlund, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed in bca2d571.

Note: See TracTickets for help on using tickets.