Topic Author
Posts: 3
Joined: 14 Jul 2022, 15:46

How to do real time?

22 Dec 2022, 09:12

Hello all.

Can someone explain to me how I can create a real-time programme? What requirements do I have to fulfil? How do you create a real-time programme? Where can I find more information?

User avatar
Posts: 739
Joined: 21 Jun 2018, 10:33
Answers: 1
Location: Berlin

Re: How to do real time?

22 Dec 2022, 09:36

It highly depends on your definition of real-time. Even real-time has a cycle time, which the scheduler tries to ensure. Generally speaking you can run any application with real-time priorities, by prefixing the call with chrt (or set ilthe Prio directly in your code). Keep in mind that lots of stuff can and will break your rt cycle time if not done right (blocking stuff like io access etc).

User avatar
Posts: 70
Joined: 03 Jul 2020, 11:07

Re: How to do real time?

18 Jan 2023, 14:18

Hi mknopf,

real time programming is nothing you can learn from a post in a forum. There are many things you are not allowed to do in your real time application. And it starts with you need to ensure that your program doesn't need to load pages from the storage. So all parts of your real time application needs to stay in memory ( Then you need to make sure you never block on for example I/O. So you can't write any files or to any I/O from your real time thread/process. And many things more.

Realtime development has nothing to do with cyclic programming. An SPS uses a cycle which is deterministic and thus you can implement realtime use cases with it. Realtime only says an event can be handled in a defined time.

There are some limiting conditions on the RevPi. We use kernel threads with realtime priorities to implement the communication with the extension modules. Also some other driver use realtime priorities. Also the communticaton with the extension modules is done in a cyclic manner. Which leaves you with a delay from the point when an event occurred (on the extension modules) a until you can process this event.

I hope this rather shallow overview helped you.

Best regards,

Who is online

Users browsing this forum: No registered users and 1 guest