Anritsu LMR Master S412E Programming Manual page 664

An integrated, handheld multi-function land mobile radio test tool
Hide thumbs Also See for LMR Master S412E:
Table of Contents

Advertisement

A-1 C/C++
if (status < VI_SUCCESS)
{
/* Error Initializing VISA...exiting*/
printf("Can't initialize VISA\n");
return –1;
}
/* Open communication with TCP/IP device at xxx.xxx.xxx.xxx*/
/* NOTE: For simplicity, we will not show error checking*/
/* TODO: Add error handling. */
status = viOpen(defaultRM, pAddress, VI_NULL, VI_NULL, &instr);
/* Set the timeout for message-based communication*/
/* TODO: Add error handling. */
status = viSetAttribute(instr, VI_ATTR_TMO_VALUE, 120000);
/* Ask the device for identification */
sprintf(buffer, "*IDN?\n");
status = viWrite(instr, (unsigned char *)&buffer[0], 6, &retCount);
status = viRead(instr, (unsigned char *)buffer, BUFFER_SIZE,
&retCount);
/* TODO: Add code to process data. */
strncpy(tempDisplay, buffer, retCount);
tempDisplay[retCount] = 0;
printf("*IDN? Returned %d bytes: %s\n", retCount, tempDisplay);
/* Close down the system */
/* TODO: Add error handling. */
status = viClose(instr);
status = viClose(defaultRM);
return 0;
}
A-2
/* Null-terminate display string. */
PN: 10580-00319 Rev. N
Example
S412E PM

Advertisement

Table of Contents
loading

Table of Contents