ADLINK ACL-8216 User Manual

Page 52

Advertising
background image

44 C/C++ Library

5.4 _8216_DI

@ Description

This function is used to read data from digital input port. There are 16
bits of digital input on the ACL-8216. The bit 0 to bit 7 are defined as
low byte and the bit 8 to bit 15 are defined as the high byte.

@ Syntax

int _8216_DI( int port_number, unsigned char *data )

@ Argument

port_number:

To indicate which port is read,

DI_LOW_BYTE
or

DI_HIGH_BYTE.

DI_LOW_BYTE: bit 0 ~ bit 7,

DI_HIGH_BYTE: bit8 ~ bit15

data:

return value from digital port.

@ Return Code

ERR_NoError
ERR_BoardNoInit
ERR_PortError

@ Example

See demo program 'DI_DEMO.C'

5.5 _8216_DI

_Channel

@ Description

This function is used to read data from digital input channels (bit).
There are 16 digital input channels on the ACL-8216. When performs
this function, the digital input port is read and the value of the
corresponding channel is returned.

* channel means each bit of digital input ports.

@ Syntax

int _8216_DI(int di_ch_no, unsigned int *data )

@ Argument

di_ch_no:

the DI channel number, the value has

to be set

from 0 to 15.

data:

return value, either 0 or 1.

@ Return Code

ERR_NoError
ERR_BoardNoInit
ERR_InvalidDIChannel

@ Example

#include "8216.h"

Advertising