KB-83657: Generating an event in the driver only when an element is changed.

Question:

A script in a block tag’s OnRead event isn’t being executed properly: there is only one element whose  EnableDriverEvent property is set as TRUE, this element is not changed, and yet the event still occurs. Why is it so?

Solution:

This happens because the EnableDriverEvent property is the responsible for generating the driver’s OnTagRead event, and not the tag’s OnRead event. Therefore, this property is useless in this case.

If the script had been created in the driver’s OnTagRead event, it would still be fired, because the event is not fired simply by an element’s change in value. Any change in any other block element causes the whole block’s timestamp to also change, which in turn causes the element whose EnableDriverEvent property is set up to TRUE to trigger the driver’s OnTagRead event.

To cause the script to be executed only when a specific element is changed, the solution is: Create a user-generated event in the block element containing an expression to monitor its value change.

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 *