Ankündigung

Einklappen
Keine Ankündigung bisher.

Reading sugar valley trough modbus - convert register to bit fields

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

  • Reading sugar valley trough modbus - convert register to bit fields

    Hello, i'm reading following modbus value (address 269) into a digital analogue sensor.

    How can i convert this register into a bit field?
    I tried this procedure :
    https://www.loxwiki.eu/display/LOX/E...+Bits+zerlegen

    but this cant be right , ionization is not working atm, so the bits aren't correct

    anyone to help me out?

    Klicke auf die Grafik für eine vergrößerte Ansicht  Name: modbus.png Ansichten: 0 Größe: 157,5 KB ID: 309305

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

Name: hydrolyse.png
Ansichten: 60
Größe: 18,2 KB
ID: 309306
    Zuletzt geändert von sennevb; 22.Jun.2021, 06:05.

  • #2
    Can you provide a screenshot of the Modbus sensor properties from Lox Config? That might confirm whether the sensor is set up correctly.
    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

    Kommentar


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

Name: status.png
Ansichten: 50
Größe: 25,9 KB
ID: 309395
      See image, i tried 16bits signed integer aswell, didnt made much difference.
      System was on target and first bit was 0

      I thank you for looking into this Tico

      Kommentar


      • #4
        The Modbus Register 0x010D converts to decimal 269. Loxone Modbus sensors normally need -1 from the published decimal value. So Config IO-Address = 268.

        Also check with another sensor on a different metric that should provide a known value (and reduce published register value by -1).

        On other Modbus systems, I've only ever used Command = 3 - Read Holding Register (4x).

        The Sugar Valley Modbus document I googled doesn't provide any guidance on signed or unsigned integer. Some experimenting may still be required...
        Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

        Kommentar


        • sennevb
          sennevb kommentierte
          Kommentar bearbeiten
          First address for sugar valley is 0, so -1 is not needed.
          I am reading PH value and redox value and these are correct only these one is using a bit field .

          I'm going to try command try and experiment a bit..

      • #5
        Well i played a bit with it , i think "byte-volgorde" mus tbe on, but still i dont have the correct output...

        I'm beginning to think there a error in my conversion to individual bits

        I ran into this thread:
        https://minimalmodbus.readthedocs.io...usdetails.html
        move to this part: Reading individual bits from a 16-bit register

        maybe we need a picoc code that extracts the right registervalue from it, but i dunno how to do that, i'm not in C that much

        Kommentar


        • #6
          The screenshot you provided with the value 8776 converts to -

          0010001001001000

          This agrees with the output of the binary converter blocks (when read top to bottom / right to left).

          Your screenshot is missing Q8 on the 'Higher 8 bit', but I'm assuming it is zero.

          Try here for other values -

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

          I would be inclined to turn on/off the various functions and see what bits change. Perhaps the Sugar Valley document is in error?
          Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

          Kommentar

          Lädt...
          X