Programming Manual MSO/UPO2000 Series
143 / 156
Instruments.uni-trend.com
status = viClose(instr);
continue;
}
/** Now we will attempt to read back a response from the device to
*the identification query that was sent. We will use the viScanf
*function to acquire the data.
*After the data has been read the response is displayed. */
status = viScanf(instr, "%t", buffer);
if (status < VI_SUCCESS)
{
printf("Error reading a response from the device %d. \n", i + 1);
}
else
{
printf("\nDevice %d: %s\n", i + 1, buffer);
}
status = viClose(instr);
}
/*Now we will close the session to the instrument using viClose. This operation frees all
system resources.*/
status = viClose(defaultRM);
printf("Press Enter to exit.");
fflush(stdin);
getchar();
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
usbtmc_test();
return 0;
}
b)
TCP/IP
Example
int tcp_ip_test(char *pIP)
{
char outputBuffer[VI_FIND_BUFLEN];
ViSession defaultRM, instr;
ViStatus status;
/* First we will need to open the default resource manager. */
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
printf("Could not open a session to the VISA Resource Manager!\n");