ADLINK ACL-8112 Series User Manual

Page 67

Advertising
background image

C Language Library

• 59

7.5

_8112_DO

Description

This function is used to write data to the digital output port. There are
16 digital outputs on the ACL-8112, they are divided into two categories,
DO_LO_BYTE and DO_HI_BYTE. Channel 0 to channel 7 is defined
as the DO_LO_BYTE port and channels 8 to 15 are defined as the
DO_HI_BYTE port.

Syntax

int _8112_DO(int port_number, unsigned char data )
int _8112pg_DO(int port_number, unsigned char data )

Argument:

port_number:

DO_LO_BYTE or DO_HI_BYTE

data:

value will be written to digital output port

Return Code:

ERR_NoError
ERR_BoardNoInit
ERR_PortError

Example:

#include “8112.h”

main()
{

_8112_Initial( CARD_1, A8112B_DG, 0x220 );

/* Assume NoError when Initialize ACL-8112/DG ver.B
card */
.
.

_8112_DO( DO_LO_BYTE , 0x55 );

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


_8112_DO( DO_HI_BYTE , 0xAA );

printf( "The high byte is now 0xAA.\n" );


}

A more detailed program is provided in this software
'DO_DEMO.C'

Advertising