140
hUSBTMCLIB = NULL;
m_defaultRM_usbtmc = 0;
}
else
{
PviOpen_usb(m_defaultRM_usbtmc, instrDescriptor, 0, 0, &m_instr_usbtmc);
status = PviSetAttribute_usb(m_instr_usbtmc, VI_ATTR_TMO_VALUE, m_Timeout);
}
}
else
{
PviOpen_usb(m_defaultRM_usbtmc, instrDescriptor, 0, 0, &m_instr_usbtmc);
status = PviSetAttribute_usb(m_instr_usbtmc, VI_ATTR_TMO_VALUE, m_Timeout);
}
}
if (!hUSBTMCLIB)
{
printf("DL-2060 device connect failed.\n");
return;
}
// Write command "*IDN?" and read the DL-2060 identification string
len = 64;
pStrout = new char[len];
ZeroMemory(pStrout, len);
strcpy(pStrout, "*idn?");
status = PviWrite_usb(m_instr_usbtmc, (unsigned char *)pStrout, 6, &nWritten);
Sleep(30);
if (status != VI_SUCCESS)
{
MessageBox(NULL, "Write to device error.", "DL-2060 multimeter device test", MB_OK);
PviClose_usb(m_defaultRM_usbtmc);
hUSBTMCLIB = NULL;
m_defaultRM_usbtmc = 0;
return;
}
else
{
printf(" output : *IDN?\n");
}
Sleep(1000);
// Read data from device
len = 64;
if (hUSBTMCLIB)
{
status = PviRead_usb(m_instr_usbtmc, pStrin, len, &nRead);
if (nRead > 0)
{
for (len=0; len < (long) nRead; len++)
{
buffer[len] = pStrin[len];
}
}
buffer[nRead] = '\0';
printf(" input : %s\n\n",buffer);
}
// Set sample count to 1
strcpy(pStrout, "SAMP:COUN 1");
status = PviWrite_usb(m_instr_usbtmc, (unsigned char *)pStrout, 12, &nWritten);
Sleep(30);
// Set configure Voltage AC, range 0.1A
strcpy(pStrout, "CONF:VOLT:AC 0.1,0.01");
status = PviWrite_usb(m_instr_usbtmc, (unsigned char *)pStrout, 22, &nWritten);
Sleep(3000);
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...