BA - KOSTAL Interface Description MODBUS - PIKO CI
BA - KOSTAL Interface Description MODBUS - PIKO CI
3. MODBUS on TCP/IP 1
3.1 Application Layer........................................................................................................................... 1
3.2 Modbus Frame.............................................................................................................................. 2
3.3 Physical Layer - LAN (TCP)............................................................................................................ 6
3.4 TCP-Port and Unit-ID.................................................................................................................... 6
4. MODBUS on Serial 7
4.1 Apllication Layer............................................................................................................................ 7
4.2 MODBUS frame............................................................................................................................ 8
4.3 Master / Slaves protocol principle.................................................................................................. 9
4.4 Physical Layer - RS485 (Serial).................................................................................................... 16
5. Exception Responses 17
7. SunSpec Interface 30
7.1 Overview..................................................................................................................................... 30
7.2 Implemented SunSpec Models.................................................................................................... 30
Any instance of misuse will result in the termination of the warranty, guarantee and general liability to the
fullest extent permitted by law of the manufacturer.
The Modbus interface can be used via the Modbus TCP protocol.
All components have to stay within their permitted operating and installation requirements. The products
should only be used in line with their documentation and the local applicable standards and directives.
Alterations to the product, e.g. changes or modifications, are perhibitted. Any use of the product other
than that described in the Intended Use section does not qualify as the intended use. Tobserve all inst-
ructions contained therein.
If KOSTAL solar inverters are connected to the Internet, there is a risk that unauthorized users can
access and manipulate the data of your PV system.
n Set up a firewall.
n Close unnecessary network ports in your router.
n Remote access should only be done through a virtual private network (VPN).
n Do not set up port forwarding for the Modbus ports used.
KOSTAL under no circumstances shall have any liability for any loss or damage invcurres by the use of
the Modbus interface. The use of the interface and reliance on the information is solely at the users risk.
The industry’s serial de facto standard since 1979, MODBUS continues to enable millions of automation
devices to communicate. Today, support for the simple and elegant structure of MODBUS continues
to grow. The Internet community can access MODBUS at a reserved system port 502 on the TCP/IP
stack.
MODBUS is a request/reply protocol and offers services specified by function codes. MODBUS function
codes are elements of MODBUS request/reply PDUs. The objective of this document is to describe the
function codes used within the framework of MODBUS transactions.
The MODBUS Application Protocol is currently used in the solar sector mainly for system communica-
tion in PV power plants. The MODBUS protocol has been developed for reading data from- or writing
data to clearly defined data areas.
MODBUS on TCP
TCP
IP
MODBUS is an application layer messaging protocol for client/server communication between devices
connected on different types of buses or networks.
Scope of this document is the implementation TCP/IP over Ethernet and serial ocer RS485. See MOD-
BUS Messaging Implementation Guide V1.0a.
MODBUS on TCP
TCP
IP
Ethernet II / 802.3
Ethernet
physical layer
PDU
Abbreviations:
ADU Application Data Unit
HDLC High Level Data Link Control
HMI Human Machine Interface
IETF Internet Engineering Task Force
I/O input/Output
IP Internet Protokoll
MAC Media Access Control
MB MODBUS Protokol
MBAP MODBUS Apllication Protokol
PDU Protocol Data Unit
PLC Programmable Logic Control
TCP Transmission Control Protocol
The MODBUS application data unit is built by the client that initiates a MODBUS transaction. The func-
tion indicates to the server what kind of action to perform.
The function code field of a MODBUS data unit is coded in one byte. Valid codes are in the range of
1 ... 255 decimal (the range 128 – 255 is reserved and used for exception responses). When a message
is sent from a Client to a Server device the function code field tells the server what kind of action to per-
form. Function code “0” is not valid.
1
Register content is 16-bits width.
The register data in the response message are packed as two bytes per register, with the binary con-
tents right justified within each byte. For each register, the first byte contains the high order bits and the
second contains the low order bits.
Request
Function code 1 Byte 0x03
Starting Address 2 Bytes 0x0000 to 0xFFFF
Quantity of Registers 2 Bytes 1 to 125 (0x7D)
Response
Function code 1 Byte 0x03
Byte count 1 Bytes 0x0000 to 0xFFFF
Register value N x 2 Bytes
1
1 to 125 (0x7D)
N = Quantity of Registers
1
Error
Error code 1 Byte 0x83
Exception code 1 Bytes 01 or 02 or 03 or 04
The contents of register 108 are shown as the two byte values of 0x022B. The contents of registers 109
–110 are 0x0000 and 0x0064.
The normal response is an echo of the request, returned after the register contents have been written.
Request
Function code 1 Byte 0x06
Starting Address 2 Bytes 0x0000 to 0xFFFF
Quantity of Registers 2 Bytes 0x0000 to 0xFFFF
Response
Function code 1 Byte 0x06
Byte count 1 Bytes 0x0000 to 0xFFFF
Register value 2 Bytes 0x0000 to 0xFFFF
Error
Error code 1 Byte 0x86
Exception code 1 Bytes 01 or 02 or 03 or 04
PIKO CI 30
Master
RJ45
COM
1,5 Nm
LAN PIKO CI 50/60
LAN
8 Nm
Master / Slave
EIA/TIA-232 or
EIA/TIA-485
MODBUS PDU
Abbreviations:
ADU Application Data Unit
Host The one that initiates communication is called the host
Slave The one that passive responses command called the slave
IETF Internet Engineering Task Force
I/O input/Output
MB MODBUS Protokol
MBAP MODBUS Apllication Protokol
PDU Protocol Data Unit
A MODBUS communication is always initiated by the master. The slave nodes will never transmit data
without receiving a request from the master node. The slave nodes will never communicate with each
other. The master node initiates only one MODBUS transaction at the same time.
The master node issues a MODBUS request to the slave nodes in two modes:
1. In unicast mode, the master addresses an individual slave. After receiving and processing t he
request, the slave returns a message (a ‚reply‘) to the master. In that mode, a MODBUS trans-
action consists of 2 messages: a request from the master, and a reply from the slave. Each slave
must have an unique address (from 1 to 247) so that it can be addressed independently from other
nodes.
2. In broadcast mode, the master can send a request to all slaves. No response is returned to broad-
cast requests sent by the master. The broadcast requests are necessarily writing commands. The
address 0 is reserved to identify a broadcast exchange.
A request telegram can be sent as soon as no communication has taken place on the RS485 bus for at
least 100 ms.
RTU (Remote Terminal Unit) mode, each 8–bit byte in a message contains two 4–bit hexadecimal
characters.
The format (11 bits) for each byte in RTU mode is:
One array contains all of the 256 possible CRC values for the high byte of the 16-bit CRC field, and the
other array contains all of the values for the low byte.
Indexing the CRC in this way provides faster execution than would be achieved by calculating a new
CRC value with each new character from the message buffer.
Note : This function performs the swapping of the high/low CRC bytes internally. The bytes are already
swapped in the CRC value that is returned from the function. Therefore the CRC value returned from
the function can be directly placed into the message for transmission.
Example:
Example:
Example:
ext.
DATALOGER
Parameter Description
Transfer mode RTU mode
Communication mode Half duplex
Baud rate 19200
Start bit 1
Data bit 8
Check bit None
Stop bit 2
PIKO CI 30
10
4
RS485 1,5 Nm
5
PIKO CI 50/60
6
RS485 B IN 7
RS485 A IN 8
RS485 B OUT 9
RS485 A OUT 10
8 Nm
The exception response message has two fields that differentiate it from a normal response:
Function Code Field: In a normal response, the server echoes the function code of the original
request in the function code field of the response. All function codes have a most – significant bit (MSB)
of 0 (their values are all below 80 hex). In an exception response, the server sets the MSB of the func-
tion code to 1. This makes the function code value in an exception response exactly 80 hex higher than
the value would be for a normal response.
With the function code’s MSB set, the client‘s application program can recognize the exception res-
ponse and can examine the data field for the exception code.
Data Field: In a normal response, the server may return data or statistics in the data field (any informa-
tion that was requested in the request). In an exception response, the server returns an exception code
in the data field. This defines the server condition that caused the exception.
Notes:
1
N = Quantity of Registers
2
Inverter States
1 Init
6 FeedIn
10 Standby
15 Shutdown
3
Scale factors: As an alternative to floating point format, values are represented by integer values with a signed scale factor applied. The scale
factor explicitly shifts the decimal point to the left (negative value) or the right (positive value). Scale factors are 16 bit two’s compliment integer,
*N = Quantity of Registers
Note:
1
The inverters can contribute to grid management by feeding in with a fixed cos φ. The displacement
factor cos φ is an unsigned factor that is nonetheless characterized by the suffix „underexcited“ or
„overexcited“. However, a „delta cos φ“ is transmitted here to the inverter, whereby a negative value
corresponds to underexcited operation and a positive value corresponds to overexcited operation.
The value range -1.0…+1.0 is shown for the transmission of the desired value to the value range
-32768…+32767 of a 16 bit whole number (signed short) with a suffix.
Example:
Setting Delta cos φ Reactive power
0 0 cos φ = 1.00
-1638 -0.05 cos φ = 0.95 underexcited
+3276 +0.10 cos φ = 0.90 overexcited
The maximum setting range is -26214…26214 (corresponds to a max. cos φ of 0.80). The setting
range actually realizable by the inverter is found in the data sheet of the inverter.
SunSpec information Models are defined using the SunSpec Model Definition XML (SMDX) encoding.
Please reference the SMDX file for the definitive version of any SunSpec Information Model, at
http://sunspec.org/download.
SunSpec information Models are communication protocol agnostic, but MODBUS is currently the most
popular transport protocol in use.
Aktuelle Informationen finden Sie unter www.kostal-solar-electric.com. Hersteller: KOSTAL Industrie Elektrik GmbH, Hagen, Deutschland
79108 Freiburg i. Br.
Deutschland
Telefon: +49 761 47744 - 100
Fax: +49 761 47744 - 111
www.kostal-solar-electric.com
03 / 2021 © 2021 KOSTAL Solar Electric GmbH 31