![]() |
|
di_digin
is an immediate function that reads a 16-bit value from the digital input port. Values and locations are device dependent.
unsigned di_digin(void);
none
The function returns two bytes from the digital input port.
The default state of the digital input bits is “High.” Values and locations of the digital input bits are device dependent.
#include "200sdk.h" |
|
int i; |
|
char errstr[255]; |
|
main() |
|
{ |
|
if(errcode = di_open()){ |
/* open the device for comm */ |
di_strerr(errcode,errstr); |
|
printf("%s",errstr); |
|
} |
|
else |
|
printf("Device installed successfully.....\n"); |
|
i = di_digin(); |
/* read digital input port */ |
printf("Digital input port = %04X\n",i); |
|
di_close(); |
|
} |
Copyright © DATAQ Instruments, Inc.