Copyright © 2014 Moxa Inc. Released on December 26, 2014 About Moxa
Moxa is a leading manufacturer of industrial networking, computing, and automation solutions. With over 25 years of industry experience, Moxa has connected more than 30 million devices worldwide and has a distribution and service network that reaches
customers in more than 70 countries. Moxa delivers lasting business value by empowering industry with reliable networks and sincere service for automation systems. Information about Moxa’s solutions is available at www.moxa.com. You may also contact Moxa by email at [email protected].
How to Contact Moxa Tel: +886-2-8919-1230 Fax: +886-2-8919-1231
Moxa Technical Support Team [email protected]
Contents
1
Application Description ... 3
1.1 Objective ... 3 1.2 Goals ... 32
System Topology ... 3
3
Hardware and Software Requirements ... 4
4
Configuration ... 5
4.1 Hardware Installation ... 5 4.2 PowerFlex 4M Settings ... 6 4.3 IAQPoint2 Settings ... 7 4.4 MGate 4101-MB-PBS Settings ... 75
Configuring Siemens PLC ... 12
5.1 Creating the STEP 7 project ...12
5.2 Inserting a Station ...13
5.3 Configuring Hardware ...14
5.4 Creating a PROFIBUS network...17
5.5 Installing the GSD file ...20
5.6 Configuring the PROFIBUS Slave ...22
5.7 Configuring I/O Modules ...23
5.8 Editing Symbols ...24
Copyright © 2014 Moxa Inc. Page 2 of 35
5.10 Downloading Configuration ...25
6
Step 7 Ladder Programming ... 27
6.1 Editing OB1 ...27
7
Communication Test: Monitor Program ... 31
8
Appendix ... 32
8.1 PowerFlex 4M Modbus Registers ...32
Copyright © 2014 Moxa Inc. Page 3 of 35
1 Application Description
1.1 Objective
This document describes an application using Siemens PLC with MGate 4101-MB-PBS.
In this application, Siemens PLC is used to get input data that MGate 4101-MB-PBS polls from the temperature meter through Modbus Register. Siemens PLC evaluates the temperature value and outputs data to MGate 4101-MB-PBS, which then uses the data to control speed.
1.2 Goals
In this document, you will learn the following: • Configure Siemens PLC.
• Configure MGate 4101-MB-PBS to communicate with a Modbus RTU device. • Set up MGate 4101-MB-PBS in SIMATIC Step 7.
• Create a basic Step 7 Ladder Programming.
• Industrial field applications and the job of each role.
2 System Topology
The following figure shows a system architecture in which the Modbus end devices, PowerFlex 4M and IAQPoint2, are connected to the serial port on MGate 4101-MB-PBS through RS-485-2W wiring. MGate 4101-MB-PBS is connected to the PROFIBUS port on Siemens PLC via a PROFIBUS cable. PC (running SIMATIC Step 7) is connected to an Ethernet switch port on Siemens PLC via an Ethernet cable. A fan is connected to PowerFlex 4M, which powers the fan.
Copyright © 2014 Moxa Inc. Page 4 of 35
3 Hardware and Software Requirements
Siemens SIMATIC S7-300 PLC − Processor: CPU 315-2 PN/DP
− Article Number: 6ES7315-2EH14-0AB0 − Version:3.2.7
MGate 4101-MB-PBS
− Firmware Version: Ver1.3_Build_14031018 − EDS File: MPBS0D80.gsd
PowerFlex 4M
PowerFlex 4M is an adjustable frequency AC drive that is used to drive the fan in this application.
IAQPoint2
IAQPoint2 is an indoor air quality monitor. It can detect CO2, temperature, and humidity
PC (SIMATIC Step 7)
MGate 4101-MB-PBS
Power Flex 4M
IAQPoint2
Information
Level
Control
Level
Device
Level
Fan
Ethernet
PROFIBUS RS-485-2WSiemens S7 PLC
CPU 315-2 PN/DP
Copyright © 2014 Moxa Inc. Page 5 of 35 levels.
SIMATIC Step7
Siemens PLC Engineering Software released by Siemens AG. − Version : V5.5+SP3
MGate Manager
Software utility to configure a Moxa MGate device. − Version : 1.9
4 Configuration
4.1 Hardware Installation
PowerFlex 4M and IAQPoint2 Connection − RS-485-2W wiring − Pin assignment
4
5
3
4
5
6
Modbus Port
Copyright © 2014 Moxa Inc. Page 6 of 35 PLC Connection
4.2 PowerFlex 4M Settings
Serial Port Settings − Baudrate: 38400
− Set on panel: Command C302 (Comm Data Rate), option 5 Options 0“1200” 1“2400” 2“4800” 3“9600” (Default) 4“19.2K” 5“38.4K”
− Data bit, Parity, Stop bit :8-E-1
− Set on panel: Command C306 (Comm Format), option 1 Options 0“RTU 8-N-1” (Default)
1“RTU 8-E-1” 2“RTU 8-O-1” 3“RTU 8-N-2” 4“RTU 8-E-2” 5“RTU 8-O-2”
PC (SIMATIC Step 7)
MGate 4101-MB-PBS
Siemens S7 PLC
CPU 315-2 PN/DP
PROFIBUS Cable
Ethernet Cable
Copyright © 2014 Moxa Inc. Page 7 of 35
Programmable Settings − Start Source: Modbus port
− Set on panel: Command P106 (Start Source), option 5 Options 0 “Keypad” (Default)
1 “3-Wire” 2 “2-Wire” 3 “2-W Lvl Sens” 4 “2-W Hi Speed” 5 “Comm Port”
− Speed Reference: Modbus port
− Set on panel: Command P108 (Speed Reference), Option 5 Options 0 “Drive Pot” (Default)
1 “InternalFreq” 2 “0-10V Input” 3 “4-20mA Input” 4 “Preset Freq” 5 “Comm Port”
− Modbus Slave ID Setting: 100 (default)
4.3 IAQPoint2 Settings
Serial Port Settings
Use the touch panel (the default access password is 2967) to configure the following settings for the serial port:
− Baudrate: 38400 − Parity: Even (Default)
− Address (Slave ID): 1 (Default)
4.4 MGate 4101-MB-PBS Settings
Assigning a PROFIBUS Address
Before a PROFIBUS slave can communicate with a PROFIBUS master, you must assign an address to the PROFIBUS slave. Make sure that you assign the same address that you set
Copyright © 2014 Moxa Inc. Page 8 of 35 in the STEP 7 project.
You can use the rotary switch (as shown in the following figure) to set an address that is between 0 and 99. To assign an address larger than 99, use the MGate Manager.
Device Configuration Using MGate Manager
This section shows you how to configure MGate 4101-MB-PBS.
Copyright © 2014 Moxa Inc. Page 9 of 35 2. Start MGate Manager and search for the device.
Copyright © 2014 Moxa Inc. Page 10 of 35 4. Select the Modbus tab and configure the fields as shown in the following figure.
Copyright © 2014 Moxa Inc. Page 11 of 35 5. Select the PROFIBUS tab. The screen displays the address value that you set using
the rotary switch.
6. Select the IO Mapping tab and configure the fields as shown in the following figures. − Modbus Commands
Note: For more information on Modbus registers for PowerFlex and IAQPoint 2, refer to the appendix.
Copyright © 2014 Moxa Inc. Page 12 of 35 − IO Module
7. Click OK.
MGate 4101-MB-PBS automatically restarts to make the changes take effect.
5 Configuring Siemens PLC
Follow the procedures in this section to configure Siemens PLC.
5.1 Creating the STEP 7 project
Start SIMATIC Manager and create a new project. Click File > New. Then, set the project name in the Name field and click OK.
Copyright © 2014 Moxa Inc. Page 13 of 35
5.2 Inserting a Station
In SIMATIC Manager, click Insert > Station and select to insert SIMATIC 300 Station into the project.
Copyright © 2014 Moxa Inc. Page 14 of 35
5.3 Configuring Hardware
5.3.1 Adding a Rack
1. In SIMATIC Manager, double-click Hardware.
2. The HW Config screen appears. Click Insert > SIMATIC 300 > RACK > Rail to insert the rack object
Copyright © 2014 Moxa Inc. Page 15 of 35 The following figure shows the HW Config screen after adding the rack object.
Copyright © 2014 Moxa Inc. Page 16 of 35 5.3.2 Adding a CPU
You must add the appropriate CPU module to the STEP7 project based on the actual hardware model. In this example, CPU 315-2 PN/DP is the hardware model. In the HW Config screen, drag the selected CPU module to the table.
Copyright © 2014 Moxa Inc. Page 17 of 35
5.4 Creating a PROFIBUS network
1. Double-click MPI/DP to configure the PROFIBUS DP module.
2. In the Properties screen, in the Interface area, select PROFIBUS from the Type drop-down list box and click Properties.
Copyright © 2014 Moxa Inc. Page 18 of 35 3. Click the Parameters tab to set the address for the PROFIBUS master. Select a value
from the Address drop-down list. Then, click New to create a new subnet.
4. In the Network Settings tab, select an option for the Transmission Rate setting and select DP for the Profile setting; then, click OK.
Copyright © 2014 Moxa Inc. Page 19 of 35 5. In the Operating Mode tab, select the DP master operating mode and click OK.
Copyright © 2014 Moxa Inc. Page 20 of 35 The following figure shows an example screen that indicates that the PROFIBUS network is configured successfully.
5.5 Installing the GSD file
For engineering and configuration purposes, you must install a device GSDML file using the SIMATIC Manager.
Copyright © 2014 Moxa Inc. Page 21 of 35 2. In the Install GSD Files screen, click Browse to navigate to the folder and select the
Copyright © 2014 Moxa Inc. Page 22 of 35 If the GSD file is installed successfully, the system displays Moxa PROFBUS Slave in the hardware catalog list.
5.6 Configuring the PROFIBUS Slave
1. In the HW Config screen, select and drag the Moxa Profibus Slave device to DP master system.
2. Right-click Moxa Profibus Slave and select Object Properties.
3. In the Parameters tab, you can configure the PROFIBUS address of the Moxa device. Note: Make sure that the address is the same address that you set using the rotary switch
Copyright © 2014 Moxa Inc. Page 23 of 35
5.7 Configuring I/O Modules
You can configure the selected I/O modules for data exchange with the PROFIBUS master. You can select the I/O module combinations based on your application. This example uses the two 1 Word output and one 1 Word input IO combination
1. Drag the Output: 1 Word module from the module list for Moxa PROFINET slave to slots 1 and 2.
2. Drag the Input: 1 Word module to slot 3. 3. Save the changes.
Copyright © 2014 Moxa Inc. Page 24 of 35
5.8 Editing Symbols
1. Right-click slot 1 entry and select Edit Symbols.
2. Set the Symbol field as QCMD and set the Comment field as Output Logic Command.
Copyright © 2014 Moxa Inc. Page 25 of 35
5.9 Configuring Ethernet Nodes
Before you can download the configuration to CPU 315-2 PN/DP, specify the Ethernet settings on CPU 315-2 PN/DP to communicate with PC.
To change the IP address of CPU 315-2 PN/DP, double-click PN-IO. Then, click Properties and specify the network settings (IP address and subnet mask).
The following figure shows an example.
5.10 Downloading Configuration
Copyright © 2014 Moxa Inc. Page 27 of 35 Siemen PLC starts to communicate with MGate 4101-MB-PBS. The P2 Status LED (PROFIBUS) on MGate 4101-MB-PBS turns steady green to indicate that the device is in data exchange mode.
6 Step 7 Ladder Programming
6.1 Editing OB1
1. In SIMATIC Manager, click S7 Program->Blocks and double-click OB1.
As a Program Cycle Organization Block, OB1 is executed at regular intervals by the S7 CPU operating system after the startup process is complete.
Copyright © 2014 Moxa Inc. Page 28 of 35 The following screen appears.
2. Drag and drop the MOVE instruction to Network 1. Then, set the ITemperature input to the IN node and the input MW0 memory variable to the OUT node.
The logic comment for Network 1 is “Copy temperature value to MW0.” as shown in the following figure.
Copyright © 2014 Moxa Inc. Page 29 of 35 3. Complete the following steps to configure Network 2:
a. Click Insert > Network to insert Network 2.
b. Drag and drop the MOVE instruction to Network 2. Then, set the 2 input to the IN node and the QMD input symbol to the OUT node.
The logic comment for Network 2 is “Output 2 (Start Mode) to "Logic Command" word.” as shown in the following figure.
4. Complete the following steps to configure Network 3: a. Click Insert > Network to insert Network 3.
b. Drag and drop the GE_I instruction to Network 3. Then, set the MW0 input to the IN1 node and the 250 input to the IN2 node.
c. Drag and drop the Move instruction to Network 3. Then, set the 600 input to the IN node and the QSpeed input symbol to the OUT node
The logic comment for Network 3 is “If Temperature is greater than 25C, output drive speed as 60 MHz.” as shown in the following figure.
Copyright © 2014 Moxa Inc. Page 30 of 35 5. Complete the following steps to configure Network 4:
a. Click Insert > Network to insert Network 3.
b. Drag and drop the GE_I instruction to Network 4. Then, set the MW0 input to the IN1 node and the 245 input to the IN2 node.
c. Drag and drop the LI_1 instruction to Network 4. Then, set the MW0 input to the IN1 node and the 250 input to the IN2 node.
d. Drag and drop the MOVE instruction to Network 4. Then, set the 500 input to the IN node and the QSpeed input symbol to the OUT node.
The logic comment for Network 4 is “If Temperature is between 24.5~25C,output drive speed as 50 MHz.” as shown in the following figure.
Copyright © 2014 Moxa Inc. Page 31 of 35 The following table shows the logic of Network 3~9.
Network Temperature (C ) Drive Speed (MHz.) >= < 3 250 - 60 4 245 250 50 5 240 245 40 6 235 240 30 7 230 235 20 8 225 230 10 9 - 225 0
6. Click Download to download the program to Siemen PLC.
7 Communication Test: Monitor Program
Copyright © 2014 Moxa Inc. Page 32 of 35 In the following example, the title bar indicates the program status (ONLINE).
The status bar indicates the Siemen PLC status (RUN). The temperature is 23.1 C and the output speed is 20MHz for Network 7.
8 Appendix
8.1 PowerFlex 4M Modbus Registers
Logic Command Register − Address: 8192
− Access: R/W − Value:
Bit(s) Description
0 1 = Stop, 0 = Not Stop 1 1 = Start, 0 = Not Start
Reference Register: Setting Speed − Address: 8193
− Access: R/W
− Value: A decimal value entered as xxx.x where the decimal point is fixed. For example, a decimal of 100 equals to 10.0 Hz and 543 equals to 54.3 Hz.
Copyright © 2014 Moxa Inc. Page 33 of 35 Logic Status Register
− Address: 8448 − Access: R − Value:
Bit(s) Description
0 1 = Ready, 0 = Not Ready
1 1 = Active (Running), 0 = Not Active 2 1 = Cmd Forward, 0 = Cmd Reverse
3 1 = Rotating Forward, 0 = Rotating Reverse
4 1 = Accelerating, 0 = Not Accelerating 5 1 = Decelerating, 0 = Not Decelerating 6 1 = Alarm, 0 = No Alarm
7 1 = Faulted, 0 = Not Faulted
8 1 = At Reference, 0 = Not At Reference 9 1 = Reference Controlled by Comm
10 1 = Operation Cmd Controlled by Comm
11 1 = Parameters have been locked 12 Digital Input 1 Status
13 Digital Input 2 Status 14, 15 Not Used
Feedback Register: Running Speed − Address: 8451
− Access: R
− Value: A xxx.x decimal value where the decimal point is fixed. For example, a decimal of 123 equals to 12.3 Hz and 300 equals to 30.0 Hz.
Copyright © 2014 Moxa Inc. Page 34 of 35 Drive Error Codes Register
− Address: 8449 − Access: R − Value:
Value (Decimal) Description
0 No Fault 2 Auxiliary Input 3 Power Loss 4 Under Voltage 5 Over Voltage 6 Motor Stalled 7 Motor Overload
8 Heat Sink Over Temperature 12 HW Overcurrent (300%) 13 Ground Fault
29 Analog Input Loss 33 Auto Restart Tries 38 Phase U to Ground Short 39 Phase V to Ground Short 40 Phase W to Ground Short 41 Phase UV Short
42 Phase UW Short 43 Phase VW Short 63 Software Overcurrent 64 Drive Overload 70 Power Unit Fail 80 AutoTune Fail 81 Communication Loss 100 Parameter Checksum Error 122 I/O Board Fail
Copyright © 2014 Moxa Inc. Page 35 of 35
8.2 IAQPoint2 Modbus Registers
Gas Display Register (CO2) − Address: 101
− Access: R
− Value: This reports gas concentration. If the CO2 sensor is fitted, this will report in ppm from 0 to 5000.
Temperature C Register − Address: 102
− Access: R
− Value: This reports temperature in tenths of a degree Celsius. Humidity Register
− Address: 103 − Access: R