Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.

Log in or register to post/reply in the forum.

Write to Modbus Power meter issue

trajendra Aug 12, 2019 10:58 AM

I am currently collecting data from a Power meter with Modbus protocol. I am able to read the data using function code "3", But I would like to write '1234' to a register "44066" to clear existing data before compiling the program. Here's my code that reads the data and my attempt of writing to that register. I did not have any luck so far. Could someone please point me in the right direction

Datasheet for Powermeter https://www.dentinstruments.com/hs-fs/hub/472997/file-2378482732-pdf/Pdf_Files/PS3037_Manual.pdf?t=1471900520152

Using CR1000X datalogger

Public Result, PS_ModData(100) As Long

Public Total_Power, A_Ll, A_L2, A_L3, VL1_L2, VL2_L3, VL1_L3,Time_reset,Time As Float

SerialOpen (ComC5,38400,3,0,500,4)

Scan (1,Sec,0,0)
PanelTemp (PTemp,60)
Battery (Batt_volt)
Time = Timer (1,Sec,0 )

ModbusMaster (Result,ComC5,38400,1,3,PS_ModData(),4001,70,3,100,3)

Time = Timer (1,Sec,0 )
If Time = 10
ModbusMaster (Result,ComC5,38400,1,6,PS_ModData(),4001,70,3,100,1)
PS_ModData(62) = 1234

'Further processing'
Total_Power = Pos_Energy_LSW*0.1 + Pos_Energy_MSW*65535*0.1
A_Ll = PS_ModData(56)*0.1
A_L2 = PS_ModData(57)*0.1
A_L3 = PS_ModData(58)*0.1
VL1_L2 = PS_ModData(19)*0.1
VL2_L3 = PS_ModData(20)*0.1
VL1_L3 = PS_ModData(21)*0.1
Time_reset = PS_ModData(62) + PS_ModData(63)*65535

Log in or register to post/reply in the forum.