Send Write Single Register by c code in Modbus

Topics about the Software of Revolution Pi
Post Reply
plima
Posts: 7
Joined: 04 Jun 2020, 17:20

Send Write Single Register by c code in Modbus

Post by plima »

Hi there,

I need to send a Write_Single_Register in a modbus master only once.
I have a custom console application written with c language and I am not being able to find out how can I achieve this.

Is it possible? How can I do this?
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: Send Write Single Register by c code in Modbus

Post by dirk »

Hi, this is an interesting requirement. This feature is not implemented. We have put it in our backlog as a feature request.
plima
Posts: 7
Joined: 04 Jun 2020, 17:20

Re: Send Write Single Register by c code in Modbus

Post by plima »

That's great news.

How can I follow the development? do you have a roadmap for it?
plima
Posts: 7
Joined: 04 Jun 2020, 17:20

Re: Send Write Single Register by c code in Modbus

Post by plima »

Any news about this development?
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Send Write Single Register by c code in Modbus

Post by Amar »

Hi Plima,
Here is a possible solution since we have not yet finalized on this feature request.piModbusMaster uses statically linked libmodbus library.

https://libmodbus.org/documentation/

In this case you can do as following:

1) piMaster service should not be running directly on startup
/lib/systemd/system/pimodbus-master.service

2) Start your required C application first to execute Write_Single_Register using the libmodbus API
https://libmodbus.org/documentation/

3) Then start piModbusMaster
sudo systemctl start pimodbus-master.service

Best Regards,
Amar
KUNBUS
Post Reply