Вы находитесь на странице: 1из 48

Cover

Event-controlled (fast) Process Value Acquisition using the AR_SEND Function


WinCC and PCS 7 OS Configuration Instruction August 2009

Applikationen & Tools


Answers for industry.

Warranty, Liability and Support

Warranty, Liability and Support


Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These application examples do not relieve you of the responsibility to use sound practices in application, installation, operation and maintenance. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time without prior notice. If there are any deviations between the recommendations provided in these application examples and other Siemens publications e.g. Catalogs the contents of the other documents have priority. We do not accept any liability for the information contained in this document. Any claims against us based on whatever legal reason resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (wesentliche Vertragspflichten). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of Siemens Industry Sector. If you have any questions concerning this document please e-mail us to the following address: online-support.automation@siemens.com

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Warranty, Liability and Support Industry Automation and Drives Technologies Service & Support Portal This article is taken from the Service Portal of Siemens AG, Industry Automation and Drives Technologies. The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/23780904

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Task 2.1 Overview of the overall solution

Table of Contents
1 2 2.1 2.2 2.3 3 3.1 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.4 3.4.1 3.4.2 3.4.3 3.4.4
Copyright Siemens AG 2009 All rights reserved

Automation Task .................................................................................. 5 Automation Solution ............................................................................. 6 Overview of the overall solution ........................................................... 6 Description of the core functionality ..................................................... 7 Hardware and software components used........................................... 9 Function Mechanisms of this Application ........................................... 11 Data transfer using AR_SEND........................................................... 11 General Information............................................................................ 13 Scan block ARSCAN_E (FB 672) ...................................................... 14 Function.............................................................................................. 14 Event-controlled or cyclic process value acquisition.......................... 15 Behavior during overload or failed connection................................... 16 Assigning the QSTATUS status word ................................................ 16 Block connections .............................................................................. 18 Manager block AR_MAN_E (FB 673) ................................................ 19 Function.............................................................................................. 19 Behavior during overload or failed connection................................... 20 Assigning the QSTATUS status word ................................................ 21 Block connections .............................................................................. 22 Configuration and Settings................................................................. 24 Preliminary remarks and functionality ................................................ 24 Preparations ....................................................................................... 27 Using the example projects................................................................ 28 Setup and configuration with PCS 7 .................................................. 28 Requirements ..................................................................................... 28 Add blocks to CFC plan...................................................................... 29 WinCC configuration for PCS7........................................................... 31 Setup and configuration with STEP 7 ................................................ 34 Precondition ....................................................................................... 34 Integrating the blocks into a function block (STEP 7) ........................ 35 WinCC configuration for STEP 7........................................................ 41 WinCC Operation for PCS7 and STEP7 ............................................ 46 History ................................................................................................ 48

4 4.1 4.2 4.3 4.4 4.4.1 4.4.2 4.4.3 4.5 4.5.1 4.5.2 4.5.3 5 6

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Task 2.1 Overview of the overall solution

Automation Task
Process data shall be acquired fast and be transferred to the WinCC Tag Logging. The acquisition cycle for the process data shall be under 500 ms. The bus load shall be kept as low as possible. Communication shall be based on the AR_SEND method.
Figure 1-1

Description of the automation problem

AS Measured Values
Update rate <500ms
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

WinCC Tag Logging

Problem description The solution shall be applicable for the following products: WinCC and STEP 7 PCS 7

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Solution 2.1 Overview of the overall solution

Automation Solution
The available function block AR_SEND (SFB 37 in S7-400) can be used to store data from the process into a measured value archive of an OS. It takes over the communication between the automation system (AS) and the operator station (OS). Then the data is sent to the WinCC archive. If the data must be acquired very fast (<500 ms) and be requested by the WinCC archive, a high load on the bus system results, even if the process value only changes slightly.

2.1
Overview

Overview of the overall solution


Based on the AR_SEND block we provide two function blocks to you. These blocks reach a higher data throughput when archiving measured values when the OS initializes a standard request. With this solution you can archive the measured values with a cycle time smaller than 500 ms. This happens by taking on the values with the function block ARSCAN_E, intermediately storing them in the AS of the AR_MAN_E block, and then sending them to the OS in blocked format. Optionally, only process values are archived which show a configurable change to the preceding process value.

Copyright Siemens AG 2009 All rights reserved

The following figure shows the two function blocks, the ARSCAN_E for cyclic acquisition of the process values and the ARMAN_E for transmitting the buffered process values via AR_SEND.
Figure 2-1

WinCC Tag Logging


Prozessobjekt Process object
AR_SEND-Subnummer

ARMAN_E
ARSCAN_E
Write Schreibpointer Zeiger

AR_SEND subnumber

CH_AI
Channel11 Kanal
Quality-Code

1kB

Process value
Prozesswert

FIFO

Read Lesepointer Zeiger

AR_SEND

Process object Prozessobjekt


AR_SEND subnumber AR_SEND-Subnummer

60kB

ARSCAN_E CH_AI
Channel 2 Kanal 2
Quality-Code

Process value
Prozesswert

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Solution 2.2 Description of the core functionality

2.2

Description of the core functionality


The figure below shows the setup of the example,
Figure 2-2
WinCC Tag Logging

Testsignal
Sub-ID

AR_MAN_E
ARSCAN_E Ereignisevent gesteuerte controlled archiving Archivierung
Write Schreibpointer Zeiger
1kB

CH_AI
Quality-Code

Process value
Prozesswert

FIFO

Read Lesepointer Zeiger

AR_SEND

Sub-ID

ARSCAN_E

60kB

CH_AI
Quality-Code

fast schnelle archiving Archivierung

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Process value
Prozesswert

Two blocks ARSCAN_E acquire a test signal once cyclically and once eventcontrolled. The AR_MAN_E provides the storage for archiving the process values and sends the data to the WinCC Tag Logging block by block using the internal AR_SEND block. Advantages of this solution The two function blocks provide the following advantages: Simple graphic interconnection of process tags with the CFC editor by means of CFC (Continuous Function Chart) conform blocks or configuration with the standard LAD / FBD / STL editor No complex parameterization of the standard function block AR_SEND by the customer. The telegram format with the necessary header information for the AR_SEND block (SFB37) has already been created. Simple configuration of measured values for archiving. Exact time stamp from the automation system (AS) Variable trigger options for sending the data (send job to the OS station)

Typical fields of application The function blocks can be used for: Archiving of process values with standard data types: DWORD and REAL Intermediate storage of process tags in the AS with a buffer storage of 4 Kbytes each Process value acquisition under 500 ms cycle time Selecting flexible scanning times of process values Archiving of process values with configurable changes

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Solution 2.2 Description of the core functionality Request for sending data from the OS station Automatic telegram repetition in case of an error

Copyright Siemens AG 2009 All rights reserved

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Solution 2.3 Hardware and software components used

2.3

Hardware and software components used


The application was generated with the following components:

Hardware components
Table 2-1 Component Rack Power supply PS 405 S7 -416-3 PN/DP Qty. 1 1 1 MLFB / order number 6ES7 400-1TA01-0AA0 6ES7 405-0KA00-0AA0 6ES7 416-3ER05-0AB0 Note Or comparable Or comparable Or comparable S7-400 S7-400 H

Software components
Table 2-2 Component SIMATIC PCS 7 V7.0 SP1
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Qty. 1

MLFB / order number 6ES7 658-2AA07-0YA0 (Single Station PO250) or comparable PCS 7 V7.0 SP1) 6ES7 810-4CC08-0YA5 6AV6 381-2BM07-0AX0 (128 Powetags) 6ES7 811-1CC05-0YA5

Note Only required for PCS 7 configuration.

STEP 7 V5.4 SP4 WinCC 7.0 S7-SCL HW-Update for H-CPUs

1 1 1 1

Only for PCS 7 configuration. Only for PCS 7 configuration. Only for PCS 7 configuration. Only for H-CPU-project

http://support.automation .siemens.com/WW/view/ en/26609816

Example files and projects The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/23780904 The download is a ZIP file which can be unzipped with any zip-program. The zip.file contains the following files:
Table 2-3 Component EVT_Arch.zip (ZIP file) Note Ar_man_e.scl Arscan_e.scl Test-Signal.SCL Dtwr.awl SCAN-VALUES.Pdl EVT_ Arch_PCS7.zip (PCS 7 project) EVT_Arch_H.zip (PCS 7project with H-CPU) EVT_Arch_STEP7.zip (STEP 7 project)

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Automation Solution 2.3 Hardware and software components used

Copyright Siemens AG 2009 All rights reserved

10

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.1 Data transfer using AR_SEND

3
3.1

Function Mechanisms of this Application


Data transfer using AR_SEND
The number of AR_SEND instances is limited per CPU and depends on the type of CPU: CPU S7-414 CPU S7-416 CPU S7-417 < 16 instances < 32 instances < 64 instances

Delimitation of the AR_SEND instances

Used AR_SEND format The used transfer format is the AR_SEND Format 9 (Header Type = 9). This format enables transferring values with different SUB-IDs and individual time stamps. A 4 byte (Float/DWORD) value typically requires 26 bytes in the telegram Headertype = 9
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Year Day 22 Bytes Minute 1/10s 1/100s Cycle = 0 Unit (type) =3 AR-ID sub number Data type of the process data Number of process values 4 Bytes 1/1000s

Month Hour Second Weekday

Unit (range) = 3

Process value

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

11

Function Mechanisms of this Application 3.1 Data transfer using AR_SEND AR_SEND Performance An AS can typically transfer blocks of approx. 8 kBytes via an AR_SEND. With format 9 (AR_SEND Headertype = 9) a 4-byte process value (DWORD or IEEE FLOAT format) requires 26 bytes in the transferred block telegram. This means that using an AR_SEND call approx. 300 values can be transferred (8 kBytes / 26 bytes = 300 values). At 3 AR_SEND calls per second this would be approx. 900 values per second. Transferred AR_SEND are evaluated and archived by the WinCC Tag Logging by means of a Conversion DLL. It is assumed that the same throughput can be achieved for this archiving process as provided by the WinCC Tag Logging for normally archived data. AR_SEND functionality with redundant AS In redundant AS operation the maximum number of telegrams is halved (AS-AS, AS-OS). This means if the maximum number of telegrams in singular operation is e.g. 80 telegrams, a maximum of 40 telegrams can be processed in redundant operation. This may also affect the AR_SEND mechanism.
Copyright Siemens AG 2009 All rights reserved

AR_SEND functionality with redundant servers Each OS server logs on at the respective AS when booted. For each connection between AS and OS a maximum storage of 16 kBytes is reserved. This limit depends on the number of used AR_SEND blocks.

12

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.2 General Information

3.2

General Information
The provided solution contains 2 blocks. A scan block (ARSCAN_E), which acquires and saves the values. A manager block (AR_MAN_E), which manages the storage areas and sends the data to the WinCC Tag Logging using the AR_SEND block.
WinCC Tag Logging
Process object Prozessobjekt
AR_SEND subnumber AR_SEND-Subnummer

Figure 3-1

ARMAN_E
ARSCAN_E
Write Schreibpointer

Zeiger

CH_AI
Channel11 Kanal
Quality-Code

1kB

Process value Prozesswert

FIFO

Read Lesepointer

Zeiger

AR_SEND

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Process object Prozessobjekt


AR_SEND subnumber AR_SEND-Subnummer

60kB

ARSCAN_E CH_AI
Channel 2 Kanal 2
Quality-Code

Process value Prozesswert

Due to the mentioned CPU dependent limitation of the number of AR_SEND instances only one instance of the AR_SEND send block is used per manager. This enables acquisition and sending of several process values to WinCC using one AR_SEND instance. An AR_MAN_E can manage up to 4093 ARSCAN_E blocks (limited by the internal AR_SEND block). However, the actual number of ARSCAN_E blocks is reduced by the respective data volume and the individual application.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

13

Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672)

3.3

Scan block ARSCAN_E (FB 672)


Figure 3-2 Standard configuration

3.3.1

Function

Process value acquisition The ARSCAN_E block acquires a current process value and its quality code. The ARSCAN_E block in the CFC is connected to the respective channel driver block (e.g. CH_AI). (This means that an ARSCAN_E block must be configured for each channel to be archived.) Each ARSCAN_E block is assigned to an AR_MAN_E block. The ARSCAN_E block is called up in the acquisition cycle (e.g. after the CH_AI). Typically this block is configured together with the instances of the measured value block (MEAS_MON) in a CFC. Valid data types of the process value to be saved are REAL and DWORD. For data type REAL the process value limits must be specified at inputs ULRANGE and UHRANGE. The acquired process value is checked for validity (Quality Code QC) and for modifications. A value change occurs at data type REAL if the process value has changed by a certain value compared with the last acquired process value. The user can set this modification by means of a percentage value related to the measuring range (DEADBAND). For connected data type DWORD a binary change monitoring is reached, i.e. the DEADBAND parameter is ignored. Therefore an even-controlled acquisition of process values is not possible. The acquisition velocity depends on the integration time of the AI module, the scan cycle of the CH_AI block, the CPU load in the program and the MIN_UPD. Save process value in FIFO The address of the memory area is forwarded to the ARSCAN_E block via CFC connection. If a process change is now detected and the minimum archiving time (MIN_CYC) has elapsed, the ARSCAN_E block writes the process value with appropriate: Time stamp Data type Sub-ID

