0

Calcs and Events - Latch value

I have a complex event trigger that I am having difficulty programming. I have a trigger that when the length has been reset (Previous length > current length - which we'll call A) and then the length is greater than 200 (where now the Previous length will not be > than current length). Is there a way to latch the first constraint to True when it becomes true (A)  in order to use an and A with the second constraint?

 

so something like 

A = if(PreviousValue('Length') or A, True, False) (But we can't use A where it is defined)

B = A and (Length > 200)

3 replies

null
    • smason
    • yesterday
    • Reported - view

    Hi ,

    I'm having difficulty understanding what you're trying to accomplish. Could you provide some more detail or context?

    • erice
    • yesterday
    • Reported - view

    Thanks Steve

    I'll try to be more specific. I have an event I would like to capture that requires:

    1) The length to be reset - PreviousValue('Length') > Length

    2) The Length needs to be greater than 200

    3) Then when (1) and (2) are true I want to be able to create an event if another tag goes out of a calculated range.

     

    (1) and (2) may not all be true at the same time, so I need the ability to hold a variable True when (1) happens, then (2) and (3) will always be True at the same time (if (3) happens at all). So my problem is being able to hold a value True even after PreviousValue('Length') > Length is no longer True.

     

    I hope that helps make it a little more clear.

      • smason
      • 16 hrs ago
      • Reported - view

      Thanks for the clarification. I think I understand now, but I don't know if we have a way to handle this. Does the resetting of the Length happen at a set interval or set time of day?

      If you had a Boolean tag that was set to True whenever the PreviousValue>CurrentValue, then used CountInStateNonZero when it exceeded 200, could you look back over a set amount of time to see if the Count = 1?

      Scratching my head on this one. 🤔

Content aside

print this pagePrint this page
  • 16 hrs agoLast active
  • 3Replies
  • 12Views
  • 2 Following