MATLAB: Do I receive an error “GPIB: NI: GPIB board is not Controller-In-Charge and is not properly addressing itself” when working with Instrument Control Toolbox

Instrument Control Toolbox

I am trying to work with GPIB instruments through an NI board. Defining and opening the connection appears to work fine:
g = gpib('ni', 0, 0);
fopen(g);
But when I try to send a command the the device:
fprintf(g,'SOMECOMMAND');
I receive an error: ERROR: Error using icinterface/fprintf (line 147) GPIB: NI: GPIB board is not Controller-In-Charge and is not properly addressing itself.

Best Answer

This error is usually an indication that there is a conflict between primary addresses of the GPIB board and the instrument which you are trying to communicate with. Please configure your GPIB board to work with primary address 0 and the instrument to use any free primary address other than 0 (e.g. 1).