MATLAB: Do the VISA objects remain in remote mode after FCLOSE is called for the Instrument Control Toolbox

gpibicictInstrument Control Toolboxinstrumentsmodes

I am using the following code:
g = visa('ni','GPIB0::1::INSTR','SecondaryAddress', 96);
fopen(g);
fprintf(g,'*IDN?');
idn = fscanf(g);
fclose(g);
out = instrhwinfo('visa','ni')
Based on the output generated by this code, I notice that my object does not revert to local mode after FCLOSE is executed:
out =
AdaptorDllName: [1x81 char]
AdaptorDllVersion: 'Version 2.3'
AdaptorName: 'NI'
AvailableChassis: []
AvailableSerialPorts: {2x1 cell}
InstalledBoardIds: 0
ObjectConstructorName: {3x1 cell}
SerialPorts: {2x1 cell}
VendorDllName: 'visa32.dll'
VendorDriverDescription: 'National Instruments VISA Driver'
VendorDriverVersion: 3.0100
I would not expect my device to remain in remote mode after FCLOSE is executed.

Best Answer

This is the expected behavior for the Instrument Control Toolbox in that MATLAB defers to what the VISA library chooses to do when closing a session. There are no workarounds.
Related Question