| 
		
	
	
	
		
	Posts: 136 
	Threads: 18 
	Joined: Apr 2017
	
 Reputation: 
1 
	
		
		
		11.01.2018, 22:11 
(This post was last modified: 11.01.2018, 22:16 by Mr.D.)
		
	 
		Hi, 
I am running a iEM3150 power meter and have used the Jason profile under modbus to setup the device. However, the iEM3150 has a register 3255 that is not assigned which tells me the partial energy consumption. I would like to assign this holding register to the spacelynk object (just like the rest of the holding register). 
How do I go about doing this?
 
Aslo, from the user manual of the iEM3150, the register 2020 is possible to reset via modbus command, how is this done?
https://www.schneider-electric.co.kr/doc...Manual.pdf 
BR 
Mr.D
	
		
	 
	
	
	
		
	Posts: 136 
	Threads: 18 
	Joined: Apr 2017
	
 Reputation: 
1 
	
	
		I have now been able to link the correct register to the spacelynk object.However, I need help to figure out how to send the command number 2020 to the IEM 3150?
 According to the manual the command 2020 uint16, resets the counter...
 Anyone?
 BR,
 Mr.D
 
		
	 
	
	
	
		
	Posts: 5281 
	Threads: 29 
	Joined: Aug 2017
	
 Reputation: 
237 
	
	
		 (17.01.2018, 19:33)Mr. Danielsen Wrote:  I have now been able to link the correct register to the spacelynk object.However, I need help to figure out how to send the command number 2020 to the IEM 3150?
 According to the manual the command 2020 uint16, resets the counter...
 Anyone?
 BR,
 Mr.D
 
Hi 
You are not talking in modbus language here     
What value to which registry via which modbus function do you want to write?  Answer this question and then we can help     
BR
	 
------------------------------Ctrl+F5
 
		
	 
	
	
	
		
	Posts: 1807 
	Threads: 7 
	Joined: Jul 2015
	
 Reputation: 
121 
	
		
		
		17.01.2018, 21:23 
(This post was last modified: 17.01.2018, 21:29 by Erwin van der Zwart.)
		
	 
		Hi, 
2020 is not a register, it's the number you need for the command interface that is build into the iEM devices, with this interface you can do everything on the device over the modbus connection that usually is done on the display of the device. To use the command interface you must disable  the COM protection on the device by using the display once (default enabled).
 
After that you can use this script to reset the counters:
 Code: require('luamodbus')mb = luamodbus.rtu()
 mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H')
 mb:connect()
 mb:setslave(1) -- Enter the correct Modbus slave address of the kWh meter
 
 -- Reset partial counters
 mb:writeregisters(5249, 2020, '')
 
 -- Results of Reset partial 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()
BR,
 
Erwin
	
		
	 
	
	
	
		
	Posts: 136 
	Threads: 18 
	Joined: Apr 2017
	
 Reputation: 
1 
	
	
		Thanks Erwin, 
Exactly what I was looking for   
Thanks again!!
 
BR, 
Mr.D
	
		
	 
	
	
	
		
	Posts: 57 
	Threads: 19 
	Joined: Jun 2017
	
 Reputation: 
1 
	
	
		 (17.01.2018, 21:23)Erwin van der Zwart Wrote:  Hi,
 2020 is not a register, it's the number you need for the command interface that is build into the iEM devices, with this interface you can do everything on the device over the modbus connection that usually is done on the display of the device. To use the command interface you must disable the COM protection on the device by using the display once (default enabled).
 
 After that you can use this script to reset the counters:
 
 Code: require('luamodbus')mb = luamodbus.rtu()
 mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H')
 mb:connect()
 mb:setslave(1) -- Enter the correct Modbus slave address of the kWh meter
 
 -- Reset partial counters
 mb:writeregisters(5249, 2020, '')
 
 -- Results of Reset partial 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()
BR,
 
 Erwin
 
Hi Erwin, 
 
I have a building with a lot of energy meters from SE via SpaceLynk.  
I have configured them via JSON profiles. 
I have noticed that the profile that came doesn't have this registers to Reset the Partial Energy.
 
I'm planing to create a single JSON profile with the single register 5250 and then a script will run every last day of the month and write the value 2020 ?
 
Will it work ?
 
I suppose that this script you posted here will interfere with the JSON profiles communication if I use it in parallel, right ?
 
Thank you
	 
		
	 
	
	
	
		
	Posts: 5281 
	Threads: 29 
	Joined: Aug 2017
	
 Reputation: 
237 
	
	
		You can create second profile for same device. This will work, you can also use proxy see thishttps://forum.logicmachine.net/showthrea...7#pid22637
------------------------------Ctrl+F5
 
		
	 |