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: Implementing an Auto Write feature in GUI Composer Designer

Tool/software: Code Composer Studio

Hello,

I am currently trying to build a GUI for a battery charger device using GUI Composer Designer. For this device, I need a feature that allows me to auto write to a particular bit of a register every X seconds. How can I implement this feature, or if it's already available in the designer, how can I add it to my GUI.

Regards,

Hari

  • Hari,

    Thank you for your patience. I have requested a GUI Composer expert to take a look at this and comment.

  • Hi Hari, 

    Setting up a timer is not available directly through drop and drop designer. You will need to drop into javascript to implement this feature. 

    You would need to open main.js file and somewhere after this code:

      // Wait for the template to fire a dom-change event to indicate that it has been 'stamped'
        // before trying to access components in the application.
        templateObj.addEventListener('dom-change', function() {
            if (initComplete) return;
            this.async(function() {
                initComplete = true;

    add a function that configures a timer, here is a link to online documentation how to set this up in javascript. You will want setInterval function specifically: 

    https://www.w3schools.com/js/js_timing.asp

    The actual code that performs the register writing would need to look something like below. You would need to adjust register name and bitfield to match your needs. 

    const binding = gc.databind.registry.getBinding(‘ti_model_register.config_reg.conv_mode’); // This obtains an object representation of register bitfield ; register name.bitfield as it appears on register page
        binding.setValue(1); // this writes decimal 1 to that bitfield. 

    Martin