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.

IWR1642BOOST: 使用LUA控制IWR6843+DCA1000采集数据的时候遇到问题

Part Number: IWR1642BOOST
Other Parts Discussed in Thread: IWR6843

目前正常使用mmWave Studio配置采集保存原始数据。但在使用LUA脚本的时候碰到一个问题 

在之前的配置中都显示成功配置了。完整日志与lua脚本如下:

GM: Constructor
GM: Thu Jan 20 15:54:04 2022
RSTD.Transmit("/Settings")
[15:54:04]
[15:54:04] ### Running Startup script: "D:\TI\mmwave_studio_02_01_01_00\mmWaveStudio\Scripts\Startup.lua" ###
[15:54:05] RSTD.SetAndTransmit ("/Settings/Scripter/Display DateTime" , "1")
[15:54:05] RSTD.SetAndTransmit ("/Settings/Scripter/DateTime Format" , "HH:mm:ss")
[15:54:05] Scripter ignored: Attempt to UnBuild() again or before Build.
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 0/Dll" , "D:\\TI\\mmwave_studio_02_01_01_00\\mmWaveStudio\\Clients\\\\LabClient.dll")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 0/Use" , "TRUE")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 1/Use" , "FALSE")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 2/Use" , "FALSE")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 3/Use" , "FALSE")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 4/Use" , "FALSE")
[15:54:05] RSTD.SetVar ("/Settings/AL Client/AL Dll" , "D:\\TI\\mmwave_studio_02_01_01_00\\mmWaveStudio\\RunTime\\SAL.dll")
[15:54:05] RSTD.SetVar ("/Settings/Clients/Client 0/GuiDll" , "")
[15:54:05] RSTD.SetVar ("/Settings/AutoUpdate/Enabled" , "TRUE")
[15:54:05] RSTD.SetVar ("/Settings/AutoUpdate/Interval" , "1")
[15:54:05] RSTD.SetVar ("/Settings/Monitors/UpdateDisplay" , "TRUE")
[15:54:05] RSTD.SetVar ("/Settings/Monitors/OneClickStart" , "TRUE")
[15:54:05] RSTD.SetVar ("/Settings/Automation/Automation Mode" , "false")
[15:54:05] RSTD.Transmit("/")
[15:54:05] RSTD.SaveSettings(): Settings saved to "C:\Users\Administrator\AppData\Roaming\RSTD\config.xml"
[15:54:05] RSTD.Build()
[15:54:05] RSTD.SaveSettings(): Settings saved to "C:\Users\Administrator\AppData\Roaming\RSTD\config.xml"
[15:54:05] RSTD.Transmit("/")
[15:54:05] RSTD.AL_Build()
[15:54:05] RSTD.AL_LoadXml()
[15:54:05] RSTD.Transmit("/")
[15:54:05] RSTD.AL_Init()
[15:54:05] RSTD.Clients_Build()
[15:54:05] GM: Init
[15:54:05] GM: Loaded 'D:\TI\mmwave_studio_02_01_01_00\mmWaveStudio\Clients\\LabClient.dll'
[15:54:05] GM: 1 Guest (s) init
[15:54:05] GM: 1 Module(s) init
[15:54:05] GM: 2 Tab (s) init
[15:54:05] RSTD.Client_LoadXml()
[15:54:05] [RadarAPI]: ar1.selectRadarMode(0)
[15:54:05] [RadarAPI]: Status: Passed
[15:54:05] Matlab Runtime Engine is installed
[15:54:05] [RadarAPI]: Starting Matlab Engine..
[15:54:09] [RadarAPI]: Matlab Engine Started!
[15:54:11] [RadarAPI]: ar1.selectCascadeMode(0)
[15:54:11] [RadarAPI]: Status: Passed
[15:54:11] [RadarAPI]: ar1.LoadSettings('C:\Users\Administrator\AppData\Roaming\RSTD\ar1gui.ini')
[15:54:11] TESTING = false
[15:54:11] RstdNet: Port 2777: Listening..
[15:54:11]
[15:54:11] ***Script completed successfully.***
[15:56:20] D:\TI\mmwave_studio_02_01_01_00\mmWaveStudio\Scripts\
[15:56:20] [RadarAPI]: Opening Board Control Port()
[15:56:20] [RadarAPI]: Status: Passed
[15:56:21] [RadarAPI]: ar1.FullReset()
[15:56:21] [RadarAPI]: Status: Failed To give full reset, Error Value: -7
[15:56:22] [RadarAPI]: Closing Board Control Port()
[15:56:22] [RadarAPI]: Status: Passed
[15:56:24] [RadarAPI]: Opening Gpio Control Port()
[15:56:24] [RadarAPI]: Status: Passed
[15:56:25] [RadarAPI]: Opening Board Control Port()
[15:56:25] [RadarAPI]: Status: Passed
[15:56:26] [RadarAPI]: ar1.FullReset()
[15:56:26] [RadarAPI]: Status: Passed
[15:56:27] [RadarAPI]: Closing Board Control Port()
[15:56:27] [RadarAPI]: Status: Passed
[15:56:27] [RadarAPI]: Closing Gpio Control Port()
[15:56:27] [RadarAPI]: Status: Passed
[15:56:27] [RadarAPI]: ar1.SOPControl(2)
[15:56:27] [RadarAPI]: Status: Passed
[15:56:28] [RadarAPI]: ar1.Connect(6,921600,1000)
[15:56:31] [RadarAPI]: Warning: Connected with baudrate 115200
[15:56:32] [RadarAPI]: Warning: Disconnected existing BaudRate
[15:56:33] [RadarAPI]: Warning: Trying to connect with baudrate 921600
[15:56:34] [RadarAPI]: ar1.Calling_IsConnected()
[15:56:35] [RadarAPI]: ar1.SelectChipVersion("IWR6843")
[15:56:35] [RadarAPI]: Status: Passed
[15:56:35] [RadarAPI]: ar1.frequencyBandSelection("60G")
[15:56:35] [RadarAPI]: ar1.SelectChipVersion("IWR6843")
[15:56:35] [RadarAPI]: Status: Passed
[15:56:35] Device Status : IWR6843/QM/SOP:2/ES:2
[15:56:38] [RadarAPI]: ar1.frequencyBandSelection("60G")
[15:56:38] [RadarAPI]: ar1.ReadRegister(0xffffe214, 0, 31)
[15:56:38] [RadarAPI]: ar1.ReadRegister(0xffffe210, 0, 31)
[15:56:38] Inavlid Device part number in ES2 and ES3 devices
[15:56:38] 6843[RadarAPI]: ar1.ReadRegister(0xffffe218, 0, 31)
[15:56:38] [RadarAPI]: ar1.DownloadBSSFw("D:\\TI\\mmwave_studio_02_01_01_00\\mmWaveStudio\\Scripts\\..\\..\\rf_eval_firmware\\radarss\\xwr68xx_radarss.bin")
[15:56:39] [RadarAPI]: Downloading BSS ROM RPRC Binary..
[15:56:46] [RadarAPI]: ar1.GetBSSFwVersion()
[15:56:46] [RadarAPI]: BSSFwVersion:(06.02.01.05 (09/03/20))
[15:56:46] BSS FW Download Success
[15:56:48] [RadarAPI]: ar1.DownloadMSSFw("D:\\TI\\mmwave_studio_02_01_01_00\\mmWaveStudio\\Scripts\\..\\..\\rf_eval_firmware\\masterss\\xwr68xx_masterss.bin")
[15:56:48] [RadarAPI]: Downloading MSS RPRC Binary..
[15:56:52] [RadarAPI]: ar1.GetMSSFwVersion()
[15:56:52] [RadarAPI]: MSSFwVersion:(02.00.00.03 (27/08/19))
[15:56:52] MSS FW Download Success
[15:56:54] [RadarAPI]: ar1.PowerOn(0, 1000, 0, 0)
[15:56:54] [RadarAPI]: Status: Passed
[15:56:54] MSS power up done async event received!
[15:56:54] Power On Success
[15:56:56] [RadarAPI]: ar1.SelectChipVersion("IWR6843")
[15:56:56] [RadarAPI]: Status: Passed
[15:56:56] [RadarAPI]: ar1.SelectChipVersion("IWR6843")
[15:56:56] [RadarAPI]: Status: Passed
[15:56:56] Device Status : IWR6843/QM/SOP:2/ES:2
[15:56:56] [RadarAPI]: ar1.RfEnable()
[15:56:57] BSS power up done async event received!
[15:56:57] [RadarAPI]: Status: Passed
[15:56:57] [RadarAPI]: ar1.GetMSSFwVersion()
[15:56:57] [RadarAPI]: MSSFwVersion:(02.00.00.03 (27/08/19))
[15:56:58] [RadarAPI]: ar1.GetBSSFwVersion()
[15:56:58] [RadarAPI]: BSSFwVersion:(06.02.01.05 (09/03/20))
[15:56:58] RF Enable Success
[15:56:59] [RadarAPI]: ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 1, 0)
[15:56:59] [RadarAPI]: Status: Passed
[15:56:59] ChanNAdcConfig Success
[15:57:00] [RadarAPI]: ar1.LPModConfig(0, 0)
[15:57:00] [RadarAPI]: Status: Passed
[15:57:00] Regualar mode Cfg Success
[15:57:00] [RadarAPI]: ar1.RfLdoBypassConfig(0x3)
[15:57:00] [RadarAPI]: Status: Passed
[15:57:00] RfLdoBypass Cfg Success
[15:57:02] [RadarAPI]: ar1.RfInit()
[15:57:03] RF Init async event received!
[15:57:03] [RadarAPI]: Time stamp, Temperture: 5967,27; APLL Status, Update: 1, 0; SynthVCO1 Status, Update: 1, 1; SynthVCO2 Status, Update: 1, 1; LODist Status, Update: 1, 1; RxADCDC Status, Update: 1, 1; HPFcutoff Status, Update: 1, 1; LPFcutoff Status, Update: 1, 1; PeakDetector Status, Update: 1, 1; TxPower Status, Update: 1, 1; RxGain Status, Update: 1, 1; TxPhase Status, Update: 1, 1; RxIQMM Status, Update: 1, 1;
[15:57:03] [RadarAPI]: Status: Passed
[15:57:03] RfInit Success
[15:57:04] [RadarAPI]: ar1.DataPathConfig(1, 1, 0)
[15:57:04] [RadarAPI]: Status: Passed
[15:57:04] DataPathConfig Success
[15:57:05] [RadarAPI]: ar1.LvdsClkConfig(1, 1)
[15:57:05] [RadarAPI]: Status: Passed
[15:57:05] LvdsClkConfig Success
[15:57:06] [RadarAPI]: ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0)
[15:57:06] [RadarAPI]: Status: Passed
[15:57:06] LVDSLaneConfig Success
[15:57:07] [RadarAPI]: ar1.ProfileConfig(0, 60, 100, 6, 60, 0, 0, 0, 0, 0, 0, 29.982, 0, 256, 10000, 0, 0, 30)
[15:57:07] [RadarAPI]: Status: Passed
[15:57:08] ProfileConfig No.0Success
[15:57:08] [RadarAPI]: ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)
[15:57:08] [RadarAPI]: Status: Passed
[15:57:08] ChirpConfig No.0 Success
[15:57:08] [RadarAPI]: ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 0, 1)
[15:57:08] [RadarAPI]: Status: Passed
[15:57:08] ChirpConfig No.1 Success
[15:57:08] [RadarAPI]: ar1.ChirpConfig(2, 2, 0, 0, 0, 0, 0, 0, 1, 0)
[15:57:08] [RadarAPI]: Status: Passed
[15:57:08] ChirpConfig No.2 Success
[15:57:09]
[15:57:09] &&&&&&&&&&&&&&&&&&&&
[15:57:09] ***Script FAILED!***
[15:57:09] &&&&&&&&&&&&&&&&&&&&
[15:57:09] Exception message is:
[15:57:09] invalid arguments to method call

  • 这是LUA脚本代码,参考github上一个1843的开源demo

    NUM_TX = 3
    NUM_RX = 4
    
    
    START_FREQ = 60 
    ADC_START_TIME = 6 
    FREQ_SLOPE = 29.982
    ADC_SAMPLES = 256
    SAMPLE_RATE = 10000
    RX_GAIN = 30 
    
    IDLE_TIME = 100
    RAMP_END_TIME = 60
    CHIRP_LOOPS = 128
    PERIODICITY = 50 
    
    autoStart = 1
    NumOfProfile = 1
    NumOfChirpInLoop = 3
    NumOfFrame = 0
    profile={}
    profile[0]={0, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, 0, 0, 0, 0, 0, 0, FREQ_SLOPE, 0, ADC_SAMPLES, SAMPLE_RATE, 0, 0, RX_GAIN}
    profile[1]={0, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, 0, 0, 0, 0, 0, 0, FREQ_SLOPE, 0, ADC_SAMPLES, SAMPLE_RATE, 0, 0, RX_GAIN}
    profile[2]={1, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, 0, 0, 0, 0, 0, 0, FREQ_SLOPE, 0, ADC_SAMPLES, SAMPLE_RATE, 0, 0, RX_GAIN}
    profile[3]={2, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, 0, 0, 0, 0, 0, 0, FREQ_SLOPE, 0, ADC_SAMPLES, SAMPLE_RATE, 0, 0, RX_GAIN}
    ptx = {}
    ptx[1]={1,0,0}
    ptx[2]={0,0,1}
    ptx[3]={0,1,0}
    periodicity = 100
    
    info = debug.getinfo(1,'S');
    file_path = (info.source);
    file_path = string.gsub(file_path, "@","");
    i, j = string.find(file_path, "\\.*%.lua")
    file_path=string.gsub(file_path, "\\[%w_]-%.lua$","\\");
    WriteToLog(file_path.."\n", "red")
    fw_path   = file_path.."..\\..\\rf_eval_firmware"
    
    COM_PORT = 6
    ar1.FullReset()
    RSTD.Sleep(2000)
    ar1.SOPControl(2)
    RSTD.Sleep(1000)
    ar1.Connect(COM_PORT,921600,1000)
    RSTD.Sleep(2000)
    ar1.frequencyBandSelection("60G")
    bitopfile = file_path.."\\".."bitoperations.lua"
    dofile(bitopfile)
    
    res, efusedevice = ar1.ReadRegister(0xFFFFE214, 0, 31)
    res, efuseES1device = ar1.ReadRegister(0xFFFFE210, 0, 31)
    efuseES2ES3Device = bit_and(efusedevice, 0x03FC0000)
    efuseES2ES3Device = bit_rshift(efuseES2ES3Device, 18)
    partId = 6843
    if(efuseES2ES3Device == 0) then
    	if (bit_and(efuseES1device, 3) == 0) then
    		partId = 1243
    	elseif (bit_and(efuseES1device, 3) == 1) then
    		partId = 1443
    	else
    		partId = 1642
    	end
    elseif(efuseES2ES3Device == 0xE0 and (bit_and(efuseES1device, 3) == 2)) then
    		partId = 6843
    		ar1.frequencyBandSelection("60G")
    --if part number is non-zero then those are ES12 and ES3 devices
    else
       if(efuseES2ES3Device == 0x20 or efuseES2ES3Device == 0x21 or efuseES2ES3Device == 0x80) then
    		partId = 1243
    	elseif(efuseES2ES3Device == 0xA0 or efuseES2ES3Device == 0x40)then
    		partId = 1443
    	elseif(efuseES2ES3Device == 0x60 or efuseES2ES3Device == 0x61 or efuseES2ES3Device == 0x04 or efuseES2ES3Device == 0x62 or efuseES2ES3Device == 0x67) then
    		partId = 1642
    	elseif(efuseES2ES3Device == 0x66 or efuseES2ES3Device == 0x01 or efuseES2ES3Device == 0xC0 or efuseES2ES3Device == 0xC1) then
    		partId = 1642
    	elseif(efuseES2ES3Device == 0x70 or efuseES2ES3Device == 0x71 or efuseES2ES3Device == 0xD0 or efuseES2ES3Device == 0x05) then
    		partId = 1843
    	elseif(efuseES2ES3Device == 0xE0) then
    		partId = 6843
    		ar1.frequencyBandSelection("60G")
    	else
    		WriteToLog("Inavlid Device part number in ES2 and ES3 devices\n" ..partId)
        end
    end 
    
    res, ESVersion = ar1.ReadRegister(0xFFFFE218, 0, 31)
    ESVersion = bit_and(ESVersion, 15)
    
    data_path     = file_path.."..\\PostProc"
    pkt_log_path  = data_path.."\\pktlogfile.txt"
    
    
    if(partId == 1642) then
        BSS_FW    = fw_path.."\\radarss\\xwr16xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr16xx_masterss.bin"
    elseif(partId == 1243) then
        BSS_FW    = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
    elseif(partId == 1443) then
        BSS_FW    = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
    elseif(partId == 1843) then
        BSS_FW    = fw_path.."\\radarss\\xwr18xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr18xx_masterss.bin"
    elseif(partId == 6843) then
        BSS_FW    = fw_path.."\\radarss\\xwr68xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr68xx_masterss.bin"
    else
        WriteToLog("Inavlid Device partId FW\n" ..partId)
        WriteToLog("Inavlid Device ESVersion\n" ..ESVersion)
    end
    
    if (ar1.DownloadBSSFw(BSS_FW) == 0) then
        WriteToLog("BSS FW Download Success\n", "green")
    else
        WriteToLog("BSS FW Download failure\n", "red")
    end
    RSTD.Sleep(2000)
    
    if (ar1.DownloadMSSFw(MSS_FW) == 0) then
        WriteToLog("MSS FW Download Success\n", "green")
    else
        WriteToLog("MSS FW Download failure\n", "red")
    end
    RSTD.Sleep(2000)
    
    if (ar1.PowerOn(1, 1000, 0, 0) == 0) then
        WriteToLog("Power On Success\n", "green")
    else
       WriteToLog("Power On failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if (ar1.RfEnable() == 0) then
        WriteToLog("RF Enable Success\n", "green")
    else
        WriteToLog("RF Enable failure\n", "red")
    end
    RSTD.Sleep(1000)
    if (partId == 1843) or (partId == 6843) then
        if (ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 1, 0) == 0) then
            WriteToLog("ChanNAdcConfig Success\n", "green")
        else
            WriteToLog("ChanNAdcConfig failure\n", "red")
        end
    else
        if (ar1.ChanNAdcConfig(1, 1, 0, 1, 1, 1, 1, 2, 1, 0) == 0) then
            WriteToLog("ChanNAdcConfig Success\n", "green")
        else
            WriteToLog("ChanNAdcConfig failure\n", "red")
        end  
    end      
    RSTD.Sleep(1000)
    
    if (partId == 1642) then
        if (ar1.LPModConfig(0, 1) == 0) then
            WriteToLog("LPModConfig Success\n", "green")
        else
            WriteToLog("LPModConfig failure\n", "red")
        end
    else
        if (ar1.LPModConfig(0, 0) == 0) then
            WriteToLog("Regualar mode Cfg Success\n", "green")
        else
            WriteToLog("Regualar mode Cfg failure\n", "red")
        end
        if (ar1.RfLdoBypassConfig(0x3) == 0) then
            WriteToLog("RfLdoBypass Cfg Success\n", "green")
        else
            WriteToLog("RfLdoBypass Cfg failure\n", "red")
        end
    end
    RSTD.Sleep(2000)
    
    if (ar1.RfInit() == 0) then
        WriteToLog("RfInit Success\n", "green")
    else
        WriteToLog("RfInit failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if (ar1.DataPathConfig(1, 1, 0) == 0) then
        WriteToLog("DataPathConfig Success\n", "green")
    else
        WriteToLog("DataPathConfig failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if (ar1.LvdsClkConfig(1, 1) == 0) then
        WriteToLog("LvdsClkConfig Success\n", "green")
    else
        WriteToLog("LvdsClkConfig failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if((partId == 1642) or (partId == 1843) or (partId == 6843)) then
        if (ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0) == 0) then
            WriteToLog("LVDSLaneConfig Success\n", "green")
        else
            WriteToLog("LVDSLaneConfig failure\n", "red")
        end
    elseif ((partId == 1243) or (partId == 1443)) then
        if (ar1.LVDSLaneConfig(0, 1, 1, 1, 1, 1, 0, 0) == 0) then
            WriteToLog("LVDSLaneConfig Success\n", "green")
        else
            WriteToLog("LVDSLaneConfig failure\n", "red")
        end
    end
    RSTD.Sleep(1000)
    
    
    if(partId == 6843) then
        for n = 0,NumOfProfile-1 do
            if(ar1.ProfileConfig(profile[n][1],profile[n][2],profile[n][3],profile[n][4],profile[n][5],profile[n][6],profile[n][7],profile[n][8],profile[n][9],profile[n][10],profile[n][11],profile[n][12],profile[n][13],profile[n][14],profile[n][15],profile[n][16],profile[n][17],profile[n][18]) == 0) then
                WriteToLog("ProfileConfig No."..n.."Success\n", "green")
            else
                WriteToLog("ProfileConfig No."..n.."failure\n", "red")
            end      
        end
    end
    for i = 0, NumOfChirpInLoop - 1 do
        p = 0
        tx1 = ptx[i+1][1]
        tx2 = ptx[i+1][2]
        tx3 = ptx[i+1][3]
        if (ar1.ChirpConfig(i, i, p, 0, 0, 0, 0, tx1, tx2, tx3) == 0) then
        --if (ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 1, 0) == 0) then
            WriteToLog("ChirpConfig No."..i.." Success\n", "green")
        else
            WriteToLog("ChirpConfig No."..i.." failure\n", "red")
         
        end
    end
    
    RSTD.Sleep(1000)
    
    if (ar1.FrameConfig(0, NumOfChirpInLoop-1, NumOfFrame, CHIRP_LOOPS,periodicity, 0, 1) == 0) then
        WriteToLog("FrameConfig Success\n", "green")
    else
        WriteToLog("FrameConfig failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if (ar1.SelectCaptureDevice("DCA1000") == 0) then
        WriteToLog("SelectCaptureDevice Success\n", "green")
    else
        WriteToLog("SelectCaptureDevice failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if (ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098) == 0) then
        WriteToLog("CaptureCardConfig_EthInit Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_EthInit failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    if ((partId == 1642) or (partId == 1843) or (partId == 6843)) then
        if (ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30) == 0) then
            WriteToLog("CaptureCardConfig_Mode Success\n", "green")
        else
            WriteToLog("CaptureCardConfig_Mode failure\n", "red")
        end
    elseif ((partId == 1243) or (partId == 1443)) then
        if (ar1.CaptureCardConfig_Mode(1, 1, 1, 2, 3, 30) == 0) then
            WriteToLog("CaptureCardConfig_Mode Success\n", "green")
        else
            WriteToLog("CaptureCardConfig_Mode failure\n", "red")
        end
    end
    RSTD.Sleep(1000)
    
    if (ar1.CaptureCardConfig_PacketDelay(25) == 0) then
        WriteToLog("CaptureCardConfig_PacketDelay Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_PacketDelay failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    tstring = os.date('%Y-%m-%d_%H;%M;%S', t0)
    local socket1 = require"socket"
    local t0 = socket1.gettime()
    os.execute("mkdir \"" ..data_path.."\\".. tstring.."\"")
    Raw_data_path = data_path.."\\"..tstring.."\\adc_data_Raw_0.bin"
    adc_data_path = data_path.."\\"..tstring.."\\adc_data.bin"
    ar1.CaptureCardConfig_StartRecord(adc_data_path, 0)
    RSTD.Sleep(1000)
    
    if (autoStart > 0 ) then
        
        local socket1 = require"socket"
        local t0 = socket1.gettime()
        print(t0)
        f = assert(io.open(data_path.."\\".. tstring.."\\".."timestamp.txt",'w'))
        f:write(t0)
        f:close()
    
        ar1.StartFrame()
        RSTD.Sleep(2000)
    end
    

  • 建议参考C:\ti\mmwave_studio_02_01_00_00\mmwave_studio_02_01_00_00\mmWaveStudio\Scripts目录下的LUA。