sittner/linuxcnc-ethercat

Truncated 16-bit signed integers?

bobobo1618 opened this issue · 1 comments

I'm trying to set up a Delta MS300 VFD with a CMM-EC01 EtherCAT option card. I've got it working save for speed control.

It seems that the speed value sent to the VFD is lacking one of the two bytes of data:

  • EtherCAT PDO entry:
    <pdoEntry idx="6042" subIdx="00" bitLen="16" halPin="target-velocity" halType="s32"/>

  • Debugging:

    > halcmd getp lcec.0.3.target-velocity
    10000
    > ethercat upload -p 3 -t int16 0x6042 0
    0x0027 39
    > python -c 'print(hex(10000))'
    0x2710
    

It looks like the device has been told the speed should be 0x0027 instead of 0x2710, as if >> 8 has been added.

To be clear, was this using the generic support or the dems300 driver? I don't see target-velocity in the dems300 driver; that PDO is mapped to vel-rpm-cmd times vel-scale.