Programming Flow

NI DC Power Supplies and SMUs Help (NI-DCPower)

Edition Date: January 2018

Part Number: 370736U-01

View Product Info

DOWNLOAD (Windows Only)


NI-DCPower (English | Japanese)

To program an NI power supply or SMU, complete the following steps:

  1. Open a session.
  2. Configure the device for your application.
  3. Initiate generation and acquisition.
  4. (Optional) Measure and query or fetch.
  5. Close the session.

Opening a Session

Use the niDCPower Initialize With Channels VI or the niDCPower_InitializeWithChannels function to open a session.

For any application you write, you must open a session to establish communication with the device by initializing.

Initialize to set the driver and the device to a known state. Initialization can take a significant amount of time compared to other NI-DCPower VIs and functions, so you should not include it in a loop when repeatedly acquiring data. Ideally, your program should call Initialize one time. If the reset parameter is set to TRUE, the device resets to the default state, which may include resetting relays.

Configuring the Device

The device has two basic source modes—Single Point source mode and Sequence source mode. Additional modes include pulsing and advanced sequencing.

Note Note  Attribute values do not persist between sessions. If you close a session and open a new one, all attributes assume their default values; however, the default values are not committed to the device until the session enters the Committed or Running state.

Single Point Source Mode

Complete the following steps to configure a device in Single Point source mode:

  1. Set the Source Mode to Single Point using the niDCPower Configure Source Mode VI or niDCPower_ConfigureSourceMode function.
  2. Configure the source unit.
  3. (Optional) Configure the measure unit.

Sequence Source Mode

Complete the following steps to configure a device in Sequence source mode:

  1. Set the Source Mode to Sequence using the niDCPower Configure Source Mode VI or niDCPower_ConfigureSourceMode function.
  2. Configure the source unit.
  3. Set the sequence with the niDCPower Set Sequence VI or the niDCPower_SetSequence function.
  4. (Optional) Configure the measure unit.

Initiating Generation and Acquisition

Use the niDCPower Initiate VI or the niDCPower_Initiate function to apply the configuration and start generation.

Measuring, Querying, or Fetching

By default, the source mode that you configured the device to use determines the way in which NI-DCPower acquires measurements.

Measuring and Querying

Complete the following steps to acquire measurements in Single Point source mode:

  1. Measure with the niDCPower Measure Multiple VI or the niDCPower_MeasureMultiple function.
  2. Call the niDCPower Query In Compliance VI or the niDCPower_QueryInCompliance function to query the output state.

Fetching

NI-DCPower automatically acquires measurements when you configure the following VIs or functions:

These measurements are automatically aquired by coercing the niDCPower Measure When property to Automatically After Source Complete or the NIDCPOWER_ATTR_MEASURE_WHEN attribute to NIDCPOWER_VAL_AUTOMATICALLY_AFTER_SOURCE_COMPLETE. To fetch these measurements, call the niDCPower Fetch Multiple VI or the niDCPower_FetchMultiple function. NI-DCPower returns the measurement values in an array.

Tip Tip  If you want the measure unit to operate independently of the source unit in this context, set the niDCPower Measure When property or the NIDCPOWER_ATTR_MEASURE_WHEN attribute to a value other than Automatically After Source Complete or NIDCPOWER_VAL_AUTOMATICALLY_AFTER_SOURCE_COMPLETE. Refer to Acquiring Measurements for more information about the niDCPower Measure When property or the NIDCPOWER_ATTR_MEASURE_WHEN attribute.

Close the Session

Use the niDCPower Close VI or the niDCPower_close function to close a session.

Closing a session is essential for freeing resources, including deallocating memory, destroying threads, and freeing operating system resources. You should close every session that you initialize, even if an error occurs during the program. When debugging your application, it is common to abort execution before you close. While aborting the execution should not cause problems, NI does not recommend doing so.

When you close a session to a device, the device continues to operate in its last configured state. If you close the session while the output channels of the device are enabled and actively sourcing or sinking power, the device continues to source or sink power until it is disabled or reset.

Related Topics

Single Point Source Mode

Sequence Source Mode

Advanced Sequencing

Pulsing

WAS THIS ARTICLE HELPFUL?

Not Helpful