⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rs.h.bak

📁 CVI例程
💻 BAK
字号:
/****************************************************************************
 *                       RS232                           
 *---------------------------------------------------------------------------
 *   Copyright (c) National Instruments 1998.  All Rights Reserved.         
 *---------------------------------------------------------------------------
 *                                                                          
 * Title:    RS.h                                        
 * Purpose:  RS232                                       
 *           instrument driver declarations.                                
 *                                                                          
 ****************************************************************************/

#ifndef __RS_HEADER
#define __RS_HEADER

#include <ivi.h>

#if defined(__cplusplus) || defined(__cplusplus__)
extern "C" {
#endif

/****************************************************************************
 *----------------- Instrument Driver Revision Information -----------------*
 ****************************************************************************/
#define RS_MAJOR_VERSION         1     /* Instrument driver major version */
#define RS_MINOR_VERSION         0     /* Instrument driver minor version */

/**************************************************************************** 
 *------------------------------ Useful Macros -----------------------------* 
 ****************************************************************************/

        /*=CHANGE:===============================================================
           Add useful instrument macros here.                                                 
         *============================================================END=CHANGE=*/

/**************************************************************************** 
 *---------------------------- Attribute Defines ---------------------------* 
 ****************************************************************************/

    /*- IVI Inherent Instrument Attributes ---------------------------------*/    

        /* User Options */
#define RS_ATTR_RANGE_CHECK               IVI_ATTR_RANGE_CHECK              /* ViBoolean */
#define RS_ATTR_QUERY_INSTR_STATUS        IVI_ATTR_QUERY_INSTR_STATUS       /* ViBoolean */
#define RS_ATTR_CACHE                     IVI_ATTR_CACHE                    /* ViBoolean */
#define RS_ATTR_SIMULATE                  IVI_ATTR_SIMULATE                 /* ViBoolean */
#define RS_ATTR_RECORD_COERCIONS          IVI_ATTR_RECORD_COERCIONS         /* ViBoolean */

        /* Instrument Capabilities */
#define RS_ATTR_NUM_CHANNELS              IVI_ATTR_NUM_CHANNELS             /* ViInt32, Read-only */
#define RS_ATTR_SPECIFIC_PREFIX           IVI_ATTR_SPECIFIC_PREFIX          /* ViString, Read-only */

        /* Version Info */
#define RS_ATTR_DRIVER_MAJOR_VERSION      IVI_ATTR_DRIVER_MAJOR_VERSION     /* ViInt32, Read-only */
#define RS_ATTR_DRIVER_MINOR_VERSION      IVI_ATTR_DRIVER_MINOR_VERSION     /* ViInt32, Read-only */
#define RS_ATTR_DRIVER_REVISION           IVI_ATTR_DRIVER_REVISION          /* ViString, Read-only */
#define RS_ATTR_ENGINE_MAJOR_VERSION      IVI_ATTR_ENGINE_MAJOR_VERSION     /* ViInt32, Read-only */
#define RS_ATTR_ENGINE_MINOR_VERSION      IVI_ATTR_ENGINE_MINOR_VERSION     /* ViInt32, Read-only */
#define RS_ATTR_ENGINE_REVISION           IVI_ATTR_ENGINE_REVISION          /* ViString, Read-only */

        /* Error Info */
#define RS_ATTR_PRIMARY_ERROR             IVI_ATTR_PRIMARY_ERROR            /* ViInt32   */
#define RS_ATTR_SECONDARY_ERROR           IVI_ATTR_SECONDARY_ERROR          /* ViInt32   */
#define RS_ATTR_ERROR_ELABORATION         IVI_ATTR_ERROR_ELABORATION        /* ViString  */

        /* Advanced Session I/O */
#define RS_ATTR_VISA_RM_SESSION           IVI_ATTR_VISA_RM_SESSION          /* ViSession, Read-only */
#define RS_ATTR_IO_SESSION                IVI_ATTR_IO_SESSION               /* ViSession, Read-only */
#define RS_ATTR_DEFER_UPDATE              IVI_ATTR_DEFER_UPDATE             /* ViBoolean */
#define RS_ATTR_RETURN_DEFERRED_VALUES    IVI_ATTR_RETURN_DEFERRED_VALUES   /* ViBoolean */
    
    /*- Instrument-Specific Attributes -------------------------------------*/

#define RS_ATTR_ID_QUERY_RESPONSE      (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 1L)     /* ViString (Read Only) */
#define RS_ATTR_TEMPRETURE                  (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 2L)
#define RS_ATTR_PRESSURE                    (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 3L)
    /*=CHANGE:===============================================================*
        Add attribute definitions here.                                       
        #define RS_ATTR_MY_ATTRIBUTE     (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 2L) 
     *============================================================END=CHANGE=*/

    
/**************************************************************************** 
 *------------------------ Attribute Value Defines -------------------------* 
 ****************************************************************************/

        /* Instrument specific attribute value definitions */

    /*=CHANGE:==============================================================*
        Add value defines for instrument specific attributes here.  Example

    // Defined values for attribute RS_ATTR_EXAMPLE 

#define RS_VAL_EXAMPLE_1             1
#define RS_VAL_EXAMPLE_2             2
#define RS_VAL_EXAMPLE_3             3
     *===========================================================END=CHANGE=*/

/**************************************************************************** 
 *---------------- Instrument Driver Function Declarations -----------------* 
 ****************************************************************************/

    /*- Init and Close Functions -------------------------------------------*/
ViStatus _VI_FUNC  RS_init (ViRsrc resourceName, ViBoolean IDQuery,
                                  ViBoolean resetDevice, ViSession *vi);
ViStatus _VI_FUNC  RS_InitWithOptions (ViRsrc resourceName, ViBoolean IDQuery,
                                             ViBoolean resetDevice, ViString optionString, 
                                             ViSession *newVi);
ViStatus _VI_FUNC  RS_close (ViSession vi);   

    /*- Locking Functions --------------------------------------------------*/
ViStatus _VI_FUNC  RS_LockSession (ViSession vi, ViBoolean *callerHasLock);   
ViStatus _VI_FUNC  RS_UnlockSession (ViSession vi, ViBoolean *callerHasLock);

        /*=CHANGE:===============================================================*
           Add instrument-specific public function declarations here.                           
         *============================================================END=CHANGE=*/
    
    /*- Error Functions ----------------------------------------------------*/
ViStatus _VI_FUNC  RS_error_query (ViSession vi, ViInt32 *errorCode,
                                         ViChar errorMessage[]);
ViStatus _VI_FUNC  RS_GetErrorInfo (ViSession vi, ViStatus *primaryError, 
                                          ViStatus *secondaryError, 
                                          ViChar errorElaboration[256]);
ViStatus _VI_FUNC  RS_ClearErrorInfo (ViSession vi);
ViStatus _VI_FUNC  RS_error_message (ViSession vi, ViStatus errorCode,
                                           ViChar errorMessage[256]);
    
    /*- Utility Functions --------------------------------------------------*/
ViStatus _VI_FUNC  RS_reset (ViSession vi);
ViStatus _VI_FUNC  RS_self_test (ViSession vi, ViInt16 *selfTestResult,
                                       ViChar selfTestMessage[]);
ViStatus _VI_FUNC  RS_revision_query (ViSession vi, 
                                            ViChar instrumentDriverRevision[],
                                            ViChar firmwareRevision[]);
ViStatus _VI_FUNC  RS_WriteInstrData (ViSession vi, ViConstString writeBuffer); 
ViStatus _VI_FUNC  RS_ReadInstrData  (ViSession vi, ViInt32 numBytes, 
                                            ViChar rdBuf[], ViInt32 *bytesRead);

    /*- Set, Get, and Check Attribute Functions ----------------------------*/
ViStatus _VI_FUNC  RS_GetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 *value);
ViStatus _VI_FUNC  RS_GetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 *value);
ViStatus _VI_FUNC  RS_GetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 bufSize, ViChar value[]); 
ViStatus _VI_FUNC  RS_GetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession *value);
ViStatus _VI_FUNC  RS_GetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean *value);

