Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

MODBUS MODULE

Communications Function
Instruction Manual

Notice

1. Make sure that this instruction manual is delivered to the end user or the system integrator.
2. Read this manual before first using the communications function, and keep it handy as a
reference for maintenance and inspections.

DWG. No. 4G50Z04721P1

Printed 2021.07 ISSUE 05


This manual explains the serial communications interface function provided for the KOBELCO controller.

The controller can be connected to a computer or a controller (hereinafter referred to as the host) for data communications via
MODBUS module.
By writing computer programs, it is able to monitor the operating status of the controller, control its operation.

① Condition monitoring of the controller (pressure, temperature, current, loading state, etc.)
② Remote control of the controller (operation, stop, etc.)

Transmission specification

Communications protocol
Protocol MODBUS-RTU
Communication baud rate 19200bps
Transmission scheme Half-duplex
Synchronization scheme Start-stop synchronization
Data bit 8 bit
Parity bit Even
Stop bit 1 bit
DCE designation DTE mode
Signal control(DTR/DSR) OFF
Signal flow control(RTS/CTS) None
XON/XOFF control None

1 4G50Z04721P1-05
1. Message Form

RTU The usual format of transmission of a message is as follows. All data will be binary codes.

host Query message

module Response

When the module is ready and receives a message addressed to itself, if the module determines that it received the massage
successfully, the module processes the request and returns a normal response. If the module determines that it did not receive the
massage successfully, the module returns an error response. The module does not return a response to a broadcast.

Query;
A host transmits a message to a single controller.

Normal Response;
After receiving a query, the inverter processes the request and returns a normal response.

Error Response;
After receiving a query, the inverter cannot process the request and returns an error response.
The error response includes a reason why the inverter cannot process the message.
The inverter does not return an error response to a CRC error or a physical transmission error.

[NOTICE]
MODBUS sends and receives binary data without a frame synchronization header character and defines the frame synchronizing
system to recognize the start of a frame by no-data time. MODBUS initializes frame information and decides the data that is first
received subsequently as the first byte of a frame if data is not communicated within a time for few bytes, including the start and
stop bits, at the transmission speed of the on-going communication while standing by for data reception. If a frame is being received
before no-data time for few bytes, this frame will be aborted. Be sure to provide more than few bytes for data send interval.
Send data so that the time between characters will not be spaced for more than 1.5 bytes. Otherwise, MODBUS will sometimes
recognize it as a start of data. In the case of data to other stations, messages from the host and responses from other stations are
also received. A wait time for more than 200 ms is needed before starting transmission after own station completes reception when
sending a response to recognize a frame start at this time.

・As for data communications codes, the MODBUS module support the binary (HEX) code.
・A communication number is used to access the desired data item.
・The smallest unit of information that computers handle is called a “bit (binary digit),” which represents the two numbers in the
binary system: 1 or 0. A group of 16 bits is referred to as a “word,”

2 4G50Z04721P1-05
2. Transmission Frame

The transmission frame is as follows.

1byte 1byte max 203byte 2byte


Station No. FC(function code) information Error check

(1) Code (Station No)


Station No is 1 byte in length and can choose No. 1 to No. 6.
No. 0 can not be used.

(2) FC(function code)


Function code is 1 byte in length and defines by the value of 0 to 255 as shown below.
Do not use the functions that are not available, otherwise it will be error response.

FC Functional explanation
0 ~ 2 Unavailable
3 Data read-out a Maximum of 99
4 ・ 5 Unavailable
6 Data write-in
7~ 225 Unavailable

(3) Information
The information field contains all the information, including an address, a byte count, the number of data, data, etc.

(4) Error check


The Error Check field is two bytes in length and used for a CRC-16 type error check.
The frame length is necessary to obtain a CRC-16 code from the FC and the byte count data since the information field length is
variable.

3 4G50Z04721P1-05
3. Data Read-out

Query
1byte 1byte 2byte 2byte 2byte
Station No. 03 Address The number of read-out data Error check
(a maximum of 99)

Normal Response
1byte 1byte 1byte 2 ~ 198byte 2byte
Station No. 03 Byte count Read-out data (a maximum of 198) Error check

How to set Query


◇ The Station Number 0 is not available.
◇ FC =03
◇ The address consists of the 2 byte in length. Set in order of a higher (High) to a lower (Low).
◇ The number of read-out data is 2 byte in length. Set in order of a higher (High) to a lower (Low). A setting range is a value
of 1 to 99 (WORD). And the number of read-out data not to exceed the maximum offset 99 of an address. It will become an
error response if a value exceeds.
◇ Set the calculation result of CRC in order of a lower (Low) to a higher (High). Arrangement becomes reverse as the others.

Normal response (Normal Response) of the interpretation


