/********************************************************************/ /* Header file Name:pac_i8050W.h /* Match lib;pac_i8050W.lib /* Match Dll:pac_i8050W.Dll /* [Abstract]: /* This file defines pac_i8050W.Dll functions, types and definitions. /* These functions be used to control the I-8050W module /* on the WinPAC/ViewPAC. /* [Caution]: /* The i-8050W is 16-channel Universal Digital I/O Module /* Be careful the channel I/O status. /********************************************************************/ /* Header file for I-8050W Version 1.0.0.0 [30,Sep,2009] by Vic I-8050W is a 16-channel universal Digital I/O module. It doesn't need to do any setting for DI function. Only DO function has to be set(Use pac_i8050W_UDIO_WriteConfig_16()). Warning:(English) A channel may be destroyed if it is subjected to an input signal(Vcc) while it is configured to be an output channel. Please remove the external signal which connects to DI, before changing the channel status from DI mode to DO mode Warning:(Traditional-Chinese) 警告:() 8050上有一個通道設定為DI且此通道有訊號輸入(Vcc),如果此時將此通道的 狀態設定為DO,則這個通道可能會損壞 通道狀態由DI改為DO之前,請先將DI的外部輸入線路移除 */ #ifdef PAC_I8050W_EXPORTS #define I8050W_API extern "C" __declspec(dllexport) #else #define I8050W_API extern "C" __declspec(dllimport) #endif #ifdef __cplusplus extern "C" { #endif /*********************************** * Get lattice version * * * * slot: 0~7 * * return value: Lattice version * ***********************************/ I8050W_API WORD pac_i8050W_GetFirmwareVersion(BYTE slot); /******************************************************** * Get library version * * * * return value: Library version * * For example: 0x1000; =Rev:1.0.0.0 * ********************************************************/ I8050W_API WORD pac_i8050W_GetLibVersion(void); /***************************************** * Get the date of library * * * * *libDate: libDate=(char*)malloc(20); * *****************************************/ I8050W_API void pac_i8050W_GetLibDate(char* libDate); /****************************************** * Write DO values for 16 channels * * * * slot: 0~7 * * config: Each bit for one output point * * 1 for active, 0 for inactive * ******************************************/ I8050W_API void pac_i8050W_UDIO_WriteDO16(BYTE slot,WORD config); /************************************************ * Read DO values for 16 channels * * * * slot: 0~7 * * return value: Each bit for one output point * * 1 for active, 0 for inactive * ************************************************/ I8050W_API WORD pac_i8050W_UDIO_ReadDO16(BYTE slot); /************************************************ * Read DI values for 16 channels * * * * slot: 0~7 * * return value: Each bit for one input point * * 1 for active, 0 for inactive * ************************************************/ I8050W_API WORD pac_i8050W_UDIO_DI16(BYTE slot); /******************************************** * Set DO mode for 16 channels * * * * slot: 0~7 * * config: Each bit for one output point * * 1 for active, 0 for inactive * ********************************************/ I8050W_API void pac_i8050W_UDIO_WriteConfig_16(BYTE slot,WORD config); /************************************************* * Read DO mode for 16 channels * * * * slot: 0~7 * * return value: Each bit for one output point * * 1 for active, 0 for inactive * *************************************************/ I8050W_API WORD pac_i8050W_UDIO_ReadConfig_16(BYTE slot); #ifdef __cplusplus } #endif