Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
DIO / PFI configuration
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
GS  
View profile  
 More options Jan 22, 4:47 am
From: GS <grpsy...@gmail.com>
Date: Sun, 22 Jan 2012 01:47:04 -0800 (PST)
Local: Sun, Jan 22 2012 4:47 am
Subject: DIO / PFI configuration
Hi,

I am trying to read and write to PFI channels on NI PCI 6221.

1. Do I need to issue a comedi_dio_config() once for 16 PFI channels
or do I need to do it for all the 16 channels?
2. comedi_dio_config(): I am expecting either -1/+1 as a return value,
but I am getting a 0 both for input and output.
3. Regardless, I am able to read the input values without any issue,
but I cannot output any values.

Any suggestions?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Abbott  
View profile  
 More options Jan 23, 6:24 am
From: Ian Abbott <abbo...@mev.co.uk>
Date: Mon, 23 Jan 2012 11:24:17 +0000
Local: Mon, Jan 23 2012 6:24 am
Subject: Re: [comedi] DIO / PFI configuration
On 2012-01-22 09:47, GS wrote:

> Hi,

> I am trying to read and write to PFI channels on NI PCI 6221.

> 1. Do I need to issue a comedi_dio_config() once for 16 PFI channels
> or do I need to do it for all the 16 channels?

Once per channel.  Both comedi_dio_config() and comedi_dio_get_config()
are channel-specific[1].  The directions of the PFI channels are
individually configurable.

[1] However, on hardware where the DIO channel directions are not
individually configurable, but grouped into partitions of several
channels, configuring the direction of one channel will affect all the
channels in the same partition.

> 2. comedi_dio_config(): I am expecting either -1/+1 as a return value,
> but I am getting a 0 both for input and output.

comedi_dio_config() returns 0 if successful, or -1 if an error occurred.

comedi_dio_get_config() returns 0 if successful, or -1 if an error
occurred.  If successful, the direction is passed back via the final
pointer parameter.

> 3. Regardless, I am able to read the input values without any issue,
> but I cannot output any values.

> Any suggestions?

> Thanks.

I'm not sure where the PFI outputs go by default.  You may need to
reroute each output channel with comedi_set_routing(), using the
constant NI_PFI_OUTPUT_PFI_DO for the last parameter.

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
GS  
View profile  
 More options Jan 29, 11:43 pm
From: GS <grpsy...@gmail.com>
Date: Sun, 29 Jan 2012 23:43:50 -0500
Local: Sun, Jan 29 2012 11:43 pm
Subject: Re: [comedi] DIO / PFI configuration

Ian: Thanks for the response.
Regarding my Q#2, the source of my confusion is this :
http://www.comedi.org/doc/r5849.html

Also regarding my Q#3: I couldn't find comedi_set_routing() in the
documentation.

Is there a newer version of this documentation?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
GS  
View profile  
 More options Feb 1, 5:34 pm
From: GS <grpsy...@gmail.com>
Date: Wed, 1 Feb 2012 17:34:29 -0500
Local: Wed, Feb 1 2012 5:34 pm
Subject: Re: [comedi] DIO / PFI configuration

Hi,

Hi, I am  trying to do DIO read and write and I am trying to read all the
48 channels of NI PCI 6221.

Please correct me if I am wrong on this:

For read, below are the steps:
comedi_dio_config(device, subDevice[i], channel[i], COMEDI_INPUT);
comedi_dio_read(device, subDevice[i], channel[i], &data);

For write, below are the steps:
comedi_dio_config(device, subDevice[i], channel[i], COMEDI_OUTPUT);
if(subDevice[ii] ==7} {  comedi_set_routing( device, subDevice[i],
channel[i], NI_PFI_OUTPUT_PFI_DO);  }
comedi_dio_write(device, subDevice[i], channel[i], bit);

Any suggestions?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebas Inc  
View profile  
 More options Feb 1, 6:08 pm
