![]() |
|
di_digout
is an immediate function that writes (outputs) a 16 bit value to the digital output port. Values and locations are device dependent.
unsigned di_digout(i); |
|
unsigned i; |
/* value to output to the digital out port */ |
i
is the 16-bit value to send to the digital out port. Values and locations are device dependent.
DI_NO_ERR | No error |
DI_OPENED_ERR | Device not opened |
DI_COMM_ERR | Communication error |
DI_DIGOUT_ERR | Digital output error |
The default state of the digital output bits is “High.” Values and locations of the digital input bits are device dependent.
#include "200sdk.h" |
|
char errstr[255]; |
|
int i; |
|
main() |
|
{ |
|
if(errcode = di_open()){ |
/* open the device for comm */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Device installed successfully.....\n"); |
|
i = 5; |
|
if(errcode = di_digout(i)){ |
/* output i to digital output port */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Digital output successful.....\n"); |
|
di_close(); |
|
} |
Copyright © DATAQ Instruments, Inc.