TI E2E support forums
TI E2E support forums
  • User
  • Site
  • Search
  • User
  • E2E™ design support >
  • Forums
    • Amplifiers
    • API solutions
    • Audio
    • Clock & timing
    • Data converters
    • DLP® products
    • Interface
    • Isolation
    • Logic
    • Microcontrollers
    • Motor drivers
    • Power management
    • Processors
    • RF & microwave
    • Sensors
    • Site support
    • Switches & multiplexers
    • Tools
    • Wireless connectivity
    • Archived forums
    • Archived groups
  • Technical articles
  • TI training
    • Tech days
    • Online training
    • Live events
    • Power Supply Design Seminar
  • Getting started
  • 简体中文
  • More
  • Cancel
Code Composer Studio™︎

Code Composer Studio™︎

Code Composer Studio forum

  • Mentions
  • Tags
  • More
  • Cancel
  • Ask a related question
    What is a related question?
    A related question is a question created from another question. When the related question is created, it will be automatically linked to the original question.
  • Ask a new question
  • Ask a new question
  • Cancel
  • State Resolved
  • Locked Locked
  • Replies 10 replies
  • Subscribers 53 subscribers
  • Views 1222 views
  • Users 0 members are here
  • ccs_c2
  • CCS v5
  • GUIComposer
Support feedback
Options
  • Tags
  • More
  • Cancel
Options
  • Share
  • More
  • Cancel
Related

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.

GUI Composer and capture enough data points to plot a 60 Hz sine wave

ahmed diab
ahmed diab
Expert 1035 points

dear;

please i need to ask about GUI Composer and how to capture enough data points to plot a 60 Hz sine wave?

thanks

ahmed

