I've got a VME-MXI-2 interface cobnnected to a VME crate. I'm using the ni-vxi driver to access the VME cards in the crate. I can't configure the VME configuration manually using the tools for variuos reasons. So I tried to do it directly in the software using CreateDevInfo and SetDevInfo functions. But although GetDevInfo shows me the same information about the device as it does when I do a manual configuration, I can't access the device. (bus error, but it doesn't access the VME bus at all) Is it possible at all to configure a VME device only from the software and not doing it manually? If yes, what else do I have to do apart from creating the device with CreateDevInfo and SetDevInfo?
If you try to access memory that was not allocated by Resman, you get a bus error. VME devices do not have the VXI configuration registers used by the VXI Resource Manager (Resman) to automatically configure and allocate resources to the modules in the system. Therefore, you must configure the VME devices in the Measurement & Automation Explorer (MAX). Here is a link to a document that describes this process: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/97b8441ebf716dbd862569ee00562083?OpenDocument
You only have to add the VME devices once. Resman uses this information during its execution to allocate the resources required by the VME cards.
thanks for your answer! Unfortunately it is not possible in my system to do any manual configuration, since it is highly dynamic. The VME configuration is read from a database and every configuration action has to be done by the software itself. I thought, that the commands createDevInfo and SetDevInfo manipulate the table read from the resman configuration and therefore I can configure a device using these commands without creating a configuration manualy?
Unfortunately, the CreateDevInfo and SetDevInfo commands do not function as you were expecting. These change the device information for that program only.
Resources (such as Memory Addresses) have to be mapped across the MXI-2 interface, and Resman performs the mapping based on the configuration information. The reason you get a bus error when trying to then access the device is because the memory mapping across the MXI-2 has not been done for the address ranges configured by SetDevInfo because resman has not run.
After setting the information programmatically, you would have to close that program to run resman. Since the settings are localized to the program you just closed, resman would not map the device information. If you used an embedded controller, you could read and write directly to the address on the device. You would not have to configure the devices at all (manually or programmatically) because you have direct access to the VME backplane.
There is not a way to programmatically configure VME devices. However, there are options in MAX to enable and disable the various VME device profiles. So you could create all of the different VME devices you will be using, and then enable/disable according to the current configuration. Also, NI-VXI 3.2 includes tools so that you can import and export VME device information in to and out of MAX.