Lec2 PLC

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

2

PROGRAMMABLE LOGIC CONTROLLERS SIEMENS SIMATIC S7 HARDWARE AND BASIC PRINCIPLES

Study duration: 90 min.

2.1

Overview of programmable logic controllers SIMATIC S7

Control system SIMATIC are known above all our reliability. Series SIMATIC S5 is older series of SIMATIC. SIMATIC S5 was popular series when the programmable logic controller SIMATIC started . Now is availability series of SIMATIC S7. SIMATIC S7 offers the most modern solution for all types technological aplication. 2.1.1 LOGO! LOGO! is a universal logic module made by Siemens. LOGO! offers solutions for domestic and installation engineering (e.g. for stairway lighting, external lighting, sun blinds, shutters, shop window lighting etc.), switch cabinet engineering, as well as for mechanical and apparatus engineering (e.g. for gate control systems, air-conditioning systems, or rainwater pumps etc.). LOGO! can also be implemented for special control systeme in conservatories or greenhouses, for control signal processing and, by connecting a communication module (e.g. ASi), for distributed local controlling of machines and processes. Special versions without operator panel and display unit are available for series production applications in small machine, apparatus, switching cabinet and installation engineering. Maximum setup of a LOGO! is 24DI / 16DO / 8AI / 2 AO. [17, 30, 35]

Fig. 2.1: LOGO!. LOGO! Integrates: Controls. Operator and display panel with background lighting. Power supply. Interface for expansion modules. Interface for the program module (card) and a PC cable. Pre-configured standard functions, e.g. on -and off delays, pulse relay and softkey. Timer. PI controller. Digital and analog flags. Inputs and outputs, according to the device type.

Digital inputs I5,I6 can be used for high-speed counting max. 2kHz (for LOGO! 12/24 RC/RCo OBA5 a LOGO! 24/24o OBA5). Inputs I7 and I8 are analog inputs (voltage 0-10V).

