SimpleTagProvider

Hello,

I am implementing a tag provider based on the SimpleTagProvider and I have 2 questions:

  • It seems that it is not possible to define multiple values for one Tag. I think I have seen some reference about that limitiation in the forum but I would appreciate if someone could confirm/comment. What about defining an UDT? Is there a way to achieve a similar effect other than defining multiple (separate) tags

  • in the SimpleTagProvider, I am using the API “updateQuality(TagPath path, Quality value)” where I set the value and the timestamp in the Quality argument. It seems to work when the value is changing but if only the timestamp is changing, the LastChange property of the Tag does not seem to be updated. Is it expected behavior? If yes, what would be the workaround to get the LastChange updated properly?

I am running 7.6.1.

Cheers

Nicolas

Hello again,

I am still interested by an answer to these questions, specially the second one (tag LastChange property not updated if the tag value does not change) one, which to me appears as a bug. Am I not providing enough information?

Cheers

Nicolas

Hi,

I’m not sure what you mean by “multiple values”. By definition a tag only has one value, the “current value”. Theoretically tags also have properties, and one day (not currently, though) will have custom properties, which I suppose could be used that way. What are you trying to achieve?

As for the “latest change”, it simply doesn’t get updated unless the value actually changes. That means the actual value (in accordance with the deadband) or the quality. So, it won’t update the timestamp each time that you call “setValue”, if you keep passing the same value each time.

That’s just the way it’s defined, as being the last time that the value changed, not just the last time it was updated. Other parts of the system, like the OPC server, don’t even send values across unless they’ve actually changed. However, various users of the SimpleTagProvider have noticed this, so I suppose it would be easy enough to add a method or flag that forced the new value’s timestamp to be used.

Regards,

Hello,

And thank you very much for the answer.

This is exactly what I need as for the moment I need to define several tags for related information (for example I would like to have an "ID" property or make available some configuration information about this tag)... So yes, adding custom property is exactly what I would need. Sorry about not being very clear with my "multiple values" description.

For the LastChange not being updated if the value does not change, maybe we could have that flag as you say or maybe you can add a property LastUpdated that will get updated regardless of the value. I think it would be useful to know both of them. I did not check how these properties were used when storing historical data, but I would think both properties would be useful there also.

Cheers

Nicolas