textarchive.ru

Главная > Документ


AND- Operation in FBD:

In the function diagram FBD, the AND- Operation is programmed and is shown by figurative representation below:

AND-Operation inputs.

There can be more than 2 inputs!


Output, where the assignment is allocated.




&

Q 4.0

I 0.0


I 0.1



Figurative representation of the logical AND-Operation

Assignment of the result of the logical operation


5.7.2 OR- operation

Example of an OR- Operation:

A lamp should ignite when one or both switches at a normally open circuit are active.

C

S1

ircuit diagram:





M

Comment:

The lamp lights when one or both switches are active.

When the switch S1 or S2 is active, lamp H2 will light up.

A PLC circuit:

In order to implement logic in a PLC program, both switches must be naturally attached at the inputs of the PLC. Here S1 is wired to the input I 0.0 and S2 to the input I 0.1.

In addition, the lamp H2 must be attached to an output e.g. Q 4.0.


Switch S1


I 0.0


Input

I 0.1


Switch S2


M

Lamp H2 should light when switch S1 or S2 is active.


Q 4.0



O

R- Operation in FBD:

In the function diagram FBD, the OR- Operation is programmed and is shown by figurative representation below:

OR-Operation inputs.

There can be more than 2 inputs!


Output, where the assignment is allocated.




Q 4.0

I 0.0


I 0.1



Figurative representation of the logical OR-Operation

Assignment of the result of the logical operation!


5.7.3 Negation

In logical functions it is often required to know whether a NO contact is not active or if a NC contact is active so that there will be no voltage against the appropriate inputs.

This can be achieved with the use of a Negation on the input of the AND/OR Operation.

In the function diagram FBD, the negation of the inputs of the AND- Operation is programmed and is shown by figurative representation below:

Input of the AND-Operation, which is negated!


Figurative representation of the negation!




&

Q 4.0

I 0.0



I 0.1


The output Q 4.0 has the correct value when I 0.0 is not active

and I 0.1 is active.

5.8 HOW IS A PLC- PROGRAM GENERATED? HOW DOES IT ARRIVE IN THE MEMORY OF THE PLC?

The PLC program is provided with the software STEP 7 on a PC and buffered there.

After the PC is connected with the MPI interface of the PLC, the program can be loaded with a loading function into the memory of the PLC.

1. PLC- Program created with STEP 7 on a PC .



2. PC connected with MPI- Interface of the PLC .

3. Program from the PC built in the PLC memory.



PC with STEP 7

PLC S7-300


Notice: The exact execution of the program will be described step by step in chapters 8 through 10.

6. ASSEMBLY AND OPERATION OF THE SIMATIC S7-300.

Device spectrum:

The SIMATIC S7-300 is a modular miniature control system and provides the following device spectrum:

  • Central processing units (CPUs) with different power ranges, partly integrated with In-/Outputs (e.g. CPU312IFM/CPU314IFM) or integrated with a PROFIBUS- Interface (e.g. CPU315-2DP)

  • Power supply devices (PS) with 2A, 5A or 10A.

  • Interface modules (IMs) for a more interconnecting design of the SIMATIC S7-300

  • Signal modules (SMs) for digital and analog in- and output.

  • Function modules (FMs) for special functions (e.g. stepping motor control)

  • Communication processors (CP) for network connection.

Note: Only a current supply device, any CPU as well as a digital in and output is required for this module.

I

mportant elements of a voltage supply and CPU:

MPI- Interface:

Each CPU possesses an MPI interface for the networking of program devices (e.g. PC adapter). This is found behind a flap at the front of the CPU.

Mode selector:

Each CPU possesses a code switch for the switching of the modes of operation. Certain programmed functions are allowed depending upon the position of the code switch. The following modes of operation are possible:

M

emory reset:

Memory reset erases all user data on the CPU each time the program is begun.

This is performed in the following three steps:


7. EXAMPLE EXERCISE

A simple exercise will be performed for our first STEP 7 program.

A press with a protection device will be released only with a START-Button S1 when the safety guard is closed. This condition is supervised with a sensor safety guard BO.

This case accesses a 5/2 directional valve Y0 for the press cylinder every 10 seconds, so that a plastic form can be pressed.

For safety reasons, the press is raised again when the START-Button S1 is released or when the sensor safety guard B0 is no longer activated.

Allocation map:

Address Symbol Comment

I 0.0 B0 Sensor safety guard

I 0.1 S1 Start- Button Q 4.0 Y0 5/2 directional valve for the press cylinder

5/2 directional valve controls the press cylinder.

The cylinder extends as long as the output Y0 is triggered.

Start button S1 to start the press procedure.

Sensor B0 recognizes if the safety guard is in place.



Safety guard to protect from personal injuries.

Push to press plastic form


8. STEP 7- ProjeCt application

