Академический Документы
Профессиональный Документы
Культура Документы
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
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
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
AS Measured Values
Update rate <500ms
Copyright Siemens AG 2009 All rights reserved 23780904_rapid_archiving_of_process_data_en.doc
Problem description The solution shall be applicable for the following products: WinCC and STEP 7 PCS 7
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
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
ARMAN_E
ARSCAN_E
Write Schreibpointer Zeiger
AR_SEND subnumber
CH_AI
Channel11 Kanal
Quality-Code
1kB
Process value
Prozesswert
FIFO
AR_SEND
60kB
ARSCAN_E CH_AI
Channel 2 Kanal 2
Quality-Code
Process value
Prozesswert
2.2
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
AR_SEND
Sub-ID
ARSCAN_E
60kB
CH_AI
Quality-Code
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
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
2.3
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
1 1 1 1
Only for PCS 7 configuration. Only for PCS 7 configuration. Only for PCS 7 configuration. Only for H-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 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)
10
3
3.1
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
Unit (range) = 3
Process value
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
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
FIFO
Read Lesepointer
Zeiger
AR_SEND
60kB
ARSCAN_E CH_AI
Channel 2 Kanal 2
Quality-Code
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.
13
Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672)
3.3
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
into a specially reserved memory area in the instance DB of the manager block (FIFO).
14
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
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.
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
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
16
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
17
Function Mechanisms of this Application 3.3 Scan block ARSCAN_E (FB 672)
3.3.5
Block connections
SAMPLE_TIME ULRANGE
REAL REAL
UHRANGE
REAL
DEADBAND
Copyright Siemens AG 2009 All rights reserved
REAL
MIN_CYC
REAL
MAX_CYC
REAL
18
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
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.
19
Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)
3.4.2
20
Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)
3.4.3
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
4 5 6 7 8 .. 15
21
Function Mechanisms of this Application 3.4 Manager block AR_MAN_E (FB 673)
3.4.4
Block connections
SND_FILL
INT
SND_CYC
REAL
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)
ANY
BOOL
22
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
23
4
4.1
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.
24
Configuration and Settings 4.1 Preliminary remarks and functionality 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.
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.
26
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
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
27
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
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
28
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
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
29
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
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
4.4.3
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.
31
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
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.
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
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
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
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.
35
In the opened symbol editor you enter the following tags for the edge detection:
Copyright Siemens AG 2009 All rights reserved
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
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
37
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
38
39
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
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
40
4.5.3
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.
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.
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
43
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
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.
45
WinCC Operation for PCS7 and STEP7 4.5 Setup and configuration with STEP 7
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.
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
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.
47
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
48