P.addParameter("16") // read/write number of holding registers (optional) P.addParameter("101") // read/write start address (optional) P.addParameter("6") // read only number of holding registers P.addParameter("1") // read only start address P.addParameter("/mnt/sd/modbus_tcp_slave.py") // modbus float holding registers Here below are the sketch and Python codesĪny advice and suggestions will be greatly appreciated. I did ping tests, continuously, to test the ethernet at the point the Modbus communication drops and the ping was very stable with 1ms response. I changed the scan rate of the polling software and the loop delay in the sketch, I was able to make the communication faster or slower but only for 30 minutes every time.Įvery time the communication drops I do reset-mcu through the SHH and it runs for another 30 minutes. I thought maybe the problem is on the PLC side, then I tried the third party software Modscan32 and I got the same result, 30 minutes no less no more. I did some minor corrections to the sketch and Python codes to match the Modbus-tk current library version 0.5.0.Įverything run smoothly and the communication is very stable and fast but for 30 minutes after the sketch starts or mcu reset. The code I am using is Yun-ModbusTK-Example, by ductsoup, that uses the Modbus-tk library. I’m using Momentum M1 PLC as Master to communicate Arduino Yun through the Modbus TCP/IP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |