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 个)
另请参阅
类别
在 Help Center 和 File 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!