Sample Program 4 - Qbasic Example For Ruska 7750I - Fluke RUSKA 7750i User Manual

Air data test set
Table of Contents

Advertisement

/* write_7000_serial : write a string to the correct 7750
/*--------------------------------------------------------------------*/
void write_7000_serial (char *s)
{
if (address == -1)
serial_write (CLEAR);
else
{ serial_write (DLE);
serial_write (address + 0x20);
}
while (*s)
serial_write (*s++);
}
/*--------------------------------------------------------------------*/
/* request_7000_serial : write a commmand and read the response
/*--------------------------------------------------------------------*/
int request_7000_serial (char *s)
{
int i;
char ch;
clock_t start, current;
write_7000_serial (s);
i = 0;
while (i < QUEUE_SIZE - 1)
{ start = clock ( );
while (inq_in == inq_out)
ch = inqueue[inq_out++];
if (inq_out == QUEUE_SIZE)
if (ch == 0x0A)
else
}
buffer[QUEUE_SIZE - 1] = 0;
return FALSE;
}
/*--------------------------------------------------------------------*/
Sample Program 4 — QBASIC Example for RUSKA 7750i
REM $INCLUDE: 'C:\GPIB-PC\QBDECL.BAS'
DIM READING AS STRING*30
CALL IBDEV(0,4,0,12,1,&H40A,R7010%)
CALL IBCLR(R7010%)
CALL IBWRT(R7010%,"MEAS?" + chr$(&H0A))
CALL IBRD(R7010%,READING$)
PRINT READING$
CALL IBONL(R7010%,0)
END
Note: EOM & EOS are linefeed
{ current = clock ( );
if (current < start)
current += CLK_TCK * 86400;
if (current - start > TIMEOUT)
{ buffer[i] = 0;
return FALSE;
}
}
inq_out = 0;
{ buffer[i] = 0;
return TRUE;
}
buffer[i++] = ch;
/* Disable Addressing */
/* Enable Addressing */
/* Address */
/* Write string */
/* Write Command */
/* Wait for a character */
/* Check for timeout */
/* Put character in buffer */
/* Line Feed? - End of response */
/* Buffer full */
5
Remote Operation
Sample Programs
*/
*/
5-17

Advertisement

Table of Contents
loading

Table of Contents