Package: nidigital
Overall Statusmaster branch statusGitHub statusInfoPython bindings for NI Modular Instrument drivers. SeeGitHubfor the latest source.AuthorNIAboutThenidigitalmodule provides a Python API for NI-Digital Pattern Driver. The code is maintained in the Open Source repository fornimi-python.Support Policynidigitalsupports all the Operating Systems supported by NI-Digital Pattern Driver.It followsPython Software Foundationsupport policy for different versions of CPython.NI-Digital Pattern Driver Python API StatusNI-Digital Pattern Driver (nidigital)Driver Version Tested Against2023 Q2PyPI VersionSupported Python VersionDocumentationOpen IssuesOpen Pull RequestsInstallationAs a prerequisite to using thenidigitalmodule, you must install the NI-Digital Pattern Driver runtime on your system. Visitni.com/downloadsto download the driver runtime for your devices.The nimi-python modules (i.e. forNI-Digital Pattern Driver) can be installed withpip:$ python -m pip install nidigital~=1.4.7ContributingWe welcome contributions! You can clone the project repository, build it, and install it byfollowing these instructions.UsageThe following is a basic example of using thenidigitalmodule to open a session to a digital pattern instrument,
source current, and measure both voltage and current using the PPMU on selected channels.importnidigitalimporttimewithnidigital.Session(resource_name='PXI1Slot2')assession:channels='PXI1Slot2/0,PXI1Slot2/1'# Configure PPMU measurementssession.channels[channels].ppmu_aperture_time=0.000004session.channels[channels].ppmu_aperture_time_units=nidigital.PPMUApertureTimeUnits.SECONDSsession.channels[channels].ppmu_output_function=nidigital.PPMUOutputFunction.CURRENTsession.channels[channels].ppmu_current_level_range=0.000002session.channels[channels].ppmu_current_level=0.000002session.channels[channels].ppmu_voltage_limit_high=3.3session.channels[channels].ppmu_voltage_limit_low=0# Sourcingsession.channels[channels].ppmu_source()# Settling time between sourcing and measuringtime.sleep(0.01)# Measuringcurrent_measurements=session.channels[channels].ppmu_measure(nidigital.PPMUMeasurementType.CURRENT)voltage_measurements=session.channels[channels].ppmu_measure(nidigital.PPMUMeasurementType.VOLTAGE)print('{:<20}{:<10}{:<10}'.format('Channel Name','Current','Voltage'))forchannel,current,voltageinzip(channels.split(','),current_measurements,voltage_measurements):print('{:<20}{:<10f}{:<10f}'.format(channel,current,voltage))# Disconnect all channels using programmable onboard switchingsession.channels[channels].selected_function=nidigital.SelectedFunction.DISCONNECTOther usage examples can be found on GitHub.Support / FeedbackFor support specific to the Python API, follow the processs inBugs / Feature Requests.
For support with hardware, the driver runtime or any other questions not specific to the Python API, please visitNI Community Forums.Bugs / Feature RequestsTo report a bug or submit a feature request specific to Python API, please use theGitHub issues page.Fill in the issue template as completely as possible and we will respond as soon
as we can.DocumentationDocumentation is availablehere.Licensenimi-pythonis licensed under an MIT-style license (see
LICENSE).
Other incorporated projects may be licensed under different licenses. All
licenses allow for non-commercial and commercial use.gRPC FeaturesFor driver APIs that support it, passing a GrpcSessionOptions instance as a parameter to Session.__init__() is
subject to the NI General Purpose EULA (see NILICENSE).