?? visa.h
字號:
#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)
/* This macro is supported for all Win32 compilers, including CVI. */
/* This macro is not supported on other platforms. */
#define VI_ATTR_PXI_DEV_NUM (0x3FFF0201UL)
#define VI_ATTR_PXI_FUNC_NUM (0x3FFF0202UL)
#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_BUS_NUM (0x3FFF0205UL)
#define VI_ATTR_PXI_CHASSIS (0x3FFF0206UL)
#define VI_ATTR_PXI_SLOTPATH (0xBFFF0207UL)
#define VI_ATTR_PXI_SLOT_LBUS_LEFT (0x3FFF0208UL)
#define VI_ATTR_PXI_SLOT_LBUS_RIGHT (0x3FFF0209UL)
#define VI_ATTR_PXI_TRIG_BUS (0x3FFF020AUL)
#define VI_ATTR_PXI_STAR_TRIG_BUS (0x3FFF020BUL)
#define VI_ATTR_PXI_STAR_TRIG_LINE (0x3FFF020CUL)
#define VI_ATTR_PXI_SRC_TRIG_BUS (0x3FFF020DUL)
#define VI_ATTR_PXI_DEST_TRIG_BUS (0x3FFF020EUL)
#define VI_ATTR_PXI_MEM_TYPE_BAR0 (0x3FFF0211UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR1 (0x3FFF0212UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR2 (0x3FFF0213UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR3 (0x3FFF0214UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR4 (0x3FFF0215UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR5 (0x3FFF0216UL)
#define VI_ATTR_PXI_MEM_BASE_BAR0 (0x3FFF0221UL)
#define VI_ATTR_PXI_MEM_BASE_BAR1 (0x3FFF0222UL)
#define VI_ATTR_PXI_MEM_BASE_BAR2 (0x3FFF0223UL)
#define VI_ATTR_PXI_MEM_BASE_BAR3 (0x3FFF0224UL)
#define VI_ATTR_PXI_MEM_BASE_BAR4 (0x3FFF0225UL)
#define VI_ATTR_PXI_MEM_BASE_BAR5 (0x3FFF0226UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR0 (0x3FFF0231UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR1 (0x3FFF0232UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR2 (0x3FFF0233UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR3 (0x3FFF0234UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR4 (0x3FFF0235UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR5 (0x3FFF0236UL)
#define VI_ATTR_PXI_IS_EXPRESS (0x3FFF0240UL)
#define VI_ATTR_PXI_SLOT_LWIDTH (0x3FFF0241UL)
#define VI_ATTR_PXI_MAX_LWIDTH (0x3FFF0242UL)
#define VI_ATTR_PXI_ACTUAL_LWIDTH (0x3FFF0243UL)
#define VI_ATTR_PXI_DSTAR_BUS (0x3FFF0244UL)
#define VI_ATTR_PXI_DSTAR_SET (0x3FFF0245UL)
#define VI_ATTR_PXI_RECV_INTR_SEQ (0x3FFF4240UL)
#define VI_ATTR_PXI_RECV_INTR_DATA (0x3FFF4241UL)
#define VI_EVENT_PXI_INTR (0x3FFF2022UL)
#define VI_INTF_PXI (5)
#define VI_PXI_ALLOC_SPACE (9)
#define VI_PXI_CFG_SPACE (10)
#define VI_PXI_BAR0_SPACE (11)
#define VI_PXI_BAR1_SPACE (12)
#define VI_PXI_BAR2_SPACE (13)
#define VI_PXI_BAR3_SPACE (14)
#define VI_PXI_BAR4_SPACE (15)
#define VI_PXI_BAR5_SPACE (16)
#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_PROT_RESERVE (6)
#define VI_TRIG_PROT_UNRESERVE (7)
#define VI_UNKNOWN_CHASSIS (-1)
#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 + -