1 general information - a-laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 general...

16
2013 PLC 1 General Information Controller configuration: main block Visio V230-13-B20 standard version addit. module Snap-in I/0 V200-18-E1B or V200-18-E2B Program uses operands with fixed addresses: I Input I0 - I15 O Output O0 - O13 T Timer TD0 - TD191 MB Memory bits MB0 - MB4095 MI Memory Integer MI0 - MI2047 ML Memory long ML0 - ML255 DW Double Word DW0 - DW63 MF Memory Float MF0 - MF23 SB System bits SB0 - SB511 SI System integer SI0 - SI511 SL System long SL0 - SL55 CDW System Double SDW0 - SDW63 C Counters C0 - C23 # Signed Constant UnS# Unsigned Constant Operands can be seen at Output Window, Description. If controller power is turned on initial values are given to operands SB2(power-up bit)=1 during the first cycle, is used to initialize the routine (program) Controller performs a cycle during the Scan Time 2 Introduction to the program environment Start "VisiLogic". Then program started you will see the last saved project. If you want to start your own project - you should choose the right configuration (1) of the controller. Also it can be K.Vassiljeva 1 ISS0065 Control Instrumentation

Upload: others

Post on 05-Apr-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

1 General Information

Controller configuration:

• main block Visio V230-13-B20 standard version

• addit. module Snap-in I/0 V200-18-E1B or V200-18-E2B

Program uses operands with fixed addresses:

I Input I0 - I15O Output O0 - O13T Timer TD0 - TD191MB Memory bits MB0 - MB4095MI Memory Integer MI0 - MI2047ML Memory long ML0 - ML255DW Double Word DW0 - DW63MF Memory Float MF0 - MF23SB System bits SB0 - SB511SI System integer SI0 - SI511SL System long SL0 - SL55CDW System Double SDW0 - SDW63C Counters C0 - C23# Signed ConstantUnS# Unsigned Constant

Operands can be seen at Output Window, Description.

If controller power is turned on

• initial values are given to operands

• SB2(power-up bit)=1 during the first cycle, is used to initialize the routine (program)

Controller performs a cycle during the Scan Time

2 Introduction to the program environment

Start "VisiLogic". Then program started you will see the last saved project. If you want to startyour own project - you should choose the right configuration (1) of the controller. Also it can be

K.Vassiljeva 1 ISS0065 Control Instrumentation

Page 2: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

inputs reading

executing of a ladder(Main module, Main routine, etc)

change of the outputs values

work with HMI:- loading of the static picture- update of the display values- checking the "Jump to Display" condition and execution- execution of the HMI program- keyboard events

communication

seen in HW Configuration.Check if all modules are declared right. Change them if needed.

Program of the controller has of two parts:

• program Ladder logic

• display description HMI

Program consists of the Modules and module of the Routines. Minimum program should haveone module with one routine

Ladder Main Module Main RoutineHMI Start-Up Module Start-Up Display

Routine consists of parts, called Net. The smallest piece of the program is an element which ispresented by a symbol. For the execution of the program signal begins from the left side (EN) ofthe element and exits from the right side of it (ENO).

ISS0065 Control Instrumentation 2 K.Vassiljeva

Page 3: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

Complex instructions are made by Function Blocks.

Connected elements form a circuit. It always begins from the left edge. One Net must have onlyone circuit!

To write a program you need to drag element (symbol), place into the circuit, specify the operand.Download - loads the program to the controller.

Online Test ("glasses") - monitoring, reads and shows values of the operands.

3 Binary variables

Value of the binary variable can be presented by: 1/0, ON/OFF, True/False.Address of the binary: I, O, MB, SB.Element "contact" -[ ]- reads the operand, and "coil" -( )- gives the operand value.

Command is executed as long as signal coming from the left equals to 1. Command can bespecified by: inversion, P-positive, N-negative, S-set, R-reset, X-toggle.

Operations on variables are implemented using serial and parallel connections of elements.

Exercise 1 Working with a discrete signal

Combine a circuit -[ ]- -( )-Tag the elements:

• choose any input address (I0-I5) for -[ ]-

• choose any output (O0 - O5) for coil -( )-

Download program to the controller.Monitor execution using input switches on the panel.

Exercise 2 Combinatory logic

