没有合适的资源?快使用搜索试试~ 我知道了~
首页西门子CFC 功能块库
西门子CFC 功能块库

本教材详细介绍了西门子CFC 功能块库中的常用模块,如数学计算类,位逻辑类,数据类型装换类,循环移位类,计数器类,定时器类,类和控制专用模块类等,相信会对喜欢使用CFC编程的用户很有帮助
资源详情
资源评论
资源推荐

Siemens AG
Automation and Drives
Postfach 4848
90437 NÜRNBERG
GERMANY
A5E00848217-01
1/2006
Copyright © Siemens AG 2006
Technical data subject to change
Safety Guidelines
This manual contains notices you have to observe in order to ensure your personal safety, as well as to
prevent damage to property. The notices referring to your personal safety are highlighted in the manual
by a safety alert symbol, notices referring to property damage only have no safety alert symbol. The
notices shown below are graded according to the degree of danger.
!
Danger
indicates that death or severe personal injury will result if proper precautions are not taken.
!
Warning
indicates that death or severe personal injury may result if proper precautions are not taken.
!
Caution
with a safety alert symbol indicates that minor personal injury can result if proper precautions are not
taken.
Caution
without a safety alert symbol indicates that property damage can result if proper precautions are not
taken.
Notice
indicates that an unintended result or situation can occur if the corresponding notice is not taken into
account.
If more than one degree of danger is present, the warning notice representing the highest degree of
danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a
warning relating to property damage.
Qualified Personnel
The device/system may only be set up and used in conjunction with this documentation. Commissioning
and operation of a device/system may only be performed by qualified personnel
. Within the context of
the safety notices in this documentation qualified persons are defined as persons who are authorized to
commission, ground and label devices, systems and circuits in accordance with established safety
practices and standards.
Prescribed Usage
Note the following:
!
Warning
This device and its components may only be used for the applications described in the catalog or the
technical description, and only in connection with devices or components from other manufacturers
which have been approved or recommended by Siemens.
Correct, reliable operation of the product requires proper transport, storage, positioning and assembly
as well as careful operation and maintenance.
Trademarks
All names identified by ® are registered trademarks of the Siemens AG.
The remaining trademarks in this publication may be trademarks whose use by third parties for their
own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and
software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency.
However, the information in this publication is reviewed regularly and any necessary corrections are
included in subsequent editions.

SIMATIC CFC Library
A5E00848217-01
iii
Contents
1 CFC blocks 1-1
1.1 Block parameters EN, ENO, SAMPLE_T......................................................... 1-1
1.2 Startup on S7-300 CPUs .................................................................................. 1-2
1.3 CFC blocks ....................................................................................................... 1-3
1.4 Logic blocks of the data type BOOL................................................................. 1-4
1.4.1 BIT_LGC........................................................................................................... 1-4
1.4.2 AND .................................................................................................................. 1-4
1.4.3 OR..................................................................................................................... 1-5
1.4.4 XOR .................................................................................................................. 1-6
1.4.5 NAND................................................................................................................ 1-7
1.4.6 NOR.................................................................................................................. 1-8
1.4.7 NOT .................................................................................................................. 1-9
1.5 Logic blocks of the data type WORD and DWORD ....................................... 1-10
1.5.1 WRD_LGC...................................................................................................... 1-10
1.5.2 WAND_W ....................................................................................................... 1-11
1.5.3 WOR_W.......................................................................................................... 1-12
1.5.4 WXOR_W ....................................................................................................... 1-13
1.5.5 WNAND_W..................................................................................................... 1-14
1.5.6 WNOR_W ....................................................................................................... 1-15
1.5.7 WNOT_W ....................................................................................................... 1-16
1.5.8 WAND_DW..................................................................................................... 1-16
1.5.9 WOR_DW ....................................................................................................... 1-17
1.5.10 WXOR_DW..................................................................................................... 1-17
1.5.11 WNAND_DW .................................................................................................. 1-18
1.5.12 WNOR_DW .................................................................................................... 1-18
1.5.13 WNOT_DW..................................................................................................... 1-19
1.6 Blocks for comparing two input values of the same type ............................... 1-20
1.6.1 COMPARE...................................................................................................... 1-20
1.6.2 CMP_I............................................................................................................. 1-20
1.6.3 CMP_DI .......................................................................................................... 1-21
1.6.4 CMP_R ........................................................................................................... 1-22
1.6.5 CMP_T............................................................................................................ 1-23
1.7 Blocks for converting data types..................................................................... 1-24
1.7.1 CONVERT ...................................................................................................... 1-24
1.7.2 BY_DW ........................................................................................................... 1-25
1.7.3 BY_W.............................................................................................................. 1-26
1.7.4 DI_DW ............................................................................................................ 1-26
1.7.5 DI_I ................................................................................................................. 1-27
1.7.6 DI_R................................................................................................................ 1-27
1.7.7 DW_DI ............................................................................................................ 1-28
1.7.8 DW_R ............................................................................................................. 1-28
1.7.9 DW_W............................................................................................................. 1-29
1.7.10 I_DI ................................................................................................................. 1-29
1.7.11 I_DW............................................................................................................... 1-30
1.7.12 I_R .................................................................................................................. 1-30
1.7.13 I_W.................................................................................................................. 1-31
1.7.14 R_DI................................................................................................................ 1-31
1.7.15 R_DW ............................................................................................................. 1-32

Contents
SIMATIC CFC Library
iv A5E00848217-01
1.7.16 R_I .................................................................................................................. 1-32
1.7.17 W_BY.............................................................................................................. 1-33
1.7.18 W_DW............................................................................................................. 1-33
1.7.19 W_I.................................................................................................................. 1-34
1.7.20 BO_BY............................................................................................................ 1-34
1.7.21 BO_W ............................................................................................................. 1-35
1.7.22 BO_DW........................................................................................................... 1-35
1.7.23 BY_BO............................................................................................................ 1-36
1.7.24 W_BO ............................................................................................................. 1-36
1.7.25 DW_BO........................................................................................................... 1-37
1.8 Arithmetic blocks of the data type REAL ........................................................ 1-38
1.8.1 MATH_FP ....................................................................................................... 1-38
1.8.2 ADD_R............................................................................................................ 1-39
1.8.3 SUB_R............................................................................................................ 1-39
1.8.4 MUL_R............................................................................................................ 1-40
1.8.5 DIV_R ............................................................................................................. 1-40
1.8.6 MAXn_R ......................................................................................................... 1-41
1.8.7 MINn_R........................................................................................................... 1-42
1.8.8 ABS_R ............................................................................................................ 1-42
1.8.9 SQRT.............................................................................................................. 1-43
1.8.10 EXP................................................................................................................. 1-43
1.8.11 POW10 ........................................................................................................... 1-44
1.8.12 LN ................................................................................................................... 1-44
1.8.13 LOG10 ............................................................................................................ 1-45
1.8.14 SIN.................................................................................................................. 1-45
1.8.15 COS ................................................................................................................ 1-46
1.8.16 TAN................................................................................................................. 1-46
1.8.17 ASIN................................................................................................................ 1-47
1.8.18 ACOS.............................................................................................................. 1-47
1.8.19 ATAN .............................................................................................................. 1-48
1.8.20 NEG_R............................................................................................................ 1-48
1.8.21 LIM_R ............................................................................................................. 1-49
1.8.22 EPS_R ............................................................................................................ 1-49
1.8.23 CADD_R ......................................................................................................... 1-50
1.8.24 POWXY........................................................................................................... 1-51
1.8.25 SAMP_AVE .................................................................................................... 1-51
1.9 Arithmetic blocks of the data type INT and DINT ........................................... 1-52
1.9.1 MATH_INT...................................................................................................... 1-52
1.9.2 ADD_I ............................................................................................................. 1-53
1.9.3 SUB_I.............................................................................................................. 1-53
1.9.4 MUL_I ............................................................................................................. 1-54
1.9.5 DIV_I............................................................................................................... 1-54
1.9.6 MOD_I............................................................................................................. 1-55
1.9.7 MAXn_I ........................................................................................................... 1-55
1.9.8 MINn_I ............................................................................................................ 1-56
1.9.9 ABS_I.............................................................................................................. 1-56
1.9.10 NEG_I ............................................................................................................. 1-57
1.9.11 LIM_I............................................................................................................... 1-57
1.9.12 EPS_I.............................................................................................................. 1-58
1.9.13 CADD_I........................................................................................................... 1-59
1.9.14 ADD_DI........................................................................................................... 1-60
1.9.15 SUB_DI........................................................................................................... 1-60
1.9.16 MUL_DI........................................................................................................... 1-61
1.9.17 DIV_DI ............................................................................................................ 1-61
1.9.18 MOD_DI.......................................................................................................... 1-62
1.9.19 MAXn_DI ........................................................................................................ 1-62
1.9.20 MINn_DI.......................................................................................................... 1-63

