Chapter 8 Ver3

Embed Size (px)

Citation preview

  • 8/2/2019 Chapter 8 Ver3

    1/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Chapter 8: PLC Timers, Counters, Registers and Analog Input/Outputs

    8.1 Timer function.8.2 Counter function.

    8.2.1 Single channel up-counter (low speed counter).8.2.2 Two channel up-down counter.8.3 Manual control cycle.8.4 Working with PLC Registers and Analog Input/Output

    8.4.1 Devices and registers for Toshiba T1/T1S PLC.8.4.2 Moving data or constant between PLC registers:8.4.3 Analog inputs/outputs using PLC registers8.4.4 Analog inputs/outputs Programming Technique using PLC registers8.4.5 Analog input/output PLC programming:8.4.6 Comparing the content of a register 8.4.7 Simple Math operations using PLC registers.

    8.1

  • 8/2/2019 Chapter 8 Ver3

    2/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    PLC Timers, Counters, Registers and Analog Inputs/Outputs

    Most industrial processes involve a time delay between sequencing processes. Some of these processes also involve counting event, e.g. counting products traveling on a conveyer. Othersinvolve reading or writing analog signal before or during the control sequence. This chapter will cover different types of timer functions and counting instructions. It will also providemore information on using PLC registers and import or export analog signals from PLC ports.

    8.1 Timer function

    PLC timer function is an instruction that waits a set amount of time before doing an actuation.Different types of timers are available with different manufacturers. Here are some of them:

    On-Delay timer ; this covers delays turning on . For example, after detecting the inputfrom a sensor a delay of time is considered before activating a solenoid valve. This is themost common timer. It is often called TON (timer on-delay), TIM (timer) or TMR (timer).

    Off-Delay timer ; this type of timers is the opposite of the on-delay timer listed above.This timer simply " delays turning off ". For example, when the solenoid actuator switchedoff, the solenoid valve (output) will turn off after a delay of x-seconds. It is called a TOF(timer off-delay) and is less common than the on-delay type listed above. (i.e. fewmanufacturers include this type of timer).

    Single-Shot timer ; this type of timer function used to switch an actuator on for specific period of time. This timer function used mostly with open loop control machine sequence.It is often called SS (single shot timer).

    The question is how to use and enable these functions. Most PLC timer functions have 16-bitregisters and no floating points are used, only integer valve is used. This because most of these PLCs use integer valve for all its registers, although more advance is (costly) PLC havefloating point registers. For example, some manufacturers provide BCD for time register having integer value between 0 to 9999 or binary number (or tick) between 0 to 65535 whichcover a 16-bit or 2-byte register. Each tick of this clock represents x-seconds or x-milli-seconds (1/1000 seconds).

    For example, Toshiba PLCs offer three types of timer instructions given as follows:

    On-delay timers (most commonly used),Off-delay timers, andSingle-shot timers

    The timer registers of Toshiba PLC s have five digits from 00001 to 32767. The timer valvesare in tenths of second (0.1) or in hundredths of seconds (0.01) depending on the timer address selected. For example, a timer value of 12000 could mean 1200.0 second or 120.00seconds depends on the timer address. The address of these timers along with their time valuefor T1- PLC is given as follows:

    Timer address (in decimal) Time valueT000 through T063 0.1 second.T064 through T255 0.01 second.

    Fig. 8.1 show how the timer instructions are used with illustrated examples.

    8.2

  • 8/2/2019 Chapter 8 Ver3

    3/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    TON Execution condition (most frequently used)

    Input Operation OutputOFF No operation (timer is not updated) OFFON Elapsed time

  • 8/2/2019 Chapter 8 Ver3

    4/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Example 8.2 ; Develop RLL for the given machine sequence using non-sustain and sustainoutput signals ? Draw the sequencing chart of the machine sequence for both cases ?

    Machine control sequence : START, A+, 10s delay, A-,B+, 10s delay, C+, B-, C-.Group I | Group II | Group III

    The RLL can be developed using on-delay and/or off-delay functions depend of type of controlsignals (non-sustain and/or sustain signals) as illustrated below, see Figs. 8.3 and 8.4;

    START, A+, (10s TON A-) , B+ , (10s TON C+), B- , C- Non-sustainGroup I | Group II | Group III

    START, (10s TOF A+), A-, B+, (10s TON C+), B- , C- SustainGroup I | Group II | Group III

    8.4

    A+ 20s delay A- B+ 10s delay C+ B- C-

    G1 G2 G3

    A+

    A-

    B+

    B-

    C+

    C-

    A+

    A-

    B+

    B-

    C+

    C-

    A+

    B+

    C+

    .a+

    .a-

    .b+

    .b-

    .c+

    .c-Start

    Cylinders.

    Solenoids Non-sustain.

    SolenoidsSustain.

    Switches

    Fig. 8.4 Sequencing chart for machine sequence given for example 8-2 usingnon-sustain and sustain control signals.

    On-delay function can be used with both cases.

    Fig. 8.3 RLL using non-sustain and sustain output signals for example 8.2.

    START R02 R01

    R01

    R01 a+ R03 R02

    R02 Flip-flopModules.

    R02 c+ c- R03 R03

    Input switches Address

    START X00a+ X01a- X02

    b+ X04b- X05c+ X06 c- X07

    STOP (not shown) X03 Group memory Address

    Flip-flop1 R01 Flip-flop2 R02 Flip-flop3 R03 Outputs Address

    A+ Y20

    A- Y21 B+ Y22 B- Y23C+ Y24C- Y25

    R01 A+

    R02 100 TON T01 A-

    R02 a- B+

    R03 B-

    R02 b+ 100 TON T02 C+

    R03 b- C- Output Modules

    (a) Relay ladder logic for non-sustain outputs R01 100 TOF T01 A+

    R02 a- B+

    R02 b+ 100 TON T02 C+ R03 b- Output

    Modules(b) Relay ladder logic for sustain outputs

  • 8/2/2019 Chapter 8 Ver3

    5/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    8.2 Counter Function

    Programmable counter is a device that carries out count function. Two types of counters areexist; 1) single channel up-counter, and 2) two channels up/down-counter. The most commoncounter is the former type, which used to count number of events, when reached to presetvalue it generates an output signal. Two channel up/down counters are special counter devicesused to count in either direction up or down, or both. For example, incremental optical encoder that generates two pules (A and B pules), an example of using two channel up/down counters.

    Furthermore, counter device can be low speed and high speed counters. The high-speedcounter device is hardware integrated circuit built in inside the PLC structure, while lowspeed counter is a software counter (like a do loop in conventuals computer programming).The high-speed counter used for counting an event or pulses at very high frequency, which

    requires counter IC build-in inside the PLC . Number of the high-speed counter channels are

    8.5

    Laboratory work 8.1 : As laboratory work simulate the machine control sequence using Toshiba PLC for Example 8.2.

  • 8/2/2019 Chapter 8 Ver3

    6/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    fixed specified by manufacture and must be considered when shopping PLC , e.g. 2 or 4channels.

    8.2.1 Single channel up-counter (low-speed counter)

    Single channel up-counter required two rungs for inputs. The first input COUNT (C) which isthe pulse input, and RESET or ENABLE (E) input. Both inputs require contacts to operate.Furthermore, counter function has an output (Q). The ladder expression for counter functionis as follows:

    FUNCTION

    While the enable input is ON, the counter will start to count the input pulses, which changefrom OFF to ON (rising edge counter). The count value stored in the counter register B.When the count value reaches the set value A, the output (Q output) that corresponding to thecounter device B are turn ON. When the enable input comes OFF, B is cleared to 0 and theoutput and the counter device are turned OFF. The preset value for counter, A value, is in therange from 0 to 65535.

    EXECUTION CONDITION

    EnableInput

    Operation Output

    OFF No operation ( B is cleared to 0) OFF

    ON Count value ( B) < set value ( A) OFFCount value ( B) set value ( A) ON

    Example 8.3 ; Consider the following RLL for single channel counter;

    X001

    X002C010

    C.010

    Y021 Example 8.4 ;

    8.6

    C CNT Q

    E A B

    Count input

    Enable input

    Output

    X01 C CNT Q R01

    X04 E 0005 C010

    X01 R01 X00 Y25

    Y25

    X001 : START contact switch. X000 : STOP contact switch.

    The START cycle will be executed for 5times only as long as the counter enables(when X04 set high). The cycle will beno longer executed when the number of start push button reached 5 cycles.

    325432 11

    Pulse input.

    Enable/Reset input.

    Counted event (register B).

    Preset Value (register A).

    Counter Output.

  • 8/2/2019 Chapter 8 Ver3

    7/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Example 8.5 : Modify example 7.4, see Chapter 7, to have specific repeated number of cyclesusing counter function, e.g. 5 repeated cycles. Modify the same RLL to have this feature. Themachine cycle can be rewritten again as follows:

    ( )( ) 54,3,2,1,

    .,),,,(5,,

    GGGGGSTART

    AC BC Bcyclesrepeat ASTART +++

    The modified RLL is shown in Fig. 8.5. Note, the x p replaced by R6 memory. In this case,setting the R6 value to a logic 1 is carried out, when the counter register reaches a countnumber of 5.

    8.2.2 Two channels up/down counter

    The expression of two channels up/down counter is given as follows:

    Function

    While the enable input is ON, this instruction counts the number of the count-input changesfrom OFF to ON. The count direction (up count or down count) is selected by the state of thedirection input. The count value is stored in the counter register A. The count value range isfrom 0 to 65535.

    Up count when the direction input is ON Down count when the direction input is OFFWhen the enable input is OFF, the counter register A is cleared to 0.

    Execution condition

    Enableinput

    Operation Output

    OFF No operation ( A is cleared to 0) OFFON Count value is not limit value (0 or 65535) OFF

    Count value is limit value and count input is ON ON

    8.7

    Fig. 8.5 Modified RLL using counter function for machine sequence that hasoption repeat of 5 times, for machine sequence steps, example 8.5.

    START R2 E.STOP R1

    R1

    R1 a+ R3 E.STOP R2

    R4 R6 c-

    R2

    R2 c+ R4 E.STOP R3

    R3

    R3 b- R5 R2 E.STOP R4

    R4

    R4 R6 c- a- E.STOP R5

    R5

    .c+ R6

    R2

    R3

    R4

    R1 A+

    R5 A-

    R2 B+

    R3 B-

    R2 b+ C+

    R4 C-

    Input Address START X0 E.STOP X1.a+ X2.a- X3.b+ X6 .b- X7 .c+ X8.c- X9. x

    pXA

    Output Address A+ Y21 A - Y22 B+ Y23 B - Y24C+ Y25C - Y26

    C Q

    E 0005 C10

    Direction input U U/D Q OutputCount input CEnable input E A

  • 8/2/2019 Chapter 8 Ver3

    8/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Example 8.6 ; Consider the following two channels up/down counter ;

    X005

    X006

    R010

    C005

    C.005

    8.3 Manual Control Cycle

    In general, machine automation cycle involves an operation of a manual control cycle toresolve any possible improper operations or machine setup. For example, in some cases thereare machine-jamming condition, hence it is required to resolve the problem and return themachine to its original working condition ( machine parking condition) . In this case, manualcontrol cycle (some time called JOG cycle) is enabled and the automatic cycle is disabled.During manual cycle different push buttons and/or selector switches are enabled for machine

    user to activate/deactivate the machine actuators and resolve the machine jamming conditionsor to carry out machine setup.

    In this section, some of these operation circuits are illustrated including the method of enable/disable both manual and automatic control cycles. Simple case is given in the

    beginning, such as running a motor or energizing a solenoid (called Jog mode) with/withoutflip-flop circuit. Followed, expanding the technique to any machine control cycle, e.g. similar to those given in Chapter 7.

    Two types of user interface switches can be used with manual control cycle, mainly, push button and selector switches. Some of these switches could have a mechanical memory andare mainly used with sustain control signals. In other hand, non-mechanical memoryswitches are used with non-sustain control signals. Fig. 8.6 shows examples of differenttypes of user interface switches used with manual control cycle; push-button, selector andemergency push button switches.

    1. Jog Control Cycle

    In jog control circuit, the motor turned on as long as the Jog push button is held down, as shown in Fig. 8.7.

    The Jog circuit can also be added to flip-flop circuit as shown in Fig. 8.7(a). The flip/flop R000 used to run the motor as automatic cycle using START and STOP push buttons, inaddition to the JOG cycle, as shown in Fig. 8.7(b).

    8.8

    NoteThe transitional contact is required for the count input. Otherwise, counting isexecuted every scan while X005 isON in this example.

    2 33 22 111

  • 8/2/2019 Chapter 8 Ver3

    9/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    8.9

    Emergency push buttonswitch operation : pressingand rotating for switchrelease.

    Emergency push-button switch.

    0

    11 1

    Three positions selector (0, 1and 11) switch with springreturn (no mechanicalmemory)

    0 1

    Two positions (0 and 1)selector switch having amechanical memory.

    Push-button switch.

    Fig. 8.6 Different types of user interface push button, selector and emergency switches.

    Returned to its original, . by spring action.

    Rotated by user.

    X000 (Jog) Y21 (Motor or solenoid)

    Fig. 8.7 Jog control cycle, (a) simple case using NO switch, (b)using flip-flop.

    X000 (Start) X001(Stop) R000

    R000

    R000 (Motor) Y21

    (Jog) X002

    (a)

    (b)

  • 8/2/2019 Chapter 8 Ver3

    10/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    2. Manual and Automatic Cycles

    It is very easy to include the manual control cycle with any automatic cycle such as thosegiven in Chapter 7.

    This operation circuits requires three types of user interface switches, which have differentfunctions and given as follows:

    a) Two position selector switches with mechanical memory is used to select between two AUTO and MAN cycles, as shown in Fig. 8.6. This switch is used with both flip-flop andoutput modules. b) Two or three positions selector switch with spring return is used to operate actuators

    having non-sustain control signal and used with MAN control cycle. Two positionsselector switch with mechanical memory is used to operate actuators having sustaincontrol signal. These switches are used with output modules.

    c) Emergency push-button switch is used to stop the AUTO cycle in case of emergency

    condition, such as work piece jamming. This type of switch, as shown in Fig. 8.6, is usedto reset the flip-flop modules.

    To illustrate how to include the manual cycle to any machine control cycle, consider thefollowing example.

    Example 8.7; Consider example 8.2.

    It is required to modify the control cycle to have Auto/Manual cycle selection and to include Emergency Push-Button switch. The machine cycle will be modified by adding the followinguser-interface switches:

    Two positions selector switch has a mechanical memory, is used to switch between AUTO and MAN cycles. Setting the selector switched to logic 1 will enable the AUTOcycle and disable the MAN cycle.

    A NO contact push-button switch is used as EMERGENCY STOP switch. Pressingthis switch will reset all the flip/flops during the AUTO cycle.

    Three-position selector switch with return spring (without mechanical memory) isused with MAN cycle and non-sustain control signals, to actuate the solenoids in forwardand backward directions. The neutral position of this selector switch when both solenoidsare deactivated.

    Two-position selector switch with mechanical memory is used with MAN cycle andsustain control signals to activate and deactivate the solenoid.

    The amended RLL is shown in Fig. (8.8a) and (8.8b).

    8.10

    Start Auto/Man R02 E.Stop R01

    R01

    R01 a+ R03 E.Stop R02

    R02 Flip-flop Module

    R02 c+ c E.Stop R03 R03

    Fig. 8.8a Modified flip-flop module with Auto/Man cycles for example 8.7.

    Input switches Address Start X00a+ X01a- X02b+ X04b- X05c+ X06 c- X07

    Emerg.Stop X03 Auto/Man X08

  • 8/2/2019 Chapter 8 Ver3

    11/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    8.4 Working with PLC Registers and Analog Input/Output

    Like microprocessor and computer CPU ; PLCs have registers or memory locations inside theCPU of the PLC . The registers have different functions, some of them used as address or temporary memory while others are used as address for data registers. These registers consistof bits and grouped together to form a byte . Bytes are also grouped together to form a word .For example, the length of the word can be one byte or two bytes or even more for larger CPU computers.

    Each PLC manufacturer assigns different configurations and functions for their PLC s. Thereader may consult the hardware manual for PLC manufacturer for details on types of PLC registers and its functions.

    In this section Toshiba PLC (series T1/T1S ) is considered as an example to illustrate how PLC registers are used to perform and assist different control functions.Devices and registers for Toshiba T1/T1S PLC

    Fig. 8.9 shows the layout structure of a Toshiba T1/T1s PLC . This structure type called block type PLC and is common with many PLC manufactures. The T1s PLC is extension for T1

    PLC , that have more memory capacity or program storage memory than T1 PLC . Fig. 8.9shows also the general layout and technique that can be used to expand the PLC input/outputmodules.

    The T1/T1S program consists of bit-based instructions that handle ON/OFF information,such as contact and coil instructions (called devices). It also consists of a register-based (16-bit) instructions, such as those used for data transfer, arithmetic operations, and analogueinput/outputs and called registers. Devices are used to store the ON/OFF information of contacts and coils, while registers are used to store/exit 16-bit data word.

    Devices are divided into six types:

    X External input devices (e.g. Switch input devices)Y External output devices (e.g. Relay output devices)R Auxiliary relay devices (e.g. Temporary memory for input devices)S Special devices (e.g. flashing output function)

    T. Timer devicesC. Counter devices

    Registers are divided into eight types:

    XW External input registers. (e.g. It can be used with analog input register)YWExternal output registers. (e.g. it can be used with analog output register)RW Auxiliary relay registers. (e.g. it can be used as temporary memory register).SW Special registers.T Timer registers (used with timer function, see section 8.1)C Counter registers (used with counter function, see section 8.2)

    8.11

    IBM-PC compatible personal computer T1-16

    T1-28

    T-PDSsoftware

    Handy programmer HP911A

    T1-40

    T1 basic unitPeripheral tool

    Expansion unit

    Expansion rack Computer link

    functionT2 I/O modules

    MMI/SCADAsystem

    4-slot2-slot

    Option cards

    T1-40S

    Fig. 8.9 Structure layout of T1/T1S Toshiba PLC with input/output modules [8.1].

    Fig. 8.8b Modified RLL output module for non-sustain and sustain output signals,(see example 8.7).

    Input switches Address

    Start X00a+ X01

    a- X02b+ X04b- X05c+ X06 c- X07

    E.STOP X03 Auto/Man X08 Man A+ X09 Man A- X0A Man B+ X0B Man B- X0C Man C+ X0D Man C- X0E

    Group memory Address Flip-flop1 R01 Flip-flop2 R02 Flip-flop3 R03 Outputs Address

    A+ Y20 A- Y21 B+ Y22 B- Y23C+ Y24C- Y25

    R01 A+

    Auto/Man Man A+ a+

    R02 100 TON T01 A-

    Auto/Man Man A- a-

    R02 a- B+

    Auto/Man Man B+ b+

    R03 B-

    Auto/Man Man B- b-

    R02 b+ 100 TON T02 C+

    Auto/Man Man C+ c+

    R0 b- C-

    Auto/Man Man C- c-

    Modified output module with Auto/Man cycles For non-sustain output signals

    R01 100 TOF T01 A+

    Auto/Man Man A+

    R02 a- B+

    Auto/Man Man B+

    R02 b+ 100 TON T02 C+

    R03 b-

    Auto/Man Man C+

    Modified output module with Auto/Man cycles For sustain output signals

  • 8/2/2019 Chapter 8 Ver3

    12/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    D Data registers (used to store data values, e.g. the content of counter register or the contentof timer register, and varied from D0000 to D1023 for T1- PLC and from D0000 to D4096 for T1S PLC )I, J and K are Index registers (e.g. it can be used with do loop instruction)

    The content of the registers can be specified during RLL development and also can beupdated using user interface station, ( as shown in Fig. 8.10).

    X devices share the same memory area as XW registers. Device X014, for example,represents the number 4 bit in the XW01 register.

    Bit position / Number (MSB) (LSB)

    F E D C B A 9 8 7 6 5 4 3 2 1 0

    XW01 1

    X014

    Thus, "X014 is ON" means that bit number 4 of XW01 is 1.Y, R, and S devices work in a similar manner.

    Addressing devices

    A device number of X, Y, R and S devices consists of a register number and a bit position asfollows.

    X 01 4

    Represents bit position 0 to F in the register.Decimal number representing the register containing the correspondingdevice.Represents the type of device. (X, Y, R, or S)

    As for the timer (T.) and the counter (C.) devices, a device number is expressed as follows.

    T. 12

    Corresponding register number. (decimal number)Represents the type of device. (T. or C.)Dot (.) is used to identify a device.

    Addressing registers

    A register number except the index registers is expressed as follows.

    XW 01

    Register number. (decimal number)

    8.12

    Fig. 8.10 User interface stations [8.1] can be used to update the PLC registers.

  • 8/2/2019 Chapter 8 Ver3

    13/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Represents the type of register. (XW, YW, RW, SW, T, C or D)

    The index registers (I, J and K) do not have the number.

    J

    I, J, or K

    Moving data or constant between PLC registers:

    Example 8.8 : Moving constant to a register:

    When R001 is ON , a constant data (12345) is stored in D0100

    Example 8.9: Moving data to the counter register:

    A constant data 5 is moved to register D0100 , next, the content of register D0100 is moved tocounter register C010 . Hence, the output Y20 will be ON after 5 push button from OFF toON for switch X001.

    Example 8.10: Moving data to timer register T010 :

    Here a constant data 1000 is moved to register D0100 . Next, the content of register D0100 ismoved to timer register T10. This will result in, switching the output Y20 after delay 100

    seconds ( 1000 * 0.010 since timer address less than T032 ), after pressing setting the flip-flop R010 . Where timer base time for T1/T1S PLC as follows:

    8.13

    12345 MOV D0100R001

    00005 MOV D0100X000

    C CNT

    E D0100 C010

    X001

    X002

    Y20

    01000 MOV D0100X000

    R010

    R010

    R010

    Y20 D0100 TON T010

  • 8/2/2019 Chapter 8 Ver3

    14/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Time base T1 T1S0.01s T000 to T031 T000 to T0630.1s T032 to T063 T064 to T255

    Note, both registers D0100 and T10 can be updated using operator interface station, ( as shown in Fig. 8.9).

    Analog inputs/outputs using PLC registers

    As an option extension for T1/T1S of Toshiba PLC , it is possible to add a maximum of twosmall interface cards to the T1/T1S expansion slot. Where there is two slots available for customer configuration, ( as shown in Fig. 8.11).

    There are different optional cards, see table below;

    Type Description Power supplyDI116 16 points input, 24 Vdc - 5 mA Supplied from theDO116 16 points output, 24 Vdc - 100 mA basic unit (5 Vdc)DD116 8 points input, 24 Vdc - 5 mA

    + 8 points output, 24 Vdc - 100 mAAD121 1 channel analog input, 0 to 5 V / 0 to 20 mAAD131 1 channel analog input, 10 VDA121 1 channel analog output, 0 to 20 mADA131 1 channel analog output, 10 VFR112 TOSLINE-F10 remote station,

    1 word input + 1 word output

    Two optional cards were installed to be in the T1/T1S PLC expansion slot, these are AD131and DA131. The first card is used to read analog signal from analog sensor, e.g. pressuresensor, while the second is used to write or output analog signal, e.g. used as command signalfor servo-drive.Each card has its address. These addresses are allocated automatically using the T-PDS32software (user program for RLL development). The automatic allocated addresses for both

    cards are given as follows:

    8.14

    Fig. 8.11 Optional cards can be added to the expansion slot of the T1/T1s PLC

  • 8/2/2019 Chapter 8 Ver3

    15/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Card Name Allocated register addressAD131 XW004DA131 YW005

    Analog inputs/outputs Programming Technique using PLC registers

    All the registers of the T1/T1S PLC are integer type, i.e. no floating point. The floating pointregisters are available with larger (costly) PLC . Hence, the read voltage is converted todigital (integer) value. The input voltage is in range from 10V to +10V, and converted todigital value form 2000 to +2000. The digital value of 2000 is corresponding to 10V , and+2000 to +10V. Hence, the relationship between the digital and analog values are given asfollows:

    D = 200 * A Equation (8.1)

    A = 0.005 * D Equation (8.2)

    where D; digital value, andA; analog value in volts.

    The following chart shows the relationship between the two values:

    Analog input/output PLC programming:

    Analog input programming can be achieved very simply by moving the data from the assigned AD register ( XW004 address) to any PLC data register, e.g. D0100. The digital valuecalculated using equation 8.1. See the RLL below for analog input function:

    8.15

    For Analog input card, card model AD131.

    For Analog Output card, card model DA131.

    Digital Value+2000

    +1000

    -10V -5V 0 +5V +10V

    -1000

    Analog voltage

    -2000

    Conversion chart for analog input card.

    Analog Value+10V

    +5V

    -2000 -1000 0 +1000 +2000

    -5V

    Digital voltage

    +10V

    Conversion chart for analog output card.

    X000

    When the switch X000 is closed : the voltage converted todigital value and moved from AD register (XW004) to thePLC Data register (D0100).

    XW004 MOV D0100

  • 8/2/2019 Chapter 8 Ver3

    16/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Similarly, analog output programming can be achieved by moving the digital value to DAregister (YW005) (the value is calculated using equation 8.2, which corresponds to therequired voltage). See the RLL below for analog output:

    Comparing the content of a register

    Comparing the content of a register and take a control action is important in both logic and

    continuous controls. This function is similar to IF statement in traditional computer programming. Study the following example:

    Example 8.11: Read the analog voltage and compare, IF the voltage is grater than 4.5V ,switch the output on (address Y023):

    8.16

    X000

    When the switch X000 is closed : the digital value (900) ismoved to the analog output register YW005. The 900digital value corresponding to 0.005*900=4.5 V.

    900 MOV YW005

    XW004 MOV D0100

    Y23 D0100 > 900

    1 st Rug move, covert the analog voltage and move the digitalvalue form the AD register (XW004) to PLC register D0100.

    2nd

    Rug compare the digital value if it is grater that 900 (whichcorresponds to 4.5V), then switch the output Y23 on, otherwisethe output Y23 is off.

    Here rung 1 is canceled and the analog input register useddirectly in the comparison operation.

    Y23 XW004 > 900

  • 8/2/2019 Chapter 8 Ver3

    17/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Similarly, the

    following compare functions can be applied:

    Simple Math operations using PLC registers

    It is also possible to carry out math operations using PLC registers. Consider the followingmath operations (note; some of the output math operations requires two registers; such as themultiplication operation) :

    Example 8.12; Write a RLL program that will Add, Subtract, Multiple, or Divide tworegisters and assign the output or results in D205 register.

    Device ON Operation Source RegistersDestination Register Output

    DeviceX00 Add D200=10, D201=5 D205=15 Y22X01 Subtract D200=10, D201=5 D205=05 Y23

    X02 Multiply D200=10, D201=5 D206.D205=50 Y24X03 Divide D200=10, D201=5 D205=02 Y25

    RLL program given as follows;

    8.17

    A > BInput Output

    A >= BInput Output

    A D0205 X00

    Y23 D0200 - D0201 -> D0205 X01

    Y24 D0200 - D0201 -> D0206 . D0205 X02

    Y25 D0200 / D0201 -> D0205 X03

    Rung 1

    Rung 2

    Rung 3

    Rung 4

    Rung 5

  • 8/2/2019 Chapter 8 Ver3

    18/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    PROBLEMS

    8.1) Given the following machine control sequence for double acting cylinders A,and B.

    .,,10,,10,,,10,, +++ B Bdelay s Adelay s A Adelay s AStart

    (a) Re-arrange the machine sequence as Cascade groups using on-delay and/or off-delayfunctions. Assuming non-sustain output signal for the solenoid A and sustain outputsignal for solenoid B?

    (b) Develop RLL and sequencing chart?(c) Modify the machine RLL program given in (b) to have Auto/Man cycles selector switch

    and two-position selector switch for each Man. Output operation? Specify the type of theselector switches used in this application?

    8.2) Given the following machine control sequence for double acting cylinders A,and B.

    .,20,10,, +

    +

    Bdelay s

    B

    Adelay s AStart

    8.18

  • 8/2/2019 Chapter 8 Ver3

    19/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    (a) Re-arrange the machine sequence using on-delay and/or off-delay functions.(b) Develop RLL for the given machine sequence assuming non-sustain outputs for both

    cylinders A and B.(c) Modify the RLL for the given machine sequence assuming non-sustain output signal for

    cylinder A and sustain output signal for cylinder B.

    8.3) Given the following machine control sequence:

    .,,20,,,,10,, +

    +

    ++

    A Bdelay s B

    A

    B

    A Bdelay s AStart

    (a) Re-arrange the machine sequence using on-delay and/or off-delay functions.(b) Develop RLL for the given machine sequence assuming non-sustain outputs for both

    cylinders A and B.

    (c) Modify the machine RLL program given in (b) to have Auto/Man cycles selector switchand two-position selector switch for each Man. Output operation? Specify type of theselector switches used in this application?

    8.4) Given the following machine control sequence:

    ( ) .,20,,),(;,,10,, +++ Adelay s BC C timesnrepeat Bdelay s AStart

    (a) Re-arrange the machine sequence using on-delay and/or off-delay functions.(b) Develop RLL for the given machine sequence assuming non-sustain outputs for all

    cylinders A , B and C.(c) Modify the machine RLL program given in (b) to have Auto/Man cycles selector switch

    and two-position selector switch for each Man. Output operation? Specify the type of theselector switches used in this application?

    8.5) Given the following machine control sequence:

    ( .,),,20,,(;3,10,, +++ A BC delay sC Btimesrepaet delay s AStart

    (a) Re-arrange the machine sequence using on-delay and/or off-delay functions.

    (b) Develop RLL for the given machine sequence assuming non-sustain outputs for allcylinders?.

    (c) Modify the RLL for the given machine sequence assuming non-sustain control outputsignal for cylinder A only?

    (d) Modify the machine RLL program given in (b) to have Auto/Man cycles selector switchand two-position selector switch for each Man. Output operation? Specify the type of theselector switches used in this application?

    8.6) Given the following machine control sequence:

    .,,20,,10,,,10,, +

    +

    ++

    A Bdelay s B

    Adelay s

    B

    A Bdelay s AStart

    8.19

  • 8/2/2019 Chapter 8 Ver3

    20/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    Re-arrange the machine sequence using on-delay and/or off-delay functions.Develop RLL for the given machine sequence assuming non-sustain outputs for all cylinders?Modify the machine RLL program given in (b) to have Auto/Man cycles selector switch andtwo-position selector switch for each Man. Output operation? Specify the type of the selector switches used in this application

    8.7) Develop RLL for single path machine sequence and analog input. Themachine sequence will not start until the analog voltage is greater than or equal to 2.5V.Use equations 8.1 and 8.2 for analog conversion and use address of XW004 for analoginput register. The machine sequence given as follows:

    ( ) .,,10,,,)5.2).(( ++= C Bdelay sC BVolts ADStart

    8.8) Given the following machine sequence; Develop the RLL for non-sustain

    output signals. Note, cylinder C+ will not actuated if the analog input signal is less than2.5V. Use equations 8.1 and 8.2 for analog conversion and use address of XW004 for analog input register:

    ( ) .,,)5.2).((,, ++ C BV ADC BStart

    8.9) A DC servomotor and drive amplifier used to adjust the motor speed, usingthe analog output developed by PLC . The command signal (which is proportional tomotor speed) is function of three select switch setting. The following table shows theanalog output voltage as a function of the input of the three selector switches;

    Selector SwitchesVoltage

    Sw3 Sw2 Sw10 0 0 00 0 1 0.250 1 0 0.50 1 1 0.751 0 0 1.01 0 1 1.251 1 0 1.51 1 1 2.0

    Develop RLL to produce analog output signal required to control motor speed as shown inabove table. (Given the analog output register address YW005, use equations 8.1 and 8.2 for analog output conversion between analog and digital values).

    8.20

  • 8/2/2019 Chapter 8 Ver3

    21/21

    Manufacturing Automation using PLC s

    CHAPTER 8 PLC Timer, Counter , Registers and Analog Input/Outputs.

    8 21