Bad_NotWritable: The access level does not allow writing to the Node

Hello,

When I try to write data to a tag I get the following error message.

Bad_NotWritable: The access level does not allow writing to the Node.

I have created a few API endpoints using Web Dev as follows:

createTags - doPost

	basePath = request['data']['basePath']
	tags = request['data']['tags']
	collisionPolicy = request['data']['collisionPolicy']
	
	result = system.tag.configure(basePath, tags, collisionPolicy)

	return {'json': result}

tag - doPost

	paths = request['data']['paths']
	values = request['data']['values']

	result = system.tag.writeBlocking(paths, values)
	
	return {'json': result}

I create an additional tag in the Tag Provider [Sample_Tags] by calling createTags - doPost with the following body:

{
    "basePath": "[Sample_Tags]/Writeable",
    "tags": [
        {
            "name": "DeviceEUI",
            "opcItemPath" : "ns=2;s=[Sample_Tags]_Meta:Writeable/DeviceEUI",
            "opcServer": "Ignition OPC UA Server",
            "valueSource": "opc"
        }
    ],
    "collisionPolicy": "o"
}

The tag is created with the following result: (192 = “good”)

[
    {
        "code": 192
    }
]

If I want to write data to the tag using tag - doPost with the following body:

{
    "paths": ["[Sample_Tags]/Writeable/DeviceEUI", "[Sample_Tags]/Writeable/WriteableBoolean1"],
    "values": [12345, false]
}

I get the following message:

[
    {
        "code": -2147483136,
        "diagnosticMessage": "Bad_NotWritable: The access level does not allow writing to the Node."
    },
    {
        "code": 192
    }
]

So the predefined tag WriteableBoolean1 has a result of 192 = “good”. The other tag DeviceEUI that I defined myself gets an error message.

I suspect this is because I am trying to write to a tag which does not originates from a device that is defined in Ignition?

If so, how can I write to a tag which I have created dynamically from an external program (using the Web Dev API) and write to it? (using the same Web Dev API)

Thanks,

Simon.

You’re creating an OPC Tag pointing to an address in the simulator driver that doesn’t exist.

If you want to create an arbitrary tag then just create a Memory Tag instead, and don’t try to pretend it exists as part of some device/driver you don’t control.

Thanks Kevin. Specifying "valueSource": "memory" did the trick…

{
    "basePath": "[Sample_Tags]/Writeable",
    "tags": [
        {
            "name": "DeviceEUI",
            "opcItemPath" : "ns=2;s=[Sample_Tags]_Meta:Writeable/DeviceEUI",
            "opcServer": "Ignition OPC UA Server",
            "valueSource": "memory"
        }
    ],
    "collisionPolicy": "o"
}

Another question though. Where can I find all the settings for a tag definition and their explanations?

The reason why I am asking is the difficulty I have with e.g. the dataType property. See below.

If I try for example to specify the data type with "dataType": "string" as follows:

{
    "basePath": "[Sample_Tags]/Writeable",
    "tags": [
        {
            "name": "DeviceEUI",
            "dataType": "string",
            "opcItemPath" : "ns=2;s=[Sample_Tags]_Meta:Writeable/DeviceEUI",
            "opcServer": "Ignition OPC UA Server",
            "valueSource": "memory"
        }
    ],
    "collisionPolicy": "o"
}

I do see the data type is string in the OPC client:

image

But in the designer it is set to None:

image

And if I try to write to the tag with:

{
    "paths": ["[Sample_Tags]/Writeable/DeviceEUI"],
    "values": ["testing"]
}

I get:

[
    {
        "code": -1073741052,
        "diagnosticMessage": "Error trying to coerce 'testing' to a number."
    }
]

So if there is a complete overview of all the properties of the tag definition that would be a great help!

Thanks.

These doc pages should be useful:

https://docs.inductiveautomation.com/display/DOC81/system.tag.configure
https://docs.inductiveautomation.com/display/DOC81/Tag+Properties

If you find the “Data Type” tag property there’s a list of valid values in its Description column.

In your case I’m guessing it’s just a case sensitivity issue and you should be using String, not string.

All the OPC-related properties you cited in your last example should be removed as well, they don’t apply to Memory Tags.

1 Like