![]() |
|
The di_stop_scan
function stops scanning.
int di_stop_scan(void);
none
DI_NO_ERR | No error |
DI_OPENED_ERR | Device not opened |
DI_COMM_ERR | Communication error |
DI_START_SCN_ERR | Stop scan error |
none
#include "200sdk.h" |
|
int errcode; |
|
#define IDIM 256; |
/* largest value allowed */ |
struct di_inlist_struct inlist[IDIM] = {0}; |
/* input list cleared */ |
struct di_mode_struct mode = {0}; |
/* mode structure */ |
char errstr[255]; |
|
int * input_buffer; |
|
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"); |
|
inlist[0].chan = 5; |
/* channel 5 */ |
inlist[0].diff = 0; |
/* single ended */ |
inlist[0].gain = 0; |
/* gain of 1 */ |
inlist[0].unipolar = 0; |
/* bipolar */ |
inlist[0].ave = 0; |
/* averaging off */ |
inlist[0].counter = 100; |
/* init counter */ |
di_list_length (IDIM, 0); |
|
if(errcode = di_inlist(inlist)){ |
/* initialize the input list */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Input list initialized.....\n"); |
|
mode.mode = 1; |
/* analog triggering enabled */ |
mode.trig_level = 0; |
/* trigger on zero crossing */ |
mode.trig_slope = 0; |
/* trigger on positive slope */ |
mode.trig_pre = 0; |
/* no pre-trigger samples desired */ |
mode.trig_post = 0; |
/* no post-trigger samples desired */ |
if(errcode = di_mode(mode)){ |
/* set mode */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Mode set.....\n"); |
|
input_buffer = di_buffer_alloc (0, 4096); |
|
if(errcode = di_start_scan()){ |
/* start scanning */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Scanning started.....\n"); |
|
if(errcode = di_stop_scan()){ |
/* stop scanning */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Scanning stopped.....\n"); |
|
di_close(); |
|
} |
Copyright © DATAQ Instruments, Inc.