EasyManua.ls Logo

Stanford Research Systems PS310 - Page 22

Stanford Research Systems PS310
42 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
20
do
{
x += 10.0; /* increment output voltage level */
sprintf(vstr, "VSET %7.1f",x); /* make VSET command string */
TxGpib(ps300,vstr); /* send command */
TxGpib(ps300,"IOUT?"); /*query current */
GetGpib(ps300); /* into result string */
if (!(sscanf(result,"%f",&n)))
Statcheck(255);
/* print level */
printf ("Voltage = %f current = %f\n",x,n);
}
}
/* ****************************************************** */
TxGpib(address,command) /* transmit a command to addressed device */
int address;
char *command;
{
int status;
char t_string[80];
sprintf(t_string, "UNT UNL MTA LISTEN %d DATA '%s' 10",address,command);
transmit(&status, t_string);
Statcheck(status);
}
/* ****************************************************** */
GetGpib(address) /* get result string from addressed device */
int address;
{
char r_string[40], temp[80];
int length, status;
sprintf(r_string, "UNT UNL MLA TALK %d",address);
transmit(&status, r_string); /* make device a talker */
Statcheck(status);
strcpy(temp, " "); /* clear result string */
receive(&status, &length, temp); /* get answer */
Statcheck(status);
strcpy(result, temp); /* move answer into global result string */
}
/* ****************************************************** */
Statcheck(status) /* check GPIB status */
int status;
{
if (status)
{
printf("GPIB error: status = %d",status);
exit();
}
}

Table of Contents

Related product manuals