Skip to content

MeasurementLink Support for Python v1.1.0

Choose a tag to compare

@bkeryan bkeryan released this 12 Jul 22:29
· 5 commits to releases/1.1 since this release

What's Changed

  • Added support for updating the measurement UI during a measurement.
    • To send UI updates while the measurement is running, use the yield keyword instead of the return keyword to "return" the measurement's output tuple. This turns the measurement function into a Python generator function, which allows it to "return" the output tuple multiple times.
    • When using yield, it is not necessary to use return. If you use both yield and return, MeasurementLink treats the return like a final yield.
    • This feature is intended for interactive usage with InstrumentStudio. In TestStand, only the final UI update is returned.
    • This feature requires MeasurementLink 2023 Q3.
  • Added support for enums.
    • To use an enum type for a configuration or output, pass nims.DataType.Enum for the data type and specify the enum_type keyword argument.
    • Example: @measurement_service.configuration("measurement_type", nims.DataType.Enum, Function.DC_VOLTS, enum_type=Function)
    • This feature requires MeasurementLink 2023 Q3.
  • Added support for version 2 of the MeasurementService interface.
    • This is required for both the UI update and enum features.
    • ni-measurementlink-service now reads the service's provided interfaces from the .serviceconfig file. When you update your services to depend on ni-measurementlink-service version 1.1 or later, you should update their .serviceconfig files to specify both versions of the measurement service interface:
        "providedInterfaces": [
          "ni.measurementlink.measurement.v1.MeasurementService",
          "ni.measurementlink.measurement.v2.MeasurementService"
        ],
    
  • Manually launching a measurement service now automatically starts the discovery service just-in-time by @vigkre in #290
  • Example improvements:
    • Simplified TestStand sequences by reducing the number of setup/cleanup steps and moving them into the main sequence.
    • Refactored command line option handling to reduce amount of boilerplate in measurement.py.
    • Added a nidigital_spi example.
    • Updated modular instrument examples to use session-based simulation by default.
    • Add a ui_progress_updates example by @bkeryan in #266
    • Update the nidaqmx_analog_input_measurement example to use the NI gRPC Device Server and MeasurementLink Session Management Service by @samchris007 in #268
    • Update docs to redirect users to the appropriate release by @bkeryan in #265
    • Use NXG/fuse controls for LabVIEW measurement UIs by @pbirkhol-ni in #272
    • Added common helper method to reserve and create session for NI-DCPower Example by @vigkre in #263
    • Update other examples to match NI-DCPower example changes. by @subash-suresh in #284
    • Create predictable Streaming Measurement example and write automated tests by @DelpireNI in #279
    • Disable result recording in Setup and Cleanup block steps by @Tharun-Sundar in #278
    • NI-Digital: Use timing and levels sheet names rather than paths by @jonathanmendez in #282
    • Add helper to get session information based on pin name by @subash-suresh in #276
    • Simplify reserve call by extracting reservation timeout constant by @bkeryan in #300
    • Add helper to get session information based on pin name by @subash-suresh in #276
    • Update Example Services' TestStand Sequences for Enum Support by @WesleyTangNationalInstruments in #295
  • Simplify single-session measurements by @bkeryan in #287
    • The SessionManagementClient class now has a singular reserve_session() method, in addition to the plural reserve_sessions() method.
    • reserve_session() validates that exactly one session was reserved and returns a SingleSessionReservation object, where reservation.session_info is a single SessionInformation object.
    • reserve_sessions() allows reserving any number of sessions and returns a MultiSessionReservation object, where reservation.session_info is a list of SessionInformation objects.
  • ni-measurementlink-generator
  • Type checking and auto-complete improvements
    • Added a py.typed marker, which indicates that ni-measurementlink-service supports type checking with tools such as mypy and pyright.
    • Use grpc-stubs for type information by @bkeryan in #275
    • Add missing type info to MeasurementContext & use correct types by @bkeryan in #281
    • Fix imports in .pyi type stubs by @bkeryan in #280
    • Generate .pyi type stubs for gRPC client stub classes by @bkeryan in #292
  • bugfix: 'gbk' codec can't decode byte by @LawsonGu in #240
  • Various minor bug fixes and improvements not listed here

New Contributors

Full Changelog: 1.0.1...1.1.0