Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

scottwday

Members
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    scottwday got a reaction from Paul.Chari in Axpert 5KVA Watchpower monitoring software   
    You have sp.Open commented out as well.
     
    I've put a simple C# command line utility on my github which lets you send a command and prints out the response.
    It handles all the CRC stuff. It might also be useful for anyone wanting to use it from scripts etc.
     
    Eg:
    console>AxpertTest -p COM3 QPI(PI30console>AxpertTest -p COM3 QPIGS(244.2 49.9 244.2 49.9 0024 0015 000 435 54.00 001 100 0019 0000 000.0 00.00 00000 00010101 00 00 00000 110 You can also set the baud (- and the timeout in milliseconds (-t)
     
    Here'e the .exe binary
    https://drive.google.com/file/d/0B8CTDo4cVxUlYzFZWnYtYlVETFE/view?usp=sharing
     
    Here's the sourcecode
    https://github.com/scottwday/AxpertTest/blob/master/Program.cs
     
    I've tested it works on my inverter (~2014 model) and with my emulator
  2. Like
    scottwday got a reaction from Warren in Axpert 5KVA Watchpower monitoring software   
    https://github.com/scottwday/AxpertTest
  3. Like
    scottwday got a reaction from Warren in Axpert 5KVA Watchpower monitoring software   
    The line will always end with a CR character. There will never be a CR in the CRC, so as soon as you get a 0x0d you know you've got the entire response.
    static void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e) { var sp = sender as SerialPort; if ((sp != null) && (!_gotResponse)) { //Read chars until we hit a CR character while (sp.BytesToRead > 0) { byte b = (byte)sp.ReadByte(); _rxBuffer.WriteByte(; if (b == 0x0d) { _gotResponse = true; break; } } } }
  4. Like
    scottwday got a reaction from Warren in Axpert 5KVA Watchpower monitoring software   
    The inverter will only reply once it receives a CR (0x0d) character.
     
    The last argument to SerialPort.Write is the number of bytes to write. you're always going to need to write more than 2 bytes. In fact it's always going to be 3 more bytes than the command you want to send:
     
    The format is <command><CRC_MSB><CRC_LSB><CR>
    public byte[] GetBytes(string Command, ushort Crc){ byte[] result = new byte[Command.Length + 3]; Encoding.ASCII.GetBytes(Command, 0, Command.Length, result, 0); result[result.Length - 3] = (byte)((Crc >> 8) & 0xFF); result[result.Length - 2] = (byte)((Crc >> 0) & 0xFF); result[result.Length - 1] = 0x0d; return result;} This code packs the bytes to send. First it's the bytes from a string, then 2 bytes of the 16 bit CRC, then a CR character.
     
    If you look at the CRC code it makes sure that it never uses 0x0d or 0x0a because they are characters that denote the end of the command.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.