2.1.2 S7-200 The S7-200 series of micro-programmable logic controllers (Micro PLCs) can control a wide variety of devices to support your automation needs. The S7-200 monitors inputs and changes outputs as controlled by the user program, which can include Boolean logic, counting, timing, complex math operations, and communications with other intelligent devices. The compact design, flexible configuration, and powerful instruction set combine to make the S7-200 a perfect solution for controlling a wide variety of applications. Maximum I/O address area is 128DI/120DO / 28AI/14AO. [31, 35] Properties micro PLCs: Execution time for bit operation, min. 0,22s. High-speed counters (typically 30kHz). Two digital inputs might be configured as interrupted. Can be controlled 8 closed-loop control with PID controller. PID controller with autotunning. Can be connected expansions modules (position control modul for step motors, measure temperature (TC, RTD), compact weighing electronics systems SIWAREX MS, modul AS interface, modem modul, PROFIBUS-DP modul, Ethernet modul.

Fig.2.2: Micro PLC - S7-200. 2.1.3 S7-300 Modular Controller - SIMATIC S7-300 is optimized for high performance machina and faktory automation. [17, 32, 35] Built-in functions (e.g., high-speed counting, closed-loop control, motion control, etc.). Extensive selection of CPUs and modules for almost every application. Compact design reduces kontrol cabinet size. Integrated system diagnostics assure a high degrese of controller availability.

Innovative Micro Memory Card provides maintenance- freee (no battery reguired) program backup plus the ability to store production and project information. Engineering using a project approach to assist in implementing a tightly integrated system. Fail-safe version provides machina safety and standard automation in a single controller.

Fig..2.3: Modular Controller S7-300 (with CPU 319 3 PN/DP). 2.1.4 S7-400 System Optimized Controller SIMATIC S7-400 is power controller for system solutions in production and process applications: [17, 33, 35] Implement high-speed and complex applicatins using extremely high processing and communication capabilities. Perform central coordination of distributed slave controllers in plant-wide architectures Virtually no limits on I/O capacities. System expansions possible dutiny operation and without interrupting processes thanks to Configuration in RUN and hot-swapping of moduls. One controller fits all: integrate machina and process safety with standard automation in a single controller using fail-safe option. Keep high-availability processes running wth redundant option. Engineered using a project approach to aid in implementing a tightly integrated system.

Fig.2.4: Controller SIMATIC S7-400 CPUs.

Tab. 2.1: Compared basic parameters controllers. CPU 224 XP Main memory, max. 12kB program, (10kB data) Execution time for bit operation, 0,22s min. Load memory/mass storage max. 256kB Counters 256 Timers 256 I/O address area, max. Max. 168I/O (14 DI /10 DO integrated in CPU) Analog input/output 30/15 (2AI / 2AO integrated in CPU) Networking PPI,MPI, Freeport, AS-Interface, PROFIBUS, Ind.Ethernet Integrated CPU 314C-2DP 64kB 64kB a 8MB 0,1 s 8MB 256 256 Max. 1016I/O (24 DI /16 DO integrated in CPU) 253 (4AI / 2AO integrated in CPU) PPI,MPI, AS-Interface, PROFIBUS/ PROFINET Ind. Ethernet, Integrated CPU 416-3 DP 2,8MB, (2,8MB program) 0,04 s 64MB 2048 2048 131072DI / 121072DO

8192AI / 8192AO PPI,MPI, PROFIBUS / PROFINET Ind.Ethernet Integrated

Real time clock

2.2

PLC S7-300 and its basic characteristics

The SIMATIC S7-300 saves space, and it is compact and modular. It is a stranger to slot rules, and it has no need for fans. The modules are simply hung on a DIN rail and screwed on to form a rugged, electromagnetically compatible configuration. The backplane bus is already integrated into the modules: just plug in the bus connectors and you're ready to go. With the varied range of modules for the SIMATIC S7-300, centralized expansions and simple distributed structures can be configured - for low-cost spare parts management There's everything from the entry-level CPU right up to the high-performance unit. Depending on the task, there are CPUs with integral I/O, integrated technological functions, and integrated communications interfaces. They all have one thing in common: efficient processing speed for short machine cycle times. 2.2.1 Standard CPUs It is used in installations which have distributed automation structures in addition to a centralized I/O. It is often used as the standard PROFIBUS DP master in SIMATIC S7-300. The CPU is also used as distributed intelligence (DP slave).

It has been optimized in terms of its quantitative framework for using SIMATIC Engineering Tools, e.g.: [17, 32] Programming with SCL. Sequence control programming with S7-GRAPH. In addition, the CPU offers an ideal platform for simple technology tasks implemented in software, e.g. Easy Motion Control. The solution of closed-loop control tasks with STEP 7 blocks or the runtime software Standard/Modular PID Control. Extended process diagnostics can be achieved by using SIMATIC S7-PDIAG. CPUs: CPU 312, CPU 314, CPU 315-2DP, CPU 315 2 PN/DP, CPU 317-2DP, CPU 317-2PN/DP, CPU 319 3 PN/DP.

Fig. 2.5: Example of standard CPU and CPU with interface for PROFINET. Tab. 2.2: Description standard CPU. CPU SIMATIC S7-300 Work memory Bit operation Word operation Fixed-point operation Floating-point operation S7 timers/counters Address areas Digital channels (central) Analog channels (central) Networking MPI PROFIBUS DP PROFINET CPU 312 32kB 0,2 s 0,4 s 5 s 6 s 128/128 256 64 CPU 314 96kB Execution time 0,1 s 0,2 s 2 s 3 s 256/256 1024 256 CPU 315-2DP 128kB 0,1 s 0,2 s 2 s 3 s 256/256 1024 256 CPU 3172DP 512kB 0,05 s 0,2 s 0,2 s 1 s 512/512 1024 256

CPU SIMATIC S7-300 PtP - komunikace

CPU 312

CPU 314

CPU 315-2DP

CPU 3172DP

Tab. 2.3: Description standard CPU with integrated interface for PROFINET. CPU SIMATIC S7-300 Work memory Bit operation Word operation Fixed-point operation Floating-point operation S7 timers/counters Digital channels (central) Analog channels (central) Networking MPI PROFIBUS DP PROFINET CBA, Io 2.2.2 Compact Controllers The CPU 3xxC-2 DP is the compact CPU for installations with a decentralized structure. With its extended working memory the compact CPU is also suitable for medium-sized applications. Integrated digital and analog I/Os enable a direction connection to the process, the PROFIBUS DP master/slave interface allows the connection of standalone I/O units. The CPU 3xxC-2 DP can thus be used both as a local unit for quick pre-processing as a higherlevel control with a subordinate fieldbus system. [1, 17, 32] Additional possibilities of use are provided with the integrated process-related functions: Count. Frequency measurement. PID control. CPUs: CPU 312C, CPU 313C, CPU 313 C 2DP, CPU 313 C 2PtP, CPU 314 C 2DP, CPU 314 C 2PtP. CPU 315-2 PN/DP CPU 317-2 PN/DP 512kB 64kB a 8MB CPU 319-3 PN/DP 1,4MB 64kB a 8MB 0,01 s 0,02 s 0,02 s 0,04 s 2048/2048

128kB 64kB a 8MB Execution time 0,1 s 0,05 s 0,2 s 0,2 s 2 s 0,2 s 3 s 1 s 256/256 512/512 1024 256

Fig. 2.6: Example of compact controller. Tab. 2.4: Description of compact PLCs. SIMATIC S7-300 Work memory Execution time Bit operation Word operation Fixed-point operation Floating-point operation S7 timers/counters Address areas Digital channels (central) Analog channels (central) Networking MPI PROFIBUS DP PROFINET PtP - communication Integrated I/O DI/DO AI/AO Integrated functions Counter Pulse outputs Open-loop positioning Integrated Controlling FB CPU 312C 32 kB 0,2 s 0,4 s 5 s 6 s 128/128 266 64 Compact PLCs CPU 313C CPU 313C-2DP CPU 314C-2DP CPU 313C-2PtP CPU 314C-2PtP 64 kB 96 kB 96 kB 0,1 s 0,2 s 2 s 3 s 256/256 1016 253 0,1 s 0,2 s 2 s 3 s 256/256 1008 248 0,1 s 0,2 s 2 s 3 s 256/256 1016 253

ASCII, 3964 R only by PtP 10/6 2(10 kHz) 2(10 kHz) --PID Controller 24/16 4/2 3(30 kHz) 3(2,5 kHz) --PID Controller 16/16 3(30 kHz) 3(2,5 kHz) --PID Controller 24/16 4/2 4(60 kHz) 4(2,5 kHz) PID Controller

2.2.3 Fail-safe Controllers Safety CPUs integrated automation and machine safety in a single controller. The S7-300F CPUs can be expanded centrally with the safety modules for the ET 200M I/O. Distributed expansion is possible using the safety ET 200S I/O modules, the ET 200M I/O modules, the ET 200pro (IP67) I/O modules or the safety digital block peripheral device ET 200eco (IP67). [17, 32, 35] Eliminate the need for separate hardwired electromechanical safety systems. Simply wire safety-related sensors directly into the controller. Program with the same software tool, use the same spare parts, and share common networks with all the standard controllers in the SIMATIC family. Available as a fail-safe controller for both simple and complex safety applications. CPUs: CPU 315F-2DP, CPU 315F-2PN/DP, CPU 317F-2DP, CPU 317F-2PN/DP.

Fig. 2.7: Example of fail-safe controller. Tab. 2.5: Description fail-safe CPU SIMATIC S7-300 Work memory Execution time Bit operation Word operation Fixed-point operation Floating-point operation S7 timers/counters Networking MPI PROFIBUS DP PROFINET CBA,IO CPU 315-F 2 DP 192kB Fail-safe CPU CPU 315-F 2 PN/DP 256kB 0,1 s 0,2 s 2 s 3 s 256/256 CPU 317-F 2 DP 1MB 0,05 s 0,2 s 0,2 s 1 s 512/512 CPU 317-F 2 PN/DP

2.2.4 Technology CPUs Technology SIMATIC CPU contains integrated technology/motion control function with full functionality of the standard e.g. CPU 315-2DP and CPU 317-2DP. The S7-300 technology CPUs 315T-2 DP and 317T-2 DP provide the full functionality of the powerful standard CPUs with integrated technology functions e.g. PLCopen-compatible motion control functions. The technology CPUs are compactly built with high-speed distributed I/Os (4 digital inputs, 8 digital outputs) and two PROFIBUS DP interfaces: [15, 32] Isochronous PROFIBUS interface DP(DRIVE) for the dynamic motion control of several coupled or single axes. MPI/DP interface for connecting other SIMATIC components, for example PG, OP, S7 controllers and distributed I/O. For operation as a DP interface, extended networks can be set up. CPUs: CPU 315T-2DP, CPU 317T-2DP. The advantages at a glance: High economic efficiency and flexibility by implementing your PLC, motion control and technological demands: - Scaleable PLC performance (CPU 315T/CPU 317T). - Integration of technology/motion control in a SIMATIC CPU. - Centralised/decentralised expandability for a wide variety of tasks provided by the use of the comprehensive SIMATIC product line. Cost savings by means of the absolute simple and fast engineering: - From drives to motion control to PLC all with STEP 7. - Reduced programming costs/optimised time-to-market by the reuse of existing S7 programs. - PLCopen-certified motion control functions facilitate engineering and service - Reduced training effort for commissioning and service people thanks to full programming in all SIMATIC languages.

Fig. 2.8: Example of technology controller.

Tab. 2.6: Description technology CPU . SIMATIC S7-300 Work memory Execution time Bit operation Word operation Fixed-point operation Floating-point operation S7 timers/counters Digital channels (central) Analog channels (central) Networking MPI PROFIBUS DP PROFINET PtP - komunikace Integrated functions Technology CPU CPU 315T-2DP 128kB 0,1 s 0,2 s 2 s 3 s 256/256 1024 256 CPU 317T-2DP 512kB 0,05 s 0,2 s 0,2 s 1 s 512/512 1024 256

Gearbox synchronism and curve synchronism, Travel to fixed stop, Print mark correction via probe, Path-or-time dependent cam switching, Positron-controlled positioning.

Addressing Slot-based addressing is the default setting, that is, STEP 7assigns each slot number a defined module start address. In slot-based addressing (default addressing), a module start address is allocated to each slot number This is a digital or analog address, depending on the type of module. User-specific addressing of modules is always requirement when using PROFIBUS-DP or PROFINET IO field device. There is no fixed slot addressing for such a configuration. User-defined addressing means that you can assign an address of your choice to any module (SM/FM/CP). The addresses are assigned in STEP7. Here, you specify the module start address that forms the basis for all other addresses of the module.

Fig. 2.9: S7-300 slots and the associated module start addresses.

2.3

Technical specifications S7-300

User defined addressing is supported by PLC S7-315-2DP. That means, the user can select the addresses for the separate modules. The advantage is the improvement of the address area. [1, 3]

Fig. 2.10: Compact PLC S7-300 (CPU xxx C-2PtP(DP)). Tab. 2.7: Description compact PLCs. The figure show on position Description (1) (2) (3) (4) (5) (6) (7) Status and error displays Micro Memory Card (MMC) Connection of integrated I/O Power supply connection 2. connected X2( PtP nebo DP) 1. connected X1( MPI) Mode selector switch

Tab. 2.8: Status and Error Indicators: CPU 31xC. LED designation SF BF ( for CPUs with interface only s DP) DC5V FRCE RUN STOP Color red red green yellow green yellow Meaning Hardware or software error Bus error 5-V power for CPU and S7-300 bus is OK Force jo bis active CPU in RUN CPU in STOP and HOLD or STARTUP

Fig. 2.11: Integrated I/Os of CPU 31xC (CPU 314C-2PtP, for example). Tab. 2.9.: Description integrated inputs/outputs. The figures show (1) (2) (3) The following integrated I/Os Analog I/Os Each with 8 digital inputs Each with 8 digital outputs

Addressing digital inputs The address of input or output consists of byte and bit part. For example I 124.2 input (I input), byte 124, bit 2

Addressing analog inputs The address is always for the input or output analog channel word it is 16bit. The addresses are increased after two (bytes).

2.4

Memory concept

The memory of CPU has three memory areas. The load memory is located on the SIMATIC Micro Memory Card (MMC). The size of the load memory corresponds exactly to the size of the SIMATIC Micro Memory Card. It is used to store code blocks, data blocks and system data (configuration, connections, module parameters, etc.). Blocks that are identified as non runtimerelated are stored exclusively in load memory. You can also store all the configuration data for your project on the SIMATIC Micro Memory Card. System memory: The RAM system memory is integrated in the CPU and cannot be expanded. It contains the address areas for address area memory bits, timers and counters, the process image of the I/Os, local data. RAM: The RAM is integrated in the CPU and cannot be extended. It is used to run the code and process user program data. Programs only run in RAM and system memory.

Fig. 2.12: Memory. 2.4.1 Retentivity of load memory, system memory and RAM Your CPU is equipped with a service-free retentive memory, i.e. its operation does not require a buffer battery. Data is kept in retentive memory across POWER OFF and restart (warm start). Retentive data in load memory : Your program in load memory is always retentive: It is stored on the SIMATIC Micro Memory Card, where i tis protecte against power failure or CPU memory restart. Retentive data in system memory: The diagnostic buffer, MPI address (and transmission rate) and operating hour counter data and generlky written to retentive memory area on the CPU. Retentivity of the MPI address and baud rate ensures that your CPU can continue to communicate, even after a power loss, memory reset or los sof communication parameters (e.g. due to removal of the SIMATIC Micro Memory Card or deletion of communication parameters. Retentive data in RAM: Therefore, the contents of retentive DBs are always retentive at restart and POWER ON/OFF. CPUs V2.1.0 or higher also support volatile DBs (the volatile DBs are initialized at restart of POWER OFF-ON with thein initial values from load memory). 2.5 Process Images

The process images are special part of memory whose are stored a status inputs or outputs. The operating system updates the process image periodically. Process image access, compared to direct I/O access, offers the advantage that a consistent image of process signals is made available to the CPU during cyclic program execution. When the signal status at an input module changes during program execution, the signal status in the process image is maintained until the image is updated in the next cycle. Moreover, since the process image is stored in CPU system memory, access is significantly faster than direct access to the signal modules.

Fig. 2.13: Process images.

2.6

Logical division of the memory address areas

The system memory of the S7 CPUs is divided into address areas (see table below). Using instructions in your program, you address the data directly in the corresponding address area. [18] Tab. 2.10: Address areas. Address Area Access via Units S7 Description of Following Size Notation (IEC) I At the beginning of the scan cycle, the CPU reads the inputs from the input modules and records the values in this area. (e.g. I 124.0) e.g. IB 124 e.g. IW 126 e.g. ID 128 Dutiny the scan cycle, the program calculates output values and places them in this area. At the end of the scan cycle, the CPU sends the calculated output values to the output modules. (e.g. Q 124.0) e.g. QB 0 e.g. QW 2 e.g. QD 4 This area provides storage for interim results calculated in the program (e.g. M10.0) e.g.MB 20

Input (bit) Process image input table Input byte Input word

IB IW

Process image output table

Input double ID word Output (bit) Q

Bit memory

Output byte Output word Output double word Memory (bit)

QB QB QB M

Memory byte

MB

Address Area

Access via Units S7 Description of Following Size Notation (IEC) Memory word MW Memory double MD word Timer (T) T Counter (C) C Data block, DB opened with OPN DB: e.g.MW 200 e.g. MD 220 This area provides storage for timers. (e.g. T32) This area provides storage for counters. Data blocks contain information for the program. They can be defined for general use by all logic blocks (shared DBs) or they are assigned to a specific FB or SFB (instance DB). e.g. DBX 0.0 e.g. DBB 2 e.g. DBW 4 e.g. DBD 6

Timers Counters Data block

Local data

Data bit Data byte Data word Data double word Data block, opened with OPN DI Data bit Data byte Data word Data double word Local data bit

DBX DBB DBW DBD DI

DIX DIB DIW DID L

This area contains the temporary data of a block while the block is being executed. The L stack also provides memory for transferring block parameteres and for recording interim results from Ladder Logic networks.

Peripheral (I/O) area: inputs

Local data byte Local data word Local data double word Peripheral input byte

LB LW LD PIB The peripheral input and output areas allow direct access to central and distributed input and output modules (DP). e.g. PIW272 e.g. PID274

Peripheral (I/O) area:

Peripheral input PIW word Peripheral input PID double word Peripheral output PQB byte

Address Area Outputs

Access via Units S7 Description of Following Size Notation (IEC) Peripheral output PQW word Peripheral output PQD double word e.g. PQW272 e.g. PQD274

2.7

Addressing

Immediate Addressing With immediate addressing, the address is coded directly in the instruction; that is, it directly follows the value with which the instruction is to work (for example, Load). An instruction can also provide its own value (for example, SET, see Tab. 2-11). Tab. 2.11: Immediate addressing.

Direct Addressing An instruction that uses direct addressing has the following two-part address that indicates the location of the value that the instruction is going to process: An address identifier (for example, IB for input byte). An exact location within the memory area that is indicated by the address identifier. The address points directly to the location of the value. Tab. 2.12: Direct addressing.

2.8

Data types

2.8.1 User-Defined Data Types (UDT) User-defined data types are special data structures you create yourself that you can use in the whole S7 program once they have been defined. [18] User-defined data types can be used like elementary data types or complex data types in the variable declaration of logic blocks (FC, FB, OB) or as a data type for variables in a data block (DB). You then have the advantage that you only need to define a special data structure once to be able to use it as many times as you wish and assign it any number of variables. User-defined data types can be used as a template for creating data blocks with the same data structure, meaning you create the structure once and then create the required data blocks by simply assigning the user-defined data type (Example: Recipes: The structure of the data block is always the same, only the amounts used are different). User-defined data types are created in the SIMATIC Manager or the incremental editor just like other blocks. Structure of a User-Defined Data Type When you open a user-defined data type, a new working window is displayed showing the declaration view of this user-defined data type in table form. The first and the last row already contain the declarations STRUCT and END_STRUCT for the start and the end of the user-defined data type. You cannot edit these rows. You edit the user-defined data type by typing your entries in from the second row of the declaration table in the respective columns. You can structure user-defined data types from: - Elementary data types. - Complex data types. - Existing user-defined data types.

The user-defined data types in the S7 user program are not downloaded to the S7 CPU. They are either created directly using an incremental input editor and edited, or they are created when source files are compiled. 2.8.2 Elementary Data Types Each elementary data type has a defined length. The following table lists the elementary data types. [18] Tab. 2.13: Elementary Data Types. Type and Siz Format Descriptio e in Options n Bit s Range and Number Example Notation (lowest to highest value)

Type and Siz Format Descriptio e in Options n Bit s BOOL(Bit 1 ) 8 BYTE (Byte) 16 WORD (Word) Boolean text Hexadecim al number Binary number Hexadecim al number BCD Decimal Decimal number unsigned Binary number Hexadecim al number Decimal number unsigned Decimal number signed Decimal number signed IEEE Floatingpoint number S7 time in steps of 10 ms (default) IEC time in steps of 1 ms, integer signed

Range and Number Example Notation (lowest to highest value) TRUE/FALSE B#16#0 to B#16#FF 2.0 to 2#1111_1111_1111_1111 W#16#0 to W#16#FFFF C#0 to C#999 B#(0.0) to B#(255.255) TRUE L B#16#10 L byte#16#10 L 2#0001_0000_0000_0000

L W#16#1000 L C#998 L B#(10,20)

DWORD (Double word)

32

2#0 to 2#1000_0001_0001_1000_ 2#1111_1111_1111_1111 1011_1011_0111_1111 1111_1111_1111_1111 DW#16#0000_0000 to L DW#16#00A2_1234 DW#16#FFFF_FFFF L dword#16#00A2_1234 B#(0,0,0,0) to L B#(1, 14, 100, 120) B#(255,255,255,255) L byte#(1,14,100,120) -32768 to 32767 L1

INT (Integer)

16

32 DINT (Integer, 32 bits) 32 REAL (Floatingpoint number) 16 S5TIME (SIMATIC time) TIME (IEC time) 32

L#-2147483648 L#2147483647

to L L#1

Upper limit: 3.402823e+38 L 1.234567e+13 Lower limit: 1.175 495e-38 L S5T#0H_1M_0S_0MS L S5TIME#0H_1H_1M_0S_0 MS L T#0D_1H_1M_0S_0MS L TIME#0D_1H_1M_0S_0M S L D#1996-3-15

DATE

16

S5T#0H_0M_0S_10MS to S5T#2H_46M_30S_0MS and S5T#0H_0M_0S_0MS T#24D_20H_31M_23S_648 MS to T#24D_20H_31M_23S_647 MS IEC date in D#1990-1-1 to

Type and Siz Format Descriptio e in Options n Bit s (IEC date) TIME OF 32 DAY (Time) 8 CHAR (Character ) steps of 1 day Time in steps of 1 ms ASCII characters

Range and Number Example Notation (lowest to highest value) D#2168-12-31 TOD#0:0:0.0 TOD#23:59:59.999 'A','B' etc. L DATE#1996-3-15 to L TOD#1:10:3.3 L TIME_OF_DAY#1:10:3.3 L 'E'

2.8.3 Complex Data Types Complex data types define data groups that are larger than 32 bits or data groups consisting of other data types. STEP 7 permits the following complex data types: [18] DATE_AND_TIME. STRING. ARRAY. STRUCT. UDT (user-defined data types). FBs and SFBs. The following table describes the complex data types. You define structures and arrays either in the variable declaration of the logic block or in a data block. Table. 2.14: Complex Data Types. Data Type DATE AND TIME STRING Description Defines an area with 64 bits (8 bytes). This data type saves in binary coded decimal format: Defines a group with a maximum of 254 characters (data type CHAR). The standard area reserved for a character string is 256 bytes long. This is the space required to save 254 characters and a header of 2 bytes. You can reduce the memory required for a string by defining the number of characters that will be stored in the character string (for example: string[9] 'Siemens'). Defines a multidimensional grouping of one data type (either elementary or complex). For example: ARRAY [1..2,1..3] OF INT" defines an array in the format 2 x 3 consisting of integers. You access the data stored in an array using the Index ([2,2]"). You can define up to a maximum of 6 dimensions in one array. The index can be any integer (-32768 to 32767).

ARRAY

Data Type STRUCT

Description Defines a grouping of any combination of data types. You can, for example, define an array of structures or a structure of structures and arrays. Simplifies the structuring of large quantities of data and entering data types when creating data blocks or declaring variables in the variable declaration. In STEP 7, you can combine complex and elementary data types to create your own userdefined" data type. UDTs have their own name and can therefore be used more than once. Simplifies the structuring of large quantities of data and entering data types when creating data blocks or declaring variables in the variable declaration. In STEP 7, you can combine complex and elementary data types to create your own userdefined" data type. UDTs have their own name and can therefore be used more than once. You determine the structure of the assigned instance data block and allow the transfer of instance data for several FB calls in one instance DB.

UDT

UDT

FB, SFB

2.8.4 Structure of a UserDefined Data Type Userdefined data types (UDTs) are special data structures that you create yourself. Since userdefined data types are assigned names they can be used many times over. Once they have been defined, they can be used at any point in the CPU program; in other words, they are shared data types. They can therefore be used: In blocks in the same way as elementary or complex data types. As templates for creating data blocks with the same data structure.

Questions: 1. Do you specify groups of programmable logic controllers? 2. Do compact programmable logic controllers have integrated technological functions? Do they have integrated function for close loop control? 3. What is the difference between compact PLCs and standard PLCs? 4. What is the difference between compact PLCs and technology PLCs? 5. Can a PLC S7-200 be used for close-loop control? 6. Can I use the microsystem LOGO! to communicate through ASi as a slave? 7. How is the memory divided? 8. Where is the users program divided? 9. Do you specify data types? 10. Which types of addressing do you know?

You might also like