I apologize for resending this message, but I have still been
unable to get the counters on the 6229 to count the analog sample clock
ticks. Please provide any advice you may have.
Thank you!
Mike
--
You received this message because you are subscribed to the Google Groups "Comedi: Linux Control and Measurement Device Interface" group.
To post to this group, send email to comed...@googlegroups.com.
To unsubscribe from this group, send email to comedi_list...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/comedi_list?hl=en.
Out of the office until April 19th.
--
after looking a bit deeper into it I found out that
$ ./choose_clock -s11 -c1 0
Selecting master clock 0 for channel 1 on subdevice.
Clock period unspecified.
is calling comedi_set_clock_source which can be found here:
http://comedi.org/git?p=comedi/comedilib.git;a=blob;f=lib/insn_config_wrappers.c;h=3fc8f56d510ed37ebb4376b5b85f651b9bea54fd;hb=HEAD#l160
The thing which makes me wonder is that this function is not using the
channel information at all.
The readme says that the command line argument specifies the source ...
but how? Do I have to select 8 because my signal line is connected to
PFI8 or do I have to select 0 because it is Pin A of the Counter or
anything else?
If I initialize the counter and read the value I always get 4294967295.
If I disable gate in the pct_simple_counting code the counter starts
counting something. I do not know what exactly, but it seems like a timer:
$ ./gpct_simple_counting -s 11
Initiating simple event counting on subdevice 11.
$ ./inp -s 11
44776835
$ ./inp -s 11
54539366
Any Ideas how I can make the counter count edges on the input line?
Do I possibly have to use NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(unsigned n)
or NI_GPCT_ANALOG_TRIGGER_OUT_CLOCK_SRC_BITS from here:
http://comedi.org/git?p=comedi/comedilib.git;a=blob;f=include/comedi.h;h=ca9a43c447b906bbf72904dfcdbbf40400c0ba7c;hb=HEAD#l588
Thanks in advance
Finn
> --
> You received this message because you are subscribed to the Google
> Groups "Comedi: Linux Control and Measurement Device Interface" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/comedi_list/-/z4nMzr0PiGsJ.
That's a bug. Fixed it. Thanks for the report! It won't make any
difference to your problem though as the ni_tio module ignores the
channel number when configuring the clock source.
> The readme says that the command line argument specifies the source ...
> but how? Do I have to select 8 because my signal line is connected to
> PFI8 or do I have to select 0 because it is Pin A of the Counter or
> anything else?
I think you set it to 40, which is 32 + 8 or 0x20 + 8. See
NI_GPCT_PFI_CLOCK_SRC_BITS(n) in comedi.h. You can also modify the
clock source with some flag values to pre-scale the counter and/or
invert the clock signal - see enum ni_gpct_clock_source_bits in comedi.h
for the values.
> If I initialize the counter and read the value I always get 4294967295.
> If I disable gate in the pct_simple_counting code the counter starts
> counting something. I do not know what exactly, but it seems like a timer:
> $ ./gpct_simple_counting -s 11
> Initiating simple event counting on subdevice 11.
> $ ./inp -s 11
> 44776835
> $ ./inp -s 11
> 54539366
> Any Ideas how I can make the counter count edges on the input line?
>
> Do I possibly have to use NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(unsigned n)
> or NI_GPCT_ANALOG_TRIGGER_OUT_CLOCK_SRC_BITS from here:
> http://comedi.org/git?p=comedi/comedilib.git;a=blob;f=include/comedi.h;h=ca9a43c447b906bbf72904dfcdbbf40400c0ba7c;hb=HEAD#l588
NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(n), I think.
Since the channel is ignored, try:
./choose_clock -s 11 40
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Why is there a NI_GPCT_GATE_PIN_GATE_SELECT(0)? For me it worked only
with NI_GPCT_DISABLED_GATE_SELECT | CR_EDGE in
http://comedi.org/git?p=comedi/comedilib.git;a=blob;f=demo/gpct_simple_counting.c;h=649dd52388aa06bf2d0b050e12d8ee4b1069d2d3;hb=HEAD#l42
How to select counting direction pin?
I have tried it with
comedi_set_gate_source(dev,subdev,0,0,NI_GPCT_UP_DOWN_PIN_GATE_SELECT(10)),
counter mode NI_GPCT_COUNTING_DIRECTION_HW_GATE_BITS and with
comedi_set_other_source(dev,subdev,0,NI_GPCT_SOURCE_ENCODER_B,NI_GPCT_PFI_OTHER_SELECT(10)),
counter mode NI_GPCT_COUNTING_DIRECTION_HW_UP_DOWN_BITS but without success.
Got it, the second way works. I messed up the counter mode in first place.