Modbus schreiben, wer kann bitte helfen?

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • ceeage
    LoxBus Spammer
    • 03.02.2018
    • 333

    #1

    Modbus schreiben, wer kann bitte helfen?

    Hallo zusammen,

    ich werde schon bald wahnsinnig

    Ich muss diese 6 Register (siehe Anlage) gleichzeitig schreiben aber bekomme es nicht hin.
    Muss ich die 1187+1188 jedes für sich anlegen und schreiben oder zusammen da ja laut Beschreibung 32 Bits?
    Mir ist das nicht ganz klar.

    Das Auslesen klappt im übrigen einwandfrei.

    Danke für eure Hilfe!

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: modbus3.png
Ansichten: 1479
Größe: 179,4 KB
ID: 408003
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Modbus4.png
Ansichten: 1388
Größe: 166,8 KB
ID: 408004
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Modbus1.png
Ansichten: 1404
Größe: 47,7 KB
ID: 408005
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Modbus2.png
Ansichten: 1380
Größe: 40,9 KB
ID: 408006
  • ceeage
    LoxBus Spammer
    • 03.02.2018
    • 333

    #2
    Ich habe jetzt noch das hier gefunden. Mir hilft es leider nicht. Aber vielleicht hilft es ja einem von euch?
    Dir vielleicht schieder ?

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: modbus5.png
Ansichten: 1234
Größe: 235,3 KB
ID: 408206

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: modbus6.png
Ansichten: 1199
Größe: 127,4 KB
ID: 408227
    Zuletzt geändert von ceeage; 25.10.2023, 13:05.

    Kommentar

    • Tico
      Lox Guru
      • 31.08.2016
      • 1035

      #3
      The following description is applicable to the 'Force Charge 1000W'. The green highlighted area are the Hex values that would be sent from an RS485 Extension. This matches the Excel information you posted earlier in the 'Manual mode' for Modbus commands.


      Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Force Charge.png Ansichten: 52 Größe: 31,2 KB ID: 414022


      I recommend using Virtual Inputs to drive the Actuators for testing and use the Loxone 'LiveView with Manual Valve Adjustment'. Then you can simply type in the values in the Config.

      Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Force Charge 1000W.png Ansichten: 46 Größe: 13,9 KB ID: 414023

      Virtual Inputs for all three actuators (just change the Name) -


      Klicke auf die Grafik für eine vergrößerte Ansicht  Name: GDES Virtual Input.png Ansichten: 46 Größe: 33,8 KB ID: 414024


      Virtual Output for GDES -

      Klicke auf die Grafik für eine vergrößerte Ansicht  Name: GDES2.png Ansichten: 46 Größe: 32,2 KB ID: 414025


      Virtual Output for Blo

      Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Blo2.png Ansichten: 48 Größe: 31,7 KB ID: 414026


      Continued next post....
      Zuletzt geändert von Tico; 10.12.2023, 23:47.
      Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

      Kommentar

      • Tico
        Lox Guru
        • 31.08.2016
        • 1035

        #4
        Virtual Output for Bup

        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Bup2.png Ansichten: 0 Größe: 31,8 KB ID: 414028



        I always struggle getting the Byte order correct. My best guess based on other brands is -

        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Byte Order 1.png Ansichten: 0 Größe: 1,8 KB ID: 414029

        There's another 4 variations that are possible. You may need to experiment, but they will be consistent across all three actuators.

        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Byte Order.png Ansichten: 0 Größe: 4,1 KB ID: 414030


        Some inverter brands have 'Enable Modbus Control' in the web-interface settings (ie. Fronius). Check whether this is the case.

        Lastly, here's some background info that helped establish the requirements for 'Force Charge 1000W'​.

        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: RS485 Force Charge 1000W.png Ansichten: 0 Größe: 125,7 KB ID: 414031

        The same format can be used to check the 'Force Discharge 1000W' -

        Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Forced Discharge.png Ansichten: 0 Größe: 30,9 KB ID: 414032

        Continued next post.....
        Zuletzt geändert von Tico; 10.12.2023, 05:11.
        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

        Kommentar

        • Tico
          Lox Guru
          • 31.08.2016
          • 1035

          #5
          Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Forced Discharge 1000W.png
Ansichten: 789
Größe: 14,2 KB
ID: 414034


          Lastly, 'PCC Power 1000W' -

          Klicke auf die Grafik für eine vergrößerte Ansicht

Name: PCC.png
Ansichten: 780
Größe: 31,0 KB
ID: 414035

          Klicke auf die Grafik für eine vergrößerte Ansicht

