All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Use of counter for quadratic encoder in NI PCI-6229 board
@ 2010-08-06 18:04 Kim, Jonghyun (NIH/CC) [F]
  2010-08-06 18:27 ` Gilles Chanteperdrix
  2010-08-09 22:13 ` Alexis Berlemont
  0 siblings, 2 replies; 6+ messages in thread
From: Kim, Jonghyun (NIH/CC) [F] @ 2010-08-06 18:04 UTC (permalink / raw)
  To: xenomai@xenomai.org

OS : Debian 5.0.4 + Xenomai 2.5.2
HW : NI PCI-6229


Hi.
I have a question on the use of counter in NI PCI-6229 board.

Thanks to analogy, I can use the functions of AI and AO using NI PCI-6229.
But, I failed to use its counter for quadratic encoder.

I think it may work, but it is hard for me because I don't have any verified example.

Recently, I tried the following code to set the counter up for quadratic encoder:
---------------------------------------------------------------------------------------------------
a4l_desc_t dsc = {.sbdata = NULL };
a4l_insn_t config;
unsigned int data[4];

a4l_open(&dsc, filename);
dsc.sbdata = malloc(dsc.sbsize);
a4l_fill_desc(&dsc);

config.type = A4L_INSN_CONFIG;
config.idx_subd = 10;  // this is correct. I checked it
data[0] = A4L_INSN_CONFIG_GPCT_QUADRATURE_ENCODER;
data[1] = 0; // X1, X2, X4
data[2] = 0; // indexphase HH, LH, ...
data[3] = 0; // indexreset
config.data = data;
config.data_size = 4*sizeof(unsigned int);

a4l_snd_insn(&dsc, &config);
----------------------------------------------------------------------------------------------------

However, the last a4l_snd_insn() returned error code, -22.


Could you give me the verified sample code for quadratic encoder using NI PCI-6229 board?
Or plz help me to use my encoder :(

Many thanks in advance.

Jonghyun

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-19 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-06 18:04 [Xenomai-help] Use of counter for quadratic encoder in NI PCI-6229 board Kim, Jonghyun (NIH/CC) [F]
2010-08-06 18:27 ` Gilles Chanteperdrix
2010-08-09 22:13 ` Alexis Berlemont
     [not found]   ` <AANLkTikc8KTqLnNoXJnARAX_fh1rf3_N+uuTu3WrVJ76@domain.hid>
2010-08-10 21:30     ` Alexis Berlemont
     [not found]       ` <AANLkTinmjbuVG7MV2=Z0KLAPtYELKJq7Ru9F3rd5wLGM@mail.gmail.com>
2010-08-16 20:54         ` Alexis Berlemont
2010-08-19 15:47           ` Klaas Gadeyne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.