show the entry list
WinCC -- Configuring Tag Logging -- Parameterizing Tag Logging
How can you increase the timeout for starting and terminating Alarm Logging / Tag Logging?
In WinCC, how can you assign the functions of the toolbar buttons of Online Trend Controls to external buttons?
Why, when you select the curve window with the "Read data immediately from archive" option activated, isn't there any data displayed?
What Smart Tools are there for WinCC?
What are the different types of tags available under licensing law?
Why are archive tags not deleted in the Tag Logging editor ?
What does parameter "Supplying tags" mean for a process tag in Tag Logging?
How can you make changes to the project on the configuration computer while the existing process values continue to be acquired and archived on the customer computer?
How can you set the archiving parameters of multiple archive tags at the same time?
Which changes can be made when configuring WinCC Tag Logging?
How can you achieve archiving cycles of less than 500ms in WinCC Tag Logging?
How can you use process-driven archiving in WinCC for a process tag with SFB37 (AR_SEND)?
How do you use SFB37 (AR_SEND) for process-driven archiving of process values in WinCC Tag Logging archives?
WinCC -- Configuring and programming communication -- Communication to S7, use of fast AR_SEND
How can you use process-driven archiving in WinCC for a process tag with SFB37 (AR_SEND)?
How do you use SFB37 (AR_SEND) for process-driven archiving of process values in WinCC Tag Logging archives?
How can you achieve archiving cycles of less than 500ms in WinCC Tag Logging?
How can you tell that WinCC has received data from AR_SEND (SFB37)?
Where is the data archived that is transferred by AR_SEND (SFB37) to WinCC?
How can you ensure that the variables in AR_SEND (SFB37) have the same time stamp?
How can you use process-driven archiving in WinCC for a process tag with SFB37 (AR_SEND)?
Part number:

Instructions:
This entry shows how you can use SFB37 (AR_SEND) to transfer one process value into a WinCC process value archive. This entry follows the procedure described in Entry ID 23629327.
 
No. Procedure
1 Defining the data format of the data to be archived
Archiving using the AR_SEND block supports different versions regarding the structure of the data to be transferred. Choose one of the possible data formats.
A detailed description of the structure of the data block to be transferred is available in the WinCC Online Help under "WinCC Information System > Communication > SIMATIC S7 Protocol Suite > Special functions > Data exchange with the S7 function block AR_SEND".

The following format has been chosen for this example in which one value of a process tag is transferred:
Header Type (INT := 9)
Year Month
Day Hours
Minutes Seconds
1/10s 1/100s 1/1000s Weekday
Cycle (DINT := 1)
Unit (Type) (BYTE := B#16#1) Unit (Range) (BYTE := B#16#1)
AR_ID Subnumber (INT := 1)
Process data - data type (INT := 5)
Number of process values (INT := 1)
Process value (REAL)

Description of the data structure elements:

  • Header Type = 9
    Header with time stamp and AR_ID subnummer.
  • Date and Time (Year, Month, Day, Hours, Minutes, Seconds, ...)
    The time stamp is filled with current system time during runtime.
  • Cycle= 1
    The process values are read out equidistantly. The starting time point is specified in the header's time stamp and is absolutely necessary. The time units of Unit (Range) and "Cycle" factor are valid for the time intervals between process values.
  • Unit (Type)= 1
    The time stamp entered in the header is valid for the process value.
  • Unit (Range)= 1
    Reserved.
  • AR_ID subnumber= 1
    Defines the assignment between the PLC process value and the WinCC archive tag.
  • Process data - data type= 5
    S7 data type = REAL.
    WinCC data type = float.
  • Number of process values = 1
    Only one process value is transferred.
  • Process value
    The process value is filled with the current value during runtime.
2 Configuring the AR_SEND send block in the STEP 7 project
For this example a function block (FB) has been created, which only realizes the core functionality of data exchange using the AR_SEND block. The data structure defined in Step 1 is filled with values and the AR_SEND block transferred for "Sending". The SFB37 (AR_SEND) is called as a multi-instance. The relevant inputs and outputs of the AR_SEND block are run on the interface of the newly created FB. In practice, depending on the case in question, you might have to program more functionalities, for example:
  • To ensure data consistency when transferring, you should not change the data during the transfer procedure. For example, you may only write to the Send area again for this purpose when the "DONE" output of the AR_SEND block has the value "1".
  • In order to reduce the communication load it is also possible to transfer data to WinCC only when there is a change in the process value. It is also possible to collect the process data upon change of value in the data structure to be transferred and then send it upon the occurrence of an event that you define. For example, the data could be sent only after expiry of a maximum time or upon exceeding a defined value change (hysteresis).
  • Since you can only call the AR_SEND block a limited number of times in the S7 program, you should select a different version of data transfer using the AR_SEND block if there is a large number of measuring points to be archived. You can also transfer multiple values of different measuring points within one data block.

More information:

  1. The block has been created in the SCL language. The procedure is identical if you use a different language (STL).
  2. The data structure for the data to be transferred has been defined as UDT and is used in the FB's interface.


    Fig. 01 

    You parameterize the length of the data block to be transferred with the LEN parameter of the AR_SEND block. You can determine the length of the data area to be transferred by opening the UDT directly from the STEP 7 program's block container. In the STL editor, the length of the structure (UDT) is then shown in bytes in the last line.


    Fig. 02
  3. You run the input AR_ID AR_SEND block externally and assign the system attributes S7_server:='alarm_archiv' and S7_a_type:='ar_send'. In this way STEP 7 assigns a unique, continuous AR_ID when incorporating the FB in the program. The following two figures show the block for the languages SCL and STL.
     
    SCL STL

    Fig. 03

    Fig. 04
  4. The following two figures show the block call in the CFC chart and in STL.
     
    CFC STL

    Fig. 05

    Fig. 06

    If you use the block in the STEP 7 program, you can determine the current system time via SFC1 (READCLK  Read System Clock) and store it in a global data block. You can interconnect this data with the block's "Time Stamp" input.

You can download the block as SCL and STL source.

WinCC_ArSendOnePV.zip ( 3 KB )

You can use Copy/Paste to insert the relevant source in the SCL or STL editor. In order to compile this source successfully, you should define the the numbers for the UDT and the FB beforehand in the symbol table.


Fig. 07

3 Configuring process-driven archiving in WinCC
Configuration of this step is described in detail in the Entry ID 23629327 mentioned above and in the WinCC Online Help. For the sake of completeness we will list the major steps again:
  • WinCC Tag Manager: set up connection in the SIMATIC S7 Protocol Suite
  • WinCC Tag Manager: create the raw data tag of the raw data type "Archive Data Link"
  • WinCC Tag Logging: create process-controlled archive tag

 Entry ID:23629424   Date:2008-09-22 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour