Embedded Software

Embedded Software

Topics related to SCADE Suite, SCADE Display, SCADE One and more.

The “Reset condition” issue of scade example in Scade Primer

TAGGED: 

    • fdtsaid
      Subscriber
      In chapter 2.1.6 Operator instantiation of Scade Primer, there is a scade program as follows:
       
      const max: uint64 = 10;
      node sigma (e:uint64) returns (sum:uint64)
      let
        sum = 0 -> e + pre sum;
      tel 
      node sample() returns (s:uint64)
      let
        s = (restart sigma every (pre s > max))(count());
      tel
       
      In line 
      s = (restart sigma every (pre s > max)) (count());
       
      Should pre s > max be true -> (pre s > max)? Because "the reset condition of restart-every cannot be delayed". 
    • Benjamin Descorps
      Ansys 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.