02-14-2023 09:01 AM
02-14-2023 10:26 AM
I can't help with the Python, just the counter capabilities.
Here's what you'll need to do:
1. Configure both tasks to use the same signal as a Start Trigger. This should be a signal you control, perhaps as a simple DO line.
2. Define the 'initial delay' property when configuring the pulse trains. The very first low time (assuming you leave them in the default mode of low idle state) comes from 'initial delay', subsequent ones come from the regular pulse params (low/high time or freq/duty cycle).
You can use 'initial delay' to set the pulse trains' relative offset. Since they both will start simultaneously due to a shared trigger, it's the 'initial delay' property that will set the offset between their respective first rising edges.
3. Start both pwm tasks before asserting the trigger.
-Kevin P