.. i just found - my mistake - i was talking about counters not encoders ...
but the issue is quite similar, besides the fact that on pins the inputs for Channel A&B are parametrized.
pokeys provide 25 nomal encoders + 3 FastEncoders. There is also one ultrafast-encoder (but i'm not sure if one of the normal encoder-channels get nominated as ultrafast, or if we can access this value on a seperate channel).
there is also a possibility to nominate one of these encoders as MPGJogEncoder in PulseEngine. Anyway i assume there will be some interferences between PulseEngineV2 and LinuxCnc, as i did not test it yet i cannot say if this can be used properly on a LinuxCnc-mill.
for normal encoders my implementations uses the following:
// pin names
Code:
pin out s32 encoder.#.count[29];
pin out float encoder.#.position[29];
pin out float encoder.#.velocity[29];
pin in bit encoder.#.reset[29];
pin in bit encoder.#.index-enable[29];
param rw float encoder.#.scale[29] "The scale factor used to convert counts to position units. It is in “counts per position unit”";
...
if (dev->info.iBasicEncoderCount)
{
// read encodervalues
if (PK_EncoderValuesGet(dev) == PK_OK)
{
EncoderValuesGet = true;
//map values to pins
for (i = 0; i < dev->info.iBasicEncoderCount; i++)
{
encoder_count(i)=dev->Encoders[i].encoderValue;
}
if (dev->info.iUltraFastEncoders)
{
for (i = dev->info.iBasicEncoderCount; i < (dev->info.iBasicEncoderCount + dev->info.iUltraFastEncoders); i++)
{
encoder_count(i) = dev->Encoders[i].encoderValue;
}
}
/*if (dev->info.iFastEncoders)
{
for (i = dev->info.iBasicEncoderCount+ dev->info.iUltraFastEncoders; i < (dev->info.iBasicEncoderCount + dev->info.iUltraFastEncoders + dev->info.iFastEncoders ); i++)
{
encoder_value(i) = dev->Encoders[i].encoderValue;
}
}*/
}
}
[/i][/i][/i]