Copyright Siemens AG 2009 All rights reserved

into a specially reserved memory area in the instance DB of the manager block (FIFO).

14

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672) If the minimum archiving time (MIN_CYC) has the value 0, then archiving takes place in the OB cycle of the ARSCAN_E block. If the process value changes within the maximum archiving time (MAX_CYC) by a percentage lower than the DEADBAND value, the current process value is saved automatically after this time has elapsed. Especially after a system startup of the OS this ensures that after time MAX_CYC has elapsed at the latest a current value is entered into the memory. If the maximum archiving time (MAX_CYC) has the value 0, then the just described automatic archiving is switched off. Note After archiving a process value output QNUM_TRANS is increased by 1. The filling level of the memory can be read at output QFIFODEG.

3.3.2

Event-controlled or cyclic process value acquisition


The previously described function of the ARSCAN_E contains an: event-controlled process value acquisition for REAL values and a cyclic process value acquisition for REAL and DWORD values.

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

This reduces the stored data volume considerably and can be adjusted to individual requirements. The settings described below enables using the subfunctions individually as well. Event-controlled process value acquisition For the event-controlled process value acquisition the following settings are made: Setting the measuring range of the process value. Setting the change of the process value compared with the previous value (DEADBAND). Change maximum archiving time (MAX_CYC) to 0.

Thus process values are only archived if the changes of the process value compared with the previously archived process value has exceeded the value configured at DEADBAND (percentage regarding measuring range). Note Security level 2 (increasing archiving cycle to MAX_CYC) is ineffective.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

15

Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672) Cyclic process value acquisition For cyclic process value acquisition the following settings are made: Changing the process value from the previous one (DEADBAND) to 0. The measuring range (ULRANGE & UHRANGE) is not considered. Setting the acquisition time of the process value at input MIN_CYC

This serves the process value with the set cycle time. As already mentioned the minimum cycle time is restricted by the cycle time of the OB by calling the ARSEND_E block. Note Security level 1 (DEADBAND doubled) is ineffective.

3.3.3

Behavior during overload or failed connection


During overload, when the filling level of the FIFO moves towards 100 %, the data volume to be saved is reduced by the ARSCAN_E block. This happens in two stages definable via the FIFO filling level percentage. These stages are configured at the AR_MAN_E block.

Copyright Siemens AG 2009 All rights reserved

Stage 1: Stage 2: Note

the ARSCAN_E block doubles the DEADBAND internally. (only for REAL values since DEADBAND does not apply at DWORD) the ARSCAN_E block increases the archiving cycle to MAX_CYC.

Despite of this reduction of the data volume the filling level of the memory may increase to 100% - e.g. because the OS cannot accept the data fast enough or due to a failed connection and no further entries can be made in the memory.

3.3.4

Assigning the QSTATUS status word


Table 3-1 BYTE 1 15 14 13 12 11 10 9 8 7 6 5 BYTE 0 4 3 2 1 0

16

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672)
Table 3-2 Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Description QC = 16#00 (ULRANGE is archived) PTR invalid or unconnected Value not connected Byte 0 Byte 1 Value has wrong data type Security level 1 reached Security level 2 reached FIFO filling level too high (FIFO full) Archiving block from manager active SUB_ID <= 1 Invalid configuration of MIN_CYC & MAX_CYC DEADBAND configuration faulty (<0% or larger 100%) ULRANGE >= UHLRANGE Not assigned Not assigned Not assigned Not assigned

15

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

17

Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672)

3.3.5

Block connections

Block ARSCAN_E has the following input parameters:


Table 3-3 Input SUB_ID Data type DWORD Description Parameter for identification of the process value of an AR_SEND instance in the raw data tag. Can not be changed during runtime. Default value: 0 (must be changed) Receives the cycle time during OB compilation by calling the block. Lower limit of measuring range (relevant only for REAL process values) Default value: 0 Upper limit of measuring range (relevant only for REAL process values) Default value: 100 Minimum change of process values regarding previous process value so the process value can be saved. (relevant only for REAL process values) Default value: 0.5 [0 = event-controlled process value acquisition off] Note: The percentage specification refers to ULRANGE and UHRANGE Minimum acquisition time (in ms) when changing the process value larger than DEADBAND. Default value: 0.0 [0 = OB cycle] Maximum acquisition time (in s) of the process value (archives the process value even if the change of the process value lies within the DEADBAND). Default value: 5.0 AS controlled triggering of an archiving process (edge-triggered). Quality code of the process value (must be interconnected or configured with 80(hex)) Pointer to FIFO of the manager block and information for the ARSCAN_E block. Process value to be acquired. This input is typically connected with the measured value block. Only DWORD or REAL values permitted. Activating the block Number of block runs AS controlled triggering of an archiving process (status-triggered).

SAMPLE_TIME ULRANGE

REAL REAL

UHRANGE

REAL

DEADBAND
Copyright Siemens AG 2009 All rights reserved

REAL

MIN_CYC

REAL

MAX_CYC

REAL

UPD_EVT QC_VALUE PTR VALUE

BOOL DWORD STRUCT ANY

EN (not visible) RUNUPCYC (not visible) UPD_COND (not visible)

BOOL INT BOOL

18

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673) Block ARSCAN_E has the following output parameters:
Table 3-4 Output QSTATUS QNUM_TRANS QPARA_ER QCONN_ER QBAD_QC QALARM_1 QALARM_2 QFIFOFUL QFIFODEG QARC_LOCK ENO (not visible) QUPD_EVT (not visible)
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Data type WORD INT BOOL BOOL BOOL BOOL BOOL BOOL INT BOOL BOOL BOOL

Description Contains the status of the ARSCAN_E Number of archived process values Error at the parameters Interconnection error Bad quality code -> ULRANGE is archived Alarm stage 1 has been reached Alarm stage 2 has been reached FIFO memory filled up to 100% (archiving the process value is not possible) Filling level of the AR_MAN_E memory (in %) Archiving of AR_MAN_E deactivated Archiving activated (except AR_MAN_E) Is set as output for a cycle if the ARSCAN_E writes to the FIFO.

3.4

