- From: Felipe Zottola Diz <fzottola_at_cantv.net>
- Date: Thu, 19 Aug 2004 08:39:38 -0400
Gain adjustment: comedi_config parameter or comedi_data_read range? Date: Thu, 19 Aug 2004 08:39:38 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 I am working with PCL-812PG DAQ card and its Comedi driver. I am having trouble adjusting gain, please correct me if I'm doing something wrong. To load pcl812.o driver I issue the following commands: /sbin/modprobe -v pcl812 /usr/local/sbin/comedi_config -v /dev/comedi0 pcl812 0x230,0,0,0,1,0 The fourth parameter specifies the gain that should be used in field data conversion. When conversion is performed, a 5 volts field setpoint shows a 80 volts display ( I multiply conversion data by (float)5/4096 ) no matter what gain I specify in that fourth parameter. Below there's part of pcl812.c, it specifies what the parameters mean so you can figure out what other things I've specified in my comedi_config command. /* Options for PCL-812: * * [0] - IO Base * [1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7; 10, 11, 12, 14, 15) * [2] - DMA (0=disable, 1, 3) * [3] - 0=trigger source is internal 8253 with 2MHz clock * 1=trigger source is external * [4] - 0=A/D input range is +/-10V * 1=A/D input range is +/-5V * 2=A/D input range is +/-2.5V * 3=A/D input range is +/-1.25V * 4=A/D input range is +/-0.625V * 5=A/D input range is +/-0.3125V * [5] - 0=D/A outputs 0-5V (internal reference -5V) * 1=D/A outputs 0-10V (internal reference -10V) * 2=D/A outputs unknow (external reference) * * Options for PCL-812PG, ACL-8112PG: * [0] - IO Base * [1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7; 10, 11, 12, 14, 15) * [2] - DMA (0=disable, 1, 3) * [3] - 0=trigger source is internal 8253 with 2MHz clock * 1=trigger source is external * [4] - 0=A/D have max +/-5V input * 1=A/D have max +/-10V input * [5] - 0=D/A outputs 0-5V (internal reference -5V) * 1=D/A outputs 0-10V (internal reference -10V) * 2=D/A outputs unknow (external reference) * */ I've also tried to set gain adjustment using the range parameter in comedi_data_read(...), and I get segmentation fault. Would anyone post part of his code to use gain adjustment?
Received on 2004-08-19Z11:39:38