Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Comedi & PCI-6534 working?

I'm using a Linux box running kernel version 2.6.6 and comedi version 0.7.69. My PCI-6534 is recognized on bootup:

comedi: version 0.7.69 - David Schleef
Available NI device IDs: 0x12b0

and # comedi_config /dev/comedi0 ni_pcidio

produces the following fine-looking claims:

comedi0: nidio:<6>PCI: Found IRQ 5 for device 0000:00:0b.0
PCI: Sharing IRQ 5 with 0000:00:0f.0
MITE:0xe9101000 mapped to c880d000 DAQ:0xe9102000 mapped to c88b0000
pci-6534 rev=64

When I try using the dio command from the demo directory of the comedilib distribution, I do not see any bits being flipped on the 6534 connector. Similarly, the outp command produces no change (the connector pins are all setting at zero volts except the +5V pin, which is at the right potential) in the output bit. Unsurprisingly, regardless of the word I'm driving onto A0-D7 on the card connector, inp (also from the demo directory) returns a value of zero.

I went on to try writing my own piece of very simple code to see if I could get _any_ output from the card. The code follows:


#include /* for printf() */
#include

int subdev = 0; /* change this to your input subdevice */
int chan = 0; /* change this to your channel */
int result = 0;
unsigned int write_mask= 0xFFFFFFFF;
unsigned int i,temp;
unsigned int* bits;

int main(int argc,char *argv[])
{
comedi_t *it;
lsampl_t data;

//parse_options(argc, argv);
printf("Opening /dev/comedi0.");
it=comedi_open("/dev/comedi0");
printf(".");
if(!it)
{
printf("Error in opening /dev/comedi0.\n");
printf("Try running comedi_config /dev/comedi0 ni_pcidio\n");
comedi_perror("/dev/comedi0");
exit(0);
}
printf(".\n");

write_mask = 0xFFFFFFFF;
while(chan<32)
{
printf(".");
result = comedi_dio_config(it,subdev,chan,COMEDI_OUTPUT);
printf("comedi_dio_config(chan=%d) returns %d\n", chan, result);
chan = chan + 1;
}
chan = 0;
while(i< 500)
{
i = i+1;
temp = 0xFFFFFFFF;
bits = &temp;
result = comedi_dio_bitfield(it, subdev, write_mask, bits);
printf(".");
usleep(1000);
if(result == -1){
printf("Error in testing 1\n");
comedi_close(it);
exit(-1);
}
}
comedi_close(it);
return 0;
}

This code runs just fine (no errors in software), but itdoes not produce anything but zero volts on A0-D7 pins.

So, I see no signs of functionality

Lastly, the comedi info command returns values that seem to be in line with the card being functional:

holloway@MACHINE:~/comedi/demo$ ./info -v
overall info:
version code: 0x000745
driver name: ni_pcidio
board name: pci-6534
number of subdevices: 1
subdevice 0:
type: 5 (digital I/O)
number of channels: 32
max data value: 1
ranges:
all chans: [0,5]
command:
start: now|int
scan_begin: timer|ext
convert: now
scan_end: count
stop: none|count
command fast 1chan:
start: now 0
scan_begin: timer 50
convert: now 0
scan_end: count 1
stop: count 2


I hope I'm just missing something simple here. Am I? Any ideas would be very appreciated.

I could move to the NI-distributed Windows software, but I'm building a custom embedded system, and it would be very beneficial for me to be able to run a UNIX-variant.

Thanks,
Jack
0 Kudos
Message 1 of 9
(5,497 Views)
Hello Jack,

Thank you for contacting National Instruments.

Just to verify that the card is functioning correctly, could you install it in a Windows machine and toggle the bits from a test panel? If you can toggle the bits, then the card is most likely working correctly.

If the card is working, then you most likely have a problem with your code or driver. For support on this, you will need to contact Comedi at http://www.comedi.org/.

Sincerely,

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(5,487 Views)

I am doing just that, but I've already run into some problems. See my posting here:
https://forums.ni.com/t5/Measure/NI6534-is-detected-by-windows-2000-but-not-in-MAX/m-p/178227.

0 Kudos
Message 3 of 9
(5,484 Views)
Hi, I have exactly the same start up problem.
Has anybody got a "Hello world" program for NI6534 with comedi libs?

2nd question: is it right to download firmware by using thie following command?

sudo comedi_config --init-data ni6534a.bin --init-data niscrb01.bin --init-data niscrb02.bin /dev/comedi0 ni_pcidio


Thanks a lot,
RMAR
0 Kudos
Message 4 of 9
(5,225 Views)

Hello RMAR,

Unfortunately, we do not support the Comedi driver for our DAQ devices here at National Instruments.  However there is a Linux version of the NI-DAQmx driver that you can use with your device, which can be downloaded here.  Using the NI-DAQmx driver you can program your device in both LabVIEW and ANSI C, and will probably have control over more functionality than the Comedi driver provides.

With regards to your questions, if you need to use the Comedi driver over the DAQmx driver, there's some support documentation at www.comedi.org.

Sorry I couldn't be of more help.

Regards,
Travis G.
Applications Engineering
National Instruments

 
0 Kudos
Message 5 of 9
(5,200 Views)
Thanks,
I've seen that you have the driver for NI6534 compiled for RedHat, SUSE and Mandriva, but unfortunately I must develop under Debian-Ubuntu.
Have you got such a version or a way to compile for my platform?

RMAR

0 Kudos
Message 6 of 9
(5,179 Views)
 

Hello RMAR,

Unfortunately, the only Linux distributions supported are the ones you've referenced.  

Travis G.
Applications Engineering
National Instruments
www.ni.com/support

 

Message Edited by Travis G. on 05-24-2006 04:49 PM

0 Kudos
Message 7 of 9
(5,155 Views)
Well, I think I am obliged to modify the driver.
I looked for the "NI 6534 Register Level Programmer Manual" but didn' find it in ftp://ftp.ni.com/support/manuals/
Do you know where I can find it?
Thanks in advance,
RMAR
0 Kudos
Message 8 of 9
(5,147 Views)

Hello RMAR,

Register level programming is beyond the scope of this forum.  Try reposting your request under the Driver Development Kit (DDK) discussion forums.

Travis G.

 
0 Kudos
Message 9 of 9
(5,126 Views)