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.

RTOS/AWR1243BOOST: How to call lua command from MATLAB to mmwave studio

Part Number: AWR1243BOOST

Tool/software: TI-RTOS

Hello

The Radar Studio User Manual has a very brief section on Lua scripting to automate acquisition tasks. 

I see that "an example of sending a single Lua Command" from mmawave studio user guide.

I want to send lua command instead of lua scripts from matlab.

But when I send lua commond , mmawave studio have nothing happened.

please help cheek my code.

It's the image of Matlab

It 's the image of mmwave studio .

  • Hi,


    Can you please let us know the version of mmWave Studio that you are using, and also post a copy of the Log file here?

    Best Regards,

    Anand

  • Thanks so much for response

    I‘m sorry the picture about output log dosen't show.

    This is output log file and matlabe code.

    I don't know why input Lua command and  output window displays Lua command for char

    matlab code.txt
    disp('Sending test message to RSTD');
    Lua_String = 'WriteToLog("ar1.FullReset()\n")';                 %Input reset command
    ErrStatus = RtttNetClientAPI.RtttNetClient.SendCommand(Lua_String);
    if (ErrStatus ~= 30000)
        disp('mmWaveStudio Connection Failed');
    end
    disp('Test message success');
    end

  • log file.txt
    GM: Constructor
    GM: Thu Jun 27 10:47:52 2019
    RSTD.Transmit("/Settings")
    [10:48:12]  
    [10:48:12]  ### Running Startup script: "C:\ti\mmwave_studio_02_00_00_02\mmWaveStudio\Scripts\Startup.lua" ###
    [10:48:12]  RSTD.SetAndTransmit ("/Settings/Scripter/Display DateTime" , "1")
    [10:48:12]  RSTD.SetAndTransmit ("/Settings/Scripter/DateTime Format" , "HH:mm:ss")
    [10:48:12]  Scripter ignored: Attempt to UnBuild() again or before Build.
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 0/Dll" , "C:\\ti\\mmwave_studio_02_00_00_02\\mmWaveStudio\\Clients\\\\LabClient.dll")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 0/Use" , "TRUE")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 1/Use" , "FALSE")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 2/Use" , "FALSE")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 3/Use" , "FALSE")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 4/Use" , "FALSE")
    [10:48:12]  RSTD.SetVar ("/Settings/AL Client/AL Dll" , "C:\\ti\\mmwave_studio_02_00_00_02\\mmWaveStudio\\RunTime\\SAL.dll")
    [10:48:12]  RSTD.SetVar ("/Settings/Clients/Client 0/GuiDll" , "")
    [10:48:12]  RSTD.SetVar ("/Settings/AutoUpdate/Enabled" , "TRUE")
    [10:48:12]  RSTD.SetVar ("/Settings/AutoUpdate/Interval" , "1")
    [10:48:12]  RSTD.SetVar ("/Settings/Monitors/UpdateDisplay" , "TRUE")
    [10:48:12]  RSTD.SetVar ("/Settings/Monitors/OneClickStart" , "TRUE")
    [10:48:12]  RSTD.SetVar ("/Settings/Automation/Automation Mode" , "false")
    [10:48:12]  RSTD.Transmit("/")
    [10:48:12]  RSTD.SaveSettings(): Settings saved to "C:\Users\HYH_PC\AppData\Roaming\RSTD\config.xml"
    [10:48:12]  RSTD.Build()
    [10:48:12]  RSTD.SaveSettings(): Settings saved to "C:\Users\HYH_PC\AppData\Roaming\RSTD\config.xml"
    [10:48:12]  RSTD.Transmit("/")
    [10:48:12]  RSTD.AL_Build()
    [10:48:13]  RSTD.AL_LoadXml()
    [10:48:13]  RSTD.Transmit("/")
    [10:48:13]  RSTD.AL_Init()
    [10:48:13]  RSTD.Clients_Build()
    [10:48:13]  GM: Init
    [10:48:13]  GM: Loaded 'C:\ti\mmwave_studio_02_00_00_02\mmWaveStudio\Clients\\LabClient.dll'
    [10:48:13]  GM: 1 Guest (s) init
    [10:48:13]  GM: 1 Module(s) init
    [10:48:13]  GM: 2 Tab   (s) init
    [10:48:13]  RSTD.Client_LoadXml()
    [10:48:13]  [RadarAPI]: Starting Matlab Engine..
    [10:49:11]  [RadarAPI]: Matlab Engine Started!
    [10:49:15]  [RadarAPI]: ar1.LoadSettings('C:\Users\HYH_PC\AppData\Roaming\RSTD\ar1gui.ini')
    [10:49:15]  TESTING = false
    [10:49:15]  
    [10:49:15]  ***Script completed successfully.***
    [10:49:26]  RstdNet: Port 2777: Listening..
    [10:50:14]  [RadarAPI]: Opening Gpio Control Port()
    [10:50:14]  [RadarAPI]: Status: Passed
    [10:50:15]  [RadarAPI]: Opening Board Control Port()
    [10:50:15]  [RadarAPI]: Status: Passed
    [10:50:16]  [RadarAPI]: ar1.FullReset()
    [10:50:16]  [RadarAPI]: Status: Passed
    [10:50:16]  [RadarAPI]: Closing Board Control Port()
    [10:50:16]  [RadarAPI]: Status: Passed
    [10:50:17]  [RadarAPI]: Closing Gpio Control Port()
    [10:50:17]  [RadarAPI]: Status: Passed
    [10:50:17]  [RadarAPI]: ar1.SOPControl(2)
    [10:50:17]  [RadarAPI]: Status: Passed
    [10:50:37]  RstdNet: Port 2777: Client 127.0.0.1:3329 - Connected
    [10:50:38]  ar1.FullReset()
    [10:51:20]  RSTD.ShowLogFile()
    

  • Hi,

    It looks like your code is working as expected - your code is calling the "WriteToLog()" lua command which is simply printing the string "ar1.FullReset()" in the log file.

    You can change that line to send any LUA command you like.

    Best Regards,

    Anand