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.

How to create an Array in the xdc/cfg file (ccs4/bios6x)



Hi folks,

I make my first experiences with the CCS4 and Bios6x. I studied the manuals and found out that the language for the xdc/cfg-file is like JavaScript.

Now I want to create 4 egal threads and I want to store the handles in one array. My idea is to use the following lines:

for( var i = 0; i < 4; i++ ) {

  TaskParams.arg0 = i;

 

  Program.global.TaskHandle[ i ] = Task.create( '&MyTask', TaskParams );

}

Does anyone have an idea how this could be realised? I tried different things but I got always an error during the generation.

Thanks alot, Jürgen

  • Hello TI,

    I am looking for an answer for my previous posting.

    Is there anybody how is able to handle questions regarding xdc/cfg-files? Or does anybody know the differences between xdc/cfg-files and JavaScript?

    Regards, Juergen

     

  • Hi Juergen,

    Juergen said:
    Is there anybody how is able to handle questions regarding xdc/cfg-files? Or does anybody know the differences between xdc/cfg-files and JavaScript?

    I would recommend asking in both the BIOS and RTSC forums. There is a lot more expertise on XDC and JavaScript in there:

    BIOS: http://e2e.ti.com/support/embedded/f/355.aspx

    RTSC: http://www.eclipse.org/forums/index.php?t=thread&frm_id=8

    Thanks

    ki

  • Hi Juergen,

    Sorry we missed your earlier post. The best place to get your questions on RTSC and SYS/BIOS answered is the BIOS forum - http://e2e.ti.com/support/embedded/f/355.aspx

    Answers to your previous queries are given below.

    Juergen said:

    Now I want to create 4 egal threads and I want to store the handles in one array. My idea is to use the following lines:

    for( var i = 0; i < 4; i++ ) {

      TaskParams.arg0 = i;

       Program.global.TaskHandle[ i ] = Task.create( '&MyTask', TaskParams );

    }

    You can do the following to statically create tasks in your config script:

    for (var i = 0;i < 4;i++) {

    Program.global["task"+i] = Task.create('&MyTask', tskParams);

    }

    This will create global symbols "task0", "task1","task2","task3" - which are the task handles that you can access in your application 'C' code. 

     

    Juergen said:

    Is there anybody how is able to handle questions regarding xdc/cfg-files? Or does anybody know the differences between xdc/cfg-files and JavaScript?

    The config script  (*.cfg) is essentially Javascript with some built in global objects that are used by our tools. Take a look at the following for more details:

    http://rtsc.eclipse.org/docs-tip/Glossary#Configuration_Script

    http://rtsc.eclipse.org/docs-tip/Glossary#XDCscript

     

    Regards

    Amit

  • Hi Ki, hi Amit,

    thank you very much for the answers. The logic behind the forums is not easy to recognise and the topics are often not really helpful to identify the origin-direction of the thread. E.g. I wrote my original post in an other thread and the admin shifted it to this forum.

    Your tip, Amit, was very helpful. It fullfills my needs. I can convert the global symbols to an array in my 'C' code.

     

    Best regards,

    Juergen