◇ The data range of a byte count is set to 2 to 198. A byte count becomes twice the number of read-out data of QUERY (1-99
data).
◇ They are the data of an address with which read-out data was located in a line in order of Hi byte of each WORD data, and
Lo byte, and each WORD data was demanded by the query, data of the address +1, and data of +2. -- It is returned along
with order. Moreover, data serves as the hexadecimal notation.

4. Data Write in

Query
1byte 1byte 2byte 2byte 2byte
Station No. 06 Address Write-in data Hi | Lo Error check

Normal Response
1byte 1byte 2byte 2byte 2byte
Station No. 06 Address Write-in data Hi | Lo Error check

How to set Query


◇ The Station Number 0 is not available.
◇ FC =06
◇ The address consists of the 2 byte in length. Set in order of a higher (High) to a lower (Low).
◇ The number of read-out data is fixed as 2 byte in length.
◇ Set the calculation result of CRC in order of a lower (Low) to a higher (High). Arrangement becomes reverse as the others.

Interpretation of a normal response


◇ A normal response becomes the same frame as the query.

4 4G50Z04721P1-05
6.Error Response

When an invalid query is received, a query is not performed but it becomes an error response.

Error Response
1byte 1byte 1byte 2byte
Station No. Exception FC Subcode Error check

Interpretation of an Error Response


◇ The error response is the same as a query requesting a Station Number.
◇ An exception code becomes the value which added 128 (80H) to FC of the query message.
For example, it is a 3+128=131 (83H)
◇ As shown in the following table, a sub code shows the reason of invalidity.

Subcode Item Description


1 Invalid FC FC received does not exist.
(Other than 3,6)
2 Invalid Address Number dose not match.
3 Data range error Out of valid range
4~A NAK NAK

5 4G50Z04721P1-05
7.CRC-16(Cyclic Redundancy Check)

At the time of data communications, it is necessary to check a communication frame for no error.
CRC (Cyclic Redundancy Check) is one of the most effective check systems for error checking.
The sender side calculates the CRC data which calculated and adds to the end of the frame. The receiver side calculates CRC
similarly to receiving data and compares these two CRC Data.
Brief description of the step for calculating CRC data

◇ A data expressed as a polynomial (1100 0000 0010 0001 is expressed as X15+X14+X5+1) is divided by a generation polynomial
(17 bits, X16+X15+X2+1). The CRC data is obtained as a remainder (16 bits) of this division.
◇ Neglect the quotient, add the remainder at the end of a data, and send a message.
◇ A receiver side divides this message (with CRC data) by the generation polynomial and assumes that a transmission is
executed without error if the remainder is 0.

<About CRC-16>
The generation polynomial is expressed with powers of X such as X3+X2+X instead of binary code 1101.
Though you can choose an arbitrary generation polynomial, there are some defined/proposed standard polynomials to optimize
error detection.
The RTU protocol uses a generation polynomial ofX16+X15+X2+1 corresponding to 1 1000 0000 0000 0101 expressed in binary.
In this case, a generated CRC is known as CRC-16.
・ It is updated in a calculation process and, finally adds to a transmitting frame as a check code.
・ Reception processing is also the same algorithm as the above.
However, it is necessary to compare CRC which is a transmitting CRC and reception side and was calculated.

8. Example of Communication

Examples of communications are shown.

Exp.(1)
Query(HOST->MODULE)
01 03 00 01 00 02 95 CB

Normal Response(MODULE->HOST)
01 03 04 FF 62 00 4F 2A 0D

Exp.(2)
Query(HOST->MODULE)
01 06 00 00 00 01 48 0A

Normal Response(MODULE->HOST)
01 06 00 00 00 01 48 0A

Exp.(3)
Query(HOST->MODULE)
01 09 00 00 00 02 5C 0A

Error Response(MODULE->HOST)
01 89 01 86 50

6 4G50Z04721P1-05
Address data list

■Monitoring data

Address ALE/FE Kobelion REMARK