Realize two logical functions F = A ∨ B&C and W = (A ∨ B)&C there logical operations aredenoted as & -"AND" and ∨ - "OR".Define the controller inputs as A,B,C, and observable outputs: F,W

Exercise 3 Majority rule

Combine circuit of thee inputs and one output: output is "ON" if at least two inputs are "ON".

K.Vassiljeva 3 ISS0065 Control Instrumentation

Page 4: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

Exercise 4 Motor control

START and STOP input signals turn on and off signals of the motor.

(a) working time(b) working logic

Select the controller inputs and outputs, tag them:START, STOP and Motor.Write a program. Run program on PLC.

ISS0065 Control Instrumentation 4 K.Vassiljeva

Page 5: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

4 Timers

Timer’s output is the time shift of the input signal. The type and number of the timer (0-191) formthe name of the timer.Types of the Timers

• TD - Delay Timer;

• TA - Timer Accumulated;

• TE - Extended Timer.

Timer is a structure which has

• input(s) Start&Run and/or Reset and output;

they can be read and saved as binary variables: -[]-, -(R)-, -()-

the input gets its value only ones during the program cycle

• parameters: delay Preset Value and current time Current Value are integers;

have formats TIME[hh:mm:ss] or SEC[000000,00] with 10 ms units

these values can be read during program execution and saved

All timer types are activated by a rising transition edge, OFF to ON.

A running timer always decrements (counts down)from the Preset Value. The Preset Values areloaded for all timers at power up. The Preset Value is also loaded into the Current Value when thetimer is reset.

4.1 TD

TD timer generates the delay on outputif I = 0 not working O = 0

if I : 0→ 1 starts CV = PV

if I = 1 working CV = PV − 1 (every 10 ms)if (I = 1) & (CV = 0) O = 1

where I is an input signal, CV - Current Value, PV - Preset Value and O - output signal.

4.2 TA

Input signal continues to countdown the timer, Reset - resets the timerOnce a TA Timer has reached its preset value, its Bit Value remains ON until the timer is reset

in the program (use -(R)- coil). The timer cannot be activated by Run Enable until it has beenreset.

K.Vassiljeva 5 ISS0065 Control Instrumentation

Page 6: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

Figure 1: TD- Timer on Delay

Figure 2: TA - Timer Accumulated

4.3 TE

Output starts immediately and does not depend on the length of the input signal.

Figure 3: TE - Timer Extended Pulse

Once a TE Timer has reached its preset value, its Bit Value remains OFF until the timer isreset in the program.

Exercise 5 Set time on 7 s. delay

ISS0065 Control Instrumentation 6 K.Vassiljeva

Page 7: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

Read the HELP for the Timers. Start timer with a switch input. Use a timer. Add a chain, whichwould indicate the timer output signal (output of the controller).

• Check timer’s work switching an input signal and tracking the output of the controller.

• Observe output of the timer and the running time /Monitoring mode/.

• What would happened if input signal is shorter than the Preset Value?

Exercise 6 Set an output signal which starts with an input and remains ON for 4 s.

tOFF

tOFF

tOFF

T

Input

Timer

Output Out = Inp&Tim

Choose the input and output signals for program monitoring.

• What would happened if input signal is shorter than the Preset Value?

• How to manage a long output signal then input signal is short?

Exercise 7 The output signal starts (ON) 2 s. after the input signal and stops (OFF) 1 s. afterthe input is OFF.

tOFF

tOFF

T1 T2

Input

Output

5 Counters

VisiLogic offers 24 built-in counters, represented by the symbol C. To use an Up Counter in yourprogram, place an Increment function in a net and select C.

K.Vassiljeva 7 ISS0065 Control Instrumentation

Page 8: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

A counter counts rising-edge pulses ( -|P|-).

If CurrenNumber = PresetV alue⇒ Counter = ON

Once the preset value is reached, the counter bit stays ON until it is reset via a Reset Coil(-(R)-). This also initializes the counter value.

Exercise 8 Counting

a) Create a program that counts the pulses from input switch (increments them) and resets thecounter.Observe counter work using Monitoring Mode.

• What would happened if the accumulated number of pulses is greater than the counter’spreset value?

b) Add to the previous part of the program for the same variable the Decrement possibility. Inthat case one input signal increments the value and another - decrements it.

Exercise 9 Wrapping Machine