Manager block AR_MAN_E (FB 673)


Figure 3-3 Standard configuration

3.4.1

Function
The central part of the AR_MAN_E block is the FIFO memory. Therefore the oldest entries in the memory are sent to WinCC first. The memory can simultaneously write the data of the ARSCAN_E blocks to the memory and read data in order to send them to the WinCC Tag Logging by means of the AR_SEND block. A send process is started if the memory has reached the configured filling level (SND_FILL) or the configured time (SND_CYC) for the send attempt has elapsed. Furthermore, the send process can be triggered manually via SND_EV.

Note

The filling level of the FIFO memory is displayed at output QFIFODEG. Output QNUMSEND displays the number of sent data blocks. Output QNUMCONNECT displays the number of connected ARSCAN_E blocks (connected with AR_MAN_E). Restart the controller to update QNUMSEND.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

19

Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)

3.4.2

Behavior during overload or failed connection


During overload of the AR_MAN_E or failed connection more process values are acquired and written to the memory than can be read from the memory and be sent to WinCC. To prevent the memory from overflowing 2 configurable security levels were implemented. In security level one the DEADBAND is doubled and the number of acquired process values reduced. The filling level for this stage is given with input ALERT_1 (in %). This security level becomes ineffective if the process values are only archived cyclically, hence the DEADBAND has been set to 0. In the second security level the archiving time of the process value is increased to the maximum archiving time. This reduces the number of acquired process values once more. The filling level for this stage is given with input ALERT_2 (in %). This security level becomes ineffective if the process values can only be archived eventcontrolled. Despite of the two security levels, the storage can be filled up completely. If the filling level has increased to 100 %, archiving the ARSCAN_E blocks is blocked until the filling level starts reducing again.

Copyright Siemens AG 2009 All rights reserved

20

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)

3.4.3

Assigning the QSTATUS status word


Table 3-5 BYTE 1 15 14 13 12 11 10 9 8 7 6 5 BYTE 0 4 3 2 1 0

Table 3-6 Bit 0 1 2 AR_ID <= 1 ALARM_1 > ALARM_2 or one of both is >=100 or one of both is <=0 SND_FILL: > ALARM_1 > ALARM_2 >=100 <=0 SND_CYC < 0 Not assigned Not assigned Not assigned Byte 1 Not assigned Not assigned Byte 0 Description FIFO is full and archiving is blocked

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

4 5 6 7 8 .. 15

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

21

Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)

3.4.4

Block connections

The AR_MAN_E block has the following input parameters:


Table 3-7 Input SAMPLE_TIME AR_ID Data type REAL DWORD Description Receives the cycle time during OB compilation by calling the block. Parameter for identification of the used AR_SEND instance in the raw data tag in the Tag Logging. Default value: 1 (automatically assigned) Filling degree of the AR_SEND FIFO in % at which a send process is triggered. Default value: 10 Note: When reaching the 10% threshold a complete AR_SEND telegram of 4 kBytes is already filled up and can be sent off. Send cycle, after this time has elapsed (in ms) the send process is triggered with the respective data. Default value: 1.0 Filling level in %, at which the security level 1 is activated. Default value: 75 Filling level in %, at which the security level 2 is activated. Default value: 85 AS controlled triggering of a transmission process (edgetriggered). Message suppression Activating the block Number of block runs Message ID of the internal ALARM_8P Default value: 0 (interface for possible messages) 10 process associated values of the ALARM_8P

SND_FILL

INT

SND_CYC

REAL

Copyright Siemens AG 2009 All rights reserved

ALERT_1 ALERT_2 SND_EVT MSG_LOCK EN (not visible) RUNUPCYC (not visible) MSG_EVID (not visible) AUX_PRO01AUX_PRO10 (not visible) L_MSGLCK (not visible)

INT INT BOOL BOOL BOOL INT DWORD

ANY

BOOL

Interconnectible message suppression

22

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673) The AR_MAN_E block has the following output parameters
Table 3-8 Output QSTATUS QSND_EVT QPARA_ER QSEND_ER QFIFOFUL QFIFODEG QNUMSEND QNUMCONN ECT QPTR MSG_STAT (not visible) MSG_ACK (not visible) QMSG_SUP (not visible) QMSG_ERR (not visible) Data type WORD BOOL BOOL BOOL BOOL INT INT INT STRUCT WORD WORD BOOL BOOL Description Serves as status message of the AR_MAN_E Is set as output for a cycle if a transmission process has been triggered. Error at the parameters Error in the sequence of the AR_SEND (no data are sent to WinCC) FIFO memory filled up to 100% (archiving the process value is not possible) Filling level of the AR_MAN_E memory (in %) Number of sent data blocks Number of connected AR_SCAN_E blocks Pointer to the start address of the FIFO active for saving and information for the ARSCAN_E block. Status of the internal ALARM_8P ACK_STATE of the internal ALARM_8P Message suppression active Error in the process of the internal ALARM_8P

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

23

Configuration and Settings 4.1 Preliminary remarks and functionality

4
4.1

Configuration and Settings


Preliminary remarks and functionality
To test the functionality of the tool / function block, we offer you a finished software example with test code and test parameters as download. These software examples support you in the first steps and tests.

Preliminary Remarks

The examples are assigned to the components used in this document and illustrate their interaction principles. However, they are not real applications in the sense of technological problem solving with definable properties.
The functionality of the blocks is identical in PCS7 and STEP7, only the configuration and interconnection differ slightly. In this document the configuration in PCS 7 and the configuration in STEP 7 for calling the function blocks by OB1 is given. Functionality in PCS 7 To run the example without an existing process in PCS7, the INT_P (standard) block for generating a test signal was used. This block generates a half-sided triangular signal in the interconnection on hand. For cyclical scanning, this signal form provides scan values in the same time interval which can be analyzed easily regarding completeness and cycle time. In Chanal 1 this example shows the CH_AI block which takes up the process value (test signal). Below the usage of the ARSCAN_E block (SCAN_1) is shown in the slightly changed standard configuration. For this configuration the process values are archived with the OB cycle time, which differ from the measuring range by 0.5 % compared with the preceding process value. If the process value does not change, it is archived every 5 seconds. In Chanal 2 the process value (test signal) is also determined with the CH_AI. The ARSCAN_E block (SCAN_2) acquires the process value with 200 ms cycle time, independent of the signal changes. The manager block (MAN_1) provides the storage area to the ARSCAN_E blocks and sends the process values to the WinCC Tag Logging. In the used standard configuration the process values are sent with 1 second cycle time to WinCC or if the memory is 10 % full.

