EtherCrab 0.7 Released
EtherCrab 0.7.0 (lib.rs) is out as the next release of this pure Rust EtherCAT MainDevice! There are some minor breaking changes, but nothing too difficult to migrate. Otherwise, not much to report as this is a release to get a couple of features out in the wild before some larger breaking changes in future EtherCrab versions. Full changelog is available here.
Breaking changes
There isn't too much in this release, so don't worry. First off, the Minimum Supported Rust Version (MSRV) has been bumped from 1.81 to 1.85, with a migration to Rust edition 2024 at the same time.
Next, an extra generic parameter has been added to SubDeviceGroup and related items such as
PdiReadGuard. For example, this is how SubDeviceGroup has changed:
// EtherCrab 0.6
To mirror EtherCrab 0.6 behaviour by default, the field is set to a lock of spin::Yield for std,
and spin::Spin for no_std, however this change allows the use of custom locks, as long as they
implement the lock_api traits.
Another minor API breakage is in MainDevice::init. It now requires a default groups struct to be
passed as an extra argument, instead of requiring G: Default and doing it internally. This should
just be a one line change as there was already a Default bound on MainDevice::init:
let groups = maindevice
.
.await
.expect;
This allows customising the initialisation of the groups struct passed to init.
Finally, Error::Timeout has an inner enum describing the reason for a timeout. The change to
Error is minimal:
use Error;
let result = /* snip */;
// EtherCrab 0.6
if let Timeout = result
// EtherCrab 0.7
if let Timeout = result
New features
Not much to show here really, but there are still some niceties added:
- XDP is now supported on Linux systems by enabling the
xdpfeature. XDP is a lower level way to access networking hardware, so may help performance on systems. - SDO info getters have been added to list out available SDOs present in a SubDevice. Search for
sdo_info_object_description_listandsdo_info_object_quantitiesin the docs, or look at thesdo-infoexample for more. - In lieu of a more complete setup using ESI files and such, basic oversampling support was added
with the
SubDevice::set_oversamplingmethod. Theel3702-oversamplingexample shows a demo of this functionality. Pay attention to how theSYNC1config is set up!
Other fixes and small behavioural changes
- SubDevice status codes and SDO abort codes are now read and returned to the user correctly.
- Distributed Clocks should be more reliable with SubDevices that have 32 bit clocks.
- Sync Manager config is now read from EEPROM instead of over CoE, improving reliability for some SubDevices.
- Sync Managers with a length of
0are no longer enabled, again helping reliability with some SubDevices. - The minimally documented register
0x980is no longer used internally in EtherCrab. Its use is present in other MainDevice implementations but causes issues with some SubDevices.
What's next
Pretty much the same as EtherCrab 0.6...
As usual, if you have other features you'd like to see in EtherCrab, please open a feature request!
Thanks to everyone using and improving EtherCrab every day ❤️