Class DefaultS7MessageProcessor
java.lang.Object
org.apache.plc4x.java.s7.netty.strategies.DefaultS7MessageProcessor
- All Implemented Interfaces:
S7MessageProcessor
public class DefaultS7MessageProcessor extends Object implements S7MessageProcessor
While a SetupCommunication message is no problem, when reading or writing data,
situations could arise that have to be handled. The following situations have to
be handled:
- The number of request items is so big, that the resulting PDU would exceed the
agreed upon PDU size: The request has to be split up into multiple requests.
- If large blocks of data are requested by request items the result of a request
could exceed the PDU size: The requests has to be split up into multiple requests
where each requests response doesn't exceed the PDU size.
The following optimizations should be implemented:
- If blocks are read which are in near proximity to each other it could be better
to replace multiple requests by one that includes multiple blocks.
- Rearranging the order of request items could reduce the number of needed PDUs.
-
Constructor Summary
Constructors Constructor Description DefaultS7MessageProcessor() -
Method Summary
Modifier and Type Method Description Collection<S7RequestMessage>processRequest(S7RequestMessage request, int pduSize)S7ResponseMessageprocessResponse(S7RequestMessage request, S7ResponseMessage response)
-
Constructor Details
-
DefaultS7MessageProcessor
public DefaultS7MessageProcessor()
-
-
Method Details
-
processRequest
public Collection<S7RequestMessage> processRequest(S7RequestMessage request, int pduSize) throws PlcException- Specified by:
processRequestin interfaceS7MessageProcessor- Throws:
PlcException
-
processResponse
- Specified by:
processResponsein interfaceS7MessageProcessor
-