Copyright Siemens AG 2009 All rights reserved

24

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.1 Preliminary remarks and functionality Interconnection in PCS7
Figure 4-1

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Using the already configured curves and tables in WinCC the behavior of both ARSCAN_E blocks can be analyzed.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

25

Configuration and Settings 4.1 Preliminary remarks and functionality Functionality in STEP7 To run the following example without an existing process in STEP7, the Testsignal block for generating a test signal is used. This block generates a halfsided triangular signal in the interconnection on hand. For cyclical scanning, this signal form provides scan values in the same time interval which can be analyzed easily regarding completeness and cycle time. The SCAN 1 block archives the process values in the cycle time of the cycle in which the block is called. However, the process value must have changed by 0.5% compared with the preceding archived process value. The SCAN 2 block archives the process values in the cycle time of the cycle in which the block is called. Archiving occurs independent of changing the process value. The manager block (MAN_1) provides the storage area to the ARSCAN_E blocks and sends the process values to the WinCC Tag Logging. In the used standard configuration the process values are sent with 1 second cycle time to WinCC or if the memory is 10 % full.

Copyright Siemens AG 2009 All rights reserved

26

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.2 Preparations

4.2

Preparations
When using a different hardware component than the one used in the example projects, it must be adjusted prior to configuring the HW-Config. Additionally the following points must be observed. Make sure that the time in the CPU and in WinCC have the same settings (UTC time or local time zone). PC/PG interface Select the interface you wish to use. Determine computer name: Copy/note the name given in My Computer at Computer Name. Set computer name in WinCC Double-click on the name and at Computer Name you enter the name noted in the previous point.

Project preparation

Compile SCL source


Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

To be able to use the blocks in the controller, the SCL sources must be imported and compiled. The SIMATIC Manager must have been opened with the project. In the example projects the SCL sources have already been integrated, therefore steps 1 to 6 of the subsequent table can be skipped.
Table 4-1 Step 1. Action Copy the following blocks from the Standard Library (System Function Blocks > Blocks) to the block folder of the controller. SFB37 (AR_SEND) SFC 1 (READ_CLK) SFC 6 (RD_INFO) SFC 20 (BLKMOV) Open the symbol table (Controller > S7 program) and enter the following lines unless they are already there. Symbol Test Signal ARSCAN_E AR_MAN_E DWTR Address FB671 FB672 FB673 FC671 Data type FB671 FB672 FB673 FC671 SCAN block MAN block Function of test signal Comment FB triangular signal

2.

Note: FB671 (Test Signal) and FC671(DWTR) are only required when using STEP7 and not for PCS7. 3. 4. Double-click the controller, the S7 program and the sources in the left window pane of the SIMATIC Manager. In the menu bar you click Add and External sources

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

27

Configuration and Settings 4.3 Using the example projects


Step 5. Action Select the folder in which you have unzipped the data and mark the following sources: AR_MAN_E.SCL ARSCAN_E.SCL Test-Signal.SCL (only required for testing STEP 7 without CFC plan) DTWR.AWL (only required for testing STEP 7 without CFC plan) Acknowledge the selection with Open. The sources then become visible in the SIMATIC Manager. Select the sources (in Controller, S7 program and Sources) and click Edit and then Compile in the menu bar. When queried whether the blocks shall be overwritten, acknowledge with Yes if necessary. Close the SCL editor in Step7 the LAD/STL/FBD editor.

6. 7.

8.

If you do not wish to use the example projects continue with 5.4 Setup and configuration with PCS 7 or with 5.5 Setup and configuration with STEP 7.

4.3
Copyright Siemens AG 2009 All rights reserved

Using the example projects


To avoid error messages, you must perform or check the following steps when using the example projects:

Table 4-2 Step 9. 10. 11. 12. 13. 14. 15. Compile the controller, blocks and plans. Download the controller program into the controller. Compile the OS. WinCC opens. Right-click the respective connection and click System parameters. Click the Unit tab and select the access point as in the PC/PG interface. Note the AR-ID of the AR_MAN_E block (in the CFC plan CFC_EVT_Arch or in FB1: Network 2). Check the AR_ID in WinCC TagLogging and, if necessary, change the value to the value noted in step 4. (A detailed explanation for generating the TagLogging tag is available in WinCC configuration for STEP7 or WinCC configuration for PCS 7) Action

The given configuration has already been performed in the example projects and can be skipped when using the example projects. Continue with 5.6 Operating WinCC for PCS7 and STEP7.

4.4
4.4.1

Setup and configuration with PCS 7


Requirements
The following points form the basis for the PCS 7 configuration and are not explained in the following configuration. A PCS7 project has been created. The hardware for the controller, the WinCC station and the communication have been configured and compiled.

28

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.4 Setup and configuration with PCS 7 The plant hierarchy was created. The CFC plan named CFC_EVT_Arch was created in the plant view. The WinCC picture SCAN VALUE.PDL contained in the EVT_Arch.zip was copied to folder GraCS of the project folder and integrated into the plant hierarchy. This picture was only used for testing the function of the blocks. Copy the picture SCAN VALUE.PDL to folder GraCS of the WinCC project folder. In the SIMATIC Manager you right-click the OS (SIMATIC PC Station > WinCC Application > OS) and select the menu item Import WinCC objects. Select the imported picture and click on Edit > Cut. Go to the technology view, select the respective hierarchy folder and click Edit > Paste in the menu bar.

4.4.2

Add blocks to CFC plan


Open the CFC plan and integrate the block from the S7 program folder. The component view must be open for this.

Table 4-3
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Step 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

Action Double-click the controller, the S7 program and than the plans in the left window pane of the SIMATIC Manager. Double-click the CFC_EVT_Arch plan which the block is to be integrated into. Click Blocks tab in the left window of the CFC editor and double-click S7-Program Add the blocks (2xARSCAN_E, 1xAR_MAN_E) to the CFC plan via Drag&Drop. Click the Library tab in the left window of the CFC editor and double-click PCS 7 Library V70 > Blocks+Templates\Blocks > CONTROL Add the INT_P block to the CFC plan via Drag&Drop. Click the Library tab in the left window of the CFC editor and double-click PCS 7 Library V70 > Blocks+Templates\Blocks > DRIVER Add the CH_AI block two times to the CFC plan via Drag&Drop. Align the inserted blocks clearly (as displayed in Figure 4-1). Double-click the respective block and enter the changes of the following table: No. Block General tab Field 16. 17. 18. 19. 20. 21. 22. 23. INT_P CH_AI (1) CH_AI (2) ARSCAN_E (1) ARSCAN_E (2) ARSCAN_E (2) ARSCAN_E (2) AR_MAN_E Name MAN_1 Name Name Name Name Name Entry Test_Signal Chanal 1 Chanal 2 SCAN_1 SCAN_2 U SIM_ON SIM_ON SUB_ID SUB_ID DEADBAND MIN_CYC Connections tab Connection 1 1 2 3 0.0 0.2 New value 10

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

