tkrebes / nisyscfg-python

NI System Configuration Python API
MIT License
4 stars 0 forks source link

Added self_calibrate to HardwareResource #54

Closed tkrebes closed 1 year ago

tkrebes commented 1 year ago

What does this Pull Request accomplish?

Adds support for self calibration - #53

Why should this Pull Request be merged?

Increases parity with LabVIEW and C API.

What testing has been done?

Tested by @ni-jfitzger on a system with a PXIe-5164. See comments below for details.

ni-jfitzger commented 1 year ago

@tkrebes for me the flake8 check returned ./nisyscfg/hardware_resource.py:550:10: W292 no newline at end of file

You may want to add a blank line at the end.

ni-jfitzger commented 1 year ago

@tkrebes I installed this and ran the following code on a system with a 5164.

>>> with nisyscfg.Session() as session:
...     filter = session.create_filter()
...     filter.is_present = True
...     filter.is_ni_product = True
...     filter.is_device = True
...     filter.user_alias = "Digitizer1"
...     for resource in session.find_hardware(filter):
...             resource.self_calibrate()
...
''

I was able to confirm that this successfully calibrated the device.