How to handle variable numbers of BaseDataVariable?

Questions regarding the use of the High Perfomance SDK for Server development

Moderator: uasdkhpc

Post Reply
AnnieFYWu
Full Member
Full Member
Posts: 5
Joined: 18 May 2018, 09:54

How to handle variable numbers of BaseDataVariable?

Post by AnnieFYWu »

Hi,

I have to add variable numbers of variable in the custom provider. How to handle the values?
Because I don't know the total numbers of variable in advance, I can't use the ua_memorystore.
Does the ua_valuestore use in this situation?
If I use ua_valuestore, do I need to assign my own function to ctx->read or ctx->write to handle the read/write request?
Thanks.

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

Re: How to handle variable numbers of BaseDataVariable?

Post by Support Team »

all of this is possible:

1) memory store: initialize it with the maximum possible variable count
2) Write your one valuestore, which can dynamically reallocate the internal memory.
In embedded systems people usually want to avoid this.
3) Handle read/write/subscription yourself in the provider
Best regards
Unified Automation Support Team

Post Reply