PCI-1751 DI/DO control in comedi

  • Thread starter Vladimir Khovanskov
  • Start date
V

Vladimir Khovanskov

I have Advantech PCI-1751, Linux Slackware 9.0 with kernel 2.4.20 and
installed comedi.

Comedi run so:

/sbin/modprobe comedi
/sbin/modprobe pci1751
/usr/sbin/comedi_config /dev/comedi0 pci1751

program "info" shows:
......
subdevice 2:
type: 3 (digital input)
number of channels: 48
....
command:
non supported
subdevice 3:
typy: 4 (digital output)
number of channels: 48
....
command:
not supported.
.....
In my program I succesfully open /dev/comedi0, and when I do
rev = comedi_dio_write(device,3, i, 1)
I have rev=1 and output of channel i equals "1" ( i corresponds to PortA0,
Port B0 & PortC0).
But when I do
rev = comedi_dio_read(device, 2, j, &r) (j corresponds PoetA1, PoerB1 &
PortC1)
I have rev=0 and r don't equals to in input signal on connrctor.
When I do
rev=comedi_dio_config(device, 3, i, COMEDI_OUTPUT)
I have rev=-1
rev=comedi_dio_config(device, 2, j,COMEDI_INPUT)
I have rev=-1.
How is it possible to control DI/DO in PCI-1751?
 
J

Joona I Palaste

Vladimir Khovanskov said:
I have Advantech PCI-1751, Linux Slackware 9.0 with kernel 2.4.20 and
installed comedi.
Comedi run so:
/sbin/modprobe comedi
/sbin/modprobe pci1751
/usr/sbin/comedi_config /dev/comedi0 pci1751
program "info" shows:
.....
subdevice 2:
type: 3 (digital input)
number of channels: 48
....
command:
non supported
subdevice 3:
typy: 4 (digital output)
number of channels: 48
....
command:
not supported.
....
In my program I succesfully open /dev/comedi0, and when I do
rev = comedi_dio_write(device,3, i, 1)
I have rev=1 and output of channel i equals "1" ( i corresponds to PortA0,
Port B0 & PortC0).
But when I do
rev = comedi_dio_read(device, 2, j, &r) (j corresponds PoetA1, PoerB1 &
PortC1)
I have rev=0 and r don't equals to in input signal on connrctor.
When I do
rev=comedi_dio_config(device, 3, i, COMEDI_OUTPUT)
I have rev=-1
rev=comedi_dio_config(device, 2, j,COMEDI_INPUT)
I have rev=-1.
How is it possible to control DI/DO in PCI-1751?

What was your C question?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,806
Members
47,353
Latest member
TamiPutnam

Latest Threads

Top