139
unsigned long *retCnt, char far desc[]);
signed long (__stdcall *PviOpen_usb) (unsigned long sesn, char *name, unsigned long mode,
unsigned long timeout, unsigned long *vi);
signed long (__stdcall *PviClose_usb) (unsigned long vi);
signed long (__stdcall *PviWrite_usb) (unsigned long vi, unsigned char *name, unsigned long len,
unsigned long *retval);
signed long (__stdcall *PviRead_usb) (unsigned long vi, unsigned char *name, unsigned long len,
unsigned long *retval);
signed long (__stdcall *PviSetAttribute_usb) (unsigned long vi, unsigned long viAttr, unsigned long attrstat);
PviOpenDefaultRM_usb = (signed long (__stdcall*)(unsigned long*))GetProcAddress(hUSBTMCLIB,
(LPCSTR)"viOpenDefaultRM");
PviFindRsrc_usb = (signed long (__stdcall*)(unsigned long, char*, unsigned long*,
unsigned long*, char[]))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viFindRsrc");
PviClose_usb = (signed long (__stdcall*)(unsigned long))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viClose");
PviOpen_usb = (signed long (__stdcall*)(unsigned long, char*, unsigned long,
unsigned long, unsigned long*))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viOpen");
PviWrite_usb = (signed long (__stdcall*)(unsigned long, unsigned char*, unsigned long,
unsigned long*))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viWrite");
PviRead_usb = (signed long (__stdcall*)(unsigned long, unsigned char*, unsigned long,
unsigned long*))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viRead");
PviSetAttribute_usb = (signed long (__stdcall*)(unsigned long, unsigned long, unsigned
long))GetProcAddress(hUSBTMCLIB, (LPCSTR)"viSetAttribute");
if (PviOpenDefaultRM_usb == NULL ||
PviFindRsrc_usb == NULL ||
PviClose_usb == NULL ||
PviOpen_usb == NULL ||
PviWrite_usb == NULL ||
PviRead_usb == NULL ||
PviSetAttribute_usb == NULL
)
{
FreeLibrary (hUSBTMCLIB);
hUSBTMCLIB = NULL;
MessageBox(NULL, "NIVISA for USBTMC library not ready.", "DL-2060 multimeter device test", MB_OK);
return;
}
printf("\n ###### Start C++ Example program. ######\n");
printf(" We check the DL-2060 multimeter on USB port and\n");
printf(" identify the first connected DL-2060 device.\n\n");
// Open Device -- Resource Manager
status = PviOpenDefaultRM_usb(&m_defaultRM_usbtmc);
if (status < 0L)
{
PviClose_usb(m_defaultRM_usbtmc);
hUSBTMCLIB = NULL;
m_defaultRM_usbtmc = 0;
MessageBox(NULL, "USBTMC resource not found.", "DL-2060 multimeter device test", MB_OK);
return;
}
else
{
// Find the USBTMC device USB[0-9]*::0x098F::0x2061::?*INSTR ( Hex )
status = PviFindRsrc_usb (m_defaultRM_usbtmc, "USB[0-9]*:: 0x098F:: 0x2061::?*INSTR", &m_findList_usbtmc,
&m_nCount, instrDescriptor);
if (status < 0L)
{
// Find the USBTMC device USB[0-9]*::0x098F::0x2061::?*INSTR ( Dec )
status = PviFindRsrc_usb (m_defaultRM_usbtmc, "USB[0-9]*::2447::080D::?*INSTR", &m_findList_usbtmc, &m_nCount,
instrDescriptor);
if (status < 0L)
{
PviClose_usb(m_defaultRM_usbtmc);
Summary of Contents for DL-2060
Page 37: ...31 Figure 3 17 1 2 3 5 5 4...
Page 136: ...130...
Page 137: ...131...
Page 138: ...132 D DL 2060 s Dimension...