ViStatus _VI_FUNC  RS_SetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 value);
ViStatus _VI_FUNC  RS_SetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 value);
ViStatus _VI_FUNC  RS_SetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViConstString value); 
ViStatus _VI_FUNC  RS_SetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession value);
ViStatus _VI_FUNC  RS_SetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean value);

ViStatus _VI_FUNC  RS_CheckAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 value);
ViStatus _VI_FUNC  RS_CheckAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 value);
ViStatus _VI_FUNC  RS_CheckAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViConstString value); 
ViStatus _VI_FUNC  RS_CheckAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession value);
ViStatus _VI_FUNC  RS_CheckAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean value);

    /*********************************************************
        Functions reserved for class driver use only.
        End-users should not call these functions.  
     *********************************************************/
ViStatus _VI_FUNC  RS_IviInit (ViRsrc resourceName, ViBoolean IDQuery, 
                                     ViBoolean reset, ViSession vi);
ViStatus _VI_FUNC  RS_IviClose (ViSession vi);   

/****************************************************************************
 *------------------------ Error And Completion Codes ----------------------*
 ****************************************************************************/
    /*=CHANGE:==============================================================*
        Add instrument-specific error codes here starting at
        IVI_SPECIFIC_ERROR_BASE.  Example:

#define RS_ERROR_NAME  (IVI_SPECIFIC_ERROR_BASE + 1)
     *===========================================================END=CHANGE=*/

/**************************************************************************** 
 *---------------------------- End Include File ----------------------------* 
 ****************************************************************************/
#if defined(__cplusplus) || defined(__cplusplus__)
}
#endif
#endif /* __RS_HEADER */




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -