Download Data Acquisition Programmer`s SDK

Transcript
Programmer’s SDK Manual
• Dependencies
di_open
di_ct_event
• Example
#include "200sdk.h"
int errcode;
unsigned bit_in;
char errstr[255];
main()
{
int i;
if(errcode = di_open()){
/* open the device for comm */
di_strerr(errcode,errstr);
printf("%s",errstr);
}
else
printf("Device installed successfully.....\n");
bit_in = 0;
/* use digital input bit 0 */
if(errcode = di_ct_event(bit_in)){ /* start event counting */
di_strerr(errcode,errstr);
printf("%s",errstr);
}
else
printf("Event counting started.....\n");
if(errcode = di_ct_stop()){
/* stop event counting */
di_strerr(errcode,errstr);
printf("%s",errstr);
}
else
printf("Event counting stopped.....\n");
di_close();
}
di_ct_wave
(not available on DI-400, DI-401, DI-410, DI-500, DI-510, DI-700, DI-720, DI-730, or
DI-5001 instruments)
• Summary
int di_ct_wave(bit_out, hi_factor, lo_factor);
unsigned bit_out; /* digital output bit(s) to be used as wave output */
unsigned hi_factor; /* waveform high width = (1µs * hi_factor) */
unsigned lo_factor; /* waveform low width = (1µs * lo_factor) */
Function Reference
59