uldara1 / Modbus

This library using for generate and communication with Modbus RTU protocol
Other
2 stars 1 forks source link

Library description is missing important information #2

Open rob040 opened 1 year ago

rob040 commented 1 year ago

Congrats, your library is already available in Arduino IDE library manager, with description "Support Modbus RTU protocol with serial Port and TCP." Looking at the code, I see no TCP code. Neither do I see any Client code. So there are some limitations to this library,

Could you state exactly what this library is about. Also, On what kind of processors or HW has this been tested to work? Could you add more description? Take ArduinoModbus as an example.

uldara1 commented 1 year ago

thank @rob040 for your feedback currently i have some example and new feature ,but not yet commit to github

noahhjackson commented 1 year ago

Library looks great! I've been looking for an arduino modbus library that doesn't require RS485. Do you have client and server examples? I'm looking to implement this in my project. Even a short description of which functions to call when.

Thanks!!

Noah

uldara1 commented 1 year ago

http://en.pmac.com.cn/images/download/20160531kubark.pdf

Screenshot 2023-06-21 at 3 08 32 PM

HI you can see this address and sample

#include <Modbus.h>
#define MODE 5
#define RS485 Serial1

Modbus mbus(RS485);
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  RS485.begin(9600, SERIAL_8N1, 19, 18); // 19/18
  mbus.init(MODE);
}
void loop(){
 // for register 0x03
 //  Register No 40001 so value of reqister equal 1
 //  Register No 40002 so value of reqister equal 2
 //  Package Request sample for 40003,  so register = 3
 //  Holding register 0x03
 //  id =  1, register = 3;
     long value = mbus.holdingRegisterRead(1, 3);
   Serial.println(value);
 delay(1000);
}
noahhjackson commented 1 year ago

@uldara1 Thanks!!!