Ankündigung

Einklappen
Keine Ankündigung bisher.

- √ - Hex-IP-Telgramme-Emfangen von Moxa

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

    - √ - Hex-IP-Telgramme-Emfangen von Moxa

    Hallo HS Experten,
    ich habe folgendes Problem: Ich möchte Daten von einer Solaranlage in der Viso der Homeservers Darstellen.
    Die Solaranlage ist über das Systra interface und einen Moxa NPort 5110
    an das LAN angeschlossen. Wenn ich per IP-Telegramm Senden den Moxa anspreche bekomme die Daten (siehe Debugseite).
    Wie muß ich die Variablen bei IP-Telegramme Empfangen einreichen um die Daten in der Viso anzuzeigen. Oder muß ich noch logikschaltungen zum umwandeln verwenden. Im Anhang die Protokollbeschreibung des Systra-Intafaces, Debugseite, Ip-Telegramme Empfangen.
    Gruß Marko
    Angehängte Dateien

    #2
    Zitat von marko Beitrag anzeigen
    einen Moxa NPort 5110
    Hi,

    I've also a 5110. Works fine
    I think your Web site analyse is not OK
    Please find here attached a sample I use for an electricity teller
    I first capture tha data from STX to STX and put it in a variable for further processing
    hth
    Angehängte Dateien

    Kommentar


      #3
      Hi Raymond,
      thank you for the quick answer.
      I try it also with this version, but I can't see the data in the viso, because I don't know how to transfer the data to a string to show it in the viso.
      Example (see debugside : 0x0 0x92 0x1 0x52 0x1 0x99 )
      LSB 0x0 HSB 0x92 = 37,376 °C
      LSB 0x1 HSB 0x52 = 20,593 °C
      LSB 0x1 HSB 0x99 = 39,169 °C
      (sorry but my english is not so good)

      best regard Marko

      Kommentar


        #4
        Hallo Marko!

        Den benötigten Baustein findest du hier.

        Darüberhinaus musst du die empfangenen Daten in die einzelnen Blöcke trennen und den eigentlichen Wert in ein 14-byte Textobjekt schreiben, um diese anschliessend mit Hilfe des Bausteins in lesbaren Text zu verwandeln.
        Gruss aus Radevormwald
        Michel

        Kommentar


          #5
          Zitat von marko Beitrag anzeigen
          but I can't see the data in the viso, because I don't know how to transfer the data to a string to show it in the viso.
          The Visu would be the last step.
          I think you have first to undestand how this thing works

          Zitat von marko Beitrag anzeigen
          Example (see debugside : 0x0 0x92 0x1 0x52 0x1 0x99 )
          LSB 0x0 HSB 0x92 = 37,376 °C
          LSB 0x1 HSB 0x52 = 20,593 °C
          LSB 0x1 HSB 0x99 = 39,169 °C
          Oho !
          I don't understand how you come to this conclusion, I miss a step.
          Which enconding is used here ? I don't see how you can put 37,376 into 0x92. Are you sure ?

          Maybe start by capturing a simple record, put it into a 14Byte text and display it in the Visu, just to see what's going on.

          Kommentar


            #6
            Hallo Michel, Raymond,
            das Problem besteht darin, dass die Temperaturen aus zwei Byte bestehen, wobei das niederwertige Byte zuerst steht. Wenn ich den Wert in ein 14 -Byte-Kommunikationsobjekt einlese und anschließend mit der Funktion Hextostring umwandle wird immer noch nichts angezeigt. Den Baustein Hexumrechnung habe ich auch probiert. Warscheinlich benutze ich die Logikbausteine falsch. Wie bekomme ich die beiden Bytes zu einer anzeigbaren Temperatur zusammen? Ist das Einlesen in 14-Byte Text richtig ? Welche Logikbausteine brauche ich ?
            Gruß Marko

            Kommentar


              #7
              Zitat von marko Beitrag anzeigen
              wobei das niederwertige Byte zuerst steht.
              Haa, the joy of little endian vs big endian
              I guess you have to write a Baustein to put that right

              But, as an aside, I suggest you open a CMD prompt and do:
              Telnet <moxa ip addr> 4001
              You should see the data scrolling across your display.
              When you've got some data, click anywhere in the display to freeze the display and examine the data

              Kommentar


                #8
                Also....

                Once you are so far, and have the Telnet working, you could do
                telnet -f <file name> <moxa> 4001
                i.e. telnet -f mylog.txt moxa 4001
                Let it run for a while
                Abort the Telnet session
                Now have a look at the log file mylog.txt

                To have a closer look at it, specially the hex control characters, use a hex editor. I use the good old Debug , as it is free and supplied in all versions of DOS & Windows. I know, it's a tool from the "stone age"

                Suppose you were in C:\Temp, then at the Cmd prompt, type:
                Debug mylog.txt
                > (the debug prompt)
                d (dump, in the left pane you see the data from the Moxa in Hex form, in the right pane you see the ASCII equivalent. Notice that the non-printable characters are NOT shown in the right pane, but you can easily locate them in the left pane)
                <your data is here>
                d (dump)
                <your data is here>
                d (dump)
                <your data is here>
                .
                .
                .
                q (quit)

                Once you've clearly identified your data, and found the adequate delimeters (in my case, it was STX, ETX) you can fine tune your HS Web analyse to get exactly the data you need and put it in a HS variable.
                From there on, you are free to cut the data in meaningfull pieces with an ad-hoc Baustein.

                This is the procedure I've used with the EDF electricity teller and the Moxa 5110. I can send more screenshots if needed.

                Kommentar


                  #9
                  Hallo,
                  ich versuche es noch mal in Deutsch.
                  Mein Problem ist nicht, dass das Moxa falsche Daten liefert. Sondern dass ich die ankommenden Daten nicht richtig verarbeitet bekomme.
                  Erst werden folgende Daten geliefert \xFC\x1F\x0B\x01. Danach folgen die einzelnen Temperaturwerte 2 Byte-weise ohne Zwischen-Bytes:
                  (Beispiel (siehe Debugseite : 0x0 0x92 0x1 0x52 0x1 0x99 )
                  LSB 0x0 HSB 0x92 = x9200 = 37,376 °C
                  LSB 0x1 HSB 0x52 = x5201 = 20,593 °C
                  LSB 0x1 HSB 0x99 = x9901 = 39,169 °C

                  Ich habe folgende Abfragen probiert:
                  Wert als Klartext K-Objekt: 14 Byte Text,
                  Wert als Binärdaten K-Objekt: 8Bit(0-255),
                  Text/Wert mit fester Länge K-Objekt: 14 Byte Text.

                  Wenn ich die Kommunikationswerte in der Viso anzeigen will, habe ich immer leere Felder (wahrscheinlich weil der Hexwert nicht im Bereich für Zeichen ist).
                  Mit 14 Byte Text kann ich nicht rechnen und 8 Bit nimmt scheinbar keine Hexwerte an.

                  Wie bekomme ich aus den anstehenden Daten einen 2 Byte Temperaturwert ?

                  Gruß Marko

                  Kommentar


                    #10
                    Zitat von marko Beitrag anzeigen
                    Mein Problem ist nicht, dass das Moxa falsche Daten liefert.
                    OK, fine

                    Zitat von marko Beitrag anzeigen
                    Danach folgen die einzelnen Temperaturwerte 2 Byte-weise ohne Zwischen-Bytes:
                    (Beispiel (siehe Debugseite : 0x0 0x92 0x1 0x52 0x1 0x99 )
                    Indeed, I checked with the hex calculator and it is OK.

                    So, your problem is to put the 2 byte temp data in reversed form.
                    As I mentionned before, you need a Baustein to do this (I think it doesn't exist, at least I haven't found it)

                    Zitat von marko Beitrag anzeigen
                    habe ich immer leere Felder (wahrscheinlich weil der Hexwert nicht im Bereich für Zeichen ist).
                    Yes, I agree with you.

                    Zitat von marko Beitrag anzeigen
                    Mein und 8 Bit nimmt scheinbar keine Hexwerte an.
                    No, no, hex is just a representation (like octal, decimal or binary: the basic data is the same.

                    Zitat von marko Beitrag anzeigen
                    Wie bekomme ich aus den anstehenden Daten einen 2 Byte Temperaturwert ?
                    I suggest to write a Baustein:
                    as input the LSB & MSB Byte of your data (temp)
                    as ouput MSB & LSB Byte
                    Concatenate those 2 bytes in a 16 bit value
                    Convert the resulting hex value to decimal (3 decimal places (I've never seen a temp with 3 decimal places ) ) as suggested by Michel.
                    Then it will work in the Visu.

                    Easy to say, but maybe hard to do.

                    Kommentar


                      #11
                      Hallo Raymond,

                      ich habe leider keine Beschreibung wie Logikbausteine geschrieben werden. Ich habe schon zweimal versucht diese Informationen von Dacom zu erhalten, aber leider keine Antwort erhalten. Ich habe auch keinen Baustein gefunden, der Hex in Dec umwandelt. Die Umwandlung von LSB und MSB ist ja nur eine Multiplikation und eine Addition. Hast du eine Anleitung zum Schreiben von Logikbausteinen ?

                      Noch eine Frage zum 8Bit Kommunikationsobjekt: Bist du sicher, das dies auch Hexwerte aufnimmt ?

                      Gruß Marko

                      Kommentar


                        #12
                        Habe einen Baustein :String mit Hexwert in Dezimal umrechnen.
                        Hilft dir das weiter?
                        Gruß Günther
                        KNX Projekte:130
                        HS:45
                        KNX,Visu mit HS,Alarmanbindung an HS(Telenot),Revox-HS,
                        www.progplan.it

                        Kommentar


                          #13
                          Hallo Günther,
                          es wäre schön, wenn du mir den Baustein mailen könntes, dann würde ich es ausprobieren.
                          Gruß Marko

                          Kommentar


                            #14
                            Zitat von marko Beitrag anzeigen
                            Hast du eine Anleitung zum Schreiben von Logikbausteinen ?
                            http://www.dacom-homeautomation.de/p...id=delogikentw

                            Zitat von marko Beitrag anzeigen
                            Noch eine Frage zum 8Bit Kommunikationsobjekt: Bist du sicher, das dies auch Hexwerte aufnimmt ?
                            Hex is just a "view" to the data
                            Let's take a concrete example: a 1 byte data containing ASCII character "A"
                            So in ASCII it is "A"
                            in hex it is 41
                            in decimal it is 65
                            in octal it is 101
                            in binary it is 1010 1010

                            Kommentar


                              #15
                              Hallo Raymond,
                              an diese Mailadresse habe ich geschrieben, nur leider keine Antwort erhalten.
                              Die Abhängigkeit ist mir bekannt, ich wusste nur nicht ob dies auch für den Homeserver gilt.
                              Gruß Marko

                              Kommentar

                              Lädt...
                              X