Opened 17 years ago

Last modified 12 years ago

#139 closed defect (fixed)

Input-input and output-output connection does not return any error and equation are not reported.

Reported by: donida Owned by: donida
Priority: critical Milestone: 1.9.0
Component: Frontend Version:
Keywords: Cc: donida, Adrian Pop, Per Östlund

Description

Read comments

Change History (6)

comment:1 by donida, 17 years ago

The input to input and output to output connections do not cause any error, for example:

package io

model in1

Modelica.Blocks.Interfaces.RealOutput a;

end in1;

model in2

Modelica.Blocks.Interfaces.RealOutput a;

end in2;

model in1_in2

in1 IN1;
in2 IN2;

equation

connect(IN1.a,IN2.a);
IN1.a=3;

end in1_in2;

end io;

In addition to this the equations of the in1 and in2 models do not appear in the instantiated models, for example:

package io

model in1

Modelica.Blocks.Interfaces.RealOutput a;

end in1;

model in2

Modelica.Blocks.Interfaces.RealOutput a;

equation

a=3;

end in2;

model in1_in2

in1 IN1;
in2 IN2;

equation

connect(IN1.a,IN2.a);

end in1_in2;

end io;

comment:2 by Peter Aronsson, 13 years ago

Is there some severe implementation issue why this bug hasn't been fixed? It is a rather fundamental connection constraint that isn't caught by the frontend.

comment:3 by Per Östlund, 13 years ago

I took a look at this and noticed that there was code written for this error, which was added as early as revision 429. It seems it was then broken in revision 977, and has remained broken since then. But the original code wasn't correct anyway, since it's allowed to connect input-input and output-output in some cases. Prefixes were not propagated correctly though, so it didn't matter since the code never triggered. I fixed the prefix propagation, corrected the check and various other broken stuff, but broke expandable connectors in the process. I'll try to fix that next week.

comment:4 by Per Östlund, 13 years ago

The correct answer from my side should have been: "Yes, there are severe implementation issues"... Regardless, I have now implemented a warning for connecting two sources to each other in revision 11934 and fixed some other issues with connections too, see test case mofiles/ConnectTwoSources. The reason why it's only a warning so far is because the BioChem library seems to connect sources to each others. There are lots of issues left with connections though, but I can't justify spending any more time on fixing things I'm trying to replace anyway. I will close this bug since I consider it fixed, but I have opened a new task #1747 for implementing all the rules for connections.

comment:5 by Martin Sjölund, 12 years ago

Milestone: 1.9.0

comment:6 by Martin Sjölund, 12 years ago

Component: InstantiationFrontend
Note: See TracTickets for help on using tickets.