Ni PCI 6229 : Can read input, but cannot write output

62 views
Skip to first unread message

Matthew

unread,
Jul 18, 2011, 12:31:59 PM7/18/11
to Comedi: Linux Control and Measurement Device Interface
Hello Everyone,

I am currently working with a Ni PCI 6229 daq card and a BNC-2110
input/output device. I have comedi version 7.76 compiled in Ubuntu
10.10. I have the ni_pcimio driver configured for this daq card.

I am able to compile the Demo program "inp.c" - a little input demo.
This works well as I am able to successfully read input voltages
(range 0: -10 to 10v and 10v giving input value 65535).

However, I am simply unable to get any sort of output to work. I have
compiled and ran "outp.c" - a little output demo, and I get the
following:

/dev/comedi1: Invalid argument

I have also simply tried something such as:

lsampl_t outputdata = 50000; //(~9 v)
sendval = comedi_data_write(device, subdevice, channel,r ange,
analogref, outputdata);


But comedi_data_write (ret) returns -1, associated with an error.



Can anyone please give me some troubleshooting ideas or perhaps
someone has had similar troubles using comedi to output data?
Furthermore, I'm sure that there are some things I should have
included in this post, so feel free to ask me to include those things
as well.

Any help is greatly appreciated.


Matt M

Ian Abbott

unread,
Jul 19, 2011, 6:18:07 AM7/19/11
to comed...@googlegroups.com

This may be a stupid question, but are you writing to the correct
subdevice? That would be subdevice 1 for the AO subdevice, and if your
device is attached as /dev/comedi1 you should be able to run the outp
demo as:

./outp -s 1 /dev/comedi1 50000

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

Matthew

unread,
Jul 20, 2011, 3:06:48 PM7/20/11
to Comedi: Linux Control and Measurement Device Interface
Hello Ian,

Yes, I am fairly confident that I am writing to the proper subdevice.
I believe this because I am able to read data through the demo program
for acquiring input. Therefore, I am simply using the same device/
subdevice/range from my input demo to run this output demo.
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-

Matthew

unread,
Jul 20, 2011, 3:22:50 PM7/20/11
to Comedi: Linux Control and Measurement Device Interface
Ian,


I'm sorry but I have to correct myself! I had the subdevice set to
the wrong number. You would think, after all the careful time I spent
trying to get this to work, I would have known this.

Thank you,

Matt
Reply all
Reply to author
Forward
0 new messages