MODBUS - Auslesen von Register Reihenfolge - wie?

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Jan W.
    Lox Guru
    • 30.08.2015
    • 1369

    #16
    Regarding timeout: it's also my understanding that this time is the maximum amount of time that the miniserver waits for a reply. The next polling cycle might start when either an answer was received or a timeout.

    Regarding Tico's observations: the miniserver might only have a single "unit" to process all modbus queries, so the miniserver waits for a reply or timeout after any request was send out. In my case with a very short answer time from the polled device and a relatively high polling time, it does not reduce the total number of sensors that can be polled. However if the device has an answer time of 500 ms for a request and you have 20 sensors, it takes 10 seconds if only a single request can be processed at a time.

    For curiosity I've reduced the polling time to 1s for all of my 38 sensors and have increase the timeout to 1000ms at the same time. The result: it does not work and I get a lot of errors "sensor does not deliver values". With Wireshark I can see that the polling for a specific parameter is about every 43 seconds. Well it's not exactly 38*1000ms=38sec, but I also have a few actors in addition to the sensors.

    Then I've reduced the timeout back to 50ms: now I can see a polling cycle of about 2,3 sec for each parameter. Again it's not exactly matching 38*50ms=1,9sec.

    It looks that Loxone has still build in some "safety" regarding modbus polling interval.

    In a next test I've reduced the timeout to 10ms and kept the polling cycle at 1s: now I can measure a polling time of about 1s.

    I found this in the release notes for 14.4.9.25:
    • A3D9-T1055 Modbus High Performance Input
      • reduce common minimum polling-cycle to 1s (except Air-Devices)
      • up to 2 Sensors per Modbus-Server or Extension allow a minimum time of 0.1s
      • if multiple modbus-servers with same IP (TCP) or multiple devices with same Device-ID(TCP + RTU) exists, performance sensors are disabled for these devices
    ​To verify if the "high performance", I've reduced the polling cyle for a single sensor to 0,5sec: that also works, but the polling intervall fluctuates between 0,5 and 0,8 sec. The modbus server still responds as fast as before (load is about 2%), but guess that the miniserver is the limiting factor.

    Lessons learned: there is a correlation between the number of sensors for a single device, the polling cycle and the timeout. The actual polling cyle is at least <number of sensors> * <timeout> . This might especially affect modbus devices that require a higher timeout value. You should carefully set the timeout if you need a short polling cycle and have many sensors.

    Regarding fragmentation: I have this option checked. The first sentence in the explanation from Loxone is wrong (in my opinion):

    Fragmentierte Pakete - Es wird erwartet, dass das Gerät die Pakete fragmentiert sendet. Ist diese Option nicht aktiviert, wird die Antwort des Geräts beim Empfang des ersten Paktes ausgewertet.

    With Wireshark I was able to verify that the device does NOT send fragmented IP packets. The answers are always short enough to fit into a single packet (packet length is about 60 to 66 bytes). In my opinion there is no need for a device to send fragmented packets, because Loxone is querying only a single register and the answer would always fit into a single packet. However it does not hurt to check this box. Somebody might ask Loxone about this option - to me it it does not make any sense.

    Tico: you may try to create a second (or even more) modbus servers with the same IP address, split your sensors among these and see if this affects your results.
    Zuletzt geändert von Jan W.; 02.03.2024, 15:42.
    Miniserver v14.5.12.7, 2x Ext., 2x Relay Ext., 2x Dimmer Ext., DMX Ext., 1-Wire Ext., Gira KNX Tastsensor 3 Komfort, Gira KNX Präsenzmelder, Fenster- und Türkontakte, Loxone Regen- und Windsensor, Gira Dual Q Rauchmelder vernetzt, 1x Relais-Modul
    Loxberry: SmartMeter, MS Backup, CamConnect, Weather4Lox
    Lüftung: Helios KWL EC 370W ET mit Modbus TCP - via Pico-C
    Heizung: Stiebel Eltron WPF 5 cool (Sole-Wasser WP) mit ISG, FB-Heizung mit 18 Kreisen, Erdsonde - via modbus/TCP
    Node-RED: IKEA Tradfri

    Kommentar

    • Tico
      Lox Guru
      • 31.08.2016
      • 1035

      #17
      Zitat von Jan W.
      The actual polling cyle is at least <number of sensors> * <timeout>.
      Agreed. That was a behaviour I observed with this wiki entry on 'tuning' Modbus for performance (paragraph g. Optimising Polling Cycle) -



      I have now unchecked 'Fragmented packets' and was pleasantly surprised that my polling rate immediately improved to that set (10 seconds). Further exploration with reducing the polling cycle to 5 seconds resulted in the Miniserver having an inelegant 'crash' (only Modbus function). The error in the Loxone Monitor was continuously repeating errors of 'Unexpected TransactionID:xxxA expected:xxxB' and no data flow. It was as if the polling flow suddenly bunched up and the Modbus unit wasn't able to keep up.

      Lessons learned: With 'Fragmented Packets' checked, the Miniserver appears to priortise waiting for the Timeout to complete. Tuning the Timeout is much more critical to achieving the best performance. And the Miniserver should be able to be adapted to sensitive clients that don't like fast polling....waits for schurli experience???

      With 'Fragmented Packets' unchecked, the Miniserver appears to priortise waiting for the returned response, or waiting for the Timeout, whichever occurs earlier.

      In both cases, it's seems fairly easy to overload the Modbus server with a combination of too many sensors and/or inappropriate Timeout.
      Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

      Kommentar

      • schurli
        Extension Master
        • 29.01.2019
        • 107

        #18
        Dear Both,

        I have now ticket the "fragmented" checkbox and I specified the timeout with 500 ms. I cannot see a difference to before when I had "fragmented" not checked. More than half of the requests are sent out before 500 ms have expired, sometimes after 200ms. For all my values I use "3-read holding register" and 32-bit unsigned integer.

        Kommentar


        • Tico
          Tico kommentierte
          Kommentar bearbeiten
          Your current polling of 17 parameters at 500ms = 8.5 seconds. So it is within 10 seconds and you won't see any change. You need to get the 17 parameters multiplied by the Timeout to be greater than 10 seconds. 17 x 1000ms = 17 seconds. You should see the polling slow down.

        • schurli
          schurli kommentierte
          Kommentar bearbeiten
          ok, I'll try later and will report :-)

        • schurli
          schurli kommentierte
          Kommentar bearbeiten
          jetzt kommt es eher auf 1s Warteintervall hin. Interessant ....
      • Tico
        Lox Guru
        • 31.08.2016
        • 1035

        #19
        If I understand your original problem, Hoymiles Support suggested the DTU requires a minimum interval of 1 second between individual queries. Therefore, set Timeout to 1100ms or perhaps 1500ms. If the crashing is caused by an overloaded DTU, it will be interesting to see if this solves the problem.

        You may need to accept that the Hoymiley DTU can't do 17 parameters in 10 seconds. The only way to improve that would be to see whether you have any co-located parameters (ie. adjacent IO addresses). Then you might see a slight improvement to pull in 64bit registers and post-process in the Config.
        Zuletzt geändert von Tico; 07.03.2024, 23:19.
        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

        Kommentar


        • schurli
          schurli kommentierte
          Kommentar bearbeiten
          with 1000 ms timeout the Hoymiles DTU crashed once sonce yesterday evening. I'll try to increase the value to 1500 ms.

          Hoymiles have designed their DTU such that for every solar panel you have an address space of 40 bytes (I believe), then the data for the next panel comes. That is, all relevant parameters are spaced apart by 40 bytes. So there are no adjacent parameters which I could read at the same time, unless it would be possible to read a much larger amount of data at the same time.
      • Noschvie
        LoxBus Spammer
        • 24.09.2018
        • 477

        #20
        Mich würde jetzt wirklich interessieren, wie das Verhalten ohne Loxone ist. Kannst du mit Node-Red eine Abfrage machen?

        Kommentar

        • schurli
          Extension Master
          • 29.01.2019
          • 107

          #21
          Zitat von Noschvie
          Mich würde jetzt wirklich interessieren, wie das Verhalten ohne Loxone ist. Kannst du mit Node-Red eine Abfrage machen?
          habe leider keinerlei Erfahrung mit Node-Red ....

          Kommentar

          • Syncrodirk
            Azubi
            • 31.03.2022
            • 2

            #22
            Guten Tag , hat es hier mittlerweile eine geschafft das ess Home Lg einzulegen in loxone ?
            Mit freundlichen Grüßen dirk

            Kommentar

          Lädt...