I am receiving this error in Python 2.7 when trying to query my device (oscilloscope) using SCPI commands to obtain a screen capture.
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 10: ordinal not in range(128)
Here is the relevant line of code as well as the traceback:
InfiniiVision.query(":DISPlay:DATA? PNG, COLor")
#Traceback
File "C:/Users/William/Desktop/example3.py", line 334, in <module>
InfiniiVision.query(":DISPlay:DATA? PNG, COLor")
File "C:\ProgramData\Anaconda2\lib\site-packages\pyvisa\resources\messagebased.py", line 407, in query
return self.read()
File "C:\ProgramData\Anaconda2\lib\site-packages\pyvisa\resources\messagebased.py", line 332, in read
message = self.read_raw().decode(enco)
I have looked at other forums and have seen that the encoding/decoding is the root of the error, however have only just started programming in Python and am still lost about how to encode or decode into the correct data type (which I don't even know what it is supposed to be).