Change the Engineering Unit of a SCALE parameter via CALC block or Function Block

Hi,

In DeltaV I'm trying to change the Engineering Units of the OUT_SCALE parameter of an instance of the C_AI_SOFT130 composite via CALC block.

In the CALC block I've tried the following lines but none of them seems to work:

'^/AI1/OUT_SCALE.UNITS' := 1607;

or 

'^/AI1/OUT_SCALE.UNITS' := "cm";

Do you know if this is at all possible?

Thank you for your help

  • You have to use the number for sure, I know that with traditional AI block you have to take it OOS first before writing but with this "soft" composite should allow you to do it anytime. Where are you trying to write the value from?
  • In reply to Matt Stoner:

    Hi Matt,
    thank you for your help.
    The example I made in my first post was a simplified version of the problem I'm having; Here the real case:

    This logic is part of a landing module used to monitor/control a weighing system connected to DeltaV via Profinet IO.

    The weighing system has its own operator interface where the Operator can select which EU is to be used by the system;
    One of the signal received from the weighing system is a simple enumeration for the EU used by the Weighing System ( 0="kg", 1="l", 2="g").

    The Weighing system sends two Profinet signals to DeltaV:
    1. The Weight
    2. A simple enumeration for the EU used by the Weighing System ( 0="kg", 1="l", 2="g").

    In DeltaV we are using an C_AI_SOFT130 block to monitor the weight.
    As the EU can be modified at any time by the operator via the Operator Interface of the Weighing System, we need a way to modify the EU in the AI block used to display the weight.
    (I hope I have been clear enough, please ask if you need further details)

    I'm trying to use a CALC block to compare the value received by the weighing system for the EU (0, 1 o 2) to set the '^/AI1/OUT_SCALE.UNITS' parameter in the C_AI_SOFT130 block used to display the PV.

    I tried the following code:

    IF '^/PARM_VAL_IN.CV' = 0 THEN '^/AI1/OUT_SCALE.UNITS' := "kg"; END_IF;
    IF '^/PARM_VAL_IN.CV' = 1 THEN '^/AI1/OUT_SCALE.UNITS' := "lb"; END_IF;
    IF '^/PARM_VAL_IN.CV' = 2 THEN '^/AI1/OUT_SCALE.UNITS' := "g"; END_IF;

    and the following code:

    IF '^/PARM_VAL_IN.CV' = 0 THEN '^/AI1/OUT_SCALE.UNITS' := 1088; END_IF;
    IF '^/PARM_VAL_IN.CV' = 1 THEN '^/AI1/OUT_SCALE.UNITS' := 32916; END_IF;
    IF '^/PARM_VAL_IN.CV' = 2 THEN '^/AI1/OUT_SCALE.UNITS' := 1089; END_IF;

    (where '^/PARM_VAL_IN.CV' reads the Profinet IO input signals for the EU and the values 1088, 32916 and 1089 are from the reg EUDT in D:\DeltaV\DVData\download).

    Unfortunately both codes don't seem to work: the CALC block displays the yellow question mark and the parameter '^/AI1/OUT_SCALE.UNITS' doesn't get updated.

    I've also tried to use the same logic to update an internal write parameter of type SCALE but it also didn't work.

    Any ideas? Thank you
  • In reply to Davide:

    Ok I have tested SOFT and regular AI function block and it doesn't seem to work in either case. I'm pretty sure there was configuration that was done in the past that worked fine doing this (v10 or v11 is when I think it was done). Interestingly you can use watchit to change the value so it seems to be an issue at runtime. I think you should log a call with the GSC on this issue.
  • In reply to Matt Stoner:

    Hi Matt,
    thanks again for your help.
    My colleague Neil was able to find a solution to this problem and I want to share it with the community hoping it might be helpful to others;

    It seems that for some reason the statement '^/AI1/OUT_SCALE.UNITS' := 1088; doesn't work;

    What worked was:
    1. In the CM, add an internal parameter of type Floating Point (in our case called KG_ENG_UNIT), and with a value of 1088
    2. In the CALC block re-write the statement as '^/AI1/OUT_SCALE.UNITS' := '^/KG_ENG_UNIT.CV';

    With this new statement we were able to modify the EU of the parameter '^/AI1/OUT_SCALE.UNITS' without having to take the CM OOS.

    (Maybe with the statement '^/AI1/OUT_SCALE.UNITS' := 1088 the CALC block was passing the value as a 32-bit Integer whereas the statement := '^/KG_ENG_UNIT.CV' forces it to pass it as a Floating point? Not sure about it)
  • In reply to Davide:

    You only need the OOS for the AI function block, the soft AI composite wouldn't require this. I think I tried "1088" as well and it didn't work but something seems to be incorrect and would still need a call. I didn't notice that your value for 'lb' was incorrect and should be 1094 as 32916 is 'l'.
  • In reply to Matt Stoner:

    Hi Matt,
    yes, using '^/AI1/OUT_SCALE.UNITS' := 1088 in the CALC block doesn't work. What worked was to use '^/AI1/OUT_SCALE.UNITS' := '^/KG_ENG_UNIT.CV'; (where KG_ENG_UNIT is a floating point internal parameter set to 1088).

    Thanks for noticing the error with "l" and "lb".