State driven equipment module - detecting error after state change complete

I have a state driven equipment module to move a set of valves into various positions. When a new A_COMMAND is set, it generates an error (via the A_ERROR parameter) if any of the valves fail to move into the correct position within the time set for each state, which is expected. However, once a state change is complete (A_STATE is equal to Complete) if any valves change their readback state to one that is incorrect, no error is generated. In other words an error is only generated if a valve fails in the process of moving, but not subsequently. For example, instrument air failure causing a valve to close unexpectedly some time after opening.

Is there another module parameter that shows if any items readback is no longer equal to target? I can create custom logic to look for Targets not being equal to Readbacks, but I would have thought there was a built-in feature for this.

  • No there isn't anything to keep monitoring so you will need to add some logic (i.e. EMC/DRIVE/PARAM# != EMC/READBACK/PARAM# ORs) and I would suggest just updating the A_PV when the A_COMMAND is Undefined (255) and those DRIVE/READBACK params if any don't equal.

    The question is how "good" do you want this to be... If you do like the example suggested above you can just set the A_PV to Undefined if one of the device conditions are <> but depending on what your state EM is doing you may want to evaluate all the device states and put the A_PV to what the devices are setup as but this can very quickly become very complex and cause a lot of logic.
  • In reply to Matt Stoner:

    Thanks for confirming Matt. This is enough info for me to create a solution.