I am trying to log data every 10 seconds, but with a condition: the value should not fall within the deadband range. For example, if the current tag value is 5.0 and the deadband is set to 2, I want the next value (after 10 seconds) to be logged only if it is 7 or above or 3 or below. In other words, changes within ±2 should not be logged.
I’ve tried configuring this using the tag history settings, but I haven’t been able to achieve the desired behavior. Could someone please suggest the correct procedure to implement this?
Using the following settings should result in what I think you're trying to achieve:
Deadband Style: Discrete
Deadband Mode: Absolute
Historical Deadband: 2.0
Sample Mode Periodic
Max Time Between Samples: 0
Sample Rate: 10
Sample Rate Units: Seconds
With these settings, every 10 seconds the system will evaluate the difference of the current value with the last recorded value, if the absolute value of that difference is greater than 2, the value will be stored.
Max Time Between Samples is set to 0, so that there is no recording based on time change.
Note that if value 1 is 5.0 and after 10 seconds the value changes to 8, that value will be recorded, if after 10 seconds the value is 8.0 ± 2.0 that value will be recorded. Resulting in the last three values being 5.0, 8.0, and 6.0. If instead what you are trying to achieve is a deadband around a setpoint value, that will require a different setup.
That is, not in Ignition's historian. That would be condition-based storage, not a deadband. Ignition's historian does not do condition-based storage at all.
No, the OP seems to want to compare to a fixed range. A tag value change event that checks the range, then fires an S&F Prep Update would be my preferred approach.
Hmm, I interpreted it as being +/- the deadband for the last stored value.
I certainly wouldn't be doing this in a tag change event, in case someone reads this and interprets it that way. Much faster to read a tag's value than a value via a SQL query though
I agree, which is why I added the last part of my response.
@devaraj.v Can you clarify if you are looking to store a value based on a deaband around some expected value, or just a deadband around the last recorded value.
I need to implement a deadband around the last recorded value to reduce the number of data logs to the database. For example, if the previously recorded value is 5.5 bar and the deadband is 0.5 bar, I will only log a new value (sampled every 10 seconds) if it is ≥ 6.0 bar or ≤ 5.0 bar.
If the change in value is less than the deadband, the value should not be logged, even though sampling continues every 10 seconds. This helps avoid unnecessary database entries when the change is insignificant.
Problem 1: For some tags it is working fine. For example (Figure:2), if my tag value is 556 and the deadband is 0.05, the value gets logged whenever it changes by more than ±0.05 . But for some other tags(for example refer Figure:1), even though I use the same settings, the value logs as null every 10 seconds, which should not happen. Ideally, whenever we change the value, it should follow the deadband. However, if we don’t change the value, it should not log anything at all—instead of logging null.
Problem 2: I changed my tag value to 556.06, but instead of showing the rounded value, it displays a long decimal like 556.059997558594. Is there any way to display the correct changed value?(Refer Figure 2)
Please do some research around how computers store decimals as floats. For example:
Ignition is behaving in the industry standard way when it stores float values. There are many ways of dealing with this behaviour. The critical thing is that Ignition is storing this value correctly.
The value isn't logging as null, it's logging as 0. That you are showing the current value to be 5 and a logged value of 0, makes me think there is something else going on, like this being a different tag, or not truely an integer value.
Also, please show the history configuration for this tag, so we can see if maybe you've missed something, in the setup.