Re:comedi dio read/write help

Thanks of ur reply. I added comedi_dio_config

comedi_dio_config ( it, subdev, chan,COMEDI_INPUT );
comedi_dio_config ( it, subdev, chan,COMEDI_OUTPUT );

but still i am getting the output as
data = 0
data1 = 0

Normally we will used to do I/O operation by ports. In comedi the ports are specified as subdevice. May I know in details about channels or lines.

Eg
     PORT1 - Digital  input (8 channels / lines for this port)
      .
      .
      PORT 4 - Digital Output (8 channels /line)

How this ports and channel specifications are accesed when using comedi drivers

The output of the comedi_test code is given below. How it is related to abov! e specified example port configuration ?

I: Comedi version: 0.7.74
I: Comedilib version: unknown =)
I: driver name: ni_65xx
I: device name: pci-6514
I:
I: subdevice 0
I: testing info...
rev 1
I: subdevice type: 3 (digital input)
  number of channels: 32
  max data value: 1
  ranges:
    all chans: [0,5]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 10 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not appli cable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_star! t_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 1
I: testing info...
rev 1
I: subdevice type: 4 (digital output)
  number of channels: 32
  max data value: 1
  ranges:
    all chans: [0,5]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 3 us
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicableI: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not app! licable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 2
I: testing info...
rev 1
I: subdevice type: 0 (unused)
I: testing insn_read...
rev 1
comedi_do_insn: EIO, good
I: testing insn_read_0...
not applicable
I: testing insn_read_time...
rev 1
not applicable
I: testing cmd_no_cmd...
got EIO, good
I: testing cmd_probe_src_mask...
not applicable
I: testing cmd_probe_fast_1chan...
not applicable
I: testing cmd_read_fast_1chan...
not applicable
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
not applicable
I: testing cmd_fifo_depth_check...
not applicable
I: testing cmd_start_inttrig...
not applicable
I: testing mmap...
not applicable
I: testing read_select...
not applicable
I: testing bufconfig...
buffer length is 0, good
I:
I: subdevice 3
I: testing info...
rev ! 1
I: subdevice type: 3 (digital input)
  number of channels : 1
  max data value: 1
  ranges:
    all chans: [0,1]
I: testing insn_read...
rev 1
comedi_do_insn returned 1, good
I: testing insn_read_0...
comedi_do_insn returned 0, good
I: testing insn_read_time...
rev 1
comedi_do_insn: 3
read time: 4 us
I: testing cmd_no_cmd...
not applicable
I: testing cmd_probe_src_mask...
rev 1
command source mask:
  start: now
  scan_begin: unknown(0x100)
  convert: follow
  scan_end: count
  stop: count
I: testing cmd_probe_fast_1chan...
command fast 1chan:
  not supported
I: testing cmd_read_fast_1chan...
  not supported
I: testing cmd_write_fast_1chan...
not applicable
I: testing cmd_logic_bug...
rev 1
E: comedi_get_cmd_src_mask failed
I: testing cmd_fifo_depth_check...
  not supported
64, 0
  not supported
128, 0
  not supported
256, 0
  not suppo! rted
512, 0
  not supported
1024, 0
  not supported
2048, 0
  not supported
4096, 0
  not supported
8192, 0
  not supported
16384, 0
  not supported
32768, 0
I: testing cmd_start_inttrig...
  not supported
I: testing mmap...
E: comedi_get_cmd_generic_timed failed
I: testing read_select...
E: comedi_get_cmd_generic_timed failed
I: testing bufconfig...
buffer size 65536
max buffer size 65536
setting buffer size to 4096
buffer size set to 4096
buffer size now at 4096
setting buffer size past limit, 69632
got EPERM, good
setting buffer size to max, 65536
buffer size now at 65536




Thanks
Sayoji




---------[ Received Mail Content ]------ ----
> Subject : Re:comedi dio read/write help
> Date : Tue, 14 Aug 2007 22:48:16 +0900
> From : matsuzay
> To : Sayoji Siv
> Cc : comedi_at_comedi.org
>
>Hi,
>
> You should call comedi_dio_config before reading/writing to a dio port.
>
>Sincerely
>
>-----------------------------------------------------
>Yoshiya Matsuzaka
>Dept. of Physiol., Graduate School of Medical Science,
>Tohoku University
>2-1 Seiryo machi, Aoba ward, Sendai 980-8575, JAPAN
>Tel: +81-22-717-8073, Fax: +81-22-717-8077
>-----------------------------------------------------
>



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

Received on 2007-08-14Z13:47:59