def test_float_property(self, x_series_device):
with nidaqmx.Task() as task:
ai_channel = task.ai_channels.add_ai_voltage_chan(
x_series_device.ai_physical_chans[0].name, max_val=5)
# Test property default value.
assert ai_channel.ai_max == 5
# Test property setter and getter.
max_value = 10
ai_channel.ai_max = max_value
assert ai_channel.ai_max == max_value
# Test property deleter. Reading this property will throw an
# error after being reset.
del ai_channel.ai_max
with pytest.raises(DaqError) as e:
read_value = ai_channel.ai_max
assert e.value.error_code == -200695
评论列表
文章目录