[Rtai] Small control system proyect.

Robert Perez robertperez67 at hotmail.com
Fri May 8 17:43:03 CEST 2009


Apart from shm functions I believe that no more lib functions are called (but perhaps I will need some later).

If I understood well the docs of RTAI I must not call linux functions from control programs to maintain real time.

 

The idea I have is: master program set a flag in shm of control_prog1 to start an execution cycle and then master goes to sleep for 20ms.

control_prog1 awakes, executes a cycle then awakes the master to tell it that it has finished and then goes to sleep.

Master awakes, takes out the permissor from control_prog1 and gives it to control_prog2 and wakes up that process and then goes to sleep again.

That is the main loop of the processes involved unles a control_prog don't finish the cycle in 20ms, then the master awakes and send the overruned 

control_prog to sleep even if it didn't finish the cycle.

When the turn comes again for that cprog the master wakes it up and the cprog continues from the same place it was inside the cycle.

 

I think that to wake up the master module I could use some semaphore or futex (I'm reading docs on how to use them), but I don't

know if I can from the master, wake another RT_TASK.

I have seen that we could use names for RT processes and then access them by name.

Do you think this is a good way ?

 

Thanks in advance.

 

 
> Date: Fri, 8 May 2009 08:58:57 +0200
> From: mantegazza at aero.polimi.it
> To: robertperez67 at hotmail.com
> CC: rtai at rtai.org
> Subject: Re: [Rtai] Small control system proyect.
> 
> Robert Perez wrote:
> > Hi all.
> > 
> > 
> > 
> > I want to ask if it's possible to use linux + RTAI for the following scenario:
> > 
> > 
> > 
> > I want one (master) process to allow other (child) processes to run in an ordered fashion (by writing an enable bit in shm)
> > 
> > In addition this (master) process should be able to put a child running process to sleep if a 
> > 
> > certain condition is true and then awake the next one and so on.
> > 
> > 
> > 
> > Of course all of these should be RT processes.
> > 
> > This is for a hobby control system proyect I'm planning.
> > 
> > Also the child processes should be able to talk through shm.
> > 
> > 
> > 
> > I got it working part of it in linux but I will need real time to make it a serious project.
> > 
> > I am considering moving to RTAI but I want to know if its possible before reading lots of documentation.
> > 
> > BTW it is coded in C++ and I don't know if C++ is supported in RTAI.
> > 
> > 
> 
> A few things you can see here: 
> http://www.aero.polimi.it/mbdyn/mbdyn-rt/index.html, is in C++. It is 
> just a matter of initializing and staticalize everything in advance or 
> through a server process.
> 
> > 
> > Could somebody please tell me what functions should I use, or an idea on how to implement it ?
> > 
> 
> SHM a part what function calls do you use to have it work with Linux?
> 
> Paolo
> 
> > 
> > 
> > Thank you all and keep the good work!.
> > 
> > 
> > 
> > Robert Perez.
> > 
> > PD: for those interested, the humble proyect is here http://sourceforge.net/projects/freedcs/ and website http://freedcs.sourceforge.net/
> > 
> > _________________________________________________________________
> > ¡Invita a todos tus amigos de una sola vez! Pruébalo ahora
> > http://www.microsoft.com/latam/windows/windowslive/products/social-network-connector.aspx
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Rtai mailing list
> > Rtai at rtai.org
> > https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
> 
> 

_________________________________________________________________
¡Invita a todos tus amigos de una sola vez! Pruébalo ahora
http://www.microsoft.com/latam/windows/windowslive/products/social-network-connector.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20090508/4f57705e/attachment.htm>


More information about the Rtai mailing list