138
Visual C++
This C++ sample application is a Win32 console application. It illustrates how to use the TEXIO
IOUtils command. A Win32 console application is a Win32 application that uses text-based input
and output, not a graphical interface. This allows you to quickly create a Win32 application by
using simple input and output functions.
E.3 THE DEVQUERY FUNCTION
LISTING E.3.
After the path
C:\Program Files\IVI Foundation\VISA\WinNT\include
has been entered, you have
to add an “Include” path.
Add C:\WINDOWS\system32\
visa32.dll
to Project folder.
(Note:Windows 64bit is different path.)
// devquery.cpp : Defines the entry point for the console application.
//
// Call the NI-VISA library visa32.dll
//
//
#include "stdafx.h"
#include "visa.h"
//standard include for a Microsoft Visual C++ project
#include "stdio.h"
#include "windows.h"
void main(int argc, char* argv[])
{
// TODO: Add your control notification handler code here
HINSTANCE hUSBTMCLIB; // for USBTMC HANDLE
unsigned long m_defaultRM_usbtmc, m_instr_usbtmc;
unsigned long m_findList_usbtmc;
unsigned long m_nCount;
ViStatus status;
int m_Timeout = 7000;
char *pStrout; // Write out data buffer
BYTE pStrin[64]; // Read in data buffer
int len;
ULONG nWritten;
ULONG nRead = 0;
char buffer[256];
char instrDescriptor[256];
// Load the NI-VISA library for USBTMC device
hUSBTMCLIB = LoadLibrary ("visa32.dll");
if (!hUSBTMCLIB)
{
MessageBox(NULL, "NIVISA for USBTMC library not found.", "DL-2060 multimeter device test", MB_OK);
return;
}
// Link the libraries
signed long (__stdcall *PviOpenDefaultRM_usb) (unsigned long *vi);
signed long (__stdcall *PviFindRsrc_usb) (unsigned long sesn, char *expr, unsigned long *vi,
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...