From: Sebas Inc <sebinci...@yahoo.com.ar>
Date: Wed, 1 Feb 2012 15:08:22 -0800 (PST)
Local: Wed, Feb 1 2012 6:08 pm
Subject: Re: DIO / PFI configuration
Hi,
i have the same problem. I only can write the subdevice 2 of my NI_DAQ
6220.

Exist the comedi_set_routing function? my comedi version isn't CVS.

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Abbott  
View profile  
 More options Feb 2, 4:52 am
From: Ian Abbott <abbo...@mev.co.uk>
Date: Thu, 2 Feb 2012 09:52:18 +0000
Local: Thurs, Feb 2 2012 4:52 am
Subject: Re: [comedi] Re: DIO / PFI configuration
On 2012/02/01 11:08 PM, Sebas Inc wrote:

> Hi,
> i have the same problem. I only can write the subdevice 2 of my NI_DAQ
> 6220.

> Exist the comedi_set_routing function? my comedi version isn't CVS.

You could copy the comedi_set_routing function from git and rename it
for your program.  It's just a wrapper function around comedi_do_insn.

int my_comedi_set_routing(comedi_t *device, unsigned subdevice,
        unsigned channel, unsigned routing)
{
        comedi_insn insn;
        lsampl_t data[2];

        memset(&insn, 0, sizeof(comedi_insn));
        insn.insn = INSN_CONFIG;
        insn.subdev = subdevice;
        insn.chanspec = channel;
        insn.data = data;
        insn.n = sizeof(data) / sizeof(data[0]);
        data[0] = INSN_CONFIG_SET_ROUTING;
        data[1] = routing;

        if(comedi_do_insn(device, &insn) >= 0) return 0;
        else return -1;

}

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebas Inc  
View profile  
 More options Feb 2, 4:13 pm
From: Sebas Inc <sebinci...@yahoo.com.ar>
Date: Thu, 2 Feb 2012 13:13:23 -0800 (PST)
Local: Thurs, Feb 2 2012 4:13 pm
Subject: Re: DIO / PFI configuration
Thanks Ian. Now works correctly.

and should be added #include <cstring> if works with C++ or #include
<string,h> in C.

On 2 feb, 06:52, Ian Abbott <abbo...@mev.co.uk> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Abbott  
View profile  
 More options Feb 3, 6:07 am
From: Ian Abbott <abbo...@mev.co.uk>
Date: Fri, 3 Feb 2012 11:07:06 +0000
Local: Fri, Feb 3 2012 6:07 am
Subject: Re: DIO / PFI configuration
[Cc'ing the list for general interest.]

Hi GS,

Configuring the PFI subdevice (subdevice 7) channels as inputs or
outputs sets the direction of the physical PFI pins to input or output,
but as the PFI signals can be routed to different functions inside the
card, a PFI pin might not be routed to the "static DO" function.

If you look at Figure 8-1 in the "DAQ M Series User Manual"
<http://www.ni.com/pdf/manuals/371022k.pdf> then for subdevice 7:

* comedi_dio_config() controls the "Direction Control" signals.
* comedi_set_routing() controls the input/output source selectors (the
unlabelled trapezoid-shaped blocks on the diagram).
* comedi_set_filter() controls the "PFI Filters" block.
* comedi_dio_bitfield()/comedi_dio_bitfield2() may modify the "Static DO
Buffer" bits and reads back the "Static DI" signals.
* comedi_dio_read() reads a "Static DI" signal.
* comedi_dio_write() modifies a "Static DO Buffer" bit.

Note that a "Static DO Buffer" bit (channel) does not appear on the
corresponding PFI pin (channel) unless that PFI pin (channel) is
configured as an output (COMEDI_OUTPUT) and is routed to the "Static DO
Buffer" (NI_PFI_OUTPUT_PFI_DO).

Best regards,
Ian.

On 2012-02-03 00:46, GS wrote:

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »