Added DMT Current Source Drivers#11
Open
Kaushik3112 wants to merge 2 commits into
Open
Conversation
| """Set current value for the channel""" | ||
| curr_range = self.get_range() | ||
| temperature = self.root_instrument.get_temp() | ||
| # print(self.ask("!help")) |
Contributor
There was a problem hiding this comment.
Remove commented print
| check_response = self.ask('!chk;'+self.channel) | ||
| params = check_response.strip().split(';') | ||
| curr_range = float(params[2].rstrip("mA")) | ||
| # curr_value = float(params[3].rstrip("uA")) |
Contributor
There was a problem hiding this comment.
Remove commented code
Suggested change
| # curr_value = float(params[3].rstrip("uA")) |
| """Check range and current of the channel""" | ||
| check_response = self.ask('!chk;'+self.channel) | ||
| params = check_response.strip().split(';') | ||
| # curr_range = float(params[2].rstrip("mA")) |
Contributor
There was a problem hiding this comment.
remove commented code
Suggested change
| # curr_range = float(params[2].rstrip("mA")) |
Comment on lines
+52
to
+53
| """ | ||
| """ |
Contributor
There was a problem hiding this comment.
Suggested change
| """ | |
| """ |
Comment on lines
+17
to
+36
| """ | ||
| Some basic concepts for this current source: | ||
|
|
||
| VisaInstrument: | ||
| This basic current source has up to 8 channels that are accessible to the user. Most functions will be contained | ||
| within the channel function but the temperature of the current source is general and needs to be | ||
| checked to ensure that it is not overheating. | ||
|
|
||
| Channel: | ||
| Each channel only has two basic functions that we can set: the current and the range (range of 4 mA or 40 mA with | ||
| resolution of 0.125 uA or 1.25uA) | ||
| The only string each channel returns is the following: #chk;channelnumber;range;value | ||
| For some weird reason the range is in mA but the current value is in uA. | ||
|
|
||
| """ | ||
|
|
||
| """ | ||
| Helper Functions | ||
|
|
||
| """ |
Contributor
There was a problem hiding this comment.
Keep everything in a single docstring
Suggested change
| """ | |
| Some basic concepts for this current source: | |
| VisaInstrument: | |
| This basic current source has up to 8 channels that are accessible to the user. Most functions will be contained | |
| within the channel function but the temperature of the current source is general and needs to be | |
| checked to ensure that it is not overheating. | |
| Channel: | |
| Each channel only has two basic functions that we can set: the current and the range (range of 4 mA or 40 mA with | |
| resolution of 0.125 uA or 1.25uA) | |
| The only string each channel returns is the following: #chk;channelnumber;range;value | |
| For some weird reason the range is in mA but the current value is in uA. | |
| """ | |
| """ | |
| Helper Functions | |
| """ |
| A driver to control the DM Technologies Multichannel current source | ||
|
|
||
| @author: Kaushik & Angela Kou | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| Some basic concepts for this current source: | |
| VisaInstrument: | |
| This basic current source has up to 8 channels that are accessible to the user. Most functions will be contained | |
| within the channel function but the temperature of the current source is general and needs to be | |
| checked to ensure that it is not overheating. | |
| Channel: | |
| Each channel only has two basic functions that we can set: the current and the range (range of 4 mA or 40 mA with | |
| resolution of 0.125 uA or 1.25uA) | |
| The only string each channel returns is the following: #chk;channelnumber;range;value | |
| For some weird reason the range is in mA but the current value is in uA. |
Comment on lines
+47
to
+49
| """ | ||
| Drivers | ||
| """ |
Contributor
There was a problem hiding this comment.
Suggested change
| """ | |
| Drivers | |
| """ |
Comment on lines
+172
to
+178
| def _open_resource( #local visa open resource that sets the baud rate | ||
| self, address: str, visalib: str | None | ||
| ) -> tuple[pyvisa.resources.MessageBasedResource, str, pyvisa.ResourceManager]: | ||
|
|
||
| resource, visabackend, resource_manager = super()._open_resource(address, visalib) | ||
| resource.baud_rate = 115200 | ||
| return resource, visabackend, resource_manager |
Contributor
There was a problem hiding this comment.
why do we need to open the pyvisa resource ourselves?
Author
There was a problem hiding this comment.
It is to set the baud_rate as the device only talks to the PC once that is set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added the drivers for the new current source.