Opened 13 years ago

Last modified 13 years ago

#1684 closed defect (fixed)

cannot use Modelica.Mechanics.MultiBody.Frames.from_nxz in algorithm section

Reported by: choeger Owned by: choeger
Priority: high Milestone:
Component: Version: trunk
Keywords: Cc: choeger,

Description


The following model will produce fault c-code in omc release 1.8.0 (r10974)

{{model Foo}}
{{  import Modelica.Mechanics.MultiBody.Frames;}}
{{  }}
{{  Frames.Orientation o;}}

{{  algorithm}}
{{  o := Frames.from_nxz({1,0,0}, {0,0,1});}}
{{end Foo;{{
}}}}

This one will not:


{{model Foo}}
{{  import Modelica.Mechanics.MultiBody.Frames;}}
{{  }}
{{  Frames.Orientation o = }}{{Frames.from_nxz({1,0,0}, {0,0,1});}}
{{end Foo;{{
}}}}

Change History (2)

comment:1 Changed 13 years ago by sjoelund.se

$Po is a record, but its reference is not generated in _Foo.h. The problem is of course that the data layout is struct(real_array,real_array) which cannot be copied directly.

Assignments to records should become an assignment of each component in succession.

comment:2 Changed 13 years ago by sjoelund.se

Fixed in r11052. Testcase added as testsuite/libraries/msl31/simulate/Modelica.Mechanics.MultiBody.Frames.mos

Note: See TracTickets for help on using tickets.