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

Driver/keithley s46 #1409

Merged
merged 29 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd0fdb8
initial commit
sohailc Nov 28, 2018
72a554e
initial commit
sohailc Nov 28, 2018
2b440c1
added instrument sim yaml file
sohailc Nov 29, 2018
5eeed70
removed superfluous newline
sohailc Nov 29, 2018
653e7b3
Merge branch 'master' of https://github.com/QCoDeS/Qcodes into driver…
sohailc Nov 29, 2018
67ecfbe
major rewrite of driver: organized in terms of relays
sohailc Nov 30, 2018
af646ae
do not raise a run time warning when attempting to release a lock tha…
sohailc Nov 30, 2018
1d5c9b9
major rewrite, again
sohailc Nov 30, 2018
5615782
test work now
sohailc Dec 3, 2018
ce2fb0f
added test to assert that the 'close' query is only asked once during…
sohailc Dec 3, 2018
f1e3852
docstrings + type hints
sohailc Dec 4, 2018
c9abbe4
edit notebook meta data to stop exec on CI
sohailc Dec 4, 2018
c4bbc08
remove unused cast import
sohailc Dec 4, 2018
634c4dc
Merge branch 'master' of https://github.com/QCoDeS/Qcodes into driver…
sohailc Dec 4, 2018
ac17359
add newline in simulation yaml
sohailc Dec 4, 2018
84f3826
wrong comment in simulation yaml file
sohailc Dec 4, 2018
0b453b5
remove nonsense assert from test
sohailc Dec 4, 2018
f499cb7
explicitly test channel number invariance
sohailc Dec 4, 2018
e1e231d
Merge branch 'master' into driver/keithley_s64
sohailc Dec 4, 2018
70902be
minor improvement in dict comprehension
sohailc Dec 4, 2018
cdcea52
Merge branch 'master' of https://github.com/QCoDeS/Qcodes into driver…
sohailc Dec 4, 2018
c8a41e6
Merge remote-tracking branch 'qcodes-sohail/driver/keithley_s64' into…
sohailc Dec 4, 2018
0cf77f8
add acquire and release lock return type hints
sohailc Dec 5, 2018
22e3e44
1) Instead of using InstrumentChannel, make individual parameters (e.…
sohailc Dec 6, 2018
de0e569
Merge branch 'master' into driver/keithley_s64
sohailc Dec 7, 2018
d78d662
make a seperate test to verify that "close?" is called once during in…
sohailc Dec 7, 2018
ac94abb
test that open_all_channels issues the right visa commands and locks …
sohailc Dec 7, 2018
8bbf347
Merge branch 'master' of https://github.com/QCoDeS/Qcodes into driver…
sohailc Dec 7, 2018
86be1ff
Merge remote-tracking branch 'qcodes-sohail/driver/keithley_s64' into…
sohailc Dec 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
346 changes: 346 additions & 0 deletions docs/examples/driver_examples/QCodes example with Keithley S46.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tektronix Keithley S46\n",
"\n",
"The S46 is an RF swicth with four relays \"A\" to \"D\". These relays either have four or six poles, depending on the instrument model. Each pole constitutes a channel and can either be \"open\" or \"closed\". Channel \"A1\" is attached to the first pole on relay \"A\", channel \"B2\" is attached to the second pole of relay \"B\", etc... \n",
"\n",
"Channels \"A1\" to \"D6\" are all \"normally open\". Only one channel per relay may be closed. \n",
"\n",
"Additionally, there are optionally eight relays \"R1\" to \"R8\" which are two pole relays. One pole is \"normally closed\" and the other \"normally open\". For these relays, we have one channel per relay, so \"R1\" is both a channel and a relay. Upon closing the channel, the normally open pole will close. \n",
"\n",
"In this notebook, we have verified with a multi-meter that channels indeed open and close as expected. \n",
"\n",
"Note: We have performed tests with a six pole instrument. Although it is expected that this driver should work with a four pole instrument, this has not been verified due to a lack of instrument availability "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.tektronix.Keithley_s46 import S46, LockAcquisitionError"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"s46 = S46(\"s2\", \"GPIB0::7::INSTR\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'R5', 'R8']\n",
"26\n"
]
}
],
"source": [
"print(s46.available_channels)\n",
"print(len(s46.available_channels))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['A2', 'B1']"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.closed_channels()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"s46.open_all_channels()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.closed_channels()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'open'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.A1()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"s46.A1(\"close\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'close'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.A1()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['A1']"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.closed_channels()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Relay A is already in use by channel 1\n"
]
}
],
"source": [
"try: \n",
" s46.A2(\"close\")\n",
" raise(\"We should not be here\")\n",
"except LockAcquisitionError as e: \n",
" print(e)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"s46.A1(\"open\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"s46.A2(\"close\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Relay A is already in use by channel 2\n"
]
}
],
"source": [
"try: \n",
" s46.A1(\"close\")\n",
" raise(\"We should not be here\")\n",
"except LockAcquisitionError as e: \n",
" print(e)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"s46.B1(\"close\")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Relay B is already in use by channel 7\n"
]
}
],
"source": [
"try: \n",
" s46.B2(\"close\")\n",
" raise(\"We should not be here\")\n",
"except LockAcquisitionError as e: \n",
" print(e)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['A2', 'B1']"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.closed_channels()"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"s46.open_all_channels()"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s46.closed_channels()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
},
"nbsphinx": {
"execute": "never"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading