PLC To VFD Communication Examples
PLC To VFD Communication Examples
12.1
Control Purpose:
z
Repeatedly reading the master frequency and output frequency of VFD-M series AC motor
drive then store them in D0 and D1 by MODRD instruction.
Repeatedly setting the running direction and running frequency by MODWR instruction. For
example, setting the AC motor drive to run forward in 40Hz.
Set value
Explanation
P00
03
P01
03
P88
01
Communication address: 01
P89
01
P92
01
If AC motor drive can not run normally due to improper parameters, users can set P76 = 10
(factory defaults) and then set the parameters according to the above table.
Devices:
Device
Function
M0
M1
M2
D10
D11
Control Program:
M1002
MOV
H86
SET
M1120
MOV
K100
RST
M1143
D1120
Set communication
format: 9600, 7, E,1l
LD=
C0
K0
M0
LD=
C0
K1
M1
LD=
C0
K2
M2
LD=
C0
K3
RST
C0
12-5
M1122
MODRD
K1
Sending request
M1
M2
M0
M1
K2
M2
H2102
K1
H2000
D10
K1
H2001
D11
C0
RST
M1127
CNT
C0
RST
M1129
CNT
C0
RST
M 1140
CNT
C0
RST
M1141
MOV
D1050
K10
M1129
M1140
M1141
C0 counts once
when data receiving
is completed.
K10
C0 counts once
when communication
timeout occurs.
C0 counts once
when parameter error
occurs.
.
Reset the flag M1141
K10
M1000
D0
D1051
D1
Program Description:
z
12-6
Initialize PLC RS-485 communication port and set the communication format as MODBUS
DVP-PLC Application Examples
There are only 4 situations for MODBUS communication: flag M1127 for normal
communication and M1129, M1140, M1141 for communication errors. Counter C0 counts
once when any of the 4 flags is ON. Therefore, the program assures the communication
reliability by monitoring the On/Off status of the 4 flags and performs 3 MODBUS
instructions in order by the value in counter C0.
When M0 = ON, [MODRD K1 H2102 K2] instruction will be executed. PLC will read the
master frequency and output frequency of AC motor drive, store them in D1073~1076 in
ASCII format, and automatically convert the content in D1073~1076 into hexadecimal
values to D1050 and D1051.
When M1 = ON, [MODWR K1 H2000 D10] instruction will be executed. D10 = H12 and the
drive will run forward. The running direction can be changed by the content in D10.
When M2 = ON, [MODWR K1 H2001 D11] instruction will be executed. D11 = K4000 and
the drive running frequency will be 40Hz. The frequency can be changed by the content in
D11.
On the bottom of this program, [MOV D1050 D0] instruction stores the master frequency of
the drive in D0, and [MOV D1051 D1] instruction stores the output frequency of the drive in
D1.
Once PLC starts running, the read/write actions for AC motor drive will be performed
repeatedly according to [LD=] instructions.
12-7
12.2
Control Purpose:
z
Repeatedly reading the master frequency and output frequency of VFD-B series AC motor
drive by MODRD instruction.
Start AC motor drive in reverse direction when Start is pressed. Increase 1Hz per second
until it reaches 50Hz. Maintain the frequency at 50Hz. (MODWR instruction)
Set value
Explanation
02-00
04
02-01
03
09-00
01
Communication address: 01
09-01
02
09-04
03
If AC motor drive can not run normally due to improper parameters, users can set P00-02 =
10 (factory defaults) and then set the parameters according to the above table.
Devices:
Device
X0
X1
Function
Start button for the drive
Stop button for the drive
M0
M1
M2
Control Program:
M1002
12-8
MOV
H99
SET
M1120
MOV
K100
SET
M1143
D1120
Set communication
format: 19200, 8, N, 2
RST
D2
RST
D10
H22
SET
M10
MOV
H1
RST
M10
RST
D2
ADD
D2
D10
M1013 M11
D10
M10
K100
D2
LD>=
D2
K5000
M11
LD=
C0
K0
M0
LD=
C0
K1
M1
LD=
C0
K2
M2
LD=
C0
K3
RST
C0
SET
M1122
MODRD
K1
M0
Sending request
M1
M2
M0
H2102
K2
D10
K1
H2001
D2
H2000
M1127
K1
M1127
12-9
C0
RST
M1129
CNT
C0
RST
M1140
CNT
C0
RST
M1141
K10
C0 counts once
when communication
timeout occurs.
M1140
K10
C0 counts once
when data receiving
error occurs.
M1141
K10
C0 counts once
when parameter err or
occurs.
Program Description:
z
Initialize PLC RS-485 communication port and set the communication format as MODBUS
RTU, 19200, 8, N, 2. The RS-485 communication format of AC motor drive should be the
same with PLC.
There are only 4 situations for MODBUS communication: flag M1127 for normal
communication and M1129, M1140, M1141 for communication errors. Counter C0 counts
once when any of the 4 flags is ON. Therefore, the program assures the communication
reliability by monitoring the On/Off status of the 4 flags and performs 3 MODBUS
instructions in order by the value in counter C0.
When M0 = ON, [MODRD K1 H2102 K2] instruction will be executed. PLC will read the
master frequency and output frequency of AC motor drive, store them in D1073~1076 in
ASCII format, and automatically convert the content in D1073~1076 into hexadecimal
values to D1050 and D1051.
When M1 = ON, [MODWR K1 H2000 D10] instruction will be executed. D10 = H22 and the
drive will run in reverse. If D10 = H1, the drive will be stopped.
When M2 = ON, [MODWR K1 H2001 D2] instruction will be executed. The frequency can be
changed by the content in D2.
Once PLC starts running, the read/write actions for AC motor drive will be performed
repeatedly according to [LD=] instructions.
12-10
12.3
Control Purpose:
z
Repeatedly reading the master frequency and output frequency of VFD-V series AC motor
drive by MODRD instruction.
Setting the drive to run forward in 30Hz by MODRW instruction when X0 is pressed.
Setting the drive to run in reverse in 20Hz by MODRW instruction when X1 is pressed.
Set value
Explanation
00-20
00-21
09-00
01
Communication address: 01
09-01
9.6
09-04
02
If AC motor drive can not run normally due to improper parameters, users can set P00-02 =
10 (factory defaults) and then set the parameters according to the above table.
Devices:
Device
Function
X0
Forward
X1
Reverse
X2
Stop
M0
M1
Control Program:
M1002
MOV
H86
SET
M1120
MOV
K200
RST
M1143
ZRS T
D0
D1120
Set communication
format: 9600, 7, E , 1
12-11
H12
D0
MOV
K3000
D1
MOV
K22
D0
MOV
K2000
D1
MOV
H1
D0
X1
Run in reverse in 20Hz
when X1 = ON
X2
Stop when X2 = ON
RST
D1
LD=
C0
K0
M0
LD=
C0
K1
M1
LD=
C0
K2
RST
C0
SET
M1122
MODRD
K1
M0
Sending request
M1
M0
H2102
M1
MODRW
K1
K16
H2000
D0
K2
M1127
RST
M1127
MOV
D1050
D2
MOV
D1051
D3
CNT
C0
K10
RST
M1129
M0
M1129
12-12
K2
C0 counts once
when communication
timeout occurs.
C0
RST
M1140
CNT
C0
RST
M1141
K10
C0 counts once
when data receiving
error occurs.
M1141
K10
C0 counts once
when parameter error
occurs.
Program Description:
z
Initialize PLC RS-485 communication port and set the communication format as MODBUS
RTU, 19200, 8, N, 2. The RS-485 communication format of AC motor drive should be the
same with PLC.
Reset D0 and D1 when PLC is powered up so as to ensure the drive is in the Stop status
When X0 is activated, the drive will run forward (D0 = H12) in 30Hz (D1 = 3000).
When X1 is activated, the drive will run in reverse (D0 = H22) in 20Hz (D1 = K2000)
There are only 4 situations for MODBUS communication: flag M1127 for normal
communication and M1129, M1140, M1141 for communication errors. Counter C0 counts
once when any of the 4 flags is ON. Therefore, the program assures the communication
reliability by monitoring the On/Off status of the 4 flags and performs 2 MODBUS
instructions in order by the value in counter C0.
The master frequency and output frequency stored in D1050 and D1051 will be sent to D2
and D3.
Once PLC starts running, the read/write actions for AC motor drive will be performed
repeatedly according to [LD=] instructions.
12-13