您现在所在的是:

西门子SIEMENS

回帖:31个,阅读:6493 [上一页] [1] [2] [3] [4] [下一页]
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:56:00
#10楼
Configuration elements in IEC 1131-3
An IEC 1131-3 conform PLC programming system reflects the hardware structure with the configuration elements. These configuration elements are basically configurations, resources and tasks.

Configurations in IEC 1131-3

A configuration can be compared to a programmable controller system, e.g. a rack. In a configuration one or several resources can be defined.

Resources in IEC 1131-3

A resource can be compared to a CPU which can be inserted in the rack. In a resource global variables can be declared, which are only valid within this resource. In a resource one or several tasks can be executed.

Tasks in IEC 1131-3

Tasks determine the time scheduling of the programs associated with them. This means that programs have to be associated to tasks. The settings of the task determine the time scheduling.

IEC 1131-3 describes different time scheduling models which results in three different task types:

Cyclic tasks are activated in a certain time interval and the program is executed periodically.


System tasks are called automatically by the PLC operating system if an error or a change of the operational state of the PLC occurs. They are also known as system programs or SPGs.


Event or interrupt tasks are activated if a certain event has happened.
Each task has a certain priority. In so called preemptive scheduling systems, an active task with low priority is interrupted immediately, when a task with higher priority becomes active due to a certain event. In systems with non-preemptive scheduling, task interruptions by tasks with higher priority are not possible.

The supported task types depend on the used PLC.
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:56:00
#11楼
POUs in IEC 1131-3
Program organization units or POUs are the language elements of a PLC program. They are small, independent software units containing the program code. The name of a POU should be unique within the project.

In IEC 1131-3 three types of POUs are distinguished referring to their different use:

programs


function blocks


functions
Each POU consists of two different parts: The declaration part and the code body part.

In the declaration part all necessary variables are declared.

The instruction or code body part of a POU is the part in which the instructions are programmed in the desired programming language.

图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:56:00
#12楼
Functions in IEC 1131-3
Functions are POUs with multiple input parameters and exactly one output parameter. Calling a function with the same values returns always the same result. Return values can be single data types. Within a function it is possible to call another function but not a function block or a program. Recursive calls are not allowed. The abbreviation for functions is FU.

IEC 1131-3 describes standard functions which can be used while editing your PLC program. According to your hardware and PLC type it is possible that not all standard functions are available or that firmware functions have been added.

For detailed information about the IEC 1131-3 standard functions please refer to the Function/Function block Online Help. For that purpose you can either select the corresponding menu item in the submenu 'Help' or call the context sensitive help topic out of the Edit Wizard. Additional information can be taken from the hardware documentation.
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:56:00
#13楼
Function blocks in IEC 1131-3
Function blocks are POUs with multiple input/output parameters and internal memory. The value that a function block returns depends on the value of its internal memory. Within a function block it is possible to call another function block or functions but not a program. Recursive calls are not allowed. The abbreviation for function blocks is FB.

IEC 1131-3 describes standard function blocks which can be used while editing your PLC program. According to your hardware and PLC type it is possible that not all standard function blocks are available or that firmware function blocks have been added.

For detailed information about the IEC 1131-3 standard function blocks please refer to the Function/Function block Online Help. For that purpose you can either select the corresponding menu item in the submenu '?' or call the context sensitive help topic out of the Edit Wizard. Additional information can be taken from the hardware documentation.
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:57:00
#14楼
Programs in IEC 1131-3
Programs are POUs which contain a logical combination of functions and function blocks according to the needs of the controller process. The behavior and the use of programs are similar to function blocks. Programs have input and output parameters and they can have internal memory. Programs must be associated to tasks.

