I’m trying to use the Logic 2 for test automation but am running into issues with syncing up the logic capture start time to my data being started.
Essentially I’m setting a gpio high and then low and recording the time in between. This seems to work great about 70% of the time but occasionally it seems like the logic automation “start_capture” takes too long to start recording and misses the gpio being set high. Obviously I could manually set a delay but that seems like a dirty way to do it as it adds time to the overall test time and still could fail.
Is there any method of confirming that the recording has in fact started before setting the gpio high?
Good question - are you saying you are calling
manager.start_capture, then you are toggling your IO pin, and despite this, you’re still missing the first event sometimes?
Looking into it, this is a bug. Everything is synchronous right down to the actual hardware recording start.
The last thing
manager.start_capture does synchronously is start a new thread that’s responsible for sending the final start command to the hardware, while all other preparation is done synchronously.
I’ll get this logged as a bug, unfortunately in the meantime the only workaround is adding a small sleep after
manager.start_capture. The total remaining delay there should be very small, I would expect a few ms typically, but as all things that are asynchronous can go wrong, I would recommend trying 100ms.
Thank you for the info. I ran it around 1000 times at 100ms and 10ms of delay and with 10ms it failed around 150 times, with 100ms it failed 0. For now I’ll add the delay but look forward to a solution down the line!