From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing VI_PXI_BAR0_SPACE of PXI device

Hi,

I am trying to read/write VI_PXI_BAR0_SPACE of PXI device using with VISA library. Here is sample C code how read data from BAR0 memory.

 

Spoiler

ViStatus res;
ViSession defaultRM, vi;
ViUInt32 oldData, newData;


viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "PXI0::CHASSIS1::SLOT3::FUNC0::INSTR",VI_NULL,VI_NULL, &vi);


//READ DATA
ViAddr addr = 0x8000;
viIn32(vi, VI_PXI_BAR0_SPACE, adr, &oldData);
printf("Addr: %04x Data:%08x\n", adr, data);

//WRITE DATA
newData = 0x7FF7;
res = viOut32(vi, VI_PXI_BAR0_SPACE, adr, newData);


This reading part is working without any issue. oldData = 0x7FFC.

I try to write newData = 0x&7FF7.

 

Something unexcpexted happen.I read data back i got = 0x7FF4.

looks like oldData and newData is logical AND somehow.

 

Does anyone have experience with reading/writing register BAR0 register map?

 

Thanks

 

 

0 Kudos
Message 1 of 1
(843 Views)