Go Down

Topic: Simple Modbus (Read 340 times) previous topic - next topic

LennReebergen

Hello,

I use a Modus Master and Slave between Arduino DUE,s

I want to add other functions such as:

Read_coil_status
Read_input_status
Read_input_staus
Forse_single_Coil etc.

I'm looking for an example with more function's as the standard library, because I am still unable to implant it

Or perhaps where i can find more information how I can add more functions.

Lenn

ard_newbie

#1
May 01, 2019, 04:51 pm Last Edit: Jun 07, 2019, 01:05 pm by ard_newbie
There is a .pdf that presents and explains all the available functions you can have with SimpleModbus library:

https://github.com/jecrespo/simple-modbus/blob/master/Modbus%20RTU%20libraries%20for%20Arduino/SimpleModbusMasterManual.pdf

To upload the library,there is an issue (I don't know why). But, all you have to do, if you want e.g. use your DUE as a MODBUS Master is:

- Open a new IDE window, name it e.g. MyModbus, then click in the little arrow in the top right of the window and select New Tab (You will see a yellow band).

- Name this New file  SimpleModbusMaster_DUE.h , copy and paste this file from the library into your SimpleModBusMaster_DUE.h.  

- Do that again but this time for SimpleModbusMaster_DUE.cpp that you will save in your SimpleModBusMaster_DUE.cpp .

- Copy the sketch of the example provided. Change the include to have:
#include "SimpleModBusMaster_DUE.h"

Because the library is now in the same folder as your Modbus example folder.


You can now modify the provided example sketch.


LennReebergen

Hello,

First thanks for the response.

I have already the simple master and Slave Modbus installed it works, that is not the problem.

And I have already download the .pdf file with the explanation.

The problem is that the explanation is not entirely clear for my.

So I looking for the simple Modbus library to which some functions have already  been added.

So I can see how you approach this.

I'm an new user, everything is not entirely clear for my.
 

ard_newbie

Since MODBUS is a standard protocol, this tutorial is relevant for any MODBUS library:

https://www.camillebauer.com/src/download/Modbus_Basics.pdf

LennReebergen

OK thanks I'm going to see if I can continue with this.

I think it's not easy for my.

Lenn

Go Up