|NI-DCPower (English | Japanese)|
To program an NI power supply or SMU, complete the following steps:
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.
The device has two basic source modes—Single Point source mode and Sequence source mode. Additional modes include pulsing and advanced sequencing.
|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.|
Complete the following steps to configure a device in Single Point source mode:
Complete the following steps to configure a device in Sequence source mode:
By default, the source mode that you configured the device to use determines the way in which NI-DCPower acquires measurements.
Complete the following steps to acquire measurements in Single Point source mode:
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 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.|
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.