PLC

BOX

QP

OUT

product

Figure 4: Wrapping Machine

Pieces product (bottles) come off the production line, they are countered by the sensor QP (seeFig. 4).

Then you have 9 pieces of the product the output OUT is launched for the 2 s., which stops theproduction line and puts the product into the box.

Simulate a delivery of the product by the signal 1 Hz (use system operand SB 3).Write a program.Store Timer/Counter PresetYou can set a Timer or Counter preset value by storing an operand or constant value into thedesired operand.

ISS0065 Control Instrumentation 8 K.Vassiljeva

Page 9: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

Operand A: contains the value to be stored in the timer/counter.Operand B: this is the timer/counter to be preset.

The value that is stored in the Timer is broken down into units of 10 milliseconds. In the aboveexample, if MI 13 is equal to 10120, the value stored into T1 will be 00 : 01 : 41.20.Store Timer/Counter: Current Value(See VisiLogic software manual)

K.Vassiljeva 9 ISS0065 Control Instrumentation

Page 10: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

6 Numerical Variables

Numerical variables are either M (Memory) or S (System).

These values may be operated:

• Memory Integer (MI)

• Memory Long Integer (ML)

• Double Word (DW)

• System Operands:(SI) (SL) (SDW)

• Network System Integer (NSI)

• Constant Value #

6.1 Compare Functions

A compare function compares two values according to the type of function you select.

• If the comparison is true (logic 1): power flows through the block.

• If the comparison is false (logic 0): power does not flow through the block.

6.2 Math Functions

You perform mathematical functions by placing math functions in a net. Math functions, locatedon the Math menu are provided for:

• Increment/Decrement

• Addition

• Subtraction

• Multiplication

• Division

• Square Root

• Power

• Factor

• Linearization

Each type of math function can use up to 8 input values to compute a single sum.

ISS0065 Control Instrumentation 10 K.Vassiljeva

Page 11: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

6.3 Store and Load Functions

Store and load functions can be used to copy values from an operand, or range of operands, toanother. You access both types of functions from the Store menu.

• Reset Numeric

• Store Direct Function

• Store Indirect Function

• Load Indirect Functions

• Store Timer/Counter Preset

• Load Timer/Counter Preset

• Store Timer/Counter: Current Value

• Load Timer/Counter: Current Value

• Step in Range

Exercise 10 Operations with numeric data

