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.

Making use of GUI VArs



Hello,

Me again. This time I am trying to do some handshaking between the target and GUI composer. The aim is to do a simple health check of the GUI display so that the target knows that the display is actually connected and working.

My idea was to set a bit parameter variable, e.g. (statusreg.DRIVEMODE.bit.COMMSFLAG)  to 1 in the target and have the GUI set it back to a zero after 0.5 seconds. Meanwhile the target will do a check to verify that it has actually been set back to a 0 within 2 seconds or so and if not set a Gui fail bit. I can get GUI to display the bit status no problem and use a reset button to set it back to zero if I want, but I can't automate the process. I'm using one of the CPU timers set to update a counter every second as a sequencer for the target code (CpuTimer1.InterruptCount).

I thought this might be possible using a GuiVAr and upon detecting a change state in the bit variable  set it back to zero. However, try as I might I can't quite get that bit to work. Most likely it is my limited understanding of the use of the GUI Var beasty and I wonder if one of you fine TI experts could lob a bit of demo code into the ether for my perusal?

I'm using an F28335 and CCS v6.0.

Any suggestions would be appreciated.

regards

Steve

 

  • Hi Steve,

    If I understand your question correctly, this is how I get it to work with myVar (unsinged int) target variable.

    I create a GUI Variable call 'ping' with these properties:

    • Server Bind Name: myVar
    • Data Type: Long
    • onPropertyChanged: onPingPropertyChanged

    In the app.js file, add the following to the onPingPropertyChanged function

    var t = $TI.GUIVars;
    setTimeout(function() {
        t.setValue('ping', 0);
    }, 500);

    If you add myVarto the Expressions view, you should be able to see the value reset back to zero after 500ms. I hope this is what you are looking for.

    Regards,
    Patrick

  • Hi Patrick,

    Yep, that works a treat. Excellent. Fixed my problem in less than 2 minutes! Thanks for the prompt feedback.

    I have only been struggling with this particular issue for a two or three days........

    Some more resources and examples for the GUI end of things online at TI would be welcome or do you recommend any useful referencess as to what will work and what won't for Gui Composer, particularly for a newbie to Javascript?.......

    regards

    Steve

  • GUI Composer wiki is the only resource that we have, and this forum is the best place to get a quick answer. As for Javascript, I'd ask my best friend Google for help... :) Hope you get your GUI working now. Don't hesitate to post question here.

    Patrick