Closed Arkh42 closed 9 months ago
I tested with the voltage_limit
property: it is working properly, contrary to current_limit
.
I don’t believe this is a bug within the nidcpower Python module, rather the underlying behavior of the driver runtime. You’d get the same results from LabVIEW or C or C#.
What is the model of the SMU you run this on? What is the version of the NI-DCPower driver runtime you installed? What operating system are you using this with?
What is the model of the SMU you run this on?
The PXIe-4163.
What is the version of the NI-DCPower driver runtime you installed?
See the snapshot attached for the whole list. All packages are version 2023 Q4 Patch 1.
What operating system are you using this with?
Windows 10.
In "NI DC Power Supplies and SMUs Help", I found the following:
Accessing Attributes
[...]
Setting Properties and Attributes Before Reading Them
Properties and attributes are modified when you set them or when you call a configuration VI or function that sets them, respectively. It is important to set the properties or attributes or call any configuration VIs or functions before reading back any property or attribute values for the following reasons:
- [...]
- The driver verifies that the configuration of the session is valid at the time the property or attribute is read. It is possible to get an error when reading a property or attribute if the configuration is not valid at that point**, even when a setting later could make it valid.
- [...]
Could that be the reason for which a read-access operation in the above script raises an error, even though I am just trying to check the type of the returned variable?
Yes. Getting (reading) a property causes what is known as a "verify" operation, which looks at all the session's properties to confirm they are in a valid configuration, and raises if this is not the case. In your code, you get a property in order to see its type, but it doesn't really matter to the driver what your intent for getting the property is.
There are several reasons why the driver only looks at valid property values when the "verify" occurs, one example is to avoid ordering requirements on how you need to set properties.
Closing this since it isn't a bug in the nidcpower
module, nor in the NI-DCPower driver runtime for that matter.
Description of issue
When I try to read the
current_limit
property, I get an error related to thecurrent_limit_range
property, as if I were trying to write the value.System report
Steps to reproduce issue
nidcpower.errors.DriverError
is raised.nidcpower.errors.DriverError
is raised.