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

Writing to write-only variables fails #141

Open
dirk-zimoch opened this issue May 26, 2023 · 8 comments
Open

Writing to write-only variables fails #141

dirk-zimoch opened this issue May 26, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@dirk-zimoch
Copy link
Contributor

We have an OPC UA server with some write-only variables.
Writing to them causes the error message: unsupported conversion for outgoing data

opcuaShow CRIO-9046:BO-1 1
item ns=2;s=Data.Node1 record=CRIO-9046:BO-1 state=up status=BadNotReadable dataDirty=n context=SUB1@OPS1
sampling=0(-1) qsize=1(1) cqsize=3 discard=old timestamp=server bini=read output=y monitor=y registered=-(n)
leaf=[ROOT] record(bo)=CRIO-9046:BO-1 type=OpcUa_Null timestamp=server bini=read monitor=y

The data type is Null. This type is deduced from incomingData, which of course had not been set during startup, because the variable is not readable. See also: status=BadNotReadable.

@ralphlange ralphlange added the enhancement New feature or request label May 26, 2023
@ralphlange
Copy link
Member

Interesting.

I have never seen a write-only variable before. That will need some effort...

Things I see in your configuration:

  • bini=read cannot work if the node is not readable
  • monitor=y neither

How should we get the right definition of the OPC UA data type, if the node is not readable? Does a client like UA Expert still show the type?

@dirk-zimoch
Copy link
Contributor Author

dirk-zimoch commented May 26, 2023

bini=read cannot work if the node is not readable
monitor=y neither

I think those are simply the defaults. The OUT link reads:
field (OUT, "@SUB1 ns=2;s=$(SetParam)")

This is what uaexpert sees. The type is "Boolean":
uaexpert

@ralphlange
Copy link
Member

I know these are the defaults - just saying that these defaults will not work for write-only variables, as they configure the client to read at connection-up and set up a monitor.

Ok.
So UaExpert can read the type without having read access to the data. I need to find out how I can get to that information.

@dirk-zimoch
Copy link
Contributor Author

dirk-zimoch commented May 26, 2023

The only things uaexpert logs for this are:

Attribute Plugin | OPC UA Server | Read attributes of node 'NS2|String|Data.Node2' succeeded [ret = Good].
Reference Plugin | OPC UA Server | Browse succeeded.

@ralphlange
Copy link
Member

"Read attributes" - sounds good.

@ralphlange
Copy link
Member

Found it. I need to use the browse (introspection) interface of the server to do that. That gets me access to all the attributes of a node without reading the value.

Up to now I was just reading the value, which also gets me the data type.

@dirk-zimoch
Copy link
Contributor Author

Maybe do that only if initialRead fails because of BadNotReadable?

@ralphlange
Copy link
Member

Yes. Otherwise I would have to always add a lot of OPC UA traffic just to cover that rare case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants