Download Maestro - Brown University Wiki

Transcript
MAESTRO-32® V6 (A65-B32)
WRITE(0,220) IROI,IBEGIN,IEND
220
FORMAT(‘ ROI # ‘,I3,’ START ‘,I6,’ STOP ‘,I6,)
C Add 2 to I to advance past the begin and end numbers
I=I+2
IROI=IROI+1
C Keep going until we run out of numbers
GO TO 200
1000 STOP
END
B.2.2. C Language:
/************************************************************/
/* Sample program compatible with Microsoft and Borland C */
/* to read header and channel data from a .CHN data file. */
/************************************************************/
#include <stdio.h>
#include <stdlib.h>
#define .CHN
-1
main(argc,argv)
int argc;
char *argv[];
{
char
acq_time[8], /* buffer for time, date */
month[4];
/* buffer for month string */
short
f_type;
/* .CHN file type */
unsigned short chan_offset, /* beginning channel number */
count,
/* loop counter */
mca_num,
/* MCA number */
num_chans,
/* no. of data channels */
num_writ,
/* no. of bytes written out */
segment,
/* segment number */
year,
/* acquisition year */
day,
/* acquisition day */
hour,
/* acquisition hour */
minute,
/* acquisition minute */
second,
/* acquisition second */
long int
livetime,
/* 20ms tics of livetime */
real_time,
/* 20ms tics of realtime */
chan_data;
/* stores channel data */
FILE
*f_pointer;
if ( argc != 2 )
{
printf("USAGE: readchn filename.chn\n");
exit(1);
}
162