Why does fclose() / instrreset cause MATLAB to hang when closing a VISA-USB object?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Réponses (1)
Voir également
Catégories
En savoir plus sur Instrument Control Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!