54 Programming Examples
SR620 Universal Time Interval Counter
/* if number is negative add 1 to get 2's complement and change sign */
if (sign)fdata[i] = -1.0 * (fdata[i] + 1.0);
/* now multiply by conversion factor */
fdata[i]
=
factors[mode] * fdata[i];
if (expd) fdata[i] = fdata[i]*1.0E-3; /* reduce by 1000 if expand is on */
}
}
/* ******************************************************************* */
void InitGpib (void) /* initialize the CEC GPIB card as controller */
{
int my_address, system_controller;
unsigned seg;
/* find cec card address */
for ( seg=0x4000 ; seg < 0xF000 ; seg += 0x400 )
{
if ( (peek (seg,50) == 'C') &&
(peek (seg,51) == 'E') &&
(peek (seg,52) == 'C') )
break;
}
if ( pc488_seg(seg))
{
printf ( " no gpib card installed\n");
exit(0);
}
my_address = 21;
system_controller = 0;
initialize (&system_controller, &my_address);
transmit (&status, "IFC UNT UNL DCL REN");
}
/* ********************************************************************* */
void TalkGpib ( int address) /* makes device at address a talker */
{
char cmd[25];
sprintf (cmd,"UNT UNL MLA TALK %d",address);
transmit (&status,cmd);
StatCheck (address);
}
/* ********************************************************************* */
void TxGpib (address,command)
/* transmit command to address */
int address;
char *command;
{
char t_string[150];
int result;
result = sprintf (t_string,"UNT UNL MTA LISTEN %d DATA '%s' END",
address,command);
transmit (&status, t_string);
StatCheck (address);
}
Содержание SR620
Страница 2: ...SR620 Universal Time Interval Counter...
Страница 6: ...iv Table of Contents SR620 Universal Time Interval Counter...
Страница 8: ...vi Safety and Preparation for Use SR620 Universal Time Interval Counter...
Страница 12: ...x Specifications SR620 Universal Time Interval Counter...
Страница 58: ...42 Programming Commands SR620 Universal Time Interval Counter...
Страница 72: ...56 Programming Examples SR620 Universal Time Interval Counter...
Страница 76: ...60 Troubleshooting Tips SR620 Universal Time Interval Counter...
Страница 82: ...66 Performance Test SR620 Universal Time Interval Counter...
Страница 90: ...74 Calibration Procedure SR620 Universal Time Interval Counter...
Страница 102: ...86 Circuit Description SR620 Universal Time Interval Counter...
Страница 124: ...108 Parts List SR620 Universal Time Interval Counter...