Node-Red Buffers -(Integers and Floats)

Поделиться
HTML-код
  • Опубликовано: 11 окт 2024

Комментарии • 18

  • @andresm4668
    @andresm4668 3 года назад

    Thanks for always save me!
    Greetings from Mexico!

  • @quaternion-pi
    @quaternion-pi 5 лет назад

    Thanks for the clear explanations and excellent related references. Very helpful.

  • @josephtanner248
    @josephtanner248 2 года назад

    Thanks Steve for these explanations. I love your no frills little examples!
    Could you show this with the node-red-contrib-buffer-parser. Especially with a longer string, this node would be clearer.

  • @HelloHelloXD
    @HelloHelloXD 5 лет назад

    I just discovered your channel. Great job!

  • @edsontouche
    @edsontouche 3 года назад

    Thanks for help me Steve!

  • @milleniazwisabatinasirait1432
    @milleniazwisabatinasirait1432 2 года назад

    Can I ask a question pls?
    how can we do calculations with these buffer numbers according to float or integer type calculations? for example 12.5 : 2 = 6.25, how can we do this in a buffer or can we do it in a function which only consists of converting a float number to a buffer and doing the calculations in a normal way? or do we have to do the calculations in a buffer calculation as well?
    and can you give an example sir? thank you 🙏

    • @stevecope
      @stevecope  2 года назад

      To do the calculation you will need to convert the buffer into a float then do your calculation and convert it back again to a buffer.
      Rgds
      Steve

  • @devendrasongra786
    @devendrasongra786 5 лет назад

    You explained very gr8.
    I am trying to convert buffer [4] to 32 bit float value but it's not done.
    Buffer Value is [57,19,67,90] represent as 32 bit float value
    Pls tell me how to do or give code for this same 32bit representation
    Or
    for array [2] to 32 bit value floating reprentation.
    Thanks in advance

    • @stevecope
      @stevecope  5 лет назад

      hi
      code should be
      b=Buffer.from([57,19,67,90]);
      output=b.readFloatBE()
      output should be the float number
      0.00014044102863408625
      Is that correct?

    • @devendrasongra786
      @devendrasongra786 5 лет назад

      @@stevecope output should be in like a 3 digit value as 230.3 volt of frequency or different

    • @stevecope
      @stevecope  5 лет назад

      Hi
      Is the buffer value you sent me correct? Should that buffer value evaluate to 230.4? Is it BE or LE
      rgds
      steve

    • @devendrasongra786
      @devendrasongra786 5 лет назад

      @@stevecope
      Hi
      Now buffer value is [67,162,67,104] or for Array showing [17315, 17256].
      In this case Energy Meter voltage showing 232.3 volt 32bit floating value.

    • @stevecope
      @stevecope  5 лет назад +1

      Hi
      Not sure of the question? To convert the buffer into a value use
      value=buf.readFloatBE()
      I've updated the tutorial on the site with examples at the bottom.
      www.steves-internet-guide.com/understanding-buffers-node-red/