You are on page 1of 11

26

MODBUS/MEMOBUS COMMUNICATION

3. MODBUS/MEMOBUS COMMUNICATION

3.1 INTRODUCTION

The MEMOBUS/Modbus communication uses one master (PLC) and a maximum of 31 slave drives in
GEM series and 31 drives in COSMOS series. Serial communications usually start with a signal from
the master to the slave drives.
A slave drive that receives a command from the master performs the specified function and then
sends a response back to the master. You must set the node address number for each slave drive for
communication.

Specifications:

Item GEM COSMOS


✓ Interface RS-485 RS-485, RS-422
✓ Communication speed 1.2, 2.4, 4.8, 9.6, 19.2, 38.4, 1.2; 2.4; 4.8; 9.6; 19.2; 38.4;
57.6, 76.8, 115.2 kbps 57.6; 76.8; 115.2 kbps
✓ Data length 8-bit (fixed) 8-bit (fixed)
✓ Parity Odd, Even, None Odd, Even, None
✓ No. of Slaves 31 31
✓ Interface RTU RTU
Table 1: Specification

Terminal Connections in YASKAWA drives related to Modbus Communication:

Fig. 1 MODBUS connection terminals in GEM series Fig. 2 MODBUS connection in COSMOS series

3.2 SETTING UP OF DRIVE


➢ Connection of drives to Master
• The wiring diagram for Master- slave GEM series and COSMOS series is shown in Fig.
3 and Fig. 4 respectively. Switch S2 (termination resistor) must be enabled for last
drive in the communication series.
E.g. When 3 drives are connected as slaves, the S2 of the third drive should be ON
(Refer Fig. 3/4/5).

❖ Note: Use shield cable for communications.

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


27

MODBUS/MEMOBUS COMMUNICATION

Fig 3: RS-485 connection in GEM series

Fig. 4: RS-485 connection in COSMOS series Fig. 5: RS-422 connection COSMOS series

➢ Set the Basic parameters in the drive

Parameter Description Value


b1 – 01 or b1-15 Frequency reference 2
selection
b1 – 02 or b1-16 Run command selection 2
H5-01 Node address 1 (any)
Table 2: Basic parameters

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


28

MODBUS/MEMOBUS COMMUNICATION

➢ Secondary parameters which has to be set as per customer requirement

H5-02 Communication Speed Selection


H5-03 Communication Parity Selection
Stopping Method After Communication Error (CE)
H5-04
Communication Fault Detection Selection
H5-05
H5-06 Drive Transmit Wait Time
H5-09 CE Detection Time
Communications ENTER Function Selection
H5-11
H5-12 Run Command Method Selection
Table 3: Parameters

❖ Note: Once all communication parameters are set, drive power recycle has to be done.

3.3 VERIFYING COMMUNICATION WITH MODSCAN (OR PC)


➢ Open a licenced Modscan32.
Note: If the modscan32 or 64 is not licenced, it automatically disconnects the drive after 3
minutes.
➢ Choose Length as 10
➢ MODBUS Point type as HOLDING REGISTER (function code: 03)

Fig.: 6 Setting Modscan

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


29

MODBUS/MEMOBUS COMMUNICATION

➢ Connect USB to RS 485 converter to PC


➢ Go to Connection > Connect

Parameter H5-01

Fig.7: Setting Modscan

➢ Set COM Port


Note: Go to Device manager > Ports to find your COM port of PC

Parameter H5-02

Parameter H5-03

Fig.8: Setting Modscan

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


30

MODBUS/MEMOBUS COMMUNICATION

➢ These are data types options in Modscan. Choose Binary for controlling the drive and
Choose Decimal for giving frequency command.
Note: Any data types can be used if corresponding converted values are known.
➢ Go to address 0002 and enable bit-0 to start the drive. Refer control word table below for
other operations in control word byte.

Data types

Control word bits

Fig.9: Controlling the drive

➢ Change data type to decimal. Double click on address 0003 and enter desired frequency
reference.

3.4 CONTROL AND STATUS WORD


3.4.1 CONTROL WORD

Drive/Address Modscan Byte Bit Description


