Agilent Technologies FS2010 Guía de usuario Pagina 110

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 109
110 Agilent VISA User’s Guide
4 Programming via GPIB and VXI
A pointer to the address space where the memory was
mapped is returned in the address parameter. If the device
specified by vi does not have memory in the specified
address space, an error is returned. Some sample
viMapAddress function calls follow.
/* Maps to A32 address space */
viMapAddress(vi, VI_A32_SPACE, 0x000, 0x100,
VI_FALSE,
VI_NULL,&address);
/* Maps to A24 address space */
viMapAddress(vi, VI_A24_SPACE, 0x00, 0x80,
VI_FALSE,
VI_NULL,&address);
Reading and Writing to Device Registers
When you have mapped the memory space, use the VISA
low- level memory functions to access the device's registers.
First, determine which device register you need to access.
Then, you need to know the register's offset. See the
applicable instrument’s user manual for a description of the
registers and register locations. You can then use this
information and the VISA low- level functions to access the
device registers.
Sample: Using viPeek16
A code sample using viPeek16 follows.
ViSession defaultRM, vi;
ViUInt16 value;
ViAddr address;
ViUInt16 value;
.
.
viOpenDefaultRM(&&defaultRM);
viOpen(defaultRM, "VXI::24::INSTR", VI_NULL,
VI_NULL,
&vi);
viMapAddress(vi, VI_A16_SPACE, 0x00, 0x04,
Vista de pagina 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 159 160

Comentarios a estos manuales

Sin comentarios