KB-30969: Alarm fires after the device has been working for some time.

Question:

How can I make an alarm be fired only after the device has been on for a certain time?

Solution:

One way to do so is via an XObject, as described below:

  1. Create an XObject.
  2. Insert a Boolean property to indicate its status (on/off), another one to indicate how long it has been on, and a third property to indicate the name of the device.
  3. Create a counter tag inside the XObject.
  4. Link the counter tag’s Enabled property to the XObject’s On property.
  5. Create a digital alarm inside the XObject. At Source field, write the expression ChronoTag > TimeOn.
  6. Link the digital alarm’s Name property to the XObject’s DeviceName property.

Attached to this article is a sample application demonstrating the procedure seen above.

NOTE: This can also be achieved by following the procedure described at the related article listed below. However, there is a difference: when following the steps described in this article, if the device turns off before the alarm fires, the time counter will start from where it stopped when the device is on again. When following the related article, on the other hand, the time counter will always be reset if the alarm has not been fired yet and the tag has left the alarm condition.

Attachments:

Sample.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *