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
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to