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.

DCA1000EVM: awr2243

Part Number: DCA1000EVM

Hello,

I am trying to send record command to mmWave studio over Matlab. Since I am running my matlab script several times in a loop, I want to pass data path and file name for adc_data. 

I tried the solution suggested in this thread

However, mmWavestudio throw the following error: 

[09:22:29]  &&&&&&&&&&&&&&&&&&&&
[09:22:29]  ***Script FAILED!***
[09:22:29]  &&&&&&&&&&&&&&&&&&&&
[09:22:29]  Script: "xw_status=mws.captureCardStartRecord("C:\ti\mmwave_studio_03_00_00_14\mmWaveStudio\PostProc\adc_data_2.bin", 1, 1, 4096)"
[09:22:29]  Exception message is:
[09:22:29]  [string "chunk"]:1: attempt to index global 'mws' (a nil value)

and my matlab script for that part is as follow

    Lua_String = sprintf('xw_status=mws.captureCardStartRecord("%s", 1, 1, 4096)',filename);
    ErrStatus =RtttNetClientAPI.RtttNetClient.SendCommand(Lua_String);
    pause(1);

I could not figure it out. I hope you can help me

Regards

  • Hi,

    I can see that the filename separates the directories with single back-slash(\), which is not correctly interpreting. 

    Please use double back-slash instead.

    Thanks,
    Anirban

  • Hello,

    I tried to give full path string as below for the sake of trying the command. But it still shows the same error. 

        str = "C:\\ti\\mmwave_studio_03_00_00_14\\mmWaveStudio\\PostProc\\dataRaw.bin";
        Lua_String = sprintf('xw_status=mws.captureCardStartRecord("%s", 1, 1, 4096)',str);
        ErrStatus =RtttNetClientAPI.RtttNetClient.SendCommand(Lua_String);
        pause(1);

    and log:

    [14:35:42]  &&&&&&&&&&&&&&&&&&&&
    [14:35:42]  ***Script FAILED!***
    [14:35:42]  &&&&&&&&&&&&&&&&&&&&
    [14:35:43]  Script: "xw_status=mws.captureCardStartRecord("C:\\ti\\mmwave_studio_03_00_00_14\\mmWaveStudio\\PostProc\\dataRaw.bin", 1, 1, 4096)"
    [14:35:43]  Exception message is:
    [14:35:43]  [string "chunk"]:1: attempt to index global 'mws' (a nil value)

    As you can see, although, I am using double back-slash in the file string, still facing the same error. This is of course also happens when I create a file path using fullfile function in matlab as follow:

        filename = fullfile("C:\\ti\\mmwave_studio_03_00_00_14\\mmWaveStudio\\PostProc", ['adc_data_' num2str(i) '.bin']);

  • Hi,

    What is 'mws' here, are you referring to any particular library or dll? I'm not aware of any 'mws' regarding matlab and mmWave Studio.

    For mmWave Studio, you should use ar1.CaptureCardConfig_StartRecord command with the suitable parameters [i.e.  (1) String ADCFileName   (2) Byte PacketSequenceNumberEnable] to start recording.

    Thanks,
    Anirban

  • Hi,

    Initially, I used ar1.CaptureCardConfig_StartRecord(name,1) which works fine. But since I am running this command in a loop to repeat measurements and save the collected data name, I look to other threads to see if there is any suggested solution where I can change the file name inside the command.

     As  it can seen in line below, since the command is already instead quotes and filename also. Matlab does not allow me to do it and gives error. I tried escape characters as well but this time, since mmWave Studio does not understand these escape character, it naturally throws illegal character error. 

    RtttNetClientAPI.RtttNetClient.SendCommand('ar1.CaptureCardConfig_StartRecord("C:\\ti\\mmwave_studio_03_00_00_14\\mmWaveStudio\\PostProc\\adc_data_Test.bin", 1)');

    When I went through other threads, in the following thread : e2e.ti.com/mmwave-studio-setting-adc_data_path-thru-matlab-for-lua, I saw 'mws', which I also tried but did not work.

    So, long story short, I showed what I want to do is:

    Instead of this:

    RtttNetClientAPI.RtttNetClient.SendCommand('ar1.CaptureCardConfig_StartRecord("C:\\ti\\mmwave_studio_03_00_00_14\\mmWaveStudio\\PostProc\\adc_data_Test.bin", 1)');
    do following:

    RtttNetClientAPI.RtttNetClient.SendCommand('ar1.CaptureCardConfig_StartRecord("%s", 1)',filename);

    when I tried it, MATLAB throws following error

    No method 'RtttNetClientAPI.RtttNetClient.SendCommand' with matching signature found.
    
    Error in lua_Commands_V1 (line 93)
        RtttNetClientAPI.RtttNetClient.SendCommand('ar1.CaptureCardConfig_StartRecord("%s", 1)',filename);

    Regards

  • Hi,

    SendCommand method doesn't take any 2nd parameter. That's where it is going wrong.

    The correct manner should be - 

    Lua_String = sprintf('ar1.CaptureCardConfig_StartRecord("C:\\ti\\mmwave_studio_02_01_01_00\\mmWaveStudio\\PostProc\\adc_data.bin", 1)');

    Then,

    ErrStatus = RtttNetClientAPI.RtttNetClient.SendCommand(Lua_String);

    .

    You can refer to this thread - https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1316366/mmwave-studio-dca1000-captured-data-path-problem-when-using-matlab

    Thanks,
    Anirban

  • Hello,

    Thank you for clarification.

    Regards