test_channel_creation.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:nidaqmx-python 作者: ni 项目源码 文件源码
def test_create_ai_voltage_chan_with_excit(self, x_series_device, seed):
        # Reset the pseudorandom number generator with seed.
        random.seed(seed)

        ai_phys_chan = random.choice(x_series_device.ai_physical_chans).name

        with nidaqmx.Task() as task:
            ai_channel = task.ai_channels.add_ai_voltage_chan_with_excit(
                ai_phys_chan, name_to_assign_to_channel="VoltageExcitChannel",
                terminal_config=TerminalConfiguration.NRSE,
                min_val=-10.0, max_val=10.0, units=VoltageUnits.VOLTS,
                bridge_config=BridgeConfiguration.NO_BRIDGE,
                voltage_excit_source=ExcitationSource.EXTERNAL,
                voltage_excit_val=0.1, use_excit_for_scaling=False,
                custom_scale_name="")

            assert ai_channel.physical_channel.name == ai_phys_chan
            assert ai_channel.name == "VoltageExcitChannel"
            assert ai_channel.ai_term_cfg == TerminalConfiguration.NRSE
            assert numpy.isclose(ai_channel.ai_min, -10.0)
            assert numpy.isclose(ai_channel.ai_max, 10.0)
            assert ai_channel.ai_voltage_units == VoltageUnits.VOLTS
            assert ai_channel.ai_bridge_cfg == BridgeConfiguration.NO_BRIDGE
            assert ai_channel.ai_excit_src == ExcitationSource.EXTERNAL
            assert ai_channel.ai_excit_val == 0.1
            assert not ai_channel.ai_excit_use_for_scaling
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号