DavidLutton / LabToolkit

Python module for instrument control and automation.
MIT License
20 stars 4 forks source link

Error while running "python setup.py install" #5

Closed adityabharadwaj14 closed 4 years ago

adityabharadwaj14 commented 4 years ago

Description

I was using this module to interface with HP3478A over GPIB-USB-HS cable.

While running "sudo python setup.py install" the following error showed up. Screenshot from 2019-12-19 16-54-49

when i tried to import LabToolkit , it gave these same errors. Have i done something wrong in the installation or can this be solved.

DavidLutton commented 4 years ago

Nothing wrong, it is just that, I have written this library to be Python >3.6 compatible

PEP 3102 -- Keyword-Only Arguments were first supported by Python 3.0

A further issue is that I have not written a driver for this HP 3478A the class in LabToolkit /DigitalMultimeter is a place holder at present

For programming commands you are after 03478-90009.pdf Page 43 to 70 where you can skip the status byte, SRQ and SPOLL until you have need of it The examples are in the document are in BASIC

Where in BASIC: 10 OUTPUT 723; "F1R1"
20 ENTER 723; A$
30 DISP $A
In Python 3 import visa
rm = visa.ResourceManager('')
inst = rm.open_resource('GPIB0::23::INSTR', read_termination='\n', write_termination='\n')
inst.write('F1R1')
a = inst.read()
print(a)

or import visa
rm = visa.ResourceManager('')
inst = rm.open_resource('GPIB0::23::INSTR', read_termination='\n', write_termination='\n')
a = inst.query('F1R1')
print(a)

In Python 2, if you must use it with its limited support life, you drop the brackets on the print statements

Good luck