def test_watchdog_expir_state(self, x_series_device, seed):
# Reset the pseudorandom number generator with seed.
random.seed(seed)
do_line = random.choice(x_series_device.do_lines)
with nidaqmx.system.WatchdogTask(
x_series_device.name, timeout=0.1) as task:
expir_states = [DOExpirationState(
physical_channel=do_line.name,
expiration_state=Level.TRISTATE)]
task.cfg_watchdog_do_expir_states(expir_states)
expir_state_obj = task.expiration_states[do_line.name]
assert expir_state_obj.expir_states_do_state == Level.TRISTATE
expir_state_obj.expir_states_do_state = Level.LOW
assert expir_state_obj.expir_states_do_state == Level.LOW
评论列表
文章目录