hi..I've worked on ac driver that need modbus rtu to make communication with mega2560.i used code which be prepared in libirary is named (modbus rtu clinet toggle)i would like to know how to find this value send and see.. if i need to have software or iec.. send me name or...
i would like send code like this(01 06 0836 00a eba3) by mega 2560.. .....this code make motor stop...my code is below... its not important how this code send...i have to send this code through modbus rtu 8n1 by 2560mega..
i notice that i have max485...
#include <ArduinoRS485.h> // ArduinoModbus depends on the ArduinoRS485 library
#include <ArduinoModbus.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Modbus RTU Client Toggle");
// start the Modbus RTU client
if (!ModbusRTUClient.begin(9600)) {
Serial.println("Failed to start Modbus RTU Client!");
while (1);
}
}
void loop() {
// for (slave) id 1: write the value of 0x01, to the coil at address 0x00
if (!ModbusRTUClient.coilWrite(1, 0x00, 0x01)) {
Serial.print("Failed to write coil! ");
Serial.println(ModbusRTUClient.lastError());
}
// wait for 1 second
delay(1000);
// for (slave) id 1: write the value of 0x00, to the coil at address 0x00
if (!ModbusRTUClient.coilWrite(1, 0x00, 0x00)) {
Serial.print("Failed to write coil! ");
Serial.println(ModbusRTUClient.lastError());
}
// wait for 1 second
delay(1000);
}