A-15
A2
// a VISA alias. Otherwise use a fully qualified VISA
// resource. The VISA resource can be a GPIB, TCP/IP, or some
// other resource. If a Watlow temp response can be obtained,
// the response will be printed to the console.
//
// Fully Qualified VISA Resource name examples:
// GPIB0::4::INSTR
// TCPIP::localhost::gpib0,4::INSTR
//
// Notes:
// 1. To compile/link requires the VISA.H and VISA32.LIB files be
// accessible. Normally the default directories would be
// setup to include these.
// 2. If an error happens, the program will print the error condition
// and then return an ERRORLEVEL of 1. If no error, the program
// will print the temp every 10 seconds.
#include <windows.h>
#include <winbase.h>
#include <stdio.h>
#include <visa.h>
main (int argc, char *argv[])
{
int retval, length, temp;
char *cp, result[1024];
ViStatus status;
ViSession rmSession, devSession;
if (argc != 2)
{
printf (“Specify the VISA resource to use. This may be\n”);
printf (“either a fully defined VISA resource, or it may be a\n”);
printf (“VISA alias.\n”);
exit (1);
}
// Before we use any VISA fuctions, we must first open the
// Resource Manager so it will initialize the VISA layer.
if (viOpenDefaultRM (&rmSession) != VI_SUCCESS)
{
printf (“Unable to open a Resource Manager session\n”);
exit (1);
}
status = viOpen (rmSession, argv[1], VI_NULL, 1000, &devSession);
if (status != VI_SUCCESS)
{
printf (“Unable to open a session with %s\n”, argv[1]);
retval = 1;
}
else
{
for (;;)
{
Figure A-5 Example VISA Program
Summary of Contents for 9099
Page 20: ...1 16 1 Figure 1 1 9009 Outline Dimensions ...
Page 24: ...1 20 1 Figure 1 3 9099 Certificate of Compliance ...
Page 54: ...3 8 3 Figure 3 1 Status Reporting Structure Flash Configuration Reset ...
Page 94: ...3 48 3 This page left intentionally blank ...
Page 100: ...4 4 6 This page is left intentionally blank ...