How to use the nidmm.Session function in nidmm

To help you get started, we’ve selected a few nidmm 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 / nidmm / system_tests / test_system_nidmm.py View on Github external
def session():
    with nidmm.Session('FakeDevice', False, True, 'Simulate=1, DriverSetup=Model:4082; BoardType:PXIe') as simulated_session:
        yield simulated_session
github ni / nimi-python / src / nidmm / system_tests / test_system_nidmm.py View on Github external
def test_error_message():
    try:
        # We pass in an invalid model name to force going to error_message
        with nidmm.Session('FakeDevice', False, True, 'Simulate=1, DriverSetup=Model:invalid_model; BoardType:PXIe'):
            assert False
    except nidmm.Error as e:
        assert e.code == -1074134964
        assert e.description.find('The option string parameter contains an entry with an unknown option value.') != -1
github ni / nimi-python / src / nidmm / system_tests / test_system_nidmm.py View on Github external
def session():
    with nidmm.Session('FakeDevice', False, True, 'Simulate=1, DriverSetup=Model:4082; BoardType:PXIe') as simulated_session:
        yield simulated_session
github ni / nimi-python / src / nidmm / examples / nidmm_fetch_waveform.py View on Github external
def example(resource_name, options, function, range, points, rate):
    with nidmm.Session(resource_name=resource_name, options=options) as session:
        session.configure_waveform_acquisition(measurement_function=nidmm.Function[function], range=range, rate=rate, waveform_points=points)
        with session.initiate():
            while True:
                time.sleep(0.1)
                backlog, acquisition_state = session.read_status()
                if acquisition_state == nidmm.AcquisitionStatus.FINISHED_WITH_NO_BACKLOG:
                    break
                measurements = session.fetch_waveform(array_size=backlog)
                print(measurements)
github ni / nimi-python / src / nidmm / examples / nidmm_measurement.py View on Github external
def example(resource_name, option_string, function, range, digits):
    with nidmm.Session(resource_name=resource_name, options=option_string) as session:
        session.configure_measurement_digits(measurement_function=nidmm.Function[function], range=range, resolution_digits=digits)
        print(session.read())
github ni / nimi-python / src / nidmm / examples / nidmm_multi_point_measurement.py View on Github external
def example(resource_name, options, function, range, digits, samples, triggers):
    with nidmm.Session(resource_name=resource_name, options=options) as session:
        session.configure_measurement_digits(measurement_function=nidmm.Function[function], range=range, resolution_digits=digits)
        session.configure_multi_point(trigger_count=triggers, sample_count=samples)
        measurements = session.read_multi_point(array_size=samples)
        print('Measurements: ', measurements)