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

   ### What happened?
   
   I'm using TriggeredScraperImpl to fetch data periodically. If any of tag 
failed, I cannot get the tag which is successful. 
   The reason is here: 
https://github.com/apache/plc4x/blob/v0.11.0/plc4j/tools/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/TriggeredScraperImpl.java
       
   public static Map<String, Object> convertPlcResponseToMap(PlcReadResponse 
plcReadResponse) {
           return plcReadResponse.getTagNames().stream()
               .collect(Collectors.toMap(
                   name -> name,
                   plcReadResponse::getObject
               ));
       }
   
   Should call check all tags are successful before calling 
plcReadResponse::getObject, or it will throw exception below:
   org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Tag 'bool-2' could 
not be fetched, response was INVALID_ADDRESS
        at 
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.getTagInternal(DefaultPlcReadResponse.java:623)
        at 
org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse.getObject(DefaultPlcReadResponse.java:111)
   
   
   ### Version
   
   v0.11.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [X] 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: dev-unsubscr...@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to