Modbus RTU MASTER

Topics about the Software of Revolution Pi
Post Reply
cerberus78
Posts: 3
Joined: 06 May 2024, 20:24

Modbus RTU MASTER

Post by cerberus78 »

Hello

I have configured revpi as shown in the tutorials.
I would like to build a c++ application that exchange data with one slave (sensor data) though modbus RTU..

to do so, what do you recommend?
Use piControl to read write on variables ? Or try to find a library to do so ?
I need to quickly get the project working to do feasibility to order more revPi if the feasibility is successful.

Thank you
User avatar
dirk
KUNBUS
Posts: 1970
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU MASTER

Post by dirk »

Hi cerberus78,
if you want to use C/C++ take a look at the video tutorial
https://revolutionpi.com/en/tutorials/v ... rials#VT13
You can use it as an idea for your own code. You can download the example code here:
https://revolutionpi.com/en/tutorials/downloads#coding
PiTest Demo with source code (ID: 1149)

The following tutorial can also be interesting
https://revolutionpi.com/en/tutorials/v ... rials#VT25
It shows how to create your own RAP file with the RevPiTimer as draft.
cerberus78
Posts: 3
Joined: 06 May 2024, 20:24

Re: Modbus RTU MASTER

Post by cerberus78 »

Great thank you ! Ill use that as a start

I'm developing an application that will interact with the picore controller using C/C++ code. I've encountered a scenario where multiple applications may attempt to access the same controller concurrently. I'm curious about how to handle this situation effectively to prevent conflicts and ensure the stability of the system.Specifically, if one application has already opened the controller, what happens when another application tries to open it again ?
Should I implement any specific mechanisms to manage concurrent access to the controller's resources?Any insights, best practices, or recommended approaches for managing concurrent access to controller resources in C/C++ applications would be greatly appreciated.
User avatar
dirk
KUNBUS
Posts: 1970
Joined: 15 Dec 2016, 13:19

Re: Modbus RTU MASTER

Post by dirk »

Hi cerberus78, the process image is accessed in kernel space. This access is therefore atomic, and that is one of the core revolutionary things about the Revolution Pi project.
Post Reply