📄 visa.h
字号:
#define VI_UTIL_ASSERT_SYSRESET (1)
#define VI_UTIL_ASSERT_SYSFAIL (2)
#define VI_UTIL_DEASSERT_SYSFAIL (3)
#define VI_VXI_CLASS_MEMORY (0)
#define VI_VXI_CLASS_EXTENDED (1)
#define VI_VXI_CLASS_MESSAGE (2)
#define VI_VXI_CLASS_REGISTER (3)
#define VI_VXI_CLASS_OTHER (4)
#define VI_PXI_ADDR_NONE (0)
#define VI_PXI_ADDR_MEM (1)
#define VI_PXI_ADDR_IO (2)
#define VI_PXI_ADDR_CFG (3)
#define VI_TRIG_UNKNOWN (-1)
#define VI_PXI_LBUS_UNKNOWN (-1)
#define VI_PXI_LBUS_NONE (0)
#define VI_PXI_LBUS_STAR_TRIG_BUS_0 (1000)
#define VI_PXI_LBUS_STAR_TRIG_BUS_1 (1001)
#define VI_PXI_LBUS_STAR_TRIG_BUS_2 (1002)
#define VI_PXI_LBUS_STAR_TRIG_BUS_3 (1003)
#define VI_PXI_LBUS_STAR_TRIG_BUS_4 (1004)
#define VI_PXI_LBUS_STAR_TRIG_BUS_5 (1005)
#define VI_PXI_LBUS_STAR_TRIG_BUS_6 (1006)
#define VI_PXI_LBUS_STAR_TRIG_BUS_7 (1007)
#define VI_PXI_LBUS_STAR_TRIG_BUS_8 (1008)
#define VI_PXI_LBUS_STAR_TRIG_BUS_9 (1009)
#define VI_PXI_STAR_TRIG_CONTROLLER (1413)
/*- Backward Compatibility Macros -------------------------------------------*/
#define viGetDefaultRM(vi) viOpenDefaultRM(vi)
#define VI_ERROR_INV_SESSION (VI_ERROR_INV_OBJECT)
#define VI_INFINITE (VI_TMO_INFINITE)
#define VI_NORMAL (VI_PROT_NORMAL)
#define VI_FDC (VI_PROT_FDC)
#define VI_HS488 (VI_PROT_HS488)
#define VI_ASRL488 (VI_PROT_4882_STRS)
#define VI_ASRL_IN_BUF (VI_IO_IN_BUF)
#define VI_ASRL_OUT_BUF (VI_IO_OUT_BUF)
#define VI_ASRL_IN_BUF_DISCARD (VI_IO_IN_BUF_DISCARD)
#define VI_ASRL_OUT_BUF_DISCARD (VI_IO_OUT_BUF_DISCARD)
/*- National Instruments ----------------------------------------------------*/
#define VI_INTF_RIO (8)
#define VI_INTF_FIREWIRE (9)
#define VI_ATTR_SYNC_MXI_ALLOW_EN (0x3FFF0161UL) /* ViBoolean, read/write */
/* This is for VXI SERVANT resources */
#define VI_EVENT_VXI_DEV_CMD (0xBFFF200FUL)
#define VI_ATTR_VXI_DEV_CMD_TYPE (0x3FFF4037UL) /* ViInt16, read-only */
#define VI_ATTR_VXI_DEV_CMD_VALUE (0x3FFF4038UL) /* ViUInt32, read-only */
#define VI_VXI_DEV_CMD_TYPE_16 (16)
#define VI_VXI_DEV_CMD_TYPE_32 (32)
ViStatus _VI_FUNC viVxiServantResponse(ViSession vi, ViInt16 mode, ViUInt32 resp);
/* mode values include VI_VXI_RESP16, VI_VXI_RESP32, and the next 2 values */
#define VI_VXI_RESP_NONE (0)
#define VI_VXI_RESP_PROT_ERROR (-1)
/* This allows extended Serial support on Win32 and on NI ENET Serial products */
#define VI_ATTR_ASRL_DISCARD_NULL (0x3FFF00B0UL)
#define VI_ATTR_ASRL_CONNECTED (0x3FFF01BBUL)
#define VI_ATTR_ASRL_BREAK_STATE (0x3FFF01BCUL)
#define VI_ATTR_ASRL_BREAK_LEN (0x3FFF01BDUL)
#define VI_ATTR_ASRL_ALLOW_TRANSMIT (0x3FFF01BEUL)
#define VI_ATTR_ASRL_WIRE_MODE (0x3FFF01BFUL)
#define VI_ASRL_WIRE_485_4 (0)
#define VI_ASRL_WIRE_485_2_DTR_ECHO (1)
#define VI_ASRL_WIRE_485_2_DTR_CTRL (2)
#define VI_ASRL_WIRE_485_2_AUTO (3)
#define VI_ASRL_WIRE_232_DTE (128)
#define VI_ASRL_WIRE_232_DCE (129)
#define VI_ASRL_WIRE_232_AUTO (130)
#define VI_EVENT_ASRL_BREAK (0x3FFF2023UL)
#define VI_EVENT_ASRL_CTS (0x3FFF2029UL)
#define VI_EVENT_ASRL_DSR (0x3FFF202AUL)
#define VI_EVENT_ASRL_DCD (0x3FFF202CUL)
#define VI_EVENT_ASRL_RI (0x3FFF202EUL)
#define VI_EVENT_ASRL_CHAR (0x3FFF2035UL)
#define VI_EVENT_ASRL_TERMCHAR (0x3FFF2024UL)
/* This is for fast viPeek/viPoke macros */
#if defined(NIVISA_PEEKPOKE)
#if defined(NIVISA_PEEKPOKE_SUPP)
#undef NIVISA_PEEKPOKE_SUPP
#endif
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_)
/* This macro is supported for all Win32 compilers, including CVI. */
#define NIVISA_PEEKPOKE_SUPP
#elif (defined(_WINDOWS) || defined(_Windows)) && !defined(_CVI_) && !defined(_NI_mswin16_)
/* This macro is supported for Borland and Microsoft compilers on Win16, but not CVI. */
#define NIVISA_PEEKPOKE_SUPP
#elif defined(_CVI_) && defined(_NI_sparc_)
/* This macro is supported for Solaris 1 and 2, from CVI only. */
#define NIVISA_PEEKPOKE_SUPP
#else
/* This macro is not supported on other platforms. */
#endif
#if defined(NIVISA_PEEKPOKE_SUPP)
extern ViBoolean NI_viImplVISA1;
ViStatus _VI_FUNC NI_viOpenDefaultRM (ViPSession vi);
#define viOpenDefaultRM(vi) NI_viOpenDefaultRM(vi)
#define viPeek8(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((ViPUInt8)(val)) = *((volatile ViUInt8 _VI_PTR)(addr))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPeek8)((vi),(addr),(val)); \
} \
}
#define viPoke8(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((volatile ViUInt8 _VI_PTR)(addr)) = ((ViUInt8)(val))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPoke8)((vi),(addr),(val)); \
} \
}
#define viPeek16(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((ViPUInt16)(val)) = *((volatile ViUInt16 _VI_PTR)(addr))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPeek16)((vi),(addr),(val)); \
} \
}
#define viPoke16(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((volatile ViUInt16 _VI_PTR)(addr)) = ((ViUInt16)(val))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPoke16)((vi),(addr),(val)); \
} \
}
#define viPeek32(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((ViPUInt32)(val)) = *((volatile ViUInt32 _VI_PTR)(addr))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPeek32)((vi),(addr),(val)); \
} \
}
#define viPoke32(vi,addr,val) \
{ \
if ((NI_viImplVISA1) && (*((ViPUInt32)(vi)))) \
{ \
do (*((volatile ViUInt32 _VI_PTR)(addr)) = ((ViUInt32)(val))); \
while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10); \
} \
else \
{ \
(viPoke32)((vi),(addr),(val)); \
} \
}
#endif
#endif
#if defined(NIVISA_PXI) || defined(PXISAVISA_PXI)
#if 0
/* The following 2 attributes were incorrectly implemented in earlier
versions of NI-VISA. You should now query VI_ATTR_MANF_ID or
VI_ATTR_MODEL_CODE. Those attributes contain sub-vendor information
when it exists. To get both the actual primary and subvendor codes
from the device, you should call viIn16 using VI_PXI_CFG_SPACE. */
#define VI_ATTR_PXI_SUB_MANF_ID (0x3FFF0203UL)
#define VI_ATTR_PXI_SUB_MODEL_CODE (0x3FFF0204UL)
#endif
#define VI_ATTR_PXI_SRC_TRIG_BUS (0x3FFF020DUL)
#define VI_ATTR_PXI_DEST_TRIG_BUS (0x3FFF020EUL)
#define VI_ATTR_PXI_RECV_INTR_SEQ (0x3FFF4240UL)
#define VI_ATTR_PXI_RECV_INTR_DATA (0x3FFF4241UL)
#endif
#if defined(NIVISA_USB)
#define VI_ATTR_USB_BULK_OUT_PIPE (0x3FFF01A2UL)
#define VI_ATTR_USB_BULK_IN_PIPE (0x3FFF01A3UL)
#define VI_ATTR_USB_INTR_IN_PIPE (0x3FFF01A4UL)
#define VI_ATTR_USB_CLASS (0x3FFF01A5UL)
#define VI_ATTR_USB_SUBCLASS (0x3FFF01A6UL)
#define VI_ATTR_USB_ALT_SETTING (0x3FFF01A8UL)
#define VI_ATTR_USB_END_IN (0x3FFF01A9UL)
#define VI_ATTR_USB_NUM_INTFCS (0x3FFF01AAUL)
#define VI_ATTR_USB_NUM_PIPES (0x3FFF01ABUL)
#define VI_ATTR_USB_BULK_OUT_STATUS (0x3FFF01ACUL)
#define VI_ATTR_USB_BULK_IN_STATUS (0x3FFF01ADUL)
#define VI_ATTR_USB_INTR_IN_STATUS (0x3FFF01AEUL)
#define VI_ATTR_USB_CTRL_PIPE (0x3FFF01B0UL)
#define VI_USB_PIPE_STATE_UNKNOWN (-1)
#define VI_USB_PIPE_READY (0)
#define VI_USB_PIPE_STALLED (1)
#define VI_USB_END_NONE (0)
#define VI_USB_END_SHORT (4)
#define VI_USB_END_SHORT_OR_COUNT (5)
#endif
#define VI_ATTR_FIREWIRE_DEST_UPPER_OFFSET (0x3FFF01F0UL)
#define VI_ATTR_FIREWIRE_SRC_UPPER_OFFSET (0x3FFF01F1UL)
#define VI_ATTR_FIREWIRE_WIN_UPPER_OFFSET (0x3FFF01F2UL)
#define VI_ATTR_FIREWIRE_VENDOR_ID (0x3FFF01F3UL)
#define VI_ATTR_FIREWIRE_LOWER_CHIP_ID (0x3FFF01F4UL)
#define VI_ATTR_FIREWIRE_UPPER_CHIP_ID (0x3FFF01F5UL)
#define VI_FIREWIRE_DFLT_SPACE (5)
#if defined(__cplusplus) || defined(__cplusplus__)
}
#endif
#endif
/*- The End -----------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -