Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

how to access parameter from another model

how to access parameter from another model

I created two models A and B, in model A, its algorithm requires some parameters from model B to trigger a conditional event, vise versa for that in model B. So how do I gain the access to the parameters from another model and use that to trigger the events from the current model?

i.e.
model A
discrete x;
Boolean conditionA;
algorithm
when pre(conditionB) then
x := 3
end when
end A;

model B
discrete y ;
Boolean conditionB;
algorithm
when pre(conditionA) then
y := 5;
end when;
end B;

in this case, the model A need access to the Boolean variable "condition" in model B.

not sure if this is an appropriate example, please help me. thanks in advance!

Re: how to access parameter from another model

should i use connector or global variable or just simply dot notation? im a noob so help please.

There are 0 guests and 0 other users also viewing this topic
You are here: