Pyvisa

Probleme bei der Installation?
Antworten
fabritiojames
User
Beiträge: 2
Registriert: Donnerstag 6. September 2018, 22:10

Hallo zusammen,

ich möchte den GPIB über Visual Studio Code & Anaconda einrichten, aber ich kriege das nicht zum laufen! Der Fehlermeldung heißt
"AttributeError: module "visa" has not attribute "resourceManager" .
Die Bibliotek von Pyvisa sind schon sauber installiert.
Könnte jemand mir bitte helfen?

Ich würde mich auf nette Rückmeldungen freuen :).
Vielen Dank
Sirius3
User
Beiträge: 18370
Registriert: Sonntag 21. Oktober 2012, 17:20

Ohne zu wissen, was Du konkret gemacht hast, kann man da schlecht helfen. Zeige den Code, die komplette Fehlermeldung, und was `print(visa.__file__)` ausgibt.
fabritiojames
User
Beiträge: 2
Registriert: Donnerstag 6. September 2018, 22:10

Danke erstmal für Ihre Rückmeldung.

import numpy as np
import pandas as pd
import visa, time
rm = visa.ResourceManager()
rm.list_resources()
my_instrument = rm.open_resource('GPIB0::24::INSTR') #String noch ersetzen
print(my_instrument.query('*IDN?'))
print(rm)

Der GPIB Treiber sind sauber installiert und die Fehlermeldung nach dm Debug heißt "AttributeError: module "visa" has not attribute "resourceManager"
--------------------------------------------------------------------------------------------------------------------------------------------------
Bei diesem Beispiel, ist den Begriff "Visa" auf den zweite Line unterschrieben (rot makiert)

import visa
ps = visa.Instrument("GPIB::Address of your instrument")

Danke .
Benutzeravatar
__blackjack__
User
Beiträge: 14328
Registriert: Samstag 2. Juni 2018, 10:21
Wohnort: 127.0.0.1
Kontaktdaten:

@fabritiojames: Und was wird ausgegeben wenn Du gleich nach den Importen das von Sirius3 angefragte ``print(visa.__file__)`` einfügst?
„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
Antworten