orocos / rtt_soem

RTT SOEM EtherCAT components and drivers
27 stars 31 forks source link

soem_beckhoff_drivers: Consistently use 2^n-1 for the range value #7

Closed octinion closed 9 years ago

octinion commented 9 years ago

Previously, 2^n was used (where n is resolution of the module). The EL4002 will be used as an example. The EL4002 is an analog output module which supports 0 to 10V output. When 2^n is used as the range of this module, 0V will be the output as a result of module.write(10) due to integer overflow. The module does support 10V output. When 2^n-1 is used, the module does indeed output 10V as a result of module.write(10).

Signed-off-by: Johan Robben jrobben@octinion.com

smits commented 9 years ago

LGTM