In this thread:
https://portal.etm.at/index.php?option= ... 16&id=4963
I had asked how to acccess a CNS identifier using dpGet() and got the tip that I need to add : at the end of the ID
My next step now is to add this (and other) CNS identifier to a DP group (specifically the OPCUAWrite and OPCUARead groups) using the Dp-group administration panel,
but I just can't add a CNS identifiers to the DP group.
I had a look at the code behind the +DP button of vision\\groups\\dpGroupsEdit.pnl
and found this code there:
dpSelector(dpe,false,"ALL_SYSTEM_NAME_SYS",true);
dpe = dpSubStr(dpe,DPSUB_DP_EL);
The dpSelector function call allows selecting CNS identifiers from the plant mode by default,
but when I select such a value the dpSubStr() function makes an empty string out of dpe
because it apparently is not meant to be used with CNS identifiers.
I assume this is a bug in the code of the +dP button of the panel, right?
The +Alias button has a similar problem because it calls dpGetAlias() with the value returned from the dpSelector and that doesn't work for CNS identifiers either.
Having learned all that, it appears to me that DpGroups can't really handle CNS identifiers anyway, because they use the dpNames() function to resolve the filters, and it looks to me like dpNames() doesn't work with CNS identifiers, which is really too bad, because that would be very convenient.
Have I described the situation here properly or do I not understand something here yet?
PS: I am using WinCC OA V3.14, patch level 2.
Add CNS identifiers to DP groups
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: Add CNS identifiers to DP groups
Why do you want to add CNS identifiers to the OPCUA groups? Why not use a CNS view to assign DPEs to the OPC UA server?
The CNS equivalence of dpNames() is cnsGetIdSet().
The CNS equivalence of dpNames() is cnsGetIdSet().
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: Add CNS identifiers to DP groups
Why do you want to add CNS identifiers to the OPCUA groups?
. . because the only OPC UA Server example that I have is configured with a datapoint list in the group OPCUAWrite@%s@ and the dpSelector tab named Plantmodel that opens with the +DP button seemed to suggest that I could CNS elements there.
Why not use a CNS view to assign DPEs to the OPC UA server?
. . because I'm not sure what I am doing :unsure: . If you think that is the right way to do it, I will pursue that.
I found the OPC UA Server CNS section in the help and I hope I can understand what is being described there and I will try it out.
Thanks for your help
. . because the only OPC UA Server example that I have is configured with a datapoint list in the group OPCUAWrite@%s@ and the dpSelector tab named Plantmodel that opens with the +DP button seemed to suggest that I could CNS elements there.
Why not use a CNS view to assign DPEs to the OPC UA server?
. . because I'm not sure what I am doing :unsure: . If you think that is the right way to do it, I will pursue that.
I found the OPC UA Server CNS section in the help and I hope I can understand what is being described there and I will try it out.
Thanks for your help
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: Add CNS identifiers to DP groups
I finally found some time again to continue playing with the OPC server configuration and I think I've figured out how it works, so I will explain it here in case someone is interested (or feels the need to correct me)
To get the OPC UA Server running and be able to easily connect clients without having to configure any authorization or security environment, I added the following entries to my projects config file:
[opcuasrv]
enableAnonymous = 1
disableSecurity = 1
tcpServerPort = 9120
One way to map datapoint elements to OPC UA nodes is to add them to the existing DP-groups named OPCUARead@%s@ orOPCUAWrite@%s@ according to your requirements,
using the DP-group administration panel (accessible from the Database tab of the SystemManagement panel) then start the OPC UA server.
I was then able to see those nodes using the UA Expert tool which is a simple OPC UA client that can be downloaded from here: https://www.unified-automation.com/prod ... xpert.html
What did not work, was to make my own DP group and add it the OPCUARead@%s@ group. Doing that resulted in the following error message:
WCCOAopcuasrv(4), 2017.07.04 15:36:16.914, PARAM,SEVERE, 8/opcuasrv, OpcUaSManager in Function addItems2PI, Unexpected state: Group filter _DpGroup00018_Public in OPC UA Group ignored
A second way is to use the Plantmodel Editor to make a CNS view containing nodes connected to the datapoints that I want to map,
then put the name of that view into the datapoint _OPCUAPvssServer.Config.CNSView,
then start the OPC UA server.
Working with the Plantmodel Editor (in 3.14 P8 or 3.15 P0) was a bit tedious since the only ways I could find to get the Plantmodel structure view tree to update
after adding and/or renaming nodes, were to filter then unfilter the view, or restart the whole Plantmodel Editor panel
According to the help, it is only possible to add one view to the server, so everything has to be packed into there.
I also found that the entries in OPCUARead@%s@ orOPCUAWrite@%s@ (my first way) get ignored completely if the OPC UA server is configured to get the nodes from a view (my second way).
That means: both ways at the same time does not work.
To get the OPC UA Server running and be able to easily connect clients without having to configure any authorization or security environment, I added the following entries to my projects config file:
[opcuasrv]
enableAnonymous = 1
disableSecurity = 1
tcpServerPort = 9120
One way to map datapoint elements to OPC UA nodes is to add them to the existing DP-groups named OPCUARead@%s@ orOPCUAWrite@%s@ according to your requirements,
using the DP-group administration panel (accessible from the Database tab of the SystemManagement panel) then start the OPC UA server.
I was then able to see those nodes using the UA Expert tool which is a simple OPC UA client that can be downloaded from here: https://www.unified-automation.com/prod ... xpert.html
What did not work, was to make my own DP group and add it the OPCUARead@%s@ group. Doing that resulted in the following error message:
WCCOAopcuasrv(4), 2017.07.04 15:36:16.914, PARAM,SEVERE, 8/opcuasrv, OpcUaSManager in Function addItems2PI, Unexpected state: Group filter _DpGroup00018_Public in OPC UA Group ignored
A second way is to use the Plantmodel Editor to make a CNS view containing nodes connected to the datapoints that I want to map,
then put the name of that view into the datapoint _OPCUAPvssServer.Config.CNSView,
then start the OPC UA server.
Working with the Plantmodel Editor (in 3.14 P8 or 3.15 P0) was a bit tedious since the only ways I could find to get the Plantmodel structure view tree to update
after adding and/or renaming nodes, were to filter then unfilter the view, or restart the whole Plantmodel Editor panel
According to the help, it is only possible to add one view to the server, so everything has to be packed into there.
I also found that the entries in OPCUARead@%s@ orOPCUAWrite@%s@ (my first way) get ignored completely if the OPC UA server is configured to get the nodes from a view (my second way).
That means: both ways at the same time does not work.