Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6220 linux

I am working on an application specific driver to for the PCI 6220 under linux.
I have the DDK and visa lib installed.  I am trying to get the aiex2 example working.
I get a clean compile, but the string argument to acqireBoard() appears to be wrong, or the installation is wrong.

The example come with the code as follows:
bus = acquireBoard( "PXI4::1::INSTR");

lspci -v for my system with the PCI 6220 installed is as follows:

0000:00:08.0 Class ff00: National Instruments: Unknown device 70b0
        Flags: bus master, medium devsel, latency 32, IRQ 11
        Memory at d2800000 (32-bit, non-prefetchable) [size=4K]
        Memory at d2802000 (32-bit, non-prefetchable) [size=4K]

I did find the document that tries to explain the string format, but nothing I've tried seems to work.
I coded the following and no combination worked:

    for( int i=0; i<16; i++ )
    {
       for( int j=0; j<24; j++ )
       {
          char str[80];
          sprintf( str, "PXI%d::%d::INSTR", i, j );

          bus = acquireBoard( str );

          if( bus != NULL )
          {
            printf( "found board at i=%d j=%d\n", i, j );
            break;
          }
       }
    }
 

Suggestions?





0 Kudos
Message 1 of 13
(10,773 Views)

Hello,
Could you give us a few extra pieces of information.
1)  What Linux distro are you running?
2)  You mentioned that you have NI-VISA installed.  Which version do you have?
3)  Are you using the NI-VISA OS Interface?  (there are a couple different ones out there)

-Alan A.

 

0 Kudos
Message 2 of 13
(10,757 Views)
1)  What Linux distro are you running?
Suse 9.3 kernel 2.6.11.4-20a

2)  You mentioned that you have NI-VISA installed.  Which version do you have?
NI-VISA 3.4

3)  Are you using the NI-VISA OS Interface?  (there are a couple different ones out there)

yes  as found in the nimseries.zip
as downloaded from links on:
http://digital.ni.com/express.nsf/bycode/exyv4w?opendocument&lang=en&node=seminar_US

0 Kudos
Message 3 of 13
(10,752 Views)
Ok, so you probably just need to add a like to visaconf.ini which is located here: usr/local/vxipnp/linux/NIvisa
Before the 'Aliases' stuff, add this line:  ShowRegisteredDevOnly = 0
This should fix your problem.
 
FYI - the string passed to the acquireBoard function is a VISA PXI resource string.  The format is:
PXI<bus_number>::<device_number>::INSTR
NI-VISA allows more complicated strings that allow you to specify the function number and other PCI attributes.  The PCI bus, device and function numbers allow you to form a unique id for any device on the system. 
The lspci output format for the location of the PCI device is:
<bus>:<slot>.<func>
where slot is the the device number.  The format might change slightly between distros.  For your device, my guess is that the string is PXI0::8::INSTR.
 
-Alan A.
 
 
0 Kudos
Message 4 of 13
(10,745 Views)
Unfortunately, I still get the same results.

Stepping into acquireBoard I get the return status on viOpen
of -1073807343

Does this give any hints?





0 Kudos
Message 5 of 13
(10,737 Views)
Could you run visaconf and see if your device is found by that utility?
-Alan A.
0 Kudos
Message 6 of 13
(10,720 Views)

visaconf only shows serial ports
Not the PCI 6220.



0 Kudos
Message 7 of 13
(10,721 Views)
Try unzipping this attachment and putting the .inf file in this directory:  /usr/local/natinst/nipal/etc/inf
 
Alan A.

Message Edited by Alan [DE] on 02-13-2006 11:03 AM

0 Kudos
Message 8 of 13
(10,716 Views)

That did it.  Thanks!
0 Kudos
Message 9 of 13
(10,702 Views)

Now I'm not getting reasonable data from the ddk examples programs aiex1.cpp and aiex2.cpp.   I tie channel 0 to ground or a voltage and the readings don't follow.
Has anyone else got these examples to work?


0 Kudos
Message 10 of 13
(10,666 Views)