-
Yes, to all.
-
The
initialChangeflag means the infrastructure has had a gap in attention (long or short) and doesn't know, for sure, what the previous value really is. For memory tags, it is initialized from the value storage, but might be out of date. You are not guaranteed that the first "real" value change hasinitialChangefalse. -
No. For other than memory tags,
previousValueis entirelynullon startup/tag restart. Memory tags try to start up from value storage, if possible. You really should not even touchpreviousValuewheninitialChangeis true. -
None of the above. When
initialChangeis true, you must determine from your own recordings, what the previous value was as far as your business logic is concerned. This may require time-consuming DB or historian or API calls that can be avoided wheninitialChangeis false. -
Yes, memory tags have a value storage system, that tries to capture all writes, but obviously cannot guarantee it. If your gateway shuts down or fails over to a redundant backup right after a memory tag write, it may be lost.
If you have business logic that absolutely has to note changes reliably, you need to use a high-availability DB as the source of truth.