Repository navigation
tIED: removeIeds behaviours with LNodes #121
Description
Currently I find that the behaviour of removeIED for LNodes is to replace the IED name with None when the IED is removed.
This behaviour is problematic for me when removing a number of IEDs in the Remove IEDs plugin in Transpower's distribution.
It leaves a large number of dangling LNode elements.
For various reasons we often map an LPHD node for each IED against a busbar bay.
After removing several IEDs this section looks like this:
<Function name="BusPhysConnection">
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="XAT_242_C1" ldInst="CFG" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" prefix="DevID" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" prefix="DevID" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" prefix="DevID" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" prefix="DevID" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="1"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
<LNode iedName="None" lnClass="LPHD" lnInst="0"/>
</Function>This however becomes a schema violation:
The reason for this is spelt out in Table 8 of IEC 61850 Ed 2.1 and the subsequent text:
For specifications where iedName=”None” everywhere, the combination of the other attributes
must be unique within the same level. This means e.g. that the prefix or lnInst should be
different if several LNs with identical lnClass are used within the same substation part (i.e.
same bay). This should also be the case for IED names, if application related naming (see
8.5.4) shall be used. This is NOT checked by the SCL schema, therefore it is the
responsibility of the project engineer or system tool, if application related naming shall be
used additionally to product (IED)-related naming.
What should the behaviour of the removeIED function be here?
In my view at the least we need to provide an option to allow removal of LNodes to allow a bulk delete of IEDs without dangling, unnecessary schema non-compliance which is at least one common workflow option. I am confident it is also a valid workflow to sometimes retain the LNodes so I think it is a good case for an optional argument.
@JakobVogelsang WDYT?
Would you accept:
export type RemoveIedOptions = {
removeLNodes: boolean;
};
function removeIED(remove: Remove,
options: RemoveIedOptions = { removeLNodes: false }): (Update | Remove)[] {
...
}If you are happy with this call signature I can prepare a PR.

Activity
JakobVogelsang commentedon Dec 5, 2024
Hi Dan, I would propose to add an option to
removeLNode.JakobVogelsang commentedon Dec 5, 2024
Would you mind it being a default false?
danyill commentedon Dec 5, 2024
danyill commentedon Jan 9, 2025
I think having a default of
falseis appropriate for anupdateIEDfunction (for a single IED). Although it could pose a problem there if there was already aiedNameofNoneand matching other attributes.If we had an
updateIEDsfunction I'd use true because otherwise we would likely break schema validity (or need to check and remove as necessary) if we had multiple LNodes with matching attributes across multiple IEDs.That posits a little challenge because the user should not see different behaviour when removing one IED vs. more than one IED. So I'd like to propose a default of
true.JakobVogelsang commentedon Jun 5, 2025
This is very reasonable. Let's got with true then :)
ca-d commentedon Apr 27, 2026
I would have guessed that someone removing an IED would want one of these two:
iedName=“None”, in which case duplicate LNodes in the same place are always to be avoided.In particular, I cannot see a need for ever generating duplicate LNodes and thereby invalidating the file.
@JakobVogelsang @danyill Am I getting the situation wrong? If so, in what way?
JakobVogelsang commentedon Apr 29, 2026
Hi you all, Stephen has triggered me today with this issue. I have another proposal for discussion @danyill @ca-d:
If an
LNodeelement has nolnTypethen we remove theLNodeelement.If an
LNodeelement HAS alnTypethen we do not remove but set theiedNametoNone.danyill commentedon May 1, 2026
That seems incomplete to me... I think though it's heading in the right direction and the suggestion from @ca-d has merit.
The uniqueness constraint in IEC 61850-6 is something like (for a LNode within a Function):
Given we require uniqueness across multiple fields perhaps what we should implement is:
The standard requires:
Perhaps something like this?
This would be for a use case of:
Even if we did this (as a default) I'd probably suggest that it was a valid use case to also say "I don't want this IED or the functions it represents so let's remove the whole lot" so it would be perhaps an additional flag. You either delete the LNodes or you retain them if possible ("virtualise the IED") so we should implement as an option.
fix: removeIED - prevent duplicate LNode's
stee-re commentedon May 27, 2026
The fix for this was revised, based on the discussions here. I waas forced to create a new PR #147 for this (because of the repo transfer).
The default behaviour now is LNodes bound to the IED being removed, are also removed. But a new optional flag "preserveLNodes" has been exposed, which will update the LNodes iedName to None if doing so won't cause a duplicate. If it would cause a duplicate, it is simply removed instead.
fix: removeIED - prevent duplicate LNode's (#147)