GRAPH_DATA_XY_AddPoint x overflow

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • GRAPH_DATA_XY_AddPoint x overflow

      Greetings!

      GRAPH_DATA_XY_AddPoint() takes a GUI_POINT which is a signed 16 bit value for X. I have a long running strip chart which will overflow.

      Upon testing the 32767 (2^15 - 1) barrier, it appears to not handle it well. I tried resetting it to 0 after 32767, but that is also not working.

      What is the recommended practice for a long running monotonically increasing X which overflows the 16 bit signed max in the GRAPH_DATA_XY widget?

      Related xref: Is there a way for getting data added to GRAPH_DATA from GUI heap?

      Cheers,
      Joe
    • Hi,

      GRAPH_DATA_XY_AddPoint() is for adding points in the form of coordinates. Values as large as the signed 16-bit limit won't work in the GRAPH since they are out of the display/widget area.

      You need to add coordinate points to the GRAPH based on your measurement values. Or maybe the GRAPH_YT makes more sense for your application. GRAPH_YT is useful for continuously adding values to a curve which gets automatically shifted to the left if new values are added.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Florian,

      I am using the GRAPH_XY as a GRAPH_YT (strip chart) because, at the time, it allowed a customization that I could not get to work for GRAPH_YT.

      I may need to do a quick test to see if GRAPH_YT can be customized as I have GRAPH_XY. There is scrolling through the data using softkey buttons.

      Upon review of my notes, I see that GRAPH_YT lacks the GRAPH_DATA_XY_SetLineStyle() capability, which is a show-stopper for its use. Is there a way to set LineStyle for GRAPH_YT?

      Cheers,
      Joe
    • Hi Joe,

      There is no equivalent function to set the line style of GRAPH_YT curves. This is because GRAPH_YT is for adding continuous values and e.g. a dashed line would indicate missing data.

      But you would be able to "simulate" a dashed line by leaving out a few values of the GRAPH every few times. The value 0x7FFF can be added for missing data and this value will not be displayed in the graph.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.