How to use nidcpower - 10 common examples

To help you get started, we’ve selected a few nidcpower examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ni / nimi-python / src / nidcpower / system_tests / test_system_nidcpower.py View on Github external
def test_channel_format_types():
    with nidcpower.Session('4162', [0, 1], False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', range(2), False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', '0,1', False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', None, False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 12
    with nidcpower.Session(resource_name='4162', reset=False, options='Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 12
github ni / nimi-python / src / nidcpower / system_tests / test_system_nidcpower.py View on Github external
def test_channel_format_types():
    with nidcpower.Session('4162', [0, 1], False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', range(2), False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', '0,1', False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 2
    with nidcpower.Session('4162', None, False, 'Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 12
    with nidcpower.Session(resource_name='4162', reset=False, options='Simulate=1, DriverSetup=Model:4162; BoardType:PXIe') as simulated_session:
        assert simulated_session.channel_count == 12
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViInt64, expected_value)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViInt16, expected_value)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self):
        _PointerMatcher.__init__(self, _visatype.ViReal64)
github ni / nimi-python / generated / nidcpower / nidcpower / unit_tests / _matchers.py View on Github external
def __init__(self, expected_size_or_value):
        _BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)
github ni / nimi-python / src / nidcpower / system_tests / test_system_nidcpower.py View on Github external
def test_create_and_delete_advanced_sequence(single_channel_session):
    properties_used = ['output_function', 'voltage_level']
    sequence_name = 'my_sequence'
    single_channel_session.source_mode = nidcpower.SourceMode.SEQUENCE
    single_channel_session.create_advanced_sequence(sequence_name=sequence_name, property_names=properties_used, set_as_active_sequence=True)
    single_channel_session.create_advanced_sequence_step(set_as_active_step=True)
    assert single_channel_session.active_advanced_sequence == sequence_name
    single_channel_session.output_function = nidcpower.OutputFunction.DC_VOLTAGE
    single_channel_session.voltage_level = 1
    single_channel_session.delete_advanced_sequence(sequence_name=sequence_name)
    try:
        single_channel_session.active_advanced_sequence = sequence_name
        assert False
    except nidcpower.errors.DriverError:
        pass