Name: PCC Power 1000W.png
Ansichten: 778
Größe: 14,0 KB
ID: 414036
          Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

          Kommentar

          • ceeage
            LoxBus Spammer
            • 03.02.2018
            • 333

            #6

            Hello Tico, thank you very much for your work! I really appreciate that. However, it doesn't work. The three values ​​have to be written at once. I tried this using an analog selector switch and also with the virtual inputs you created. Nothing works at all with 32-bit settings. With 64-bit settings, values ​​come but they do not match the transmitted values. I have to say that I don't use a Modbus extension but a TCP converter from Waveshare. But that shouldn't actually be a problem since I can read and write simple 16-bit values. Is it possible that Loxone cannot write these multiple registers? Have you ever tried writing multiple registers in Loxone for something else? Thanks and greetings, Chris


            Kommentar

            • Tico
              Lox Guru
              • 31.08.2016
              • 1035

              #7
              Looking through my projects, I don't have any 32bit actuators to test. I could be a limitation of Loxone that it can't do 32bit actuators. Can you instead write 6 x 16bit registers simultaneously? Is there a defined timeframe that all register commands must be sent in?

              ie. Force Charge 1000W

              Register 4486 = value 0
              Register 4487 = value 0
              Register 4488 = value 0
              Register 4489 = value 1000
              Register 4490 = value 0
              Register 4491 = value 1000

              I assume you're sending standard Modbus TCP direct from the Miniserver to the converter? Is the TCP converter at the inverter/battery connection using a Modbus RTU connection there?

              Is that properly terminated with a 120 Ohm resistor?

              Currently I am using a Raspberry Pi 4 to read temperature and humidity data which will form part of a broader project I am working on My setup Raspberry pi 4 running node red, wifi enabled DFRobot SEN0438 Temperature and Humidity Sensor (Utilise Modbus RTU over RS485) Waveshare CE07325 Industrial USB to RS485 converter The Raspberry pi will operate as a Modbus TCP/RTU Gateway. This will allow me to read Temperature and humidity Data via Modbus TCP for devices that utilise Modbus RTU Curren...


              You said "With 64-bit settings, values ​​come but they do not match the transmitted values.". What values come? Battery charging values occur? Or something else?
              Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

              Kommentar

              • ceeage
                LoxBus Spammer
                • 03.02.2018
                • 333

                #8
                Zitat von Tico
                Looking through my projects, I don't have any 32bit actuators to test. I could be a limitation of Loxone that it can't do 32bit actuators. Can you instead write 6 x 16bit registers simultaneously? Is there a defined timeframe that all register commands must be sent in?

                ie. Force Charge 1000W

                Register 4486 = value 0
                Register 4487 = value 0
                Register 4488 = value 0
                Register 4489 = value 1000
                Register 4490 = value 0
                Register 4491 = value 1000
                I'll try to write six individual registers as you described tomorrow. Interesting approach. Thanks for that!
                Apparently you have to write the three multi-registers at the same time for the inverter to accept them.

                Zitat von Tico

                I assume you're sending standard Modbus TCP direct from the Miniserver to the converter? Is the TCP converter at the inverter/battery connection using a Modbus RTU connection there?

                Is that properly terminated with a 120 Ohm resistor?
                Yes exactly. Modbus RTU. I attached the resistor to the Waveshare. I don't have any other Modbus participants on the wire. I understand from your link that a resistor on the inverter could help? It could also be that the Waveshare is unsuitable. I also have Home Assistant running at the same time. There is a plugin installed there which I can use to control the inverter/battery. This is how you set the values. However, I don't know how it's done. At the same time, I don't have Loxone and Home Assistant running, otherwise they could interfere with each other.

                Could the Loxone Modbus Extension help?

                Zitat von Tico

                You said "With 64-bit settings, values ​​come but they do not match the transmitted values.". What values come? Battery charging values occur? Or something else?
                ​​​​​​​Tomorrow I will post pictures of what values ​​come when I send something to the inverter.

                What is also not entirely clear to me is which value is responsible for the charging current of the battery? Is it the "Gdes"? There are some documentations on the internet which sometimes contradict each other.​

                Kommentar

                • Tico
                  Lox Guru
                  • 31.08.2016
                  • 1035

                  #9
                  Zitat von ceeage
                  Could the Loxone Modbus Extension help?
                  The Web Configuration of the Waveshare device appears to have many parameters. Combined with getting Loxone correctly configured, that's a lot of parameters to get exactly right. You might find the simplicity of going Loxone Modbus Extension direct to the device is successful.

                  Notwithstanding, you said you were reading values ok now. The 'Work Mode' of the Waveshare device strikes me as a possibility. Can you post the equivalent page of your settings -

                  Klicke auf die Grafik für eine vergrößerte Ansicht

