Functions > di_digin

Syntax 

di_digin is an immediate function that reads a 16-bit value from the digital input port. Values and locations are device dependent.

Syntax 

unsigned di_digin(void);

Parameters

none

Return Value

The function returns two bytes from the digital input port.

Dependencies

di_open

Remarks

The default state of the digital input bits is “High.” Values and locations of the digital input bits are device dependent.

DI-148, DI-149, DI-158, DI-700, DI-71x, DI-220, DI-400
DI-720, DI-5001, DI-500, DI-78x

Sample Code

#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.