29

Configuration and Settings 4.4 Setup and configuration with PCS 7


Step 11. Action Interconnect blocks using the following table and then close the CFC plan. No Block 24. 25. 26. 27. 28. 29. 30. 31. 32. 12. 13.
Copyright Siemens AG 2009 All rights reserved

Output Connection QVHL V V V QUALITY V QUALITY QPTR QPTR Block Test_Signal Chanal 1 Chanal 2 SCAN_1 SCAN_1 SCAN_2 SCAN_2 SCAN_1 SCAN_2

Input Connection TRACK SIM_V SIM_V VALUE QC_VALUE VALUE QC_VALUE PTR PTR

Test_Signal Test_Signal Test_Signal Chanal 1 Chanal 1 Chanal 2 Chanal 2 MAN_1 MAN_1

In the SIMATIC Manager you click on SIMATIC 400 and then on PLC > Compile and Download objects. Compile and load the entire control project. Double-click SIMATIC PC Station > WinCC Application, right-click OS and click Compile. Compile the OS.

30

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.4 Setup and configuration with PCS 7

4.4.3

WinCC configuration for PCS7

Set access point to WinCC


Table 4-4 Step 1. 2. Action Right-click the respective connection and click System parameters. Click the Unit tab and select the access point as in the PC/PG interface.

Configure process-controlled tags Here the process display SCAN_VALUE with the display of the archive tag in curves and in a table are available. For this example, the process-controlled tags SCAN_1 und SCAN_2 have been created in a process value archive. Please make sure that the raw data tag, the AR_ID, and the sub-number for each process value are set according to the parameterization in the CFC. The following instructions will show the step by step configuration of the processcontrolled tag SCAN_1.
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Table 4-5 Step 1. 2. 3. Action In the WinCC Explorer you open the Tag Logging editor, right-click on Archive and click the Archive Wizard.. Follow the Wizard and create a process value archive without archive tag. In the generated process value archive, right-click on the lower data pane. In the context menu, select New Process Controlled Tag.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

31

Configuration and Settings 4.4 Setup and configuration with PCS 7


Step 4. Action

Use the dialog to define the properties of the process-controlled tags. In the Conversion DLL field you select the entry nrms7pmc.nll.

5.
Copyright Siemens AG 2009 All rights reserved

Select the raw data tag by means of the Select button. Double-click the raw data tag S7-Programm(1)#RawArchiv to open the dialog for entering the AR_ID and the sub-number. Please make sure that the raw data tag, the AR_ID and the sub-ID for each process value are set according to the parameterization in the CFC.

32

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.4 Setup and configuration with PCS 7


Step 6. Action After entering both ID numbers, also enter the archive tag name SCAN_1. The unique internal archive tag name is composed of: the raw data tag #S7-Prgramm(1)#RawArchiv the AR_ID number which must comply with the AR_ID parameter at the AR_MAN_E block the sub-number which must comply with the SUB_ID parameter at the ARSCAN_E block

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

7.

Repeat steps 3-6 for the second process-controlled tag SCAN_2. Note that the value of the Sub-ID for SCAN_2 changes, but the AR_ID have the same value as SCAN_1.

Continue with 5.6 Operating WinCC for PCS7 and STEP7.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

33

Configuration and Settings 4.5 Setup and configuration with STEP 7 Adjusting the WinCC picture
Table 4-6 Step 1. 2. 3. 4. 5. Action Click on the Graphics Designer and double-click the SCAN_VALUES image to open the picture. Double-click the respective Control (WinCC Online Trend Control or WinCC Online Table Control). In the Curves tab you select a curve (e.g. Curve1) and specify a name for the curve in Name: As Data supply: you select Archive tags (only for WinCC Online Trend Control). Click the Selection button. In the opened dialog you double-click the process value archive and the process-controlled tag.

4.5

Setup and configuration with STEP 7


For the configuration in STEP 7 there are basically three options to call up the function blocks. 1. Calling up the function blocks in the CFC plan. 2. Calling up the function blocks in the OB1 or in a function block which is called up in the OB1. 3. Calling up the function blocks in a cyclic interrupt OB (OB30 to OB38) The configuration of the blocks with STEP 7 and the CFC plan option is the same as for the given configuration for PCS 7. When using the cyclic interrupt OBs (option 3) only the required function block needs to be called up in the respective OB. Alternatively the blocks ARSCAN_E and AR_MAN_E can be called up in a function block which in return is called up in the respective OB. This option provides the advantage that the cycle time of the OBs in HW Config can be set with a precision in the milliseconds range. When using OB1 or a function block which is called up in OB1, an edge-controlled activation of the function block must be implemented in addition to calling the function block. To keep the expenses during configuration and the CPU load as low as possible a clock memory is recommended. The times of the respective inputs are then no longer given in seconds but as a multiple of the activation cycle of the block.

Preliminary Remarks
Copyright Siemens AG 2009 All rights reserved

4.5.1

Precondition
The following points form the basis for the STEP7 7 configuration and are not explained in the following configuration. A STEP7 project has been created. The hardware for the controller, the WinCC station and the communication have been configured and compiled. The WinCC picture SCAN VALUE.PDL contained in the EVT_Arch.zip was copied to folder GraCS of the project folder and integrated into the Picture Tree Manager. This picture was only used for testing the function of the blocks. Start the Picture Tree Manager.

34

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7 Add a container via Drag&Drop Add the picture SCAN-VALUE via Drag&Drop

4.5.2

Integrating the blocks into a function block (STEP 7)


The function blocks of the EVT_Arch library can also be integrated in STEP 7 using the LAD/STL/FBD editor. The following points must be noted here: The blocks must be activated for one editing cycle using an edge. The cycle time for calling the blocks must be implemented via the clock memory or a timer. The times (e.g. MAX_CYC, SND_CYC) must be given as a multiple of the cycle time of the respective block.

Generating a clock memory


Table 4-7 Step 1. 2.
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Action Click the controller in the tree view and double-click the hardware in the Details window of the SIMATIC Manager. HW Config opens. Double-click the configured CPU and select the Cycle / Clock Memory tab. Activate the Clock Memory checkbox and enter a number for the clock memory. (Memory byte 100 in this example) Click on Station in the menu bar and select Save and Close. Close HW Config.

