add a method to RawMaster
to send and receive PDUs token-less
#12
Labels
enhancement
New feature or request
Milestone
At the moment, it is only possible to send PDUs by reserving a token on the master side, and this token ensures that the answer is exclusively received by the async task that sent the PDU. This is great for purposed exchanges like configurations or imperative commands.
This is less relevant however for cyclic communication, where we might want to send hundreds of PDUs in a sending loop without bothering about reserving free tokens and receive any incoming PDUs in an other without care of the order.
There is two implementation options:
1. add
send
andreceive
functionsRawMaster::pdu(request) -> answer
RawMaster::send(request)
will send with null token and not wait for the answer
RawMaster::receive(request) -> answer
will not send any request but wait for an answer matching that request
2. add
any
receive function and allow breaking PDU awaitingRawMaster::pdu(request, wait: bool) -> Option<answer>
will have an option for awaiting or not
RawMaster::any(request) -> answer
Option 1 seems better but duplicates some code
use case
Since an ethercat segment can contains up to
2**16
slaves, there can be a delay between sending a PDU and receiving an answer larger than the operation cycle period (1ms or less). So we need to send updates of logical memory at the desired cycle period and use the answer only when it comes back, possibly hundreds of cycle latter.The text was updated successfully, but these errors were encountered: