推荐星级:
  • 1
  • 2
  • 3
  • 4
  • 5

TIA s7-1200/1500,LGF for S7-1200/1500

更新时间:2020-01-02 20:10:32 大小:4M 上传用户:chaochenggang查看TA发布的资源 标签:tia 下载积分:2分 评价赚积分 (如何评价?) 收藏 评论(0) 举报

资料介绍

西门子-TIA LGF库文件文档介绍。Library of General Functions (LGF) for S7-1200/1500

部分文件列表

文件名 大小
S7-1200LGF.pdf 4M

部分页面预览

(完整内容请下载后查看)
Library of General  
Functions (LGF) for  
S7-1200/1500  
Siemens  
Industry  
Online  
STEP 7 (TIA Portal) V15  
Support  
Legal information  
Legal information  
Use of application examples  
Application examples illustrate the solution of automation tasks through an interaction of several  
components in the form of text, graphics and/or software modules. The application examples are  
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-  
binding and make no claim to completeness or functionality regarding configuration and  
equipment. The application examples merely offer help with typical tasks; they do not constitute  
customer-specific solutions. You yourself are responsible for the proper and safe operation of the  
products in accordance with applicable regulations and must also check the function of the  
respective application example and customize it for your system.  
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the  
application examples used by technically trained personnel. Any change to the application  
examples is your responsibility. Sharing the application examples with third parties or copying the  
application examples or excerpts thereof is permitted only in combination with your own products.  
The application examples are not required to undergo the customary tests and quality inspections  
of a chargeable product; they may have functional and performance defects as well as errors. It is  
your responsibility to use them in such a manner that any malfunctions that may occur do not  
result in property damage or injury to persons.  
Disclaimer of liability  
Siemens shall not assume any liability, for any legal reason whatsoever, including, without  
limitation, liability for the usability, availability, completeness and freedom from defects of the  
application examples as well as for related information, configuration and performance data and  
any damage caused thereby. This shall not apply in cases of mandatory liability, for example  
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of  
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent  
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for  
damages arising from a breach of material contractual obligations shall however be limited to the  
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross  
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions  
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens  
against existing or future claims of third parties in this connection except where Siemens is  
mandatorily liable.  
By using the application examples you acknowledge that Siemens cannot be held liable for any  
damage beyond the liability provisions described.  
Other information  
Siemens reserves the right to make changes to the application examples at any time without  
notice. In case of discrepancies between the suggestions in the application examples and other  
Siemens publications such as catalogs, the content of the other documentation shall have  
precedence.  
The Siemens terms of use shall also apply.  
Security information  
Siemens provides products and solutions with industrial security functions that support the secure  
operation of plants, systems, machines and networks.  
In order to protect plants, systems, machines and networks against cyber threats, it is necessary  
to implement and continuously maintain a holistic, state-of-the-art industrial security concept.  
Siemens’ products and solutions constitute one element of such a concept.  
Customers are responsible for preventing unauthorized access to their plants, systems, machines  
and networks. Such systems, machines and components should only be connected to an  
enterprise network or the Internet if and to the extent such a connection is necessary and only  
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.  
For additional information on industrial security measures that may be implemented, please visit  
Siemens’ products and solutions undergo continuous development to make them more secure.  
Siemens strongly recommends that product updates are applied as soon as they are available  
and that the latest product versions are used. Use of product versions that are no longer  
supported, and failure to apply the latest updates may increase customer’s exposure to cyber  
threats.  
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed  
at:
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
2
 
