• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

epics/apps/crucible/cbmall_cern2010/thirdParty/include/CAENHVWrapper.h (r4864/r2652)

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*        --- CAEN Engineering Srl - Computing Systems Division ---        */
00004 /*                                                                         */
00005 /*    CAENHVWRAPPER.H                                                      */
00006 /*                                                                         */
00007 /*                                                                         */
00008 /*    Source code written in ANSI C                                        */
00009 /*                                                                         */ 
00010 /*    Created:  March 2000                                                 */
00011 /*                                                                         */
00012 /***************************************************************************/
00013 
00014 #ifndef __CAENHVWRAPPER_H
00015 #define __CAENHVWRAPPER_H
00016 
00017 #include "caenhvoslib.h"
00018 
00019 #ifndef uchar 
00020 #define uchar unsigned char
00021 #endif
00022 #ifndef ushort 
00023 #define ushort unsigned short
00024 #endif
00025 #ifndef ulong
00026 #define ulong unsigned int
00027 #endif
00028 
00029 #define MAX_CH_NAME                12
00030  
00031 #define MAX_PARAM_NAME             10
00032 
00033 #define MAX_CRATES                             8
00034 #define MAX_SLOTS                             32
00035 #define MAX_BOARDS    ( MAX_SLOTS * MAX_CRATES )
00036 
00037 #define MAX_BOARD_NAME             12
00038 #define MAX_BOARD_DESC             28 
00039 #define SET                         1
00040 #define MON                         0
00041 #define SIGNED                      1
00042 #define UNSIGNED                    0
00043 
00044 #define PARAM_TYPE_NUMERIC          0
00045 #define PARAM_TYPE_ONOFF            1
00046 #define PARAM_TYPE_CHSTATUS         2
00047 #define PARAM_TYPE_BDSTATUS         3
00048 
00049 #define PARAM_MODE_RDONLY           0
00050 #define PARAM_MODE_WRONLY           1
00051 #define PARAM_MODE_RDWR             2
00052 
00053 #define PARAM_UN_NONE               0
00054 #define PARAM_UN_AMPERE             1
00055 #define PARAM_UN_VOLT               2
00056 #define PARAM_UN_WATT               3
00057 #define PARAM_UN_CELSIUS            4
00058 #define PARAM_UN_HERTZ              5
00059 #define PARAM_UN_BAR                6
00060 #define PARAM_UN_VPS                7
00061 #define PARAM_UN_SECOND             8
00062 #define PARAM_UN_RPM                9             // Rel. 1.4
00063 #define PARAM_UN_COUNT             10             // Rel. 2.6
00064 
00065 #define SYSPROP_TYPE_STR            0
00066 #define SYSPROP_TYPE_REAL           1
00067 #define SYSPROP_TYPE_UINT2          2
00068 #define SYSPROP_TYPE_UINT4          3
00069 #define SYSPROP_TYPE_INT2           4
00070 #define SYSPROP_TYPE_INT4           5
00071 #define SYSPROP_TYPE_BOOLEAN        6
00072 
00073 #define SYSPROP_MODE_RDONLY         0
00074 #define SYSPROP_MODE_WRONLY         1
00075 #define SYSPROP_MODE_RDWR           2
00076 
00077 /*-----------------------------------------------------------------------------
00078                                                                              
00079                              ERROR    CODES                                 
00080                                                                              
00081   Their meaning is the next:                                                 
00082    CODES                                                                     
00083      0    Command wrapper correctly executed                                 
00084      1    Error of operatived system                                         
00085      2    Write error in communication channel                               
00086      3    Read error in communication channel                                
00087      4    Time out in server communication                                   
00088      5    Command Front End application is down                              
00089      6    Comunication with system not yet connected by a Login command      
00090      7    Execute Command not yet implementated                              
00091      8    Get Property not yet implementated                                 
00092      9    Set Property not yet implementated                                 
00093      10   Communication with RS232 not yet implementated                     
00094      11   User memory not sufficient                                          
00095          12   Value out of range
00096      13   Property not yet implementated
00097      14   Property not found
00098      15   Execute command not found
00099      16   No System property
00100      17   No get property
00101      18   No set property
00102      19   No execute command
00103      20   configuration change
00104      21   Property of param not found
00105      22   Param not found
00106  -----------------------------------------------------------------------------*/
00107 #define CAENHV_OK                   0
00108 #define CAENHV_SYSERR               1
00109 #define CAENHV_WRITEERR             2
00110 #define CAENHV_READERR              3
00111 #define CAENHV_TIMEERR              4
00112 #define CAENHV_DOWN                 5
00113 #define CAENHV_NOTPRES              6
00114 #define CAENHV_SLOTNOTPRES          7
00115 #define CAENHV_NOSERIAL             8
00116 #define CAENHV_MEMORYFAULT          9
00117 #define CAENHV_OUTOFRANGE           10
00118 #define CAENHV_EXECCOMNOTIMPL       11
00119 #define CAENHV_GETPROPNOTIMPL       12
00120 #define CAENHV_SETPROPNOTIMPL       13
00121 #define CAENHV_PROPNOTFOUND         14
00122 #define CAENHV_EXECNOTFOUND         15
00123 #define CAENHV_NOTSYSPROP                       16
00124 #define CAENHV_NOTGETPROP                       17
00125 #define CAENHV_NOTSETPROP           18
00126 #define CAENHV_NOTEXECOMM           19
00127 #define CAENHV_SYSCONFCHANGE          20
00128 #define CAENHV_PARAMPROPNOTFOUND    21
00129 #define CAENHV_PARAMNOTFOUND        22
00130 #define CAENHV_CONNECTED                 (0x1000 + 1)
00131 #define CAENHV_NOTCONNECTED            (0x1000 + 2)
00132 #define CAENHV_OS                    (0x1000 + 3)
00133 #define CAENHV_LOGINFAILED         (0x1000 + 4)
00134 #define CAENHV_LOGOUTFAILED        (0x1000 + 5)
00135 #define CAENHV_LINKNOTSUPPORTED    (0x1000 + 6)  // Rel. 1.2
00136 
00137 // Link Types for InitSystem
00138 #define LINKTYPE_TCPIP            0
00139 #define LINKTYPE_RS232            1
00140 #define LINKTYPE_CAENET           2
00141 
00142 #ifndef __CAENHVRESULT__                         // Rel. 2.0 - Linux
00143 // The Error Code type
00144 typedef int CAENHVRESULT;
00145 #define __CAENHVRESULT__
00146 #endif
00147 
00148 #ifdef __cplusplus
00149 extern "C" {
00150 #endif // __cplusplus
00151 
00152 CAENHVLIB_API char         *CAENHVGetError(const char *SystemName);
00153 
00154 CAENHVLIB_API char         *CAENHVLibSwRel(void);
00155 
00156 CAENHVLIB_API CAENHVRESULT  CAENHVInitSystem(const char *SystemName, 
00157  int LinkType, void *Arg, const char *UserName, const char *Passwd);
00158 
00159 CAENHVLIB_API CAENHVRESULT  CAENHVDeinitSystem(const char *SystemName);
00160 
00161 CAENHVLIB_API CAENHVRESULT  CAENHVGetChName(const char *SystemName, ushort slot, 
00162  ushort ChNum, const ushort *ChList, char (*ChNameList)[MAX_CH_NAME]);
00163 
00164 CAENHVLIB_API CAENHVRESULT  CAENHVSetChName(const char *SystemName, ushort slot, 
00165  ushort ChNum, const ushort *ChList, const char *ChName);
00166 
00167 CAENHVLIB_API CAENHVRESULT  CAENHVGetChParamInfo(const char *SystemName, 
00168  ushort slot, ushort Ch, char **ParNameList);
00169 
00170 CAENHVLIB_API CAENHVRESULT  CAENHVGetChParamProp(const char *SystemName, 
00171  ushort slot, ushort Ch, const char *ParName, const char *PropName, void *retval);
00172 
00173 CAENHVLIB_API CAENHVRESULT  CAENHVGetChParam(const char *SystemName, ushort slot, 
00174  const char *ParName, ushort ChNum, const ushort *ChList, void *ParValList);
00175 
00176 CAENHVLIB_API CAENHVRESULT  CAENHVSetChParam(const char *SystemName, ushort slot, 
00177  const char *ParName, ushort ChNum, const ushort *ChList, void *ParValue);
00178 
00179 CAENHVLIB_API CAENHVRESULT  CAENHVTestBdPresence(const char *SystemName, 
00180  ushort slot, ushort *NrofCh, char *Model, char *Description, ushort *SerNum, 
00181  uchar *FmwRelMin, uchar *FmwRelMax);
00182 
00183 CAENHVLIB_API CAENHVRESULT  CAENHVGetBdParamInfo(const char *SystemName, 
00184  ushort slot, char **ParNameList);
00185 
00186 CAENHVLIB_API CAENHVRESULT  CAENHVGetBdParamProp(const char *SystemName, 
00187  ushort slot, const char *ParName, const char *PropName, void *retval);
00188 
00189 CAENHVLIB_API CAENHVRESULT  CAENHVGetBdParam(const char *SystemName, 
00190  ushort slotNum, const ushort *slotList, const char *ParName, void *ParValList);
00191 
00192 CAENHVLIB_API CAENHVRESULT  CAENHVSetBdParam(const char *SystemName, 
00193  ushort slotNum, const ushort *slotList, const char *ParName, void *ParValue);
00194 
00195 CAENHVLIB_API CAENHVRESULT  CAENHVGetGrpComp(const char *SystemName, ushort group, 
00196  ushort *NrOfCh, ulong **ChList);
00197 
00198 CAENHVLIB_API CAENHVRESULT  CAENHVAddChToGrp(const char *SystemName, ushort group, 
00199  ushort NrOfCh, const ulong *ChList);
00200 
00201 CAENHVLIB_API CAENHVRESULT  CAENHVRemChToGrp(const char *SystemName, ushort group, 
00202  ushort NrOfCh, const ulong *ChList);
00203 
00204 CAENHVLIB_API CAENHVRESULT  CAENHVGetGrpParam(const char *SystemName, ushort Group, 
00205  ushort NrOfPar, const uchar **ParNameList, void *ParValList);
00206 
00207 CAENHVLIB_API CAENHVRESULT  CAENHVSetGrpParam(const char *SystemName, ushort Group, 
00208  const uchar *ParName, void *ParVal);
00209 
00210 CAENHVLIB_API CAENHVRESULT  CAENHVGetCrateMap(const char *SystemName,   
00211  ushort *NrOfSlot, ushort **NrofChList, char **ModelList, char **DescriptionList,
00212  ushort **SerNumList, uchar **FmwRelMinList, uchar **FmwRelMaxList);
00213 
00214 CAENHVLIB_API CAENHVRESULT  CAENHVGetExecCommList(const char *SystemName,
00215  ushort *NumComm, char **CommNameList);
00216 
00217 CAENHVLIB_API CAENHVRESULT  CAENHVExecComm(const char *SystemName, 
00218  const char *CommName);
00219 
00220 CAENHVLIB_API CAENHVRESULT  CAENHVGetSysPropList(const char *SystemName, 
00221  ushort *NumProp, char **PropNameList);
00222 
00223 CAENHVLIB_API CAENHVRESULT  CAENHVGetSysPropInfo(const char *SystemName, 
00224  const char *PropName, unsigned *PropMode, unsigned *PropType);
00225 
00226 CAENHVLIB_API CAENHVRESULT  CAENHVGetSysProp(const char *SystemName, 
00227  const char *PropName, void *Result);
00228 
00229 /* Rel. 1.2 */
00230 CAENHVLIB_API CAENHVRESULT  CAENHVSetSysProp(const char *SystemName, 
00231  const char     *PropName, void *Set);
00232 
00233 /* Rel. 1.1 */
00234 CAENHVLIB_API CAENHVRESULT CAENHVCaenetComm(const char *SystemName, 
00235  ushort Crate, ushort Code, ushort NrWCode, ushort *WCode, short *Result,
00236  ushort *NrOfData, ushort **Data);
00237 
00238 #ifdef __cplusplus
00239 }
00240 #endif // __cplusplus
00241 
00242 //*******************************************************// !!! CAEN
00243 //#define _CRTDBG_MAP_ALLOC
00244 //#include <stdlib.h>
00245 //#include <crtdbg.h>
00246 //*******************************************************// !!! CAEN
00247 
00248 
00249 #endif // __CAENHVWRAPPER_H

Generated on Tue Dec 10 2013 04:52:21 for ROCsoft by  doxygen 1.7.1