TI中文支持网
TI专业的中文技术问题搜集分享网站

MMWAVE-STUDIO: 如何在mmwave studio已经打开的情况下,用cmd代替run键或lua shell来执行lua脚本?

Part Number:MMWAVE-STUDIO

根据mmwave_studio_user_guide所描述,可以在cmd通过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指令来实现启动mmwave studio并自动采集数据,但是该脚本在采集完一次数据后就会自动断开连接并退出studio。

因此我把Automation.lua拆分为两个部分,第一个lua脚本(setup.lua)是初始化studio,第二个lua脚本(start.lua)是开始采集数据,请问当我使用cmd执行了第一个脚本后(指令为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),尝试通过cmd执行第二个脚本,而不是使用studio中的run。如果使用上述相同指令,则会报错说明studio已经被打开,如何在mmwave studio已经打开的情况下,用cmd代替run键来执行第二个lua脚本?

这是setup.lua,我把采集数据、断开连接和关闭功能进行了注释

---------------------------------- 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
timeout= 1000

-- BSS firmware
bss_path= "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\radarss\\xwr16xx_radarss.bin"
-- MSS firmware
mss_path= "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\masterss\\xwr16xx_masterss.bin"

adc_data_path= "C:\\ti\\mmwave_studio_02_01_01_00\\mmWaveStudio\\PostProc\\test_data1.bin"

------------------------- Connect Tab settings ---------------------------------
-- Select Capture device
ret=ar1.SelectCaptureDevice(capture_device)
if(ret~=0)
thenprint("******* Wrong Capture device *******")return
end

-- SOP mode
ret=ar1.SOPControl(SOP_mode)
RSTD.Sleep(timeout)
if(ret~=0)
thenprint("******* SOP FAIL *******")return
end

-- RS232 Connect
ret=ar1.Connect(uart_com_port,baudrate,timeout)
RSTD.Sleep(timeout)
if(ret~=0)
thenprint("******* Connect FAIL *******")return
end

-- Download BSS Firmware
ret=ar1.DownloadBSSFw(bss_path)
RSTD.Sleep(2*timeout)
if(ret~=0)
thenprint("******* BSS Load FAIL *******")return
end

-- Download MSS Firmware
ret=ar1.DownloadMSSFw(mss_path)
RSTD.Sleep(2*timeout)
if(ret~=0)
thenprint("******* MSS Load FAIL *******")return
end

-- SPI Connect
ar1.PowerOn(0, 1000, 0, 0)

-- RF Power UP
ar1.RfEnable()

------------------------- Other Device Configuration ---------------------------

-- ADD Device Configuration here

ar1.ChanNAdcConfig(1, 1, 0, 1, 1, 1, 1, 2, 1, 0)

ar1.LPModConfig(0, 0)

ar1.RfInit()

ar1.SetCalMonFreqLimitConfig(77,81)

RSTD.Sleep(1000)

ar1.DataPathConfig(513, 1216644097, 0)

ar1.LvdsClkConfig(1, 1)

ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0)

--ar1.SetTestSource(4, 3, 0, 0, 0, 0, -327, 0, -327, 327, 327, 327, -2.5, 327, 327, 0, 0, 0, 0, -327, 0, -327, 
--327, 327, 327, -95, 0, 0, 0.5, 0, 1, 0, 1.5, 0, 0, 0, 0, 0, 0, 0)
ar1.ProfileConfig(0, 77, 7, 1, 50, 0, 0, 0, 0, 0, 0, 29.982, 0, 256, 6000, 0, 0, 30)

ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)

ar1.DisableTestSource(0)

ar1.FrameConfig(0, 0, 0, 128, 40, 0, 0, 1)

ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098)

ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30)

ar1.CaptureCardConfig_PacketDelay(25)

--Start Record ADC data
--ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
--RSTD.Sleep(1000)

--Trigger frame
--ar1.StartFrame()
--RSTD.Sleep(5000)

------------------------- Close the Connection ---------------------------------
-- SPI disconnect
--ar1.PowerOff()

-- RS232 disconnect
--ar1.Disconnect()

------------------------- Exit MMwave Studio GUI -----------------------------------
--os.exit()

-- end

这是start.lua,只保留了采集数据的功能,

--Start Record ADC data
ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
RSTD.Sleep(1000)

--Trigger frame
ar1.StartFrame()
RSTD.Sleep(5000)

Nancy Wang:

稍后我们会帮您升级到英文论坛,会有相关专家给您支持。

,

Cherry Zhou:

您好,

所以您的 lua 脚本打开了2个不同的 mmWave Studio 实例吗? 不可能同时运行两个实例。 

,

Cherry Zhou:

此外,您给出的以下信息是为什么;

————————- Close the Connection ———————————– SPI disconnect–ar1.PowerOff()

— RS232 disconnect–ar1.Disconnect()

————————- Exit MMwave Studio GUI ————————————-os.exit()

— end

赞(0)
未经允许不得转载:TI中文支持网 » MMWAVE-STUDIO: 如何在mmwave studio已经打开的情况下,用cmd代替run键或lua shell来执行lua脚本?
分享到: 更多 (0)