birkenfeld / ads-rs

Rust crate to access PLCs via the Beckhoff ADS protocol
https://crates.io/crates/ads
Apache License 2.0
46 stars 10 forks source link

silent panic if twincat restarts mid-read #18

Closed chammel4 closed 1 year ago

chammel4 commented 1 year ago

I'm finding that if a twincat restart completes (not sure yet exactly at which state transition the problem occurs) during device.get_state() or ads::Handle.read(), or ads::Handle::new(), the call never returns with a Result<> - this leads me to believe something in the background silently panics.

Is there something you're aware of that can be monitored to explicitly avoid this scenario? or otherwise, suggestions for where this silent panic may be taking place?

Thanks!

birkenfeld commented 1 year ago

Are you creating the client with Timeouts::none()? It is recommended to use a timeout to avoid this.

chammel4 commented 1 year ago

good call, kind sir! That took care of it - now nicely riding through TC restarts. I didn't realize I had used Timeouts::none

chammel4 commented 1 year ago

nothing to be done - Timeouts::none was erroneously used