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.

DSS Scripting - saveData() questions

In CCS6 I'm using the saveData() script.

The filename where the data is stored always defaults to the eclipse directory - even if I enter a complete path with 

the drive letter.  Why is that?

Additionally could you explain the header saved in the first line - I see the address but what is the rest?

Any plans on making a formatted output version?  As it is you always need to do some Excel or other code to do something

with the data.  Storing several variables per line would be nice (maybe even CSV) would help when you are using a data structure.

Any better PDFs available on scripting or DDS?

Thanks

  • Hi John,

    John MacGregor said:

    The filename where the data is stored always defaults to the eclipse directory - even if I enter a complete path with 

    the drive letter.  Why is that?

    It does default to the eclipse directory inside CCS. But this is only if you specify a relative path. If you specify an absolute path with drive letter, that should work and place the file in the specified absolute path. How are you calling the API?

    John MacGregor said:
    Additionally could you explain the header saved in the first line - I see the address but what is the rest?

    This is described in the Help that comes with CCS ('Help -> Help Contents'):

    John MacGregor said:

    Any plans on making a formatted output version?  As it is you always need to do some Excel or other code to do something

    with the data.  Storing several variables per line would be nice (maybe even CSV) would help when you are using a data structure.

    There are no plans but I like the suggestion for CSV (which I like). We will look into this

    John MacGregor said:
    Any better PDFs available on scripting or DDS?

    There is no comprehensive PDF on DSS. The best resource I can provide is the DSS handbook. Form there, you can find links to other available resources on DSS:

    http://dev.ti.com/tirex/#/?link=Development%20Tools%2FIntegrated%20Development%20Environments%2FCode%20Composer%20Studio%2FDebug%2FDocuments%2FUser%27s%20Guides%2FScripting%20Handbook

    Thanks

    ki

  • Thanks for the information on the savedata() header. The relative file path (lots of ..\\..) works fine but I couldn't get an absolute path to work, Originally I though that the scripting console only would work if the DSP was at a breakpoint but savedata() works even if the DSP is not at a breakpoint.
    I'm prolly being lazy but I'd like to change the data file name every time I run my function - so every time I call my function I can increment the filename string. This way I can save multiple data sets without having to manually use Explorer and change the filename. This would require a static variable that would get incremented and some string manipulation of the file name string. However I'm to a java guy but I'm assuming this would should not be too hard to do. Any ideas?
  • John MacGregor said:
    The relative file path (lots of ..\\..) works fine but I couldn't get an absolute path to work

    the absolute path should work. I am surprised that it is not. How are you calling the API?

    John MacGregor said:
    Originally I though that the scripting console only would work if the DSP was at a breakpoint but savedata() works even if the DSP is not at a breakpoint.

    Typically, this is the case. But if you are using a device that supports real-time memory accesses (like C2000 or Cortex-M), then it is possible to access memory while the target is running. I believe there is also a debugger option that you can set to have the debugger auto-halt the target under the hood when a device access is made. After the access, the debugger would resume execution so from the user standpoint, the target appeared to have never halted

    John MacGregor said:
    I'd like to change the data file name every time I run my function - so every time I call my function I can increment the filename string. This way I can save multiple data sets without having to manually use Explorer and change the filename. This would require a static variable that would get incremented and some string manipulation of the file name string. However I'm to a java guy but I'm assuming this would should not be too hard to do. Any ideas?

    Yes this can be done fairly easily. I was thinking of something like the below very simple js file example:

    ...

    var numSaveData = 0;

    saveDataToFile();
    saveDataToFile();
    saveDataToFile();

    function saveDataToFile()
    {
        activeDS.memory.saveData(0, 0x0, "C:/Temp/saved_data" + numSaveData + ".dat", 10, 1, false);
        numSaveData++;
    }

    ...