SpaceLogic KNX Forum
Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.
Link copied. Please paste this link to share this article on your social media post.
Hello everybody,
I'd need to RESET COUNTERS in Schneider electricity meter iEM3155 via ModBus in W4K.
In W4K in pre-installed MB profile related to iEM3155 is only possibility to read values. Reset should be done by ModBus 16 write function.
I know I can download prepared .json profile and customize it... problem is I'm not able to add there a MB16 write function and make it works. To be concrete:
ModBus 16 function - multiple write:
reg. 5250 (uint16) - write value 2023
reg. 5251 (uint16) - write value 0
Have you ever faced the same issue? If you have an example (.json profile) - would be appreciated! 🙂
Thank you and have a nice day,
Jan
Link copied. Please paste this link to share this article on your social media post.
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.1.2', 502)
mb:connect()
mb:setslave(1) -- Enter the correct Modbus slave address of the kWh meter
--see iEM 3255 user manual from page 62 for possible parameters
-- Reset partial energy counters
datanumber = 2020
reservedalways = ''
mb:writeregisters(5249, datanumber, reservedalways) --max 123 parameters entered by , , , ,
--Register 5250 = Requested command, 5251 = Not used, 5252 = parameter 1
-- Results of Reset partial energy counters
r1, r2 = mb:readregisters(5374, 2)
log ("Result Command: " .. r1)
log ("Result Code: " .. r2) -- 0 = valid operation, 3000 = invalid Operation, 3001 = Invalid Parameter, 3002 = Invalid number of parameters, 3007 = Operation not perfomed
-- ********************************************************
mb:close()
Link copied. Please paste this link to share this article on your social media post.
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.1.2', 502)
mb:connect()
mb:setslave(1) -- Enter the correct Modbus slave address of the kWh meter
--see iEM 3255 user manual from page 62 for possible parameters
-- Reset partial energy counters
datanumber = 2020
reservedalways = ''
mb:writeregisters(5249, datanumber, reservedalways) --max 123 parameters entered by , , , ,
--Register 5250 = Requested command, 5251 = Not used, 5252 = parameter 1
-- Results of Reset partial energy counters
r1, r2 = mb:readregisters(5374, 2)
log ("Result Command: " .. r1)
log ("Result Code: " .. r2) -- 0 = valid operation, 3000 = invalid Operation, 3001 = Invalid Parameter, 3002 = Invalid number of parameters, 3007 = Operation not perfomed
-- ********************************************************
mb:close()
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.