Ankündigung

Einklappen
Keine Ankündigung bisher.

How to convert a 4 byte value into EIS 11 (DPT13 - Energy)

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    KNX/EIB How to convert a 4 byte value into EIS 11 (DPT13 - Energy)

    We like to use an SIM-KNX module with an Arduino MicroController to develop a device to send Energy information from a dutch energysmartmeter to a KNX installation.

    Do anyone know how to convert a 4 byte value into EIS 11 (DPT13 - Energy)?

    #2
    http://www.knx.org/fileadmin/downloa...07.00%20AS.zip

    Kommentar


      #3
      Falcon

      Yes i know the document and writed some testcode in Visual C# with the FALCON SDK, but i can't send a right DPT13 packet..

      Other datapoints as ON/OFF is no problem..

      Kommentar


        #4
        This is funny. DPT 13.013 is a plain 32 bit signed integer, that is on the bus encoded and transmitted just as it is done in C#. It would not need any conversion at all...
        So, if you have energy data in your module and it's encoded as a signed 32 bit integer and the unit is kWh, then it's good as it is.
        What is exactly the problem?

        Kommentar


          #5
          I wrote the following code:

          private void button2_Click(object sender, EventArgs e)
          {
          try
          {
          if (KnxComm.connected())
          {
          int curval = 1024;
          string currentKwhHex = curval.ToString("X8");
          MessageBox.Show(currentKwhHex + " : " + Int32.Parse(currentKwhHex, System.Globalization.NumberStyles.HexNumber));
          // EIS11 DPT13
          DeviceWriteError eError = KnxComm._ptrGroupDataTransfer.Write((object)"0x" + KnxComm.group2knx("8/7/2"),
          (Priority)3,
          6, //RoutingCount
          false, //Lessthan7bits
          curval
          );

          // EIS11 DPT13
          eError = KnxComm._ptrGroupDataTransfer.Write((object)"0x" + KnxComm.group2knx("8/7/3"),
          (Priority)3,
          6, //RoutingCount
          false, //Lessthan7bits
          (object)"0x" + currentKwhHex.Substring(0, 2) + " 0x" + currentKwhHex.Substring(2, 2) + " 0x" + currentKwhHex.Substring(4, 2) + " 0x" + currentKwhHex.Substring(6, 2)
          );
          // extended error information
          if (eError != DeviceWriteError.DeviceWriteErrorNoError)
          {
          // error message
          Logging.writeLog("Error: group data write error");
          MessageBox.Show("Error: group data write error");
          }
          }
          else
          {
          MessageBox.Show("Geen connectie");
          }
          }
          catch (Exception ex) // show error
          {
          Logging.writeLog(ex.Message);
          MessageBox.Show("Error write group address!" + ex.Message);
          }
          }

          }


          ---------------

          int curval is an int32
          when i send the value 1024 to address 8/7/2 and 8/7/3 i see on the busmonitor the following value:
          00 00 04 00 | 1,43493E-42

          I don't know why this value is sended. I only want to set an int32 on the bus, so my other software/hardware can see this value.

          Kommentar


            #6
            Don't let the Busmonitor mislead you ... I have the impression that the HEX-value is correct, but that the Busmonitor thinks that it is a 4 octet float value instead of a 4 octet signed integer. I assume that's why it shows 1,43493E-42 instead of 1024.

            Kommentar


              #7
              Zitat von S. De Bruyne Beitrag anzeigen
              Don't let the Busmonitor mislead you ... I have the impression that the HEX-value is correct, but that the Busmonitor thinks that it is a 4 octet float value instead of a 4 octet signed integer. I assume that's why it shows 1,43493E-42 instead of 1024.
              Yes its a little bit weird. In the busmonitor i set its an 4 byte signed integer, but it looks like it goes wrong in the c# code.

              Maybe it has something todo that i execute the code on a 64bit machine.

              When i display the bus values in Domovea (Hager visualization), i have also weird values and not the one i send with my c# code.

              Kommentar


                #8
                Yes i found the problem, but not a solution yet

                i have to use DPT 14.056 (4-octet float value) instead of the 4 bytes signed integer...

                But how to decode this to send it with the falcon sdk..

                Kommentar

                Lädt...
                X