Name: RS485_TO_ETH_(B)_Manual_052.png
Ansichten: 831
Größe: 92,4 KB
ID: 414127

                  I interpret GDES as the Grid Connection desired power flow. The charging current of the battery reads as being controlled by a combination of Blo and Bup. ie The Force Charge example above.
                  Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                  Kommentar

                  • ceeage
                    LoxBus Spammer
                    • 03.02.2018
                    • 333

                    #10
                    Hello Tico, here is the information you are looking for. I hope you can read a little something from my screenshots. You can only control anything with 64-bit settings. However, the values ​​that are read do not match (red circle).

                    I will try to attach a 120 ohm resistor to the inverter connector. This is ordered. I will then give you feedback if anything changes.

                    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: blo.png Ansichten: 0 Größe: 187,1 KB ID: 414274
                    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: blo2.png Ansichten: 0 Größe: 187,5 KB ID: 414275
                    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: blo3.png Ansichten: 0 Größe: 179,7 KB ID: 414276



                    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: IMG_5256.jpg
Ansichten: 763
Größe: 209,1 KB
ID: 414281



                    Zuletzt geändert von ceeage; 12.12.2023, 19:00.

                    Kommentar


                    • Tico
                      Tico kommentierte
                      Kommentar bearbeiten
                      I need some clarification on what behaviour is occurring. Are you seeing changing behaviour of the battery, but just not getting coherent values returned by the sensors?
                      Or are you not getting any change in battery behaviour and only seeing values change/returned if 64bit settings are used for the actuators?
                      I've looked at those screenshots you posted and a picture is emerging. Can you clarify if any write attempts were made to the actuators between each screenshot?
                      And what happens if a 32bit sensor is created to read different IO Address's (ie. 4488, 4489, 4490) with just 16-bit register checked. Just the values returned for each address could be helpful.

                      edit - I wouldn't worry with the 120 Ohm resistor. I think it is solvable with the current hardware setup.
                      Zuletzt geändert von Tico; 13.12.2023, 02:51.

                    • Tico
                      Tico kommentierte
                      Kommentar bearbeiten
                      Also, you mentioned you were reading values perfectly. I assume these were PV-Power and Bezug-Einspelsung. Are those sensors using the advertised IO-Address or IO-Address-1? (ie. sometimes Loxone requires -1, sometimes not).

                    • ceeage
                      ceeage kommentierte
                      Kommentar bearbeiten
                      It is not so easy to map all changed parameters. Of course I tried all registers as suggested. also individually as 16-bit variants. Only with the 64-bit setting does something happen. Screenshot 1 drained the battery, screenshot 2 powered the battery from the mains and screenshot 3 shows no effect. but when unloading and loading this happened with the non-specified values. I know it may be asking a lot, but would it perhaps be in your interest if you could take a look at it yourself remotely? Maybe I'm just missing something? Thank you for your commitment! oh and about the addresses. I can create the ones that can be read correctly as normal. without deducting a spot. When writing the values, I also tried subtracting the addresses by one place. but unfortunately it didn't do anything.
                  • Tico
                    Lox Guru
                    • 31.08.2016
                    • 1035

                    #11
                    Given that you have sensors that are reading correctly without deducting a spot, I will assume that writing to actuators should occur without deducting one place.

                    I will only address the first two screenshots where something is happening to the battery.

                    Those screenshots of the values being returned are helpful. I can see what you are sending as Actuator settings. I can't see what you have set up as Sensor settings.
                    The problem appears to be getting the bytes in the correct order for the sensors.

                    If you look at the first screenshot of the value returned -

                    -402456576

                    Put that value in a decimal to hex converter -

                    Decimal to hex number conversion calculator and how to convert.


                    ​​
                    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: E8030000.png
