Jump to content

runningdelta(), but for string signals


Go to solution Solved by Joe Reckamp,

Recommended Posts

We have string-type signals that show the current operating mode. On the historian, these signals have a compression setting of 8 hours, meaning a new value is written no later than 8 hours after the previous value was written. So during any 12 hour period, there will be 1 or 2 values written to the historian even if nothing has changed.

We are trying to count the number of changes to the string signal during a 12 hour period. For numeric signals, we can use 

$signal.remove($signal.runningdelta() == 0)
.aggregate(count(), $capsule, durationkey())

This makes sure that if the numeric signal (also with a compression setting of 8 hrs max) does not actually change during the 12 hour period, that data point will not count.

Is there an equivalent way for doing this with string signals? 

Thanks, David

Link to comment
Share on other sites

  • Seeq Team
  • Solution

Hi David,

You could either:

(1) subtract 1 from the count as it will always have the starting value as a capsule, meaning the value will always be number of changes + 1

or 

(2) use $signal.tocondition().starts(), which will make the capsule only appear at the start (or specifically the time when a change is made)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...