Programming Examples 55
SR620 Universal Time Interval Counter
/* ********************************************************************* */
void GetGpib (address) /* get an answer from device at address */
int address;
{
char r_string[40], temp[80];
sprintf (r_string, "UNT UNL MLA TALK %d", address);
transmit (&status, r_string);
StatCheck (address);
strcpy (temp, " ");
receive (&status, &length, temp);
StatCheck (address);
strcpy (recv, temp);
}
/* ******************************************************************** */
void StatCheck (address) /* check the gpib status and exit if error */
int address;
{
if (status != 0)
{
printf ("Error at device %d : status = %d",address,status);
exit (0);
}
}