/**********************************************************/ /* X324 API Functions for uPAC-7186EX/I-7188EX/I-7188XB */ /* */ /* [May 06, 2023] version 2.10 */ /**********************************************************/ #ifndef __X324_H #define __X324_H #ifdef __cplusplus extern "C" { #endif int X324_Init(void); /* Initiate the X324 library Return on success, returns zero on error, returns a non-zero error code Bit0/1: calibration parameters of channel 0 are not available Bit2/3: calibration parameters of channel 1 are not available Bit4/5: calibration parameters of channel 2 are not available Bit6/7: calibration parameters of channel 3 are not available */ unsigned X324_GetLibVersion(void); /* Get the version number of X324 library Return It always returns a non-zero value to indicate the current version 0x210 indicates the version is 2.10 */ void X324_GetLibDate(char *date); /* Get the build date of the current version of X324 library Argument date: Buffer where function writes the string */ void X324_AnalogOut(int channel, float value); /* Set the output voltage Argument channel: Channel number value: Set the output voltage, represented as a float in the range [0, 5.0] */ float X324_Read_DA_CalibrationGain(int channel); /* Retrieve the calibration configuration Argument channel: Channel number */ float X324_Read_DA_CalibrationOffset(int channel); /* Retrieve the calibration configuration Argument channel: Channel number */ #define X324_DigitalOut X324_Write_All_DO void X324_Write_All_DO(int status); /* Set the output status for all channels Argument value: All digital outputs are packed as one channel per bit of the writing value */ void X324_Write_One_DO(int channel, int status); /* Set the output status for the specified channel Argument channel: Channel number status: An integer specifying the output value, 0 for OFF and 1 for ON */ int X324_Read_All_DO(void); /* Read back the current status of all channels Return All digital outputs are packed as one channel per bit of the return data. Status is indicated as 1=ON and 0=OFF For example: The status of outputs is shown as the byte value 0C hex, or binary 0000 1010. DO3 is in the fifth bit position from the left, and DO0 is the LSB of this byte. */ int X324_Read_One_DO(int channel); /* Read back the current status of the specified channel Argument channel: Channel number Return An integer representing the output state, 0 for OFF and 1 for ON */ extern float X324_fDA_Gain[]; extern float X324_fDA_Offset[]; #ifdef __cplusplus } #endif #endif