help file profibus dp communication between freelance ... · pdf fileprofibus dp communication...

16
Freelance Distributed Control System Help File PROFIBUS DP communication between Freelance Control System and Siemens S7-300 PLC Summary The purpose of this document is to provide a viable solution for customers that wish to connect Siemens S7-300 PLC with Freelance Control System via PROFIBUS DP Communication. This document will guide users how to integrate with Freelance control system and Siemens S7-300 PLC via PROFIBUS DP communication efficiently. Pre-Requisites This document is intended for those who have a basic understanding of Freelance, PROFIBUS and Siemens. This help file is not a replacement for the Freelance or Siemens documentation and should only be used in conjunction with the manuals. Recommended Reading Freelance Item Name of Document Document Number 1 Engineering Manual, communication and fieldbuses 3BDD012515R0701 2 Engineering Manual, system configuration 3BDD012503R0801 3 Mounting and installation instructions, AC800F 3BDD012501R0801 4 Introduction, getting started 3BDD02560R0701 Table 1-1 Siemens S7-300 PLC Item Name of Document Document Number 1 STEP 7 Getting Start 6ES7810-4CA07-8BW0 2 S7-CPs for PROFIBUS Configuring and Commissioning Release 06/2005 C79000-G8976-C181-02 Table 1-2 Hardware The following components are required before establishing the PROFIBUS DP communication between Freelance Control System and Siemens S7-300 PLC with CP 342-5 Communication Module: - Freelance Control System with Control Builder F Version 8.2 or above - Siemens S7-300 CPU 314C-2DP hardware with Step 7 V5.4 software - CP 342-5 PROFIBUS DP Communication Module

Upload: lediep

Post on 07-Mar-2018

316 views

Category:

Documents


16 download

TRANSCRIPT

Page 1: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

Freelance Distributed Control System

Help File PROFIBUS DP communication between Freelance Control System and Siemens S7-300 PLC

Summary

The purpose of this document is to provide a viable solution for customers that wish to connect Siemens S7-300 PLC with Freelance Control System via PROFIBUS DP Communication. This document will guide users how to integrate with Freelance control system and Siemens S7-300 PLC via PROFIBUS DP communication efficiently.

Pre-Requisites

This document is intended for those who have a basic understanding of Freelance, PROFIBUS and Siemens. This help file is not a replacement for the Freelance or Siemens documentation and should only be used in conjunction with the manuals. Recommended Reading

Freelance

Item Name of Document Document Number 1 Engineering Manual,

communication and fieldbuses 3BDD012515R0701

2 Engineering Manual, system configuration

3BDD012503R0801

3 Mounting and installation instructions, AC800F

3BDD012501R0801

4 Introduction, getting started 3BDD02560R0701 Table 1-1

Siemens S7-300 PLC

Item Name of Document Document Number 1 STEP 7 Getting Start 6ES7810-4CA07-8BW0 2 S7-CPs for PROFIBUS Configuring

and Commissioning Release 06/2005 C79000-G8976-C181-02

Table 1-2

Hardware

The following components are required before establishing the PROFIBUS DP communication between Freelance Control System and Siemens S7-300 PLC with CP 342-5 Communication Module:

- Freelance Control System with Control Builder F Version 8.2 or above - Siemens S7-300 CPU 314C-2DP hardware with Step 7 V5.4 software - CP 342-5 PROFIBUS DP Communication Module

Page 2: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

1 | P a g e

Architecture

The architecture of the hardware will be set up similar to the following diagram:

Figure 1-1

General Process

Below diagram shows the basic steps involved in establishing the communication between Freelance controller and Siemens controller via PROFIBUS DP.

1. Planning Data Communication Buffer

Area

2. Configuration of Profibus DP

Interface

3. Configuration of I/O data area

and FC Programming

4. Inport .gsd file in Control Builder F Software

5. Edit I/O Channels

CPU 314C-2DP with CP 342-5

AC 800F with FI830

PROFIBUS

Architecture

Page 3: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

2 | P a g e

Interaction between the CPU and PROFIBUS CP in the DP Slave Mode

Below chart shows the whole communication process, it is divided into two parts as below:

Part A: Periodic Data Communication between DP Master and DP Slave

DP Master and DP Slave data exchange in accordance with the DP polling cycle. The exchanged data stored in the PROFIBUS DP module’s Send and Receive buffer area. DP Master starts the data exchange task and transmit output data, and at the same time to receive input data.

Part B: Data exchange between CPU and PROFIBUS CP module