Contents
SIMATIC CFC Library
A5E00848217-01
v
1.9.21 ABS_DI ........................................................................................................... 1-63
1.9.22 NEG_DI........................................................................................................... 1-64
1.9.23 LIM_DI ............................................................................................................ 1-64
1.9.24 EPS_Dl ........................................................................................................... 1-65
1.9.25 CADD_DI ........................................................................................................ 1-66
1.10 Flip-flop blocks................................................................................................ 1-67
1.10.1 FLIPFLOP....................................................................................................... 1-67
1.10.2 JK_FF ............................................................................................................. 1-67
1.10.3 RS_FF............................................................................................................. 1-68
1.10.4 SR_FF............................................................................................................. 1-68
1.11 Shift blocks ..................................................................................................... 1-69
1.11.1 SHIFT.............................................................................................................. 1-69
1.11.2 SHL_W............................................................................................................ 1-69
1.11.3 SHL_DW......................................................................................................... 1-70
1.11.4 SHR_W........................................................................................................... 1-70
1.11.5 SHR_DW ........................................................................................................ 1-71
1.11.6 ROL_W ........................................................................................................... 1-71
1.11.7 ROL_DW ........................................................................................................ 1-72
1.11.8 ROR_W........................................................................................................... 1-72
1.11.9 ROR_DW........................................................................................................ 1-73
1.12 Multiplexer blocks ........................................................................................... 1-74
1.12.1 MULTIPLX ...................................................................................................... 1-74
1.12.2 MUXn_I........................................................................................................... 1-74
1.12.3 MUXn_DI ........................................................................................................ 1-75
1.12.4 MUXn_R ......................................................................................................... 1-76
1.12.5 MUXn_BO....................................................................................................... 1-77
1.12.6 SEL_BO.......................................................................................................... 1-78
1.12.7 SEL_R............................................................................................................. 1-78
1.13 Counter blocks................................................................................................ 1-79
1.13.1 COUNTER ...................................................................................................... 1-79
1.13.2 CTU................................................................................................................. 1-79
1.13.3 CTD................................................................................................................. 1-80
1.13.4 CTUD.............................................................................................................. 1-81
1.14 Blocks for generating or processing pulses.................................................... 1-82
1.14.1 Pulse............................................................................................................... 1-82
1.14.2 TIMER_P ........................................................................................................ 1-82
1.14.3 R_TRIG........................................................................................................... 1-85
1.14.4 F_TRIG ........................................................................................................... 1-86
1.14.5 AFP................................................................................................................. 1-87
1.15 Blocks for acquiring or processing time intervals and timebases................... 1-88
1.15.1 TIME ............................................................................................................... 1-88
1.15.2 TIME ............................................................................................................... 1-88
1.15.3 TIME_BEG...................................................................................................... 1-89
1.15.4 TIME_END...................................................................................................... 1-89
1.16 Controller blocks ............................................................................................. 1-90
1.16.1 CONTROL ...................................................................................................... 1-90
1.16.2 CONT_C ......................................................................................................... 1-90
1.16.2.1 CONT_C: Block diagram ................................................................................ 1-96
1.16.3 CONT_S ......................................................................................................... 1-97
1.16.3.1 CONT_S: Block diagram .............................................................................. 1-101
1.16.4 PULSEGEN .................................................................................................. 1-102
1.16.4.1 PULSEGEN: Block diagram ......................................................................... 1-108
1.16.4.2 PULSEGEN: Three-step control................................................................... 1-108
1.16.4.3 PULSEGEN: Three-step control, asymmetrical ........................................... 1-110
1.16.4.4 PULSEGEN: Two-step control ..................................................................... 1-111
1.16.4.5 PULSEGEN: Manual operation in two- or three-step control ....................... 1-112
剩余133页未读,继续阅读














安全验证
文档复制为VIP权益,开通VIP直接复制

评论7