//*************************************************************************************** // //! \file advio.h //! IO deiver for ECU series prodeuct. //! //! \version V1.0 //! \date 2024 // //*************************************************************************************** #ifndef _ADVIO_H_ #define _ADVIO_H_ #include #include #include #include #undef LOG_DOMAIN #undef LOG_TAG #define LOG_DOMAIN 0x3200 // 全局domain宏,标识业务领域 #define LOG_TAG "MY_TAG" #include "hilog/log.h" #ifndef WIN_TYPE_DEF #define WIN_TYPE_DEF typedef char WCHAR; typedef void *HMODULE; typedef void *HANDLE; typedef bool BOOL; typedef char BYTE; typedef HANDLE HINSTANCE; #endif #define DLL_FILE_NAME "libadvio.so" #define AI_CALI_TYPE_ZERO 0X55 #define AI_CALI_TYPE_SPAN 0Xaa #define AI_CALI_TYPE_MIX 0X5a #define CAL_FLASH 0x01 #define _USER_FACTORY 0X02 #define CAL_FACTORY_USER 0x03 /** range value of 0~20mA. */ #define RANGE_CODE_I_0_P20 0x0182 /** range value of 4~20mA. */ #define RANGE_CODE_I_4_P20 0x0180 /** range value of -2.5V~2.5V. */ #define RANGE_CODE_V_N2P5_P2P5 0x0141 /** range value of -10V~10V. */ #define RANGE_CODE_V_N10_P10 0x0143 /** range value of 0V~10V. */ #define RANGE_CODE_V_0_P10 0x0149 enum DO_INIT_VALUE_TYPE { DO_INIT_DOVALUE_TYPE = 0, DO_INIT_RESERVED }; #pragma pack(1) /** module information data struct */ typedef struct tagSPISearchDeviceAck { /** firmware working mode. 0: download mode 1 : application mode */ uint8_t uModuleMode; /** module name */ uint8_t ucModuleName[10]; /** firmware version */ uint32_t ulModuleVersion; /** channel number of AI */ uint8_t ucAINum; /** channel number of AO */ uint8_t ucAONum; /** channel number of DI */ uint8_t ucDINum; /** channel number of DO */ uint8_t ucDONum; /** reserved */ uint32_t ulresv; } SPISearchDev, *PSPISearchDev; typedef struct _CMD_LOCATION { int head; int tail; } CMD_LOCATION, *PCMD_LOCATION; #pragma pack() typedef enum tagErrorCode { /// /// The operation is completed successfully. /// Success = 0, ///************************************************************************ /// warning ///************************************************************************ /// /// The interrupt resource is not available. /// WarningIntrNotAvailable = 0xA0000000, /// /// The parameter is out of the range. /// WarningParamOutOfRange = 0xA0000001, /// /// The property value is out of range. /// WarningPropValueOutOfRange = 0xA0000002, /// /// The property value is not supported. /// WarningPropValueNotSpted = 0xA0000003, /// /// The property value conflicts with the current state. /// WarningPropValueConflict = 0xA0000004, ///*********************************************************************** /// error ///*********************************************************************** /// /// The handle is NULL or its type doesn't match the required operation. /// ErrorHandleNotValid = 0xE0000000, /// /// The parameter value is out of range. /// ErrorParamOutOfRange = 0xE0000001, /// /// The parameter value is not supported. /// ErrorParamNotSpted = 0xE0000002, /// /// The parameter value format is not the expected. /// ErrorParamFmtUnexpted = 0xE0000003, /// /// Not enough memory is available to complete the operation. /// ErrorMemoryNotEnough = 0xE0000004, /// /// The data buffer is null. /// ErrorBufferIsNull = 0xE0000005, /// /// The data buffer is too small for the operation. /// ErrorBufferTooSmall = 0xE0000006, /// /// The data length exceeded the limitation. /// ErrorDataLenExceedLimit = 0xE0000007, /// /// The required function is not supported. /// ErrorFuncNotSpted = 0xE0000008, /// /// The required event is not supported. /// ErrorEventNotSpted = 0xE0000009, /// /// The required property is not supported. /// ErrorPropNotSpted = 0xE000000A, /// /// The required property is read-only. /// ErrorPropReadOnly = 0xE000000B, /// /// The specified property value conflicts with the current state. /// ErrorPropValueConflict = 0xE000000C, /// /// The specified property value is out of range. /// ErrorPropValueOutOfRange = 0xE000000D, /// /// The specified property value is not supported. /// ErrorPropValueNotSpted = 0xE000000E, /// /// The handle hasn't own the privilege of the operation the user wanted. /// ErrorPrivilegeNotHeld = 0xE000000F, /// /// The required privilege is not available because someone else had own it. /// ErrorPrivilegeNotAvailable = 0xE0000010, /// /// The driver of specified device was not found. /// ErrorDriverNotFound = 0xE0000011, /// /// The driver version of the specified device mismatched. /// ErrorDriverVerMismatch = 0xE0000012, /// /// The loaded driver count exceeded the limitation. /// ErrorDriverCountExceedLimit = 0xE0000013, /// /// The device is not opened. /// ErrorDeviceNotOpened = 0xE0000014, /// /// The required device does not exist. /// ErrorDeviceNotExist = 0xE0000015, /// /// The required device is unrecognized by driver. /// ErrorDeviceUnrecognized = 0xE0000016, /// /// The configuration data of the specified device is lost or unavailable. /// ErrorConfigDataLost = 0xE0000017, /// /// The function is not initialized and can't be started. /// ErrorFuncNotInited = 0xE0000018, /// /// The function is busy. /// ErrorFuncBusy = 0xE0000019, /// /// The interrupt resource is not available. /// ErrorIntrNotAvailable = 0xE000001A, /// /// The DMA channel is not available. /// ErrorDmaNotAvailable = 0xE000001B, /// /// Time out when reading/writing the device. /// ErrorDeviceIoTimeOut = 0xE000001C, /// /// The given signature does not match with the device current one. /// ErrorSignatureNotMatch = 0xE000001D, /// /// The given configure does not match with the device current one. /// ErrorConfigNotRight = 0xE0000020, /// /// Undefined error /// ErrorUndefined = 0xE000FFFF, } ErrorCode; typedef ErrorCode (*PFNIODEVINIT)(void); typedef ErrorCode (*PFNIODEVCLOSE)(void); typedef ErrorCode (*PFNGETSPIDEVHANDLE)(int *); typedef ErrorCode (*PFNSPIPROTOIO)(int, uint8_t *, uint8_t, uint8_t *, uint8_t *, uint8_t); typedef ErrorCode (*PFNGETDEVINFO)(PSPISearchDev); typedef ErrorCode (*PFNGETADDEVINFO)(char *, char *); typedef unsigned char (*PFNCONSTRUCTSPIPACKAGE)(unsigned char, unsigned char, unsigned char, unsigned char *, unsigned char, unsigned char *); typedef ErrorCode (*PFNGETAIRANGECODE)(unsigned char, unsigned char, unsigned char *); typedef ErrorCode (*PFNSETAIRANGECODE)(unsigned char, unsigned char, unsigned char *); typedef ErrorCode (*PFNAIREAD)(unsigned char, unsigned char, unsigned char *); typedef ErrorCode (*PFNAICAILIBRATE)(unsigned char, unsigned char); typedef ErrorCode (*PFNAICALIBRATEFLASH)(unsigned char); typedef ErrorCode (*PFNSETAIINTERGRATION)(uint8_t); typedef ErrorCode (*PFNGETAIINTERGRATION)(uint8_t *); typedef ErrorCode (*PFNDOREAD)(unsigned int *); typedef ErrorCode (*PFNDOWRITEONECHANNEL)(unsigned int, unsigned int); typedef ErrorCode (*PFNDOWRITEALL)(unsigned int); typedef ErrorCode (*PFNDIREAD)(unsigned int *); typedef ErrorCode (*PFNGETDRVVERSION)(uint32_t *); // typedef ErrorCode (* PFNDOINITVALUEGET)(unsigned int, unsigned int*); // typedef ErrorCode (* PFNDOINITVALUESET)(unsigned int, unsigned int); typedef ErrorCode (*PFNACCESSDOINITVALUE)(uint32_t, uint32_t, uint32_t, void *, uint32_t); typedef struct _BAdvIOLib { HMODULE instHandle; PFNIODEVINIT pfnIODevInit; PFNIODEVCLOSE pfnIODevClose; PFNGETSPIDEVHANDLE pfnGetSPIDevHandle; PFNSPIPROTOIO pfnSPIProtoIO; PFNGETDEVINFO pfnGetDevInfo; PFNGETADDEVINFO pfnGetADDevInfo; PFNCONSTRUCTSPIPACKAGE pfnConstructSPIPackage; PFNGETAIRANGECODE pfnGetAIRangeCode; PFNSETAIRANGECODE pfnSetAIRangeCode; PFNAIREAD pfnAIRead; PFNAICAILIBRATE pfnAICalibrate; PFNAICALIBRATEFLASH pfnAICalibrateFlash; PFNSETAIINTERGRATION pfnSetAIIntergration; PFNGETAIINTERGRATION pfnGetAIIntergration; PFNDOREAD pfnDORead; PFNDOWRITEONECHANNEL pfnDOWriteOneChannel; PFNDOWRITEALL pfnDOWriteAll; PFNDIREAD pfnDIRead; PFNGETDRVVERSION pfnGetDrvVersion; // PFNDOINITVALUEGET pfnDoInitValueGet; // PFNDOINITVALUESET pfnDoInitValueSet; PFNACCESSDOINITVALUE pfnAccessDoinitValue; } BAdvIOLib, *PBAdvIOLib; static inline BAdvIOLib *GetBDaqLib(void) { static BAdvIOLib badvioLib; return &badvioLib; } static inline BOOL InitializeAdvIOLibray(BAdvIOLib *badviolib) { if (badviolib->instHandle == NULL) { if ((badviolib->instHandle = dlopen(DLL_FILE_NAME, RTLD_LAZY)) != NULL) { badviolib->pfnIODevInit = (PFNIODEVINIT)dlsym(badviolib->instHandle, "IODevInit"); badviolib->pfnIODevClose = (PFNIODEVCLOSE)dlsym(badviolib->instHandle, "IODevClose"); badviolib->pfnGetSPIDevHandle = (PFNGETSPIDEVHANDLE)dlsym(badviolib->instHandle, "GetSPIDevHandle"); badviolib->pfnSPIProtoIO = (PFNSPIPROTOIO)dlsym(badviolib->instHandle, "SPIProtoIO"); badviolib->pfnGetDevInfo = (PFNGETDEVINFO)dlsym(badviolib->instHandle, "GetDevInfo"); badviolib->pfnGetADDevInfo = (PFNGETADDEVINFO)dlsym(badviolib->instHandle, "GetADDevInfo"); badviolib->pfnConstructSPIPackage = (PFNCONSTRUCTSPIPACKAGE)dlsym(badviolib->instHandle, "ConstructSPIPackage"); badviolib->pfnGetAIRangeCode = (PFNGETAIRANGECODE)dlsym(badviolib->instHandle, "GetAIRangeCode"); badviolib->pfnSetAIRangeCode = (PFNSETAIRANGECODE)dlsym(badviolib->instHandle, "SetAIRangeCode"); badviolib->pfnAIRead = (PFNAIREAD)dlsym(badviolib->instHandle, "AIRead"); badviolib->pfnAICalibrate = (PFNAICAILIBRATE)dlsym(badviolib->instHandle, "AICalibrate"); badviolib->pfnAICalibrateFlash = (PFNAICALIBRATEFLASH)dlsym(badviolib->instHandle, "AICalibrateFlash"); badviolib->pfnSetAIIntergration = (PFNSETAIINTERGRATION)dlsym(badviolib->instHandle, "SetAIIntergration"); badviolib->pfnGetAIIntergration = (PFNGETAIINTERGRATION)dlsym(badviolib->instHandle, "GetAIIntergration"); // badviolib->pfnFormatSPICMDPackage = (PFNFORMATSPICMDPACKAGE)dlsym(badviolib->instHandle, // "FormatSPICMDPackage"); badviolib->pfnDORead = (PFNDOREAD)dlsym(badviolib->instHandle, "DORead"); badviolib->pfnDOWriteOneChannel = (PFNDOWRITEONECHANNEL)dlsym(badviolib->instHandle, "DOWriteOneChannel"); badviolib->pfnDOWriteAll = (PFNDOWRITEALL)dlsym(badviolib->instHandle, "DOWriteAll"); badviolib->pfnDIRead = (PFNDIREAD)dlsym(badviolib->instHandle, "DIRead"); badviolib->pfnGetDrvVersion = (PFNGETDRVVERSION)dlsym(badviolib->instHandle, "GetDrvVersion"); // badviolib->pfnDoInitValueGet = (PFNDOINITVALUEGET)dlsym(badviolib->instHandle, "DOInitValueGet"); // badviolib->pfnDoInitValueSet = (PFNDOINITVALUESET)dlsym(badviolib->instHandle, "DOInitValueSet"); badviolib->pfnAccessDoinitValue = (PFNACCESSDOINITVALUE)dlsym(badviolib->instHandle, "AccessDoInitValue"); } } return badviolib->instHandle != NULL; } /*!************************************************************************* * \brief * Initialize the AdvIO device. * * \details * This function must be called before any other AdvIO functions. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevInit(void) { if (InitializeAdvIOLibray(GetBDaqLib())) { if (GetBDaqLib()->pfnIODevInit) { return GetBDaqLib()->pfnIODevInit(); } else { return ErrorHandleNotValid; } } return ErrorUndefined; } /*!************************************************************************* * \brief * De-initialize the Advio device * * \details * * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevClose(void) { if (GetBDaqLib()->pfnIODevClose) { return GetBDaqLib()->pfnIODevClose(); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Get SPI Interface Handle. * * \details * * \param[out] phdl * Handle of the SPI Interface. * * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioGetSPIDevHandle(int *phdl) { if (GetBDaqLib()->pfnGetSPIDevHandle) { return GetBDaqLib()->pfnGetSPIDevHandle(phdl); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * perform a SPI data exchange. * * \details * * \param[in] dev_hdl * Handle of the SPI Interface. * * \param[in] pinbuf * input data buffer. * * \param[in] inlen * number of input data. * * \param[out] poutbuf * output data buffer. * * \param[out] poutlen * number of output data. * * \param[in] printflag * flag display date or not. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioSPIProtoIO(int dev_hdl, uint8_t *pinbuf, uint8_t inlen, uint8_t *poutbuf, uint8_t *poutlen, uint8_t printflag) { if (GetBDaqLib()->pfnSPIProtoIO) { return GetBDaqLib()->pfnSPIProtoIO(dev_hdl, pinbuf, inlen, poutbuf, poutlen, printflag); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Get IO module infomation. * * \details * * * \param[out] pdevinfo * pointer of module infomation data struct. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetDevInfo(PSPISearchDev pdevinfo) { if (GetBDaqLib()->pfnGetDevInfo) { return GetBDaqLib()->pfnGetDevInfo(pdevinfo); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Get AD module infomation. * * \details * * * \param[out] pname * ad module name. * * \param[out] pinfo * ad module firmware version. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetADDevInfo(char *pname, char *pinfo) { if (GetBDaqLib()->pfnGetADDevInfo) { return GetBDaqLib()->pfnGetADDevInfo(pname, pinfo); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Contruct a spi protocal data package. * * \details * * * \param[in] id * index of module. * * \param[in] direction * get data or set data. * * \param[in] command_id * spi command index. * * \param[in] pbufsrc * the rest input data buffer. * * \param[in] buflen * input data buffer lenght. * * \param[out] pbufdst * input data buffer. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevConstructSPIPackage(unsigned char id, unsigned char direction, unsigned char command_id, unsigned char *pbufsrc, unsigned char buflen, unsigned char *pbufdst) { if (GetBDaqLib()->pfnConstructSPIPackage) { return (ErrorCode)(GetBDaqLib()->pfnConstructSPIPackage(id, direction, command_id, pbufsrc, buflen, pbufdst)); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Get AI range code. * * \details * * * \param[in] startch * The number of the first data channel index you want to get. * * \param[in] stopch * The number of the last data channel index you want to get. * * \param[out] poutbuf * range code data output buffer, two byte per channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetAIRangeCode(unsigned char startch, unsigned char stopch, unsigned char *poutbuf) { if (GetBDaqLib()->pfnGetAIRangeCode) { return GetBDaqLib()->pfnGetAIRangeCode(startch, stopch, poutbuf); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Set AI range code. * * \details * * * \param[in] startch * The number of the first data channel index you want to set. * * \param[in] stopch * The number of the last data channel index you want to set. * * \param[in] poutbuf * range code data input buffer, two byte per channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevSetAIRangeCode(unsigned char startch, unsigned char stopch, unsigned char *poutbuf) { if (GetBDaqLib()->pfnSetAIRangeCode) { return GetBDaqLib()->pfnSetAIRangeCode(startch, stopch, poutbuf); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * AI calibrate action. * * \details * * * \param[in] chan * The number of the data channel index you want to calibrate. * * \param[in] calitype * calibrate type, zero calibrate or range calibrate. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevAICalibrate(unsigned char chan, unsigned char calitype) { if (GetBDaqLib()->pfnAICalibrate) { return GetBDaqLib()->pfnAICalibrate(chan, calitype); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * store calibrate data into flash. * * \details * * * \param[in] act_type * action type, to user flash or factory flash. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevAICalibrateFlash(unsigned char act_type) { if (GetBDaqLib()->pfnAICalibrateFlash) { return GetBDaqLib()->pfnAICalibrateFlash(act_type); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Sinc3 decimation factor setting. * * \details * * * \param[in] flag * Sinc3 decimation factor, 0:60Hz, 1:50Hz. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevSetAIIntergration(uint8_t flag) { if (GetBDaqLib()->pfnSetAIIntergration) { return GetBDaqLib()->pfnSetAIIntergration(flag); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * get Sinc3 decimation factor. * * \details * * * \param[out] pflag * Sinc3 decimation factor, 0:60Hz, 1:50Hz. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetAIIntergration(uint8_t *pflag) { if (GetBDaqLib()->pfnGetAIIntergration) { return GetBDaqLib()->pfnGetAIIntergration(pflag); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Obtain the results of AI. * * \details * * * \param[in] startch * The number of the first data channel index you want to set. * * \param[in] stopch * The number of the last data channel index you want to set. * * \param[out] poutbuf * AI data output buffer, two byte per channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevAIRead(unsigned char startch, unsigned char stopch, unsigned char *poutbuf) { if (GetBDaqLib()->pfnAIRead) { return GetBDaqLib()->pfnAIRead(startch, stopch, poutbuf); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Obtain the current state of do. * * \details * * * \param[out] dovalue * do state of all channel, one bit corresponds to one do channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevDORead(unsigned int *dovalue) { if (GetBDaqLib()->pfnDORead) { return GetBDaqLib()->pfnDORead(dovalue); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Write the DO value of a channel. * * \details * * * \param[in] index * do channel index. * * \param[in] value * do value be setting. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevDOWriteOneChannel(unsigned int index, unsigned int value) { if (GetBDaqLib()->pfnDOWriteOneChannel) { return GetBDaqLib()->pfnDOWriteOneChannel(index, value); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Write the DO value of all channel. * * \details * * * \param[in] value * do value be setting, one bit corresponds to one do channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevDOWriteAll(unsigned int value) { if (GetBDaqLib()->pfnDOWriteAll) { return GetBDaqLib()->pfnDOWriteAll(value); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Obtain the current state of di. * * \details * * * \param[out] divalue * di state of all channel, one bit corresponds to one di channel. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevDIRead(unsigned int *divalue) { if (GetBDaqLib()->pfnDIRead) { return GetBDaqLib()->pfnDIRead(divalue); } else { return ErrorHandleNotValid; } } // /*!************************************************************************* // * \brief // * Obtain the do init value. // * // * \details // * // * // * \param[in] index // * do channel index. // * // * \param[out] pvalue // * do init value. // * // * \return // * result, 0 if successful. // * // ***************************************************************************/ // static inline ErrorCode AdvioDevDoInitValueGet(unsigned int index, unsigned int* pvalue) // { // return GetBDaqLib()->pfnDoInitValueGet(index, pvalue); // } // /*!************************************************************************* // * \brief // * Obtain the do init value. // * // * \details // * // * // * \param[in] index // * do channel index. // * // * \param[in] value // * do init value. // * // * \return // * result, 0 if successful. // * // ***************************************************************************/ // static inline ErrorCode AdvioDevDoInitValueSet(unsigned int index, unsigned int value) // { // return GetBDaqLib()->pfnDoInitValueSet(index, value); // } /*!************************************************************************* * \brief * Obtain the io driver version. * * \details * * * \param[out] ver * io driver version. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetDrvVersion(uint32_t *ver) { if (GetBDaqLib()->pfnGetDrvVersion) { return GetBDaqLib()->pfnGetDrvVersion(ver); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Set DO initial value . * * \details * * * \param[in] chStart * do channel index. * * \param[in] chCount * do channel count. * *\param[in] type * init value type. * *\param[in] valueRange * init value be setting, 32bit array. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevSetDoInitValue(uint32_t chStart, uint32_t chCount, uint32_t type, void *valueRange) { if (GetBDaqLib()->pfnAccessDoinitValue) { return GetBDaqLib()->pfnAccessDoinitValue(chStart, chCount, type, valueRange, 1); } else { return ErrorHandleNotValid; } } /*!************************************************************************* * \brief * Get DO initial value . * * \details * * * \param[in] chStart * do channel index. * * \param[in] chCount * do channel count. * *\param[in] type * init value type. * *\param[out] valueRange * to be fill with init value, 32bit array. * * \return * result, 0 if successful. * ***************************************************************************/ static inline ErrorCode AdvioDevGetDoInitValue(uint32_t chStart, uint32_t chCount, uint32_t type, void *valueRange) { if (GetBDaqLib()->pfnAccessDoinitValue) { return GetBDaqLib()->pfnAccessDoinitValue(chStart, chCount, type, valueRange, 0); } else { return ErrorHandleNotValid; } } #endif //*************************************************************************************** // //! \example example/airead/main.c //! Show how to get ai sample value. //! \example example/airange_get/main.c //! Show how to get ai range code. //! \example example/airange_set/main.c //! Show how to set ai range code. //! \example example/diread/main.c //! Show how to get di value. //! \example example/doread/main.c //! Show how to get do value. //! \example example/dowrite_multi/main.c //! Show how to set do to multi channel in one time. //! \example example/dowrite_single/main.c //! Show how to set do to a single channel. //! \example example/mdlsearch/main.c //! Show how to get io device information. // //***************************************************************************************