Data exchange between the CPU and the PROFIBUS CP module based on DP_RECV and DP_SEND function block (FCs) and CPU call cycle time.

Figure 1-2

Programming Method in DP Slave Mode

Normally we use below two FCs in application programming interface:

- DP_RECV: receive DP data from DP Master - DP_SEND: send DP data to DP Master

Common used function blocks as shown below:

FC FC Can be used with:

Meaning

DP Master DP Slave DP_SEND (FC1) X X For sending data DP_RECV (FC2) X X For receiving data DP_DIAG (FC3) X - For diagnostic functions initiated by the DP master DP_CTRL (FC4) X - For control functions

Page 4: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

3 | P a g e

Description of Function Blocks

1) FC1 DP_SEND

Definition of the Function Block:

Parameter Declaration Type Possible Values

Remarks

CPLADDR INPUT WORD Module base address When you configure the CP with STEP 7 hardware configuration, the module start address is displayed in the configuration table. Specify this address here.

SEND INPUT ANY (as VARTYPE only BYTE, with FC1 V3 and higher: BYTE With FC1 up to V2.x: BTYE, WORD and DWORD)

Specifies the address and length. The address of the DP data area refers to one of the following: - Process image area - Bit memory - Data block area The length must be set for - DP master: 1 to 240 - DP slave: 1 to 86

The following applies to new modules (see CP manual):

- DP master: 1…2160 - DP slave: 1…240

DONE OUTPUT BOOL 0: - 1: new data

This parameter indicates whether or not the job was executed without errors. For the meaning of this parameter in conjunction with the ERROR and STATUS parameters, refer to the following table.

ERROR OUTPUT BOOL 0: - 1: error

For the meaning of this parameter in conjunction with the DONE and STATUS parameters, refer to the follow table.

STATUS OUTPUT WORD See following table

Status code For the meaning of this parameter in conjunction with the DONE and ERROR parameters, refer to the following table 8-1.

Page 5: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

4 | P a g e

Common error status information description:

DONE ERROR STATUS Meaning 0 0 8180H Startup:

The DP service was started but data acceptance is not yet possible. Normal operation: Data transfer active.

With newer CP types, the following meaning is possible (see /2/): DP has not been started, due to CP STOP or “no parameter assignment” (occurs here instead of code 0, 1, 8183H!).

1 0 0000 H New data transferred without error. 0 1 8183 H No configuration or the DP service has not yet started on the PROFIBUS DP. 0 1 8184 H System error or bad parameter type. 0 1 8F22 H Area length error reading a parameter (e.g. DB too short). 0 1 8F23 H Area length error writing a parameter (e.g. DB too short). 0 1 8F24 H Area error reading a parameter. 0 1 8F25 H Area error writing a parameter. 0 1 8F28 H Alignment error reading a parameter. 0 1 8F29 H Alignment error writing a parameter. 0 1 8F30 H Parameter is in the write-protected 1st act. data block. 0 1 8F31 H Parameter is in the write-protected 2nd act. data block. 0 1 8F32 H Parameter contains a DB number that is too high. 0 1 8F33 H DB number error. 0 1 8F42 H Timeout reading a parameter from the I/O area. 0 1 8F43 H Timeout writing a parameter to the I/O area. 0 1 8F44 H Address of the parameter to be read is disabled in the access track. 0 1 8F45 H Address of the parameter to be written is disabled in the access track. 0 1 8F7F H Internal error, e.g. illegal ANY reference. 0 1 8090 H No module with this address exists. 0 1 8091 H Logical base address not at a double word boundary. 0 1 80A1 H Negative a acknowledgment writing to the module. 0 1 80B0 H The module does not recognize the data record. 0 1 80B1 H The specified data record length is incorrect.

Master mode: The length of the source area in the SEND parameter is greater than the length configured on the PROFIBUS CP for output data. Slave mode: The length of the source area specified in the SEND parameter is greater than the maximum length specified in the product information bulletin / manual /2/.

With newer CP types, the following applies to the DP master and DP slave modes (see /2/): The number of data to be sent exceeds the upper limit for this service.

0 1 80C0 H The data record cannot be read. 0 1 80C1H The specified data record is currently being processed. 0 1 80C2 H There are too many jobs pending. 0 1 80C3 H Resources occupied (memory) 0 1 80C4 H Communication error (occurs temporarily, it is usually best to repeat the

job in the user program). 0 1 80D2 H Logical base address incorrect.

Page 6: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

5 | P a g e

ANY data type using instruction ANY: applied to the actual parameters of unknown type or use any data type occasions. Specific information can refer to the following sections: “Format of the Parameter Type ANY” “Using the Parameter Type ANY”

