Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using VISA with a PLX9050

I'm trying to write a driver for a cPCI device that uses the PLX9050 PCI controller. My problem is the 9050 has a known problem that affects the ability to read some of the internal configuration registers. The attached errata document from PLX explains the issue.

Currently my only solution to access these registers is to require the user to manually change the device's resource allocations through the Windows Device Manager. After that everything works fine.

I realize this is not a VISA problem but I was hoping someone else might have run across this problem and could recommend a more automated solution.

PLX's solution of swapping BAR settings works but VISA does not seem to like it unless it is done at
the Windows level.

David Clark
C&H Technologies, Inc.
0 Kudos
Message 1 of 6
(4,244 Views)
Hi David,

I am not totally convinced that it will solve your problem, but I thought I may interject with a bit of VISA info.

If you go to Tools -> Visa -> Visa Options in MAX, and select Show all PXI/PCI devices, you can see all PCI cards in the system. (They will show in max under the PXI System (Unidentified) table after you refresh the list.

Once this has been done, you can open a VISA session to the cards and read and write to them as if you were reading and writing to anywhere else. You may be able to poke registers to find a workaround, but I am not positive about this.

Also I am not sure that I understand how you can swap BAR's around. I was under the impression that the bios assigns memory space for PCI cards at boot time, and consequently wi
ndows would not be able to alter this?

Either way does this help? Getting direct access to the registry would hopefully help you find a workaround.

Let me know if this helps or if there are more questions.

Best Regards,
Aaron K.
Application Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,244 Views)
Aaron,

First of all, thanks for the response.

I am able to peek and poke registers on the card using VISA. I created an "inf" file using NI's wizard so it shows up normally in MAX.

You are correct about the BIOS assigning space for the cards at boot time but Windows allows you to override these setting through the device manager. Window's 9x does at least. I haven't tried in on XP or 2K yet. To do it, go to the device manager, select the card, go to properties, select the "Resources" tab, un-ckeck "Use Automatic Settings", and click on "Change Settings".

The following is what I mean by swapping BAR's around:
I need to access BAR1. BAR3 is assigned space that I do not need. So I can swap the values of the BAR1 and BAR3 registers on the card like this

viOut32(vi, PXI_CFG_SPACE, 0x14, bar3_setting)
viOut32(vi, PXI_CFG_SPACE, 0x1C, bar1_setting)

Now when I tell VISA to access BAR3 like this
viIn32(vi, PXI_BAR3_SPACE, 0x00, &data)

the card will actually decode the address as a BAR1 address and return the BAR1 value at that offset. I'm basically tricking VISA into thinking its accessing BAR3 when its actually accessing BAR1. The problem with doing this is that if the BAR1 and BAR3 register settings aren't the same as the values that Windows has saved for them, VISA will lock up next time you try to search for resources like when you open VISAIC. Also a solution where I swap BARs, then access the necessary register, then re-swap BARs will not work because I need to access BAR1 to handle interrupts, so it has to be accessable at all times.

Bottom line is I need to change the setting at the Windows level. I know the user can do it manually in Win9x but I'd prefer it to be more automatic. I have not looked at it on XP or 2K yet. I have also briefly tried to do it in the inf file with a "LogConfigOverride" section but have not been successful.

I've jumped to something of higher priority so this issue remains idle for the time being. I'll fill you in via this thread if I find a solution when I do finally get back to it.

David Clark
Software Design Engineer
C&H Technologies, Inc.
www.chtech.com
0 Kudos
Message 3 of 6
(4,244 Views)
Hi David,

In windows XP they restrict your ability to do what you have described. Actually I found an MSDN article that stated this is no longer available by design.


This could be particularly tricky to work around. I tried to search google for an idea of how to do this, but I wasn't able to come up with much. I'm sure you already know this, but if this can be done programatically I am confident it will be using MS's HAL (Hardware Abstraction Layer). That being said, I wasn't able to find anything that would indicate how this is done.


Hope this helps out some!

Best Regards,
Aaron K.
Application Engineer
0 Kudos
Message 4 of 6
(4,244 Views)
I was afraid of that after initially playing with it on XP but had not done enough research to come to that conclusion.

David Clark
0 Kudos
Message 5 of 6
(4,244 Views)
Hi David,

It took me a few minutes to find the link, but here is the article I found: http://support.microsoft.com/?kbid=315278

It looks like there may be some workarounds, but they don't seem to offer many guarantees.

Hope this helps!

Aaron K.
0 Kudos
Message 6 of 6
(4,244 Views)