basic programming simatic s7-300 - geocities€¦ · ppt file · web view · 2012-02-01constantia...

41
By: Andri Kuncoro

Upload: phungtram

Post on 15-Apr-2018

225 views

Category:

Documents


2 download

TRANSCRIPT

By:Andri Kuncoro

SIMATIC Overview

SIMATIC Controller (PLC)

S7-200

S7-300

S7-400

S7 – 300Features : Modular small controll system Performance graded range of CPU Extensive selection of modules Expandable design with up to 32 modules Backplane bus integrated in the modules Can be networked with MPI, Profibus or Industrial ethernet Central PG/PC connection with access to all modules No slot restrictions Configuration and parameter setting with the help “HW Config”

S7 – 300

MRES = Memory reset functionSTOP = Stop mode, program not executedRUN = Program executionRUNP = Program execution, read/write access

SF = Group error, internal CPU or fault in moduleBATF = Battery faultDC5V = Internal 5 VDC voltage indicatorFRCE = FORCERUN = Flashes when the CPU is starting up,

then steady light in Run modeSTOP = Show steady light in Stop modeSF DP = Physical bus faultBUSF = No configuration or incorrect configuration

Mode Selector

Status Indicator

Starting with SIMATIC Manager

SIMATIC Manager menus and toolbars

Standard Library

Context-Sensitive Help in S7

F1

Creating a project

Insert Station

Starting Hardware Configuration Editor

Generating a Hardware setpoint Configuration

Addressing S7 Modules

S

R

1 2 3 4 5 6 7 8 9 10 11

R0 PS CPU IM 0 4 8 12 16 20 24 28

R1 (PS) IM 32 36 40 44 48 52 56 60

R2 (PS) IM 64 68 72 76 80 84 88 92

R3 (PS) IM 96 100 104 108 112 116 120 124

Module Address Overview

Variable Addressing

2x

CPU Properties

2x

Saving the HW Configuration and Downloading it in the Module

Inserting S7 Block

Inserting S7 Block

Block architecture and Block editor

OB : Organization BlockFB : Function BlockFC : FunctionSFB : System Function BlockSFC : System FunctionDB : Data Block

Maximun Nesting Depth :

S7-300 : 8 (16 for CPU 318)

S7-400 :24

Program Structure

Binary Operation

AND - OPERATION

ASSIGNMENT

Binary OperationOR - OPERATION

EXCLUSIVE - OR - OPERATION

Binary Operation

Binary OperationRESET DOMINANT

SET DOMINANT

Binary OperationPOSITIVE EDGE

Binary OperationNEGATIVE EDGE

Binary OperationJUMP UNCONDITIONAL (JU)

JUMP CONDITIONAL (JC)

Digital OperationBIT

BYTE

WORD

For a unit of 8 binary characters, the term BYTE is used. A byte has the size of 8 bits.

A word also has the size of 2 bytes or 16 bits.

A double-word corresponds to the word length of 32 binary characters. A double-word also has the size of 2 words, 4 bytes, or 32 bits.

DOUBLE-WORD

Beberapa operand di S7 :1. Operand input(I)

Bit I 0.0 - … Byte IB 0 - … Word IW 0 - … Double Word ID 0 - …2. Operand Output(Q)

Bit Q 0.0 - … Byte QB 0 - … Word QW 0 - … Double Word QD 0 - …3. Operand Flag(M)

Bit M 0.0 - … Byte MB 0 - … Word MW 0 - … Double Word MD 0 - …4. Operand Timer(T)

T 05. Operand Counter(C) C 0

Digital Operation6. Operand Peripheral(PI)

Input Byte PIB 0 - … Input Word PIW 0 - … Output Byte PQB 0 - … Output Word PQW 0 - …

7.Operand Data(D)Bit DBX 0.0 - …

Byte DBB 0 - … Word DBW 0 - … Double Word DBD 0 - …

PULSE TIMER

Digital Operation

EXTENDED PULSE TIMER

Digital Operation

ON –DELAY TIMER

Digital Operation

OFF-DELAY TIMER

Digital Operation

COUNTER OPERATIONS

Digital Operation

COMPARISON FUNCTIONS

Digital Operation

== IN1 is equal to IN2<> IN1 is not equal to IN2> IN1 is greater than IN2< IN1 is less than IN2>= IN1 is greater than or equal to IN2<= IN1 is less than or equal to IN2

Digital Operation

???Data Block

???Scale & Unscaled

Matur Suwun…