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

Setting the status code of a node to "bad" through OPCUA doesn't work #2

Open
lovasoa opened this issue Aug 10, 2020 · 0 comments
Open

Comments

@lovasoa
Copy link

lovasoa commented Aug 10, 2020

When setting up variables in WAGO's eCockpit, they have the StatusWrite bit disabled in their OPCUA node's AccessLevel. This means that when trying to set the StatusCode of the value to any other value than Good, the server answers with the following error:

0x80730000 (BadWriteNotSupported): The server does not support writing the combination of value, status and timestamps provided.

We haven't found any way to change this AccessLevel.

Here is a small python script that can be run to trigger the error :

import asyncio
from datetime import datetime

from asyncua import Client, ua  # type:ignore


async def main():
    client = Client("opc.tcp://ip_of_the_wago_device:4840")
    await client.connect()
    params = ua.WriteParameters()
    attr = ua.WriteValue()
    attr.NodeId = ua.NodeId.from_string("ns=4;s=|var|WAGO 750-8212 PFC200 G2 2ETH RS.Application.GVL.BESS_WATCHDOG_FEEDBACK")
    attr.AttributeId = ua.AttributeIds.Value
    attr.Value.Value = ua.Variant(42, ua.VariantType.UInt16)
    attr.Value.SourceTimestamp = datetime.now()
    attr.Value.StatusCode = ua.StatusCode(ua.StatusCodes.Bad)
    params.NodesToWrite.append(attr)
    write_results = await client.uaclient.write(params)
    for status_code in write_results:
        status_code.check()


if __name__ == "__main__":
    asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant