DME1600
53
Sample Programs
App
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("DME1600 device connect failed.\n");
return;
}
// Write command "*IDN?" and read the DME1600 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.", "DME1600 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
Содержание DME1600
Страница 4: ...4 DME1600 This page left blank intentionally...
Страница 5: ...Setup This chapter explains the settings that you need to configure to use the interfaces 1...
Страница 9: ...Message Reference This chapter explains the SCPI com mands 2 Message Reference...
Страница 43: ...Appendix A Error Messages B Sample Programs...
Страница 55: ......