Uploaded image for project: 'Apache PLC4X'
  1. Apache PLC4X
  2. PLC4X-146

Problem when using examples/hello-integration-edgent with plc-simulator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4.0, 0.5.0
    • 0.6.0
    • Integration-Edgent
    • None

    Description

      Hi, I am trying to use PLC4x (PLC4J actually) and find some errors:

      1. When I used `HelloPlc4x`, the clioption was: --connection-string test://127.0.0.1 --field-addresses RANDOM/foo:BYTE 

              OK it works!

       

            2. Then I tried org.apache.plc4x.java.examples.integration.edgent.PlcLogger, and the cliOption was: --connection-string test://127.0.0.1 --field-address RANDOM/foo:BYTE --polling-interval 1000, then error occurs:

       

      11:14:25.568 [pool-1-thread-1-489175fe-87ea-41a2-87c2-35b62b8ac594] ERROR o.a.p.edgent.PlcConnectionAdapter - reading from plc device test://127.0.0.1 null failed11:14:25.568 [pool-1-thread-1-489175fe-87ea-41a2-87c2-35b62b8ac594] ERROR o.a.p.edgent.PlcConnectionAdapter - reading from plc device test://127.0.0.1 null failedorg.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException: Incompatible Datatype java.lang.Byte at index 0 at org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem.getByte(BaseDefaultFieldItem.java:59) at org.apache.plc4x.java.base.messages.DefaultPlcReadResponse.getByte(DefaultPlcReadResponse.java:158) at org.apache.plc4x.java.base.messages.DefaultPlcReadResponse.getByte(DefaultPlcReadResponse.java:152) at org.apache.plc4x.edgent.PlcConnectionAdapter$MySupplier.get(PlcConnectionAdapter.java:175) at org.apache.edgent.function.Functions$ThreadSafeSupplier.get(Functions.java:165) at org.apache.edgent.oplet.functional.SupplierPeriodicSource.fetchTuples(SupplierPeriodicSource.java:50) at org.apache.edgent.oplet.core.PeriodicSource.run(PeriodicSource.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at org.apache.edgent.runtime.etiao.TrackingScheduledExecutor$TrackedFuture.run(TrackingScheduledExecutor.java:226) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.edgent.runtime.etiao.ThreadFactoryTracker$2.run(ThreadFactoryTracker.java:87) at java.lang.Thread.run(Thread.java:748)

       

      I tried some other data type like INTEGER, and got the same error.

       

      Is there something wrong?

       

       

       

      Attachments

        Issue Links

          Activity

            People

              cdutz Christofer Dutz
              hxd Xiangdong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m