Client Scope Data points
- zscriven
- Posts:21
- Joined: Tue Jul 05, 2016 11:03 pm
Client Scope Data points
Is there a way to create data points that can have a unique value for each client?
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Client Scope Data points
You can set a DPE to a value generated by the CTRL function createUuid()
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: Client Scope Data points
You can make a UI specific DP like this,
then fill it with the UI specific information that you want:
for (int i = 1; i < 10; i++)
{
string dp_name = "InfoUI_" + i);
dpCreate(dpCommon, "ExampleDP_Int");
dpSet(dp_name +".", add whatever info you want here);
}
It doesn't have to be of the type ExampleDP_Int, you can use whatever type you need.
Each UI can then get that information like this, for example:
int info;
dpGet( "InfoUI_" + myManNum() + ".", info);
Or you could create a dynamic datapoint whose contents is mapped to the UI with correspondig index, something like this;
I assume here that you have created a dyn int type named UI_INFO for the UI specific info that you want to store.
dpCreate("UI_Info, "UI_INFO");
dyn_int infos = makeDynInt(100,200,300,400);
dpSet("UI_Info.", infos)
Each UI can then get that information like this, for example:
dyn_int infos;
dpGet( "UI_Info.", infos);
int my_info = infos[myManNum()];
WinCC OA actually uses this technique for managing the UIs as you can see by looking at the internal datapoints of the type "_Ui"
There you can see which user is (or was last) logged in on each UI and on which display the UI is (was) running, for example.
Hope that helps you.
then fill it with the UI specific information that you want:
for (int i = 1; i < 10; i++)
{
string dp_name = "InfoUI_" + i);
dpCreate(dpCommon, "ExampleDP_Int");
dpSet(dp_name +".", add whatever info you want here);
}
It doesn't have to be of the type ExampleDP_Int, you can use whatever type you need.
Each UI can then get that information like this, for example:
int info;
dpGet( "InfoUI_" + myManNum() + ".", info);
Or you could create a dynamic datapoint whose contents is mapped to the UI with correspondig index, something like this;
I assume here that you have created a dyn int type named UI_INFO for the UI specific info that you want to store.
dpCreate("UI_Info, "UI_INFO");
dyn_int infos = makeDynInt(100,200,300,400);
dpSet("UI_Info.", infos)
Each UI can then get that information like this, for example:
dyn_int infos;
dpGet( "UI_Info.", infos);
int my_info = infos[myManNum()];
WinCC OA actually uses this technique for managing the UIs as you can see by looking at the internal datapoints of the type "_Ui"
There you can see which user is (or was last) logged in on each UI and on which display the UI is (was) running, for example.
Hope that helps you.
- zscriven
- Posts:21
- Joined: Tue Jul 05, 2016 11:03 pm
Re: Client Scope Data points
Thanks for the great detailed explanation.