Putting queue value of monitored item in memory

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

Moderator: uasdkc

Post Reply
dingy
Sr. Member
Sr. Member
Posts: 14
Joined: 28 May 2013, 03:15

Putting queue value of monitored item in memory

Post by dingy »

Hello, support team:

I'm developing an application on ARM based platform in which the Flash memory is used as storage device.

As the flash memory has some limitations on writing times and access speed, so it is not recommended to access it frequently.

After a study inside the source code, I find that the queued value of the monitored items are stored in the SQL Lite or the file system(DataLog module). In this case, I switched off the DataLog module to avoid frequent writing on the flash.

Switching off the DataLog module means the stop of queuing value of monitored item, but I still need that the subscription inside UA Server can buffer changed data for a short period. So, I wonder if it is possible to buffer the queue values into the memory instead of a storage device?

PS: In my application, we can pre-alloc hundreds of KBs to queue the data of monitor item.

Thanks

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

Re: Putting queue value of monitored item in memory

Post by Support Team »

Hi Dingy,

the SQLite storage and the file based storage are "examples" for implementing different strategies for persisting larger amounts of historic data in order to demonstrate the historic access functionality in the server. Typically you would use the storage system you already have on the device or you use whatever is best suitable for your hardware.

The queueing of MonitoredItems is something different than history. Typically the MonitoredItem queue is "in memory", and by this somewhat "expensive" on embedded devices where you most likely have only limited RAM available. The intended use for MonitoredItem queue is short interruption of network, or high speed sampling. Such "in memory" ItemQueue can be simply enabled in the SDK at the MonitoredItem settings.

However, if you want to persist the data you would probably go for the Flash memory, which is a little slower, but still suitable for historic access. The write cycles on flash or on SD card are typically no problem today, assuming you not opt for the cheapest, modern SD cards have different strategies to reach similar write cycles like standard HDD.

Best Regards
Support Team

dingy
Sr. Member
Sr. Member
Posts: 14
Joined: 28 May 2013, 03:15

Re: Putting queue value of monitored item in memory

Post by dingy »

Hello,

After your feedback, I re-checked my program which tests the data recovery of subscription in case of network interruption. And I found that there is some mistake on my subscription parameter.

In fact, the PublishingInterval, lifetimeCount and MaxKeepAliveCount that I'm setting is too small, this makes the effective lifetime of subscription is less than 2 seconds. So, when the connection between my Java UA client and ansi c UA server is re-etablished, the ancient subscription is already expired.

Because the Java UA client re-create a new subscription and the monitored items automatically when the previous one is expired, it give me a wrong impression that the subscription was recovered without the queued values. And that is why I supposed that the Data Log option has something to do with the queued value(because I saw some code related to DataLogger in UaServer_Monitor.c).

After correcting my test program today, it runs fine. Thanks a lot.

Post Reply