File management takes place in STEP 7 with the SIMATIC Manager. Here e.g. program blocks can be copied or be called for further processing with other tools by clicking with the mouse. The operation corresponds to the standards usually seen in WINDOWS 95/98/2000/ME/NT4.0. (e.g. With one right click from the mouse button, one is able to receive the selection menu to each module).

In the folders SIMATIC 300 station and CPU, the structure of the hardware of a PLC is illustrated. Therefore such a project can always be seen as hardware specific.

In STEP 7, each project is put into a firmly given structure. The programs are stored in the following directories:

SIMATIC 300 Station:

Stored here are the appropriate hardware configuration (Hardware/SC*1) and CPU data.


Project:

The directory contains the hardware (e.g. SIMATIC 300 Station) and the sub structure (e.g. MPI and PROFIBUS).



Source Files/SO*1:

Sources are placed here (e.g. SCL- Source Files). They can be converted into executable programs by translation.



Blocks/AP-off*1:

Stored here are the program blocks ( OB, FB, FC, SFB, SFC, DB etc. ).

Symbols/SY*1:

Stored here are the symbol lists for symbolic addressing.

CPU:

The S7 program and the interlaced connecting partners (Connection/CO*1) are registered here.


S7-Program: The user programs (Blocks/AP-off*1), symbol tables (Symbols/SY*1), and Source files(Source files/SO*1) are administered here.


*1 Terms are from STEP 7 Version 2.x

I

n order to make a project independent from the hardware, one can create a project that does not contain all possible files.

This project would have the following structure:

Project:

The directory contains the hardware (e.g. SIMATIC 300 Station) and the sub structure (e.g. MPI and PROFIBUS).


Source Files/SO*1:

Sources are placed here (e.g. SCL- Source Files). They can be converted into executable programs by translation.




Blocks/AP-off*1:

Stored here are the program blocks ( OB, FB, FC, SFB, SFC, DB etc. )


Symbols/SY*1:

Stored here are the symbol lists for symbolic addressing.

S7-Program: The user programs (Blocks/AP-off*1), symbol tables (Symbols/SY*1), and Source files(Source files/SO*1) are administered here.


*1 Terms are from STEP 7 Version 2.x

N

ote: This example will know the programs provided without the configuration of the hardware. Thus, it will load arbitrary configurations of the SIMATIC S7-300, S7-400 or WinAC. Only the addresses of the inputs and outputs must be adjusted for each individual case.

The user must implement the following steps in order to provide a project in which the solution program can be written.

1. The main tool in STEP 7 is the SIMATIC Manager, which can be opened with a double click on the icon ( ® SIMATIC Manager).

  1. STEP 7- Programs are managed in projects. Each project can be newly created ( ® File ® New).

  1. G

    ive the project the Name startup. ( ® startup ® OK)

4. Insert a new S7-Program into startup. ( ® startup ® Insert ® Program ® S7-Program)

5

. The program execution is written into blocks in STEP 7. According to standards, the organization block OB1 is already present. This represents the interface for the operating system of the CPU, which will be automatically called and cyclically worked on.

From this organization block, further blocks e.g. the function FC1 can be called for a program routine. This serves as a process to divide a total task into sub-problems, which are then simpler to solve and simpler to test for functionally.

Program structure of the example:


Organization Block

OB1

Cyclic block called by the operating system. Here the function FC1 is called.

CALL FC1


Function

FC1

This example contains the actual program of the pressing control. It is called by the OB1.





6

. In order to further insert the module FC1 into the project, the folder ‘Blocks‘ must be highlighted.( ® Blocks)

7

. The S7- Block function is inserted into the folder block. ( ® Insert ® S7 Block ® Function)

8. Now the name of the function can be chosen and further entries for the block document can be made. ( ® FC1 ® OK)

9

. The two modules OB1 and FC1 are now available in the SIMATIC Manager and can be further programmed.

9. STEP 7- Program writing in function diagram fBD

One possibility to provide a STEP 7 program is the function diagram FBD. A figurative representation of the control problem by means of symbols with function identifiers is shown below. On the left side of the symbol, the inputs are arranged. On the right side, the outputs.

1. The function FC1 should be worked on here as the first block. The function is opened in the SIMATIC Manager with a double click ( ® FC1)

2

. In the newly opened Editor, the VIEW of the programming language function diagram can be changed from LAD/STL/FBD to FBD ( ® View ® FBD).



3

. The surface program for the programming in the function block diagram (FBD) appears as follows:

Frequently used instructions such as the AND- Box, OR- Box, Assignment, Empty Box, Binary Input, Negated Binary Input, Branch and Connection!


Insert new networks!

Save block!


Catalog of all programmed items!

Download block into the CPU!




Variable declaration table (not used in this example)!

Comments and network block title!

The control problem can be provided here by symbols with function identifies!

Program elements can be shuffled with ‘DRAG‘ and ‘DROP‘ of the mouse into the network. They must then be provided with the correct operation.


Note: The programs in the STEP 7 blocks are programmed in individual networks. Thus there is a possibly to have a further structuring and improved documentation in the network headings‘ results.

