Rohde-Schwarz / RsInstrument

RsInstrument is a Python remote-control communication module for Rohde & Schwarz SCPI-based Test and Measurement Instruments.
MIT License
72 stars 16 forks source link

send_file_from_pc_to_instrument() function runs into timeout error #16

Closed chrisu-mi closed 5 months ago

chrisu-mi commented 6 months ago

When running the following code, I get a timeout error:

Instrument = RsInstrument(visaResourceAddr, True, False) Instrument.visa_timeout = 5000 # Timeout for VISA Read Operations Instrument.opc_timeout = 5000 # Timeout for opc-synchronised operations Instrument.instrument_status_checking = True # Error check after each command Instrument.clear_status() Instrument.send_file_from_pc_to_instrument(filepath, '/INT/SETTINGS/setup.set')

Traceback (most recent call last): ... RsInstrument.Internal.InstrumentErrors.StatusException: 'TCPIP0::192.168.1.10::inst0::INSTR': Query '*STB?' - VISA Timeout error occurred (5000 milliseconds) and ... Instrument error detected: -101,"Invalid character"

But the file gets transferred, so when I apply error handling with try:/except:..closing the current session and reopening a new one I can remotely load the transferred setup-file with no problem.

Miloslav-RS commented 6 months ago

Hi chrisu-mi, sorry for the late answer. What instrument are you communicating with?

chrisu-mi commented 6 months ago

Hi Miloslav, i am using a RTM3004 with the latest firmware update applied 2 weeks ago.

Miloslav-RS commented 6 months ago

Hi Chrisu-mi, with the RTM3004, try this constructor: Instrument = RsInstrument(visaResourceAddr, True, False, options='AddTermCharToWriteBinBlock=True')

Miloslav-RS commented 5 months ago

I hope that helped, Chrisu-mi, if not, please reopen the issue.

chrisu-mi commented 5 months ago

@Miloslav-RS Thanks for your help, it works like this!