Modbus Profile Mapping to SolarEdge Inverter

Discussion in 'C-Bus Automation Controllers' started by pspeirs, May 1, 2019.

  1. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    Hi All,

    Has anyone played with setting up profiles for mapping to a SolarEdge inverter, or perhaps can mke some suggestions. BTW, anyone with an SE5000 be aware that the second RS485 port is hardware disabled an it is mnot possible to enable it even though the settings can be configured :) So, the switch to TCP/IP Modbus.

    I've set up a profile based on the information in the sunspec specification notes (https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note.pdf)

    however, any results that are returned don't appear to be valid. I'm sure there is somewhere I'm going wrong with this.

    Another thing, it doesn't seem possible to simple update the profile, or if the profile is deleted and readded, the device doesn't pick up the changes, so I need to delete both the device and profile before re adding.

    Code:
    {
        "manufacturer": "SolarEdge",
        "name": "SE5000",
        "product_range": "SE",
        "description": "SolarEdge SE5000 Inverter",
        "mapping": [
            {
                "name": "I_AC_Power",
                "bus_datatype": "uint32",
                "type": "register",
                "address": 40083,
                "datatype": "uint16",
                "units": "W"
            },
            {
                "name": "I_Status",
                "bus_datatype": "uint32",
                "type": "register",
                "address": 40108,
                "datatype": "uint16"
            },
            {
                "name": "M_AC_Freq",
                "bus_datatype": "int32",
                "type": "register",
                "address": 40204,
                "datatype": "int16"
            }
        ]
    }
     
    pspeirs, May 1, 2019
    #1
    1. Advertisements

  2. pspeirs

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,103
    Likes Received:
    8
    What are the results you are seeing that you think are not valid?

    Have you tried the adjacent address? It is base 0 or base 1 addressing. You appear to have taken this into consideration by changing the address by one (40083 is I_AC_Voltage_SF and 40084 is I_AC_Power)

    Not familiar with these units but know a smidge of MODBUS.

    Try a MODBUS test utility. I use MODBUSViewTCP. Its free for 15 minutes. There are others, just google them. Its a way to do a sanity check on what you are seeing.
     
    znelbok, May 2, 2019
    #2
    1. Advertisements

  3. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    Hey Mick,

    I've cleaned up the profile to a consecutive list of registers as shown below and the values returned are as below. I'll download your suggested test app and try it when I get home. As you can see from the values below, doesn't seem to make much sense, even when using the consecutive registers in case of the offsets.

    upload_2019-5-2_12-28-42.png


    Cheers,
    Paul
     
    pspeirs, May 2, 2019
    #3
  4. pspeirs

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    900
    Likes Received:
    54
    Location:
    Adelaide, Australia
    Just guessing but I assume you have a single phase inverter. The offsets are out by 1, so then first one is AC current which would make the last on the current scale factor. For a single phase inverter, current and current_A would be the same (they are!). Current B and C are not implemented so would probably return the maximum value for a 16 bit number (NOT_IMPLEMENTED) which is 65535. The scale factor is a signed integer so 65534 is actually -2. applying that to the current you get 6.43A. Would that be correct?
     
    Ashley, May 2, 2019
    #4
  5. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    So far so good, the util mentioned above allowed me to scan a bunch of addresses once I found the correct ID. Frequency and its scaling factor are correct so I'll work on creating the profile for the other values. Yes Ashley, they are out by one.

    upload_2019-5-2_20-22-21.png


    Cheers,
    Paul
     
    pspeirs, May 2, 2019
    #5
  6. pspeirs

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,103
    Likes Received:
    8
    You have to watch the base addressing with Modbus. That's why I asked if it was base 0 or base 1 (offset is often used as well) becasue you can be out by 1 as you have just found out. Just watch your data types as well. Signed and unsigned ints as you see can be very different to the eye.
     
    znelbok, May 3, 2019
    #6
  7. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    My issue now is more around getting the meter values for each phase back. This is connected to the inverter via RS485 and while I can return the meter model for example, there are no values available for the phase values. Probably best to wait until I'm at home the same time as the sun is up though to be doubly sure, but I suspect its proprietry sent to the monitoring portal.

    I could use the CMU to measure each phase but the measurements compared to whats being returned by the inverter are out by 150-200 watts.
     
    pspeirs, May 3, 2019
    #7
  8. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    Speaking of mappings, there appear to be a number of items not adequately explained in the manual. For starters, the cbus data types in some of the installed profiles contain numbers lie 1009, 1001, etc. What do these translate to as the listing of data types in the scripting module does not define these.

    How does the value_custom tag work? For the below profile entry, is it saying to set the mapped value to true or false based on the string contained at address 3?

    Code:
    {
        "name": "Remote Temp Sensor Status",
        "bus_datatype": "bool",
        "type": "discreteinput",
        "address": 3,
        "value_custom": {
            "0": "OK",
            "1": "Fault"
        }
    }
    In the following piece, I assume we're reading 14 registers from starting from address. What is datatype 7, is this a string that each value gets parsed and thrown into?

    Code:
    {
        "value_bitmask": "0x7F00",
        "read_count": 14,
        "read_offset": 4,
        "value_custom": { "22", "PM1200" }.
        "bus_datatype": 7,
        "address": 80,
        "name": "Product Code",
        "datatype": "uint16"
    }


    Cheers,
    Paul
     
    pspeirs, May 6, 2019
    #8
  9. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    More help needed guys. After giving up with reading the meter via the inverter, I've connected directly to the meters RS485 port. I cn connect with Modbus Poll and read the correct registers, and running the test via the SHAC gives the following results.

    upload_2019-5-14_19-12-34.png

    which looks pretty good for the frequency. I'm having no luck configuring the profile to correctly read this (and other) regsters. I have tried the following without success.

    If someone can give me some guidance as I'm not convinced the documentation really explains it all that well. Would also be nice to see some examples that use all variations of the possible configuration options.

    Code:
            {
                "name": "Freq 1(1033)",
                "type": "register",
                "address": 41033,
                "read_count": 2,
                "read_swap":  true,
                "datatype": "float32",
                "bus_datatype": 14,
                "units": "Hz"
            },
            {
                "name": "Freq 2(1033)",
                "type": "register",
                "address": 41033,
                "read_count":  2,
                "datatype": "float32",
                "bus_datatype": 14,
                "units": "Hz"
            },
    
    Regs,
    Paul
     
    pspeirs, May 14, 2019
    #9
  10. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    121
    Likes Received:
    4
    Location:
    Sydney
    I do seem to be talking to myself quite a bit lately, nevertheless, it seems to work if the profile is set as follows.

    {
    "bus_datatype": 14,
    "address": 1032,
    "type": "register",
    "units": "Hz",
    "name": "Freq",
    "read_swap": true,
    "datatype": "float32"
    }

    So, even though the RTU Read Test wants the actual register number 1033, the profile still needs the base 0 number 1032. This is pretty confusing to have to work out. Anyway, frequency seems to work, time to plug the rest in.

    Cheers,
    Paul
     
    pspeirs, May 14, 2019
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.