VISA Instrument not Opening after error in script

4 views (last 30 days)
Dear all,
I have a Keysight scope an signal generator connected via USB to my PC and I have two scripts that will communicate to both devices via a VISA interface. Now if I run the scripts without error, the instruments can be opened, record or transmit data and closed.
However, if after the instrument was opened there is any kind of error in the script (NOT related to the VISA interface, let's say it is a syntax error when caling a function: instead of fft you write ftt), after the error is fixed and I try to re-run the script, the instrument will not open:
Error using icinterface/fopen (line 83)
Unsuccessful open: The specified configuration:
USB0::0x0000::0x0000::AAAAAAAA::0::INSTR is not available.
Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to
determine if other instrument objects are connected to the requested instrument.
I try to call a "fclose(visaObj)", but and I get the same result. Firthermore, the only way to solve this is to restart Matlab.
Does anybody has an idea how to solve this?
Kind regards,
Ion

Answers (0)

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!