-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
high data values #1
Comments
Hi pcmalek, Thank you for your comment. I could not figure out how do they return these high values using the two variables, simply because I never had any high values with my simple set up, hence I just left these registers as-is. Is it simply 100's in one register and 1000s in the other? Unfortunately, I do not have the UPower unit anymore to do the testing. If you can source that information from Epsolar or find out the other way how the high values are coded by using two registers, I am happy to alter the code to represent that. |
hi Olaf Andersen and thank you for the quick response
yes i did find the solution but I am not a programmer unfortunately.
1. the first solution is from Adam Welch UK and it is in javascript but he
explain to me the principle, here is part of his email:
( I did have trouble with these registers, but finally managed to get them
working with this bit of javascript...
var low = msg.payload[0];
var high = msg.payload[1];
var total = ((high << 16) + low) / 100;
msg.payload = total;
msg.measurement = "W";
return msg;
It's all about shifting the high number to the left using the leftshift
operator
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Left_shift
)
2. the second solution came from github and the link :
https://github.com/toggio/PhpEpsolarTracer/blob/master/PhpEpsolarTracer.php
this code i tried and it work great with my Tracer AN but no luck with the
my UPower. it worked great with all high value because they programed a
part with conversion in mind for the low and high value data .
here is the link for the project:
https://github.com/toggio/PhpEpsolarTracer
i contacted a member from this team but he couldn't help. thank you again
for your effort.
Le mar. 4 mai 2021 à 01:57, Olaf Andersen ***@***.***> a
écrit :
… Hi pcmalek,
Thank you for your comment. I could not figure out how do they return
these high values using the two variables, simply because I never had any
high values with my simple set up, hence I just left these registers as-is.
Is it simply 100's in one register and 1000s in the other? Unfortunately,
I do not have the UPower unit anymore to do the testing.
If you can source that information from Epsolar or find out the other way
how the high values are coded by using two registers, I am happy to alter
the code to represent that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT52MCNFKKXUFZMU4PXYZKTTL5A7FANCNFSM44BD7UJQ>
.
|
Hi pcmalek, Can you please test the logtracer.py against your Tracer controller and see if it picks up the high values now. I have not done that for UPower logger yet, however the principles will be the same Thanks, |
hi olaf
unfortunately it didn't work it displays a false result
the problem is clear the H L are already converted into Decimal value and
the solution is to combine them in there Hexadecimal value for the data
make sense.
example:
IVwatt : 411.62
IVwattH : 0.02
IVwattL : 411.62
411.62 => x100 = 41162 => A0CA
0.02 => x100 = 2 => 2
IVwatt = ( (2 << 4) + A0CA ) /100 = (2A0CA) / 100 = (172234) / 100 =
1722.34 Watt
IVwatt = 1722.34 Watt is a correct value
i concluded this from the manufacturer directive below:
modbus_protocol
(For the data with the length of 32 bits, such as power, using the L and H
registers represent the low and
high 16 bits value,respectively. e.g.The charging input rated power is
actually 3000W, multiples of 100 times,
then the value of 0x3002 register is 0x93E0 and value of 0x3003 is 0x0004.)
i made an example of a possible solution but the syntax is probably
incorrect:
# calculate compound values
IVwatt1 = up.readReg(IVwattH)
IVwatt1 = (IVwatt1*100)
IVwatt1 = format(IVwatt1, 'x')
IVwatt2 = up.readReg(IVwattL)
IVwatt2 = (IVwatt2*100)
IVwatt2 = format(IVwatt2, 'x')
IVwatt3 = ((IVwatt1) + (IVwattL2)
IVwatt4 = int("IVwatt3", 16)
IVwatt4 = (IVwatt4)/100
i hope it can help you to figure it out
thank you again
Le jeu. 13 mai 2021 à 08:03, Olaf Andersen ***@***.***> a
écrit :
… Hi pcmalek,
Can you please test the logtracer.py against your Tracer controller and
see if it picks up the high values now. I have not done that for UPower
logger yet, however the principles will be the same
Thanks,
Olaf
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT52MCNCQPCLVX7ST7WZM5DTNN2UDANCNFSM44BD7UJQ>
.
|
Le sam. 15 mai 2021 à 12:55, Malek ***@***.***> a écrit :
… hi olaf
unfortunately it didn't work it displays a false result
the problem is clear the H L are already converted into Decimal value and
the solution is to combine them in there Hexadecimal value for the data
make sense.
example:
IVwatt : 411.62
IVwattH : 0.02
IVwattL : 411.62
411.62 => x100 = 41162 => A0CA
0.02 => x100 = 2 => 2
IVwatt = ( (2 << 4) + A0CA ) /100 = (2A0CA) / 100 = (172234) / 100 =
1722.34 Watt
IVwatt = 1722.34 Watt is a correct value
i concluded this from the manufacturer directive below:
modbus_protocol
(For the data with the length of 32 bits, such as power, using the L and H
registers represent the low and
high 16 bits value,respectively. e.g.The charging input rated power is
actually 3000W, multiples of 100 times,
then the value of 0x3002 register is 0x93E0 and value of 0x3003 is 0x0004.)
i made an example of a possible solution but the syntax is probably
incorrect:
# calculate compound values
IVwatt1 = up.readReg(IVwattH)
IVwatt1 = (IVwatt1*100)
IVwatt1 = format(IVwatt1, 'x')
IVwatt2 = up.readReg(IVwattL)
IVwatt2 = (IVwatt2*100)
IVwatt2 = format(IVwatt2, 'x')
IVwatt3 = ((IVwatt1) + (IVwattL2)
IVwatt4 = int("IVwatt3", 16)
IVwatt4 = (IVwatt4)/100
i hope it can help you to figure it out
thank you again
Le jeu. 13 mai 2021 à 08:03, Olaf Andersen ***@***.***> a
écrit :
> Hi pcmalek,
>
> Can you please test the logtracer.py against your Tracer controller and
> see if it picks up the high values now. I have not done that for UPower
> logger yet, however the principles will be the same
>
> Thanks,
> Olaf
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AT52MCNCQPCLVX7ST7WZM5DTNN2UDANCNFSM44BD7UJQ>
> .
>
|
i made an example of a possible solution but the syntax is probably
incorrect:
1- multiplication *100
2- convert Decimal to Hexadecimal without 0x
3- concatenate Hexadecimal numbers
4- convert Hexadecimal to Decimal
5- divade /100
# calculate compound values
IVwatt1 = up.readReg(IVwattH)
IVwatt1 = (IVwatt1*100)
IVwatt1 = format(IVwatt1, 'x')
IVwatt2 = up.readReg(IVwattL)
IVwatt2 = (IVwatt2*100)
IVwatt2 = format(IVwatt2, 'x')
IVwatt3 = ((IVwatt1) + (IVwattL2)
IVwatt4 = int("IVwatt3", 16)
IVwatt4 = (IVwatt4)/100
i hope it can help you to figure it out
thank you again
Le sam. 15 mai 2021 à 13:01, Malek ***@***.***> a écrit :
…
Le sam. 15 mai 2021 à 12:55, Malek ***@***.***> a écrit :
> hi olaf
> unfortunately it didn't work it displays a false result
> the problem is clear the H L are already converted into Decimal value and
> the solution is to combine them in there Hexadecimal value for the data
> make sense.
> example:
> IVwatt : 411.62
> IVwattH : 0.02
> IVwattL : 411.62
>
> 411.62 => x100 = 41162 => A0CA
> 0.02 => x100 = 2 => 2
>
> IVwatt = ( (2 << 4) + A0CA ) /100 = (2A0CA) / 100 = (172234) / 100 =
> 1722.34 Watt
> IVwatt = 1722.34 Watt is a correct value
> i concluded this from the manufacturer directive below:
> modbus_protocol
> (For the data with the length of 32 bits, such as power, using the L and
> H registers represent the low and
> high 16 bits value,respectively. e.g.The charging input rated power is
> actually 3000W, multiples of 100 times,
> then the value of 0x3002 register is 0x93E0 and value of 0x3003 is
> 0x0004.)
>
> i made an example of a possible solution but the syntax is probably
> incorrect:
>
> # calculate compound values
>
> IVwatt1 = up.readReg(IVwattH)
> IVwatt1 = (IVwatt1*100)
> IVwatt1 = format(IVwatt1, 'x')
>
> IVwatt2 = up.readReg(IVwattL)
> IVwatt2 = (IVwatt2*100)
> IVwatt2 = format(IVwatt2, 'x')
>
> IVwatt3 = ((IVwatt1) + (IVwattL2)
>
> IVwatt4 = int("IVwatt3", 16)
>
> IVwatt4 = (IVwatt4)/100
>
> i hope it can help you to figure it out
> thank you again
>
>
> Le jeu. 13 mai 2021 à 08:03, Olaf Andersen ***@***.***> a
> écrit :
>
>> Hi pcmalek,
>>
>> Can you please test the logtracer.py against your Tracer controller and
>> see if it picks up the high values now. I have not done that for UPower
>> logger yet, however the principles will be the same
>>
>> Thanks,
>> Olaf
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <#1 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AT52MCNCQPCLVX7ST7WZM5DTNN2UDANCNFSM44BD7UJQ>
>> .
>>
>
|
Thank you for doing that. To me, the hexadecimal vs decimal values should not matter - all numbers are stored in binary format in the (int) type variable and only presented to humans in decimal or hexdecimal form. So, the << 16 operation should work fine either way. However, you have got the point about multiplying them by 100 first! Maybe that is what's missing from my formulae |
I would like to mention, that if either the Controller Temperature (CTtemp) or Battery Temperature (BAtemp) gets negative, the value should be shifted with 32768 (#8000) to correctly read the registers value. |
hi fatyogi and thank you for your work
i used your code with my UPOWER and my TRACER AN it is great but i found a problem with all big data value like "PVwatt","PVkwh","BAwatt","ACwatt","IVwatt".
the problem is that all those value can be more than 600 so the data is split in to two value High and Low .
in your code you did not combine the high and low value instead you made them two different thing but if for example the "IV watt" = 1000 Watt than the code display a high and a low value that do not make any sence.
i tried to fix it by combining the high and low data value but i did not succeed.
i hope you can help thanks .
The text was updated successfully, but these errors were encountered: