Programming Interfaces
Agilent 81250 String Interface Library
26
Agilent 81250 Parallel Bit Error Ratio Tester, Programming Reference, March 2006
Example Implementations
The following examples show how these commands could be
implemented in a C or VisualBasic environment.
C Example
The following code example connects to the firmware server on the
defined machine at the defined port, queries the
:DVT:IDN?
, outputs
the results, and disconnects.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hp81200.h>
#define BUFF_SIZE 1024
int main(int argc, char* argv[])
{
int err = 0;
char buffer[BUFF_SIZE];
int bufSize= BUFF_SIZE;
char* host;
// Define host
switch(argc)
{
case 1:
host = "";
break;
case 2:
host = argv[1];
default:
host = argv[1];
strncat(host, "; ", 2);
strncat(host, argv[2], strlen(argv[2]));
break;
}
// Connect to host
err = Connect_HP81200(host);
if (err=0)
{
printf("Could not connect to host\n");
return 0;
}
// Send :DVT:IDN?
bufSize= BUFF_SIZE;
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com