New features in version 2.40

 
  1. High Availability Applications
  2. For high availability applications it is desirable to detect serious errors happening outside the state machine code but effecting the correct execution of the the state machine. Such errors might come from a runaway pointer overwriting key variables, power brownout corrupting a bit or a bad ram cell losing a bit to name a few. To detect and handle such situations is an overall system design task. But the code generator can help you to detect inconsistencies of the state machine offering the following two mechanisms:

  3. •You can provide error handler code that is executed in the default path of the switch/case statements. This helps to detect undefined values of the state variables. See configuration key ’UnknownStateHandler’.

  4. •The code generator optionally generates a validate function that checks if a transition from the present state to a new target state is allowed (i.e. modeled in the state diagram).
    In a single CPU set-up the validation function runs on the same controller that executes the state machine code. But it is also possible to execute the validate function on a second CPU in a redundant CPU setup.


  1. Example state machine code:



  2. switch (instanceVar->stateVarS1) {

  3. case S11:

  4.     if(msg==(TESTCASE_EVENT_T)ev1212){

  5.         /* Transition from S11 to S13 */

  6.         testValidationHandler(S11, S13, instanceVar->inst_id);

  7.         ...


  8.     }else if(msg==(TESTCASE_EVENT_T)evC){

  9.         /* Transition from S11 to S21 */

  10.         testValidationHandler(S11, S21, instanceVar->inst_id);

  11.         ...


  12.     ...

  13.     default:

  14.         errorHandler();

  15.     break;

  16.     ...




  1. Your validation function:



  2. void testValidationHandler(uint16_t from, uint16_t to, uint8_t machineId){


  3.     uint16_t retCode;


  4.     retCode = testValidate(from, to); // generated function

  5.     if(retCode!=0U){

  6.     // your error handling code

  7.       exit(1);

  8.     }else {

  9.       return;

  10.     }

  11. }






  1. Improved support for multiline actions
  2. Multiline actions in events or states are now fully shown in the internal visual editor. This could be reached by using the HTML feature of the DOT renderer. Therefore it is required that you use the latest version of Graphviz. See the image below for an example.


  1. Copy state diagram image to the clipboard
  2. It is now possible to copy the present state diagram image to the clipboard. Just right-click on the image and select ‘copy’.

Change rank direction
  1. Sometimes the layout is better to read if it is from top to down. Sometimes its better from left to right. Now you can select between the two rank directions. The following images show the oven state machine from the manual when using the two layout options. 





  2. Better support for memory constraint devices
  3. It is highly desirable to avoid pointer usage where possible in some very RAM constraint micro controllers. The *isIn* and *resetHistory* functions can now use an instance pointer or the instance variable depending on the parameter UseInstancePointer. This also allows to keep the instanceVar static which allows a C-compiler to create very compact code.



Download the latest update - it is free for registered users.
 

23.05.2011

 
 

next >

< previous