Upload
wwwotomasyonegitimicom
View
219
Download
0
Embed Size (px)
Citation preview
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
1/48
Applikationen & ToolsAnswers for industry.
Cover
Event-controlled (fast) Process ValueAcquisition using the AR_SENDFunction
WinCC and PCS 7 OS
Configuration Instruction August 2009
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
2/48
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
3/48
Warranty, Liability and Support
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 3
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Industry Automation and Drives Technologies Service & Support PortalThis article is taken from the Service Portal of Siemens AG, Industry Automationand Drives Technologies. The following link takes you directly to the downloadpage of this document.
http://support.automation.siemens.com/WW/view/en/23780904
http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/237809048/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
4/48
Automation Task
2.1 Overview of the overall solution
4Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Table of Contents1 Automation Task .................................................................................. 52
Automation Solution ............................................................................. 6
2.1 Overview of the overall solution ........................................................... 62.2 Description of the core functionality ..................................................... 72.3 Hardware and software components used........................................... 9
3 Function Mechanisms of this Application........................................... 113.1 Data transfer using AR_SEND........................................................... 113.2 General Information............................................................................ 133.3 Scan block ARSCAN_E (FB 672) ...................................................... 143.3.1 Function.............................................................................................. 143.3.2 Event-controlled or cyclic process value acquisition.......................... 153.3.3 Behavior during overload or failed connection................................... 163.3.4 Assigning the QSTATUS status word ................................................ 163.3.5 Block connections .............................................................................. 18
3.4
Manager block AR_MAN_E (FB 673) ................................................ 19
3.4.1 Function.............................................................................................. 193.4.2 Behavior during overload or failed connection................................... 203.4.3 Assigning the QSTATUS status word ................................................ 213.4.4 Block connections .............................................................................. 22
4 Configuration and Settings................................................................. 244.1 Preliminary remarks and functionality ................................................ 244.2 Preparations ....................................................................................... 274.3 Using the example projects................................................................ 284.4 Setup and configuration with PCS 7 .................................................. 284.4.1 Requirements ..................................................................................... 284.4.2 Add blocks to CFC plan...................................................................... 29
4.4.3
WinCC configuration for PCS7........................................................... 314.5 Setup and configuration with STEP 7 ................................................ 34
4.5.1 Precondition ....................................................................................... 344.5.2 Integrating the blocks into a function block (STEP 7) ........................ 354.5.3 WinCC configuration for STEP 7........................................................ 41
5 WinCC Operation for PCS7 and STEP7............................................ 466 History ................................................................................................ 48
http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/237809048/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
5/48
Automation Task
2.1 Overview of the overall solution
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 5
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
1 Automation Task
Description of the automation problemProcess 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 loadshall be kept as low as possible.
Communication shall be based on the AR_SEND method.
Figure 1-1
AS
Update rate
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
6/48
Automation Solution
2.1 Overview of the overall solution
6Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
2 Automation SolutionThe available function block AR_SEND (SFB 37 in S7-400) can be used to storedata 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 (
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
7/48
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
8/48
Automation Solution
2.2 Description of the core functionality
8Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Request for sending data from the OS station
Automatic telegram repetition in case of an error
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
9/48
Automation Solution
2.3 Hardware and software components used
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 9
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
2.3 Hardware and software components used
The application was generated with the following components:
Hardware components
Table 2-1
Component Qty. MLFB / order number Note
Rack 1 6ES7 400-1TA01-0AA0 Or comparable
Power supply PS 405 1 6ES7 405-0KA00-0AA0 Or comparable
S7 -416-3 PN/DP 1 6ES7 416-3ER05-0AB0 Or comparableS7-400S7-400 H
Software components
Table 2-2
Component Qty. MLFB / order number Note
SIMATIC PCS 7V7.0 SP1
1 6ES7 658-2AA07-0YA0(Single Station PO250)or comparable PCS 7 V7.0SP1)
Only required forPCS 7configuration.
STEP 7 V5.4 SP4 1 6ES7 810-4CC08-0YA5 Only forPCS 7configuration.
WinCC 7.0 1 6AV6 381-2BM07-0AX0(128 Powetags)
Only forPCS 7configuration.
S7-SCL 1 6ES7 811-1CC05-0YA5 Only forPCS 7
configuration.HW-Update forH-CPUs
1 http://support.automation.siemens.com/WW/view/en/26609816
Only forH-CPU-project
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 Note
EVT_Arch.zip (ZIP file) Ar_man_e.scl
Arscan_e.scl
Test-Signal.SCL
Dtwr.awl
SCAN-VALUES.Pdl
EVT_ Arch_PCS7.zip (PCS 7project)
EVT_Arch_H.zip (PCS 7-project with H-CPU)
EVT_Arch_STEP7.zip (STEP7 project)
http://support.automation.siemens.com/WW/view/en/26609816http://support.automation.siemens.com/WW/view/en/26609816http://support.automation.siemens.com/WW/view/en/26609816http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/23780904http://support.automation.siemens.com/WW/view/en/26609816http://support.automation.siemens.com/WW/view/en/26609816http://support.automation.siemens.com/WW/view/en/266098168/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
10/48
Automation Solution
2.3 Hardware and software components used
10Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
11/48
Function Mechanisms of this Application
3.1 Data transfer using AR_SEND
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 11
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
3 Function Mechanisms of this Application
3.1 Data transfer using AR_SEND
Delimitation of the AR_SEND instances
The number of AR_SEND instances is limited per CPU and depends on the type ofCPU:
CPU S7-414 < 16 instances
CPU S7-416 < 32 instances
CPU S7-417 < 64 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 timestamps.
A 4 byte (Float/DWORD) value typically requires 26 bytes in the telegram
Headertype = 9
Year Month
Day Hour
Minute Second
1/10s 1/100s 1/1000s Weekday
Cycle = 0
Unit (type) =3 Unit (range) = 3
AR-ID sub number
Data type of the process data
22Bytes
Number of process values
4Bytes
Process value
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
12/48
Function Mechanisms of this Application
3.1 Data transfer using AR_SEND
12Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
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 orIEEE 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 bymeans of a Conversion DLL.
It is assumed that the same throughput can be achieved for this archiving processas 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 ise.g. 80 telegrams, a maximum of 40 telegrams can be processed in redundantoperation.
This may also affect the AR_SEND mechanism.
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 isreserved. This limit depends on the number of used AR_SEND blocks.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
13/48
Function Mechanisms of this Application
3.2 General Information
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 13
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
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 sendsthe data to the WinCC Tag Logging using the AR_SEND block.
Figure 3-1
FIFO
AR_SEND
Schreib-
Zeiger
WinCC Tag Logging
Lese-
Zeiger
ARMAN_E
1kB
60kB
ARSCAN_E
Kanal 1
CH_AI
AR_SEND-Subnummer
Quality-Code
Prozesswert
Prozessobjekt
ARSCAN_E
Kanal 2
CH_AI
AR_SEND-Subnummer
Quality-Code
Prozesswert
Prozessobjekt
Due to the mentioned CPU dependent limitation of the number of AR_SENDinstances only one instance of the AR_SEND send block is used per manager.This enables acquisition and sending of several process values to WinCC usingone AR_SEND instance. An AR_MAN_E can manage up to 4093 ARSCAN_Eblocks (limited by the internal AR_SEND block). However, the actual number ofARSCAN_E blocks is reduced by the respective data volume and the individualapplication.
Process object
Process object
AR_SEND subnumber
Process value
AR_SEND subnumber
Process value
Writepointer
Readpointer
Channel 1
Channel 2
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
14/48
Function Mechanisms of this Application
3.3 Scan block ARSCAN_E (FB 672)
14Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
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. TheARSCAN_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 eachchannel to be archived.) Each ARSCAN_E block is assigned to an AR_MAN_Eblock.
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 valueblock (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 ULRANGEand UHRANGE. The acquired process value is checked for validity (Quality CodeQC) and for modifications.
A value change occurs at data type REAL if the process value has changed by acertain value compared with the last acquired process value. The user can set thismodification by means of a percentage value related to the measuring range(DEADBAND). For connected data type DWORD a binary change monitoring isreached, i.e. the DEADBAND parameter is ignored. Therefore an even-controlledacquisition of process values is not possible.
The acquisition velocity depends on the integration time of the AI module, the scancycle 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 CFCconnection. If a process change is now detected and the minimum archiving time(MIN_CYC) has elapsed, the ARSCAN_E block writes the process value withappropriate:
Time stamp
Data type
Sub-ID
into a specially reserved memory area in the instance DB of the manager block(FIFO).
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
15/48
Function Mechanisms of this Application
3.3 Scan block ARSCAN_E (FB 672)
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 15
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
If the minimum archiving time (MIN_CYC) has the value 0, then archiving takesplace in the OB cycle of the ARSCAN_E block.
If the process value changes within the maximum archiving time (MAX_CYC) by apercentage lower than the DEADBAND value, the current process value is saved
automatically after this time has elapsed. Especially after a system startup of theOS this ensures that after time MAX_CYC has elapsed at the latest a current valueis entered into the memory. If the maximum archiving time (MAX_CYC) has thevalue 0, then the just described automatic archiving is switched off.
Note After archiving a process value output QNUM_TRANS is increased by 1. Thefilling 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.
This reduces the stored data volume considerably and can be adjusted toindividual requirements. The settings described below enables using thesubfunctions 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 valuecompared with the previously archived process value has exceeded the valueconfigured at DEADBAND (percentage regarding measuring range).
Note Security level 2 (increasing archiving cycle to MAX_CYC) is ineffective.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
16/48
Function Mechanisms of this Application
3.3 Scan block ARSCAN_E (FB 672)
16Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
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. Themeasuring 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 theminimum cycle time is restricted by the cycle time of the OB by calling theARSEND_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 datavolume to be saved is reduced by the ARSCAN_E block. This happens in twostages definable via the FIFO filling level percentage. These stages are configuredat the AR_MAN_E block.
Stage 1: the ARSCAN_E block doubles the DEADBAND internally. (only forREAL values since DEADBAND does not apply at DWORD)
Stage 2: the ARSCAN_E block increases the archiving cycle to MAX_CYC.
Note Despite of this reduction of the data volume the filling level of the memory mayincrease to 100% - e.g. because the OS cannot accept the data fast enough ordue 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 BYTE 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
17/48
Function Mechanisms of this Application
3.3 Scan block ARSCAN_E (FB 672)
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 17
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Table 3-2
Bit Description
0 QC = 16#00 (ULRANGE is archived)
1 PTR invalid or unconnected
2 Value not connected
3 Value has wrong data type
4 Security level 1 reached
5 Security level 2 reached
6 FIFO filling level too high (FIFO full)
7
Byte0
Archiving block from manager active
8 SUB_ID
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
18/48
Function Mechanisms of this Application
3.3 Scan block ARSCAN_E (FB 672)
18Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
3.3.5 Block connections
Block ARSCAN_E has the following input parameters:
Table 3-3
Input Data type Description
SUB_ID DWORD Parameter for identification of the process value of anAR_SEND instance in the raw data tag. Can not bechanged during runtime.
Default value: 0(must be changed)
SAMPLE_TIME REAL Receives the cycle time during OB compilation bycalling the block.
ULRANGE REAL Lower limit of measuring range
(relevant only for REAL process values)
Default value: 0
UHRANGE REAL Upper limit of measuring range
(relevant only for REAL process values)
Default value: 100
DEADBAND REAL Minimum change of process values regardingprevious process value so the process value can besaved.
(relevant only for REAL process values)
Default value: 0.5
[0 = event-controlled process value acquisition off]
Note: The percentage specification refers toULRANGE and UHRANGE
MIN_CYC REAL Minimum acquisition time (in ms) when changing the
process value larger than DEADBAND.Default value: 0.0
[0 = OB cycle]
MAX_CYC REAL Maximum acquisition time (in s) of the process value(archives the process value even if the change of theprocess value lies within the DEADBAND).
Default value: 5.0
UPD_EVT BOOL AS controlled triggering of an archiving process(edge-triggered).
QC_VALUE DWORD Quality code of the process value (must beinterconnected or configured with 80(hex))
PTR STRUCT Pointer to FIFO of the manager block and information
for the ARSCAN_E block.VALUE ANY Process value to be acquired.
This input is typically connected with the measuredvalue block.
Only DWORD or REAL values permitted.
EN(not visible)
BOOL Activating the block
RUNUPCYC(not visible)
INT Number of block runs
UPD_COND(not visible)
BOOL AS controlled triggering of an archiving process(status-triggered).
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
19/48
Function Mechanisms of this Application
3.4 Manager block AR_MAN_E (FB 673)
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 19
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Block ARSCAN_E has the following output parameters:
Table 3-4
Output Data type Description
QSTATUS WORD Contains the status of the ARSCAN_E
QNUM_TRANS INT Number of archived process values
QPARA_ER BOOL Error at the parameters
QCONN_ER BOOL Interconnection error
QBAD_QC BOOL Bad quality code -> ULRANGE is archived
QALARM_1 BOOL Alarm stage 1 has been reached
QALARM_2 BOOL Alarm stage 2 has been reached
QFIFOFUL BOOL FIFO memory filled up to 100% (archiving theprocess value is not possible)
QFIFODEG INT Filling level of the AR_MAN_E memory (in %)
QARC_LOCK BOOL Archiving of AR_MAN_E deactivatedENO(not visible)
BOOL Archiving activated (except AR_MAN_E)
QUPD_EVT(not visible)
BOOL Is set as output for a cycle if the ARSCAN_E writes tothe 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 oldestentries in the memory are sent to WinCC first. The memory can simultaneouslywrite the data of the ARSCAN_E blocks to the memory and read data in order tosend 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.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
20/48
Function Mechanisms of this Application
3.4 Manager block AR_MAN_E (FB 673)
20Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
3.4.2 Behavior during overload or failed connection
During overload of the AR_MAN_E or failed connection more process values areacquired and written to the memory than can be read from the memory and be sentto WinCC. To prevent the memory from overflowing 2 configurable security levelswere implemented.
In security level one the DEADBAND is doubled and the number of acquiredprocess 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 archivedcyclically, hence the DEADBAND has been set to 0.
In the second security level the archiving time of the process value is increased tothe maximum archiving time. This reduces the number of acquired process valuesonce 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 event-controlled.
Despite of the two security levels, the storage can be filled up completely. If thefilling level has increased to 100 %, archiving the ARSCAN_E blocks is blockeduntil the filling level starts reducing again.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
21/48
Function Mechanisms of this Application
3.4 Manager block AR_MAN_E (FB 673)
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 21
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
3.4.3 Assigning the QSTATUS status word
Table 3-5
BYTE 1 BYTE 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Table 3-6
Bit Description
0 FIFO is full and archiving is blocked
1 AR_ID ALARM_2
or one of both is >=100
or one of both is ALARM_1
> ALARM_2
>=100
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
22/48
Function Mechanisms of this Application
3.4 Manager block AR_MAN_E (FB 673)
22Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
3.4.4 Block connections
The AR_MAN_E block has the following input parameters:
Table 3-7
Input Datatype
Description
SAMPLE_TIME REAL Receives the cycle time during OB compilation by calling theblock.
AR_ID DWORD Parameter for identification of the used AR_SEND instancein the raw data tag in the Tag Logging.
Default value: 1 (automatically assigned)
SND_FILL INT Filling degree of the AR_SEND FIFO in % at which a sendprocess is triggered.
Default value: 10
Note: When reaching the 10% threshold a completeAR_SEND telegram of 4 kBytes is already filled up and canbe sent off.
SND_CYC REAL Send cycle, after this time has elapsed (in ms) the sendprocess is triggered with the respective data.
Default value: 1.0
ALERT_1 INT Filling level in %, at which the security level 1 is activated.
Default value: 75
ALERT_2 INT Filling level in %, at which the security level 2 is activated.
Default value: 85
SND_EVT BOOL AS controlled triggering of a transmission process (edge-triggered).
MSG_LOCK BOOL Message suppressionEN(not visible)
BOOL Activating the block
RUNUPCYC(not visible)
INT Number of block runs
MSG_EVID(not visible)
DWORD Message ID of the internal ALARM_8P
Default value: 0
(interface for possible messages)
AUX_PRO01-AUX_PRO10(not visible)
ANY 10 process associated values of the ALARM_8P
L_MSGLCK
(not visible)
BOOL Interconnectible message suppression
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
23/48
Function Mechanisms of this Application
3.4 Manager block AR_MAN_E (FB 673)
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 23
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
The AR_MAN_E block has the following output parameters
Table 3-8
Output Data type DescriptionQSTATUS WORD Serves as status message of the AR_MAN_E
QSND_EVT BOOL Is set as output for a cycle if a transmission processhas been triggered.
QPARA_ER BOOL Error at the parameters
QSEND_ER BOOL Error in the sequence of the AR_SEND (no data aresent to WinCC)
QFIFOFUL BOOL FIFO memory filled up to 100% (archiving theprocess value is not possible)
QFIFODEG INT Filling level of the AR_MAN_E memory (in %)
QNUMSEND INT Number of sent data blocks
QNUMCONNECT
INT Number of connected AR_SCAN_E blocks
QPTR STRUCT Pointer to the start address of the FIFO active forsaving and information for the ARSCAN_E block.
MSG_STAT(not visible)
WORD Status of the internal ALARM_8P
MSG_ACK(not visible)
WORD ACK_STATE of the internal ALARM_8P
QMSG_SUP(not visible)
BOOL Message suppression active
QMSG_ERR(not visible)
BOOL Error in the process of the internal ALARM_8P
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
24/48
Configuration and Settings
4.1 Preliminary remarks and functionality
24Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
4 Configuration and Settings
4.1 Preliminary remarks and functionality
Preliminary Remarks
To test the functionality of the tool / function block, we offer you a finished softwareexample with test code and test parameters as download. These softwareexamples support you in the first steps and tests.
The examples are assigned to the components used in this document andillustrate their interaction principles. However, they are not real applicationsin the sense of technological problem solving with definable properties.
The functionality of the blocks is identical in PCS7 and STEP7, only theconfiguration 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-sidedtriangular signal in the interconnection on hand. For cyclical scanning, this signalform provides scan values in the same time interval which can be analyzed easilyregarding completeness and cycle time.
In Chanal 1 this example shows the CH_AI block which takes up the processvalue (test signal). Below the usage of the ARSCAN_E block (SCAN_1) is shownin the slightly changed standard configuration. For this configuration the processvalues 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 notchange, 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 cycletime, independent of the signal changes.
The manager block (MAN_1) provides the storage area to the ARSCAN_E blocksand sends the process values to the WinCC Tag Logging. In the used standardconfiguration the process values are sent with 1 second cycle time to WinCC or ifthe memory is 10 % full.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
25/48
Configuration and Settings
4.1 Preliminary remarks and functionality
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 25
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Interconnection in PCS7
Figure 4-1
Using the already configured curves and tables in WinCC the behavior of both
ARSCAN_E blocks can be analyzed.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
26/48
Configuration and Settings
4.1 Preliminary remarks and functionality
26Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Functionality in STEP7
To run the following example without an existing process in STEP7, theTestsignal block for generating a test signal is used. This block generates a half-
sided triangular signal in the interconnection on hand. For cyclical scanning, thissignal form provides scan values in the same time interval which can be analyzedeasily regarding completeness and cycle time.
The SCAN 1 block archives the process values in the cycle time of the cycle inwhich 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 inwhich the block is called. Archiving occurs independent of changing the processvalue.
The manager block (MAN_1) provides the storage area to the ARSCAN_E blocksand sends the process values to the WinCC Tag Logging. In the used standardconfiguration the process values are sent with 1 second cycle time to WinCC or if
the memory is 10 % full.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
27/48
Configuration and Settings
4.2 Preparations
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 27
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
4.2 Preparations
Project preparation
When using a different hardware component than the one used in the exampleprojects, it must be adjusted prior to configuring the HW-Config. Additionally thefollowing 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 interfaceSelect the interface you wish to use.
Determine computer name:Copy/note the name given in My Computer at Computer Name.
Set computer name in WinCCDouble-click on the name and at Computer Name you enter the name noted in
the previous point.
Compile SCL source
To be able to use the blocks in the controller, the SCL sources must be importedand compiled. The SIMATIC Manager must have been opened with the project. Inthe example projects the SCL sources have already been integrated, thereforesteps 1 to 6 of the subsequent table can be skipped.
Table 4-1
Step Action
1. 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)
2. Open the symbol table (Controller > S7 program) and enter the following lines unless theyare already there.
Symbol Address Data type Comment
Test Signal FB671 FB671 FB triangular signal
ARSCAN_E FB672 FB672 SCAN block
AR_MAN_E FB673 FB673 MAN block
DWTR FC671 FC671 Function of test signal
Note:
FB671 (Test Signal) and FC671(DWTR) are only required when using STEP7 and not forPCS7.
3. Double-click the controller, the S7 program and the sources in the left window pane of theSIMATIC Manager.
4. In the menu bar you click Add and External sources
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
28/48
Configuration and Settings
4.3 Using the example projects
28Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Step Action
5. 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)
6. Acknowledge the selection with Open. The sources then become visible in the SIMATICManager.
7. Select the sources (in Controller, S7 program and Sources) and click Edit and then Compile inthe menu bar. When queried whether the blocks shall be overwritten, acknowledge with Yesif necessary.
8. Close the SCL editor in Step7 the LAD/STL/FBD editor.
If you do not wish to use the example projects continue with5.4 Setup and configuration with PCS 7 or with5.5 Setup and configuration with STEP 7.
4.3 Using the example projects
To avoid error messages, you must perform or check the following steps whenusing the example projects:
Table 4-2
Step Action
9. Compile the controller, blocks and plans.
10. Download the controller program into the controller.
11. Compile the OS. WinCC opens.12. Right-click the respective connection and click System parameters.
13. Click the Unit tab and select the access point as in the PC/PG interface.
14. Note the AR-ID of the AR_MAN_E block (in the CFC plan CFC_EVT_Arch or in FB1: Network2).
15. Check the AR_ID in WinCC TagLogging and, if necessary, change the value to the valuenoted in step 4.(A detailed explanation for generating the TagLogging tag is available in
WinCC configuration for STEP7 orWinCC configuration for PCS 7)
The given configuration has already been performed in the example projects and
can be skipped when using the example projects. Continue with 5.6 OperatingWinCC for PCS7 and STEP7.
4.4 Setup and configuration with PCS 7
4.4.1 Requirements
The following points form the basis for the PCS 7 configuration and are notexplained in the following configuration.
A PCS7 project has been created.
The hardware for the controller, the WinCC station and the communicationhave been configured and compiled.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
29/48
Configuration and Settings
4.4 Setup and configuration with PCS 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 29
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
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 planthierarchy. This picture was only used for testing the function of the blocks.
Copy the picture SCAN VALUE.PDL to folder GraCS of the WinCCproject folder.
In the SIMATIC Manager you right-click the OS (SIMATIC PC Station >WinCC Application > OS) and select the menu item Import WinCCobjects.
Select the imported picture and click on Edit > Cut.
Go to the technology view, select the respective hierarchy folder and clickEdit > 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. Thecomponent view must be open for this.
Table 4-3
Step Action
1. Double-click the controller, the S7 program and than the plans in the left window pane of theSIMATIC Manager.
2. Double-click the CFC_EVT_Arch plan which the block is to be integrated into.
3. Click Blocks tab in the left window of the CFC editor and double-click S7-Program
4. Add the blocks (2xARSCAN_E, 1xAR_MAN_E) to the CFC plan via Drag&Drop.
5. Click the Library tab in the left window of the CFC editor and double-click PCS 7 Library V70> Blocks+Templates\Blocks > CONTROL
6. Add the INT_P block to the CFC plan via Drag&Drop.
7. Click the Library tab in the left window of the CFC editor and double-click PCS 7 Library V70> Blocks+Templates\Blocks > DRIVER
8. Add the CH_AI block two times to the CFC plan via Drag&Drop.
9. Align the inserted blocks clearly (as displayed in Figure 4-1).
10. Double-click the respective block and enter the changes of the following table:
General tab Connections tabNo. Block
Field Entry Connection New value
16. INT_P Name Test_Signal U 10
17. CH_AI (1) Name Chanal 1 SIM_ON 1
18. CH_AI (2) Name Chanal 2 SIM_ON 1
19. ARSCAN_E (1) Name SCAN_1 SUB_ID 2
20. ARSCAN_E (2) Name SCAN_2 SUB_ID 3
21. ARSCAN_E (2) DEADBAND 0.0
22. ARSCAN_E (2) MIN_CYC 0.2
23. AR_MAN_E Name MAN_1
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
30/48
Configuration and Settings
4.4 Setup and configuration with PCS 7
30Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Step Action
11. Interconnect blocks using the following table and then close the CFC plan.
Output InputNoBlock Connection Block Connection
24. Test_Signal QVHL Test_Signal TRACK
25. Test_Signal V Chanal 1 SIM_V
26. Test_Signal V Chanal 2 SIM_V
27. Chanal 1 V SCAN_1 VALUE
28. Chanal 1 QUALITY SCAN_1 QC_VALUE
29. Chanal 2 V SCAN_2 VALUE
30. Chanal 2 QUALITY SCAN_2 QC_VALUE
31. MAN_1 QPTR SCAN_1 PTR
32. MAN_1 QPTR SCAN_2 PTR
12. In the SIMATIC Manager you click on SIMATIC 400 and then on PLC > Compile andDownload objects. Compile and load the entire control project.
13. Double-click SIMATIC PC Station > WinCC Application, right-click OS and clickCompile. Compile the OS.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
31/48
Configuration and Settings
4.4 Setup and configuration with PCS 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 31
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
4.4.3 WinCC configuration for PCS7
Set access point to WinCC
Table 4-4
Step Action
1. Right-click the respective connection and click System parameters.
2. 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 incurves 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 makesure that the raw data tag, the AR_ID, and the sub-number for each processvalue are set according to the parameterization in the CFC.
The following instructions will show the step by step configuration of the process-controlled tag SCAN_1.
Table 4-5
Step Action
1. In the WinCC Explorer you open the Tag Logging editor, right-click on Archive and click theArchive Wizard..
2. Follow the Wizard and create a process value archive without archive tag.
3. In the generated process value archive, right-click on the lower data pane. In the context
menu, select New Process Controlled Tag.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
32/48
Configuration and Settings
4.4 Setup and configuration with PCS 7
32Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Step Action
4. Use the dialog to define the properties of the process-controlled tags. In theConversion DLL field you select the entry nrms7pmc.nll.
5. 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 enteringthe AR_ID and the sub-number. Please make sure that the raw data tag, the AR_ID andthe sub-ID for each process value are set according to the parameterization in the CFC.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
33/48
Configuration and Settings
4.4 Setup and configuration with PCS 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 33
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Step Action
6. After entering both ID numbers, also enter the archive tag name SCAN_1. The uniqueinternal 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_Eblock
7. Repeat steps 3-6 for the second process-controlled tag SCAN_2. Note that the value of theSub-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.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
34/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
34Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Adjusting the WinCC picture
Table 4-6
Step Action
1. Click on the Graphics Designer and double-click the SCAN_VALUES image to open thepicture.
2. Double-click the respective Control (WinCC Online Trend Control or WinCC Online TableControl).
3. In the Curves tab you select a curve (e.g. Curve1) and specify a name for the curve inName:
4. As Data supply: you select Archive tags (only for WinCC Online Trend Control). Click theSelection button.
5. In the opened dialog you double-click the process value archive and the process-controlledtag.
4.5 Setup and configuration with STEP 7
Preliminary Remarks
For the configuration in STEP 7 there are basically three options to call up thefunction 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 calledup 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 blockneeds to be called up in the respective OB. Alternatively the blocks ARSCAN_Eand AR_MAN_E can be called up in a function block which in return is called up inthe respective OB. This option provides the advantage that the cycle time of theOBs 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-controlledactivation of the function block must be implemented in addition to calling thefunction block. To keep the expenses during configuration and the CPU load aslow as possible a clock memory is recommended. The times of the respectiveinputs are then no longer given in seconds but as a multiple of the activation cycleof the block.
4.5.1 Precondition
The following points form the basis for the STEP7 7 configuration and are notexplained in the following configuration.
A STEP7 project has been created.
The hardware for the controller, the WinCC station and the communicationhave been configured and compiled.
The WinCC picture SCAN VALUE.PDL contained in the EVT_Arch.zip wascopied to folder GraCS of the project folder and integrated into the PictureTree Manager. This picture was only used for testing the function of theblocks.
Start the Picture Tree Manager.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
35/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 35
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
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 usingthe 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 clockmemory or a timer.
The times (e.g. MAX_CYC, SND_CYC) must be given as a multiple of thecycle time of the respective block.
Generating a clock memory
Table 4-7
Step Action
1. Click the controller in the tree view and double-click the hardware in the Details window of theSIMATIC Manager. HW Config opens.
2. Double-click the configured CPU and select the Cycle / Clock Memory tab.
3. Activate the Clock Memory checkbox and enter a number for the clock memory. (Memory byte100 in this example)
4. Click on Station in the menu bar and select Save and Close.
5. Close HW Config.
Entering the required tags into the symbol table
For detecting an edge of a cycle (in this example a positive edge), two further bitsare required in addition to the clock memory bit. These three tags per edge mustbe 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 theSIMATIC MANAGER.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
36/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
36Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Table 4-8
Step Action
1. 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.2. The following entries have already been created during the configuration.
Symbol Address Data type Comment
Test-Signal FB671 FB671 FB triangular signal
ARSCAN_E FB672 FB672 SCAN block
AR_MAN_E FB673 FB673 MAN block
DWTR FC671 FC671 Function of test signal
AR_SEND SFB 37 SFB 37
READ_CLK SFC 1 SFC 1 Read System Clock
RD_SINFO SFC 6 SFC 6 Read OB Start InformationBLKMOV SFC 20 SFC 20 Copy Tags
In the opened symbol editor you enter the following tags for the edge detection:
Symbol Address Data type Comment
M_1s M 90.2 BOOL Memory bit for 1sec edge
M_500ms M 90.3 BOOL Memory bit for 500sec edge
Flanke_500ms M 90.4 BOOL Edge 500ms
Flanke_1s M 90.5 BOOL Edge 1sec
500ms cycle M 100.3 BOOL Clock memory with 500ms cycle time
1s cycle M 100.5 BOOL Clock memory with 1ms cycle time
3. Also add the following tags.
Symbol Address Data type Comment
Signal-Takt M 100.1 BOOL Cycle of the test signal
vReal MD 50 REAL Test signal REAL value
vDWord MD 54 DWORD Test signal DWORD value
4. Click on File in the menu bar and then on Save and Close.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
37/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 37
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Calling blocks (STEP 7)
The specified blocks were called with German mnemonics. The settings can bechanged in the SIMATIC Manager at Options > Settings in the Language tab.
For English mnemonics the source code must be changed accordingly.
Note The given source code can be copied directly into the networks via Copy andPaste if the data blocks DB19-DB22 are not used in the project.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
38/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
38Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Table 4-9
Step Action
1. Mark the block folder (at Controller, S7 Program, Block) and click Add, S7 block, Functionblock.
2. Specify a name (e.g. FB1) as well a symbolic name (e.g. EVT_Arch) for the block andacknowledge with OK
3. Open the (created) block (in this example FB1) with a double-click and create three networksby clicking Add > Network three times successively
4. 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 selectedlines 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 selectedlines 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
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
39/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 39
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Step Action
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) tocall 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. Save and close the block by clicking File > Save and then File > Exit
9. Double-click block OB1 in the block folder of your CPU to open it.
10. Click Add > Network and enter the following line in the network.
CALL "EVT_Arch" , DB18
11. Save and close the block by clicking File > Save and then File > Exit
12. In the SIMATIC Manager you click on SIMATIC 400 and then on PLC > Compile and
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
40/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
40Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Step Action
Download objects. Compile and load the entire control project.
13. Double-click SIMATIC PC Station > WinCC Application, right-click OS and clickCompile. Compile the OS.
The following blocks and functions were created in the block folder of the controllerduring the configuration.
Table 4-10
Object Symbolic Name Description
OB1 Cyclic processing
FB1 EVT_Arch FB for event-controlled fast activation
FB671 Test-Signal Generates a triangular signal
FB672 ARSCAN_E ARSCAN_E
FB673 AR_MAN_E AR_MAN_EFC671 DTWR Converts DWORD to REAL
DB18 Instance DB of FB 1
DB19 Instance DB of the test signal
DB20 Instance DB of AR_MAN
DB21 Instance DB of AR_SCAN 1
DB22 Instance DB of AR_SCAN 2
SFB37 AR_SEND
SFC1 READ_CLK Read System Clock
SFC6 RD_SINFO Read OB Start Information
SFC20 BLKMOV Copy Tags
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
41/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 41
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
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 OScompilation in the SIMATIC Manager so that no connection or no raw data tag hasyet been created in the Tag Management.
Table 4-11
Step Action
1. Click on Tag Management and then on Add New Driver.
2. Select SIMATIC S7 Protocol Suite.chn and acknowledge with OK.
3. Select the channel (TCP/IP in the example) and click on Edit > Properties in the menu bar.
4. Click the New button
5. Enter the name of the S7 Connection tag under Names and click Properties.
6. Enter the IP address, rack number and slot number of the AS.7. Acknowledge both dialog fields with OK and select the created connection
8. Right-click the connection and left-click New Tag...
9. Enter the name of the RawArchiv tag and select the data type Raw Data Type.
10. Click on Select" and activate the Archive Data Coupling checkbox.
11. Close both dialog fields with OK.
Set access point to WinCC
Table 4-12
Step Action1. Right-click the respective connection and click System parameters.
2. Click the Unit tab and select the access point as in the PC/PG interface.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
42/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
42Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Configure process-controlled tags
For this example, the process-controlled tagsSCAN_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 areset according to the parameterization in the function block.
The following instructions will show the step by step configuration of the process-controlled tag SCAN_1.
Table 4-13
Step Action
1. In the WinCC Explorer you open the Tag Logging editor, right-click on Archive and click theArchive Wizard..
2. Follow the Wizard and create a process value archive without archive tag.
3. In the generated process value archive, right-click the lower data pane. In the context menu,select New Process Controlled Tag.
4. Use the dialog to define the properties of the process-controlled tags. In the ConversionDLL field you select the entry nrms7pmc.nll.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
43/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 43
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Step Action
5. 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 enteringthe 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.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
44/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
44Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
Step Action
6. After entering both ID numbers, also enter the archive tag name SCAN_1. The uniqueinternal 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_Eblock
7. Repeat steps 1-6 for the second process-controlled tag SCAN_2. Note that the value of theSub-ID for SCAN_2 changes, but the AR_ID has the same value as SCAN_1.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
45/48
Configuration and Settings
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 45
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Adjusting the WinCC picture
Table 4-14
Step Action
1. Click the Graphics Designer and double-click the SCAN_VALUES image to open thepicture.
2. Double-click the respective Control (WinCC Online Trend Control or WinCC Online TableControl).
3. In the Curves tab you select a curve (e.g. Curve1) and specify a name for the curve inName:
4. As Data supply: you select Archive tags (only for WinCC Online Trend Control). Click theSelection button.
5. In the opened dialog you double-click the process value archive and the process-controlledtag.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
46/48
WinCC Operation for PCS7 and STEP7
4.5 Setup and configuration with STEP 7
46Event-controlled (fast) Process Value Acquisition
V1.1, Entry ID: 23780904
CopyrightS
iemensAG2
009Allrightsreserved
5 WinCC Operation for PCS7 and STEP7The following instruction shows you the basic functionalities of the AR_MAN_Eblock 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 % orafter 5 seconds at the latest. Value SCAN_2 is archived every 500 ms independentof the value change. The AR_MAN_E block sends the archived values to theWinCC 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 blocksand therefore also does not show all possible application options.
Table 5-1
Step Action
1. Start WinCC with a right-click on OS and click on Object before WinCC has been opened.
2. Start WinCC Runtime.
3. 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 valuesare in the right Trend Control object displayed as curves. Using these two objects thearchiving can be easily searched for gaps and other irregularities.
4. Use ALT + TAB to go to the SIMATIC MANAGER and open the CFC plan in which theblocks are integrated.
5. In the menu bar you click Test and then Test mode
6. If queried whether to log on the CPU for the test confirm with Yes.
7. Double-click the DEADBAND connection of the SCAN_1 block, change the value to 5.0 andclick on OK.
8. Double-click the MAX_CYC connection of the SCAN_2 block, change the value to 1 andclick on OK.
9. Double-click the SND_CYC connection of the MAN_1 block, change the value to 5 and clickon OK.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
47/48
WinCC Operation for PCS7 and STEP7
4.5 Setup and configuration with STEP 7
Event-controlled (fast) Process Value AcquisitionV1.1, Entry ID: 23780904 47
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
Step Action
10. The following picture clearly shows that the number of archived process value has declinedcompared with the preceding picture and the data update (sending the data to WinCC) takeslonger.
8/2/2019 Event-controlled (fast) Process Value Acquisition using the AR_SEND Function www.otomasyonegitimi.com
48/48
Fehler! Formatvorlage nicht definiert.
CopyrightS
iemensAG2
009Allrightsreserved
23780904_
rapid_
archiving_
of_process_
data_
en.doc
6 HistoryTable 6-1 History
Version Date Modification
V1.0 20.12.2006 First issue
V1.1 30.03.2009 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