DUMAY Philippe - 2017-05-25

Hello,

I am trying to setup a rule to extract the different elements of a DPT
229.001 (DPT Metering Value)

As you know the DPT229.001 have 2 informations :

  • byte 1 to 4 is the counter value (32 bits signed)
  • byte 5 is the index
  • byte 6 is always 0

As this DPT is not yet implemented in linknx, the only way is to declare
2 different object for the same GAD:

  • The first object with a DPT 12.xxx that will contain the value (4
    first bytes)
  • The second object with a DPT 29.xxx that will contain the index in
    the byte 5 over 8.

I have made an LUA Script wich works fine under Scite but the result in
LINKNX is not the same :
The script :
conso=obj("DT_EDF_TI_CONSO");
ob229=obj("DT_EDF_TI_DPT229");
set("DT_EDF_gachetteG",conso);
set("DT_EDF_TEST1",ob229);
idxlitteral= string.format('%x', 4294967295 and
DT_EDF_TI_conso_part229)

value=tonumber(string.sub(string.sub('00'..string.format('%x',
4294967295 and ob229),-8),1,2));

set("DT_EDF_TI_Idx_tarif",value);
if value==2 then set("DT_EDF_TI_Conso_glob_HP",conso);
elseif value==1 then set("DT_EDF_TI_Conso_glob_HC",conso);
end;

When we have in the 64bit object the value "12004467174501" (hexa : 00
00 0A EB 02 00 6C 65), SciTE return "2006c65" for idxlitteral but linknx
return always "ffffffff" !!!

I don't know the LUA version as linknx always return the same ffffffff
to the _VERSION interrogation.

Anybody have an idea of the problem ?