Example: ANY 10 Bytes Is used when the data type of the current parameter is

unknown. Format: P#M50.0 BYTE 10 ANY format for data types P#M100.0 WORD 5 L#1COUNTER 10 ANY format for

Parameter type

Definition data area to ANY parameter: Not only ANY parameter can be appointed the detail address (e.g. MW100), but also can be appointed the data area.

Detail format as below: P# Area ID Byte.Bit Data Type Area Length data type can be appointed all data types, if data type is not BOOL, it must use address mode (x.0).

Example:

Actual Parameter Description P# M 50.0 BYTE 10 Specifies 10 bytes in the byte memory area:

MB50 to MB59. P# DB 10.DBX5.0 S5TIME 3 Specifies 3 units of data of the data type S5TIME,

that are located in DB10: DB byte 5 to DB byte 10.

P# Q 10.0 BOOL 4 Specifies 4 bits in the output area: Q 10.0 to Q 10.3.

Page 7: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

6 | P a g e

2) FC2 DP_RECV

Definition of the Function Block:

Parameter Declaration Type Possible Values

Remarks

CPLADDR INPUT WORD Module base address When you configure the CP with STEP 7 hardware configuration, the module start address is displayed in the configuration table. Specify this address here.

RECV INPUT ANY (as VARTYPE only BYTE, with FC1 V3 and higher: BYTE with FC1 up to V2.x: BYTE, WORD and DWORD)

Specifies the address and length. The address of the DP data area refers to - Process image area - Bit memory - Data block area The length must be set for - DP master: 1 to 240 - DP slave: 1 to 86 - DP master; only read status byte: 255

The following applies to new modules (see CP manual):

- DP master: 1…2160 - DP slave: 1 to 240 - DP master; only read status byte: 1

NDR OUTPUT BOOL 0: - 1: new data accepted

This parameter shows if new data were accepted. Status code For the meaning of this parameter in conjunction with the DONE and ERROR parameters, refer to the following table 8-2.

ERROR OUTPUT BOOL 0: - 1: error

Error code For the meaning of this parameter in conjunction with the NDR and STATUS parameters, refer to the following table 8-2.

STATUS OUTPUT WORD See following table

Status code For the meaning of this parameter in conjunction with the NDR and ERROR parameters, refer to the following table 8-2.

DPSTATUS OUTPUT Byte For coding, see below under DPSTATUS (Table 8-3)

DP status code

Page 8: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

7 | P a g e

Common error status information description:

DONE ERROR STATUS Meaning 0 0 8180 H Startup:

The DP service was started but data acceptance is not yet possible. Normal operation: Data acceptance active.

With newer CP types, the following meaning is possible (see /2/): DP has not been started due to CP STOP or “no parameter assignment” (occurs here instead of code 0, 1, 8183H!).

1 0 0000 H New data accepted without error. 0 1 8183 H No configuration or the DP service has not yet started on the PROFIBUS CP. 0 1 8184 H System error or bad parameter type. 0 1 8F22 H Area length error reading a parameter (e.g. DB too short). 0 1 8F23 H Area length error writing a parameter (e.g. DB too short). 0 1 8F24 H Area error reading a parameter. 0 1 8F25 H Area error writing a parameter. 0 1 8F28 H Alignment error reading a parameter. 0 1 8F29 H Alignment error writing a parameter. 0 1 8F30 H Parameter is in the write-protected 1st act. data block. 0 1 8F31 H Parameter is in the write-protected 2nd act. data block. 0 1 8F32 H Parameter contains a DB number that is too high. 0 1 8F33 H DB number error. 0 1 8F3A H Destination area not loaded (DB). 0 1 8F42 H Timeout reading a parameter from the I/O area. 0 1 8F43 H Timeout writing a parameter to the I/O area. 0 1 8F44 H Address of the parameter to be read is disabled in the access track. 0 1 8F45 H Address of the parameter to be read is disabled in the access track. 0 1 8F7F H Internal error, e.g. illegal ANY reference. 0 1 8090 H No module with this address exists. 0 1 8091 H Logical base address not at a double word boundary. 0 1 80A0 H Negative acknowledgment writing to the module. 0 1 80B0 H The module does not recognize the data record. 0 1 80B1 H The specified data record length is incorrect.

Slave mode: the length of the destination area specified in the RECV parameter is greater than the maximum length specified in the CP product information bulletin / manual /2/. Master mode: The length of the destination area specified in the RECV parameter is greater than the length of the input data configured on the PROFIBUS DP.

