This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trend history transfer
#5
Hello Erwin,

everything ok, except energy metering. I have a script for energy metering which is executed every 30 min. I have checked in logs and the script is executed every 30 mins. Also the AMEM3155 is operated well and measures values.

But the object doesn't be updated. The script is below. In the previous Homelynk I didn't have any problem. Can you help?

if not mb then
require('luamodbus')
mb = luamodbus.rtu()
end


-- 19200 baud rate, even parity, 8 data bits, 1 stop bit, half duplex
mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H')
mb:connect()

mbConfusedetslave(1)

-- Total active energy import
total1, total2, total3, total4 = mb:readregisters(3203,4)
if total1 then
total5=bit.lshift(total1,48)+bit.lshift(total2,32)+bit.lshift(total3,16)+total4
total5=total5/1000
log('act pwr 10/0/1',total5)
grp.write('10/0/1',total5)
end

-- Partial active energy import
partial1, partial2, partial3, partial4 = mb:readregisters(3255,4)
if partial1 then
partial5=bit.lshift(partial1,48)+bit.lshift(partial2,32)+bit.lshift(partial3,16)+partial4
partial5=partial5/1000
log('act pwr 10/0/2',partial5)
grp.write('10/0/2',partial5)
end

-- Phase1 active energy import
phase1, phase2, phase3, phase4 = mb:readregisters(3517,4)
if phase1 then
phase5=bit.lshift(phase1,48)+bit.lshift(phase2,32)+bit.lshift(phase3,16)+phase4
phase5=phase5/1000
log('act pwr 10/0/3',phase5)
grp.write('10/0/3',phase5)
end

-- Tarrif Day active energy import
day1, day2, day3, day4 = mb:readregisters(4195,4)
if day1 then
day5=bit.lshift(day1,48)+bit.lshift(day2,32)+bit.lshift(day3,16)+day4
day5=day5/1000
log('act pwr 10/0/4',day5)
grp.write('10/0/4',day5)
end

-- Tarrif Night active energy import
night1, night2, night3, night4 = mb:readregisters(4199,4)
if night1 then
night5=bit.lshift(night1,48)+bit.lshift(night2,32)+bit.lshift(night3,16)+night4
night5=night5/1000
log('act pwr 10/0/5',night5)
grp.write('10/0/5',night5)
end

-- Multi Tarrif active energy rate
tarrif1 = mb:readregisters(4190)
--if tarrif1 then
--tarrif2=bit.lshift(tarrif1,16)
--tarrif2=tarrif2/1000
log('act pwr 10/0/6',tarrif1)
grp.write('10/0/6',tarrif1)
--end





I
Reply


Messages In This Thread
Trend history transfer - by XSPA2474KW - 09.11.2019, 12:30
RE: Trend history transfer - by XSPA2474KW - 10.11.2019, 10:59
RE: Trend history transfer - by admin - 10.11.2019, 11:19
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 09:43
RE: Trend history transfer - by admin - 13.11.2019, 10:50
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 11:34
RE: Trend history transfer - by Daniel - 13.11.2019, 12:13
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 12:36
RE: Trend history transfer - by Daniel - 13.11.2019, 12:46
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 13:13
RE: Trend history transfer - by Daniel - 13.11.2019, 13:20
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 13:29
RE: Trend history transfer - by Daniel - 13.11.2019, 13:32
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 13:33
RE: Trend history transfer - by Daniel - 13.11.2019, 13:34
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 13:37
RE: Trend history transfer - by Daniel - 13.11.2019, 13:47
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 13:56
RE: Trend history transfer - by Daniel - 13.11.2019, 13:59
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 14:05
RE: Trend history transfer - by Daniel - 13.11.2019, 14:09
RE: Trend history transfer - by XSPA2474KW - 13.11.2019, 14:19
RE: Trend history transfer - by Daniel - 13.11.2019, 15:06
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 06:09
RE: Trend history transfer - by Daniel - 14.11.2019, 08:17
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 08:24
RE: Trend history transfer - by Daniel - 14.11.2019, 08:42
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 08:53
RE: Trend history transfer - by Daniel - 14.11.2019, 09:17
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 09:50
RE: Trend history transfer - by Daniel - 14.11.2019, 10:10
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 12:25
RE: Trend history transfer - by Daniel - 14.11.2019, 12:37
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 12:40
RE: Trend history transfer - by Daniel - 14.11.2019, 12:40
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 13:20
RE: Trend history transfer - by Daniel - 14.11.2019, 13:46
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 14:06
RE: Trend history transfer - by Daniel - 14.11.2019, 14:09
RE: Trend history transfer - by XSPA2474KW - 14.11.2019, 14:37
RE: Trend history transfer - by Daniel - 14.11.2019, 14:38

Forum Jump: