• Not Answered

Deadband

Hi,

 I have a lot of programming experience  but I am fairly new to deltav.  I have a CND (Condition Block) which is going to set the output of the block when a variable (pressure) passes a certain limit.  I want to make sure the output of the CND block goes low only if the value of that variable goes for example 50 less than the limit. 

Variable > 100 then CND block output =1

Varable < 50 then CND block output =0

I can also use Calc block and Upper and Lower parameters.  I just don't want to Overkill it.

Thanks

11 Replies

  • Hi
    You can test that :

    (* If OUT not active test max pressure over 100 *)
    ('OUT_D.CV'=False And '^/PRESSURE.CV' > 100)
    Or
    (* Else, keep OUT active till pressure over 50 *)
    ('OUT_D.CV'=True And '^/PRESSURE.CV' > 50)
  • In reply to Jack_France:

    Thank you very much. This makes sense. I did not know in DeltaV I could use the block's own output in the expressions. Thanks again.
  • In reply to Jack_France:

    The CND block does not support If statements.

    Try:
    (PV > 100) OR ('^/out_d.cv' AND (PV <50))

    Once the out_d is set, it latches until PV falls below 50.

    You can use parameters to make the limit and hysteresis tunable.

    Andre Dicaire

  • In reply to Andre Dicaire:

    Thank you . Just checking this one with you. Shouldn't it be like "(PV > 100) OR ('^/out_d.cv' AND (PV >50). this way when it goes below 50 from 100, the output will turned off.
  • There are usually several ways to do anything in DeltaV, but as a general rule, you should not use a CALC or CND block to do something that is already a standard component of another block. (Also, the CALC block by far requires the most processor resources, so never use a CALC block to do something that can be done with a CND block, and never use more than one CALC block in a module.)

    Assuming that the pressure value is coming from an Analog Input (AI) block, what you are asking is already done by the High Limit (HI_LIM), Alarm Hysteresis (ALARM_HYS), and High Active (HI_ACT) parameters. See below for the definition from Books Online:

    HI_LIM (units= EU of IN_SCALE): The setting for the alarm limit used to detect the high alarm condition. If SCALE_ENABLE is not set, the raw value will not be scaled.

    ALARM_HYS (units= Percent or Percent of IN_SCALE): The amount the alarm value must return within the alarm limit before the associated active alarm condition clears. If SCALE_ENABLE is not set, the raw value will not be scaled. ALARM_HYS is limited to 50% of scale.

    HI_ACT (Boolean): The result of alarm detection associated with HI_LIM. If HI_ACT equals True, HI_LIM has been exceeded.


    If your pressure value is an input parameter instead of an AI block, you can connect it to the input of an Alarm Detection (ALM) block, which has equivalent parameters to the AI block.

    Using the AI or ALM block will also make all of your configurable values accessible from the standard module detail display graphic.
  • In reply to Bill Tinley:

    Thank you. You are correct. I actually came across this subject in books online. I just thought it might not be the right way to do what I wanted to. That of course is because of my lack of knowledge and experience with Deltav.

    Regards,

    learner
  • In reply to learner:

    Yes, it works. CND blocks accept to use it's own OUT as param (I have tested it before I suggested it)
  • In reply to learner:

    Correct.  PP > 50.Sorry for the error.

    I agree with Bill that if a block provides the function,  best to use it rather than use custom written expressions.

    As for CALC blocks in general,  my rule is to avoid large complex expressions.  One function per CALC block.  This makes it easier to troubleshoot and maintain.  

    Andre Dicaire

  • In reply to Andre Dicaire:

    Yes, "never" was probably an overstatement...

    But, I've seen enough bad DeltaV code to always stress this to people who are new to DeltaV. Otherwise, you end up with things like 3 CALC blocks with 10 lines of code each in a class module with 200 instances, wondering why you are having issues with controller loading.
  • In reply to Bill Tinley:

    I appreciate your feedback. Thank you.