Read online if a DST is assigned to a DC/IO_IN_x

Hi Forum,

I would like to create a function to automatic set the DC/STATE_MASKS.STATEINx fields of a dedicated input / output.

If that dedicated IO_IN_x input is not configured then the function shall set the STATE_MASKS input to ignore after a download.

Reference-parameter can check via the PARAMETER.$REF as string if there is any reference, #IGNORE or empty.

I don't know how to check this IO_IN_x / IO_OUT_x Parameters online within an action in that CM.

Thank You and Best Regards,

Michael

  • The .REF for IO_IN_x / IO_OUT_x (or any IO function block parameter) are not runtime parameters and can't be accessed with logic.

    Unfortunately,
    You will have to manually configure your state masks based on the IO that is configured OR
    You could probably do something in Bulk Edit to export, create some formulas to massage the data and reimport back into the system for existing system (do before you create module using Bulk Edit Excel Formulas for state mask or create Templates with different numbers of IO and state mask already set) OR
    You could create multiple module classes with the different state masks set and relink instances to the appropriate class (I very much dislike this option because if you ever have to make a change...you have to do it multiple times and I prefer the multiple Module Templates linked to a class with different state masks already defined)
  • In reply to Matt Stoner:

    Hi Matt,
    thanks for clarification. Then I have to go the stony way and configure the STATE_MASKS manually in the instances.
    I hoped to find a way to avoid this. :-(
    Will add a comment in the CM how to configure the STATE_MASK for different IO-Condition for a valve.
    NC/NO valves shall be the same class module in my library and change only the STATE_MASKS.
    That way the close button will be always the upper button in a faceplate. Easier for operator.
    I think, what you mention to keep the library small shall be a good engineering practice.
    I remember a project with PBL where there were more than 10 AI class-modules and about 20 PID.
    Best Regards, Michael
  • In reply to Michael Krispin:

    No problem, Manually vs using Bulk Edit?

    I would be using bulk edit so I will show the format for DC and EDC blocks below for the community as least (Note: EDC can go up to 6 states (0-5) so you would just have more columns if needed for those states)

    The order for INs and OUTs is 1234 so in the example there is 2 input and 1 output. The X means don't care for that input/output.

    The leading < and ending > in the example mean that this module is tied to a class and it is still linked to the class. If you want to break from the class and be unique then remove the < and > to do so.