zhang13 opened a new issue, #1702:
URL: https://github.com/apache/plc4x/issues/1702

   ### What happened?
   
   Some point readings in EthernetIP data read are null. In EipProtocolLogic, 
the decodeSingleReadResponse method returns a result where CipService p is not 
a CipReadResponse. p is CipConnectedResponse.
   Only certain fixed points return p as CipConnectedResponse, and I don't know 
why.
   `private Map<String, ResponseItem<PlcValue>> 
decodeSingleReadResponse(CipService p, String tagName, PlcTag tag) {
           Map<String, ResponseItem<PlcValue>> values = new HashMap<>();
           if (p instanceof CipReadResponse) {
               CipReadResponse resp = (CipReadResponse) p;
               PlcResponseCode code = decodeResponseCode(resp.getStatus());
               PlcValue plcValue = null;
               CIPDataTypeCode type = resp.getData().getDataType();
               ByteBuf data = Unpooled.wrappedBuffer(resp.getData().getData());
               if (code == PlcResponseCode.OK) {
                   plcValue = parsePlcValue((EipTag) tag, data, type);
               }
               ResponseItem<PlcValue> result = new ResponseItem<>(code, 
plcValue);
               values.put(tagName, result);
           } else {
   // **p is CipConnectedResponse**
               System.out.println(p.getClass().getName()); // 
CipConnectedResponse
           }
           return values;
       }`
   
   ### Version
   
   v0.12.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [X] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [ ] S7


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to