com-pas/compas-sct

[RSR-633] - Automated Binding - Edit InRef

Closed this issue · 0 comments

US Purpose:

The US purpose is to populate for a given LDevice@inst/LN0 and for each DOI@name="InRefXXX"/DAI@name="purpose"/Val, if at least one /Inputs/ExtRef.desc matches:

  • DOI@name="InRef"/DAI@name="setSrcRef"/Val
  • DOI@name="InRef"/DAI@name="setSrcCB"/Val
  • DOI@name="InRef"/DAI@name="setTstRef"/Val
  • DOI@name="InRef"/DAI@name="setTstCB"/Val

 

Prerequisites:

All ExtRef are already bound:

 

Input:

  • SCD file where all ExtRef are already bound

 

Description:

The goal is to associate DOI@name="InRefXXX" with:

  • one ExtRef nominally used
  • AND eventually one ExtRef used for tests

The ExtRef that can be associated to a DOI@name="InRefXXX":

  • are in the same LDevice.inst/LN0 than the DOI@name="InRefXXX"
  • AND have their ExtRef@desc which contain the string defined in DOI@name="InRefXXX"/DAI@name="purpose"/Val
  • AND have their ExtRef@iedName AND ExtRef@ldInst populated

Thus, each DOI@name="InRefXXX" can have as possible binding ExtRef:

  • 0 ExtRef
  • 1 ExtRef where ExtRef@desc is suffixed by "_1"
  • 2 to n ExtRef where ExtRef@desc are suffixed by "_1" and by "_n" with n > 1

 

The first ExtRef is the nominal case, it is the one which has the suffix "_1".

The last ExtRef is for the cases of tests, it is the one which has the greater suffix ie "_n".

 

The first ExtRef of the nominal case is used to populate:

  • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val with ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
  • AND DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val with ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName only if ExtRef owns source CB. In this case, if ExtRef@srcLNClass is omit then take "LLN0".
  • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it

The last ExtRef of the test case is used to populate:

  • DOI@name="InRefXXX"/DAI@name="setTstRef"/Val with ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
  • AND DOI@name="InRefXXX"/DAI@name="setTstCB"/Val with ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName only if ExtRef owns source CB. In this case, if ExtRef@srcLNClass is omit then take "LLN0".
  • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it

 

Details:

  • For each LDevice.inst/LN0 of the SCD file
    • For each DOI@name="InRefXXX"/DAI@name="purpose"/Val :
      • Find into the current LDevice.inst/LN0, all Inputs/ExtRef@desc which contain the DAI@name="purpose"/Val in their string
      • Keep only ExtRef which have their ExtRef@iedName AND ExtRef@ldInst populated
        • Case 1 : No ExtRef@desc matches, then do nothing. An informative message is returned INFO.01 then process the next DOI@name="InRefXXX"
        • Case 2 : Only one ExtRef@desc matches, then
          • Check that the ExtRef@desc is suffixed by "_1" else an informative message is returned INFO.01 and the next DOI@name="InRefXXX" is processed
          • Create and populate attributes:
            • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
            • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
            • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
        • Case 3 : Two or more ExtRef@desc match, then
          • Among these matching ExtRef@desc, check that the ExtRef@desc smallest suffix is "_1": it is the first ExtRef, the nominal case else an informative message is returned INFO.01 and the next DOI@name="InRefXXX" is processed.
          • Among these matching ExtRef@desc, check that the ExtRef@desc greatest suffix is strictly different from the smallest suffix "_1" else there is no ExtRef for test then an informative message is returned INFO.01 and the next DOI@name="InRefXXX" is processed
          • With the first ExtRef@desc i.e the one which is suffixed by "_1", the smallest suffix, create and populate attributes:
            • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
            • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
            • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
          • With the ExtRef@desc which has the greatest suffix different from the smallest, create and populate attributes:
            • DOI@name="InRefXXX"/DAI@name="setTstRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
            • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setTstCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
            • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
        • If we are not into one of the previous cases, then return an info message INFO.01 then process the next DOI@name="InRefXXX"

 

Output:

In SCD file, each LDevice@inst/LN0/DOI@name="InRefXXX", when it exists some LDevice@inst/LN0/Inputs/ExtRef which match with the DOI@name="InRefXXX"/DAI@name="purpose"/Val, is bound by using the following attributes populated:

  • with the ExtRef@desc which has the smallest suffix i.e "_1" for:
    • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
    • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
    • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
  • with the ExtRef@desc which has the greatest suffix strictly different from the smallest i.e "_1" for:
    • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
    • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. When ExtRef@srcLNClass is omit then take "LLN0".
    • Note: If an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
  • An info message is returned when a DOI@name="InRefXXX" can't be bound with an ExtRef, all DOI@name="InRefXXX" of the SCD file must be processed

 

Error/Info messages:

INFO.01: "The DOI IED=IED@name/LD=LDevice@inst/LN="LLN0"/DOI@name="InRefXXX" can't be bound with an ExtRef"

 

Acceptance criteria:

  • Check that in SCD file, each LDevice@inst/LN0/DOI@name="InRefXXX", when it exists some LDevice@inst/LN0/Inputs/ExtRef@desc which contains the DOI@name="InRefXXX"/DAI@name="purpose"/Val, is bound by using the following attributes populated:
    • with the ExtRef@desc which has the smallest suffix i.e "_1" such as:
      • DOI@name="InRefXXX"/DAI@name="setSrcRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
      • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setSrcCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
      • Check that if an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
    • with the ExtRef@desc which has the greatest suffix absolutely different from the smallest i.e "_1" such as:
      • DOI@name="InRefXXX"/DAI@name="setTstRef"/Val = ExtRef@iedNameExtRef@ldInst/ExtRef@prefixExtRef@lnClassExtRef@lnInst[.]ExtRef@doName
      • if ExtRef@srcCBName exists and is populated then DOI@name="InRefXXX"/DAI@name="setTstCB"/Val = ExtRef@iedNameExtRef@srcLDInst/ExtRef@srcPrefixExtRef@srcLNClassExtRef@srcLNInst[.]ExtRef@srcCBName. In this case, if ExtRef@srcLNClass is omit then take "LLN0"
      • Check that if an optional attribute is missing (srcPrefix or srcLnInst), fill the DAI/Val without it
    • Check that an info message is returned when a DOI@name="InRefXXX" can't be bound with an ExtRef"
    • Check that all DOI@name="InRefXXX" of the SCD file are processed