3. 4. 5.

Entering the required tags into the symbol table For detecting an edge of a cycle (in this example a positive edge), two further bits are required in addition to the clock memory bit. These three tags per edge must be created in the symbol table in order to call the blocks using the clock memory. The tags need not be created if the blocks are called using the cyclic interrupt OB. To enter the tags into the symbol table, the project must be opened in the SIMATIC MANAGER.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

35

Configuration and Settings 4.5 Setup and configuration with STEP 7


Table 4-8 Step 1. 2. Action Double-click on the controller and then on S7 program in the left window pane of the SIMATIC Manager and on Symbols in the right window pane. The following entries have already been created during the configuration. Symbol Test-Signal ARSCAN_E AR_MAN_E DWTR AR_SEND READ_CLK RD_SINFO BLKMOV Address FB671 FB672 FB673 FC671 SFB 37 SFC 1 SFC 6 SFC 20 Data type FB671 FB672 FB673 FC671 SFB SFC SFC SFC 37 1 6 20 Read System Clock Read OB Start Information Copy Tags SCAN block MAN block Function of test signal Comment FB triangular signal

In the opened symbol editor you enter the following tags for the edge detection:
Copyright Siemens AG 2009 All rights reserved

Symbol M_1s M_500ms Flanke_500ms Flanke_1s 500ms cycle 1s cycle 3.

Address M 90.2 M 90.3 M 90.4 M 90.5 M 100.3 M 100.5

Data type BOOL BOOL BOOL BOOL BOOL BOOL

Comment Memory bit for 1sec edge Memory bit for 500sec edge Edge 500ms Edge 1sec Clock memory with 500ms cycle time Clock memory with 1ms cycle time

Also add the following tags. Symbol Signal-Takt vReal vDWord Address M 100.1 MD 50 MD 54 Data type BOOL REAL DWORD Comment Cycle of the test signal Test signal REAL value Test signal DWORD value

4.

Click on File in the menu bar and then on Save and Close.

36

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7 Calling blocks (STEP 7) The specified blocks were called with German mnemonics. The settings can be changed in the SIMATIC Manager at Options > Settings in the Language tab. For English mnemonics the source code must be changed accordingly. The given source code can be copied directly into the networks via Copy and Paste if the data blocks DB19-DB22 are not used in the project.

Note

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

37

Configuration and Settings 4.5 Setup and configuration with STEP 7

Table 4-9 Step 1. 2. 3. 4. Action Mark the block folder (at Controller, S7 Program, Block) and click Add, S7 block, Function block. Specify a name (e.g. FB1) as well a symbolic name (e.g. EVT_Arch) for the block and acknowledge with OK Open the (created) block (in this example FB1) with a double-click and create three networks by clicking Add > Network three times successively Enter the following lines in the first network to call the test signal block: CALL "Test-Signal" , DB19 CLOCK_PULSE:="Signal-Takt" VALUE_REAL :="vReal" VALUE_DWORD:="vDWord" 5. Enter the following lines into the second network to call the AR_MAN_E block: (The selected lines may be skipped when calling with cyclic interrupt OBs.) U "1s-Takt" FP "M_1s" = "Flanke_1s" CALL "AR_MAN_E" , DB20 ENABLE :="Flanke_1s" RUNUPCYC :=10 SAMPLE_TIME:=1.000000e+000 AR_ID :=DW#16#1 SND_FILL :=10 SND_CYC :=1.000000e+000 MSG_EVID :=DW#16#2 ALERT_1 :=75 ALERT_2 :=85 SND_EVT :=FALSE MSG_LOCK :=FALSE L_MSGLCK :=FALSE 6. Enter the following lines into the third network to call the first ARSCAN_E block: (The selected lines may be skipped when calling with cyclic interrupt OBs.) U "500ms-Takt" FP "M_500ms" = "Flanke_500ms" CALL "ARSCAN_E" , DB21 ENABLE :="Flanke_500ms" RUNUPCYC :=10 SUB_ID :=W#16#2 SAMPLE_TIME:=1.000000e+000 ULRANGE :=0.000000e+000 UHRANGE :=1.000000e+002 DEADBAND :=1.000000e+000 MIN_CYC :=0.000000e+000 MAX_CYC :=1.000000e+001

Copyright Siemens AG 2009 All rights reserved

38

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7


Step UPD_EVT :=FALSE UPD_COND :=FALSE QC_VALUE :=B#16#80 PTR :=DB20.QPTR QSTATUS := QNUM_TRANS := QUPD_EVT := QPARA_ER := QCONN_ER := QBAD_QC := QALARM_1 := QALARM_2 := QFIFOFUL := QFIFODEG := QARC_LOK := VALUE :="vReal" 7. Enter the following lines in the fourth network (if necessary adjust the data bock number) to call the second ARSCAN_E block: CALL "ARSCAN_E" , DB22 ENABLE :="Flanke_500ms" RUNUPCYC :=10 SUB_ID :=W#16#3 SAMPLE_TIME:=1.000000e+000 ULRANGE :=0.000000e+000 UHRANGE :=1.000000e+002 DEADBAND :=0.000000e+000 MIN_CYC :=0.000000e+000 MAX_CYC :=1.000000e+000 UPD_EVT :=FALSE UPD_COND :=FALSE QC_VALUE :=B#16#80 PTR :=DB20.QPTR QSTATUS := QNUM_TRANS := QUPD_EVT := QPARA_ER := QCONN_ER := QBAD_QC := QALARM_1 := QALARM_2 := QFIFOFUL := QFIFODEG := QARC_LOK := VALUE :="vReal" 8. 9. 10. 11. 12. Save and close the block by clicking File > Save and then File > Exit Double-click block OB1 in the block folder of your CPU to open it. Click Add > Network and enter the following line in the network. CALL "EVT_Arch" , DB18 Save and close the block by clicking File > Save and then File > Exit In the SIMATIC Manager you click on SIMATIC 400 and then on PLC > Compile and Action

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

39

Configuration and Settings 4.5 Setup and configuration with STEP 7


Step 13. Action Download objects. Compile and load the entire control project. Double-click SIMATIC PC Station > WinCC Application, right-click OS and click Compile. Compile the OS.

The following blocks and functions were created in the block folder of the controller during the configuration.
Table 4-10 Object OB1 FB1 FB671 FB672 FB673 FC671 DB18 DB19
Copyright Siemens AG 2009 All rights reserved

