Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Selecting Generate SC will produce a C file:

 

4. Evaluated Examples

In the following, you find the examples used for evaluation. Be advised that there currently is no tool integrated evaluation possible. Please refer to the SCCharts superpage for the project status and known limitations.

Example SCChart  (Graphical)SCChart (Textual SCT)
shifter3  
Code Block
titleabo.sct
scchart shifter3 {
 input signal int I = 1;
 signal int S0;
 signal int S1;
 output signal int O;
 region R1:
 initial state I2
 --> I2 with pre(S0) / S1(pre(val(S0)));
 region R0:
 initial state I1
 --> I1 with pre(I) / S0(pre(val(I)));
 region R2:
 initial state I3
 --> I3 with pre(S1) / O(pre(val(S1)));
}
reincarnation  
Code Block
titleabo.sct
scchart reincarnation {
  input signal A;
  output signal gotS;
  region R0:
  initial state Reincarnation {
    signal S;
    region R0:
    initial state I
    --> C1 immediate;
    state p;
    final state r;
    state q
    --> r with A / S;
    state C1
    --> p immediate with S / gotS
    --> q immediate;
  }
  >-> Reincarnation;
}
cabin  
Code Block
titleabo.sct
scchart Cabin {
  input signal Stop;
  input signal CabinStopped;
  input signal DoorIsOpen;
  input signal DoorOpen;
  input signal DoorSensor;
  input signal DoorIsClosed;
  input signal DoorClose;
  input signal TimerExpired;
  output signal StartOK;
  output signal OpenDoorMotorOff;
  output signal OpenDoorMotorOn;
  output signal StartTimer;
  output signal CloseDoorMotorOn;
  output signal CloseDoorMotorOff;
  region R0:
  initial state I
  --> Open immediate with / OpenDoorMotorOn;
  state Open
  --> S0 with DoorIsOpen / OpenDoorMotorOff;
  state S0 {
    region R0:
    initial state Initial
    --> S0 immediate with / StartTimer;
    state S0
    --> S1 with TimerExpired | DoorClose / CloseDoorMotorOn;
    state S1
    --> S2 with DoorIsClosed / StartOK;
    final state S2;
  }
  o-> I with DoorOpen | DoorSensor / CloseDoorMotorOff
  >-> S1 with / CloseDoorMotorOff;
  state S1
  --> S2 with Stop;
  state S2
  --> I with CabinStopped;
}
reactor control  
Code Block
titleabo.sct
scchart Module_ReactorControl {
  output signal PullOutRods;
  output signal PushInRods;
  input signal Start;
  input signal OverHeated;
  input signal CooledDown;
  signal unsafe;
  region main:
  initial state init0 "I"
  --> ParallelStatementList40state immediate;
  state ParallelStatementList40state {
    region R0:
    initial state init1 "I"
    --> Await43state immediate;
    state Await43state {
      region R0:
      initial state init2 "I"
      --> S18 immediate;
      state S18 "18"
      --> S23 with Start / PullOutRods;
      state S23 "23";
    }
    o-> Await43state with unsafe;
    region R1:
    initial state init3 "I"
    --> S94 immediate;
    state S94 "94"
    --> S134 immediate with unsafe / PushInRods;
    state S134 "134"
    --> S94 with !unsafe;
    region R2:
    initial state init4 "I"
    --> S193 immediate;
    state S193 "193"
    --> Sustain68state immediate with OverHeated;
    state Sustain68state {
      region R0:
      initial state init5 "I"
      --> S227 immediate with / unsafe;
      state S227 "227"
      --> S227 with / unsafe;
    }
    o-> S193 with CooledDown;
  };
}