Hi,
I'm using:
ModBusMaster (EmonResult,ComSDC7,115200,1,3,Emon(),1001,38,3,50,2)
To read values from a modbus device.
However, there are four values i'd like to reset to zero... values/registers/whatever they are 1001/1003/1005/1007 and it only needs to be a one time thing...
I'm not really sure how to use the ModBusMaster command to do this, do I just use a 4 value array and set them all to zero?
Thanks!
bump, no helps?
All you need to do is use another ModbusMaster instruction and use function 16 (write multiple registers). You will need to conditionally run the instruction unless you want to zero the registers all the time. An example would be:
ModBusMaster (EmonResult,ComSDC7,115200,1,16,Emon(),1001,4,3,50,2)
Make sure you set the valuse of Emon(1), Emon(2), Emon(3), and Emon(4) to 0 before you run the instruction.
Regards,