AttributeError: 'GPIBInstrument' object has no attribute 'flush'
See original GitHub issueProblem
The flush()
method cannot be called on a GPIBInstrument
object
I can do this from Labview, and the official NI VISA documentation says that viFlush() is valid for the following resource classes: GPIB INSTR
, GPIB INTFC
, Serial INSTR
, TCPIP INSTR
, TCPIP SOCKET
, VXI INSTR
, VXI SERVANT
From looking at the pyvisa code, it appears as though the only resource class that has flush()
implemented is asynchronous serial.
Steps to reproduce
import visa
rm = visa.ResourceManager()
session = rm.open_resource('GPIB0::5::INSTR')
session.flush()
returns this error:
Traceback (most recent call last):
session.flush(0b00100000)
AttributeError: 'GPIBInstrument' object has no attribute 'flush'
Proposed fix
Implement flush()
by calling viFlush()
within the GPIBInstrument
class, and any other objects in the list above where it’s safe to be called.
If you’d like that in the form of a pull request I can handle that, but wanted to ensure that this is indeed a bug and not a mis-interpretation on my end.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
'GPIBInstrument' object has no attribute 'ask' - Stack Overflow
I am now using python to get data from lock in amplifer with GPIB and met a ... Error report; AttributeError: 'GPIBInstrument' object...
Read more >AttributeError: 'NoneType' object has no attribute 'flush'
someon knows why i have that error, Warning (from warnings module): File ... AttributeError: 'NoneType' object has no attribute 'flush'.
Read more >PyVISA Documentation - Read the Docs
In this case, I have a GPIB instrument with instrument number 14, so I create the instance. (i.e. variable) called my_instrument accordingly ...
Read more >Stream Object has no attribute flush - Google Groups
I came up with a problem when i run my program in another Linux environment, it seems that i haven't installed something. I...
Read more >Instruments — PyVISA 1.5 documentation - Read the Docs
For this, have a look at the specialised classes like GpibInstrument (section Common ... The class Instrument defines the following methods and attributes:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
VXI is not widely used with PyVISA (at least I never heard of anybody using it), so it is fine to skip the implementation.
Nice, thanks!