Realtime with CAN & Background Services

Moderator: RevPiModIO

moritzderhorl
Posts: 1
Joined: 14 Aug 2025, 08:56

Realtime with CAN & Background Services

Post by moritzderhorl »

Good day to all you awesome RevPi-Persons!

I have a use-case for my RevPi that requires realtime performance and would love some pointers into the right direction(s).

The system consists of a measurement equipment transmitting data via CAN (either a PCAN-USB oder a CAN module for the RevPi) and multiple things that need to happen with that data:
  • RT: process data and set AIO/DIO according to programmed logic
  • Non-RT: stream data to a separate process to display and store it
The data from the equipment is somewhat dense as there are multiple 16-bit values streamed with roughly 10kHz.
The current implementation which only does the Non-RT part (processing the measurement data and storing it) can handle that throughput.

I have looked through the following ressources:
viewtopic.php?p=9224&hilit=realtime#p9224
https://revpimodio.org/revpipyplc/
https://revolutionpi.com/de/docs/codesys

I have my fair share of experience both on RevPi, Python and Linux, but the RT-stuff is sparcely documented and quite complex to me.

My Codebase is in Python and directly interacts with the CAN interface.

My relevant questions for you are:
  • Can the RevPi take my datastream, process it in RT and then pass it on to a non-critical process?
  • Are there requirements, caveats or best-practices for writing "RT"-Python?
  • Do you have pointers for ressources or how to scaffold / design this system?
Thanks for all your hard work and answers.

Best
Moritz