BiancoRoyal / node-red-contrib-iiot-opcua

deprecated - very new developed by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-iiot-opcua
BSD 3-Clause "New" or "Revised" License
34 stars 9 forks source link

OPCUA-IIoT-Listener only returning errors on monitored value change #196

Closed dtq-one closed 2 years ago

dtq-one commented 2 years ago

Which node-red-contrib-iiot-opcua version are you using?

4.0.9

What happened?

When listening to an item on a OPC-UA server, not using justValue, then node-red-contrib-iiot-opcua listener node returns an encoding error:

{
    "Error": [Error
    ],
    "Value": {
        "payload": {
            "addressSpaceItems": [
                [Object
                ]
            ],
            "nodetype": 'listen',
            "injectType": 'subscribe',
            "value": DataValue {
                "statusCode": [ConstantStatusCode
                ],
                "sourceTimestamp": [Date
                ],
                "sourcePicoseconds": 0,
                "serverTimestamp": [Date
                ],
                "serverPicoseconds": 0,
                "value": [Variant
                ]
            },
            "monitoredItem": ClientMonitoredItemImpl {
                "_events": [
                    "Object": null prototype
                ],
                "_eventsCount": 4,
                "_maxListeners": undefined,
                "statusCode": [ConstantStatusCode
                ],
                "subscription": [ClientSubscriptionImpl
                ],
                "itemToMonitor": [ReadValueId
                ],
                "monitoringParameters": [MonitoringParameters
                ],
                "monitoringMode": 2,
                "timestampsToReturn": 2,
                "result": [MonitoredItemCreateResult
                ],
                "monitoredItemId": 219,
                "filterResult": undefined,
                [Symbol(kCapture)
                "]": false
                }
            },
            "topic": '',
            "justValue": false,
            "_msgid": '6b824e715b291e7b'
        }

Server

Other/External server

How can this be reproduced?

  1. Create an OPCUA-IIoT-Inject node containing one OPC UA Node existing in the OPC UA Server
  2. Create an OPCUA-IIoT-Listener with connection to the OPC UA Server
  3. Create a Debug Node; Wirting all three nodes together and deploy
  4. Initiating in the OPC UA Server a value change of the monitored attribute

What did you expect to happen?

On value change of the OPC UA server the The OPCUA-IIoT-Listener should deliver a object containing the actual changed value.

{
    "value": {
        "dataType": "String",
        "arrayType": "Scalar",
        "value": "Hose"
    },
    "statusCode": {
        "value": 0,
        "description": "No Error",
        "name": "Good"
    },
    "sourceTimestamp": "2022-09-09T10:16:13.173Z",
    "sourcePicoseconds": 0,
    "serverTimestamp": "2022-09-09T10:16:13.173Z",
    "serverPicoseconds": 0
}

Other Information

No response

biancode commented 2 years ago

fixed from v4.0.10