Table of Contents  
Table of Contents  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
3
Table of Contents  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
4
1 Library Overview  
1.1 General  
1
Library Overview  
1.1  
General  
TIA Portal includes a vast number of "ready-to-use" instructions (mathematical  
functions, times, counters etc.). Moreover, it offers other useful basic functions.  
These functions are provided as a library and can be used freely. The ready-to-use  
functions are freely adjustable and thus can be used universally.  
The library described here is versioned and continuously expanded. Information on  
the version system can be found in chapt
1.2  
Hardware and software requirements  
Requirements for this library  
To make use of the full functionality of the library described here, the hardware and  
software requirements listed below must be met.  
Hardware  
All blocks (FB, FC, DB,…) in the library can be used universally with the following  
controllers:  
S7-1200 and S7-1200 F product families  
S7-1500 and S7-1500 F product families  
Simulation with S7-PLCSIM (as of V14)  
Software  
Note  
STEP 7 (TIA Portal) Basic or Professional as of V14  
In general, it is possible to open a library using STEP 7 Basic, although elements  
of STEP 7 Professional (e. g. S7-1500 controllers) are included. In this case, you  
will be informed via a message when opening the library.  
All elements (types and master copies) can be used if they are supported by the  
hardware installed in TIA Portal.  
If you try to copy elements with STEP 7 Basic from the library that are not  
supported (e. g. S7-1500 controllers), an error message will be displayed.  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
5
1 Library Overview  
1.3 Library resources  
1.3  
Library resources  
The following section gives you an overview of the space of the load and main  
memory used by the library blocks.  
Assignment of memory space to the individual blocks  
Table 1-1: Memory assignment (CPU 1212 DC/DC/DC V4.2, CPU 1511-1 PN V2.0)  
Block  
CPU 1212 assignment  
(bytes)  
CPU 1511 assignment  
(bytes)  
Load  
Main  
Load  
Main  
memory  
memory  
memory  
memory  
Bit logic operations  
FB LGF_PulseRelay V1.0.2  
Date and timer operations  
FB LGF_Astro V1.1.5  
7295  
201  
7367  
302  
49620  
26835  
40562  
21867  
18024  
3593  
2231  
4537  
1751  
956  
49752  
27040  
40548  
22071  
18009  
3672  
2301  
4647  
1826  
1020  
FB LGF_SetTime V1.0.2  
FB LGF_TimerSwitch V1.1.4  
FC LGF_CalendarDayWeekV1.0.0  
FC LGF_GermanHoliday V1.0.0  
Counter operations  
FC LGF_CountFalInDWord V1.0.1  
FC LGF_CountRisInDWord V1.0.1  
Comparator operations  
14890  
14759  
1124  
1124  
14896  
14766  
1188  
1188  
FC LGF_CompareVariant V1.0.2  
FC LGF_CompareReal V1.0.0  
Math operations  
10955  
6281  
620  
118  
10966  
6302  
684  
182  
FC LGF_AverageAndDeviation V1.0.2  
FB LGF_FloatingAverage V1.1.0  
FC LGF_MatrixAddition V2.0.0  
FC LGF_MatrixInverse V2.0.0  
FC LGF_MatrixMultiplication V2.0.0  
FC LGF_MatrixSubtraction V2.0.0  
FC LGF_MatrixTranspose V2.0.0  
FB LGF_MinMaxHistory V1.0.1  
FC LGF_RandomBasic V1.0.0  
FC LGF_RandomInt V1.0.1  
FB LGF_RandomReal V1.0.2  
FC LGF_SearchMinMax V1.0.1  
FC LGF_XRoot V1.0.1  
29602  
16590  
11514  
15936  
12172  
11545  
9971  
3194  
748  
489  
1017  
546  
489  
383  
114  
191  
241  
281  
4642  
49  
29614  
16506  
11556  
15976  
12213  
11590  
10010  
6144  
3258  
830  
553  
1081  
610  
553  
447  
178  
255  
305  
345  
4706  
113  
334  
393  
209  
127  
6150  
6844  
6868  
9104  
9115  
9528  
9550  
36145  
4688  
36195  
4693  
FC LGF_HighLowLimit V1.0.0  
FC LGF_Integration V1.0.0  
FC LGF_Factorial V1.0.0  
8978  
262  
323  
145  
75  
9015  
11058  
6280  
11073  
6293  
FC LGF_Distance V1.0.0  
5226  
5171  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
6
1 Library Overview  
1.3 Library resources  
Block  
CPU 1212 assignment  
(bytes)  
CPU 1511 assignment  
(bytes)  
Load  
Main  
Load  
Main  
memory  
memory  
memory  
memory  
Data handling  
FB LGF_FIFO V1.0.2  
20681  
1688  
20773  
1784  
FB LGF_LIFO V1.0.0  
18620  
9477  
1547  
345  
18713  
9564  
1639  
417  
FB LGF_RingBuffer V1.0.2  
FB LGF_ShellSortInt V1.1.1  
FB LGF_ShellSortUint V1.1.1  
FB LGF_ShellSortReal V1.1.1  
FC LGF_CRC8 V1.0.0  
18458  
18563  
18484  
7173  
1458  
1458  
1458  
202  
18526  
18637  
18530  
7205  
1540  
1540  
1540  
266  
FC LGF_CRC8For1Byte V1.0.0  
FC LGF_CRC16 V1.0.0  
5655  
103  
5652  
167  
7525  
221  
7506  
285  
FC LGF_CRC32 V1.0.0  
15939  
855  
15867  
919  
Converter operations  
FC LGF_BinaryToGray V1.0.2  
FC LGF_GrayToBinary V1.0.2  
FC LGF_BitsToWord V1.0.0  
FC LGF_WordToBits V1.0.0  
FC LGF_DTLtoString V1.0.1  
FC LGF_StringToDTL V1.0.1  
FC LGF_TemperatureConvert V1.0.1  
FC LGF_ScaleLinear V1.0.0  
FC LGF_StringToTaddr V1.0.0  
FC LGF_TaddrToString V1.0.0  
FC LGF_IntToString V1.0.0  
FC LGF_TimeToString V1.0.0  
Signal generators  
4327  
11803  
6052  
36  
872  
4335  
11809  
6079  
100  
936  
186  
250  
6226  
175  
6250  
239  
16403  
19911  
6644  
876  
16395  
19886  
6624  
935  
1116  
242  
1139  
306  
29123  
21707  
10780  
6137  
4443  
883  
29144  
21715  
10825  
6133  
4507  
941  
388  
447  
146  
205  
13676  
1064  
13687  
1123  
FB LGF_Frequency V1.1.2  
FB LGF_Impulse V1.2.0  
10878  
7730  
345  
131  
249  
276  
364  
260  
286  
286  
10871  
7719  
412  
200  
320  
347  
435  
331  
357  
357  
FB LGF_SawTooth V1.0.2  
FB LGF_SawToothCI V1.0.0  
FB LGF_TriangleCI V1.0.0  
FB LGF_RectangleCI V1.0.0  
FB LGF_SinusCI V1.0.0  
10137  
9912  
10179  
9903  
10541  
9841  
10656  
9915  
10080  
10157  
10123  
10168  
FB LGF_CosinusCI V1.0.0  
Technology operations  
FB LGF_LimRateOfChangeBasic V1.0.1  
FB LGF_LimRateOfChangeAdvanced V1.0.1  
FB LGF_Ramp V1.0.1  
11985  
24401  
27084  
12901  
357  
1474  
1440  
564  
12022  
24704  
27144  
13014  
430  
1706  
1517  
640  
FB LGF_NonLin V1.0.0  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
7
2 Working with the Library  
2
Working with the Library  
2.1  
General  
All blocks in the "LGF" library are unrestricted in connection with S7-1200 and S7-  
1500 controllers.  
Most of the blocks are stored in the library as types. Thus, the blocks are versioned  
and thus can benefit from all advantages.  
Central update function of library elements  
Versioning of library elements  
Note  
Information on how to work with libraries is available in the Guideline on Library  
Handling  
and in the “Programming Guideline for S7-1200/1500” in chapter “Libraries”.  
Note  
All blocks in the LGF have been created according to the Programming  
Styleguide.  
Further information on libraries in TIA Portal:  
Topic page libraries  
How can I open libraries in STEP 7 (TIA Portal)?  
Automation Tasks in 10 minutes or less TIA Portal: Time Savers Global  
Libraries  
Which elements of STEP 7 (TIA Portal) can you store in a library as Type or as  
Master Copy?  
When starting TIA Portal V13 onwards, how do you get a global library to open  
automatically and use it as corporate library, for example?  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
8
2 Working with the Library  
2.2  
Simulatability with SIMATIC S7-PLCSIM Advanced  
(NEW)  
To make sure that the blocks can be simulated with SIMATIC S7-PLCSIM  
Advanced after compiling, proceed as follows:  
1. Open the properties of your project, go to the “Protection” tab and enable the  
option "Support simulation during block compilation”.  
2. In your project, right-click a block (e. g. “LGF_FIFO”) in the project library and  
select "Edit type”.  
A new version of the block is created,  
3. Compile the project.  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
9
2 Working with the Library  
In the properties of the block (e. g. “LGF_FIFO”), the option "Can be simulated  
with SIMATIC S7-PLCSIM (Advanced)” is enabled automatically.  
4. After loading, the block can be simulated with SIMATIC S7-PLCSIM Advanced.  
5. In the project library, right-click the new version “[in test]”.  
If, after simulation, you want to keep the original version, select "Discard  
changes and delete version".  
Thus, you stay compatible with the LGF library.  
If, nevertheless, you want to keep the new version, select "Release  
version".  
Note  
Blocks with enabled simulatability require more memory space in the PLC.  
Library of General Functions (LGF)  
Entry ID: 109479728, V4.0.2, 10/2018  
10  

全部评论(0)

暂无评论