|
5 | 5 | - [Abbreviations](#abbreviations) |
6 | 6 | - [Dependencies](#dependencies) |
7 | 7 | - [Examples](#examples) |
8 | | - - [Setting up the Example Measurements](#setting-up-the-example-measurements) |
9 | | - - [Executing the Example Measurements](#executing-the-example-measurements) |
10 | 8 | - [Developing Measurements: Quick Start](#developing-measurements-quick-start) |
11 | 9 | - [Installation](#installation) |
12 | 10 | - [Developing a minimal python measurement](#developing-a-minimal-python-measurement) |
@@ -55,48 +53,7 @@ There are three ways to do this: |
55 | 53 |
|
56 | 54 | ## Examples |
57 | 55 |
|
58 | | -The `examples` directory contains the following example projects: |
59 | | - |
60 | | -- `sample_measurement`: Performs a loopback measurement with various data types. Provides a Measurement UI and a LabVIEW UI. |
61 | | -- `nidaqmx_analog_input`: Performs a finite analog input measurement with NI-DAQmx. |
62 | | -- `nidcpower_source_dc_voltage`: Sources and measures a DC voltage with an NI SMU. Provides a Measurement UI and a LabVIEW UI. |
63 | | -- `nidmm_measurement`: Performs a measurement using an NI DMM. |
64 | | -- `nifgen_standard_function`: Generates a standard function waveform using an NI waveform generator. |
65 | | -- `niscope_acquire_waveform`: Acquires a waveform using an NI oscilloscope. |
66 | | -- `niswitch_control_relays`: Controls relays using an NI relay driver (e.g. PXI-2567). |
67 | | -- `nivisa_dmm_measurement`: Performs a DMM measurement using NI-VISA and an NI Instrument Simulator v2.0. |
68 | | - |
69 | | -For more details about a specific example, see the `README.md` file included with the example. |
70 | | - |
71 | | -### Setting up the Example Measurements |
72 | | - |
73 | | -The example measurements shared are *poetry-based* projects. Follow the below steps to for setting up the example measurement: |
74 | | - |
75 | | -1. Install `poetry`. Refer to <https://python-poetry.org/docs/#installation> for information on installing poetry. |
76 | | - |
77 | | -2. Open a command prompt, and change the working directory to the directory of the example measurement you want to work with. |
78 | | - |
79 | | - ``` cmd |
80 | | - cd <path_of_example_measurement> |
81 | | - REM Example: cd "..\measurementlink-python\examples\dc_measurement" |
82 | | - ``` |
83 | | -
|
84 | | -3. Run `poetry install`. This command creates/updates the .venv and installs all the dependencies(including `ni-measurementlink-service` package) needed for the Example into `.venv` |
85 | | -
|
86 | | - ``` cmd |
87 | | - poetry install |
88 | | - ``` |
89 | | - - If you get a "command not found" error during `poetry install`, make sure that you added the Poetry path to the system path. Refer to [https://python-poetry.org/docs/#installing-with-the-official-installer/Add-poetry-to-your-path](https://python-poetry.org/docs/#installing-with-the-official-installer:~:text=Add%20Poetry%20to%20your%20PATH) |
90 | | -  |
91 | | -
|
92 | | -### Executing the Example Measurements |
93 | | -
|
94 | | -1. Start the discovery service if not already started. |
95 | | -2. Use `poetry run` to run the measurement service: |
96 | | -
|
97 | | - ``` cmd |
98 | | - poetry run python measurement.py |
99 | | - ``` |
| 56 | +The [`examples`](https://github.com/ni/measurementlink-python/tree/main/examples/) directory contains example measurement services. See the [README.md](https://github.com/ni/measurementlink-python/tree/main/examples/README.md) file for more information. |
100 | 57 |
|
101 | 58 | --- |
102 | 59 |
|
@@ -210,11 +167,17 @@ pip install ni-measurementlink-generator |
210 | 167 |
|
211 | 168 | ## Static Registration of Python Measurements |
212 | 169 |
|
213 | | -Refer to the [Static Registration of measurements section]() for the detailed steps needed to statically register a measurement. |
| 170 | +The MeasurementLink discovery service provides a registry of other services, and can discover and activate other services on the system. These features allow the discovery service to distinguish, manage, and describe measurement services on the system. |
| 171 | + |
| 172 | +To statically register a measurement service with the MeasurementLink discovery service, do the following: |
| 173 | + |
| 174 | +1. Create a [startup batch file](#create-a-batch-file-that-runs-a-python-measurement) or [executable](#create-executable-for-python-scripts) for the measurement service. |
214 | 175 |
|
215 | | -To Statically register the examples provided, the user can copy the example directory with the service config file with the startup batch file, to the search paths and follow the [Setting up the Example Measurements](#setting-up-the-example-measurements) section to set up the measurements. |
| 176 | +2. Edit the measurement service's `.serviceconfig` file and set the `path` value to the filename of the startup batch file or executable. |
216 | 177 |
|
217 | | -Note: The startup batch file can be modified accordingly if the user wants to run with a custom python distribution or virtual environment |
| 178 | +3. Copy the measurement service's directory (including the `.venv` subdirectory if present, `.serviceconfig` file, and startup batch file) to a subdirectory of `C:\ProgramData\National Instruments\MeasurementLink\Services`. |
| 179 | + |
| 180 | +Once your measurement service is statically registered, the MeasurementLink discovery service makes it visible in supported NI applications. |
218 | 181 |
|
219 | 182 | ### Create a batch file that runs a python measurement |
220 | 183 |
|
@@ -280,8 +243,6 @@ Measurement and its related files can be maintained as a python package. The bas |
280 | 243 |
|
281 | 244 | Python communities have different ways of managing a python package and its dependencies. It is up to the measurement developer, on how they wanted to maintain the package and dependencies. Measurement developers can choose from a few common approaches discussed below based on their requirements. |
282 | 245 |
|
283 | | -Note: Once we have the template support for Python measurement, the approach to managing the python measurement package(project) will be streamlined and simplified. |
284 | | - |
285 | 246 | ### Create and Manage Python Measurement Package using poetry |
286 | 247 |
|
287 | 248 | 1. Setting up Poetry(One-time setup) |
|
0 commit comments