comedi dio read/write help

HI,
         I am newbie working with NI PCI 6514 card. I am able to install  comedi-0.7.74 and comedilib-0.8.0  and configure the device and test it with comedi_test. I started working with the commands by led.
         When i use the command  comedi_dio_read() command it showing 0 always  and when i am writing by comedi_dio_write()  to subdevice  there is no response. The code is given below. I am not sure whether i am following it in  a right way.
Thanks in advance for any help.

#include <stdio.h> & nbsp; /* for printf() */
#include <comedilib.h>
                     &nb! sp;                                                                          
int subdev = 1;        /* change this to your input subdevice */
int chan = 1 ;          /* change this to your channel */
int range = 0;          /* more on this later */
int aref = AREF_GROUND; /* more on this l ater */
                             &nbs! p;           &n bsp;                                                      
int main(int argc,char *argv[])
{
  comedi_t *it;
  lsampl_t data;
   lsampl_t data1;
                                                         &nbs p;                               &! nbsp; 
  it=comedi_open("/dev/comedi0");
                                                                                                
  comedi_dio_read ( it, subdev, chan, &data);
  printf("data = %d \n", data);
 
  comedi_dio_write ( it, subdev, chan, 1);

  comedi_dio_read ( it, subdev, chan, &data1);
  printf(" data1 = %d \n",data1);
                                                                                               
  return 0;
}




Looking for the Hottest New Ringtones?
Find them at Lycos Mobile. Get 10 Bonus Tones today!

Received on 2007-08-14Z12:20:59