#5445 closed defect (fixed)
[NF] Synchronous operators are not allowed in if condition
Reported by: | anonymous | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | New Instantiation | Version: | |
Keywords: | synchronous | Cc: |
Description
In the new instantiation, it isn't possible to use synchronous operators in if equation condition
model Example Real x = time; Real y; parameter Boolean cond = false; equation when Clock() then if sample(cond) then y = sample(x); else y = 0; end if; end when; end Example; // ~/OpenModelica/OMCompiler/Compiler/NFFrontEnd/NFCeval.mo: 1657:9-1658:51]: // Internal error NFCeval.evalBuiltinCall: unimplemented case for sample
The same error happened with other synchronous operators, like hold.
Change History (4)
comment:1 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 6 years ago
comment:4 by , 6 years ago
You are right, with flag +d=-evaluateAllParameters instantiation correctly works for all operators, except backSample, shiftSample, noClock and hold.
model Example Real x; Real y; parameter Boolean cond = false; equation when Clock() then x = time; end when; if hold(cond) then y = hold(x); else y = 0; end if; end Example;
Note:
See TracTickets
for help on using tickets.
Fixed in b726183e.