1.pcs7 simatic pcs7 simatic process control system È … · 1.pcs7 Ï7- Ã1° û simatic pcs7...
TRANSCRIPT
1.PCS7
SIMATIC PCS7 SIMATIC Process Control SystemTIA DCS
PCS7PCS7 Library /
PID
CFC PCS7 Library
I AS
II
III
IV
PCS7PCS7
PCS7PCS7
PCS7PCS7 Add-on
PCS7 HVAC —— A&D AS
PTE 400 —— I&S IS KHE
Standard Chemistry —— A&D SC MHM
PCS 7 PS —— PG L6
—— I&S ITPS KHE
AS
2.
PCS7 Block Type ASFunction Block OS
Block Icon Faceplate
FunctionInstance Data Block OS AS OCM Operator Control & Monitor
AS
Block Type
AS FB
Block Type Block TypeCode
Block Type Block TypeBlock Type
AS Block Type
CFC Chart Block Type
CFC PCS7Block Blocks
AS
OS
PCS7 OS Faceplate Instance
Faceplate Type
Faceplate Type
AS
Group Display
PCS7
OB OB CFCOB OB30 38 OB
OB100 CFCOB
ENO FBQERR ENO
Initial Startup
OB OBOB OB
Startup
CPUOB PCS7 OB100
OB
CFC Update Sampling TimeOB SAMPLE_T CFC
Invisible
OS
2.1 PCS7
PCS7AS
2.1
PCS7 PDF PCS7
2.2
PCS7 Programming Instructions for Blocks
2.3
F1http://www.ad.siemens.com.cn/Service/
2.2 AS
PCS7 SCL
2.4 SCL
2.2.1
OS
/
——IN1 1 IN2 2 HLIMIT HYS
——OUT1 QH_ALM
2.2.2
PCS7 SIMATIC Station PC Station
2.5
2.2.3 SCL
2.2.3.1 SCL
Sources SCL Source External Source...SCL Template
”Export Source…”
2.6
2.7
2.8
2.2.3.2 SCL
SCL Options Customize… SCL Create Debug Info
2.9 Options
2.10 Create Debug info SCL
Options Symbol table
2.11
PCS7 FB FB500 FC DB
2.2.3.3
FUNCTION_BLOCK TITLE NAME2.3
//******************************************************************************************** FUNCTION_BLOCK "ADD_FB" TITLE = 'ADD_FB' { // List of system attributes S7_tasklist:= 'OB100'; // Block is called if there is in a warm restart S7_m_c:= 'true'; // Block can be controlled and monitored S7_alarm_ui:= '1' // Setting “1” for PCS 7 message dialog ('0' for standard message dialog) } AUTHOR: ABC NAME: ADD_FB VERSION: '0.01' FAMILY: XYZ KNOW_HOW_PROTECT //********************************************************************************************
2.2.3.4 /
VAR_INPUT EV_ID { S7_visible:='false'; S7_link:='false'; S7_param :='false'; // Parameter cannot be set in CFC S7_server:='alarm_archiv'; // Message no. assigned by server S7_a_type:='alarm_8p' // Block signals with ALARM_8P }:DWORD := 0; // Message ID RUNUPCYC{ S7_visible:='false'; S7_link:='false' } :INT := 3; // Number of run up cycles MSG_LOCK {
S7_visible:='false'; S7_dynamic:='true'; S7_m_c:='true' } : BOOL := 0; // Enable 1=Messages locked IN1 { // 1 S7_shortcut:='addend1'; S7_unit:=''; S7_m_c:='true'; S7_dynamic:='true'; S7_archive:='shortterm' } :REAL :=0.0; //input value 1 IN2 { // 2 S7_shortcut:='addend2'; S7_unit:=''; S7_m_c:='true'; S7_dynamic:='true'; S7_archive:='shortterm' } :REAL :=0.0; //input value 2 HLIMIT { // S7_shortcut:='limit value'; S7_unit:=''; S7_m_c:='true'; S7_dynamic:='true'; S7_archive:='shortterm' } :REAL :=100.0; //limit value for output HYS { // S7_shortcut:='HYS'; S7_unit:=''; S7_m_c:='true' } :REAL :=1.0; //Hysteresis settings END_VAR
EV_ID
S7_server S7_a_type RUNUPCYC CPU
MSG_LOCK SCL PCS7
VAR_OUTPUT OUT1 { // S7_shortcut:='sum'; S7_unit:=''; S7_m_c:='true'; S7_dynamic:='true';
S7_archive:='shortterm' } :REAL :=0.0; //output value 1 QH_ALM { //
S7_dynamic:='true'} : BOOL := 0; // 1=H-Alarm active QMSG_ERR { S7_visible:='false'; S7_dynamic:='true'} : BOOL := 0; // ALARM_8P: Error output QMSG_SUP { S7_visible:='false'; S7_dynamic:='true'; S7_m_c:='true'} : BOOL := 0; // 1=Message Suppression Active MSG_STAT { S7_visible:='false'; S7_dynamic:='true'} : WORD := 0; // Message: STATUS output MSG_ACK { S7_visible:='false'; S7_dynamic:='true'} : WORD := 0; // Message: ACK_STATE output
END_VAR
QMSG_ERR QMSG_SUP MSG_STAT MSG_ACK
VAR sbRESTART :BOOL := TRUE; // Initial start memory bit siRUNUPCNT :INT := 0; // Counter for RUNUPCYC execution sb_SIG_1: BOOL := FALSE; //Merker ALARM_8P Signal 1 sb_SIG_2: BOOL := FALSE; //Merker ALARM_8P Signal 2 sb_SIG_3: BOOL := FALSE; //Merker ALARM_8P Signal 3 sb_SIG_4: BOOL := FALSE; //Merker ALARM_8P Signal 4 sb_SIG_5: BOOL := FALSE; //Merker ALARM_8P Signal 5 sb_SIG_6: BOOL := FALSE; //Merker ALARM_8P Signal 6 sb_SIG_7: BOOL := FALSE; //Merker ALARM_8P Signal 7 sb_SIG_8: BOOL := FALSE; //Merker ALARM_8P Signal 8 //************************************************************************************** // Declaration Section Multiple Instances(SFB/FB), remember to copy the FB/FC blocks into your projects manually! //************************************************************************************** ALARM_8P_1: ALARM_8P; // Generation of max. 8 messages with max. 10 auxiliary values
END_VAR
FB FB ALARM_8p
VAR_TEMP pbALARM: BOOL; // Call up ALARM_8P pbM_SUP: BOOL; // Message suppression pb_SIG_1,pb_SIG_2,pb_SIG_3,pb_SIG_4,pb_SIG_5,pb_SIG_6,pb_SIG_7,pb_SIG_8:BOOL; // temp variable for alarm function // Start info: Structure with info for the OB that has just called the block TOP_SI: STRUCT EV_CLASS :BYTE; EV_NUM :BYTE; PRIORITY :BYTE; NUM :BYTE; TYP2_3 :BYTE; TYP1 :BYTE; ZI1 :WORD; ZI2_3 :DWORD; END_STRUCT; // Start info: Structure with info for the last called startup OB START_UP_SI: STRUCT EV_CLASS :BYTE; EV_NUM :BYTE; PRIORITY :BYTE; NUM :BYTE; TYP2_3 :BYTE; TYP1 :BYTE; ZI1 :WORD; ZI2_3 :DWORD; END_STRUCT; DUMMY :INT; // Auxiliary variable END_VAR
2.2.3.5 OB
//************************************************************************************* // Dependence on Calling OB //************************************************************************************* // Read out start info with SFC6 (RD_SINFO) DUMMY := RD_SINFO (TOP_SI := TOP_SI, START_UP_SI := START_UP_SI); pbM_SUP := MSG_LOCK;
IF sbRESTART THEN // Initial start TOP_SI.NUM := 100; // Execute initial start as warm restart sbRESTART := FALSE; // Reset initial start END_IF;
RD_SINFO OB TOP_SI.NUM OBOB OB100
OB S7_tasklist
CPUOB100 sbRESTART
true
2.2.3.6 OB // In which OB was the block called ? CASE WORD_TO_INT(BYTE_TO_WORD(TOP_SI.NUM)) OF //************************************************************************************ // Startup //************************************************************************************ // OB100: Warm restart 100: QH_ALM := 0; OUT1:=0; //default reset commands QMSG_ERR := 0; QMSG_SUP := 0; MSG_STAT := 0; MSG_ACK :=0; pb_SIG_1:= 0; pb_SIG_2:= 0; pb_SIG_3:= 0; pb_SIG_4:= 0; pb_SIG_5:= 0; pb_SIG_6:= 0; pb_SIG_7:= 0; pb_SIG_8:= 0; siRUNUPCNT := RUNUPCYC; // Save RUNUPCYC value ELSE //********************************************************************************** // Technological Section //********************************************************************************** OUT1:=IN1+IN2; IF OUT1>HLIMIT THEN QH_ALM:=true; ELSIF OUT1<HLIMIT-HYS THEN QH_ALM:=false; END_IF; //**********************************************************************************
// Message suppression during the startup //********************************************************************************** IF siRUNUPCNT = 0 // RUNUPCYC cycle already elapsed ? THEN IF MSG_LOCK THEN pb_SIG_1:= 0; // Report possible outgoing ELSE pb_SIG_1:= QH_ALM; // Alarm high END_IF; pbALARM:=sb_SIG_1<>pb_SIG_1; ELSE siRUNUPCNT := siRUNUPCNT - 1; pbALARM :=FALSE; // Initialization no ALARM pbM_SUP := TRUE; END_IF; END_CASE;
CASE TOP_SI.NUM OB100 OB siRUNUPCNT 0
2.2.3.7
//************************************************************************************** // Messages with ALARM_8P //************************************************************************************** // STRING variables must not be linked to ALARM8_P as auxiliary values // so transfer in array of bytes IF pbALARM THEN ALARM_8P_1 (EN_R := TRUE, // Update output ACK_STATE ID := 16#EEEE, // Data channel for messages (always 16#EEEE) EV_ID:= EV_ID, // Message number > 0 SIG_1:= pb_SIG_1, // Signal 1 to be monitored SIG_2:= 0,//pb_SIG_2, // Signal 2 to be monitored SIG_3:= 0,//pb_SIG_3, // Signal 3 to be monitored SIG_4:= 0,//pb_SIG_4, // Signal 4 to be monitored SIG_5:= 0,//pb_SIG_5, // Signal 5 to be monitored SIG_6:= 0,//pb_SIG_6, // Signal 6 to be monitored SIG_7:= 0,//pb_SIG_7, // Signal 7 to be monitored SIG_8:= 0,//pb_SIG_8, // Signal 8 to be monitored SD_1 := AUX_PR01, // Auxiliary value 1 SD_2 := AUX_PR02, // Auxiliary value 2 SD_3 := AUX_PR03, // Auxiliary value 3 SD_4 := AUX_PR04, // Auxiliary value 4 SD_5 := AUX_PR05, // Auxiliary value 5 SD_6 := AUX_PR06, // Auxiliary value 6 SD_7 := AUX_PR07, // Auxiliary value 7 SD_8 := AUX_PR08, // Auxiliary value 8 SD_9 := AUX_PR09, // Auxiliary value 9 SD_10:= AUX_PR10); // Auxiliary value 10
QMSG_ERR := ALARM_8P_1.ERROR; // ERROR status parameter MSG_STAT := ALARM_8P_1.STATUS; // STATUS status parameter MSG_ACK := ALARM_8P_1.ACK_STATE; // Current OS confirmation status END_IF; IF (NOT QMSG_ERR) THEN // Note historical signals. sb_SIG_1:= pb_SIG_1; END_IF; IF (MSG_STAT = 21) THEN // Block locked pbM_SUP := TRUE; END_IF; QMSG_SUP := pbM_SUP;
Alarm_8P pbALARM true
Alarm_8p CPU EV_ID alarm_8p EV_ID SIG_1 SIG_2 …… pb_SIG_1 sb_SIG_1
PCS7 alarm_8p Alarm_8p8 8EV_ID S7_server S7_a_type Alarm_8p
alarm_8p alarm_8p EV_ID
2.2.4 SCL SCL SCL SCL Blocks
2.12 SCL
2.2.5
Blocks Special object Properties Message…
2.13
2.14
$$BlockComment$$$$AKZ$$ $$AREA$$ Area
”STEP7-Programming with Step7” 16 “Configuring Messages”
2.2.6 CFC
Plant view Hierarchy CFC CFC BlockCFC CFC
2.15
2.2.7
CPUOS
2.3 Block Icon
2.3.1 @@PCS7Typicals.pdl
OS @@[email protected]
2.16 @@PCS7Typicals.pdl
2.17 @PCS7Typicals.pdl
@PCS7typicals
@PCS7typicals _XYZ.pdl
2.3.2 Block Icon
2.3.2.1 Block Icon
DIG_MON DIG_MON Block Icon
2.18 DIG_MON Block Icon
2.3.2.2 Block Icon
Block Icon Customized Object Edit … I/O field I/O
2.19
2.20 I/O field OUT
2.21 I/O field Output
Block Icon PCS7
Tagname
Block Icon Customized Object Finish Editing Block Icon
2.22 Block Icon
2.3.2.3 Block Icon
Block Icon Configuration Dialog… I/O fieldOutputvalue Block Icon OUT1
2.23
Links Output value Links
2.24
OUT1
2.25
2.26 OUT1
2.3.2.4 Block Icon
Block Icon General Links
General type @ADD_FB/1 Servername PCS7 ADD_FB Control
2.27 Block Icon
type Servername Block Icon
Links OUT1 Dynamic .OUT1 2s
2.28 Block Icon
2.4 Faceplate
2.4.1 Faceplate
WinCC Faceplate Designer
2.29
Type ADD_FB No Batch Variables Generate
2.30
@PL_ADD_FB.pdl, @PG_ADD_FB_pdl, @PG_ADD_FB_OVERVIEW.pdl, @PG_ADD_FB_VIEWLIST.pdl, @PG_ADD_FB_STANDARD.pdl
2.31
ADD_FB
2.4.2 Faceplate
@PG_ADD_FB_STANDARD.pdl @PCS7elements.pdl@PG_ADD_FB_STANDARD.pdl
2.32 @PG_ADD_FB_STANDARD.pdl
@PCS7elements.pdl PCS7
2.33
IN1 Font Text .IN1#shortcut Unit .IN1#unit 1h
IN1
IN2
OUT1
Limit
HYS
2.34 IN1 Font
IN1 UserDefined2 IN1 UserDefined3 OutputValue.IN1 VisibleValue .IN1 2s
2.35 IN1 UserDefined3
IN2 Font Text .IN2#shortcut Unit .IN2#unit 1h
2.36 IN2 Font
IN2 UserDefined2 IN2 UserDefined3 OutputValue.IN2 VisibleValue .IN2 2s
2.37 IN2 UserDefined3
OUT1 Font Text .OUT1#shortcut Unit .OUT1#unit 1h
2.38 OUT1 Font
OUT1 UserDefined2 OUT1 UserDefined3VisibleValue .OUT1 2s
2.39 OUT1 UserDefined3
limit Font Text .HLIMIT#shortcut Unit .HLIMIT#unit1h
2.40 limit Font
limit UserDefined2 limit UserDefined3 OutputValue.HLIMIT VisibleValue .HLIMIT 2s
2.41 limit UserDefined3
HYS Font Text .HYS#shortcut Unit .HYS#unit 1h
2.42 HYS Font
HYS UserDefined2 HYS UserDefined3 OutputValue.HYS VisibleValue .HYS 2s
2.43 HYS UserDefined3
2.5 OS
OS Create/Update Block Icon
2.44 OS
2.45 Compile OS
2.6
AS OS
2.46 Group Display
Loop Display Loop Display
2.47 loop display
2.7
BlocksOS GraCS 2.3
3.
PCS7block icon faceplate
S7_tasklist S7_alarm_uiCFC OB OB100
2.14 0
S7_m_c OS S7_shortcut S7_unitS7_string_0/1
0 1PCS7
S7_serverS7_a_type alarm_8p
EV_ID PCS7
TnS7_sampletime
Block Icon Faceplateexe
2.3PCS7
FAQ
http://support.automation.siemens.com/cn/view/zh/22109936 http://support.automation.siemens.com/CN/view/zh/22123899 http://support.automation.siemens.com/CN/view/zh/22779943
Block Icon PCS7 SCL