smartgridadsc / OpenPLC61850

OpenPLC61850, an extension of OpenPLC compatible with the IEC 61850 MMS protocol
GNU General Public License v3.0
45 stars 19 forks source link

Incorrect error handling in `checkControlChanges` #3

Closed joshtyf closed 12 months ago

joshtyf commented 1 year ago

Description

In webserver/core/iec61850client.cpp in the function checkControlChanges, the program attempts to check the current value of the IED to see if it needs to send a write command to the IED to update its values. However, when an error is encountered, it merely logs ErrorCheckingValueBeforeWriting and proceeds on with the rest of the code.

https://github.com/smartgridadsc/OpenPLC61850/blob/9d2267dc4b8b2cfd1ad727880077b223efceec03/webserver/core/iec61850client.cpp#L182-L198

Possible fix

Ideally, the program should not continue with the rest of the code to send the write command to the IED as this will obscure the bug. There should probably be a continue statement in the conditional block.

wenshei commented 12 months ago

Thanks Josh.