Labels in Cicode

In the CitectSCADA help, it states that labels can be used in cicode etc.

What I am trying to do is use partial subsitution to get the values of labels eg

i have a few labels defined:  _C_V01_PressureConstant, _C_V02_PressureConstant etc

i need to perform a partial substitution of the label in cicode where i need to specify the equip name using a string value...

FUNCTION ExampleFunc(string sEquip)

int value = "_C" + sEquip + "_PressureConstant"

//the value returned in 0  but the label has been set a value of 900

END

Parents
  • In this case you try to assign a string to an integer, which will result into a Hardware Alarm. There are several options:
    - V2016 : Define an extra item (PressureConstant) for your equipment type as Calculated Variable and add a parameter and use this in the Address field
    - V2018 : Put all the constants in a Map using some Cicode, use Equipment as the key name

    You probably want to use these constants somewhere, so in this it becomes easier to reference them.
Reply
  • In this case you try to assign a string to an integer, which will result into a Hardware Alarm. There are several options:
    - V2016 : Define an extra item (PressureConstant) for your equipment type as Calculated Variable and add a parameter and use this in the Address field
    - V2018 : Put all the constants in a Map using some Cicode, use Equipment as the key name

    You probably want to use these constants somewhere, so in this it becomes easier to reference them.
Children
No Data