The problem is that Modelica-based state-machines (e.g. the clock-based ones in 
the new Modelica 3.3. standard)
or in older libraries, or the state-charts in ModelicaML usually refer to time 
is some way.

I assume you only want an FSM driven by some eventgenerator of your own?

Peter F

-----Original Message-----
From: owner-openmodelicainter...@ida.liu.se 
[mailto:owner-openmodelicainter...@ida.liu.se] On Behalf Of Mihai T. Lazarescu
Sent: den 25 mars 2013 11:59
To: openmodelicainterest@ida.liu.se
Subject: Re: Generate C code for external (real-time) environment

Hi Peter,

Thanks for the reply.

I'm looking for something along the lines of Simulink Coder:

    http://www.mathworks.it/products/simulink-coder/description5.html

The purpose is to use OpenModelica to define some blocks of a system in terms 
of FSMs:

    https://en.wikipedia.org/wiki/Finite-state_machine

These should be:

** simulatable within OpenModelica the usual way;

** exportable (e.g., as a stand-alone C function) that I can
   then wrap and include in a completely different (embedded)
   system (e.g., a wireless sensor node -- WSN).

In other words, I try to use OpenModelica as high level functional input 
environment (e.g., for developers with no programming skills), with:

** testing capabilities (usual OpenModelica simulation);

** export capabilities (standalone C code generation).
   By these I mean something like:

   -- FSM conditions be encoded as either plain C 'if' or calls
      to functions that compute them -- these functions should
      be generated alongside the FSM C code;

   -- FSM states are decoded using C 'switch' or equivalent
      constructs;

   -- the I/O ports of the OpenModelica block are encoded in
      C as, e.g., function formal arguments (one of these may
      be the system time, if needed).

We intend to use this flow and models as part of a free software high level 
synthesis of WSN applications.  The developer should be able to input the 
top-level operation of a WSN node, such as:

    'every minute read the temperature from port T and send
    it to the average block on port Ain.  Every 60 minutes
    read the output of the average block from port Aout and
    send it to the radio input port TX for transmission'.

Is there an OpenModelica export functionality close to this that I can use and, 
possibly, adapt?  The API of the generated code is not critical, but the code 
should be self-consistent -- it should not make references to simulator or 
other external libraries.

I hope this is more clear.  Let me know if you need more info.

Thanks,
Mihai

On Mon, Mar 25, 2013 at 09:05:26AM +0000, Peter Fritzson wrote:

> Hi Miahi,
> 
> You have to be more specific.
> 
> How is the C code generated from your state diagram (what kind of 
> state diagram) supposed to interact with the RTOS?
> 
> What kind of API do you use?
> 
> Peter F
> 
> -----Original Message-----
> From: owner-openmodelicainter...@ida.liu.se 
> [mailto:owner-openmodelicainter...@ida.liu.se] On Behalf Of Mihai T. 
> Lazarescu
> Sent: den 23 mars 2013 21:01
> To: openmodelicainterest@ida.liu.se
> Subject: Generate C code for external (real-time) environment
> 
> I'm new to OpenModelica and I'm looking for a free or commercial 
> generator of C code that can be integrated in an external execution 
> environment (e.g., as a task in an embedded RTOS).
> 
> The source for the generator is a state diagram.
> 
> All I can find are generators for Modelica simulations.
> 
> Thank you.
> 
> Mihai
> 

Reply via email to