Skip to content

Commit c256dfe

Browse files
examples: Update NI-DCPower readme to describe the .env simulation process (#491)
* Update readme for nidcpower and replace .env sample files to examples directory.
1 parent cc3191e commit c256dfe

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

.env.sample renamed to examples/.env.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# To use it:
44
# - Copy this file to your service's directory or one of its parent directories
5-
# (such as the root of your Git repository or `C:\ProgramData\National
6-
# Instruments\MeasurementLink\Services`).
5+
# (such as the root of your Git repository or `C:\ProgramData\National
6+
# Instruments\MeasurementLink\Services` for statically registered measurement services).
77
# - Rename it to `.env`.
88
# - Uncomment and edit the options you want to change.
99
# - Restart any affected services.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#
55
# To use it:
66
# - Copy this file to your service's directory or one of its parent directories
7-
# (such as the root of your Git repository or `C:\ProgramData\National
8-
# Instruments\MeasurementLink\Services`).
7+
# (such as the root of your Git repository or `C:\ProgramData\National
8+
# Instruments\MeasurementLink\Services` for statically registered measurement services).
99
# - Rename it to `.env`.
1010
# - Uncomment and edit the options you want to change.
1111
# - Restart any affected services.

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ The example measurements are *Poetry-based* projects. Follow the steps below to
5151
```
5252
- 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)
5353
54+
### Creating Simulated Devices for Example Measurements
55+
56+
- To enable simulation for all the modular instrument and VISA examples, copy `.env.simulation` to `.env` in the `examples` directory.
57+
5458
### Executing the Example Measurements
5559
5660
1. Start the discovery service if not already started.

examples/nidcpower_source_dc_voltage/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ This is a MeasurementLink example that sources and measures a DC voltage with an
3131

3232
This example requires an NI SMU that is supported by NI-DCPower (e.g. PXIe-4141).
3333

34-
By default, this example uses a simulated instrument. To use a physical instrument, edit
35-
`_constants.py` to specify `USE_SIMULATION = False`.
34+
By default, this example uses a physical instrument or a simulated device created in NI MAX. To automatically create a simulated device when running the measurement or TestStand sequence, follow the steps below:
35+
- Create a `.env` file in the measurement service's directory or one of its parent directories (such as the root of your Git repository or `C:\ProgramData\National Instruments\MeasurementLink\Services` for statically registered measurement services).
36+
- Add the following options to the `.env` file to enable simulation via the driver's option string:
37+
38+
```
39+
MEASUREMENTLINK_NIDCPOWER_SIMULATE=1
40+
MEASUREMENTLINK_NIDCPOWER_BOARD_TYPE=PXIe
41+
MEASUREMENTLINK_NIDCPOWER_MODEL=4141
42+
```
3643

3744
> **Note**
3845
> The multi-site pin map, `NIDCPowerSourceDCVoltageMultiSite.pinmap`, requires an

0 commit comments

Comments
 (0)