ComediEncoder positionSet()

Hi,

since the comedi support in ocl moved to comedi-0.8 i was updating our
robots hardware components, and apparently the positionSet() on a
ComediEncoder has no effect. I know that the ComediEncoder was one of
the devices that changed most between comedi-0.7.x and comedi-0.8, so
probably something went wrong there.

I'll try to find out why it does not work anymore. I'm just reporting
that there is probably something broken in the ComediEncoder code.

Ruben

ComediEncoder positionSet()

On Monday 15 December 2008 14:25:41 Ruben Smits wrote:
> Hi,
>
> since the comedi support in ocl moved to comedi-0.8 i was updating our
> robots hardware components, and apparently the positionSet() on a
> ComediEncoder has no effect. I know that the ComediEncoder was one of
> the devices that changed most between comedi-0.7.x and comedi-0.8, so
> probably something went wrong there.
>
> I'll try to find out why it does not work anymore. I'm just reporting
> that there is probably something broken in the ComediEncoder code.

What changed is that in 0.8, an encoder is a subdevice instead of a channel
and the channel(s) holds the counter value. You can read and write to such a
channel (with comedi_data_read/write), but I don't know if this is race-safe
or not.

Peter

Ruben Smits's picture

ComediEncoder positionSet()

On 15 Dec 2008, at 14:42, Peter Soetens wrote:

> On Monday 15 December 2008 14:25:41 Ruben Smits wrote:
>> Hi,
>>
>> since the comedi support in ocl moved to comedi-0.8 i was updating
>> our
>> robots hardware components, and apparently the positionSet() on a
>> ComediEncoder has no effect. I know that the ComediEncoder was one of
>> the devices that changed most between comedi-0.7.x and comedi-0.8, so
>> probably something went wrong there.
>>
>> I'll try to find out why it does not work anymore. I'm just reporting
>> that there is probably something broken in the ComediEncoder code.
>
> What changed is that in 0.8, an encoder is a subdevice instead of a
> channel
> and the channel(s) holds the counter value. You can read and write
> to such a
> channel (with comedi_data_read/write), but I don't know if this is
> race-safe
> or not.

I checked the code of comedi and i found that is is not safe to write
a value to one of the channels of a counter submodule after is was
armed. This is the case for me.

Apparently the value of a data_write command is not set to the counter
after it was armed. I assume that i was just using the comedi counter
in a wrong way before. This also means that the code of ComediEncoder
should be slightly changed to cope with this.

Ruben

>
> Peter
>