Calculation problem

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    Calculation problem

    Hello,

    I'm trying to read the current setpoint shift from my knx thermostat. It is returned as a single byte, which seems to be mapped as follows:
    byte = 0 - > 0°
    byte = 1 -> +0.1°
    byte = 2 -> +0.2°
    ...
    For negative adjustments, it goes like this:
    byte = 255 -> -0.1°
    byte = 254 -> -0.2°
    ...

    So I have the byte. But I cannot seem to get it to calculate correctly to do the mapping. My first idea was this:
    -
    if-block (byte<=128) -> scaler block (parameters 0,0,1,0.1)
    if-block (byte>128) -> scaler block (parameters 255,-0.1,254,-0.2)
    -
    But for the second part, it gives the wrong result. Simple subtraction also fails:
    -
    (byte, constant 255) -> subtract
    -
    returns -1 if the byte = 254, but also returns -1 if it is 253, 252, ... etc.

    What am I missing here...?
    Thanks,


    Jörg
  • Christian Fenzl
    Lebende Foren Legende
    • 31.08.2015
    • 11224

    #2
    Jörg,
    if you subtract 128 (so 0000 0000 would be -128, and 1000 0000 would be 0), do you get correct values?
    Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

    Kommentar

    • J V
      LoxBus Spammer
      • 28.08.2015
      • 367

      #3

      Thanks, I will try. I do not have access to the system this week, so I can only post the results next week. I keep thinking it is some problem with signed/unsigned conversion, so that idea might work. I will then post a screenshot of the different blocks active in liveview, as that will show the values.

      Loxone supports the following KNX types:
      http://www.loxone.com/enen/service/d...ata-types.html
      This particular value is returned as a single byte. I've currently configured it as an EIS5 type, and it seems to take it, but with the values I posted. Using a type (EIS6 or so) seems to give similar issues.

      Kommentar

      • Automation
        Supermoderator
        • 23.08.2015
        • 663

        #4
        What type of KNX Thermostat do you have? In the device description it should written, what type of datapoint it is. Afterwards the matching can be done.
        En Gruäss us de Schwiiz
        KNX seit 2005
        Miniserver seit Jan. 2011

        Kommentar

        • J V
          LoxBus Spammer
          • 28.08.2015
          • 367

          #5
          Sorry for the delay, I was out of town... The thermostat is a Gira Pushbutton sensor 3 plus. In the technical documentation, the descripton for the object that returns the setpoint shift is:
          -
          Function: Basic setpoint shift
          Object 106
          Function: Current setpoint shift
          Name: R.Output
          Type 1 byte
          DPT 6.010
          Flag C, -, T, R
          Description
          1-byte object for giving feedback on the current setpoint shifting to a controller extension. The value of a counter value in the communication object is 0.1 K. The value "0" means that no shift is active. The value is depicted in a double complement in the positive and negative direction.
          -

          The last sentence is the clue probably, but I'm not sure how to deal with it. I just got back and have not yet tried to subtract 128 as Christian suggested.


          Jörg

          Kommentar

          • Automation
            Supermoderator
            • 23.08.2015
            • 663

            #6
            DPT6.001 is a datapoint for percentage (-128% - +127%)....
            En Gruäss us de Schwiiz
            KNX seit 2005
            Miniserver seit Jan. 2011

            Kommentar

            • J V
              LoxBus Spammer
              • 28.08.2015
              • 367

              #7
              Well... I don't know anything about ETS... so I figured it would return some double value. A bit strange to return a percentage for something that is not a percentage.

              I'll try in Loxone Config to use an EIS 6 object, and see what that one returns.

              Kommentar

              • Automation
                Supermoderator
                • 23.08.2015
                • 663

                #8
                Sorry mistake from my side, you wrote DPT 6.010, which sends a value from -128 to 127, but not in percentage without any unity.
                En Gruäss us de Schwiiz
                KNX seit 2005
                Miniserver seit Jan. 2011

                Kommentar

                • J V
                  LoxBus Spammer
                  • 28.08.2015
                  • 367

                  #9
                  Strange thing... In the Loxone Config, the value gets rescaled to a value in the range 0-100 (in steps of 100/255=0.392...) when I interpret it is a ETS6. The scaling is that 0.392% = +0.1°, 99.608%= -0.1°, and then it just continues like that.
                  I don't remember if there are possibilities to change the limits 0 and 100 in Config - it was late in the evening when I tried it.

                  But I could put some function blocks (2 scalers and a "less then" test), and then the calculation works. So at least when interpreting the value as ETS6, I can get the calculation correct. I'm not sure I actually need the setpoint shift, but I need to get used to the Config way of programming and doing things, and it is a good exercise. My plan is to synchronize the wall thermostat with the intelligent room controller, so far I can send current temperature and current setpoint to the room controller.

                  I should really learn more about those ETS types, to avoid such problems in the future... Thanks!
                  Zuletzt geändert von J V; 14.10.2015, 11:59. Grund: added some info

                  Kommentar

                  • Automation
                    Supermoderator
                    • 23.08.2015
                    • 663

                    #10
                    Zitat von J V
                    I should really learn more about those ETS types, to avoid such problems in the future... Thanks!
                    This will help:


                    En Gruäss us de Schwiiz
                    KNX seit 2005
                    Miniserver seit Jan. 2011

                    Kommentar

                    • J V
                      LoxBus Spammer
                      • 28.08.2015
                      • 367

                      #11
                      Thanks!
                      I managed to simplify the calculation, as there is a scaling possibility in the sensor block; I just need 1 extra scaler, 1 less then test and a 2 way multiplexer. (Still seems a lot, but it works).

                      Now trying to get information on which mode the thermostat is in, and whether or not it is supplying heat. For sure the PDF you linked will be useful, thanks!

                      I've noticed in the German speaking forum that people are trying to to similar things (here). So far, I can feed current temperature and current setpoint from the thermostat to the intelligent room controller. I think I found the functions in the manual to read if the thermostat is e.g. in comfort mode or in night mode, so that will be my next step... along with getting the dimmer to work (haven't looked too much into that one).
                      Zuletzt geändert von J V; 15.10.2015, 12:15.

                      Kommentar

                      Lädt...