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

Can't add Variable to graph #85

Open
Lifbully opened this issue Jul 6, 2022 · 0 comments
Open

Can't add Variable to graph #85

Lifbully opened this issue Jul 6, 2022 · 0 comments

Comments

@Lifbully
Copy link

Lifbully commented Jul 6, 2022

Hi I'm trying to add a changing INT32 type variable to the server and watch the data change on the client side. I can see the variable change by subscribing to the data change, but I can't add it to the graph. When I use the add to graph function it shows nothing. Can anyone tell me why? Variables are defined here:

c1Attr.displayName = UA_LOCALIZEDTEXT(const_cast<char*> ("en-US"), const_cast<char*> ("c1 - current value"));
c1Attr.accessLevel = UA_ACCESSLEVELMASK_READ | UA_ACCESSLEVELMASK_WRITE;
UA_Variant_setScalar(&c1Attr.value, &c1, &UA_TYPES[UA_TYPES_INT32]);

UA_NodeId currentNodeId = UA_NODEID_STRING(1, const_cast<char*>("current c1 value callback"));
UA_QualifiedName currentName = UA_QUALIFIEDNAME(1, const_cast<char*>("current c1 value callback"));
UA_NodeId parentReferenceNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES);
UA_NodeId variableTypeNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE);

UA_Server_addVariableNode(server, currentNodeId, Library_versionId,
	parentReferenceNodeId,
	currentName,
	variableTypeNodeId, c1Attr, NULL, NULL);
rangoy added a commit to rangoy/opcua-client-gui that referenced this issue Mar 15, 2023
I tried to add a variable to a graph, and it did not work as due to the filter of acceptedDatatypes in graphwidget.py

I got this message in the log;
```
uaclient.graphwidget - INFO - Variable cannot be added to graph because it is of type Int16 or an array')
```

I added the number types avaliable in Prosys Simulation server. I do not know if there might be other types too.

I think this will solve issue FreeOpcUa#85
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