Project

General

Profile

Files » inst.h

Frédéric Blanc, 2016-01-29 10:30

 
/*****************************************************************************
/*=CHANGE:===============================================================*
Change the copyright note.
*=======================================================================*
* Copyright 2009, National Instruments, Corporation. All Rights Reserved. *
*****************************************************************************/
/****************************************************************************
* inst
*
* Title: inst.h
* Purpose: inst
* instrument driver declarations.
*
****************************************************************************/

#ifndef __INST_HEADER
#define __INST_HEADER

#include <ivi.h>

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

/****************************************************************************
*----------------- Instrument Driver Revision Information -----------------*
****************************************************************************/
/*=CHANGE:===============================================================
The major and minor version of the driver should be a number between
0 and 255
*============================================================END=CHANGE=*/
#define INST_MAJOR_VERSION 1 /* Instrument driver major version */
#define INST_MINOR_VERSION 0 /* Instrument driver minor version */
/*=CHANGE:===============================================================
Enter the correct version of the class specification
*============================================================END=CHANGE=*/
#define INST_CLASS_SPEC_MAJOR_VERSION 2 /* Class specification major version */
#define INST_CLASS_SPEC_MINOR_VERSION 0 /* Class specification minor version */


/*=CHANGE:===============================================================
Add supported instrument models.
Add your company name.
Add useful instrument driver description.
*============================================================END=CHANGE=*/
#define INST_SUPPORTED_INSTRUMENT_MODELS "MODEL1,MODEL2,MODEL3,MODEL4"
#define INST_DRIVER_VENDOR "My Company & Co."
#ifdef _IVI_mswin64_
#define INST_DRIVER_DESCRIPTION "Description [Compiled for 64-bit.]"
#else
#define INST_DRIVER_DESCRIPTION "Description"
#endif

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

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

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

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

/* User Options */
#define INST_ATTR_RANGE_CHECK IVI_ATTR_RANGE_CHECK /* ViBoolean */
#define INST_ATTR_QUERY_INSTRUMENT_STATUS IVI_ATTR_QUERY_INSTRUMENT_STATUS /* ViBoolean */
#define INST_ATTR_CACHE IVI_ATTR_CACHE /* ViBoolean */
#define INST_ATTR_SIMULATE IVI_ATTR_SIMULATE /* ViBoolean */
#define INST_ATTR_RECORD_COERCIONS IVI_ATTR_RECORD_COERCIONS /* ViBoolean */
#define INST_ATTR_INTERCHANGE_CHECK IVI_ATTR_INTERCHANGE_CHECK /* ViBoolean */
/* Driver Information */
#define INST_ATTR_SPECIFIC_DRIVER_PREFIX IVI_ATTR_SPECIFIC_DRIVER_PREFIX /* ViString, read-only */
#define INST_ATTR_SUPPORTED_INSTRUMENT_MODELS IVI_ATTR_SUPPORTED_INSTRUMENT_MODELS /* ViString, read-only */
#define INST_ATTR_GROUP_CAPABILITIES IVI_ATTR_GROUP_CAPABILITIES /* ViString, read-only */
#define INST_ATTR_INSTRUMENT_MANUFACTURER IVI_ATTR_INSTRUMENT_MANUFACTURER /* ViString, read-only */
#define INST_ATTR_INSTRUMENT_MODEL IVI_ATTR_INSTRUMENT_MODEL /* ViString, read-only */
#define INST_ATTR_INSTRUMENT_FIRMWARE_REVISION IVI_ATTR_INSTRUMENT_FIRMWARE_REVISION /* ViString, read-only */
#define INST_ATTR_SPECIFIC_DRIVER_REVISION IVI_ATTR_SPECIFIC_DRIVER_REVISION /* ViString, read-only */
#define INST_ATTR_SPECIFIC_DRIVER_VENDOR IVI_ATTR_SPECIFIC_DRIVER_VENDOR /* ViString, read-only */
#define INST_ATTR_SPECIFIC_DRIVER_DESCRIPTION IVI_ATTR_SPECIFIC_DRIVER_DESCRIPTION /* ViString, read-only */
#define INST_ATTR_SPECIFIC_DRIVER_CLASS_SPEC_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_CLASS_SPEC_MAJOR_VERSION /* ViInt32, read-only */
#define INST_ATTR_SPECIFIC_DRIVER_CLASS_SPEC_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_CLASS_SPEC_MINOR_VERSION /* ViInt32, read-only */