1. Set a constant value (#5) to operand MI 0 (A) and (#2) to MI 1 (B) (using Store function)

2. Counter (C) counts the number of impulses from Inp module (I.x)

3. D = A+C, E = B*D

Compare E with constant (#18). Results of comparison present as binary signal (<,=,>). AddInputs that reset C, D and E values.

7 HMI

To show some information on display you need to change Mode from Ladder to HMI.Displays can contain both fixed and Variable text. Fixed (constant) text does not change

according to run-time conditions. Variable text can show run-time values, such as timer values, ordisplay operating instructions according to system status. If you have several displays, then any ofthem can be loaded as it is shown in Fig. 5

K.Vassiljeva 11 ISS0065 Control Instrumentation

Page 12: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

Figure 5: How-to: Load HMI Display

7.1 Text

To place fixed text messages in a Display:

1. Click the Text Box icon; your cursor turns into a cross-hairs

2. Click on Display, drag the cursor across the screen

3. In Text Properties Box - Text enter the text you want

Variable text can show run-time values, such as timer values, or display operating instructionsaccording to operand status.

A Binary Text Variable:

Link - Status determines which text is shown. Links Text to the variable in the program

0 - This text is displayed when the linked operand is OFF

1 - This text is displayed when the linked operand is ON

7.2 Variables

Variables enable you to show run-time values, text, images, and bar graphs on the controller’sscreen in response to run-time conditions. Bit, or binary text variables, for example, display textmessages on the controller’s LCD screen according to the status of a bit operand.

When you insert a variable into a display, the Variable Editor opens, showing you the optionsthat are relevant for that Variable.

A Number Variable enables you to:

• Show any numeric value within a Display.

• Control the format in which that value is shown, including the placement of a decimal pointand leading zeros.

• Use Linearization to show a converted value, such as an analog temperature converted todegrees Celsius.

ISS0065 Control Instrumentation 12 K.Vassiljeva

Page 13: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

• Allow the operator to use the controller keypad to enter a number, such as a set point, via aKeypad Entry Variable.

To insert the binary variable into a Display:

1. Click on a variable in the HMI toolbar, then click on the HMI screen and drag your cursor tocreate a field for the display of the variable data.

2. Release the mouse button; a dialog box opens, enabling you to define the source of the variabledata.

For example, a binary variable, named Switch Status, linked to MB0. When

MB 0 = 0, the text OFF will be displayed in the field.

MB 0 = 1, the text ON will be displayed in the field.

If a field is too small to display data, a warning message is displayed at compilation anddownload. In addition, monochrome controllers color a field that is too small in red.

Figure 6: Linking MI 16 (integer) with a display

7.3 Keypad Entry Variables

Keypad Entry Variables enable a user to enter values via the Vision keypad.

K.Vassiljeva 13 ISS0065 Control Instrumentation

Page 14: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

In order to enable the user to enter values, the variable must be active. When a variable isactive, pressing Enter ’locks’ the variable, and writes whatever value has been entered from thekeypad into the variable. The next variable becomes active.

When a Display contains more than 1 variable, using the right arrow key enables the user totab from one active variable to the next. Pressing Enter ’locks’ the variable, excluding it from thetab order.

A Display with Keypad Entry Variables may be in one of two states:

Active The variables are active, marked by a blinking cursor. A Display loads into this state bydefault; the first variable, as set in Variable Tab Order, will be active.# Description ValueSB 30 HMI keypad entries completed OFFSB 32 HMI keypad entries in progress ONSI 250 Currently active keypad entry Number of currently active

variable

Locked When variables are locked, no cursor is present on the LCD.# Description ValueSB 30 HMI keypad entries completed ONSB 32 HMI keypad entries in progress OFFSI 250 Currently active keypad entry -1

You can load all Displays in a project in the locked state via SB 27, Disable all keypad automation.If SB 27 is ON when a Display is shown, the user cannot navigate through the variable using thekeypad keys and no cursor is present on-screen.

The user navigates through the variables by using the directional arrows on the keypad. Con-trolling the cursor via SBs

SB 30 HMI keypad entries complete

• Use SB 30 to run ladder tasks that require data entered via keypad.

• Note that when a variable is active, pressing the Enter button on the keypad signals thatthe user has finished entering the value.

• After the Enter button has been pressed for all of the variables in the current display,SB 30 turns ON.

SB 31 Refresh current LCD screen display variables

• Use SB 31 to immediately re-enable data entry.

• Turning SB 31 ON restores the cursor, and re-activates all keypad entry variables in thecurrent display.

ISS0065 Control Instrumentation 14 K.Vassiljeva

Page 15: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

2013 PLC

SB 29 Current keypad entry sets SB 30

• Turn SB 29 ON after data is keyed into any variable, to enable the user to skip keyingin data for the remaining variables in the current display.

• After SB 29 turns ON, SB 30 turns ON as well.

7.4 Counter

A Counter Variable shows a counter’s value in a Display.

1. Create a Variable field, and then select Counter.

2. Select from the features and formats shown below.

Figure 7: Display/Preset Counter Values

Exercise 11 Working with HMI

Continue the exercise 8.

• Add to the start-up display text: Counter value is:

• Add variable/counter to display your counter Current value

• Add a binary text which indicates: have counter reached the Preset Value ornot

K.Vassiljeva 15 ISS0065 Control Instrumentation

Page 16: 1 General Information - A-Laba-lab.ee/edu/system/files/kristina.vassiljeva/... · 1 General Information Controllerconfiguration: mainblockVisio V230-13-B20 standardversion ... Variables

PLC 2013

Exercise 12 Working with HMI: HMI SB and SIs

Use VisiLogic Help. Study the Keypad keys of the controller: HMI SB and SIs.

• Add to the program possibility to increase/decrease a value of the counter usingkeypads UP and DOWN.

• ENTER key enters the Preset Value to a counter, see Fig. 8

• ESC key will reset the counter and refresh the screen, see Fig. 9

Figure 8: Preset Counter Value

Figure 9: Reset the counter and refresh the screen

Now you are ready for homework # 2.Attach the model of the parking lot: Check what inputs and outputs it is using.

ISS0065 Control Instrumentation 16 K.Vassiljeva