You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reading Registers from my GoodWe inverters GW6000ES20 and GW10KN-ET.
The documentation says
Offset: 35003
Description: Inverter SN
Mode: RO
Type: STR
Length: 8
Remark: ASCII code,16 bytes. Read together.
I am reading 5 int values like
[0] = 0x00004757 | int
[1] = 0x00003630 | int
[2] = 0x00003030 | int
[3] = 0x00004553 | int
[4] = 0x00003230 | int
When i try to convert the register values with ConvertRegistersToString, it uses RegisterOrder.HighLow (by code), and the result is
WG0600SE02
after implementing RegisterOrder.LowHigh, it converts correctly: GW6000ES20
So the method should look like
'''
///
/// Converts 16 - Bit Register values to String
///
/// Register array received via Modbus
/// First Register containing the String to convert
/// number of characters in String (must be even)
/// Desired Word Order (Low Register first or High Register first
/// Converted String
public static string ConvertRegistersToString(int[] registers, int offset, int stringLength, RegisterOrder order = RegisterOrder.LowHigh)
{
byte[] result = new byte[stringLength];
byte[] registerResult = new byte[2];
I am reading Registers from my GoodWe inverters GW6000ES20 and GW10KN-ET.
The documentation says
Offset: 35003
Description: Inverter SN
Mode: RO
Type: STR
Length: 8
Remark: ASCII code,16 bytes. Read together.
I am reading 5 int values like
[0] = 0x00004757 | int
[1] = 0x00003630 | int
[2] = 0x00003030 | int
[3] = 0x00004553 | int
[4] = 0x00003230 | int
When i try to convert the register values with ConvertRegistersToString, it uses RegisterOrder.HighLow (by code), and the result is
WG0600SE02
after implementing RegisterOrder.LowHigh, it converts correctly: GW6000ES20
So the method should look like
'''
///
/// Converts 16 - Bit Register values to String
///
/// Register array received via Modbus
/// First Register containing the String to convert
/// number of characters in String (must be even)
/// Desired Word Order (Low Register first or High Register first
/// Converted String
public static string ConvertRegistersToString(int[] registers, int offset, int stringLength, RegisterOrder order = RegisterOrder.LowHigh)
{
byte[] result = new byte[stringLength];
byte[] registerResult = new byte[2];
Sorry if the formatting is not so pretty, this is my first time reporting an issue...
The text was updated successfully, but these errors were encountered: