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.

MMWAVE-STUDIO: How to execute lua script with cmd instead of the run key or lua shell when mmWave studio is already open?

Part Number: MMWAVE-STUDIO

Hi team,

Here's an issue from the customer may need your help:

Based on mmWave_studio_user_guide, C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\RunTime\mmWaveStudio.exe  /lua C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\Scripts\Automation.lua this instruction enables launching mmWave studio and collecting data automatically in cmd. However, the script automatically disconnects and exits studio once the data has been captured.

So the customer has split Automation.lua into two parts, the first lua script (setup.lua) is to initialize studio and the second lua script (start.lua) is to start collecting data.(the instruction is C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\RunTime>mmWaveStudio.exe  /lua C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\Scripts\setup.lua)

When the first script is executed with cmd, try executing the second script through cmd instead of using run in studio. If use the same instructions above, it will get an error stating that studio has been opened.

How to execute a second lua script with cmd instead of run with mmWave studio already open?

The following is setup.lua, and the customer notes the capture data, disconnect and close functions: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---------------------------------- STARTUP -------------------------------------
------------------------ DO NOT MODIFY THIS SECTION ----------------------------
-- mmwavestudio installation path
RSTD_PATH = RSTD.GetRstdPath()
-- Declare the loading function
dofile(RSTD_PATH .. "\\Scripts\\Startup.lua")
------------------------------ CONFIGURATIONS ----------------------------------
-- Use "DCA1000" for working with DCA1000
capture_device = "DCA1000"
-- SOP mode
SOP_mode = 2
-- RS232 connection baud rate
baudrate = 115200
-- RS232 COM Port number
uart_com_port = 19
-- Timeout in ms
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The following is start.lua, which retains the ability to acquire data only:

Fullscreen
1
2
3
4
5
6
7
--Start Record ADC data
ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
RSTD.Sleep(1000)
--Trigger frame
ar1.StartFrame()
RSTD.Sleep(5000)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Could you help check this case? Thanks.

Best Regards,

Cherry