/****************************************************/ /* XW110i API Functions for uPAC-5000 Series */ /* */ /* [Sep 12, 2012] by Liam version 1.00 */ /****************************************************/ #ifndef __XW110_H #define __XW110_H #ifdef __cplusplus extern "C" { #endif int XW110_Init(void); /* Initiate the XW110 library Return On success, returns zero On error, returns a non-zero value Bit7: 1 => XW110i cannot be found */ unsigned XW110_GetLibVersion(void); /* Get the version number of XW110 library Return It always returns a non-zero value to indicate the current version 0x100 indicates the version is 1.00 */ void XW110_GetLibDate(char *date); /* Get the build date of the current version of XW110 library Argument date: Buffer where function writes the string */ unsigned XW110_Read_All_DI(void); /* Read the input status of all channels Return All digital inputs are packed as one channel per bit of the return data. Status is indicated as 0=ON (short to GND) and 1=OFF (Open) For example: The status of inputs is shown as the byte value 0C hex, or binary 0000 1010. DI3 is in the fifth bit position from the left, and DI0 is the LSB of this byte. */ int XW110_Read_One_DI(int channel); /* Read the input status of the specified channel Argument channel: Channel number Return 0 for ON (short to GND) and 1 for OFF (Open) */ #ifdef __cplusplus } #endif #endif