TAGGED: scade
-
-
November 22, 2024 at 9:44 pmfdtsaidSubscriberIn
chapter 2.1.6 Operator instantiation
ofScade Primer
, there is a scade program as follows:const max: uint64 = 10;node sigma (e:uint64) returns (sum:uint64)letsum = 0 -> e + pre sum;telnode sample() returns (s:uint64)lets = (restart sigma every (pre s > max))(count());telIn lines = (restart sigma every (pre s > max)) (count());Shouldpre s > max
betrue -> (pre s > max)
? Because "the reset condition of restart-every cannot be delayed". -
November 25, 2024 at 2:15 pmBenjamin DescorpsAnsys Employee
Hello,
Indeed, use of the pre operator is incorrect, missing an init clause.
You can replace :
s = (restart sigma every (pre s >= max))(count ());
by, either:
s = (restart sigma every (fby(s;1;0) >= max))(count ());
or
s = (restart sigma every ((0-> pre s) >= max))(count ());
The error will be fixed in the next SCADE version.
Benjamin
-
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
Top Contributors
-
1216
-
543
-
523
-
225
-
209
Top Rated Tags
© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.