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:如何在 mmWave Studio 已打开时、使用 cmd 而不是 run 键或 lua shell 执行 lua 脚本?

Guru**** 2526700 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1217381/mmwave-studio-how-to-execute-lua-script-with-cmd-instead-of-the-run-key-or-lua-shell-when-mmwave-studio-is-already-open

器件型号:MMWAVE-STUDIO

大家好、

以下是客户可能需要您的帮助的问题:

根据 mmWave_studio _user_guide、C:\ti\mmwave_studio _02_01_01_00\mmWaveStudio\Runtimes\mmWaveStudio.exe /lua C:\ti\mmwave_studio _02_01_00\mmWaveStudio\Scripts\Automation.lua  此指令用于启动 mmWave Studio 并在 cmd 中自动收集数据。 但是、脚本会在捕获到数据后自动断开并退出 Studio。

因此、客户将 Automation.lua 分为两个部分、第一个 lua 脚本(setup.lua)用于初始化 studio、第二个 lua 脚本(start.lua  )用于开始收集数据。(指令为 C:\ti\mmwave_studio _02_01_01_00\mmWaveStudio\Runtime> mmWaveStudio.exe /lua C:\ti\mmwave_02_studio _setup_01_01\lua)

当第一个脚本使用 cmd 执行时、请尝试通过 cmd 执行第二个脚本、而不是在 studio 中使用 run。 如果使用上述相同的指令、系统将显示错误、指明工作室已打开。

如何使用 cmd 执行第二个 lua 脚本、而不是在 mmWave Studio 已打开的情况下运行?

下面是 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)
then
    print("******* Wrong Capture device *******")
    return
end

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

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

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

-- Download MSS Firmware
ret=ar1.DownloadMSSFw(mss_path)
RSTD.Sleep(2*timeout)
if(ret~=0)
then
    print("******* 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)

您能帮助检查这个问题吗? 谢谢。

此致、

樱桃

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Cherry:

    让我检查以下客户尝试是否可行。

    此致、
    Saswat Kumar

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的  Saswat Kumar:

    谢谢、期待您的更新。

    此致!

    樱桃

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Cherry:

    因此、客户 lua 脚本正在打开 MM wave studio 的2个不同实例。 我认为无法同时运行这两个实例。

    此致、
    Saswat Kumar

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Cherry:

    此外、为什么用户提供:

    ---------------- 关闭连接-------------------------------------------------------
    --SPI 断开连接
    -- ar1.poweroff ()

    -- RS232断开连接
    -AR1.Disconnect()

    ---------------- 退出 mmWave Studio GUI -------------------------------------------------------
    -- os.exit()

    结束了
    此致、
    Saswat Kumar