Ansichten: 760
Größe: 18,6 KB
ID: 414365


                    Then consider what Loxone is 'seeing' in the 12byte value field - it reads down the column and re-orders the bytes according to your settings.
                    The sensor is reading hex values of E8 03 00 00, but 1000 has a hex value of 03 E8. The hex value 00 00 03 E8 will be read as 1000 (leading zero's are ignored). ie. reverse the byte order of the sensor to read 1000.
                    I think you said this scenario was draining the battery.


                    ​​

                    Then look at the 2nd screenshot of values returned -

                    65536000

                    ​​
                    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: 65536000.png
Ansichten: 698
Größe: 20,5 KB
ID: 414366

                    We see 03E8 which is equal to 1000. But it is also picking up an extra 0000 (which makes it decimal 65536000 in Loxone).

                    ​​
                    I think the way forward is to create six sensors (one for each register); 4487, 4488, 4489, 4490, 4491, 4492

                    eg. IO Address - 4487
                    Command - 3 - Read Holding Register (4x)
                    Data Type - 16-bit Unsigned Integer
                    Checked - 16-bit register

                    Command the battery to discharge. Then note the decimal value returned for each register. A screenshot of this will be helpful.

                    Repeat for commanding the battery to charge from the grid. Screenshot the six sensors again.

                    This will hopefully give a better sense of all registers for both situations of charging and discharging.
                    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                    Kommentar

                    • ceeage
                      LoxBus Spammer
                      • 03.02.2018
                      • 333

                      #12
                      Hello Tico,

                      Unfortunately it took a while to respond but unfortunately i was unable to attend. I just played around with your values a bit again. I created the six sensors as suggested. On the screenshot you can see them and the received value. The old values were somehow no longer displayed to me.

                      But now it doesn't change anything about the behavior of the battery. I can't load/unload anything anymore. I don't know what the problem is and how I can move forward now? Thanks anyway for your help. Maybe you can think of something else?​

                      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: blo4.png
Ansichten: 734
Größe: 194,0 KB
ID: 426418

                      Kommentar


                      • Tico
                        Tico kommentierte
                        Kommentar bearbeiten
                        I don't have a lot to go on unfortunately. I would suggest experimenting with the Actuators until you can reproduce the forced charging and forced discharging. Only when that occurs can headway be made.
                    • Sandmann0709
                      Azubi
                      • 01.04.2024
                      • 2

                      #13
                      ceeage bist du bei dem problem schon weitergekommen? Konntest du den force charge oder discharge schonmal über loxone steuern? Mich würde die Lösung auch brennend interessieren :-), da ich gerade überlege welche speichergröße ich mir zulege.
                      Warum muss man die 6 register überhaupt alle zusammen bzw. gleichzeitig schreiben?

                      LG
                      Alex

                      Kommentar

                      • Loxfreunde
                        Azubi
                        • 13.09.2024
                        • 2

                        #14
                        Original - Example from Sofar for the passive Mode:

                        Passive Mode For real time control of the HYD inverter, it must be set to the passive mode

                        01 10 11 10 00 01 02 00 03 E5 C0

                        01: Communication address
                        10: Control function code
                        11 10: Register first address
                        00 01: Number of registers
                        02: Data length
                        00 03: Energy_Storage_Mode_Control:3 Register address: 1110
                        E5 C0: CRC Checksum Low 8 bits first, high 8 bits last

                        Discharge the battery with 120 W Set the min. and max. limit to -120

                        01 10 11 89 00 04 08 FF FF FF 88 FF FF FF 88 61 A0

                        01: Communication address
                        10: Control function code
                        11 89: Register first address
                        00 04: Number of registers
                        08: Data length
                        FF FF FF 88: Passive_Manual_Blo: -120W Register Address: 1189 118A (minimum discharge power limit)
                        FF FF FF 88: Passive_Manual_Bup: -120W Register Address: 118B 118C (maximum discharge power limit)
                        61 A0 :CRC Checksum Low 8 bits first, high 8 bits last

                        Set the battery into standby By setting all power limits to 0

                        01 10 11 89 00 04 08 00 00 00 00 00 00 00 00 94 09

                        01: Communication address
                        10: Control function code
                        11 89: Register first address
                        00 04: Number of registers
                        08: Data length
                        00 00 00 00: Passive_Manual_Blo:0W Register address: 1189 118A
                        00 00 00 00: Passive_Manual_Bup:0W Register address: 118B 118C
                        94 09 :CRC Checksum Low 8 bits first, high 8 bits last​

                        Charge the battery with 500 W Set the min. and max. limit to 500

                        01 10 11 89 00 04 08 00 00 01 F4 00 00 01 F4 24 1A

                        01: Communication address
                        10: Control function code
                        11 89: Register first address
                        00 04: Number of registers
                        08: Data length
                        00 00 01 F4: Passive_Manual_Blo:500W Register address: 1189 118A
                        00 00 01 F4: Passive_Manual_Bup:500W Register Address: 118B 118C
                        24 1A: CRC Checksum Low 8 bits first, high 8 bits second​
                        Zuletzt geändert von Loxfreunde; 13.09.2024, 12:47.

                        Kommentar

                        • Sandmann0709
                          Azubi
                          • 01.04.2024
                          • 2

                          #15
                          Servus,
                          Da ich es mit Loxone nicht schaffe, diese Parameter zu verändern bzw. gleichzeitig in mehrere Register zu schreiben, schalte ich nun nur zwischen Nutzungszeitmodus (1) und Self-Use Modus (0) hin und her. Das funktioniert ganz gut. Die Ladeleistung kann ich zwar nicht variieren, das stört aber nicht wirklich. Die habe ich nun fix eingestellt auf 8kW. Der Register den ich als Aktor nutze ist Nr. 4368.
                          Damit die Steuerung über Loxone funktioniert, müssen am Wechselrichter einmalig die Zeitparameter gesetzt werden.
                          Angehängte Dateien

                          Kommentar

                          Lädt...