Sinexcel PWS2-30 Modbus Protocol V120 sign reversal

The Newer model of Sinexcel PWS2-30 uses Modbus protocol V120. There are many, many changes between this and the one currently existing in OpenEMS. We have been updating this. We have hit one big problem:

Active & Reactive power have had their signs reversed. Fixing this is not trivial to us Java newbies. Can anyone suggest the code to achieve this please?

Lines 552 - 554

Thank you.

After some looking I have decrypted the somewhat cryptic constants in the java code.

The one we needed was SCALE_FACTOR_2_AND_INVERT, where INVERT refers to changing the sign, that is, multiplying my -1.

BTW: FACTOR_2 refers to 10^2, a scaling of 100. Adding to the confusion, FACTOR_MINUS2 refers to 10^-2, or 1/100 scaling. I think these could have been named better, but that’s just me :slight_smile:

1 Like


the naming with FACTOR_2, etc. follows the definition of SunSpec (“Scale factor – Signed power of 10 multiplier (+) or divider (-)”, e.g.

Anyway, thanks for documenting it here. I know not everybody is reading the Javadocs in the code → :slight_smile:


1 Like