hpe3631a.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:15k
源码类别:

MTK

开发平台:

C++ Builder

  1. /* Copyright (C) 1997 Hewlett-Packard Company */
  2. /* VXIplug&play Instrument Driver for the hpe3631a*/
  3. #ifndef hpe3631a_INCLUDE 
  4. #define hpe3631a_INCLUDE
  5. #include "vpptype.h"
  6. #if defined(__cplusplus) || defined(__cplusplus__)
  7. extern "C" {
  8. #endif
  9. /*****************************************************************************/
  10. /*  hpe3631a.h                                                                 */
  11. /*  Copyright (C) 1997 Hewlett-Packard Company                               */
  12. /*---------------------------------------------------------------------------*/
  13. /*  Driver for hpe3631a, Triple Output DC Power Supply                                     */
  14. /*  Driver Version: A.03.01                                                  */
  15. /*****************************************************************************/
  16. /*****************************************************************************/
  17. /*  STANDARD SECTION                                                         */
  18. /*  Constants and function prototypes for HP standard functions.             */
  19. /*****************************************************************************/
  20. /*---------------------------------------------------------------------------*/
  21. /* DEVELOPER: Remove what you don't need from this standard function         */
  22. /*              section, with the exception that VPP required functions      */
  23. /*              may not be removed.                                          */
  24. /*            Don't add to this section - add to the instrument specific     */
  25. /*              section below.                                               */
  26. /*            Don't change section - if you need to "change" the prototype   */
  27. /*              of a standard function, delete it from this section and      */
  28. /*              add a new function (named differently) in the instrument     */
  29. /*              specific section.                                            */
  30. /*---------------------------------------------------------------------------*/
  31.         /***************************************************/
  32.         /*  Standard constant error conditions returned    */
  33.         /*  by driver functions.                           */
  34.         /*    HP Common Error numbers start at BFFC0D00    */
  35.         /*    The parameter errors extend the number of    */
  36.         /*      errors over the eight defined in VPP 3.4   */
  37.         /***************************************************/
  38. #define hpe3631a_INSTR_ERROR_NULL_PTR      (_VI_ERROR+0x3FFC0D02L) /* 0xBFFC0D02 */
  39. #define hpe3631a_INSTR_ERROR_RESET_FAILED  (_VI_ERROR+0x3FFC0D03L) /* 0xBFFC0D03 */
  40. #define hpe3631a_INSTR_ERROR_UNEXPECTED    (_VI_ERROR+0x3FFC0D04L) /* 0xBFFC0D04 */
  41. #define hpe3631a_INSTR_ERROR_INV_SESSION   (_VI_ERROR+0x3FFC0D05L) /* 0xBFFC0D05 */
  42. #define hpe3631a_INSTR_ERROR_LOOKUP        (_VI_ERROR+0x3FFC0D06L) /* 0xBFFC0D06 */
  43. #define hpe3631a_INSTR_ERROR_DETECTED      (_VI_ERROR+0x3FFC0D07L) /* 0xBFFC0D07 */
  44. #define hpe3631a_INSTR_NO_LAST_COMMA       (_VI_ERROR+0x3FFC0D08L) /* 0xBFFC0D08 */ 
  45. #define hpe3631a_INSTR_ERROR_PARAMETER9    (_VI_ERROR+0x3FFC0D20L) /* 0xBFFC0D20 */
  46. #define hpe3631a_INSTR_ERROR_PARAMETER10   (_VI_ERROR+0x3FFC0D21L) /* 0xBFFC0D21 */
  47. #define hpe3631a_INSTR_ERROR_PARAMETER11   (_VI_ERROR+0x3FFC0D22L) /* 0xBFFC0D22 */
  48. #define hpe3631a_INSTR_ERROR_PARAMETER12   (_VI_ERROR+0x3FFC0D23L) /* 0xBFFC0D23 */
  49. #define hpe3631a_INSTR_ERROR_PARAMETER13   (_VI_ERROR+0x3FFC0D24L) /* 0xBFFC0D24 */
  50. #define hpe3631a_INSTR_ERROR_PARAMETER14   (_VI_ERROR+0x3FFC0D25L) /* 0xBFFC0D25 */
  51. #define hpe3631a_INSTR_ERROR_PARAMETER15   (_VI_ERROR+0x3FFC0D26L) /* 0xBFFC0D26 */
  52. #define hpe3631a_INSTR_ERROR_PARAMETER16   (_VI_ERROR+0x3FFC0D27L) /* 0xBFFC0D27 */
  53. #define hpe3631a_INSTR_ERROR_PARAMETER17   (_VI_ERROR+0x3FFC0D28L) /* 0xBFFC0D28 */
  54. #define hpe3631a_INSTR_ERROR_PARAMETER18   (_VI_ERROR+0x3FFC0D29L) /* 0xBFFC0D29 */
  55.         /***************************************************/
  56.         /*  Constants used by system status functions      */
  57.         /*    These defines are bit numbers which define   */
  58.         /*    the operation and questionable registers.    */
  59.         /*    They are instrument specific.                */
  60.         /***************************************************/
  61.         /***************************************************/
  62.         /*  Constants used by function hpe3631a_timeOut      */
  63.         /***************************************************/
  64. #define hpe3631a_TIMEOUT_MAX         2147483647L
  65. #define hpe3631a_TIMEOUT_MIN         0L
  66. #define hpe3631a_CMDINT16ARR_Q_MIN   1L
  67. #define hpe3631a_CMDINT16ARR_Q_MAX   2147483647L
  68. #define hpe3631a_CMDINT32ARR_Q_MIN   1L
  69. #define hpe3631a_CMDINT32ARR_Q_MAX   2147483647L
  70. #define hpe3631a_CMDREAL64ARR_Q_MIN  1L
  71. #define hpe3631a_CMDREAL64ARR_Q_MAX  2147483647L
  72.         /***************************************************/
  73.         /*  Required plug and play functions from VPP-3.1  */
  74.         /***************************************************/
  75. ViStatus _VI_FUNC hpe3631a_init
  76.                         (ViRsrc resourceName,
  77.                          ViBoolean IDQuery,
  78.                          ViBoolean resetDevice,
  79.                          ViPSession instrumentHandle);
  80. ViStatus _VI_FUNC hpe3631a_close
  81.                         (ViSession instrumentHandle);
  82. ViStatus _VI_FUNC hpe3631a_reset
  83.                         (ViSession instrumentHandle);
  84. ViStatus _VI_FUNC hpe3631a_self_test
  85.                         (ViSession      instrumentHandle,
  86.                          ViPInt16       selfTestResult,
  87.                          ViChar _VI_FAR selfTestMessage[]);
  88. ViStatus _VI_FUNC hpe3631a_error_query
  89.                         (ViSession  instrumentHandle,
  90.                          ViPInt32  errorCode,
  91.                          ViChar _VI_FAR errorMessage[]);
  92. ViStatus _VI_FUNC hpe3631a_error_message
  93.                         (ViSession instrumentHandle,
  94.                          ViStatus statusCode,
  95.                          ViChar _VI_FAR message[]);
  96. ViStatus _VI_FUNC hpe3631a_revision_query
  97.                         (ViSession instrumentHandle,
  98.                          ViChar _VI_FAR instrumentDriverRevision[],
  99.                          ViChar _VI_FAR firmwareRevision[]);
  100.         /***************************************************/
  101.         /*  HP standard utility functions                  */
  102.         /***************************************************/
  103. ViStatus _VI_FUNC hpe3631a_timeOut
  104.                         (ViSession instrumentHandle,
  105.                          ViInt32 setTimeOut);
  106. ViStatus _VI_FUNC hpe3631a_timeOut_Q
  107.                         (ViSession instrumentHandle,
  108.                          ViPInt32 timeOut);
  109. ViStatus _VI_FUNC hpe3631a_errorQueryDetect
  110.                         (ViSession instrumentHandle,
  111.                          ViBoolean setErrorQueryDetect);
  112. ViStatus _VI_FUNC hpe3631a_errorQueryDetect_Q
  113.                         (ViSession instrumentHandle,
  114.                          ViPBoolean errorQueryDetect);
  115. ViStatus _VI_FUNC hpe3631a_dcl
  116.                         (ViSession instrumentHandle);
  117. ViStatus _VI_FUNC hpe3631a_opc_Q
  118.                         (ViSession instrumentHandle,
  119.                          ViPBoolean instrumentReady);
  120.         /***************************************************/
  121.         /*  HP standard status functions                   */
  122.         /***************************************************/
  123. ViStatus _VI_FUNC hpe3631a_readStatusByte_Q
  124.                         (ViSession instrumentHandle,
  125.                          ViPInt16 statusByte);
  126. ViStatus _VI_FUNC hpe3631a_operEvent_Q
  127.                         (ViSession instrumentHandle,
  128.                          ViPInt32 operationEventRegister);
  129. ViStatus _VI_FUNC hpe3631a_operCond_Q
  130.                         (ViSession instrumentHandle,
  131.                          ViPInt32 operationConditionRegister );
  132. ViStatus _VI_FUNC hpe3631a_quesEvent_Q
  133.                         (ViSession instrumentHandle,
  134.                          ViPInt32 questionableEventRegister );
  135. ViStatus _VI_FUNC hpe3631a_quesCond_Q
  136.                         (ViSession instrumentHandle,
  137.                          ViPInt32 questionableConditionRegister );
  138.         /***************************************************/
  139.         /*  HP standard command passthrough functions      */
  140.         /***************************************************/
  141. ViStatus _VI_FUNC hpe3631a_cmd
  142.                         (ViSession instrumentHandle,
  143.                          ViString sendStringCommand);
  144. ViStatus _VI_FUNC hpe3631a_cmdString_Q
  145.                         (ViSession instrumentHandle,
  146.                          ViString queryStringCommand, 
  147.                      ViInt32 stringSize,
  148.                          ViChar _VI_FAR stringResult[]);
  149. ViStatus _VI_FUNC hpe3631a_cmdInt
  150.                         (ViSession instrumentHandle,
  151.                          ViString sendIntegerCommand,
  152.                          ViInt32 sendInteger);
  153. ViStatus _VI_FUNC hpe3631a_cmdInt16_Q
  154.                         (ViSession instrumentHandle,
  155.                          ViString queryI16Command,
  156.                          ViPInt16 i16Result);
  157. ViStatus _VI_FUNC hpe3631a_cmdInt32_Q
  158.                         (ViSession instrumentHandle,
  159.                          ViString queryI32Command,
  160.                          ViPInt32 i32Result);
  161. ViStatus _VI_FUNC hpe3631a_cmdInt16Arr_Q
  162.                         (ViSession instrumentHandle,
  163.                          ViString queryI16ArrayCommand,
  164.                          ViInt32 i16ArraySize,
  165.                          ViInt16 _VI_FAR i16ArrayResult[],
  166.                          ViPInt32 i16ArrayCount);
  167. ViStatus _VI_FUNC hpe3631a_cmdInt32Arr_Q
  168.                         (ViSession instrumentHandle,
  169.                          ViString queryI32ArrayCommand,
  170.                          ViInt32 i32ArraySize,
  171.                          ViInt32 _VI_FAR i32ArrayResult[],
  172.                          ViPInt32 i32ArrayCount);
  173.     
  174. ViStatus _VI_FUNC hpe3631a_cmdReal
  175.                         (ViSession instrumentHandle,
  176.                          ViString sendRealCommand,
  177.                          ViReal64 sendReal);
  178. ViStatus _VI_FUNC hpe3631a_cmdReal64_Q
  179.                         (ViSession instrumentHandle,
  180.                          ViString queryRealCommand,
  181.                          ViPReal64 realResult);
  182. ViStatus _VI_FUNC hpe3631a_cmdReal64Arr_Q
  183.                         (ViSession instrumentHandle,
  184.                          ViString realArrayCommand,
  185.                          ViInt32 realArraySize,
  186.                          ViReal64 _VI_FAR realArrayResult[],
  187.                          ViPInt32 realArrayCount);
  188. /* End of HP standard declarations */
  189. /*---------------------------------------------------------------------------*/
  190. /*****************************************************************************/
  191. /*  INSTRUMENT SPECIFIC SECTION                                              */
  192. /*  Constants and function prototypes for instrument specific functions.     */
  193. /*****************************************************************************/
  194. /*---------------------------------------------------------------------------*/
  195. /* DEVELOPER: Add constants and function prototypes here.                    */
  196. /*            As a matter of style, add the constant #define's first,        */
  197. /*              followed by function prototypes.                             */
  198. /*            Remember that function prototypes must be consistent with      */
  199. /*              the driver's function panel prototypes.                      */
  200. /*---------------------------------------------------------------------------*/
  201.         /***************************************************/
  202.         /*  Instrument specific constants                  */
  203.         /***************************************************/
  204. #define hpe3631a_FILE_OPEN_ERROR      (_VI_ERROR+0x3FFC0D30L) /* 0xBFFC0D30 */
  205. #define hpe3631a_FILE_READ_ERROR     (_VI_ERROR+0x3FFC0D31L) /* 0xBFFC0D31 */
  206. #define hpe3631a_FILE_WRITE_ERROR     (_VI_ERROR+0x3FFC0D32L) /* 0xBFFC0D32 */
  207.         /***************************************************/
  208.         /*  Instrument specific functions                  */
  209.         /***************************************************/
  210. /* End of instrument specific declarations */
  211. /*---------------------------------------------------------------------------*/
  212. /******   Used by Function hpe3631a_current   *****/
  213. #define  hpe3631a_CURR_INST1  1
  214. #define  hpe3631a_CURR_INST2  2
  215. #define  hpe3631a_CURR_INST3  3
  216. #define  hpe3631a_CURR_MAX  5.15
  217. #define  hpe3631a_CURR_MIN  0
  218. /******   Used by Function hpe3631a_measureCurrent_Q   *****/
  219. #define  hpe3631a_CURR_MEAS1  1
  220. #define  hpe3631a_CURR_MEAS2  2
  221. #define  hpe3631a_CURR_MEAS3  3
  222. /******   Used by Function hpe3631a_measureVoltage_Q   *****/
  223. #define  hpe3631a_VOLT_MEAS1  1
  224. #define  hpe3631a_VOLT_MEAS2  2
  225. #define  hpe3631a_VOLT_MEAS3  3
  226. /******   Used by Function hpe3631a_outputOn   *****/
  227. #define  hpe3631a_OUTPUT_OFF  0
  228. #define  hpe3631a_OUTPUT_ON  1
  229. /******   Used by Function hpe3631a_stepVoltageRange   *****/
  230. #define  hpe3631a_STEP_INST1  1
  231. #define  hpe3631a_STEP_INST2  2
  232. #define  hpe3631a_STEP_INST3  3
  233. #define  hpe3631a_START_VOLT_MAX  30.9
  234. #define  hpe3631a_START_VOLT_MIN  -30.9
  235. #define  hpe3631a_END_VOLT_MAX  30.9
  236. #define  hpe3631a_END_VOLT_MIN  -30.9
  237. #define  hpe3631a_STEP_VOLT_MAX  30.9
  238. #define  hpe3631a_STEP_VOLT_MIN  -30.9
  239. #define  hpe3631a_DELAY_MAX  100000
  240. #define  hpe3631a_DELAY_MIN  0
  241. #define  hpe3631a_CURR_LIMIT_MAX  7.21
  242. #define  hpe3631a_CURR_LIMIT_MIN  0
  243. #define  hpe3631a_ARR_LENGTH_MAX  1028
  244. #define  hpe3631a_ARR_LENGTH_MIN  1
  245. /******   Used by Function hpe3631a_voltage   *****/
  246. #define  hpe3631a_VOLT_INST1  1
  247. #define  hpe3631a_VOLT_INST2  2
  248. #define  hpe3631a_VOLT_INST3  3
  249. #define  hpe3631a_VOLT_MAX  30.9
  250. #define  hpe3631a_VOLT_MIN  -30.9
  251. ViStatus _VI_FUNC hpe3631a_current  (ViSession instrumentHandle, ViInt16 instrument, ViReal64 current);
  252. ViStatus _VI_FUNC hpe3631a_measureCurrent_Q  (ViSession instrumentHandle, ViInt16 instrument, ViPReal64 current);
  253. ViStatus _VI_FUNC hpe3631a_measureVoltage_Q  (ViSession instrumentHandle, ViInt16 instrument, ViPReal64 voltage);
  254. ViStatus _VI_FUNC hpe3631a_outputOn  (ViSession instrumentHandle, ViInt16 state);
  255. ViStatus _VI_FUNC hpe3631a_stepVoltageRange  (ViSession instrumentHandle, ViInt16 instrument, ViReal64 startVoltage, ViReal64 endVoltage, ViReal64 step, ViInt32 delay, ViReal64 currentLimit, ViReal64 _VI_FAR voltArray[], ViReal64 _VI_FAR currArray[], ViInt32 arrayLength);
  256. ViStatus _VI_FUNC hpe3631a_voltage  (ViSession instrumentHandle, ViInt16 instrument, ViReal64 voltage);
  257. /* Used for "C" externs in C++ */
  258. #if defined(__cplusplus) || defined(__cplusplus__)
  259. }    /* end of "C" externs for C++ */
  260. #endif 
  261. #endif /* hpe3631a_INCLUDE */