(Hex) address
0 Forward Run = 1;
Stop = 0
1 Reverse Run
2 External Fault
0 3 Reset
4 Multifunction input 1
0001 0002 5 Multifunction input 2
(1)
6 Multifunction input 3
7 Multifunction input 4
8 Multifunction input 5
1 9 Multifunction input 6
A Multifunction input 7
B Multifunction input 8
C to F Reserved
➢ Table 4: Control Word

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


31

MODBUS/MEMOBUS COMMUNICATION

3.4.2 FRECQUENCY CONTROL


Word/ Address Modscan Value Frequency
(Hex) address
0002 0003 2500 25Hz
(2) 5000 50Hz
Table 5: Frequency control

Fig.10: To change frequency

3.4.3 STATUS WORD

Word/Address Modscan Byte Bit Description


(Hex) address
0 During Run
1 During Reverse Run high.
Forward low
2 Drive Ready
0 3 During Fault
0032 0033 4 Data setting error
(0020) 5 Multifunction Digital output 1
6 Multifunction Digital output 2
7 Multifunction Digital output 3
8 to B Reserved
1 C Safe Torque Off Hardware
D Safe Torque Off
E Communication Ref Status
F Communication Control Status
Table 11: Status Word

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


32

MODBUS/MEMOBUS COMMUNICATION

Status word bits

Fig.11: Status word monitoring

3.4.4 EXAMPLE FOR MONITOR VALUES


Drive address Modscan Parameter Monitor
Address
35 (23) 0036 U1-01 Reference frequency
36 (24) 0037 U1-02 Output frequency
37 (25) 0038 U1-06 Output voltage ref
38 (26) 0039 U1-03 Output current
39 (27) 0040 U1-08 Output power
40 (28) 0041 U1-09 Output Torque
41 (29) 0042 U1-07 DC BusVoltage
Table 12: Monitor Values

The figure 12 shows the values of a drive-in respective addresses:


✓ Ref Frequency: 50Hz
✓ Output Frequency: 40.02Hz
✓ Output Voltage: 334.3V
✓ Motor current: 1.3A
Note: Appropriate scaling has to be done.

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


33

MODBUS/MEMOBUS COMMUNICATION

Fig.12: Monitoring drive running values

NOTE: When Slave is Not Responding


In the following situations, the slave drive will ignore the command message sent from the master,
and not send a response
message:
1. When a communications error (overrun, framing, parity or CRC-16) is detected in the
command message.
2. When the slave address in the command message and the slave address in the drive do not
match (remember to set the slave address for the drive using H5-01).
3. When the gap between two blocks (8 bit) of a message exceeds 24 bits.
4. When the command message data length is invalid.
5. If the slave address specified in the command message is 00H, all slaves execute the write
function, but do not return response message to the master.

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


34

MODBUS/MEMOBUS COMMUNICATION

3.5 SUPPORTED FUNCTION CODES

Table 13 Supported function codes

3.5.1 Example Function code: 5A (5AH) Writing/Reading to Multiple holding registers


This function code writes/reads the contents of four holding registers at the same time. The four
holding registers to be read from are specified in H5-25 to H5-28 [Function 5A Register x Selection].

Fig 13 Set up for Function code 5A in Modscan

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


35

MODBUS/MEMOBUS COMMUNICATION

The following monitor values are set in drive

➢ The drive for slave 1 is set for Forward run with a frequency reference of 50.00 Hz.
➢ The setting in H5-25 to H5-28 and the data in the specified holding registers are as follows.
• H5-25 = 0044H: U1-05 [Motor Speed]
• H5-26 = 0045H: U1-06 [Output Voltage Ref]
• H5-27 = 0042H: U1-03 [Output Current]
• H5-28 = 0049H: U1-10 [Input Terminal Status]

Messaging example when reading from more than one holding register/reading the registers

Table 14 Message addressing example

Covert these to decimals to get actual monitor values

Fig 14 Reading with 5A function code

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION


36

MODBUS/MEMOBUS COMMUNICATION

Value Observed
HEX Value Observed Value Observed
MONITORS (in Hexadecimal)
ADDRESS (in Decimal) (in Drive Monitors)
-Modscan
Output
44 1387H 4999 50.01 Hz
Frequency
Output
45 0D0BH 3339 333.6 VAC
Voltage
DC Bus
31 022EH 558 561 VDC
Voltage
Output
26 000DH 13 1.26 A
current
Table 15 Monitor values for above example

YASKAWA AC DRIVES MODBUS RTU COMMUNICATION

You might also like