/* Advanced Session Information */
#define INST_ATTR_LOGICAL_NAME IVI_ATTR_LOGICAL_NAME /* ViString, read-only */
#define INST_ATTR_IO_RESOURCE_DESCRIPTOR IVI_ATTR_IO_RESOURCE_DESCRIPTOR /* ViString, read-only */
#define INST_ATTR_DRIVER_SETUP IVI_ATTR_DRIVER_SETUP /* ViString, read-only */
/*- Instrument-Specific Attributes -------------------------------------*/

/*=CHANGE:===============================================================*
Add attribute definitions here.
#define INST_ATTR_MY_ATTRIBUTE (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 2L)
*============================================================END=CHANGE=*/

/*- Obsolete Inherent Instrument Attributes ----------------------------*/
/*=CHANGE:=============================================================*
NOTE TO THE DEVELOPER: These attributes are obsolete and may not be
supported in future versions of IVI drivers.
If you DO NOT want this driver to be compliant with NI's Ivi Driver
Toolset 1.1, remove these attribute definitions.

If you DO want this driver to be compliant with NI's IVI Driver Toolset
1.1, remove the comments around these attribute definitions.

// Driver Information
#define INST_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MAJOR_VERSION // ViInt32, read-only
#define INST_ATTR_SPECIFIC_DRIVER_MINOR_VERSION IVI_ATTR_SPECIFIC_DRIVER_MINOR_VERSION // ViInt32, read-only

// Error Info
#define INST_ATTR_PRIMARY_ERROR IVI_ATTR_PRIMARY_ERROR // ViInt32
#define INST_ATTR_SECONDARY_ERROR IVI_ATTR_SECONDARY_ERROR // ViInt32
#define INST_ATTR_ERROR_ELABORATION IVI_ATTR_ERROR_ELABORATION // ViString

// Advanced Session Information
#define INST_ATTR_IO_SESSION_TYPE IVI_ATTR_IO_SESSION_TYPE // ViString, read-only
#define INST_ATTR_IO_SESSION IVI_ATTR_IO_SESSION // ViSession, read-only

// Obsolete Attribute Identifiers for Renamed Attributes
#define INST_ATTR_NUM_CHANNELS IVI_ATTR_CHANNEL_COUNT
#define INST_ATTR_QUERY_INSTR_STATUS INST_ATTR_QUERY_INSTRUMENT_STATUS
#define INST_ATTR_RESOURCE_DESCRIPTOR INST_ATTR_IO_RESOURCE_DESCRIPTOR

*==========================================================END=CHANGE=*/


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

/* Instrument specific attribute value definitions */

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

// Defined values for attribute INST_ATTR_EXAMPLE

#define INST_VAL_EXAMPLE_1 1
#define INST_VAL_EXAMPLE_2 2
#define INST_VAL_EXAMPLE_3 3
*===========================================================END=CHANGE=*/

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

/*- Init and Close Functions -------------------------------------------*/
ViStatus _VI_FUNC inst_init (ViRsrc resourceName, ViBoolean IDQuery,
ViBoolean resetDevice, ViSession *vi);
ViStatus _VI_FUNC inst_InitWithOptions (ViRsrc resourceName, ViBoolean IDQuery,
ViBoolean resetDevice, ViConstString optionString,
ViSession *newVi);
ViStatus _VI_FUNC inst_close (ViSession vi);

/*- Coercion Info Functions --------------------------------------------*/
ViStatus _VI_FUNC inst_GetNextCoercionRecord (ViSession vi,
ViInt32 bufferSize,
ViChar record[]);
/*- Locking Functions --------------------------------------------------*/
ViStatus _VI_FUNC inst_LockSession (ViSession vi, ViBoolean *callerHasLock);
ViStatus _VI_FUNC inst_UnlockSession (ViSession vi, ViBoolean *callerHasLock);

