Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Keithley3706A): Fix interlock status dictionary #5013

Merged

Conversation

brandonaltieri1
Copy link
Contributor

@brandonaltieri1 brandonaltieri1 commented Feb 14, 2023

When instantiating an object of the class Keithley3706A, the interlock status is checked for each card that is installed in the unit. When querying the unit for the interlock status (for a specific slot), the unit can return any of the following values:

image

See page 742 of https://download.tek.com/manual/3700AS-901-01D_Jul_2018_Ref_0.pdf. The interlock state is mapped using a dictionary (interlock_status in the get_interlock_state method), where the returned value is used as the key to find the appropriate status string. However, this dictionary was initially defined using only two keys, 0 and 1. When querying the interlock status, the possible return values are nil, 0, 1, 2, and 3. As some of these return values are not included as keys in the interlock_status dictionary, when the unit does not return 0 or 1, a KeyError is raised, and the driver cannot be instantiated. This PR updates this interlock_status dictionary to include all possible return values as keys, and adds the associated status strings (taken directly from the reference manual). The unit test/sim file are both updated to reflect these changes.

@brandonaltieri1 brandonaltieri1 changed the title update interlock status dict Bug in Keithley 3706A Driver when checking interlock status Feb 14, 2023
@brandonaltieri1 brandonaltieri1 changed the title Bug in Keithley 3706A Driver when checking interlock status fix(Keithley3706A): Fix interlock status dictionary Feb 14, 2023
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #5013 (1340484) into master (73c352f) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5013      +/-   ##
==========================================
- Coverage   67.22%   67.19%   -0.04%     
==========================================
  Files         356      356              
  Lines       29726    29729       +3     
==========================================
- Hits        19984    19977       -7     
- Misses       9742     9752      +10     

@brandonaltieri1 brandonaltieri1 marked this pull request as ready for review February 15, 2023 14:30
@jenshnielsen
Copy link
Collaborator

Thanks @brandonaltieri1 could you add a short message to a file called 5013.improved_driver in docs\changes\newsfragments explaining the fix

@brandonaltieri1
Copy link
Contributor Author

Thanks @brandonaltieri1 could you add a short message to a file called 5013.improved_driver in docs\changes\newsfragments explaining the fix

Done, thanks @jenshnielsen!

@jenshnielsen jenshnielsen added this pull request to the merge queue Feb 16, 2023
Merged via the queue into microsoft:master with commit e2bc66b Feb 16, 2023
@brandonaltieri1 brandonaltieri1 deleted the keithely_3706a_driver_bug_fix branch February 16, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants