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

[WIP] pyVISA backend #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

[WIP] pyVISA backend #10

wants to merge 5 commits into from

Conversation

gribeill
Copy link

Replace NI c library backend with pure-python pyvisa-py.

Still a WIP as I occasionally get strange PyCall errors, but the basic functionality should be there. Use at your own risk!

@gribeill gribeill changed the title :WIP: pyVISA backend [WIP] pyVISA backend Apr 16, 2019
@matthewware
Copy link
Collaborator

Could we write up some doc on configuring the Conda.jl environment? I'm having some issues getting this to work on some environments? I'll chat with you tomorrow.

@gribeill
Copy link
Author

Yeah it seems to only work with some very specific combinations of python and conda. I keep getting python TypeErrors which I am very confused by... hence the WIP :)

@catosp
Copy link

catosp commented Apr 17, 2019

Well, i tried on my work computer, but i cannot see the GPIB devices, i cannot connect to serial device:

(v1.1) pkg> add Conda
Updating registry at C:\Users\Adrian\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
Resolving package versions...
Installed GR ─ v0.39.1
Updating C:\Users\Adrian\.julia\environments\v1.1\Project.toml
[8f4d0f93] + Conda v1.2.0
Updating C:\Users\Adrian\.julia\environments\v1.1\Manifest.toml
[28b8d3ca] ↑ GR v0.39.0 ⇒ v0.39.1
Building GR → C:\Users\Adrian\.julia\packages\GR\KGODl\deps\build.log

(v1.1) pkg> add Instruments#master
Cloning git-repo https://github.com/BBN-Q/Instruments.jl.git
Updating git-repo https://github.com/BBN-Q/Instruments.jl.git
Resolving package versions...
Updating C:\Users\Adrian\.julia\environments\v1.1\Project.toml
[2c6aeda0] ~ Instruments v0.1.0 #master (https://github.com/BBN-Q/Instruments.jl.git) ⇒ v0.1.0 #master (https://github.com/BBN-Q/Instruments.jl.git)
Updating C:\Users\Adrian\.julia\environments\v1.1\Manifest.toml
[2c6aeda0] ~ Instruments v0.1.0 #master (https://github.com/BBN-Q/Instruments.jl.git) ⇒ v0.1.0 #master (https://github.com/BBN-Q/Instruments.jl.git)
Building Instruments → C:\Users\Adrian\.julia\packages\Instruments\6mCPT\deps\build.log

julia> using Instruments
[ Info: Precompiling Instruments [2c6aeda0-45f5-11e9-10ba-f7b3d6416888]

julia> rm = ResourceManager()
0x00001001

julia> instruments = find_resources(rm)
1-element Array{String,1}:
"ASRL1::INSTR"

julia> uwSource = GenericInstrument()
GenericInstrument(0x00000000, false, 0x00000400)

julia> connect!(rm, uwSource, "ASRL1::INSTR")
ERROR: VISA C call failed with status VI_ERROR_RSRC_BUSY: The resource is valid, but VISA cannot currently access it.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] check_status(::Int32) at C:\Users\Adrian.julia\packages\Instruments\6mCPT\src\visa\VISA.jl:104
[3] #viOpen#1(::UInt32, ::UInt32, ::Function, ::UInt32, ::String) at C:\Users\Adrian.julia\packages\Instruments\6mCPT\src\visa\VISA.jl:154
[4] viOpen at C:\Users\Adrian.julia\packages\Instruments\6mCPT\src\visa\VISA.jl:153 [inlined]
[5] connect!(::UInt32, ::GenericInstrument, ::String) at C:\Users\Adrian.julia\packages\Instruments\6mCPT\src\instrument.jl:12
[6] top-level scope at none:0

julia>

@catosp
Copy link

catosp commented Apr 17, 2019

I tried to use pyVisa-py in python 3.7 and the same results: i cannot see gpib devices.
Then i installed gpib_ctypes.
Then i added this line in python code:
from gpib_ctypes import make_default_gpib
and after this i wrote this line:
make_default_gpib()
and now i can see the gpib devices (only python) but i cannot se the usb devices.

@matthewware
Copy link
Collaborator

@catosp I would stick with the NI back end for now if it's working for you. We're still trying to figure out a configuration that works with all systems.

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