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

   ### What happened?
   
   The documentation says that tags added via `addCyclicField(...)` will be 
polled in the specified time intervals. My expectation is to get subscription 
events each time these fields are getting polled, but apparently I don't get 
any. The other two types of subscriptions are working OK, however I don't see 
any difference between `addChangeOfStateField(...)` and `addEventField(...)` 
with the OPC-UA driver.
   
   Example code to reproduce the issue:
   ```
   PlcDriverManager driverManager = new PlcDriverManager();
   try (PlcConnection opcuaConnection = 
driverManager.getConnection("opcua:tcp://opcuaserver.com:48010")) {
       PlcSubscriptionRequest request = 
opcuaConnection.subscriptionRequestBuilder()
               .addCyclicField(
                       "Demo",
                       "ns=2;s=Demo.Static.Scalar.String",
                       Duration.ofSeconds(1)
               )
               .build();
   
       PlcSubscriptionResponse response = request.execute().get();
       if (response.getResponseCode("Demo") != PlcResponseCode.OK) {
           throw new RuntimeException("Not OK.");
       }
   
       AtomicLong counter = new AtomicLong();
   
       response.getSubscriptionHandle("Demo").register(
               subscriptionEvent -> {
                   counter.incrementAndGet();
                   System.out.println(subscriptionEvent);
               }
       );
   
       Thread.sleep(10 * 1000); // 10 seconds
   
       if (counter.get() == 0) {
           throw new RuntimeException("No events received.");
       }
   }
   
   System.out.println("OK");
   ```
   
   Logs
   -------
   
   * [logs.txt](https://github.com/apache/plc4x/files/12706657/logs.txt)
   
   
   ### Version
   
   v0.10.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [X] 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