How are CanWrite and ReadOnly populated from an OPC UA device tag?

I am playing around with an Emerson CPL410 PLC and Ignition 8.1.9 (Fresh install)

I have a gazillion variables in the PLC that are marked for OPC UA as "Publish External Read-Only"

When I loaded some of these tags into a project (from a basic OPC UA connection) I see that "CanWrite" is checked, and "ReadOnly" is unchecked. When I go to change the value of the tag, I get a response of:

Error writing to value.value:
Bad("Bad_NotWriteable: The access level does not allow writing to the Node.")

If I manually check "ReadOnly", "CanWrite" unchecks automatically. But if I then try to uncheck "ReadOnly", I get the error message:

Error writing to ReadOnly.value:
Bad_AccessDenied("Tag is Read-Only")

So it seems as if somewhere down there Ignition knows that it is a read only tag. But the initial presentation is that the tag is not read only.

Ignition is not bringing in access levels from the OPC UA servers, what you are seeing and modifying are the access level in Ignition's tag system.

When you have it set to writable and attempt a write only to get something like:

Error writing to value.value:
Bad(“Bad_NotWriteable: The access level does not allow writing to the Node.”)

that means the write went to the OPC server and was rejected there.

When you modify the Ignition tag permissions to indicate it's ReadOnly then it gets stopped sooner.

So what you are saying is that the only way to know the writability of a tag is by referring back to the PLC itself?

For an OPC tag, yes.

I think this is something we can improve on in the future, though. It should be possible to read the AccessLevels from the server and set the Ignition tag permissions at the time the tag is created. It would only be set then, though, and wouldn’t update if/when it changed in the server. This is the same dilemma that has stopped us from pulling the Description attribute in for OPC tags from OPC UA servers as well.