tTimeOut(2000) // if there is no answer in 2000 ms, roll over * This is an structe which contains a query to an slave device Modbus master(0,1,1) // this is master and RS-485 * u8serno : serial port (use 0 for Serial) * u8id : node id = 0 for master, = 1.247 for slave If (millis() > tempus) digitalWrite(13, LOW ) īitWrite( au16data, 0, digitalRead( 2 )) īitWrite( au16data, 1, digitalRead( 3 )) īitWrite( au16data, 2, digitalRead( 4 )) īitWrite( au16data, 3, digitalRead( 5 )) As of now, the master simply reads data slave and prints in the Serial monitor. I am using an Arduino Mega 2560 for the project and using this library Modbus RTU. I'm trying Arduino to Arduino (master-slave) communication using Modbus RTU protocol in RS-485.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |