EasyManua.ls Logo

UNI-T UTG900E Series

UNI-T UTG900E Series
41 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming Manual UTG900E Series
Instruments.uni-trend.com
27 / 41
if (status < VI_SUCCESS)
{
printf("Cannot open a session to the device %d. \n", i + 1);
continue;
}
/** At this point we now have a session open to the USB TMC instrument.
*We will now use the viPrintf function to send the device the string "*IDN?\n",
*asking for the device’s identification. */
char * cmmand = "*IDN?\n";
status = viPrintf(instr, cmmand);
if (status < VI_SUCCESS)
{
printf("Error writing to the device %d. \n", i + 1);
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)

Table of Contents

Other manuals for UNI-T UTG900E Series

Related product manuals