I’m wanting to run a test that uses multiple parallel sequences with a multi-channel relay box; one sequence per relay channel. This test requires that the relay channels stay in sync with each other.
I have written a driver for this relay box as well as a test step to toggle the state of a relay and wait for a specified time using the python plugin. Here is the relevant code from the test step:
def Run(self): self.Device.Toggle(self.Channel) self.Info("Toggled Relay " + str(self.Channel) + " state, Waiting for " + str(self.Time) + "ms") OpenTap.TapThread.Sleep(self.Time)
self.Time is the number of milliseconds the step should take and
self.Channel is the relay channel to toggle.
The problem is that the
Toggle command takes a few milliseconds to complete and over time, the channels get out of sync with each other (approx 1 second per 100 toggles) as they toggle at different frequencies.
Does anyone here know of a way to ensure that the
Run method executes in exactly the right number of milliseconds?