4

. For our example, a timer is needed as a pulse. This is called S_PULSE and can be found in the catalog under the point Timers.( ® Timers ® S_PULSE)

Note: If an operation was selected, it is indicated in the footer of the catalog and is accompanied with a brief description.

5

. For exact specifications, information for each operation is contained in the ? symbol, which is the online assistance manual. It is comprehensive and explains each instruction with a detailed example. ( ® ? )

N

ote: The time as a pulse S_PULSE, as used above, holds for as long as the time is given. When the set input S is ‘1‘, the output Q is ‘1‘. If the time is given with a TV or signal level S of ‘0‘, then the output Q will be ‘0‘.

  1. The operation S_PULSE is now inserted into the first network, by placing the cursor over S_PULSE, clicking and then holding the mouse button, dragging the S_PULSE to the network field, and then releasing the mouse button ( ® S_PULSE).

  1. O

    perations that are frequently used e.g. the AND-Operation can be found in the menu bar. They are inserted by first clicking on the input S by the timer, and then on the button (® S ® ).

  1. T

    he timers need to be designed with T1 and be registered with a value of 10 seconds in the S5 Time-Format S5T#10s. In addition, the inputs should be registered as I 0.0 and I 0.1 at the AND- Operation as well as in the network and comment blocks. ( ® T1 ® S5T#10s ® I0.0 ® I0.1 ® Comment)

Note: In order to give a time to a timer, the following syntax must be used:

S5T# 10s

S5T# is the first format and directly after it the time (here 10 seconds) is entered. The time can also be given as milliseconds (ms), minutes (m), and hours (H). These units can also be indicated together (e.g. S5T#3M_3S).

  1. A

    further network is registered by clicking on the symbol in the menu bar. ( ® )

10. Insert an assignment by clicking once on the symbol ( ® )

1

1. The assignment should apply for the output Q4.0 and will take place as long as the Timer’s signal T1 is ‘High‘. These two operands must be inserted before the FC1 can be stored and loaded into the PLC. ( ® Q 4.0 ® T1 ® ® )

Caution: The editor program „LAD/STL/FBD“ was not closed. It can be closed by switching to the SIMATIC Manager in the foot line (Point 12) or by the calling of OB1 with the function “OPEN“.

12. To program the OB1 of the FC-Call, double click on it in the SIMATIC Manager (® SIMATIC Manager ® OB1).


1

3. The properties of the OB1 are held and accepted with OK ( ® OK).

14. In the Editor, the view LAD/FBD/STL can be changed to FBD by clicking on View, and then FBD for the programming language function diagram.( ® View ® FBD)

1

5. The OB1 can be saved by first double clicking on the FC1 (found under the FC Block) in OB1‘s Network 1 catalog, then clicking the save button and then compiling it with the download button . ( ® FC Block ® FC1 ® ® )


10. STEP 7- program debugging in the CPU

1. In order to observe the program in FC1, LAD/FBD/STL’s block must be changed in the editor under Window and then from OB1 to FC1. (® Window ® FC1)

2

. The program in the FC1 can be observed with a mouse click on the eyeglass symbol . The execution of the timer is demonstrated as the signal state of an input and output. ( ® )

T I A Training document Page 48 of 48 Module A3

Last revision: 02/2002 ‘Startup‘ PLC- Programming with STEP 7



Скачать документ

Похожие документы:

  1. Automation– and drive technology- sce (1)

    Документ
    AutomationandDriveTechnology- SCE Training document for the company-wide automation solution Totally Integrated Automation (T I A) MODULE A2 ... was provided by Siemens A&D SCE (automationanddrivetechnology, Siemens A&D Cooperates with Education ...
  2. Automation– and drive technology- sce

    Документ
    AutomationandDriveTechnology- SCE Training document for the company-wide automation solution Totally Integrated Automation (T I A) MODULE A6 ... was provided by Siemens A&D SCE (automationanddrivetechnology, Siemens A&D Cooperates with Education ...
  3. Trendsiters digital content and web technologies

    Документ
    ... to come. Publishing becomes more and more automatedand knowledge-orientated. Peer reviewed ... peer-reviewed predecessor, and spent six years, on and off, studying the ... the IT function to link anddrivetechnology investment decisions to conform to ...
  4. Trendsiters digital content and web technologies (1)

    Документ
    ... to come. Publishing becomes more and more automatedand knowledge-orientated. Peer reviewed ... peer-reviewed predecessor, and spent six years, on and off, studying the ... the IT function to link anddrivetechnology investment decisions to conform to ...
  5. Trendsiters digital content and web technologies (3)

    Документ
    ... to come. Publishing becomes more and more automatedand knowledge-orientated. Peer reviewed ... peer-reviewed predecessor, and spent six years, on and off, studying the ... the IT function to link anddrivetechnology investment decisions to conform to ...

Другие похожие документы..