Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong status of a varibale in READRESPONSE. #41

Open
atimin opened this issue Jul 27, 2019 · 7 comments
Open

Wrong status of a varibale in READRESPONSE. #41

atimin opened this issue Jul 27, 2019 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@atimin
Copy link
Member

atimin commented Jul 27, 2019

Describe the bug

If a variable in the OPC UA server has a not success status, it is copied in READRESPONSE as a number. In other situations, the status code has a string value, for an example 'BadInvalidNodeId'.

To Reproduce

  import websocket
  import json

   msg = {
      'Header': {
        'MessageType':'READ_REQUEST',
        'ClientHandle':'1'
      },
      'Body': { 'Variable' : 'TestVariableWithBadStatus'}
   }

 
  ws = websocket.create_connection('ws://127.0.0.1:8081')
  ws.send(json.dumps(msg)) 
  resp = ws.recv()  
  print(resp)

Results:

{
    "Header": {
        "MessageType": "READ_RESPONSE",
        "ClientHandle": "1"
    },
    "Body": {
        "Value": {
            "Type": "12",
            "Body": "Hello, worldi1111!"
        },
        "Status": "2157641728",
        "SourceTimestamp": "2019-07-27T06:58:53Z",
        "ServerTimestamp": "2019-07-27T11:58:53Z"
    }
}

Expected behavior

The status should be:

   "Status": "BadNoData",
@atimin atimin added the bug Something isn't working label Jul 27, 2019
@atimin atimin added this to To do in Release-1.0.0 via automation Jul 27, 2019
@huebl
Copy link
Contributor

huebl commented Jul 27, 2019

The SPEC specifies that the StatusCode must be returned as a number and not as a string. A string is only allowed in a status object but not in a status variable. Currently we do not support status objects. Should there still be a status string returned then this should be changed.

@FLIPBack - Do you know such places?

@atimin
Copy link
Member Author

atimin commented Jul 27, 2019

Ok. I agree that the status of the value must be an integer. But the names are confusing me again.
Field StatusCode stores the status as a sting. In my opinion, It can't be a code. On the other hand field Status is a number and it is code. Moreover it is hard to distinguish these names.

My offer is to rename Status to OpcUaStatusCode, so its semantic will be clearer. StatusCode is not the best name, but it might cause a lot of changes to rename it.

@atimin
Copy link
Member Author

atimin commented Jul 27, 2019

Should there still be a status string returned then this should be changed.

@FLIPBack - Do you know such places?

Sorry didn't catch, 😞

@huebl
Copy link
Contributor

huebl commented Jul 27, 2019

The implementation (OpcUaWebServer) uses proprietary and OPC UA data types. The description of JSON was not yet included in the SPEC at this time. Therefore, all status codes were transmitted in string format. The new OPC UA specification now also describes the JSON formats. Therefore, the OPC UA data types have already been changed. The own data types were probably not changed yet. That's why there are still differences.

I also think the own data types should be adapted to the OPC UA standard.

@atimin
Copy link
Member Author

atimin commented Jul 27, 2019

@huebl , could you give an example? own data type is not clear to me.

@huebl
Copy link
Contributor

huebl commented Jul 27, 2019

Example OPC UA Data Type: OpcUaVariable (READ_RESPONSE Body)
Example own DataType: Variables (Value Info Response). This data type is not described in OPC UA SPEC.

All requests do not exist in OPC UA. As a result, many own data types are used for the requests / responses. The situation in the OpcUaGateway is different. In most cases (exception login) OPC UA data types are used in this component.

@atimin
Copy link
Member Author

atimin commented Jul 29, 2019

Having a look at the specification, I see that you follow the standard.

I also think the own data types should be adapted to the OPC UA standard.

How do you want to do it?

@huebl huebl added this to the Release 1.0.0 milestone May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Release-1.0.0
  
To do
Development

No branches or pull requests

2 participants