Class S7ProtocolLogic
java.lang.Object
org.apache.plc4x.java.spi.Plc4xProtocolBase<TPKTPacket>
org.apache.plc4x.java.s7.readwrite.protocol.S7ProtocolLogic
The S7 Protocol states that there can not be more then {min(maxAmqCaller, maxAmqCallee} "ongoing" requests.
So we need to limit those.
Thus, each request goes to a Work Queue and this Queue ensures, that only 3 are open at the same time.
-
Field Summary
FieldsFields inherited from class org.apache.plc4x.java.spi.Plc4xProtocolBase
context, driverContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(ConversationContext<TPKTPacket> context) protected voiddecode(ConversationContext<TPKTPacket> context, TPKTPacket msg) This method is only called when there is no Response Handler.protected S7AddressencodeS7Address(PlcField field) Currently we only support the S7 Any type of addresses.voidonConnect(ConversationContext<TPKTPacket> context) read(PlcReadRequest readRequest) voidsetDriverContext(DriverContext driverContext) subscribe(PlcSubscriptionRequest subscriptionRequest) unsubscribe(PlcUnsubscriptionRequest unsubscriptionRequest) write(PlcWriteRequest writeRequest) Methods inherited from class org.apache.plc4x.java.spi.Plc4xProtocolBase
browse, getDriverContext, onDisconnect, onDiscover, setContext
-
Field Details
-
REQUEST_TIMEOUT
-
-
Constructor Details
-
S7ProtocolLogic
public S7ProtocolLogic()
-
-
Method Details
-
setDriverContext
- Overrides:
setDriverContextin classPlc4xProtocolBase<TPKTPacket>
-
onConnect
- Overrides:
onConnectin classPlc4xProtocolBase<TPKTPacket>
-
read
- Overrides:
readin classPlc4xProtocolBase<TPKTPacket>
-
write
- Overrides:
writein classPlc4xProtocolBase<TPKTPacket>
-
subscribe
public CompletableFuture<PlcSubscriptionResponse> subscribe(PlcSubscriptionRequest subscriptionRequest) - Overrides:
subscribein classPlc4xProtocolBase<TPKTPacket>
-
unsubscribe
public CompletableFuture<PlcUnsubscriptionResponse> unsubscribe(PlcUnsubscriptionRequest unsubscriptionRequest) - Overrides:
unsubscribein classPlc4xProtocolBase<TPKTPacket>
-
decode
This method is only called when there is no Response Handler.- Overrides:
decodein classPlc4xProtocolBase<TPKTPacket>- Throws:
Exception
-
close
- Specified by:
closein classPlc4xProtocolBase<TPKTPacket>
-
encodeS7Address
Currently we only support the S7 Any type of addresses. This helper simply converts the S7Field from PLC4X into S7Address objects.- Parameters:
field- S7Field instance we need to convert into an S7Address- Returns:
- the S7Address
-