0001 1st suc. press. Suc. press. Ex. 200 ⇒2kPa
0002 1st dis. press. Dis. press. Ex. 50 ⇒0.05MPa
0003 2nd dis. press. OS press. Ex. 290 ⇒0.29MPa
0004 Oil press. Spare Ex. 190 ⇒0.19MPa
0005 Spare Spare Spare (Not available)
0006 1st suc. temp. Ambient temp. Ex. 200 ⇒20.0℃
0007 1st dis. temp. Motor coil temp. Ex. 200 ⇒20.0℃
0008 2nd suc. temp. Spare Ex. 200 ⇒20.0℃
0009 2nd dis. temp. Dis. temp. Ex. 200 ⇒20.0℃
0010 Oil temp. O/S temp. Ex. 200 ⇒20.0℃
0011 Spare Spare Spare (Not available)
0012 Current Current Ex. 100 ⇒100A
0013 - - Spare (Not available)
0014 Loading condition Loading condition Ex. 100 ⇒100V
0015 - - Spare (Not available)
0016
0017
0018
0019
0020 Operation time Operation time Double words
0021
0022 Operation count Operation count Double words
0023
0024 Emergency Stop 1 Emergency Stop 1 BIT info(See table below)
0025 Emergency Stop 2 Emergency Stop 2 BIT info(See table below)
0026 Caution 1 Caution 1 BIT info(See table below)
0027 Lamp condition Lamp condition BIT info(See table below)
0028 Maintenance 1 Maintenance 1 BIT info(See table below)
0029 Maintenance 2 Maintenance 2 BIT info(See table below)

7 4G50Z04721P1-05
Address ALE/FE Kobelion
0024 EMERGENCY(1)
0 bit Motor over load Motor over load
1 bit Motor coil temp high Motor coil temp high
2 bit Aux. Motor Failure Reverse phase
3 bit Fan motor failure
4 bit Delayed start Dryer failure
5 bit Low oil pressure Dis. temp high
6 bit High 1st disc. temp.
7 bit High 2nd suc. temp. After o/s temp high
8 bit High 2nd disc. temp. Ground fault
9 bit High oil temperature Inverter open phase
10 bit Abnormal stop of dryer Inverter DC voltage error
11 bit Suspended water supply Inverter main circuit under voltage
12 bit Starter failure Inverter motor over-load
13 bit Reverse phase Inverter over-load
14 bit Inverter error Inverter step out
15 bit Inverter fuse burnt
0025 EMERGENCY(2)
0 bit Inverter over-current
1 bit Inverter over-heat
2 bit Inverter heavy error
3 bit Insufficient water flow (Option)
4 bit Inverter contactor error
5 bit
6 bit
7 bit
8 bit
9 bit
10 bit
11 bit
12 bit Inverter error
13 bit Emergency Stop
14 bit Sensor error Sensor error
15 bit CPU fault CPU error

8 4G50Z04721P1-05
Address ALE/FE Kobelion
0026 CAUTION
0 bit Low oil press. Dis. temp high
1 bit Ambient temp high
2 bit High 1st dis. temp. After o/s temp high
3 bit High 2nd suc. temp. Dryer failure
4 bit High 2nd dis. temp Ambient temp high
5 bit High oil temp. Oil separator clogged
6 bit Inverter over-heat
7 bit Inverter light error
8 bit
9 bit Motor coil temp high
10 bit Dryer failure
11 bit Abnormal stop of dryer
12 bit Inverter light error
13 bit
14 bit Maintenance 100HR Maintenance 100HR
15 bit Sensor failure

9 4G50Z04721P1-05
Address ALE/FE Kobelion
0028 MAINTENANCE(1)
0 bit Clogged dust filter Dust filter cleaning
1 bit Replace suction filter Suction filter replacement
2 bit Replace oil filter Oil filter replacement
3 bit Change oil Lubricating oil replacement
4 bit Oil separator element replacement
5 bit Inspect cooler Cooler inspection
6 bit
7 bit Grease up Grease up
8 bit Pressure set error Pressure set error
9 bit
10 bit
11 bit Clean oil mist collector
12 bit
13 bit Replace battery Replace battery
14 bit Sensor failure Sensor failure
15 bit
0029 MAINTENANCE(2)
0 bit Yearly inspection Yearly inspection
1 bit 2nd yearly inspection
2 bit 4th yearly inspection
3 bit Overhaul
4 bit
5 bit
6 bit
7 bit
8 bit
9 bit
10 bit
11 bit
12 bit
13 bit
14 bit
15 bit
0027 PANEL LAMP
0 bit POWER POWER
1 bit LOAD LOAD
2 bit AUTO START AUTO START
3 bit LOCAL LOCAL
4 bit REMOTE REMOTE
5 bit - -
6 bit STOP STOP
7 bit START START
8 bit EMERGENCY EMERGENCY
9 bit CAUTION CAUTION
10 bit MAINTENANCE MAINTENANCE

10 4G50Z04721P1-05
■Command data ※Only write-in.

Address Data write-in Item


0000 0001 Remote run
0002 Remote stop
0004 -

11 4G50Z04721P1-05
■Example of sample VB6 program execution
※ Visual Basic is a registered trademark of U.S. microsoft.

Transmission and reception of the optional data like in the following example can be done by doing "the
arrangement of the form control" of the explanation and "the description of the code" with mentioning later.

□ Arrangement of the control on the form


Two TextBox, two Labels , three CommandButton and one MsComm are arranged on the form as
follows.

12 4G50Z04721P1-05
□ Description of a code

