Section 9: Keithley External Control Interface (KXCI)
Model 4200A-SCS Parameter Analyzer Reference Manual
9-56
4200A-901-01 Rev. C / February 2017
Waiting for SRQ
Instead of serial polling the 4200A-SCS to detect an SRQ, you can monitor the service request line.
When an SRQ occurs, the SRQ line goes true. You can use the following C language programming
routine to hold up program execution until an SRQ occurs.
send(addr, "DR1", &status);
while(!srq());
The first statement enables service request for data ready. The second command holds up program
execution until the SRQ (data ready) occurs.
Sample programs
Three sample programs (using the C language) are provided to demonstrate system control using an
external computer communicating through GPIB. For these programs, configure KXCI as follows:
•
GPIB address
: 17
•
Delimiter
: Comma
•
EOI
: Off
Program 1: VAR1 and VAR2 sweep (system mode)
The following program demonstrates how to program the 4200A-SCS to perform a VAR1 and VAR2
sweep. It assumes that channels 1 through 4 of the KXCI are configured for the SMU function.
MAXLEN = 2048;
addr = 17;
// Initialize card:
initialize(10, 0);
// Set speed to 0.01 PLC, clear buffer, and
// enable service request for data ready:
send(addr, "IT1 BC DR1",&status);
// Channel definition for SMU1; constant common:
send(addr, "DE CH1,'VE','IE',3,3", &status);
// Define SMU2 for VAR2 I sweep:
send(addr, "CH2,'VB','IB',2,2", &status);
// Define SMU3 for VAR1 V sweep:
send(addr, "CH3,'VC','IC',1,1", &status);
// Define SMU 4 to be off:
send(addr, "CH4", &status);
// Define V-sources and V-meters to be off:
send(addr, "VS1;VS2;VM1;VM2", &status);