Modbus TCP device read string

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • BDP
    Smart Home'r
    • 02.08.2016
    • 50

    #1

    Modbus TCP device read string

    I just installed an Alfen Wallbox.
    I'm able to read most of the Modbus values using Modbus TCP. However there is also a string value. This gives the state of Wallbox and car.


    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: AlfenModbusState.jpg Ansichten: 0 Größe: 38,2 KB ID: 343716
    I have no idea if it's possible to read this string value.

    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: AlfenModbusStateRegisters.jpg Ansichten: 0 Größe: 61,9 KB ID: 343717

    Some more information concerning the string datatype

    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: AlfenModbusReadRegisters.jpg Ansichten: 0 Größe: 44,1 KB ID: 343718

    Will it be possible to read this string value?
  • FlorianZ
    Dumb Home'r
    • 17.06.2017
    • 17

    #2
    Hello
    have you found a solution to read the string?
    I also have 2 Alfen wallboxes and have the same problem.

    Kommentar

    • BDP
      Smart Home'r
      • 02.08.2016
      • 50

      #3
      Leider nicht.
      I need to look further into this...

      Kommentar

      • Tico
        Lox Guru
        • 31.08.2016
        • 1035

        #4
        I think the eaisest way would be to convert the values presented by the "Mode 3 State Listing" to decimal. It appears there are only 9 states possible. The following two sites are helpful -

        https://www.binaryhexconverter.com/a...nary-converter

        https://www.binaryhexconverter.com/b...imal-converter

        Example: State = A

        A in binary is 01000001. Loxone should read this binary value and present the decimal value for 01000001. That decimal value is 65.

        In a Status block, have the Modbus sensor to AI1. If AI1=65, Status Text = A

        Example: State = B1

        B1
        in binary is 01000010 00110001. Loxone should read this binary value and present the decimal value, 16945.

        On the second line of the Status Block, If AI1=16945, Status Text = B1

        Example: State = B2

        B2 in binary is 01000010 00110010. Loxone should read this binary value and present the decimal value, 16946

        On the third line of the State Block, If AI1=16946, Status Text = B2

        etc, etc, etc.


        edit: On re-reading the "Reading Registers" screenshot, the byte order might be reversed. So the example B2 -

        01000010 00110010 becomes 00110010 01000010

        This is decimal 12866.

        Whichever byte order is used, it should be consistent across the 9 states.
        Zuletzt geändert von Tico; 27.05.2022, 15:30.
        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

        Kommentar

        • FlorianZ
          Dumb Home'r
          • 17.06.2017
          • 17

          #5
          I just did a quick test and it seems to be working.
          I was able to read out the state E without the car being connected.
          At the weekend I try to test all states.
          many thanks for the help.

          Kommentar

          • FlorianZ
            Dumb Home'r
            • 17.06.2017
            • 17

            #6
            the mode 3 state can be read out with the following settings:

            Kommentar

            • Tico
              Lox Guru
              • 31.08.2016
              • 1035

              #7
              There might be a way to get two separate outputs for 'Connected' and 'Charging'. I assume you would want those for entries into the Loxone Wallbox block?

              But I just need confirmation of when the Mode 3 state reads B2, is the vehicle charging or not?
              Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

              Kommentar

              • BDP
                Smart Home'r
                • 02.08.2016
                • 50

                #8
                Zitat von Tico
                There might be a way to get two separate outputs for 'Connected' and 'Charging'. I assume you would want those for entries into the Loxone Wallbox block?

                But I just need confirmation of when the Mode 3 state reads B2, is the vehicle charging or not?
                I solved this (hopefully) using AQ = 2 for charging and connected and 1 for connected.
                I'll try this weekend (when electric car is at my disposal).

                FlorianZ I think value E should be 17664 and not 17644

                Kommentar

                • Gast

                  #9
                  Good morning! Thanks for this, great idea.

                  Just to understand, how did you arrive at 16640/17644/17664/17920 for A/E/F? Should this not just be 65/69/70?

                  Kommentar

                  • Tico
                    Lox Guru
                    • 31.08.2016
                    • 1035

                    #10
                    For just the character 'A', you would expect 65. Likewise character 'E' would be 69 etc. However, the string is 2 bytes, with the second byte having a 0 as padding.

                    ASCII text character A = binary 01000001 = decimal 65
                    Second byte padding = binary 00000000 = decimal 0

                    Both 'characters' sequentially = 0100000100000000

                    The binary string 0100000100000000 = 16640 decimal
                    Zuletzt geändert von Tico; 13.09.2022, 11:27.
                    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                    Kommentar

                    • Gast

                      #11
                      Great thanks for explaining.

                      Kommentar

                      • minitrue
                        Azubi
                        • 21.03.2021
                        • 1

                        #12
                        Hi all,
                        This post has been very helpful so far in connecting my Alfen to Loxone. That went remarkably well... up to now.

                        I was wondering how and what you all connect to the (new) Wallbox block at Mr (Meter)?

                        According to the Alfen documentation that should be either Real Energy Delivered Sum (374) or Real Energy Consumed Sum (390) - however with my limited knowledge I have no clue how to read out the FLOAT64 - there is no such option in Loxone. Any insights on the settings I should use?​​

                        Kommentar

                        • MaxMoritz
                          Smart Home'r
                          • 27.11.2015
                          • 41

                          #13
                          English text follows:

                          Hallo BDP und alle anderen , ich bräuchte Unterstützung, denn leider sind hier im Loxforum wenig Einträge über die Alfen Wallbox zu finden.
                          Ich habe Lastmanagement in der Wallbox konfiguriert und habe über Modbus TCP/IP auch Zugriff zur Wallbox.
                          Ich möchte das Lastmanagement mit Loxone über den Wallbox Baustein umsetzen, habe aber Problem den Modbus Befehl zu finden , der den Ladevorgang startet und stoppt. Wenn ich an der Box die RFID Karte vorhalte, wird diese erkannt und ich bekomme die Rückmeldung, dass die Wallbox auf das Lastmanagement wartet.
                          Was ist hier genau zu tun?
                          Kann jemand helfen.

                          Hello BDP and everyone else, I need support, because unfortunately there are few entries about the Alfen Wallbox here in the Loxforum.
                          I have configured load management in the Alfen EV charger and also have access to the EV charger via Modbus TCP/IP.
                          I would like to implement load management with Loxone via the wallbox module, but I am having problems finding the Modbus command that starts and stops the charging process. When I present the RFID card to the box, it is recognized and I get the feedback that the wallbox is waiting for load management.
                          What exactly do I need to do here?
                          Can anyone help?

                          MANY THANKS
                          MaxMoritz​

                          Kommentar

                          • BDP
                            Smart Home'r
                            • 02.08.2016
                            • 50

                            #14
                            Hello, I'll try to look into this soon.
                            If I didn't answer before monday please send me a PM

                            Kommentar


                            • MaxMoritz
                              MaxMoritz kommentierte
                              Kommentar bearbeiten
                              Many thanks @BDP.

                              In the meantime I´ve spoken to Alfen and got confirmation that there doesn't exist a Start/Stop command, which I can address via Modbus. This is only triggered with RFID card for EV charger, every reading means Alfen starts or stop.
                              If I am correct it means, that I unfortunately cannot use Loxone Wallbox Config Module to trigger charging process. Am I right?

                              Would be great if you could share how you use Loxone to control Alfen and how far you go.
                              I have in the meantime managed to do 3 phase load balancing via Loxone, reducing current power to 4,2 Kw/h.
                              However I still have difficulties to read "Current Sum" via Loxone, although Modbus settings are correct. But for "Current L1-3" I get values...
                          • BDP
                            Smart Home'r
                            • 02.08.2016
                            • 50

                            #15
                            Hello, there's no command tot just start/stop indeed.
                            But normally you can send values to "Modbus Slave Max Current". When you send values less than 6 (one phase), car will stop charging

                            Kommentar

                            Lädt...