03-23-2006 04:29 PM
03-23-2006 04:42 PM
03-23-2006 04:55 PM
Sorry Alex...but that's not the correct answer. I tried it that way first because it seemed logical and because the example code showed it that way. But the compiler complained...the latest version of the function in the VISA library actually requires a new variable type ViPAddr which is itself a pointer to a far. Now the compiler is happy, but the run-time code is not.
But thanks for responding so quickly,
Erik
03-23-2006 05:43 PM
ViPAddr is actually just a typedef for a pointer to a ViAddr (sorry, I missed the P in my initial reading). pdaq_fpga_base_addr should be declarared as a ViAddr (not a ViPAddr) and you should take the address of it when passing it to viMapAddress. This seems to work fine for me in CVI 8.0; if you still have problems, could you please post the text of the error you receive? Here is the revised code:
void PDAQ_init_with_NI_VISA( void )
{
ViSession defaultRM, PDAQ3_PLX;
ViStatus status;
ViAddr daq_fpga_base_addr;
// open National Instruments VISA default resource manager
status = viOpenDefaultRM( &defaultRM );
// open NI-VISA handle to PDAQ3 VISA driver - this is my PCI card
status = viOpen( defaultRM, "PXI5::4::INSTR", VI_NULL, VI_NULL, &PDAQ3_PLX );
// map physical memory
status = viMapAddress (PDAQ3_PLX, 0, VI_PXI_BAR2_SPACE, pdaq_pci_bar2_size, 0, VI_NULL, &daq_fpga_base_addr);
}
Thanks,
-alex
03-23-2006 05:55 PM