Symbolic Name EVT_Arch Test-Signal ARSCAN_E AR_MAN_E DTWR

Description Cyclic processing FB for event-controlled fast activation Generates a triangular signal ARSCAN_E AR_MAN_E Converts DWORD to REAL Instance DB of FB 1 Instance DB of the test signal Instance DB of AR_MAN Instance DB of AR_SCAN 1 Instance DB of AR_SCAN 2

DB20 DB21 DB22 SFB37 SFC1 SFC6 SFC20 AR_SEND READ_CLK RD_SINFO BLKMOV

Read System Clock Read OB Start Information Copy Tags

40

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7

4.5.3

WinCC configuration for STEP 7

Create connection The steps in this section only need to be performed if you do not execute the OS compilation in the SIMATIC Manager so that no connection or no raw data tag has yet been created in the Tag Management.
Table 4-11 Step 1. 2. 3. 4. 5. 6. 7. 8. 9.
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Action Click on Tag Management and then on Add New Driver. Select SIMATIC S7 Protocol Suite.chn and acknowledge with OK. Select the channel (TCP/IP in the example) and click on Edit > Properties in the menu bar. Click the New button Enter the name of the S7 Connection tag under Names and click Properties. Enter the IP address, rack number and slot number of the AS. Acknowledge both dialog fields with OK and select the created connection Right-click the connection and left-click New Tag... Enter the name of the RawArchiv tag and select the data type Raw Data Type. Click on Select" and activate the Archive Data Coupling checkbox. Close both dialog fields with OK.

10. 11.

Set access point to WinCC


Table 4-12 Step 1. 2. Action Right-click the respective connection and click System parameters. Click the Unit tab and select the access point as in the PC/PG interface.

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

41

Configuration and Settings 4.5 Setup and configuration with STEP 7 Configure process-controlled tags For this example, the process-controlled tags SCAN_1 und SCAN_2 have been created in a process value archive. Please make sure that the raw data tag, the AR_ID and the sub-ID for each process value are set according to the parameterization in the function block. The following instructions will show the step by step configuration of the processcontrolled tag SCAN_1.
Table 4-13 Step 1. 2. 3. Action In the WinCC Explorer you open the Tag Logging editor, right-click on Archive and click the Archive Wizard.. Follow the Wizard and create a process value archive without archive tag. In the generated process value archive, right-click the lower data pane. In the context menu, select New Process Controlled Tag.

Copyright Siemens AG 2009 All rights reserved

4.

Use the dialog to define the properties of the process-controlled tags. In the Conversion DLL field you select the entry nrms7pmc.nll.

42

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7


Step 5. Action Select the raw data tag by means of the Select button. Double-click the raw data tag S7-Programm(1)#RawArchiv to open the dialog for entering the AR_ID and the sub-number. Please make sure that the raw data tag, the AR_ID and the sub-ID for each process value are set according to the parameterization in the CFC.

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

43

Configuration and Settings 4.5 Setup and configuration with STEP 7


Step 6. Action After entering both ID numbers, also enter the archive tag name SCAN_1. The unique internal archive tag name is composed of: the raw data tag #S7-Prgramm(1)#RawArchiv the AR_ID number which must comply with the AR_ID parameter at the AR_MAN_E block the sub-number which must comply with the SUB_ID parameter at the ARSCAN_E block

Copyright Siemens AG 2009 All rights reserved

7.

Repeat steps 1-6 for the second process-controlled tag SCAN_2. Note that the value of the Sub-ID for SCAN_2 changes, but the AR_ID has the same value as SCAN_1.

44

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Configuration and Settings 4.5 Setup and configuration with STEP 7 Adjusting the WinCC picture
Table 4-14 Step 1. 2. 3. 4. 5. Action Click the Graphics Designer and double-click the SCAN_VALUES image to open the picture. Double-click the respective Control (WinCC Online Trend Control or WinCC Online Table Control). In the Curves tab you select a curve (e.g. Curve1) and specify a name for the curve in Name: As Data supply: you select Archive tags (only for WinCC Online Trend Control). Click the Selection button. In the opened dialog you double-click the process value archive and the process-controlled tag.

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

45

WinCC Operation for PCS7 and STEP7 4.5 Setup and configuration with STEP 7

WinCC Operation for PCS7 and STEP7


The following instruction shows you the basic functionalities of the AR_MAN_E block and the ARSCAN_E block. Value SCAN_1 is archived in this example, if the value has changed compared with the previously archived value by at least 1 % or after 5 seconds at the latest. Value SCAN_2 is archived every 500 ms independent of the value change. The AR_MAN_E block sends the archived values to the WinCC TagLogging once per second or if the memory is filled up to 10 %. However, the instruction does not show the complete function scope of the blocks and therefore also does not show all possible application options.

Table 5-1 Step 1. 2. 3. Start WinCC Runtime. When calling up the SCAN-VALUES picture, the left window pane displays the archived values of SCAN 1 and SCAN 2 and the two Table Control objects (tables). The same values are in the right Trend Control object displayed as curves. Using these two objects the archiving can be easily searched for gaps and other irregularities. Action Start WinCC with a right-click on OS and click on Object before WinCC has been opened.

Copyright Siemens AG 2009 All rights reserved

4. 5. 6. 7. 8. 9.

Use ALT + TAB to go to the SIMATIC MANAGER and open the CFC plan in which the blocks are integrated. In the menu bar you click Test and then Test mode If queried whether to log on the CPU for the test confirm with Yes. Double-click the DEADBAND connection of the SCAN_1 block, change the value to 5.0 and click on OK. Double-click the MAX_CYC connection of the SCAN_2 block, change the value to 1 and click on OK. Double-click the SND_CYC connection of the MAN_1 block, change the value to 5 and click on OK.

46

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

WinCC Operation for PCS7 and STEP7 4.5 Setup and configuration with STEP 7
Step 10. Action The following picture clearly shows that the number of archived process value has declined compared with the preceding picture and the data update (sending the data to WinCC) takes longer.

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

47

Fehler! Formatvorlage nicht definiert.

History
Table 6-1 History Version V1.0 V1.1 Date 20.12.2006 30.03.2009 First issue Changing the time calculation from TIME to REAL Supplementing the following block connections/functions SAMPLE_TIME / cycle time of the OB QFIFODEG / filling level of the memory QNUM_TRANS / archived process value QNUMSEND / sent data blocks QNUMCONNECT / ARSCAN_E connected Modification

Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc

48

Event-controlled (fast) Process Value Acquisition V1.1, Entry ID: 23780904

Вам также может понравиться