Filter löschen
Filter löschen

Why does fclose() / instrreset cause MATLAB to hang when closing a VISA-USB object?

2 Ansichten (letzte 30 Tage)
I am controlling both a Thorlabs optic power meter over visa-usb and a Newport motor controller over serial.
USB:
pmAddress = 'USB0::0x1313::0x8078::P0008339::INSTR';
pm100d = visa('ni',pmAddress);
fopen(pm100d);
... communicate with instrument ...
fclose(pm100d);
delete(pm100d);
clear pm100d;
instrreset;
SERIAL:
gSmc = serial('com3','BaudRate',9600,'DataBits',8,'Parity','None','Terminator','LF');
fopen(gSmc);
... send commands ...
fclose(gSmc);
delete(gSmc);
clear gSmc;
instrreset;
In the serial case, everything works as intended. In the USB case, fclose() causes MATLAB to hang. I can't ctrl-c the process, and I can't do anything to resolve the problem except forcing MATLAB to quit.
I tried using instrreset instead and the same problem happens for the VISA-USB object.
What could be causing this?
Thanks for your help.

Antworten (1)

Walter Roberson
Walter Roberson am 21 Nov. 2016

Kategorien

Mehr zu Instrument Control Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by