Historizing of Data Variables

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
harlix
Full Member
Full Member
Posts: 5
Joined: 27 Feb 2013, 22:23

Historizing of Data Variables

Post by harlix »

Hello,

I'm just working on the Linux Ansi-C-SDK and trying to implement some data values with historizing capabilities using your file-based data logger.

To understand the architecture of the SDK and how to implement all what's necessary, I started creating some simple data variables which are organized by some folder objects.
I did not create a model of some real-world-process or machine like in the example server lessons shipped with the SDK and I'm not using any security.

This all works fine.

Now, I'm trying to add historizing capabilities to one of the data variables, like it's done in example lesson07. I can create a data logger, start it and connect any varaiable to it. All this exit with status GOOD. A folder "historian" is created, containing a "taginfo.txt" file.
But when I connect to the server via UAExpert and try to add the historized variable to a trend view as mentioned at http://doc.unifiedautomation.com/uasdkc ... rted7.html , I always get the error "Added Item does not support Historizing" and "Get stepped property of node XX failed with status code BadNoMatch".

I also tried to set the historizing flag using OpcUa_Variable_SetHistorizing() method. The Variable has the right AccessLevels (History_Read). No success!

Also when I compile the original example lesson 7 demo server coming with the SDK, UAExpert behaves similar when I connect to it.

Do you have any ideas what's wrong here? I thought perhaps it's an issue because of the mandatory HasHistoricalConfiguration Reference and any according configuration object. I never created something like that because I never came along these items within the example lesson 7 source code. Perhaps I'm wrong?

Thanks for your help,
Felix

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Historizing of Data Variables

Post by Support Team »

Hello,

the cause for UaExpert not reading the history of the variable seems to be the missing UserAccessLevel 'OpcUa_AccessLevels_HistoryRead'. UaExpert reads the UserAccessLevel attribute of a node and only allows to add it if HistoryRead access is allowed.

If you have UASERVER_SUPPORT_AUTHORIZATION enabled, inserting the line

Code: Select all

OpcUa_Variable_SetAccessLevel(pVariable, OpcUa_AccessLevels_CurrentRead | OpcUa_AccessLevels_HistoryRead);
after creating the variable should fix the problem. Please ensure that the variable has the access level 'UA_READABLE' set in it's UserMgt permissions (UaServer_UserMgt_SetPermissions).

If UASERVER_SUPPORT_AUTHORIZATION is disabled, you additionally have to add

Code: Select all

OpcUa_Variable_SetUserAccessLevel(pVariable, OpcUa_AccessLevels_CurrentRead | OpcUa_AccessLevels_HistoryRead);
as in this case the UserAccessLevel cannot be determined using the authorization module.

The Historizing flag only indicates that a variable is currently writing history data, it is not related to being able to read the history data (as indicated by OpcUa_AccessLevels_HistoryRead).

Best regards,
Unified Automation Support Team

harlix
Full Member
Full Member
Posts: 5
Joined: 27 Feb 2013, 22:23

Re: Historizing of Data Variables

Post by harlix »

Hello,

Thanks a lot for your help! Adding the historized variable to a trend view works now after setting the correct user access level. UASERVER_SUPPORT_AUTHORIZATION is disabled.

Now, there is another issue. UAExpert says: "The type of the history values of node XXX can not be displayed". That's strange, I can read the value in DA mode without problems. The data type is UInt32. I created the variable with "g_pProviderCBInterface->CreateDataVariable()" and it's HasTypeDefinition reference is set correctly to BaseDataVariableType. Do I have to create other references for variables which support historizing?

Best regards,
Felix

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Historizing of Data Variables

Post by Support Team »

Hello,

please ensure that you have the current version of UaExpert installed (1.2.2). In previous versions there was a bug leading to UaExpert not displaying history data.

Best regards,
Unified Automation Support Team

harlix
Full Member
Full Member
Posts: 5
Joined: 27 Feb 2013, 22:23

Re: Historizing of Data Variables

Post by harlix »

Hello,

I've just checked this. The UaExpert (Linux) version currently installed is 1.2.2 175, Build Timestamp: Aug 22 2012 14:04:09. I think that's the actual version.

Edit: I just tried the actual UaExpert version on a Windows machine - same issue.

Best regards,
Felix

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Historizing of Data Variables

Post by Support Team »

Hello,

in this case it seems that your server doesn't send any history data to UaExpert. Please ensure following:

- your provider handles AddItem / Subscribe correctly (the history data logger uses an internal subscription to get item values)
- monitored items are sampled correctly
- your HistoryReadRawModified implementation is correct

To see the history values being sent to UaExpert, you could use Wireshark or the OPC Foundation CTT in Analyzer mode.

Best regards,
Unified Automation Support Team

harlix
Full Member
Full Member
Posts: 5
Joined: 27 Feb 2013, 22:23

Re: Historizing of Data Variables

Post by harlix »

Hello,

I fixed the issue.

After reviewing all the necessary code, your hint
Support Team wrote: Please ensure following:

- your provider handles AddItem / Subscribe correctly (the history data logger uses an internal subscription to get item values)
finally pointed out the problem: I tried to set up the data logger whithin my createAddressSpace() routine BEFORE calling providerSubscriptionInitialize().
Hence, the data logger wasn't initialized correctly.

Now, historizing works like a charm.

Thanks for your helpful support!

Best regards,
Felix

Post Reply