Advance PLC Programming Course V2019 Chapter 02 PDF
Advance PLC Programming Course V2019 Chapter 02 PDF
Advance PLC
Summary of Contents
Programming Course Chapter 2
-V 2019
1—1
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
1. INTRODUCTION
Be sure to properly set/configure/install the basic Electrical wiring and jumpers, and
Parameters needed for the Drive to control and operate the motor/load. The
Reference should be in unit RPM with a range of 0 to 1675 RPM.
1—2
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
2. VLT FC301/FC302
12-pulse drive
• 3 x 380-500 V...250 kW – 1 MW
• 3 x 525-690 V...250 kW – 1.4 MW
2—3
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
2—4
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
2.2 Technical Overview
Single master
Profibus DP V0
Multiple master
Profibus DP V1
• Initiate / Abort acyclical connection
• Acyclical read/write on parameters
The PROFIBUS DP extension DP V1 permits acyclical as well as cyclical data communication. This
feature can be used by a DP master class 1 (e.g. PLC), as well as a DP master class 2 (e.g. PC tool).
2—5
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
3. INSTALLATION
Instructions:
3—6
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
3.2 Connecting the Bus Line
6ES7 972-0BA41-0XA0
Terminal A1 = Green Wire (Siemens A)
Terminal B1 = Red Wire (Siemens B)
DP/MPI Port
Siemens PLC
3—7
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
3.3 Configure the PROFIBUS Network
All PROFIBUS stations that are connected to the same bus network must have a unique station
address.
Using the hardware switches, it is possible to select an address range from 0 to 125 (factory
setting 127) according to the table below:
Node address “5” will be used for the purpose of this manual.
3—8
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
4. DRIVE CONFIGURATION AND PROGRAMMING
4.1 Drive Parameter Configuration using Option A (MCA 101) for PROFIBUS
3
2
1
1. Par. 0-** Operation / Display → 0-2* LCP Display → 0-20 Display Line 1.1 Small
Set the value to: “[1613] Frequency”
2. Par. 0-** Operation / Display → 0-2* LCP Display → 0-21 Display Line 1.2 Small
Set the value to: “[1614] Motor Current”
3. Par. 0-** Operation / Display → 0-2* LCP Display → 0-22 Display Line 1.3 Small
Set the value to: “[1610] Power [kW]”
4. Par. 0-** Operation / Display → 0-2* LCP Display → 0-23 Display Line 2 Large
Set the value to “[1617] Speed [RPM]”
5. Par. 0-** Operation / Display → 0-2* LCP Display → 0-24 Display Line 3 Large
Set the value to “[1617] Reference [Unit]”
Node Address of
the Drive
4—9
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
4.1.3 Configure Par. 8-01 Control Site
Notice the “!Fieldbus fault [W34]”, this happens when there’s no PROFIBUS Master
device communicating with the Drive. This fault/warning will be resolved under topic
5 PLC Programming PLC.
4—10
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
4.1.6 Configure Par. 3-15 Reference Resource 1
4—11
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5. PLC PROGRAMMING
In order to configure a PROFIBUS Master device, the configuration tool needs a GSD (General
Station Description) file for each type of slave on the network.
The GSD file is a “standard” text file containing the necessary communications setup data for a
slave.
1
Extract the downloaded .zip file and copy the extracted folder to your Desktop to
browse/locate the file easily during the GSD installation.
5—12
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
Follow the steps below;
1
1. Install the GSD file in the Hardware
Configuration tool. Click the
“Options” tab.
2. Select and click “Install GSD File…”.
3. Under “Install GSD Files” window, 2
Click the “Browse …” button and
locate the folder “\Desktop\VLT_
PROFIBUS_GSD_2010-11
-03\Danfoss Drives GSD 3
Files\FC 100 200 300”
4. Click to highlight the file
“DA02040A.gsd” on the file
selection panel.
5. Click “Install”.
6. Click “OK”. 4
5—13
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.1.2 Inserting the Drive
5—14
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.1.3 Inserting PPO (Parameter Process data Objects) Type
5
8 6
10 7
9
5—15
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
Different PPO Type can be selected depending on the application of the project or the range of
data needed by the programmer for data collection, to and from the Drive via PROFIBUS protocol.
In this manual, only the basic data to control the Drive via PROFIBUS will be covered.
These data are listed below:
The Input and Output area of “PPO Type 3 Word Consistent PCD” have the following
configuration:
5—16
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5—17
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.1.4 Parameter Assignment.
MAV
(Main Actual Value)
MRV
(Main Reference Value)
5—18
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
When the PLC download is completed, the “!Fieldbus fault [W34]” warning will go off. This
means that the PROFIBUS communication between the PLC and the Drive is now active and
enabled.
5—19
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2 Ladder Programming
Add the Function for the ladder logic as per information below;
1 2
5—20
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.2 Add Data Block (DB) for Writing and Reading data on VFD
Add 3 Data Blocks as storage data for VFD – PLC Data Mapping and Control.
1. Name : DB101
Symbolic Name : VFD PROFIBUS IO Transfer
2. Name : DB102
Symbolic Name : VFD PROFIBUS Write
3. Name : DB103
Symbolic Name : VFD PROFIBUS Read
2
3
5—21
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
Configure DB102 – VFD PROFIBUS Write
This DB will be the data storage to control/write the Drive’s;
• MRV (Main Reference Value) – Speed Setpoint in unit RPM.
• CTW (Control Word) - Start and Stop command of the motor/load.
• The highlighted “Initial value” is 650.0 in Floating Point data format. Every time DB102 is
initialized, the PLC will send 650 in RPM unit to the drive as an initial speed setpoint by
default.
• Leave +0.0 DB_VAR(INT) as is.
5—22
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.4 Transfer VFD PPO Address to DB101 – VFD PROFIBUS IO
Using FC101- VFD PROFIBUS IO Transfer, program the Ladder Logic as per illustration below;
5—23
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.5 Sending Main Reference Value [MRV] (Speed Setpoint RPM) to the Drive
The MRV(Main Reference Value) in unit RPM, is mapped to the PLC Output address
“PQW258”.
The PLC setpoint MRV data (0.0 to 1675.0 RPM) is unscaled to Raw Data (PQW258) with 0 to
16384 in Decimal range. In this manual, the range of the Drive’s MRV is set to 0 to 1675 in unit
RPM.
In the Simatic Manager, there is no standard FB’s or FC’s to Unscale the PLC Setpoint MRV (0 to
1675) to Raw Data (PQW258) with 0 to 16384 in Decimal range.
The solution is to Unscale the data manually using the equation below;
Using “FC102”, the figure below shows the derivation of the equation above in Ladder Logic;
5—24
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
Tags and Symbols
3
2 4 5
16384.0
1675.0
Memory DWord MD100 and MD104 are used as Data Buffers (way of storing output data from
Logic Instructions). There are tons of different approach in using Data Buffers depends on the
knowledge and mindset of the Programmer. For the purpose of this manual, using the Memory
address is much of an easier approach.
5—25
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.6 Receiving Main Actual Value [MAV] (Speed Feedback RPM) from the Drive
The MAV(Main Actual Value) in unit RPM, is mapped to the PLC Input address
“PIW258”.
The Raw Data (PIW258) with 0 to 16384 in Decimal range, is scaled to PLC reference MAV with
0.0 to 1675.0 in unit RPM. In this manual, the range of the Drive’s MAV is set to 0 to 1675 in unit
RPM.
In the Simatic Manager, there is no standard FB’s or FC’s to Scale the Raw Data (PIW258) with 0
to 16384 to PLC reference MAV with 0.0 to 1675.0 in unit RPM.
The solution is to Scale the data manually using the equation below;
PMAV : PLC ref Main Actual HI_Lim : Max Reference (1675 RPM)
Value K2 : Max Raw Data (16384)
In : Input
Using “FC102”, the figure below shows the derivation of the equation above in Ladder Logic;
5—26
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
Tags and Symbols
1 4
2
1675.0
16384.0
5—27
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.7 Reading the Drive’s Status – STW (Status Word)
The Hex value of 0F07 sent from the Drive to the PLC indicates;
1. The Drive/Control is ready and enabled.
2. No errors and warnings.
3. In operation or the motor/load is running in normal operation.
4. The motor is running in correct speed as per Speed Reference/Setpoint.
5. PIW256 receives a value of “W#16#0F07” in Siemens Hex Word format.
5—28
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
The Drive sends data to the PLC in “Little Endian” data order.
There are two types of data order (Endianness) used in computing/programming;
1. Big Endian – ordering places the most significant byte first and the least significant byte
last.
2. Little Endian – ordering places the least significant byte first and the most significant byte
last.
The data transfer from the Drive to the PLC in “Little Endian” data order is illustrated below;
STW (Status Word) FC Profile
Byte Order Bit Bit value Hex Value
00 1
01 1
02 1 7
Least 03 0
Significant 04 0
Byte 05 0
06 0 0
07 0
08 1
09 1
Most 10 1 F
Significant 11 1
Byte 12 0
13 0
14 0 0
15 0
Hex Value 0 F 0 7
Bit Value 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1
Bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Hex Value 0 F 0 7
Siemens Word Value W#16#0F07
(Hex)
PLC Address PIW256
The Drive sends the Least Significant Byte first and the Most Significant Byte last. In short, the
data transfer is in “Little Endian” data order since the increasing memory direction is from right
to left.
5—29
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
In the PLC, the order and placement of Bits in a Word (2 Bytes, 16 Bits) is in “Big Endian” data
order. This is the opposite of the Drive’s data order.
The illustration below shows the data order of Bits in a Word in Siemens Standard.
Address PIW256
Hex Value W#16#0F07
0 F 0 7
Binary Value 0000 1111 000 0111
Hex Value 0 F 0 7
Bit Value 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1
PIW256 in Bits 256.7 256.6 256.5 256.4 256.3 256.2 256.1 256.0 257.7 257.6 257.5 257.4 257.3 257.2 257.1 257.0
Byte Order Least Significant Byte Most Significant Byte
The illustration below shows the final data mapping from the Drive’s Status Word(STW) to
PIW256 by Bits.
The tabulation of data in Siemens PLC, the Least Significant Byte is always placed in the upper
part of the table, while Most Significant Byte seats in the lower part. This contrasts the data
order in Siemens standard and can cause confusion in data tracing and data mapping.
5—30
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
To visualize the data in the PLC data table the same as the representation of the Data mapped
from the Drive, a simple solution is to swap the Least Significant and Most Significant Bytes of
PIW256.
Using FC102, follow the steps below to execute the idea above into Ladder logic;
STW (Status
Word) FC DB103.DBB6
Profile PIW256 → DB101.DBW2
Byte Bit Bit PIW256 DB101.DBW2
Order No.
00 0.0
01 0.1
02 0.2
Least 03 0.3
Significant 04 0.4 IB256 DB101.DBB2
Byte 05 0.5
06 0.6
07 0.7
08 1.0
09 1.1
Most 10 1.2
Significant 11 1.3
Byte 12 1.4 IB257 DB101.DBB3
13 1.5
14 1.6
15 1.7
5—31
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5. Add “Network 4” 5
6. Insert “MOVE” instruction in the Rung.
7. Input “DB101.DBB2” address in the “IN”
attribute. 6
This means that the Source Block is the Least 0
Significant Byte of “DB101.DBW2”
(“PIW256_VFD_STW).
8. Input “DB103.DBB7” in the “OUT” attribute.
This means that the Destination Block is 7 8
“DB103.DBB7”.
STW (Status
Word) FC DB2.DBB7
Profile PIW256 → DB101.DBW2
Byte Bit Bit PIW256 DB101.DBW2
Order No.
00 0.0
01 0.1
02 0.2
Least 03 0.3
Significant 04 0.4 IB256 DB101.DBB2
Byte 05 0.5
06 0.6
07 0.7
08 1.0
09 1.1
Most 10 1.2
Significant 11 1.3
Byte 12 1.4 IB257 DB101.DBB3
13 1.5
14 1.6
15 1.7
5—32
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
The illustration below shows the result data mapping of STW (Status Word) from Drive’s Data
Table to PLC Data Block.
DB103.DBW6
STW (Status Word) FC Profile
Byte Bit Bite value = 0 Bit value = 1
Order
00 Control not ready Control ready
01 Drive not ready Drive ready
02 Coasting Enable
Least 03 No error Trip
Significant 04 No error Error (no Trip)
Byte 05 Reserved -
06 No error Triplock
07 No warning Warning
08 Speed ≠ Reference Speed = Reference
09 Local operation Bus control
Most 10 Out of frequency limit Frequency limit OK
Significant 11 No operation In operation
Byte 12 Drive OK Stopped, autostart
13 Voltage OK Voltage exceeded
14 Torque OK Torque exceeded
15 Timer OK Timer exceeded
5—33
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
5.2.8 Start and Stop Command
Start Command
To start the drive, sending Hex value of 047C will start the drive with the transmitted reference,
as shown below;
Stop Command
To stop the drive, sending Hex value of 043C will stop the drive with the transmitted reference,
as shown below;
5—34
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
To implement Start – Stop Command in Ladder Logic,
Using “FC102”, follow the steps below;
1. Add “Network 5” and program the Ladder Logic as illustrated below (Start-Stop with
Interlocks);
1 2 3 4 5 6
5—35
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
2. Add “Network 6” and program the Ladder Logic as illustrated below (Starting the Drive”);
W#16#47C
(Hex Value 047C
to Start the Drive)
W#16#43C
(Hex Value 047C
to Start the Drive)
5—36
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
6. HMI TESTING
Testing and commissioning
Steps:
1. Checking of the Profibus DP node addressing
2. Running the VFD by Local Control
3. I/O checking from field terminals to Software
4. Checking of the peripheral I/O addressing transfer function to Data Block
5. Checking of the VFD Start.Stop Function
6. Controlling and monitoring the VFD via pre-programmed HMI Simatic Multi Panel
12” Touch MP377.
6—37
VERSION 2019
ADVANCED PLC PROGRAMMING - SIEMENS S7-300 + Danfoss FC300 VFD
VLT® AutomationDrive FC 301 / FC 302 + PROFIBUS DP MCA 101
6—38
VERSION 2019