openscd / open-scd

A substation configuration description editor for projects using SCL IEC 61850-6 Edition 2 or greater
https://openscd.github.io
Apache License 2.0
97 stars 31 forks source link

Subscribing on minimal ExtRef definition #1532

Closed JakobVogelsang closed 1 month ago

JakobVogelsang commented 3 months ago

As a user of OpenSCD I want to be able to see already existing subscriptions in OpenSCD in all circumstances. At the moment when an ExtRef element has missing srcLNClass and srcLNInst is interpreted as unsubscribe. That however is incorrect as described here.

grafik

Acceptance Criteria On checking existing subscriptions, the existing rules must be extended so that:

Example <ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcCBName="gcb" serviceType="GOOSE" /> must be interpreted as <ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcLNClass="LLN0" srcLNInst="" srcCBName="gcb" serviceType="GOOSE" />

Sander3003 commented 3 months ago

What plug-ins are affected in this issue?

pascalwilbrink commented 3 months ago

On which plug-ins does this occur?

JakobVogelsang commented 2 months ago

It could appear in all the six subscriber plugins:

JakobVogelsang commented 2 months ago

The problem is likely to be found here:

grafik

Here, a query is constructed with the assumption that srcLNClass and srcLNInst are not empty.

clepski commented 2 months ago

After having looked into the issue for GOOSE later binding the code that fetches the list for the subscribed list is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L258-L271

and does not call packages/plugins/src/editors/subscription/foundation#getExtRef at all.

The filter for srcLNClass and srcLNInst is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L164-L188

It looks like the check for srcLNClass fails, because a missing value is transformed to empty string and compared to lnElement.lnClass which is probably 'LLN0'. The srcLNInst passes, because a missing value is interpreted as empty string which is the default value by coincidence.

Take note that the comparison function converts missing element, missing attribute and missing value to empty string.

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L126-L144

clepski commented 2 months ago

The part in packages/plugins/src/editors/subscription/foundation#getExtRef is being used in the Message binding plugins

JakobVogelsang commented 1 month ago

@clepski this would be the file for the regression test. It has SMV and GOOSE services linked to the ExtRef and both would fail to show correct subscription at the moment.

dafaultSrcLNClassSrcLNInst.scd.zip

Sander3003 commented 1 month ago

@DavoodSooran can you validate this story?

Sander3003 commented 1 month ago

I suggest to close this issue and create an new issue and pull-request for the following finding: https://github.com/openscd/open-scd/issues/1556