- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » tuple assignment not allowed .....
tuple assignment not allowed .. newer version or computer problem?
tuple assignment not allowed .. newer version or computer problem?
Hi,
I've got this error in building a model:
Tuple assignment only allowed when rhs is a function call
referring to this line of code
Code:
equation
(del, -vx) = ExternalFunc1(val);
ExternalFunc1() calls an external C function
This model works properly on my laptop with an old version of OM (1.5.0 5840 if I remember well)..
I passed it to another computer in which I installed the newest OM version (6380).
Is it due to the newer version or maybe I miss some files in the other computer?
Thanks in advance,
Francecso
Re: tuple assignment not allowed .. newer version or computer problem?
Hi,
We moved to a new way of generating the code, from
templates and I think this is a new error that showed up.
I added it to our tracker and we will look into it soon:
https://openmodelica.org:8443/cb/issue/1322
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: tuple assignment not allowed .. newer version or computer problem?
"The only way to call a function returning more than one result is to make the function call the right hand side of an equation or
assignment. In these cases, the left hand side of the equation or assignment shall contain a list of component
references within parentheses."
Your tuple contains a negated component reference, which is not allowed according to the specification. We made OMC more conforming to the specification with regard to function calls. For example, you can now omit -vx and just type del = ExternalFunc1(time). The error messages are as bad as always though.
- sjoelund.se
- 1700 Posts
Re: tuple assignment not allowed .. newer version or computer problem?
http://build.openmodelica.org/omc/builds/windows/ for Windows nightly builds (latest is Oct 12; r6338).
http://openmodelica.org/index.php/downl … load-linux for Linux nightly (latest is Oct 14; r6383).
- sjoelund.se
- 1700 Posts
Re: tuple assignment not allowed .. newer version or computer problem?
I'm sorry but I wrote a wrong number!
I'm already using the 6338 version.. I've got the problem with this version..
If it's a bug, has the 6133 version the same problem?
Excuse me again!
Re: tuple assignment not allowed .. newer version or computer problem?
Yes, but the problem is supposed to be there, as Modelica doesn't support function calls on the form you are describing
(a,b,c) = fn() is ok
(a,-b,c) = fn() is not
- sjoelund.se
- 1700 Posts
Re: tuple assignment not allowed .. newer version or computer problem?
sjoelund.se wrote:
Yes, but the problem is supposed to be there, as Modelica doesn't support function calls on the form you are describing
(a,b,c) = fn() is ok
(a,-b,c) = fn() is not
In this case it's not a big problem for me now..
Thanks again!
Francesco
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » tuple assignment not allowed .....