Within a program it is possible to call functions and function blocks. Recursive calls are not allowed
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:57:00
#15楼
Instantiation
For reusing function block definitions IEC 1131-3 provides the possibility of instantiation. This means that a function block or a program is defined once and that its internal memory is allocated to different instances, different memory regions. Each instance has an associated identifier and contains the input and output parameter and the internal memory of the function block or program. A function block can be instantiated in another function block or in a program. The instance name of a function block has to be used as in the VAR declaration of the program or the function block. Programs can be instantiated within resources.
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:57:00
#16楼
Data types in IEC 1131-3
Data types determine what kind of value the variable can have. Data types define the initial value, range of possible values and the number of bits.

IEC 1131-3 distinguishes three kinds of data types:

Elementary data types


Generic data types


User defined data types
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:58:00
#17楼
Elementary data types
The value ranges and the bitsize of elementary data types are described in IEC 1131-3.

Elementary data types are shown in the following table:

Data type Description Size Range Default initial value
BOOL Boolean 1 0...1 0
SINT Short integer 8 -128...127 0
INT Integer 16 -32768...32767 0
DINT Double integer 32 -2.147.483.648 up to 2.147.483.647 0
USINT Unsigned short integer 8 0 up to 255 0
UINT Unsigned integer 16 0 up to 65535 0
UDINT Unsigned double integer 32 0 up to 4.294.967.295 0
REAL Real numbers 32 -3.402823466E+38...
-1.175494351E-38
0.0
+1.175494351E-38...
+3.402823466 E+38 0.0
TIME Duration 32   t#0s
BYTE Bit string of length 8 8   0
WORD Bit string of length 16 16   0
DWORD Bit string of length 32 32   0


The usage of elementary data types depends on your hardware. Please refer to your hardware documentation for the supported data types.

The data type STRING is also an elementary data type but does not belong to the above mentioned group. Its format in the memory depends on your PLC type.
The data type STRING has the following structure:
Byte 0-1 offset to maximum length (0 corresponds to 80)
Byte 2-3 current length
Byte 4-83 characters
Byte 84 zero terminator

The range given for the data type REAL is the normal range. It is precise up to 6-9 places.

图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:58:00
#18楼
Generic data types
Generic data types are data types which include hierarchical groups of elementary data types. ANY_INT includes the elementary data types DINT, INT, SINT, UDINT, UINT and USINT. If a function can be connected with ANY_INT it means that variables of the data types DINT, INT, SINT, UDINT, UINT and USINT can be handled.

Generic data types are shown in the following table:

ANY
   ANY_NUM
       ANY_REAL
           REAL
       ANY_INT
           DINT, INT, SINT
           UDINT, UINT, USINT
   ANY_BIT
       DWORD, WORD, BYTE, BOOL
   STRING
   TIME
 
The usage of data types also depends on your hardware. Please refer to your hardware documentation for restrictions concerning generic data types.
图
6285
karl 版主
文章数:1703
年度积分:48
历史总积分:6285
注册时间:2003/12/26
发站内信
发表于:2004/11/3 19:58:00
#19楼
User defined data types
User defined data types are edited by the application programmer with a TYPE ... END_TYPE declaration using the text editor in a data type worksheet. Derived data types can be enumerated data types, structures or arrays.

Array data types include several elements of one data type. An array can be used to declare several elements of the same type with only one line in the type declaration. Click here to see an example.

Structured data types include several elements of different data types. Click here to see an example.

User defined strings are STRING data types with a variable number of characters. Declaring a user defined string the length is set in brackets behind the data type as it is shown in the example.

Enumerated data types limit the possible values to the enumerated ones. The variable in which the data type is used can have only the enumerated values. Click here to see an example.

The usage and (memory) format of structured data types, user defined strings, enumerated data types depends on your PLC type. Please refer to your hardware documentation concerning the use of these enumerated data types.
图

关于我们 | 联系我们 | 广告服务 | 本站动态 | 友情链接 | 法律声明 | 非法和不良信息举报

工控网客服热线:0755-86369299
版权所有 工控网 Copyright©2024 Gkong.com, All Rights Reserved

62.4004