KM2 Datagram

84 views
Skip to first unread message

KM2 User

unread,
Sep 4, 2022, 3:15:28 PM9/4/22
to Resol Vbus
Hello
I just started with Sungo 200 = Deltasol BX Plus 2.08 and KM2 Module.
I succeeded in menu XML conversion and get datagram by tcpconnection getvaluebyid.
It s very quick.
But have few questions :
  - are value index stable when version is changing ? or have I to use idHash ?
  - i don t understand acktor function which returns values like 308 or 520. these values are not comprehensible versus valuetexts array. how to get the text value ?
 - same problem with other text values
 - is it possible to translate german text in french from value id ?
 - what is the meaning of bitsize xml parameter ?

More questions than answers. I m ready to help if necessary.



Daniel Wippermann

unread,
Sep 6, 2022, 2:54:03 PM9/6/22
to resol...@googlegroups.com
Hi!

>  - are value index stable when version is changing ? or have I to use idHash ?

You’ll have to use the idHash at least once to lookup the mapping from idHash to index. You can then cache that information until the controller or its firmware version changes. Then you’ll have to repeat the lookup process.

> - i don t understand acktor function which returns values like 308 or 520. these values are not comprehensible versus valuetexts array. how to get the text value ?

Actor functions combine two information in a single 16-bit integer value:

- The text to use as a prefix in the lower 8 bits
- An optional number to append after the text in the upper 8 bits

So taking your example of „308“: the lower 8 bits are „52“ and the upper 8 bits are „1“ (1 * 256 + 52 = 308). So the actor function uses the text for value 52 and appends „ 1“ after the text. The other example of „520“ is 2 * 256 + 8 and uses text 8 and appends a „ 2“.

If the upper 8 bits are „0“, no number is appended.

> - same problem with other text values

The rule above applies to several other types as well, but not all.

> - is it possible to translate german text in french from value id ?

I do not understand the question, could you please elaborate what you want to do?

> - what is the meaning of bitsize xml parameter ?

Although all values transferred over the VBus seem to be 32-bits in size when they are transferred using VBus 2.x datagrams, internally they are often stored in memory locations that are smaller. Temperatures for example often fit in signed 16-bit values.

The bitSize attribute in the XML declares, how large the memory location for the value is and what possible range the value can be before it gets truncated:

- bitSize=„1“ uses only one bit and values can be either 0 or 1
- bitSize=„7“ uses a signed 8-bit integer that can store values between -128 and 127
- bitSize=„8“ uses an unsigned 8-bit integer that can store values between 0 and 255
- bitSize=„15“ uses a signed 16-bit integer that can store values between -32768 and 32767
- bitSize=„16“ uses an unsigned 16-bit integer that can store values between 0 and 65535
- bitSize=„31“ uses a signed 32-bit integer that can store values between (-(2^31) and (2^31-1))


Best regards,
Daniel







--
You received this message because you are subscribed to the Google Groups "Resol Vbus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resol-vbus+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/resol-vbus/6b1b10b2-f709-4ac8-86e9-c6f2093c7bdbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages