ADLINK ACL-8216 User Manual

Page 53

Advertising
background image

C/C++ Library 45


main()
{
unsigned int data;
int ch;

_8216_Initial( CARD_1, 0x220 );
/* Assume NoError when Initialize ACL-8216 */
for( ch=0; ch<16; ch++ )
{

_8216_DI_channel( ch , &data );
printf( "The value if DI channel %d is
%d.\n" , ch , data );
}
}

5.6 _8216_DO

@ Description

This function is used to write data to digital output ports. There are 16
digital outputs on the ACL-8216, they are divided by two ports,
DO_LOW_BYTE and DO_HIGH_BYTE. The channel 0 to channel 7
are defined in DO_LOW_BYTE port and the channel 8 to channel 15
are defined as the DO_HIGH_BYTE port.

@ Syntax

int _8216_DO(int port_number, unsigned char data )

@ Argument

port_number: DO_LOW_BYTE or DO_HIGH_BYTE

data:

value will be written to digital

output port

@ Return Code

ERR_NoError
ERR_BoardNoInit
ERR_PortError

@ Example

#include "8216.h"
main()
{
_8216_Initial( CARD_1, 0x220 );
/* Assume NoError when Initialize ACL-8216 */

_8216_DO( DO_LO_BYTE , 0x55 );
printf( "The low byte is now 0x55.\n" );

_8216_DO( DO_HI_BYTE , 0xAA );

Advertising