Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
c48f0bba
Commit
c48f0bba
authored
9 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
Keithley first successful connection-disconection and current setting
parent
4def77e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
keitley244/keithley_first.ipynb
+152
-0
152 additions, 0 deletions
keitley244/keithley_first.ipynb
with
152 additions
and
0 deletions
keitley244/keithley_first.ipynb
0 → 100644
+
152
−
0
View file @
c48f0bba
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"id": "29f2491b-d6fe-4d60-88f8-7c2341b404fe",
"metadata": {},
"outputs": [],
"source": [
"import pyvisa\n",
"import time"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "9bd148de-3fbb-44a7-98b9-408b83f4226c",
"metadata": {},
"outputs": [],
"source": [
"rm =pyvisa.ResourceManager()\n",
"rm.list_resources()\n",
"k224= rm.open_resource('GPIB0::15::INSTR')\n",
"k224.timeout = None"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "33cf3ace-54b1-44ab-8be5-5d32ea2b4ca8",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"k224.write(\"I7.5E-2X\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "440d2ced-b449-4ca6-bd2d-ef7c9955a346",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<StatusCode.success: 0>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"k224.control_ren(3)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "65f1c08d-e8d6-4af6-957c-6b502bfa364c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\nVI_GPIB_REN_DEASSERT = 0\\nVI_GPIB_REN_ASSERT = 1\\nVI_GPIB_REN_DEASSERT_GTL = 2\\nVI_GPIB_REN_ASSERT_ADDRESS = 3\\nVI_GPIB_REN_ASSERT_LLO = 4\\nVI_GPIB_REN_ASSERT_ADDRESS_LLO = 5\\nVI_GPIB_REN_ADDRESS_GTL = 6\\n'"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"\n",
"VI_GPIB_REN_DEASSERT = 0\n",
"VI_GPIB_REN_ASSERT = 1\n",
"VI_GPIB_REN_DEASSERT_GTL = 2\n",
"VI_GPIB_REN_ASSERT_ADDRESS = 3\n",
"VI_GPIB_REN_ASSERT_LLO = 4\n",
"VI_GPIB_REN_ASSERT_ADDRESS_LLO = 5\n",
"VI_GPIB_REN_ADDRESS_GTL = 6\n",
"\"\"\"\n",
"\n",
"# in comparison with the manual and the pyvisa constants"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "9f123901-72cb-46ca-bff7-82336e6f5fa1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"k224.write(\"D0X\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4d4cbcef-908f-4cd0-89be-790fccb51cb3",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.8.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:29f2491b-d6fe-4d60-88f8-7c2341b404fe tags:
```
python
import
pyvisa
import
time
```
%% Cell type:code id:9bd148de-3fbb-44a7-98b9-408b83f4226c tags:
```
python
rm
=
pyvisa
.
ResourceManager
()
rm
.
list_resources
()
k224
=
rm
.
open_resource
(
'
GPIB0::15::INSTR
'
)
k224
.
timeout
=
None
```
%% Cell type:code id:33cf3ace-54b1-44ab-8be5-5d32ea2b4ca8 tags:
```
python
k224
.
write
(
"
I7.5E-2X
"
)
```
%% Output
10
%% Cell type:code id:440d2ced-b449-4ca6-bd2d-ef7c9955a346 tags:
```
python
k224
.
control_ren
(
3
)
```
%% Output
<StatusCode.success: 0>
%% Cell type:code id:65f1c08d-e8d6-4af6-957c-6b502bfa364c tags:
```
python
"""
VI_GPIB_REN_DEASSERT = 0
VI_GPIB_REN_ASSERT = 1
VI_GPIB_REN_DEASSERT_GTL = 2
VI_GPIB_REN_ASSERT_ADDRESS = 3
VI_GPIB_REN_ASSERT_LLO = 4
VI_GPIB_REN_ASSERT_ADDRESS_LLO = 5
VI_GPIB_REN_ADDRESS_GTL = 6
"""
# in comparison with the manual and the pyvisa constants
```
%% Output
'\nVI_GPIB_REN_DEASSERT = 0\nVI_GPIB_REN_ASSERT = 1\nVI_GPIB_REN_DEASSERT_GTL = 2\nVI_GPIB_REN_ASSERT_ADDRESS = 3\nVI_GPIB_REN_ASSERT_LLO = 4\nVI_GPIB_REN_ASSERT_ADDRESS_LLO = 5\nVI_GPIB_REN_ADDRESS_GTL = 6\n'
%% Cell type:code id:9f123901-72cb-46ca-bff7-82336e6f5fa1 tags:
```
python
k224
.
write
(
"
D0X
"
)
```
%% Output
5
%% Cell type:code id:4d4cbcef-908f-4cd0-89be-790fccb51cb3 tags:
```
python
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment