You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by "andvasp (via GitHub)" <gi...@apache.org> on 2026/08/21 14:02:38 UTC
[PR] feat(plc4j/eip): Report the information if the tag address is invalid
andvasp opened a new pull request, #2706:
URL: https://github.com/apache/plc4x/pull/2706
Hi @chrisdutz!
This is a simple PR to report tag INVALID_ADDRESS.
I discover this when analysing a problem where I am trying to read a valid tag address but the PLC does not recognize it. I am investigating it and probability I will create an issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz commented on PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#issuecomment-5445432867
I'll look into this as soon as I manage to free a few seconds of time ... I'm sort of working my butt off in preparing PLC4X for 1.0.0 and the release ... your PRs always claim to be simple, but when looking at them the reformatting you keep on doing makes them all but simple to spot the changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "andvasp (via GitHub)" <gi...@apache.org>.
andvasp commented on PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#issuecomment-5446378471
Sorry for that @chrisdutz .
I took advantage of the changes and encapsulated an existing method that uses the response status, making a few minor modifications. I submitted a much simpler version.
I believe it's truly simple now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#discussion_r3844366343
##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -498,15 +497,10 @@ private CompletableFuture<PlcReadResponse> readWithoutMessageRouter(PlcReadReque
CipRRData rrdata = new CipRRData(sessionHandle, CIPStatus.Success.getValue(),
DEFAULT_SENDER_CONTEXT, 0L, EMPTY_INTERFACE_HANDLE, 0, typeIds);
return sendRequest(rrdata).thenApply(response -> {
- if (!(response instanceof CipRRData rr)) {
- values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INTERNAL_ERROR, null));
- return null;
- }
- UnConnectedDataItem dataItem = (UnConnectedDataItem) rr.getTypeIds().get(1);
- if (dataItem.getService() instanceof CipConnectedResponse ccr && ccr.getStatus() == 0x03) {
- values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INVALID_ADDRESS, null));
+ if (extractCipService(response) instanceof CipReadResponse rr) {
+ values.put(tagName, createPlcResponse(eipTag, rr));
} else {
- values.putAll(decodeSingleReadResponse(dataItem.getService(), tagName, eipTag));
+ values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INTERNAL_ERROR, null));
Review Comment:
This drops the existing invalid-address handling for the no-message-router path. An Unconnected Send failure is decoded as `CipConnectedResponse` (the removed code explicitly handled status `0x03`, and the parallel Go reader still does), so the new `CipReadResponse` type check sends that response to `INTERNAL_ERROR` without ever calling `decodeResponseCode`. Decode a non-success `CipServiceResponse` here before falling back to `INTERNAL_ERROR`.
This issue also appears on line 1107 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "andvasp (via GitHub)" <gi...@apache.org>.
andvasp commented on PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#issuecomment-5396289524
HI @chrisdutz.
Do you believe it can be merged before release 1.0.0?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
chrisdutz merged PR #2706:
URL: https://github.com/apache/plc4x/pull/2706
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "andvasp (via GitHub)" <gi...@apache.org>.
andvasp commented on code in PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#discussion_r3844586868
##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -498,15 +497,10 @@ private CompletableFuture<PlcReadResponse> readWithoutMessageRouter(PlcReadReque
CipRRData rrdata = new CipRRData(sessionHandle, CIPStatus.Success.getValue(),
DEFAULT_SENDER_CONTEXT, 0L, EMPTY_INTERFACE_HANDLE, 0, typeIds);
return sendRequest(rrdata).thenApply(response -> {
- if (!(response instanceof CipRRData rr)) {
- values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INTERNAL_ERROR, null));
- return null;
- }
- UnConnectedDataItem dataItem = (UnConnectedDataItem) rr.getTypeIds().get(1);
- if (dataItem.getService() instanceof CipConnectedResponse ccr && ccr.getStatus() == 0x03) {
- values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INVALID_ADDRESS, null));
+ if (extractCipService(response) instanceof CipReadResponse rr) {
+ values.put(tagName, createPlcResponse(eipTag, rr));
} else {
- values.putAll(decodeSingleReadResponse(dataItem.getService(), tagName, eipTag));
+ values.put(tagName, new DefaultPlcResponseItem<>(PlcResponseCode.INTERNAL_ERROR, null));
Review Comment:
Yes. The logic was simplified a little bit. As the status 0x03 is from type CipServiceResponse it can be handled directly without checking for type CipConnectedResponse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(plc4j/eip): Report the information if the tag address is invalid
Posted by "andvasp (via GitHub)" <gi...@apache.org>.
andvasp commented on PR #2706:
URL: https://github.com/apache/plc4x/pull/2706#issuecomment-5444977671
Hi @chrisdutz !
What about this PR. Can you review it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@plc4x.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org