ADLINK ACL-8112 Series User Manual
Page 66

58 • C Language Library
7.4 _8112_DI
_Channel
Description
This function is used to read data from the digital input channels (bit).
There are 16 digital input channels on the ACL-8112. When performing
this function, the digital input port is read and the value of the
corresponding channel is returned.
* channel means each bit of the digital input ports.
Syntax
int _8112_DI_Channel(int di_ch_no, unsigned int
*data )
int _8112pg_DI(int di_ch_no, unsigned int *data )
Argument:
di_ch_no:
the DI channel number, the value is
between from 0 to 15.
data:
return value, either 0 or 1.
Return Code:
ERR_NoError
ERR_BoardNoInit
ERR_InvalidDIChannel
Example:
#include “8112.h”
main()
{
unsigned int data;
int ch;
_8112_Initial( CARD_1, A8112B_HG, 0x220 );
/* Assume NoError when Initialize ACL-8112 */
.
.
for( ch=0; ch<16; ch++ )
{
_8112_DI_Channel( ch , &data );
printf( "The value of DI channel %d is
%d.\n" , ch , data );
}
}