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

2 次查看(过去 30 天)
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.

回答(1 个)

Walter Roberson
Walter Roberson 2016-11-21

类别

Help CenterFile Exchange 中查找有关 Instrument Control Toolbox Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by