#5445 closed defect (fixed)
[NF] Synchronous operators are not allowed in if condition
Reported by: | anonymous | Owned by: | perost |
---|---|---|---|
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 Changed 5 years ago by perost
- Resolution set to fixed
- Status changed from new to closed
comment:2 follow-up: ↓ 3 Changed 5 years ago by anonymous
Still not work in b7a2c6913
comment:3 in reply to: ↑ 2 Changed 5 years ago by perost
comment:4 Changed 5 years ago by gossen
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;
Fixed in b726183e.