39
if ( FS700=ibfind("loran"))<=0 ) {
/* Find Device */
printf("Cannot Find Device LORAN\n");
exit(0);
}
ibwrt (FS700,"*STB?",5);
/* reads status byte */
ibrd (FS700,tstr,20);
/* read answer */
tstr[ibcnt] = 0;
/* terminate string */
sscanf (tstr,"%d",&i);
/* convert answer to integer */
if ( i & 3)
/* searching or locked ? */
{
printf ("Already searching\n");
exit (0);
}
ibwrt(FS700,"GRIP 99400",10);
/* set GRI to west coast USA */
ibwrt(FS700,"AUTO 0",6);
/* Set set search mode to MANUAL */
ibwrt(FS700,"STRT",4);
/* start search */
ibwrt(FS700,"GRIP?",5);
/* Query GRI Level */
ibrd(FS700,tstr,20);
tstr[ibcnt]=0;
/* Terminate Received String */
printf("GRI = %s\n",tstr);
printf("Program Executed Normally\n");
}