Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viInt32 reads all FF's from memory at VI_PXI_BAR2_SPACE at offset 0

our device has memory at bar space 2. when i try to write and read back offsets 0x0 to 0x0FFFFF, i get all FF's. if i start at offset 0x100000, i read back what i wrote correctly. the calls to viOut32 and viIn32 do not return any errors. any ideas? here's a code snippet. this works, but if i use 0 for the offset, i get all FF's in aViInt. could there be a problem with my inf file.

 

 /* initialize varible, write it out, check the return for an error and print if error */

 aViInt = 1234;
 aviStatus = viOut32(pE2maDev->hViSession, VI_PXI_BAR2_SPACE, (ViBusAddress)0x100000,(ViUInt32)aViInt);
 if (aviStatus != VI_SUCCESS)
     printf("viOut32 Failed\n");
 printf("aViInt = 0x%08X\n",aViInt);

 

/* zero out variable. */ 

aViInt = 0;
 printf("aViInt = 0x%08X\n",aViInt);

 

/* read in value from memory, check for error, print out results. */
 aviStatus = viIn32(pE2maDev->hViSession, VI_PXI_BAR2_SPACE, (ViBusAddress)0x100000, (ViPUInt32) &aViInt);
 if (aviStatus != VI_SUCCESS)
  printf("viIn32 Failed\n");

 printf("aViInt = 0x%08X\n",aViInt); 

0 Kudos
Message 1 of 7
(3,906 Views)
Hmm, it does sound like there may be an issue with your .inf file, since it's just an issue with the memory. Can you look through that file and see if there are any issues? You could also post that file here so we can take a look at it, thanks!
Justin E
National Instruments R&D
0 Kudos
Message 2 of 7
(3,890 Views)
here are my files.
Download All
0 Kudos
Message 3 of 7
(3,882 Views)

i might add that reading/writing at offset 0x100000 and above is ok.

 

also, i have a different model card with memory at the same bar space and i can't read any offsets. all FF's.

0 Kudos
Message 4 of 7
(3,865 Views)

Chucky,

 

On your second card, you can't read anything at ANY offset, or just the 0x0 to 0x0FFFFF? In looking at your ini and inf files, it seems like you have interrupts setup on BAR3... is this what you're trying to access? There's nothing in the ini or inf files that I saw that indicate you have memory in BAR2 space. Is this something specific to your device?

Justin E
National Instruments R&D
0 Kudos
Message 5 of 7
(3,846 Views)

on the second card, i can not write to any offset.

 

the interrupt stuff in the inf file may not be correct.

 

how do i specify in the inf file that bar space 2 is memory? the driver wizzard did not indicate that it had to be specified.

0 Kudos
Message 6 of 7
(3,843 Views)

Chucky,

 

This driver looks like it was developed using the VISA Driver Development Wizard. If the inf file is incorrect, you'll have to go back through and re-create it using that Wizard for the appropriate interrupts and the appropriate locations. In there you can set where the interrupts are in memory.

Justin E
National Instruments R&D
0 Kudos
Message 7 of 7
(3,824 Views)