Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] [Q] onDataChangeNotification from Milo Public Demo Server

I may have found the cause.

When specifying nodeIDs with my tool,

rainy-felix/conf/opcua/milo-example.properties)
--
...
nodeIDs=2,Dynamic/RandomInt32,0 \ 
                2,Dynamic/RandomInt64,0 \
                2,Dynamic,-1

With the above settings,

- Search for 2,Dynamic,-1 (infinite depth)

- Unique nodeID
  Dynamic/RandomInt32
  Dynamic/RandomInt64

As a result, RandomInt32 and RandomInt64 seem to be the result of being registered twice in itemRequest.

Sorry.

2019年8月7日(水) 22:13 shigeru ishida <s5u.ishida@xxxxxxxxx>:
The whole data acquired by the onDataChangeNotification() is as follows.

"2,Dynamic/RandomInt64" --> 4 data
"2,Dynamic/RandomInt32" --> 4 data
"2,Dynamic/RandomFloat" --> 2 data
"2,Dynamic/RandomDouble" --> 2 data

At 1000 (msec) of publishInterval, there were cases of 2 data, but there were cases of 4 data.

The this source is below.

https://github.com/s5uishida/rainy-opcua/blob/master/src/io/github/s5uishida/iot/rainy/device/opcua/OPCUA.java

UaNotificationListener#onDataChangeNotification()
--(queue)-->
UaNotificationThread#run()

-----------------------------------------------------------------------
{
  "deviceID" : "milo.digitalpetri.com:62541/milo",
  "clientID" : "RP3B-01",
  "samplingDate" : "2019-08-07 11:38:08.936",
  "samplingTimeMillis" : 1565174288936,
  "opcua" : {
    "2,Dynamic/RandomInt64" : [ {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : 5990980463499091245
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 5420692849057307041
    }, {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : -8881336140964711079
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 5863872778695597319
    } ],
    "2,Dynamic/RandomInt32" : [ {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : 791772535
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 1782756439
    }, {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : -878956760
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 864562888
    } ],
    "2,Dynamic/RandomFloat" : [ {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : 0.19435209
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 0.25050706
    } ],
    "2,Dynamic/RandomDouble" : [ {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : 0.1526497667677068
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 0.1558034339740545
    } ]
  }
}
----------------------------------------------------------------------

2019年8月7日(水) 21:48 Kevin Herron <kevinherron@xxxxxxxxx>:
I have subscribed to the same Node on the demo server and do not see the same behavior.

A subscription with publishing interval 1000ms, item sampled at 500ms, should give you ~2 value changes each notification.
subscription.addNotificationListener(new UaSubscription.NotificationListener() {
@Override
public void onDataChangeNotification(
UaSubscription subscription,
List<UaMonitoredItem> monitoredItems,
List<DataValue> dataValues,
DateTime publishTime
) {

System.out.println("publishTime=" + publishTime);

for (int i = 0; i < dataValues.size(); i++) {
DataValue value = dataValues.get(i);
DateTime sourceTime = value.getSourceTime();
DateTime serverTime = value.getServerTime();
System.out.printf("item[%s]: value=%s, sourceTime=%s, serverTime=%s\n",
i, value.getValue().getValue(), sourceTime.getJavaTime(), serverTime.getJavaTime());
}
}
});

Some of the results:

publishTime=DateTime{utcTime=132096554583830000, javaDate=Wed Aug 07 05:44:18 PDT 2019}
item[0]: value=2875342633587846354, sourceTime=1565181857875, serverTime=1565181857875
item[1]: value=957520923775665323, sourceTime=1565181858375, serverTime=1565181858375
publishTime=DateTime{utcTime=132096554593830000, javaDate=Wed Aug 07 05:44:19 PDT 2019}
item[0]: value=-2336219662187986474, sourceTime=1565181858875, serverTime=1565181858875
item[1]: value=-7969223177063959083, sourceTime=1565181859376, serverTime=1565181859376
publishTime=DateTime{utcTime=132096554603830000, javaDate=Wed Aug 07 05:44:20 PDT 2019}
item[0]: value=4339378375169982240, sourceTime=1565181859876, serverTime=1565181859876
item[1]: value=9174086057039525471, sourceTime=1565181860376, serverTime=1565181860376
publishTime=DateTime{utcTime=132096554613840000, javaDate=Wed Aug 07 05:44:21 PDT 2019}
item[0]: value=-776450203408151688, sourceTime=1565181860876, serverTime=1565181860876
item[1]: value=-7174959611780219828, sourceTime=1565181861376, serverTime=1565181861376

On Wed, Aug 7, 2019 at 5:32 AM Kevin Herron <kevinherron@xxxxxxxxx> wrote:
Shigeru,

I will try to reproduce this issue and let you know what I find.

On Wed, Aug 7, 2019 at 4:36 AM shigeru ishida <s5u.ishida@xxxxxxxxx> wrote:
Hi Kevin,

I have a question about the public demo server.

- publishInterval = 1000 (msec)
- samplingInterval = 500 (msec)

The following [2,Dynamic/RandomInt64] was obtained under the above conditions.
In one notification, 4 pieces of data could be acquired. The order of this JSON format
data is the dataValues list organized for each NodeId.

onDataChangeNotification(UaSubscription subscription,
                                      List<UaMonitoredItem> monitoredItems,
                                      List<DataValue> dataValues,
                                      DateTime publishTime)

t this time, looking at sourceTime, it seems that the order of time is repeated.

      "sourceTime" : "2019-08-07 11:38:08.155",
      "sourceTime" : "2019-08-07 11:38:08.655",
      "sourceTime" : "2019-08-07 11:38:08.155",
      "sourceTime" : "2019-08-07 11:38:08.655",

Is there any problem with the publishing facility of the server?
The time accuracy is msec. It is not 100nsec.
----------------------------------------------------------------------
{
  "deviceID" : "milo.digitalpetri.com:62541/milo",
  "clientID" : "RP3B-01",
  "samplingDate" : "2019-08-07 11:38:08.936",
  "samplingTimeMillis" : 1565174288936,
  "opcua" : {
    "2,Dynamic/RandomInt64" : [ {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : 5990980463499091245
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 5420692849057307041
    }, {
      "sourceTimeMillis" : 1565174288155,
      "sourceTime" : "2019-08-07 11:38:08.155",
      "serverTime" : "2019-08-07 11:38:08.155",
      "serverTimeMillis" : 1565174288155,
      "value" : -8881336140964711079
    }, {
      "sourceTimeMillis" : 1565174288655,
      "sourceTime" : "2019-08-07 11:38:08.655",
      "serverTime" : "2019-08-07 11:38:08.655",
      "serverTimeMillis" : 1565174288655,
      "value" : 5863872778695597319
    } ]
...
...
  }
}
----------------------------------------------------------------------

If I misunderstand, I'm sorry.

Regards,

--Shigeru

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev

Back to the top