Sorensen MML Series Operation and Programming Manual
6-2
}
static char rxBuf[ 64 ]
static void Niread( int pad, char *queryStr )
{
char cmd[ 4 ];
Niwrite( pad, queryStr );
cmd[ 0 ] = UNL;
cmd[ 1 ] = UNT;
cmd[ 2 ] = TA + pad;
cmd[ 3 ] = MLA;
//
ibcmd( bd, cmd, 4 );
ibrd( bd, rxBuf, sizeof( rxBuf ) - 1 );
rxBuf[ ibcnt ] = ‘ \0 ’;
ibcmd( bd, cmd, 2);
}
void main( )
{
setNi( 0, “GPIB” );// Sets the status of PC’s GPIB CARD. //
Niread( 8, “*IDN?” );// Reads back indentity code of MML-4.
cout << rxBuf << “ \n\r ”;
// Displays on the screen of PC.
//
Niwrite( 8, “CHAN 1” );// Sets CHANNEL as 1.
//
Niread( 8, “CHAN:ID?” ); // Reads back identity code of channel
1.cout << rxBuf << “ \n\r ”;// Displays on the screen of PC.
//
Niwrite( 8, “MODE CCL” ); // Sets CHANNEL 1 MODE as CCL.Niwrite (
8, “CURR:STATIV:L1 1” ): // Sets L1 current of CCL as 1A.
//
Niread( 8, “LOAD ON” ); // Starts sinking current.
//
Niread( 8, “MEAS:VOLT?” ); // Measures the readings of voltage.
cout << rxBuf << “ \n\r ”; // Displays on the screen of PC.
//
Niread( 8, “MEAS:CURR?” ); // Measures the readings of current.
cout << rxBuf << “ \n\r ”; // Displays on the screen of PC.
Niread( 8, “LOAD OFF” ); // Stops sinking current.
//
ibsic ( bd );
ibon1( bd, 0 );
ibsre ( bd, 0 );
}
For the above example, please refer to Chapter 3, and add corresponding commands
according to settings and controls.
Artisan Scientific - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisan-scientific.com
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com