thiagoralves / OpenPLC_v3

OpenPLC Runtime version 3
1.07k stars 433 forks source link

Fix error handling in WriteMultipleRegisters #252

Closed Abestanis closed 1 month ago

Abestanis commented 1 month ago

Sorry, I just realized that I unintentionally introduced a change in #251.

Previously if the position of any of the values in the loop was invalid, we would set mb_error. But now we are overwriting mb_error every iteration of the loop, so if the first position is invalid and the second position is valid, mb_error will be ERR_NONE in the end.

This fixes my mistake, sorry about that.