Download Model GPIB-MAC User Manual

Transcript
0 National Instruments
November 1985
tbox(
llCan
not
SetVOl”)
;
continue;
if ( FSOpen( reply.fName, reply.vRefNum, &refNum)) (
tbox("Can't open file");
continue;
/* get end of file l /
if ( rc = GetEOF( refNum, &logEOF)) 1
tbox("Can't find EOF");
continue:
printf("EOF = %ld.\n", logEOF);
/* get buffer for file l /
s = NewPtr( logEOF);
if ( s == NULL){
tbox("File size too large for memory"):
continue:
/* read file into buffer */
if ( FSRead( refNum, blogEOF, s)) (
tbox("Could not read file.");
continue;
printf("Bytes read into buffer = %ld\n". logEOF);
FSClose( refNum);
/* don't need input file now l /
send( s, logEOF, ref0ut);
/* release buffer l /
DisposPtr( s);
puts("Waiting for any response from device.");
for{ pause=TickCountO+30; TickCount < pause;)
showIn( refIn);
SFGetFile(pass(where), ““, OL, 1, typelist. OL, breply);
send( s, logEOF,
char *s;
long logEOF;
short ref0ut;
refOut )
unsigned short loops = 1;
puts("# loops: “1;
scanf("%hd" , &loops);
printf( "--Total bytes to send= %ld bytes--\n", logEOF*loopsl;
while ( loops--)(
FSWrite( refOut, 6logEOF. s);
/* send file */
130
APPENDIX I - SERIAL PORT SAMPLE PROGRAM