/*=CHANGE:===============================================================*
Add instrument-specific public function declarations here.
*============================================================END=CHANGE=*/
/*- Error Functions ----------------------------------------------------*/
ViStatus _VI_FUNC inst_error_query (ViSession vi, ViInt32 *errorCode,
ViChar errorMessage[]);

ViStatus _VI_FUNC inst_GetError (ViSession vi, ViStatus *code,
ViInt32 bufferSize, ViChar description[]);
ViStatus _VI_FUNC inst_ClearError (ViSession vi);

ViStatus _VI_FUNC inst_error_message (ViSession vi, ViStatus errorCode,
ViChar errorMessage[256]);
/*- Obsolete Error Handling Functions ----------------------------*/
/*=CHANGE:=============================================================*
NOTE TO THE DEVELOPER: These functions are obsolete and may not be
supported in future versions of IVI drivers.
If you DO NOT want this driver to be compliant with NI's Ivi Driver
Toolset 1.1, remove these function definitions.

If you DO want this driver to be compliant with NI's IVI Driver Toolset
1.1, remove the comments around these functions definitions.

ViStatus _VI_FUNC inst_GetErrorInfo (ViSession vi, ViStatus *primaryError,
ViStatus *secondaryError,
ViChar errorElaboration[256]);
ViStatus _VI_FUNC inst_ClearErrorInfo (ViSession vi);
*==========================================================END=CHANGE=*/

/*- Interchangeability Checking Functions ------------------------------*/
ViStatus _VI_FUNC inst_GetNextInterchangeWarning (ViSession vi,
ViInt32 bufferSize,
ViChar warnString[]);
ViStatus _VI_FUNC inst_ResetInterchangeCheck (ViSession vi);
ViStatus _VI_FUNC inst_ClearInterchangeWarnings (ViSession vi);

/*- Utility Functions --------------------------------------------------*/
ViStatus _VI_FUNC inst_InvalidateAllAttributes (ViSession vi);
ViStatus _VI_FUNC inst_reset (ViSession vi);
ViStatus _VI_FUNC inst_ResetWithDefaults (ViSession vi);
ViStatus _VI_FUNC inst_self_test (ViSession vi, ViInt16 *selfTestResult,
ViChar selfTestMessage[]);
ViStatus _VI_FUNC inst_revision_query (ViSession vi,
ViChar instrumentDriverRevision[],
ViChar firmwareRevision[]);
ViStatus _VI_FUNC inst_Disable (ViSession vi);
ViStatus _VI_FUNC inst_WriteInstrData (ViSession vi, ViConstString writeBuffer);
ViStatus _VI_FUNC inst_ReadInstrData (ViSession vi, ViInt32 numBytes,
ViChar rdBuf[], ViInt32 *bytesRead);

/*- Set, Get, and Check Attribute Functions ----------------------------*/
ViStatus _VI_FUNC inst_GetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 *value);
ViStatus _VI_FUNC inst_GetAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt64 *value);
ViStatus _VI_FUNC inst_GetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 *value);
ViStatus _VI_FUNC inst_GetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 bufSize, ViChar value[]);
ViStatus _VI_FUNC inst_GetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession *value);
ViStatus _VI_FUNC inst_GetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean *value);

ViStatus _VI_FUNC inst_SetAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 value);
ViStatus _VI_FUNC inst_SetAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt64 value);
ViStatus _VI_FUNC inst_SetAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 value);
ViStatus _VI_FUNC inst_SetAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViConstString value);
ViStatus _VI_FUNC inst_SetAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession value);
ViStatus _VI_FUNC inst_SetAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean value);

ViStatus _VI_FUNC inst_CheckAttributeViInt32 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 value);
ViStatus _VI_FUNC inst_CheckAttributeViInt64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViInt64 value);
ViStatus _VI_FUNC inst_CheckAttributeViReal64 (ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 value);
ViStatus _VI_FUNC inst_CheckAttributeViString (ViSession vi, ViConstString channelName, ViAttr attribute, ViConstString value);
ViStatus _VI_FUNC inst_CheckAttributeViSession (ViSession vi, ViConstString channelName, ViAttr attribute, ViSession value);
ViStatus _VI_FUNC inst_CheckAttributeViBoolean (ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean value);

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

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

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




(9-9/25)