Agilent Technologies FS2010 Podręcznik Użytkownika Strona 122

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 160
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 121
122 Agilent VISA User’s Guide
4 Programming via GPIB and VXI
Although the resource handles the allocation and operation
of the window, the programmer must free the window via
viUnMapAddress when finished. This makes the window
available for the system to reallocate.
Sample: MEMACC Resource Program
This program demonstrates one way to use the MEMACC
resource to open the entire VXI A16 memory and then
calculate an offset to address a specific device.
/* peek16.c */
#include <stdio.h>
#include <stdlib.h>
#include <visa.h>
#define EXIT1
#define NO_EXIT 0
/* This function simplifies checking for VISA
errors. */
void checkError( ViSession vi, ViStatus status,
char
*errStr,int doexit){
char buf[256];
if (status >= VI_SUCCESS)
return;
buf[0] = 0;
viStatusDesc( vi, status, buf );
printf( "ERROR 0x%lx (%s)\n ’%s’\n", status,
errStr,
buf );
if ( doexit == EXIT )
exit ( 1 );
}
void main() {
ViSession drm;
ViSession vi;
ViUInt16inData16 = 0;
ViUInt16peekData16 = 0;
ViUInt8*addr;
Przeglądanie stron 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 159 160

Komentarze do niniejszej Instrukcji

Brak uwag