Manipulating the Pointer
Every time you call viMapAddress(), the pointer you get back is valid for accessing a region of addresses. Therefore, if you call viMapAddress() with mapBase set to address 0 and mapSize to 0x40 (the configuration register space for a VXI device), you can access not only the register located at address 0, but also registers in the same vicinity by manipulating the pointer returned by viMapAddress(). For example, if you want to access another register at address 0x2, you can add 2 to the pointer. You can add up to and including 0x3F to the pointer to access these registers in this example because we have specified 0x40 as the map size. However, notice that you cannot subtract any value from the address variable because the mapping starts at that location and cannot go backwards. The following example shows how you can access other registers from address.
Example
Note This example shows C source code. There is also an example in Visual Basic syntax. |
#include "visa.h"
/* Error Initializing VISA...exiting */ } } |