Agilent Technologies E1465A Automobile Parts User Manual


 
46 Using the Matrix Modules Chapter 3
/*
Enter from matrix module
*/
error_handler (IOENTERS (MATRIX, into, &length), "ENTER command");
printf("Print the errors: %s",into);
return;
}
int error_handler (int error, char *routine)
{
char ch;
if (error != NOERR)
{
printf ("\n Error %d %s \n", error, errstr(error));
printf (" in call to GPIB function %s \n\n", routine);
printf ("Press 'Enter' to exit: ");
scanf ("%c", &ch);
exit(0);
}
return 0;
}
Synchronizing Matrix Modules
This section gives guidelines to synchronize matrix modules with
measurement instruments.
Example:
Synchronizing a
Matrix Module
(BASIC)
This BASIC example program shows how to synchronize matrix modules
with measurement instruments. In this example, a matrix module switches a
signal to a multimeter. The program verifies that the channel is closed before
the multimeter begins its measurement.
10 OUTPUT 70915; "*RST"
! Reset the module
20 OUTPUT 70915; "CLOS (@10012)"
! Close a channel
30 OUTPUT 70915; "*OPC?"
! Wait for operation complete
40 ENTER 70915; Opc_value
50 OUTPUT 70915; "CLOS? (@10012)"
!Test that the channel is closed
60 ENTER 70915;A
70 IF A=1 THEN
80 OUTPUT 70903;"MEAS:VOLT:DC?"
! When channel is closed,
measure the voltage
90 ENTER 70903; Meas_value
100 PRINT Meas_value
! Print the measured value
110 ELSE
120 PRINT "Channel did not close"
130 END IF
140 END