Menu

Plotting binary values

Logging
franto
2023-07-11
2023-07-11
  • franto

    franto - 2023-07-11

    Hi,

    I recieve this message:

    02h 55h 55h 07h 05h 0Fh 00h A9h 17h 31h B4h 49h 42h 0Ah 29h

    Message bytes are interpreted as follows:

    data bytes description
    02h 55h 55h 07h 05h 0Fh 00h 1-7 unique message Id
    A9h 17h 8-10 integer number 17A9h (6057)
    31h B4h 49h 42h 11-14 floating point number 4249B431h (50.426)
    0Ah 29h 15-16 CRC16 Modbus 290Ah

    I recieve this message every 2s and would like to plot flaoting and integer number.

    How do I parse and plot these two values ?

    Thank you
    Frank

     
  • Maettu

    Maettu - 2023-07-11

    Hi Frank,

    Please see tooltip of Trigger and Action:

     

    Last edit: Maettu 2023-07-11
  • Maettu

    Maettu - 2023-07-11

    You can use e.g. https://regex101.com/ to develop your regex. In your case:

    (?>..h ){7}(..)h (..)h (..)h (..)h (..)h (..)h(?> ..h){2}
    

    Then, the integral value would become $1$2 and the float value $3$4$5$6. However there is a catch: Regex doesn't allow to combine these captures into single values, especially not a floating point value. So YAT unfortunately doesn't support plotting such hex values yet. You may file a feature request for this. But it's not that easy to implement, won't be able to do this shortly.

    In the meantime: Use Log to capture the data and plot it in Matlab or Excel or whatever.

    The YAT plot infrastructure is just meant to cover the simple use cases, advanced stuff shall be done in specialized tools.

    Best regards,
    Matthias

    PS: Refining the title from "Parsing meassage" to "Plotting binary values".

     
    👍
    1

    Last edit: Maettu 2023-07-11

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.