' START BUTTON


Private Sub Command1_Click()
On Error Resume Next

MSComm1.CommPort = Val(Text1.Text)
MSComm1.Settings = "19200,e,8,1"
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeBinary
MSComm1.PortOpen = True
If Err <> 0 Then
MsgBox "Can not open COM port.", vbCritical
Exit Sub
End If
MSComm1.DTREnable = False
MSComm1.RTSEnable = False
Command1.Enabled = False
Command2.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Timer1.Interval = 2000
Timer1.Enabled = True
End Sub

' STOP KEY


Private Sub Command2_Click()
On Error Resume Next

Timer1.Enabled = False
Timer1.Interval = 0
MSComm1.PortOpen = False
Command1.Enabled = True
Command2.Enabled = False
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
End Sub

' Reception interrupt


Private Sub MSComm1_OnComm()
Dim Buffer As Variant
Dim buf() As Byte
Dim CRC As Long
Dim i%
Dim dat As Long

On Error Resume Next

Buffer = MSComm1.Input ' Read out reception buffer


buf = Buffer

If (buf(0) = Val(Text2.Text)) And (buf(1) = 3) And (buf(2) = 20 * 2) Then ' Reception format check
CRC = crc16(buf(), 43) ' Calculate CRC16
If (buf(43) = (CRC Mod 256)) And (buf(44) = (CRC ¥ 256)) Then ' CRC check
For i% = 0 To 19
dat = buf(i% * 2 + 3)
dat = dat * 256
dat = dat + buf(i% * 2 + 4)
Label5(i%).Caption = Trim(CStr(dat)) & " " ' Data display
Next i%
End If
End If
End Sub

13 4G50Z04721P1-05
' Transmission timer
Private Sub Timer1_Timer()
Dim buf(0 To 7) As Byte
Dim CRC As Long

On Error Resume Next

buf(0) = Val(Text2.Text)
buf(1) = &H3
buf(2) = Val(Text3.Text) ¥ 256
buf(3) = Val(Text3.Text) Mod 256
buf(4) = 0
buf(5) = 20

CRC = crc16(buf(), 6)
buf(6) = CRC Mod 256
buf(7) = CRC ¥ 256

MSComm1.Output = buf()
MSComm1.InBufferCount = 0
MSComm1.RThreshold = 45
End Sub

Function crc16(cp() As Byte, Optional ByVal Size As Long = -1) As Long


Dim L As Long
Dim ICRC As Integer

If Size < 0 Then Size = UBound(cp) - LBound(cp) + 1

ICRC = &HFFFF

For L = LBound(cp) To LBound(cp) + Size - 1: CRCUpdate ICRC, cp(L): Next

crc16 = CLng(ICRC) And &HFFFF&


End Function

Private Sub CRCUpdate(ByRef CRC As Integer, ByVal b As Byte)


Const Polynomial16 As Integer = &HA001
Dim Bits As Byte

CRC = CRC Xor b


For Bits = 0 To 7
Select Case (CRC And &H1)
Case 0
CRC = rightShift(CRC)
Case Else
CRC = rightShift(CRC) Xor Polynomial16
End Select
Next
End Sub

Private Function rightShift(ByVal V As Integer) As Long


rightShift = V And &HFFFE
rightShift = rightShift ¥ &H2
rightShift = rightShift And &H7FFF
End Function

14 4G50Z04721P1-05
WARRANTY CONDITIONS

1) WARRANTY CONDITIONS
The warranty period of this machine shall be 12 months from a date of completion of the test run or 15
months from the date of shipment, whichever comes earlier.
2) CONTENTS OF WARRANTY
In case a trouble should occur during the warranty period and when it is determined that the trouble is
caused clearly by our defective design, manufacture and/or execution of work, we repair or replace the parts
free of charge without delay.
3) EXCEPTIONS TO THE APPLICATION OF WARRANTY
Even during the warranty period of this machine, we refuse warranty in the following cases:
・Trouble caused by the natural disasters or accidents belong human control.
・Trouble caused by a defective material selected or supplied by you, or caused by a defect resulted from
the design designated by you.
・Trouble caused by a repair or modification conducted by you without notifying us of the fact.
・Trouble caused by not adhering to the operating procedures, periodical inspections, maintenance and
storage, etc. described in the specification sheets and instruction manuals issued by us.
・Trouble caused by defective foundation, building and/or equipment other than this machine.

INDEMNITY
Under no circumstances shall, including any illegality, Kobe Steel, Ltd. be liable for special, indirect,
incidental, or consequential damages, including, but not limited to, loss of production, or loss of anticipated
profits, loss of operational profits, loss of material and products or indirect losses, however same shall be
caused.

15 4G50Z04721P1-05

You might also like