mz-automation / libiec61850

Official repository for libIEC61850, the open-source library for the IEC 61850 protocols
http://libiec61850.com/libiec61850
GNU General Public License v3.0
863 stars 461 forks source link

NBReports generated despite IedServer_lockDataModel(), IedServer_lockDataModel() #501

Open moggiozzi opened 6 months ago

moggiozzi commented 6 months ago

Shouldn't mms not buffered reports generated only after IedServer_unlockDataModel()? I think need "else" before the call processEventsForReport(); in reporting.c `void ReportControl_valueUpdated(ReportControl* self, int dataSetEntryIndex, int flag, bool modelLocked) { ReportControl_lockNotify(self);

if (self->inclusionFlags[dataSetEntryIndex] & flag) { /* report for this data set entry is already pending (bypass BufTm) */
    self->reportTime = Hal_getTimeInMs();

    if (modelLocked) {
        /* buffer all relevant values */
        copyValuesToReportBuffer(self);
    }
    else // !!! MY CODE !!!
        processEventsForReport(self, self->reportTime);
}`
mzillgith commented 6 months ago

In this case there is already a pending value in the report buffer, so it has to be sent immediately. Otherwise the value in the buffer would be lost. Therefore processEventsForReport has to be called even when IedServer_lockDataModel has been called before.

moggiozzi commented 6 months ago

In this case there is already a pending value in the report buffer, so it has to be sent immediately. Otherwise the value in the buffer would be lost. Therefore processEventsForReport has to be called even when IedServer_lockDataModel has been called before.

I have structured data (3-phase voltage and current) and I want to send a report only after updating all 3 values.