
Software
R&S
®
TS-PSAM
30
User Manual 1142.9878.12 ─ 12
static void runMuTest ( void );
static void runDmmTest ( void );
/* FUNCTION *****************************************************************/
/* loads the driver and runs the test
*****************************************************************************/
int main(int argc, char *argv[])
{
printf("Use of driver functions\n\n");
/* open a session to the device driver */
sta = rspsam_InitWithOptions(resDesc, VI_TRUE, VI_TRUE, "Simulate=0", & vi);
/* check return value */
chk ("rspsam_InitWithOptions");
if (VI_SUCCESS == sta)
{
runMuTest();
runDmmTest();
/* close the driver */
sta = rspsam_close(vi);
chk ("rspsam_close");
}
printf("\nPress 'Enter' to terminate\n");
getchar();
return 0;
}
/* FUNCTION *****************************************************************/
/* checks the return status of a driver call
*****************************************************************************/
static void chk ( char * funcName )
{
if ( sta != VI_SUCCESS )
{
char errorMessage[256];
rspsam_error_message(vi, sta, errorMessage);
printf ("%s returned 0x%08X; %s\n", funcName, sta, errorMessage);
}
}
/* FUNCTION *****************************************************************/
/* configures a test using MU and DCS separately
*****************************************************************************/
Programming Example