PLC / Datalogger / Gateway as a slave
The Sofar EMS supports adding a PLC, Datalogger, Gateway or hub as a slave device through the Sofar EMS protocol. This function is provided for when there is a hub that has to receive control signals itself from the Sofar EMS.
When your device has implemented the protocol, you can add your device through the device wizard, choosing "Solar Inverter", "Generic", "Ethernet TCP" and "PLC (Generic protocol)".
Protocol implementation
You can download the specifications of the protocol through this link.You have two options when implementing the protocol on the hub:
- Or you only implement the data and control registers for the totals of all PV, storage etc. They are added in the Sofar EMS as one big aggregated device (or one EV charger, one energy meter, one hybrid inverter if applicable).
- Or you implement the data and control registers for each individual device. Each individual device is added in the Sofar EMS separately.
Do NOT add a device that is controlled by the PLC directly to the EMS. This could lead to conflicting control signals and doubly counted power values.
In case your hub only implements the totals, the Sofar EMS will treat this as one big controllable aggregated device. You can still put the aggregated device in any group, just like any other device. However, there are a few things to keep in mind if the individual devices that form up the aggregated device are in reality spread among different groups:
- The Sofar EMS will not be able to guard properly against overload on those groups.
- The Sofar EMS will for those groups not be able to determine the complete path of all power. This may lead to the Sofar EMS seeing production by an "unknown source" or consumption by an "unknown load" if there are energy meters on those groups. Some power might be reported double.
If the devices behind the hub are spread out over different groups, you must implement the data and control registers for each individual device.
Examples
A PLC that controls PV production and wants to accept a control signal from the Sofar EMS
The premise of the Sofar EMS protocol in this case is that the Sofar EMS sees the PLC itself as a controllable PV inverter.
The minimum required if you want to control PV inverters through a PLC with a signal from the Sofar EMS, is that the PLC:
- tells the Sofar EMS that there is only PV;
- returns how much PV power is produced in total by the inverters;
- accepts the setpoints of the Sofar EMS;
For point 1:
- Input register 0, (32 bit unsigned int), must contain the fixed value "0x454E4952" (protocol identification)
- Input register 100, (16 bit unsigned int), must contain the value "0", so the Sofar EMS knows that the PLC doesn't supply grid energy measurements.
- Input register 300, (16 bit unsigned int), must contain the value "1", so the Sofar EMS knows that there is PV.
- Input register 400, (16 bit unsigned int), must contain the value "0", so the Sofar EMS knows that there is no storage.
For point 2:
- Input register 202, (32 bit signed int), contains the AC power of the inverters. Negative is towards the grid, positive is from the grid.
- Input register 303, (32 bit unsigned int), contains the total PV production power in W. (Always a positive number)
For point 3:
- Holding register 1001, (16 bit unsigned int), will be set to "1" by the Sofar EMS if it wants to apply a control setpoint, or "0" when the PLC should fall back to its own control
- Holding register 1002, (32 bit unsigned int), will be set by the Sofar EMS and contains the maximum allowed PV production power in W. (Always a positive number)
IMPORTANT: ALL NON-IMPLEMENTED REGISTERS MUST CONTAIN THE NON-IMPLEMENTED VALUE OF THEIR TYPE, AS DESCRIBED IN THE PROTOCOL.
The registers above are the absolute minimum required. The Sofar EMS will assume that all the PV that is connected to the PLC behaves as if it were a single PV inverter, with power factor 1 and symmetric three phase behaviour.
If enhanced control is necessary, e.g. to keep an eye on phase currents etc., it is best to implement the recommended registers as well.