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.

CCS/LAUNCHXL-F28069M: Encoder array data export to GUI Composer with PLOT or CVS file?

Part Number: LAUNCHXL-F28069M


Tool/software: Code Composer Studio

Graph_QEP1[Graph_Counter] = ENC_getElecAngle(encHandle);
Graph_QEP2[Graph_Counter] = ENC_getElecAngle(encHandle2);
Graph_EST3[Graph_Counter] = EST_getAngle_pu(obj->estHandle);

My motor code has capture 300 of the above symbol and when filled, ideally transfer to GUI "PLOT" widget but there no instruction on how to implement this. I'm happy to accept a solution for GUI to provide txt or csv files instead of plot.

How to do that? after reading thro', it mentions javascript is required to do that, but how, is there a working demo solution?

I'm only starting to learn GUI composer V2. Not bad, it hard to keep track of real-time data from enc block (BLDC InstaSpin-Motion), I was comparing between two encoders (QEP1/QEP2) and est. 

Plan B: In CCS is there a way to combine all 3 arrays into a single chart. 

  • Hi

    To supplement my effort to understand this.

    I have a test array code:

    #define GRAPH_SIZE 300
    volatile _iq Graph_QEP1[GRAPH_SIZE];
    volatile _iq Graph_QEP2[GRAPH_SIZE];
    volatile _iq Graph_EST3[GRAPH_SIZE];

    ... and in main().....just to experiment with GUI Composer V2.

    //---------------------------Populate data for test.
    for (int i=0; i<GRAPH_SIZE; i++)
    {
    Graph_QEP1[i]=_IQ24(((float)(i)/10.0));
    Graph_QEP2[i]=_IQ24((((float)(100-i))/10.0));
    }
    which is binded to linechart widget in GUI Composer V2 via testarray.gui (attached)
    I do get linear ramp between QEP1 and QEP2 based on value in the linechart properties

    myXDS|Graph_QEP1
    myXDS|Graph_QEP2

    It seems the array data do passed to the linchart widget which is good, but the number needs scaling.

    However when I change value to

    myXDS|Graph_QEP1.$q24

    myXDS|Graph_QEP2.$q24
    It fails to work along with red circle and white cross.

    I tried this value below.

    myXDS|Graph_QEP1/16777216
    myXDS|Graph_QEP2/16777216
    It fails to work along with red circle and white cross.

    I tried this value below.

    myXDS| 0.00000596 * Graph_QEP1

    myXDS|0.00000596 * Graph_QEP2

    It fails to work along with red circle and white cross.

    What I have done wrong here, is there way to scale the number to Q24?

  • document.addEventListener('gc-databind-ready', function() 
    {
        /* 
    	*   Add custom computed value databindings here, using the following method:
    	*
        *   function gc.databind.registry.bind(targetBinding, modelBinding, [getter], [setter]);
    	*
    	*   param targetBinding - single binding string or expression, or array of binding strings for multi-way binding.
    	*   param modelBinding - single binding string or expression, or array of binding strings for multi-way binding.
    	*   param getter - (optional) - custom getter function for computing the targetBinding value(s) based on modelBinding value(s).
    	*   param setter - (optional) - custom setter function for computing the modelBinding value(s) based on targetBinding value(s).
        */
    
    	    gc.databind.registry.bind(
    	        'widget.ti_widget_linegraph.series_0_values',       // A numberbox labeled OUTPUT. MUST preceded the widget name with "widget."
    	        "Graph_QEP1",                                       // A numberbox labeled INPUT.  MUST preceded the widget name with "widget."
                function(value)
                {
                    var i;
                    //var data2 = []; data2.length = value.length;  // One Method.
                    var data2 = new Array(value.length); 
                    for (i=0; i<value.length; i++)
                    {
                        data2[i]=value[i]/(Math.pow(2, 24));
                    }
                    //templateObj.$.ti_widget_linegraph.series_2_values = data2;
                    templateObj.$.ti_widget_linegraph.series_0_values = data2;
                    return (value);
                }
            ); 
            
            	gc.databind.registry.bind(
    	        'widget.ti_widget_linegraph.series_1_values',       // A numberbox labeled OUTPUT. MUST preceded the widget name with "widget."
    	        "Graph_QEP2",                                       // A numberbox labeled INPUT.  MUST preceded the widget name with "widget."
                function(value)
                {
                    var i;
                    for (i=0; i<value.length; i++)
                    {
                        value[i]=value[i]/(Math.pow(2, 24));
                    }
                    templateObj.$.ti_widget_linegraph.series_1_values = value;
                    return (value);
                }
            ); 
    });

    Not sure what the difference between

    gc.databind.registry.bind
    and
    gc.databind.registry.getBinding

    Is here documentation/example details to cover this?

    Anyway above code  is the working solution to modify array data before it goes to linegraph.

    Please confirm:

    targetBinding = Mean GUI object end?
    modelBinding = Mean MCU object end (global variable)?, why it named as 'model'

    
    

  • Hello,

    Sorry for the delay. I have forwarded this issue to our GUI Composer expert. He is currently away but will return Tuesday so I hope to have an update for you then.

    Thanks

    ki

  • Any progress?