over 11 years ago
  • Cancel
  • Igor Gorbachev
    0 Igor Gorbachev over 11 years ago
    Guru 20525 points

    Hi!

    You can refer to that link http://processors.wiki.ti.com/index.php/Category:GUI_Composer

    Regards,

    Igor

    • Cancel
    • Up 0 True Down
    • Cancel
  • ahmed diab
    0 ahmed diab over 11 years ago in reply to Igor Gorbachev
    Expert 1035 points

    Dear, thanks

    but my question for:

    capture enough data points to plot a 60 Hz sine wave???

    it is not clear in wiki and and i did as wiki but the figure is not appeared as sine wave? but actually with scope it is sine?

    can you give me answer?

     

    • Cancel
    • Up 0 True Down
    • Cancel
  • Patrick Chuong
    0 Patrick Chuong over 11 years ago in reply to ahmed diab
    TI__Genius 16400 points

    Hi Ahmed,

    You can put sine wave data points into an array on the target side and use the graph to plot the array by binding the array to the graph value.

    If this is not what you want, can you send a picture of the graph that you want to plot?

    Regards,
    Patrick 

    • Cancel
    • Up 0 True Down
    • Cancel
  • ahmed diab
    0 ahmed diab over 11 years ago in reply to Patrick Chuong
    Expert 1035 points

    thank you!

    i will explain for you about my problem:

    1- i have the current of the ACI motor. it is a sine wave. it is q value is q24. when i tried to plot in the GUI  it is not appierd as sine wave. in the ccs, and for plot it, by using the datalog[1] feature to store the values in a memory buffer. can you help to do it for gui? how can i put sine wave data points into an array on the target side?

    2- for convert the data to appear in gui as q24 i dieveded the vales in app.js fuunction divideTenthousand and times in function timesTenthousand! value / or * 16777216? it is right?

    3- how can i exite run time for c2000; in wiki 

    "

     C2000 family of devices requires following lines to be added to "appInitScript.js" between load program and run program steps. 

    print("Enabling Realtime\n");
    session.expression.evaluate("ST1.DBGM = 0");
    session.expression.evaluate("GEL_EnableRealtime()");

    "

    how can i modefy app.js?

    • Cancel
    • Up 0 True Down
    • Cancel
  • Patrick Chuong
    0 Patrick Chuong over 11 years ago in reply to ahmed diab
    TI__Genius 16400 points

    ahmed diab said:

    1- i have the current of the ACI motor. it is a sine wave. it is q value is q24. when i tried to plot in the GUI  it is not appierd as sine wave. in the ccs, and for plot it, by using the datalog[1] feature to store the values in a memory buffer. can you help to do it for gui? how can i put sine wave data points into an array on the target side?

    Assuming that you have an array of 5000 elements, each element is a point on the x-axis. The value of the array element represents the y-axis. So, you will need to store your data points (y-axis) into the array. On the host side, GUI Composer, you will need to bind this array to the Series Value in the Binding tab.

    Watch this video to find out how to bind variables in GUI Composer. 
    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_ccstudio/guicomposer/gc_intro/gc_intro.html

    ahmed diab said:

    2- for convert the data to appear in gui as q24 i dieveded the vales in app.js fuunction divideTenthousand and times in function timesTenthousand! value / or * 16777216? it is right?

    See this post for q-value binding.
    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/295399/1030118.aspx#1030118

    ahmed diab said:

    3- how can i exite run time for c2000; in wiki 

    "

     C2000 family of devices requires following lines to be added to "appInitScript.js" between load program and run program steps. 

    print("Enabling Realtime\n");
    session.expression.evaluate("ST1.DBGM = 0");
    session.expression.evaluate("GEL_EnableRealtime()");

    "

    how can i modefy app.js?

    You can download the runtime from this wiki. http://processors.wiki.ti.com/index.php/Category:Gui_Composer

    These lines are for the appInitScript.js, not app.js. After you exported the application for running it with GUIComposer runtime, there will be an appInitScript.js file generated in your GUI app zip file. You should be able to add these lines into the appInitScript.js file. 

    Note that you might need to remove this line session.options.setBoolean("UseLegacyStopMode", true); in the appInitScript.js file if you don't want to halt the target due to target access.

    Regards,
    Patrick 

    • Cancel
    • Up 0 True Down
    • Cancel
  • ahmed diab
    0 ahmed diab over 11 years ago in reply to Patrick Chuong
    Expert 1035 points

    thank you very much for your help.

    1- please find my appInitScript.js

    Fullscreen 8463.appInitScript.txt Download
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    
    function initTarget() {
    	var debugServer = ScriptingEnvironment.instance().getServer("DebugServer.1");
    
    	print("Initializing target : " + appConfigFile+"\n");
    	debugServer.setConfig(appConfigFile /* internal variable */);
    	var session = debugServer.openSession("*", "*" /* TODO: */);
    
    	session.options.setBoolean("UseLegacyStopMode", true);
    	
    	if (!session.target.isConnected()) {
    		print("Connecting target: "+session.getName()+"\n");
    		session.target.connect();
    	}
    	
    	print("Loading program: "+appProgramFile+"\n");
    	session.memory.loadProgram(appProgramFile /* internal variable */);
    	
    	print("Running Program...\n");
    	session.target.runAsynch();
    	
    	print("Enabling Realtime\n");
    	session.expression.evaluate("ST1.DBGM = 0");
    	session.expression.evaluate("GEL_EnableRealtime()");
    }
    
    initTarget();[1206/190138:ERROR:renderer_main.cc(218)] Running without renderer sandbox
    
    ; please till me if errors in it?

    2- for q24 please check the print screen!! this is true to read with the q24. thanks

    thanks

    • Cancel
    • Up 0 True Down
    • Cancel
  • Patrick Chuong
    0 Patrick Chuong over 11 years ago in reply to ahmed diab
    TI__Genius 16400 points

    ahmed diab said:

    1- please find my appInitScript.js

    Fullscreen 8463.appInitScript.txt Download
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    
    function initTarget() {
    	var debugServer = ScriptingEnvironment.instance().getServer("DebugServer.1");
    
    	print("Initializing target : " + appConfigFile+"\n");
    	debugServer.setConfig(appConfigFile /* internal variable */);
    	var session = debugServer.openSession("*", "*" /* TODO: */);
    
    	session.options.setBoolean("UseLegacyStopMode", true);
    	
    	if (!session.target.isConnected()) {
    		print("Connecting target: "+session.getName()+"\n");
    		session.target.connect();
    	}
    	
    	print("Loading program: "+appProgramFile+"\n");
    	session.memory.loadProgram(appProgramFile /* internal variable */);
    	
    	print("Running Program...\n");
    	session.target.runAsynch();
    	
    	print("Enabling Realtime\n");
    	session.expression.evaluate("ST1.DBGM = 0");
    	session.expression.evaluate("GEL_EnableRealtime()");
    }
    
    initTarget();[1206/190138:ERROR:renderer_main.cc(218)] Running without renderer sandbox
    
    ; please till me if errors in it?

    Put the expression evaluations before the runAsynch line.

    ahmed diab said:

    2- for q24 please check the print screen!! this is true to read with the q24. thanks

    I found out that we don't currently support Q-value for array binding at the moment. You will need to use the pre and post functions to do your conversion.

    Regards,
    Patrick 

    • Cancel
    • Up 0 True Down
    • Cancel
  • ahmed diab
    0 ahmed diab over 11 years ago in reply to Patrick Chuong
    Expert 1035 points

    dear; sorry but it is very important for me!

    1- please see the app.jas and the printscreen and this to convert from and to q24?

    Fullscreen 4130.app.txt Download
    /*
     * This file is provided for custom JavaScript logic that your HTML files might need.
     * GUI Composer includes this JavaScript file by default within HTML pages authored in GUI Composer.
     */
    require(["dojo/ready"], function(ready){
         ready(function(){
             // logic that requires that Dojo is fully initialized should go here
    
         });
    });
    
    function divideTenthousand( valueFromTarget) {
    	 // return valueFromTarget/2;
    	return valueFromTarget/16777216;
    }
    
    function timesTenthousand( valueToTarget) {
    	 // return valueToTarget*2;
    	return valueFromTarget*16777216;
    }
    
     

    2- can you review the appInitScript

    Fullscreen 5164.appInitScript.txt Download
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    
    function initTarget() {
    	var debugServer = ScriptingEnvironment.instance().getServer("DebugServer.1");
    
    	print("Initializing target : " + appConfigFile+"\n");
    	debugServer.setConfig(appConfigFile /* internal variable */);
    	var session = debugServer.openSession("*", "*" /* TODO: */);
    
    	session.options.setBoolean("UseLegacyStopMode", true);
    	
    	if (!session.target.isConnected()) {
    		print("Connecting target: "+session.getName()+"\n");
    		session.target.connect();
    	}
    	
    	print("Loading program: "+appProgramFile+"\n");
    	session.memory.loadProgram(appProgramFile /* internal variable */);
    	
    	print("Running Program...\n");
                       print("Enabling Realtime\n");
    	session.expression.evaluate("ST1.DBGM = 0");
    	session.expression.evaluate("GEL_EnableRealtime()");
    	session.target.runAsynch();
    	
    	
    }
    
    initTarget();[1206/190138:ERROR:renderer_main.cc(218)] Running without renderer sandbox
    
    and tell me about its errors? and about the function of session.options.setBoolean("UseLegacyStopMode", true); i did not understand whe i must delete it?

    thanks and soory

    • Cancel
    • Up 0 True Down
    • Cancel
  • Patrick Chuong
    0 Patrick Chuong over 11 years ago in reply to ahmed diab
    TI__Genius 16400 points

    ahmed diab said:

    1- please see the app.jas and the printscreen and this to convert from and to q24?

    You need to multiple and divide each element in the pre and post functions.

    See this post,
    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/301032/1049516.aspx#1049516

    ahmed diab said:

    2- can you review the appInitScript

    Fullscreen 5164.appInitScript.txt Download
    importPackage(Packages.com.ti.ccstudio.scripting.environment)
    
    function initTarget() {
    	var debugServer = ScriptingEnvironment.instance().getServer("DebugServer.1");
    
    	print("Initializing target : " + appConfigFile+"\n");
    	debugServer.setConfig(appConfigFile /* internal variable */);
    	var session = debugServer.openSession("*", "*" /* TODO: */);
    
    	session.options.setBoolean("UseLegacyStopMode", true);
    	
    	if (!session.target.isConnected()) {
    		print("Connecting target: "+session.getName()+"\n");
    		session.target.connect();
    	}
    	
    	print("Loading program: "+appProgramFile+"\n");
    	session.memory.loadProgram(appProgramFile /* internal variable */);
    	
    	print("Running Program...\n");
                       print("Enabling Realtime\n");
    	session.expression.evaluate("ST1.DBGM = 0");
    	session.expression.evaluate("GEL_EnableRealtime()");
    	session.target.runAsynch();
    	
    	
    }
    
    initTarget();[1206/190138:ERROR:renderer_main.cc(218)] Running without renderer sandbox
    
    and tell me about its errors? and about the function of session.options.setBoolean("UseLegacyStopMode", true); i did not understand whe i must delete it?

    Where do you see this error? You can safely ignore it if it is from the command prompt.

    The UseLegacyStopMode is used to halt the target before any target access, otherwise target access is not possible while it is running. It is intrusive and can cause problem if you have time critical algorithm on your target. Since you already enabled realtime mode, you don't need to halt the target before target access.

    Patrick

    • Cancel
    • Up 0 True Down
    • Cancel
  • ahmed diab
    0 ahmed diab over 11 years ago in reply to Patrick Chuong
    Expert 1035 points

    Thank you so much for all you've done to help me, You're so helpful!!!!

    • Cancel
    • Up 0 True Down
    • Cancel