With newer CP types, the following applies to the DP master and DP slave modes (see /2/): The number of data to be received exceeds the upper limit for this service.

0 1 80C0 H The data record cannot be read. 0 1 80C1 H The specified data record is currently being processed. 0 1 80C2 H There are too many jobs pending. 0 1 80C3 H Resources occupied (memory). 0 1 80C4 H Communication error (occurs temporarily, it is usually best to repeat the

job in the user program). 0 1 80D2 H Logical base address incorrect.

Page 9: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

8 | P a g e

Configuration on Siemens Slave

Siemens PROFIBUS DP communication interface setting

Assume we have opened SIMATIC Manager and “Getting Started” project. Open SIMATIC 300 Station folder, and double-click hardware icon.

Figure 1-3

Select and Insert objects:

1) Insert S7-300 device a. S7-300 Rail b. Insert the objects into corresponding slots c. Usually insert the S7-300 CPU into the second slot, please choose the correct CPU from the equipment

selection list.

Figure 1-4

2) Insert CP342-5 module

a. Usually insert CP342-5 into slot 4. (please refer STEP 7 manual) b. Select insert equipment c. Choose S7-300 station\CP 300\PROFIBUS\CP342-5\, and choose the corresponding protocol module and the

correct version. d. Configure the DP communication interface parameter e. Double-click CP342-5 slot, popup the interface parameter configuration dialog:

Page 10: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

9 | P a g e

Figure 1-5

Main configuration works:

Set the Interface communication basic parameter, In General table’s Interface area, select “Properties” button, popup the below setting dialog:

Figure 1-6

Choose “Parameters” table, set Address, and choose “New” button, set communication network.

Page 11: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

10 | P a g e

Figure 1-7

Based on DP Master’s communication speed to set Transmission Rate. Select correct Subnet, usually we select to use DP. Click “OK”, confirm and exit.

3) Set Interface Operating Mode Select “Operating Mode” table as below, and then please select “DP slave” mode, choose “Test, commissioning, routing”.

Figure 1-8

4) Programming of function block

Insert FC1 DP_SEND function block and make the connection to corresponding pins. Details please refer above the communication schematic diagram and definition of function block.

Page 12: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

11 | P a g e

Programming as below:

Figure 1-10

CPLADDR: function block connects with real physical hardware.

Choose “CPLADDR” pin, and then right-click mouse, select “Connection”, choose the corresponding physical hardware in the popup dialog-box, click “OK”. Now the function block is connected with real physical hardware.

Figure 1-11

And then insert FC2 DP_RECV function block to repeat the same process, and finish the all STEP 7 programming work.

Figure 1-12

Page 13: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

12 | P a g e

Configuration on Freelance Control Builder F

1) Import .GSD file.

Figure 1-13

2) Import .GSD file for CP342-5 module, file name is “siem80d6.gsd”.

Figure 1-14

3) PROFIBUS slave can be seen in hardware structure of Control Builder F.

Figure 1-15

Page 14: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

13 | P a g e

4) Check detail information of the slave version.

Figure 1-16

5) Basic communication parameter of slave can be found under “Definition” tab.

Bus address: configure the same address as in Siemens STEP 7 software (e.g. address: 6).

Watchdog Timeout: use Default value.

Figure 1-17

6) Insert PROFIBUS slave module.

Right click and insert as shown in screenshot.

Page 15: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

14 | P a g e

Figure 1-18

IO selection can be found as below.

Figure 1-19

7) Insert IO components from the IO editor as shown.

Figure 1-20

Page 16: Help File PROFIBUS DP communication between Freelance ... · PDF filePROFIBUS DP communication between Freelance Control System ... Freelance control system and Siemens S7-300 PLC

15 | P a g e

8) Save as template

If there are more than one similar type of slave in same configuration, save it as a template as shown in the picture. In this way, step 1 to 7 configuration can be skipped for additional PROFIBUS slaves. This will save time to do repeated configuration in slave parameter.

Figure 1-21

Establishing communication

After the configuration steps are done, data can be sent from Freelance controller to Siemens controller via PROFIBUS.

Below diagram shows the function blocks configured in Siemens STEP 7 software.

In the picture Network 2: Send function block. P#Q 30.0 BYTE 16 will be sending data to Freelance. In the picture Network 3: Receive function block. P#I 30.0 BYTE 16 will be receiving data from Freelance. Refer to the description of Function blocks table from page 3 to 7 to understand detail of each of output function. (E.g. DONE, ERROR, STATUS, END)

Figure 1-22