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.
Hi,
I have been exploring ways to read the output of the console after triggering data capture. I would specifically like to capture the "Frame Ended" string output as indicated below so that I can trigger another process from within my automation lua script. The problem is this response arrives at the console output asynchronously and not in response to a specific lua command.
[16:56:22] [RadarAPI]: Frame Ended
[16:56:22] Frame End async event received!
I can see the above output on the output console but I cannot access that output from within my automation lua script.
I spent quite a bit of time trying to redirect the console output to a file that I could process in my script but that did not work. For some reason, redirecting the stdout to a file does not help at this instance.
To recap, following is the top level functionality I am trying to achieve:
1 - Trigger collection of N radar frames using the automation script.
2 - Wait until the console output displays "[RadarAPI]: Frame Ended" (indicating N frames have been collected)
3 - Automation script detects the "[RadarAPI]: Frame Ended" on the console then triggers another post-processing task from within the same lua script.
At the moment, my automation script executes step 1, after which I have to manually intervene to bridge the gap after the N frames are captured.
If you have any suggestions on achieving the above, that will be of great help.
Regards,
Cagri
Hi,
In the LUA script you could toggle frame start as shown below
if (0 == ar1.StartFrame()) then WriteToLog("Frame Start Success\n", "green") else WriteToLog("Frame Start Failed\n", "red") end
This indicates if it fails or succeeded. Since you know the frame period you then set a delay for that time frame and continue
RSTD.Sleep(5000)
Regards,
Charles O
Hi Charles,
Thank you for your suggestion. That will work I think.
However, just out of curiosity, is there a guidance from TI on how to redirect the stdout to a file? It will be good to know this to log the full notification messages to a file as well. (I am not well-versed in lua as I haven't been using it much)
Regards,
Cagri
Hi,
We don't have a documented process for this at this time, But I can help with any other questions you may have.
Regards,
Charles O
Hi Charles,
Thanks for your message.
I have implemented the solution based on the delay insertion suggestion. After a few tests and timing tweaks, it seems to do the job for me. Therefore, I have no further related questions on this at the moment. Thank you for your help.
Regards,
Cagri