How to use the nidigital.DriveFormat function in nidigital

To help you get started, we’ve selected a few nidigital 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 / nidigital / system_tests / test_system_nidigital.py View on Github external
# Channel-based properties
    multi_instrument_session.vil = 1
    multi_instrument_session.pins['PinA', 'PinB', 'PinC'].vil = 2
    assert multi_instrument_session.pins['DutPins'].vil == pytest.approx(2, abs=1e-3)
    assert multi_instrument_session.pins['SysPins'].vil == pytest.approx(1, abs=1e-3)

    # Methods that accept channel_list parameter
    states = multi_instrument_session.pins['PinA', 'PinB'].read_static()
    assert len(states) == 4    # 2 sites per pin

    # Methods that accept pin_list parameter
    multi_instrument_session.create_time_set('t0')
    multi_instrument_session.pins['PinA', 'PinB'].configure_time_set_drive_format(
        time_set_name='t0',
        drive_format=nidigital.DriveFormat.RL)
    drive_format = multi_instrument_session.pins['PinA', 'PinB'].get_time_set_drive_format(time_set_name='t0')
    assert drive_format == nidigital.DriveFormat.RL
github ni / nimi-python / src / nidigital / system_tests / test_system_nidigital.py View on Github external
def test_configure_get_time_set_drive_format(multi_instrument_session):
    '''Test time set drive format methods.

    - configure_time_set_drive_format
    - get_time_set_drive_format
    '''
    time_set_name = 'time_set_abc'
    time_set_drive_format = nidigital.DriveFormat.SBC
    multi_instrument_session.load_pin_map(os.path.join(test_files_base_dir, "pin_map.pinmap"))

    multi_instrument_session.create_time_set(time_set_name)
    assert multi_instrument_session.pins['site0/PinA', 'site1/PinC'].get_time_set_drive_format(time_set_name) == nidigital.DriveFormat.NR
    multi_instrument_session.pins['site0/PinA', 'site1/PinC'].configure_time_set_drive_format(time_set_name, time_set_drive_format)
    assert multi_instrument_session.pins['site0/PinA', 'site1/PinC'].get_time_set_drive_format(time_set_name) == time_set_drive_format