GRAPH_DATA_YT_AddValue questions

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

    • GRAPH_DATA_YT_AddValue questions

      Hi,
      I would like to use GRAPH widget to show the waveform.
      GRAPH_DATA_YT_AddValue function can only add one value into GRAPH_DATA_Handle,
      is there any methold to update the whole date array? I can use the following code to initial data array,
      and attach them to GRAPH_DATA_Handle, but when I change the content of data after then, the Graph are not change accordingly.
      My quetions is how to update the whole data array and let Graph change accordingly.
      Thanks for your support.


      static I16 data[600];
      for(int i=0;i<600;i++)
      {
      data=4*(i%100);
      }
      Graphdata = GRAPH_DATA_YT_Create(GUI_RED, 600, data, 600);
      GRAPH_AttachData(hItem, Graphdata);
    • Hi,

      currently there is no GRAPH_DATA routine to update the array. You have to clear the old data handle, create a new one and attach it.

      C Source Code

      1. if (hData) {
      2. GRAPH_DATA_YT_Clear(hData);
      3. }
      4. hData = GRAPH_DATA_YT_Create(GUI_RED, 100, aData, 100);
      5. GRAPH_AttachData(hGraph, hData);

      Also, to actually fill the array with values, you have to index the array. Like this:

      C Source Code

      1. aData[i] = 123;
      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.