This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: GC add trigger in plot

Part Number: TMS320F28335


Hi everyone,

I am creating a GUI with a graphical display of a sine wave. I want to add a plot trigger when data crosses zero for a consistent and easily digestible display. Due to limited memory on my device, processing data as such before sending to the GUI is not an ideal option.

In GUI Composer v2, I am currently using a line graph which does not explicitly incorporate this functionality. Is it possible for me to edit the java script (Am I correct in assuming this is where it would need to be added?) in order to add this functionality to my plot? 

I am also aware of the 'Plot' widget available in v2 library which is more flexible in terms of customized plotting. I have checked the "Plotly" functions and events from https://plotly.com/javascript/plotlyjs-function-reference/ and have not found anything related. Is the trigger functionality available and/or more efficiently configured through this widget?

**side note, I have done some digging and couldn't find anything in the v3 library about this either, but if it is available, please let me know.

Any help or directions to the appropriate resources to achieve this would be great.

Thank you in advance,

Alex.

  • Alex,

    Sorry for the hassle. The documentation for GC is admittedly "light" and my own personal knowledge of it is limited. I'll need to confer with some GC experts tomorrow and keep you posted.

    ki 

  • Sorry for keeping you waiting. I'm still looking into this.

  • Is it possible for me to edit the java script (Am I correct in assuming this is where it would need to be added?) in order to add this functionality to my plot? 

    You are correct. 

    in the source for the *.gui file, you can add:

    <div id="props"></div>

    Then in your application js file, you can add a custom value databinding like:

    bindingRegistry.bind('props.array', 'targetArray',
        value => { return value*5/9 + 32; }, /* getter */
        value => { (return value-32)*9/5; } /* setter */
    );

    Where 'targetArray' is the actual graph plot data in the target code and being pushed to the created property object 'props.array'. Then for the graph, you would bind it to the 'props.array' (select 'props' in the dropdown and enter 'array' in the variable field).

    You can modify the code above for whatever action you wish for the getter and setter values to trigger for non-zero values.

    See the comments in the Boilerplate code for databinding that comes in the default application js file.

    Hope this helps

    ki