/************************/ /* head file for 8024 */ /************************/ /* Ver 2.0.0 [7,Oct,2004] by Bill 1.Remove smoe function that useless for user. Such as: void write_93c46(int slot,int addr,int data); int read_93c46(int slot,int addr); void erase_93c46(int slot,int addr); 2.Change functions name: pac_i8024_VoltageHexOut ==> pac_i8024_VoltageOut_Hex pac_i8024_CurrentHexOut ==> pac_i8024_CurrentOut_Hex */ /************************************************************************/ /* [8024 D/A chip specific] */ /* Voltage Output range: -10.0V 0V +10.0V */ /* (1)float format -10.0V 0.0V +10.0V */ /* (2)Hex format -32768 0 32767 */ /* (3)interger format(mv) -10000mV 0mV +10000mV */ /* */ /* CurrentOutput range: 0.0mA +20.0mA */ /* (1)float format 0.0mA +20.0mA */ /* (2)Hex format 0 32768 */ /* (3)interger format(0.001mA) 0 20000mA */ /************************************************************************/ #ifdef _8024_EXPORTS #define I8024W_API __declspec(dllexport) #else #define I8024W_API __declspec(dllimport) #endif #define NoError 0 #define ID_ERROR -1 #ifdef __cplusplus extern "C" { #endif #define pac_i8024W_ReadVoltage pac_i8024W_VoltageOut_Readback #define pac_i8024W_ReadVoltageHex pac_i8024W_VoltageOut_Hex_Readback #define pac_i8024W_ReadCurrent pac_i8024W_CurrentOut_Readback #define pac_i8024W_ReadCurrentHex pac_i8024W_CurrentOut_Hex_Readback I8024W_API short pac_i8024W_GetFirmwareVersion(int iSlot); I8024W_API short pac_i8024W_GetLibVersion(void); I8024W_API void pac_i8024W_GetLibDate(char libDate[]); I8024W_API void I8024_ReadGainOffsetInfo(int slot, int ch, int type, float *gain, float* offset); I8024W_API void pac_i8024W_ReadVoltageGain(int slot,int ch,int* vMax,int* vMin); I8024W_API void pac_i8024W_ReadCurrentGain(int slot,int ch,int* iMax,int* iMin); I8024W_API short pac_i8024W_Initial(int Slot); /* For I-8024 use 14-bit DA chip, but for all hex output/readback API function, we use 16-bit as output hex data, for example: iChipData is 16-bit hex data will be used as output data the iChipData will be converted to 14-bit data before output to DA Chip Lbyte = iChipData & 0xff; Hbyte = iChipData >> 8; Hbyte = Hbyte & 0x3f; Range with 16 bits of 2's complement: Voltage: -32768 -0 +0 32767 -10V 0V 0V +10V (New) Current: 0 32768 0 20mA ****************************************** Range of general 14 bits: Voltage: 0 8192 16383 -10V 0 10V (Old) Current: 8192 16383 0 20mA */ //Voltage output I8024W_API void pac_i8024W_VoltageOut(int slot,int ch,float fData); //fData: -10.0 ~ +10.0 I8024W_API void pac_i8024W_VoltageOut_Hex(int slot,int ch,int hData); //iData: -32768 ~ +32767 //Current I8024W_API void pac_i8024W_CurrentOut(int slot,int ch,float fData); //fData: 0.0 ~ +20.0 I8024W_API void pac_i8024W_CurrentOut_Hex(int slot,int ch,int hData); //iData: 0 ~ +32767 //Voltage output readback (software readback) I8024W_API float pac_i8024W_VoltageOut_Readback(int slot,int ch); //fData: -10.0 ~ +10.0 I8024W_API int pac_i8024W_VoltageOut_Hex_Readback(int slot,int ch); //iData: -32768 ~ +32767 I8024W_API float pac_i8024W_CurrentOut_Readback(int slot,int ch); //fData: 0.0 ~ +20.0 I8024W_API int pac_i8024W_CurrentOut_Hex_Readback(int slot,int ch); //iData: 0 ~ +32767 #ifdef __cplusplus } #endif