Jump to content
  • PLC programming technology and HMI interface design English database

    PLC, DCS, HMI and SCADA product application technical articles

    leigehong
    Design a PLC program to control the level of a water storage tank by turning a discharge pump ON and OFF based on Low and High levels.
    PLC Program for Water Level Control

    Logic Description
    Auto : if Auto Mode selected in Local Control Panel, then pump will be logically controlled based on Low Level Switch and High Level Switch Manual : if Manual Mode Selected in Local Control Panel, then irrespective of Low Level Switch & High Level Switch Status, Pump will be controlled manually using ON/OFF button in Local Control Panel. When the water level reaches low level then pump will be stopped. if the level of the water reaches high point, the pump will started so that the water can be drained and thus lowering the level. Indication Panel : This panel contains LED’s to show the status of the water level control. It has Pump Running, Low Level & High Level Signals If pump is running then the Pump Running status lamp will be ON. then, if Low Level Switch activated then Low Level Status lamp will be ON. if High Level Switch activated then High Level Status lamp will be ON. PLC Ladder Logic
    Manual Mode Selected, OFF Position and Water at Low Level

    Manual Mode Selected & Water between Low & High Levels

    Auto Mode Selected & High-Level Switch Activated


    leigehong
    PLC Program : A Continuous Filling Operation requires boxes moving on a conveyor to be automatically positioned and filled.
    PLC Program for Continuous Filling Operation

    Purpose
    Solenoid : To control the product filling from the hooper. Solenoid will be activated after the box positioned (proximity switch activation) and again de-activates after the level switch activated (level full).
    Level Switch : To detect the product level in the filling box.
    Proximity Switch : To position the box exactly below the hooper.
    Motor : To run the conveyor such that the box will move accordingly.
    Local Control Panel : it has START & STOP buttons used to control the sequence.
    Indication Panel : It displays the plant/batch status. Status signals are Run/Stand By/Full.
    PLC Logic

    The below are the default positions :
    STOP Switch : Normally Close (NC) START Switch : Normally Open (NO) Proximity Switch : Normally Open (NO) Level Switch : Normally Open (NO) Note : In ladder logic we can use either NO or NC contacts as default of proximity & level switch as required. if we use NO then it becomes NC after switch activated. if we use NC then it becomes NO after switch activated.
    Explanation
    Here we have 5 rungs / complete lines in the above ladder logic.
    First Rung:
    It has STOP, START & RUN Indication. STOP default NC, START is NO, when we press START command then both STOP & START are NC so the output RUN will be activated.
    RUN Indication will be displayed in indication panel. As START is a push button which generates a momentary command only.
    So we use a logical NO contact from RUN output. when RUN is activated, the NO becomes NC and Holds/latches the START command and RUN will be continuously activated even though START signal is lost as it is momentary type.
    Second Rung:
    it is used to indicate STAND BY signal status in the indicator panel. RUN indication NC contact is connected to STANDBY.
    so when RUN signal activated or process started then NC becomes NO and STAND BY indication will be disabled. if it is not running then stand by will be activated.
    Third Rung:
    it is used to indicate FULL signal status in the indicator panel. when level switch & proximity switch are activated then NO contacts will become NC and FULL signal status will be enabled.
    Fourth Rung:
    It is used to control the Motor either START/STOP. Proximity switch NC contact is used & RUN signal NO contact is used here to control the Motor.
    so when we press START button, the RUN will be activated ( as discussed in First Rung ) so RUN signal NO contact will becomes NC.
    Both proximity & RUN signals are enabled/healthy then Motor will be started and conveyor will start running and box/package will start move.
    once the box reached before Hooper then proximity switch will be activated. So proximity switch NC contact becomes NO, so Motor will be stopped immediately.
    After filling, the box has to move again and to reach other side. so here we use level switch NO contact across proximity switch.
    When Filling completed, Level switch contact changes from NO to NC, so again the motor starts and moves the box to other end.
    Fifth Rung:
    It is used to control the solenoid valve operation. If solenoid activated then it starts filling the box and if solenoid valve de-activates then the filling will be stopped.
    Here we mainly use RUN signal NO contact, Level Switch NC contact, Proximity NO contact to control the solenoid valve.
    Solenoid valve will be activated when START command is given ( RUN signal NO contact becomes NC), when level is Zero (Level switch NC contact used as default here ), when Box is placed under the hooper ( proximity switch NO contact used.
    so when box arrives under hooper, NO contact becomes NC ) , after all the logics are healthy then solenoid valve will be activated and starts filling.
    if level reaches 100% then level switch will become NO and thus stopping the filling by de-activating the solenoid valve.  We used proximity switch here because the filling has to be started when the box placed in correct position.
    After filling the box move out and filling again will start when next box comes under Hooper.

    leizuofa
    Create a ladder diagram for controlling a batch mixing process. Implement a PLC program for the mixing tank or Mixing Process using PLC Ladder Logic.
    PLC Program for Mixing Tank

    Fig : Mixing tank
    A tank is used to mix two liquids.
    The required control circuit operates as follows:
    A. When the START button is pressed, solenoids A and B energize. This permits the two liquids to begin filling the tank.
    B. When the tank is filled, the float switch trips. This de-energizes solenoids A and B and starts the motor used to mix the liquids together.
    C. The motor is permitted to run for 1 minute. After 1 minute has elapsed, the motor turns off and solenoid C energizes to drain the tank.
    D. When the tank is empty, the float switch de- energizes solenoid C.
    E. A STOP button can be used to stop the process at any point.
    F. If the motor becomes overloaded, the action of the entire circuit will stop.
    G. Once the circuit has been energized, it will continue to operate until it is manually stopped.
    PLC Logic Solution
    A relay schematic that will perform the logic of this circuit is shown in Below Figure. The logic of this circuit is as follows:

    Fig : Relay Schematic
    A. When the START button is pushed, relay coil CR is energized. This causes all CR contacts to close. Contact CR-1 is a holding contact used to maintain the circuit to coil CR when the START button is released.
    B. When contact CR-2 closes, a circuit is completed to solenoid coils A and B. This permits the two liquids that are to be mixed together to begin filling the tank.
    C. As the tank fills, the float rises until the float switch is tripped. This causes the normally closed float switch contact to open and the normally open con- tact to close.
    D. When the normally closed float switch opens, solenoid coils A and B de-energize and stop the flow of the two liquids into the tank.
    E. When the normally open contact closes, a circuit is completed to the coil of a motor starter and the coil of an on-delay timer. The motor is used to mix the two liquids together.
    F. At the end of the one minute time period, all of the TR contacts change position. The normally closed TR-2 contact connected in series with the motor starter coil opens and stops the operation of the motor.
    Normally open TR-3 contact closes and energizes solenoid coil C which permits liquid to begin draining from the tank. The normally closed TR-1 contact is used to assure that valves A and B cannot be re-energized until solenoid C de-energizes.
    G. As liquid drains from the tank, the float drops. When the float drops far enough, the float switch trips and its contacts return to their normal positions. When the normally open float switch contact reopens and de-energizes coil TR, all TR contacts return to their normal positions.
    H. When the normally open TR-3 contact reopens, solenoid C de-energizes and closes the drain valve. Contact TR-2 recloses, but the motor cannot restart because of the normally open float switch contact.
    When contact TR-1 re-closes, a circuit is completed to solenoids A and B. This permits the tank to begin refilling, and the process starts over again.
    I. If the STOP button or overload contact opens, coil CR de-energizes and all CR contacts open. This de- energizes the entire circuit.
    Note : The PLC Program also will be very much similar to the above relay schematic.
    Assignment For You
    Analyse the below animation and share the circuit operation through comments.


    leizuofa
    An Allen-Bradley SLC500 programmable logic controller (PLC) uses a 16-bit analog-to-digital converter ( in its model 1746-NI4 ) in analog input card to convert 4-20 mA signals into digital number values ranging from 3277 (at 4 mA) to 16384 (at 20 mA).
    However, these raw numbers from the PLC’s analog card must be mathematically scaled inside the PLC to represent real-world units of measurement, in this case 0 to 700 GPM of flow.
    PLC Analog Input Scaling
    Formulate a scaling equation to program into the PLC so that 4 mA of current registers as 0 GPM, and 20 mA of current registers as 700 GPM.

    We are already given the raw number values from the analog card’s analog-to-digital converter (ADC) circuit for 4 mA and 20 mA: 3277 and 16384, respectively.
    These values define the domain of our linear graph:

    Calculating and substituting the slope (m) value for this equation, using the full rise-over-run of the linear function:

    This type of scaling calculation is so common in PLC applications that Allen-Bradley has provided a special SCL (“scale”) instruction just for this purpose.
    Instead of “slope” (m) and “intercept” (b), the instruction prompts the human programmer to enter “rate” and “offset” values, respectively.
    Furthermore, the rate in Allen-Bradley’s SCL instruction is expressed as the numerator of a fraction where the denominator is fixed at 10000, allowing fractional (less than one) slope values to be specified using integer numbers.
    Aside from these details, the concept is exactly the same. Expressing our slope of 700/13107 as a fraction with 10000 as the denominator is a simple matter of solving for the numerator using cross-multiplication and division:

    Thus, the SCL instruction would be configured as follows


    leizuofa
    Now we are discussing about How a PLC Motor Control ?. Before going into the article, let us assume some conditions here.
    A PLC has to start a Motor when the Start button is pressed. It has three interlocks which are Motor Vibration High, Overload & Motor Temperature High.
    if any of the interlock activated then PLC has to stop the motor immediately.
    PLC has to stop the motor if the stop button is pressed.
    PLC trip logic or interlock has to be enable only when motor is in Remote mode.
    PLC Motor Control

    In above figure : Red LED indicator lights on the input and output cards of the PLC indicate if those respective I/O channels are energized.
    Note :
    In above figure, Local Control Panel signals are not shown. Local control panel is connected to motor feeder directly. 24v DC power directly connected ( in general fuses or barriers will be used, power will be distributed through bus bar) PLC Inputs
    Start push button Stop push button Vibration High Temperature High Overload Trip Run feedback Local/Remote status PLC Outputs
    Start Command (Remote Start) Stop Command (Remote Stop) Start Permissive ( Optional) The motor is a three phase, 415V AC powered device. So by default high voltage equipment will be powered from substations or motor control centers (MCC) which are maintained by electrical.
    So we consider this motor is connected to a simple motor feeder in the substation.
    Generally the motor feeder have inputs from field (local control panel) & PLC also. Which are shown in below figure.

    Note : the motor feeder may have start, stop, some other trips indications like overload etc… in the motor feeder panel which are not shown in the fig. These are mounted on the motor feeder panel (in addition to LCP).
    If motor feeder receives start & stop command inputs from PLC then we call them as Remote Start & Remote Stop signals.
    Similarly if motor feeder receives start & stop command inputs from local control panel (LCP) which is installed in field (near to motor) then we call them as Local Start & Local Stop signals.
    In common practice, this LCP has emergency stop & Local/Remote selection switch also.
    The motor feeder also sends a Local/Remote status to PLC. If Local/Remote selection switch is in Local mode then motor feeder will only consider signals from LCP and ignore the commands from PLC.
    Similarly if Local/Remote Selection switch in Remote Mode then motor feeder will consider signals from Remote i.e. PLC and ignore the signals from LCP.
    For example : if Local/Remote selection Switch in Remote Mode. If field operator pressed the start push button from the field LCP then motor will not be started as the selection is in remote mode.
    Depends on the Local/Remote selection switch status the motor feeder will decides which signals to be consider i.e. either PLC or LCP signals.
    Note : Local/Remote Selection will not be applied for Emergency Stop or Stop Commands either from PLC or LCP. Whatever mode it is, the Stop commands will be accepted by motor feeder and stops the motor immediately. This is a safety concern.
    Lets see how a PLC controls a motor.
    Now Local/Remote selection switch is in Remote mode.
    Here we are sending an Permissive signal ( Start Permissive) to the motor feeder. For starting the motor, the permissive must be healthy otherwise motor feeder will be de-energized or will not start the motor.
    In PLC, Start permissive will be used as a extra safety & for checking the interlock status. if all the interlocks are healthy then only permissive signal will be sent to motor feeder.
    Generally we call this as “Start Permissive”, as name implies it is only required for starting the motor, after motor started the status of this permissive signal will not be considered by motor feeder (Only required for starting the motor).
    This is an optional signal. For High capacity motors, start permissive signals will be used. For normal or low capacity motors these are very rarely used, again depends on our applications, industry, requirements etc.
    Lets say all interlocks are healthy, so PLC sends the permissive signal to motor feeder.
    Now start push button is pressed.
    First PLC checks the Local/Remote status, if it is in Remote then proceeds further.
    Again it checks for any active trips/interlocks. If there is no interlock or all working normal, then PLC sends a start command to substation where motor feeder is installed.
    In this example we have three interlocks: Motor Vibration High, Motor Temperature High & Overload trip.
    In generally High capacity motors are equipped with Vibration sensors & temperature sensors.
    In our example we consider vibration signals as fail safe, so default status is normally closed, if high vibration appears then the contact become Normally Open & PLC trips/stops the motor.
    We have another interlock which is Overload trip, this input is taken from the motor feeder. The temperature sensors signal is normally open and when temperature high then it becomes normally close and PLC trips/Stops the motor.
    Note: Fail safe or default contact status either NC or NO are depends on our application or logic requirements. Here we are only discussing an example for understanding the concept.
    After receiving the start command from the PLC, motor feeder will be energized and power up the motor. After motor started, the motor feeder will send the Run feedback to the PLC. The run feedback will be displayed on the graphics.
    In some PLC’s or in safety PLC’s if the Run feedback is not received in specified time frame ( say within 5 seconds) then PLC automatically sends an Stop signals to the motor feeder. This is a optional feature in normal PLC applications( must in safety PLC’s).
    Say now Vibration High came, then PLC sends a stop command to motor feeder and it immediately stops the motor. The run feedback status also updates accordingly.
    Motor will be started when Level Transmitter will be High & again it will stopped at Level Transmitter Low
    Abbreviations :
    MCC : Motor Control Center or Substation where motor will be powered.
    PLC/DCS : Control System, where Motor can be controlled as per logic (Auto) or as per operator action (Manual).
    LCP : Local Control Panel which is installed in the field, near motor in which start, stop push buttons are available

    leizuofa
    Instrumentation and control rely on converting physical or process variables into a more useful format for the operator display.
    Pressure in a pipe is converted to mechanical deflection of a diaphragm, which is converted to electrical energy by a strain gauge (the diaphragm and strain gauge constitute a transducer), then to a numeric integer value by an I/O module, and then to a floating point engineering unit value by the PLC or HMI for display.
    This information is also used to help generate output commands, which are converted into electrical signals and then to mechanical action. The trick is to understand the I/O relationships of the various converters.
    How PLC Reads the Data from Field Transmitters

    For example, a flow orifice will cause a predictable pressure drop as fluids flow across it. A pressure transmitter can measure this pressure drop by comparing the upstream pressure to the downstream pressure.
    Though this pressure differential is not linear with flow rate, it has a repeatable relationship to it. This relationship is best approximated as a square-root function.
    Taking the square root of the differential pressure signal effectively linearizes it with the flow rate.
    After a linear relationship has been established, the entire conversion sequence from transmitter to computer display can be deduced from one measurement.
    The below Figure depicts two typical temperature measurement circuits as follows: The top configuration uses the external power supply of the transmitter to power the signal loop.
    This configuration is referred to as a four-wire loop. The bottom configuration uses an internal power supply (AI card Power) to power the loop. This configuration is referred to as a two-wire loop.

    The following discussion about unit conversions applies to both circuit types. Focus on the top circuit.
    A thermocouple is the sensing element. Thermocouples are devices that use the principle of bimetallic contact to generate a small millivolt signal.
    Note that the temperature-voltage curve presented in the chart is relatively linear throughout the temperature interval.
    Outside of that temperature interval, the signal can become less linear (a characteristic of a thermocouple), but that is of no importance here.

    Instrument scaling must always begin at the process measurement. The designer consults the heat and material balance (HMB) sheet for our imaginary system and finds the expected temperature at the measurement point is approximately 105°C.
    The upstream heater is capable of heating the system to approximately 130°C before it shuts down due to its over-temperature interlock.
    The design engineer knows a properly calibrated span would place the normal operating point at about the middle of the curve. The upper end would need to be above 130°C.
    After some thought, the engineer decides on a calibrated span of 15 to 150°C and chooses a type K thermocouple, which provides an output of 0.597 to 6.138 mV over that temperature interval.

    The temperature transmitter, then, must be bench calibrated to provide a 4 -20 mA output signal that is proportional to the 0.597 to 6.138 mV input signal expected from the thermocouple.
    The transmitter, being a current source (as opposed to a voltage source), varies its power output as necessary to maintain a steady milliamp output that is proportional to the millivolts on its input i.e. measured temperature reading.
    (Note: A voltage source, such as a battery, tries to maintain a constant voltage regardless of load, while a current source tries to maintain a constant current regardless of load).
    The temperature transmitter then converts this signal into a 4–-20 mA signal that has been scaled, in this case for a span of 15 to –150°C.
    The PLC has an analog input module that detects the output of the temperature transmitter. Virtually all analog input modules are voltmeters, even though they are listed as milliamp inputs.
    Sometimes the resistor is external on the terminal strip, and sometimes it is internal on the PLC I/O module (shown in Figure). In either case, the 4-–20 mA signal will be converted to a voltage.
    Typically, this voltage is 1-–5 VDC because the resistor used is 250 ohms. This analog value must then be converted to a binary value.
    In our example, the PLC specification lists this particular PLC I/O module as having 12-bit resolution. To find the resolution of the module in terms of the process variable, perform a binary conversion: 212 = 4095.
    So, for an input span of 1-–5 VDC, the PLC I/O module provides an integer value to the PLC program that ranges from 0 to 4095.
    The PLC program may fetch this data to use as needed. One of the possible actions of the PLC program is to move this data value into a network interface buffer (a series of contiguous locations in PLC memory) for transmittal upstream to the HMI.
    The raw-count integer value is then made available for data transmittal across the network.
    The HMI receives this transmitted data stream, which is then stored in an input data buffer. The HMI computer has a tag-file database, which contains instructions about how to manipulate each data item for presentation to the operator.
    Many of the tags in the tag file are linked to data items in the input data buffer. One such tag is linked to this particular location.
    The 0 to 4095 raw value is extracted and converted to engineering units by use of the formula embedded in either the tag-file database or the graphic screen software that uses the information.
    The formula in our sample case is shown in Below Figure.
    The value produced (85.88) would be the value displayed to the operator in oC as follows in Below Figures:


    leizuofa
    A timer is a PLC instruction measuring the amount of time elapsed following an event.
    Timer instructions come in two basic types: on-delay timers and off-delay timers. Both “on-delay” and “off-delay” timer instructions have single inputs triggering the timed function.
    An “on-delay” timer activates an output only when the input has been active for a minimum amount of time.
    PLC Timer Instructions
    Take for instance this PLC program, designed to sound an audio alarm siren prior to starting a conveyor belt.
    To start the conveyor belt motor, the operator must press and hold the “Start” push-button for 10 seconds, during which time the siren sounds, warning people to clear away from the conveyor belt that is about to start.
    Only after this 10-second start delay does the motor actually start (and latch “on”):

    Similar to an “up” counter, the on-delay timer’s elapsed time (ET) value increments once per second until the preset time (PT) is reached, at which time its output (Q) activates.
    In this program, the preset time value is 10 seconds, which means the Q output will not activate until the “Start” switch has been depressed for 10 seconds.
    The alarm siren output, which is not activated by the timer, energizes immediately when the “Start” push-button is pressed.
    An important detail regarding this particular timer’s operation is that it be non-retentive.
    This means the timer instruction should not retain its elapsed time value when the input is de-activated.
    Instead, the elapsed time value should reset back to zero every time the input de-activates. This ensures the timer resets itself when the operator releases the “Start” push-button.
    A retentive ondelay timer, by contrast, maintains its elapsed time value even when the input is de-activated. This makes it useful for keeping “running total” times for some event.
    Most PLCs provide retentive and non-retentive versions of on-delay timer instructions, such that the programmer may choose the proper form of on-delay timer for any particular application.
    The IEC 61131-3 programming standard, however, addresses the issue of retentive versus non-retentive timers a bit differently.
    According to the IEC 61131-3 standard, a timer instruction may be specified with an additional enable input (EN) that causes the timer instruction to behave non-retentively when activated, and retentively when de-activated.
    The general concept of the enable (EN) input is that the instruction behaves “normally” so long as the enable input is active (in this case, non-retentive timing action is considered “normal” according to the IEC 61131-3 standard), but the instruction “freezes” all execution whenever the enable input de-activates.
    This “freezing” of operation has the effect of retaining the current time (CT) value even if the input signal de-activates.
    For example, if we wished to add a retentive timer to our conveyor control system to record total run time for the conveyor motor, we could do so using an “enabled” IEC 61131-3 timer instruction like this:

    When the motor’s contactor bit (OUT contactor) is active, the timer is enabled and allowed to time.
    However, when that bit de-activates (becomes “false”), the timer instruction as a whole is disabled, causing it to “freeze” and retain its current time (CT) value ( Note 1 ).
    This allows the motor to be started and stopped, with the timer maintaining a tally of total motor run time.
    Note 1 : The “enable out” (ENO) signal on the timer instruction serves to indicate the instruction’s status: it activates when the enable input (EN) activates and de-activates when either the enable input de-activates or the instruction generates an error condition (as determined by the PLC manufacturer’s internal programming). The ENO output signal serves no useful purpose in this particular program, but it is available if there were any need for other rungs of the program to be “aware” of the run-time timer’s status.
    If we wished to give the operator the ability to manually reset the total run time value to zero, we could hard-wire an additional switch to the PLC’s discrete input card and add “reset” contacts to the program like this:

    Whenever the “Reset” switch is pressed, the timer is enabled (EN) but the timing input (IN) is disabled, forcing the timer to (non-retentively) reset its current time (CT) value to zero.
    The other major type of PLC timer instruction is the off-delay timer. This timer instruction differs from the on-delay type in that the timing function begins as soon as the instruction is deactivated, not when it is activated.
    An application for an off-delay timer is a cooling fan motor control for a large industrial engine.
    In this system, the PLC starts an electric cooling fan as soon as the engine is detected as rotating, and keeps that fan running for two minutes following the engine’s shut-down to dissipate residual heat:

    When the input (IN) to this timer instruction is activated, the output (Q) immediately activates (with no time delay at all) to turn on the cooling fan motor contactor.
    This provides the engine with cooling as soon as it begins to rotate (as detected by the speed switch connected to the PLC’s discrete input).
    When the engine stops rotating, the speed switch returns to its normally-open position, de-activating the timer’s input signal which starts the timing sequence.
    The Q output remains active while the timer counts from 0 seconds to 120 seconds.
    As soon as it reaches 120 seconds, the output de-activates (shutting off the cooling fan motor) and the elapsed time value remains at 120 seconds until the input re-activates, at which time it resets back to zero.
    The following timing diagrams compare and contrast on-delay with off-delay timers:

    While it is common to find on-delay PLC instructions offered in both retentive and non-retentive forms within the instruction sets of nearly every PLC manufacturer and model, it is almost unheard of to find retentive off-delay timer instructions. Typically, off-delay timers are non-retentive only (Note 2 ).
    Note 2 : The enable (EN) input signals specified in the IEC 61131-3 programming standard make retentive off-delay timers possible (by de-activating the enable input while maintaining the “IN” input in an inactive state), but bear in mind that most PLC implementations of timers do not have separate EN and IN inputs. This means (for most PLC timer instructions) the only input available to activate the timer is the “IN” input, in which case it is impossible to create a retentive off-delay timer (since such a timer’s elapsed time value would be immediately re-set to zero each time the input re-activates).

    leizuofa
    As we have seen with counter and timers, some PLC instructions generate digital values other than simple Boolean (on/off) signals.
    Counters have current value (CV) registers and timers have elapsed time (ET) registers, both of which are typically integer number values.
    Many other PLC instructions are designed to receive and manipulate non-Boolean values such as these to perform useful control functions.
    The IEC 61131-3 standard specifies a variety of data comparison instructions for comparing two non-Boolean values, and generating Boolean outputs.
    PLC Data Comparison Instructions
    The basic comparative operations of “less than” (<), “greater than” (>), “less than or equal to” (≤), “greater than or equal to” (≥), “equal to” (=), and “not equal to” (6=) may be found as a series of “box” instructions in the IEC standard:

    The Q output for each instruction “box” activates whenever the evaluated comparison function is “true” and the enable input (EN) is active.
    If the enable input remains active but the comparison function is false, the Q output de-activates. If the enable input de-de-activates, the Q output retains its last state.
    A practical application for a comparative function is something called alternating motor control, where the run-times of two redundant electric motors are monitored, with the PLC determining which motor to turn on next based on which motor has run the least:

    .In this program, two retentive on-delay timers keep track of each electric motor’s total run time, storing the run time values in two registers in the PLC’s memory:
    Motor A runtime and Motor B runtime. These two integer values are input to the “greater than” instruction box for comparison.
    If motor A has run longer than motor B, motor B will be the one enabled to start up next time the “start” switch is pressed.
    If motor A has run less time or the same amount of time as motor B (the scenario shown by the blue-highlighted status indications), motor A will be the one enabled to start.
    The two series-connected virtual contacts OUT motor A and OUT motor B ensure the comparison between motor run times is not made until both motors are stopped.
    If the comparison were continually made, a situation might arise where both motors would start if someone happened to press the Start pushbutton with one motor is already running.

    leikang
    A counter is a PLC instruction that either increments (counts up) or decrements (counts down) an integer number value when prompted by the transition of a bit from 0 to 1 (“false” to “true”).
    Counter instructions come in three basic types:
    up counters, down counters, and up/down counters. Both “up” and “down” counter instructions have single inputs for triggering counts, whereas “up/down” counters have two trigger inputs: one to make the counter increment and one to make the counter decrement.
    PLC Counter Instructions
    To illustrate the use of a counter instruction, we will analyze a PLC-based system designed to count objects as they pass down a conveyor belt:

    In this system, a continuous (unbroken) light beam causes the light sensor to close its output contact, energizing discrete channel IN4.
    When an object on the conveyor belt interrupts the light beam from source to sensor, the sensor’s contact opens, interrupting power to input IN4.
    A push-button switch connected to activate discrete input IN5 when pressed will serve as a manual “reset” of the count value.
    An indicator lamp connected to one of the discrete output channels will serve as an indicator of when the object count value has exceeded some pre-set limit.
    We will now analyze a simple Ladder Diagram program designed to increment a counter instruction each time the light beam breaks:

    This particular counter instruction (CTU) is an incrementing counter, which means it counts “up” with each off-to-on transition input to its “CU” input.
    The normally-closed virtual contact (IN sensor object) is typically held in the “open” state when the light beam is continuous, by virtue of the fact the sensor holds that discrete input channel energized while the beam is continuous.
    When the beam is broken by a passing object on the conveyor belt, the input channel de-energizes, causing the virtual contact IN sensor object to “close” and send virtual power to the “CU” input of the counter instruction.
    This increments the counter just as the leading edge of the object breaks the beam. The second input of the counter instruction box (“R”) is the reset input, receiving virtual power from the contact IN switch reset whenever the reset pushbutton is pressed. If this input is activated, the counter immediately resets its current value (CV) to zero.
    Status indication is shown in this Ladder Diagram program, with the counter’s preset value (PV) of 25 and the counter’s current value (CV) of 0 shown highlighted in blue.
    The preset value is something programmed into the counter instruction before the system put into service, and it serves as a threshold for activating the counter’s output (Q), which in this case turns on the count indicator lamp (the OUT counts reached coil).
    According to the IEC 61131-3 programming standard, this counter output should activate whenever the current value is equal to or greater than the preset value (Q is active if CV ≥ PV).
    This is the status of the same program after thirty objects have passed by the sensor on the conveyor belt.
    As you can see, the current value of the counter has increased to 30, exceeding the preset value and activating the discrete output:

    If all we did not care about maintaining an accurate total count of objects past 25 – but merely wished the program to indicate when 25 objects had passed by.
    we could also use a down counter instruction preset to a value of 25, which turns on an output coil when the count reaches zero:

    Here, a “load” input causes the counter’s current value to equal the preset value (25) when activated.
    With each sensor pulse received, the counter instruction decrements. When it reaches zero, the Q output activates.
    A potential problem in either version of this object-counting system is that the PLC cannot discriminate between forward and reverse motion on the conveyor belt.
    If, for instance, the conveyor belt were ever reversed in direction, the sensor would continue to count objects that had already passed by before (in the forward direction) as those objects retreated on the belt.
    This would be a problem because the system would “think” more objects had passed along the belt (indicating greater production) than actually did.
    One solution to this problem is to use an up/down counter, capable of both incrementing (counting up) and decrementing (counting down), and equip this counter with two light-beam sensors capable of determining direction of travel.
    If two light beams are oriented parallel to each other, closer than the width of the narrowest object passing along the conveyor belt, we will have enough information to determine direction of object travel:

    This is called quadrature signal timing, because the two pulse waveforms are approximately 90 deg (one-quarter of a period) apart in phase.
    We can use these two phase-shifted signals to increment or decrement an up/down counter instruction, depending on which pulse leads and which pulse lags.
    A Ladder Diagram PLC program designed to interpret the quadrature pulse signals is shown here, making use of negative-transition contacts as well as standard contacts:

    The counter will increment (count up) when sensor B de-energizes only if sensor A is already in the de-energized state (i.e. light beam A breaks before B).
    Counter will decrement (count down) when sensor A de-energizes only if sensor B is already in the de-energized state (i.e. light beam B breaks before A).
    Note that the up/down counter has both a “reset” (R) input and a “load” input (“LD”) to force the current value.
    Activating the reset input forces the counter’s current value (CV) to zero, just as we saw with the “up” counter instruction.
    Then Activating the load input forces the counter’s current value to the preset value (PV), just as we saw with the “down” counter instruction.
    In the case of an up/down counter, there are two Q outputs: a QU (output up) to indicate when the current value is equal to or greater than the preset value, and a QD (output down) to indicate when the current value is equal to or less than zero.
    Note how the current value (CV) of each counter shown is associated with a tag name of its own, in this case parts counted.
    The integer number of a counter’s current value (CV) is a variable in the PLC’s memory just like boolean values such as IN sensor A and IN switch reset, and may be associated with a tag name or symbolic address just the same.
    This allows other instructions in a PLC program to read (and sometimes write!) values from and to that memory location.

    leikang
    This article is about the programming of two-hand control used in the press industry.
    The purpose of this program is about safety to prevent fatal accidents. Below is an image of how the press machine looks and why we care about safety. As you can see there are pushbuttons used to control the press machine. The center plate is pushed against the surface of the workpiece when we press the push buttons.
    The two pushbuttons must be pressed at the same time to operate the press machine as shown in the below animation.

    When the operator uses his one hand to press the button and use his second hand when plate pushing against the surface, he can injure himself. The powerful force of pushing a plate can easily squeeze hands if the operator tries to maneuver things in a hurry.
    Below I have explained the program used to prevent such incidents with the help of Siemens TIA Portal.
    Here in the below figure press machine which has two inputs and one output is shown. Inputs are connected to the plc digital input (DI) module and single output which is connected to the digital output (DO) module.
    Below is a list of inputs and outputs used for the program.
    Inputs:
    Push Button  (PB_1): I0.0 Push Button  (PB_2): I0.2 Outputs:
    Press Machine Output: Q0.0 Two-Hand Control Logic

    Logic Description
    Network 1:
    Here two push-buttons PB_1 & PB_2 are connected in series. When both push-buttons are pressed at the same time, then the signal will pass through NC contact of timer T0 and energize the output.
    Network 2:
    Now if any single push button either PB_1 or PB_2 is pressed then timer T0 on-delay timer (S_ODT) is energized, here in our case after 5 seconds.
    Here NC contact of press machine’s output is also used after push button because if the output is ON then it won’t allow the timer to energize.
    So, the machine’s output will only energize when both buttons are pressed together.

    leikang
    When you design a PLC logic, you have to take care of the names that you provide to tags. It should be easily understood and interpreted by any programmer. It should neither be too long nor too short.
    The naming convention is important because improper tagging can cause troubleshooting issues for programmers. Also, giving lengthy names will consume the memory of PLC. So, every programmer has to follow proper naming conventions before writing a PLC program. In this post, we will see the concept of PLC tag naming conventions.
    PLC Tag Naming Conventions

    First of all, let us understand how tag naming convention plays a great role in PLC programming. You have a motor with its run command and run feedback as PLC IO’s.
    The motor is located in the blower room and it is used as an air compressor. The motor tag name in the P&ID is M-101. Now, for a PLC programmer, identifying a tag location is important. So, there are two types of mindsets that normally define a PLC programmer.
    The first will try to give as much information as possible in a tag name; so he can name the motor run command as M101_Compressor_Run_Command. The second one will try to give the name as Q_M101_Comp.
    The second mindset looks very clear, as he is giving short names and keeping the length as minimal as possible. This is the reason why naming a PLC tag is important, as it relieves the programmer from reading such lengthy tags in situations where urgent troubleshooting has arrived. (It is to be noted that PLC tag naming does not accept any special character apart from underscore (_) ).
    A PLC tag name should contain information that can help the programmer relate to the meaning of it. This generally implies the following information –
    data type (eg. boolean, integer), data flow (eg. input, output), scope (eg. local, global), instrument or device type (eg. motor, valve, sensor), process parameter (eg. pressure, flow, temperature) and location of the device.   Tag Name Styles
    There are various styles according to IEC standards that must be followed for proper naming.
    Let us have a look at some of the most generally used:
    Camel Style, Pascal Style, Snake Style, Prefix with Data Type Style Camel Style
    In this style, there is no underscore in between. A full name is given to the whole word, but each word in it starts with a capital letter. For example, take the above-discussed example.
    M101_Compressor_Run_Command will be written as m101CompressorRunCommand. You can identify each word by a capital letter.
    The first letter will be a compulsory small letter. This style looks good if the word is small. It prevents the use of underscore and this makes memory consumption smaller.
    Pascal Style
    It is similar to the camel style; the only difference is that the first letter will be a compulsory capital letter.
    For example, our tag will be written as M101CompressorRunCommand.
    Snake Style
    The example that we discussed before is the snake style. Here, each word will be separated by an underscore.
    Prefix with Data Type Style
    Here, the tag will be prefixed by the data type of the tag name. In our case, the tag type was boolean. According to IEC standards, a boolean tag is usually given a prefix of ‘x’.
    So, our style will be written as xM101CompressorRunCommand. This helps the programmer to identify what type of data is used for that particular tag.
    Tips For Tag Naming in PLC Programming
    The first and foremost rule is that the length of a tag should be short, but not so short that no one can understand it. As discussed, the length should contain appropriate information in a proper length. Lengthy names should be strictly avoided.
    Follow the general tag naming styles that were discussed. These are according to IEC standards and make the logic look neat and clean.
    To reduce bugs during tag creation, use Excel files. Excel reduces workload in a very vast way as duplication and copying becomes very easy. Errors are hardly produced in Excel files.
    It is not always necessary to use a full name for a word. For example, the valve can be written as vlv and temperature can be written as temp.
    Avoid making the tag fully capitals. It looks cumbersome and inappropriate to read.

    leikang
    A wise PLC programmer once told me that the first thing any aspiring programmer should learn about the PLC they intend to program is how the digital memory of that PLC is organized. This is sage advice for any programmer, especially on systems where memory is limited, and/or where I/O has a fixed association with certain locations in the system’s memory.
    Virtually every microprocessor-based control system comes with a published memory map showing the organization of its limited memory: how much is available for certain functions, which addresses are linked to which I/O points, how different locations in memory are to be referenced by the programmer.
    Discrete input and output channels on a PLC correspond to individual bits in the PLC’s memory array. Similarly, analog input and output channels on a PLC correspond to multi-bit words (contiguous blocks of bits) in the PLC’s memory.
    The association between I/O points and memory locations is by no means standardized between different PLC manufacturers, or even between different PLC models designed by the same manufacturer. This makes it difficult to write a general tutorial on PLC addressing, and so my ultimate advice is to consult the engineering references for the PLC system you intend to program.
    The most common brand of PLC in use is Allen-Bradley (Rockwell), which happens to use a unique form of I/O addressing (Note 1), students tend to find confusing. For these two reasons (popularity and confusion), I will focus on Allen-Bradley addressing conventions for the bulk of this section.
    Note 1 : The most modern Allen-Bradley PLCs have all but done away with fixed-location I/O addressing, opting instead for tag name based I/O addressing. However, enough legacy Allen-Bradley PLC systems still exist in industry to warrant coverage of these addressing conventions.
    PLC Memory Map
    The following table shows a partial memory map for an Allen-Bradley SLC 500 PLC

    Memory Map also called the data table, this map shows the addressing of memory areas reserved for programs entered by the user. Other areas of memory exist within the SLC 500 processor, but these other areas are inaccessible to the technician writing PLC programs.
    Note that Allen-Bradley’s use of the word “file” differs from personal computer parlance. In the SLC 500 controller, a “file” is a block of random-access memory used to store a particular type of data.
    By contrast, a “file” in a personal computer is a contiguous collection of data bits with collective meaning (e.g. a word processing file or a spreadsheet file), usually stored on the computer’s hard disk drive.
    Within each of the Allen-Bradley PLC’s “files” are multiple “elements,” each element consisting of a set of bits (8, 16, 24, or 32) representing data.
    Elements are addressed by number following the colon after the file designator, and individual bits within each element addressed by a number following a slash mark. For example, the first bit (bit 0) of the second element in file 3 (Binary) would be addressed as B3:2/0.
    In Allen-Bradley PLCs such as the SLC 500 and PLC-5 models, files 0, 1, and 2 are exclusively reserved for discrete outputs, discrete inputs, and status bits, respectively.
    Thus, the letter designators O, I, and S (file types) are redundant to the numbers 0, 1, and 2 (file numbers).
    Other file types such as B (binary), T (timers), C (counters), and others have their own default file numbers (3, 4, and 5, respectively), but may also be used in some of the user-defined file numbers (10 and above).
    For example, file 7 in an Allen-Bradley controller is reserved for data of the “integer” type (N), but integer data may also be stored in any file numbered 10 or greater at the user’s discretion.
    Thus, file numbers and file type letters for data types other than output (O), input (I), and status (S) always appear together.
    You would not typically see an integer word addressed as N:30 (integer word 30 in the PLC’s memory) for example, but rather as N7:30 (integer word 30 in file 7 of the PLC’s memory) to distinguish it from other integer word 30’s that may exist in other files of the PLC’s memory.
    This file-based addressing notation bears further explanation. When an address appears in a PLC program, special characters are used to separate (or “delimit”) different fields from each other.
    The general scheme for Allen-Bradley SLC 500 PLCs is shown here:

    Not all file types need to distinguish individual words and bits. Integer files (N), for example, consist of one 16-bit word for each element. For instance, N7:5 would be the 16-bit integer word number five held in file seven.
    A discrete input file type (I), though, needs to be addressed as individual bits because each separate I/O point refers to a single bit. Thus, I:3/7 would be bit number seven residing in input element three.
    The “slash” symbol is necessary when addressing discrete I/O bits because we do not wish to refer to all sixteen bits in a word when we just mean a single input or output point on the PLC.
    Integer numbers, by contrast, are collections of 16 bits each in the SLC 500 memory map, and so are usually addressed as entire words rather than bit-by-bit .
    Certain file types such as timers are more complex. Each timer “element ” consists of two different 16-bit words (one for the timer’s accumulated value, the other for the timer’s target value) in addition to no less than three bits declaring the status of the timer (an “Enabled” bit, a “Timing” bit, and a “Done” bit).
    Thus, we must make use of both the decimal-point and slash separator symbols when referring to data within a timer. Suppose we declared a timer in our PLC program with the address T4:2, which would be timer number two contained in timer file four.
    If we wished to address that timer’s current value, we would do so as T4:2.ACC (the “Accumulator” word of timer number two in file four). The “Done” bit of that same timer would be addressed as T4:2/DN (the “Done” bit of timer number two in file four)
    A hallmark of the SLC 500’s addressing scheme common to many legacy PLC systems is that the address labels for input and output bits explicitly reference the physical locations of the I/O channels.
    For instance, if an 8-channel discrete input card were plugged into slot 4 of an Allen Bradley SLC 500 PLC, and you wished to specify the second bit (bit 1 out of a 0 to 7 range), you would address it with the following label: I:4/1.
    Addressing the seventh bit (bit number 6) on a discrete output card plugged into slot 3 would require the label O:3/6. In either case, the numerical structure of that label tells you exactly where the real-world input signal connects to the PLC.
    PLC Memory Mapping Example
    To illustrate the relationship between physical I/O and bits in the PLC’s memory, consider this example of an Allen-Bradley SLC 500 PLC, showing one of its discrete input channels energized (the switch being used as a “Start” switch for an electric motor):

    If an input or output card possesses more than 16 bits – as in the case of the 32-bit discrete output card shown in slot 3 of the example SLC 500 rack – the addressing scheme further subdivides each element into words and bits (each “word” being 16 bits in length).
    Thus, the address for bit number 27 of a 32-bit input module plugged into slot 3 would be I:3.1/11 (since bit 27 is equivalent to bit 11 of word 1 – word 0 addressing bits 0 through 15 and word 1 addressing bits 16 through 31):

    A close-up photograph of a 32-bit DC input card for an Allen-Bradley SLC 500 PLC system shows this multi-word addressing:

    The first sixteen input points on this card (the left-hand LED group numbered 0 through 15) are addressed I:X.0/0 through I:X.0/15, with “X” referring to the slot number the card is plugged into. The next sixteen input points (the right-hand LED group numbered 16 through 31) are addressed I:X.1/0 through I:X.1/15.
    Legacy PLC systems typically reference each one of the I/O channels by labels such as “I:1/3” (or equivalent ) indicating the actual location of the input channel terminal on the PLC unit.
    The IEC 61131-3 programming standard refers to this channel-based addressing of I/O data points as direct addressing. A synonym for direct addressing is absolute addressing.
    Addressing I/O bits directly by their card, slot, and/or terminal labels may seem simple and elegant, but it becomes very cumbersome for large PLC systems and complex programs.
    Every time a technician or programmer views the program, they must “translate” each of these I/O labels to some real-world device (e.g. “Input I:1/3 is actually the Start push-button for the middle tank mixer motor”) in order to understand the function of that bit.
    A later effort to enhance the clarity of PLC programming was the concept of addressing variables in a PLC’s memory by arbitrary names rather than fixed codes.
    The IEC 61131-3 programming standard refers to this as symbolic addressing in contrast to “direct” (channel-based) addressing, allowing programmers arbitrarily name I/O channels in ways that are meaningful to the system as a whole.
    To use our simple motor “Start” switch example, it is now possible for the programmer to designate input I:1/3 (an example of a direct address) as “Motor start switch” (an example of a symbolic address) within the program, thus greatly enhancing the readability of the PLC program.
    Initial implementations of this concept maintained direct addresses for I/O data points, with symbolic names appearing as supplements to the absolute addresses.
    The modern trend in PLC addressing is to avoid the use of direct addresses such as I:1/3 altogether, so they do not appear anywhere in the programming code.
    The Allen-Bradley “Logix” series of programmable logic controllers is the most prominent example of this new convention at the time of this writing.
    Each I/O point, regardless of type or physical location, is assigned a tag name which is meaningful in a real-world sense, and these tag names (or symbols as they are alternatively called) are referenced to absolute I/O channel locations by a database file.
    An important requirement of tag names is that they contain no space characters between words (e.g. instead of “Motor start switch”, a tag name should use hyphens or underscore marks as spacing characters: “Motor start switch”), since spaces are generally assumed by computer programming languages to be delimiters (separators between different variables).
    Having introduced Allen-Bradley’s addressing notation for SLC 500 model PLCs, I will now abandon it in favor of the modern convention of symbolic addressing throughout the rest of the articles, so as to avoid making the programming examples brand- or model-specific. Each data point within my PLC programs will bear its own tag name rather than a direct (channel-based) address label.

    leikang
    Ina process plant, on/off control is done through the PLC or DCS.
    The below Figure is an overview of one discrete/digital (on/off) circuit, showing the entire process from the power supply through the sensor and on to the PLC.
    PLC Digital Signals Wiring Techniques

    In Above Figure, a level switch is mounted to a vessel. The switch is monitored by a PLC digital input module. The circuit is powered through a circuit breaker (CB2) in an instrument power panel.
    The main power feed is brought to a marshalling panel, where the power is split, feeding multiple fused circuits. Fuse 03FU is the main disconnect fuse, while the remaining fuses are distribution fuses. Fuse 06FU feeds our circuit.
    Hot (electrically live) wire 06A is passed to the field junction box (FJB) as one wire in a multi-conductor cable. This cable, sometimes called a homerun or main cable, is broken out at the field junction box (FJB), where, in this example, two unshielded twisted pair cables are fed to the end device, LSH-47.
    This leaves one spare conductor. The hot wire 06A hits the + terminal of the form- A contact and jumpers to the H terminal to power up the electronics of the level switch.
    The wire number changes across the relay contact to 06B. This wire feeds the signal back to the FJB, where the signal is passed back to the termination cabinet via the multi-conductor homerun cable.
    There the signal and neutral are paired and passed to the PLC module. Note that the return neutral wire, labeled 02N (since it is the return wire for CB2), is split to the PLC and the level switch.
    NOTE: It is always advisable to use twisted-pair wire when connecting to a PLC system. Twisted-pair cables exhibit excellent noise immunity, which is particularly useful when connecting to high-impedance loads, such as those found on PLC/DCS I/O modules.
    A high-impedance load can be particularly sensitive to noise since the attendant current is so low, and the amount of actual work being done is minimal.
    That is it, in a nutshell. The following is a commentary on connectivity issues related to PLC/DCS signal wiring.
    a. Sinking and Sourcing
    The terms sinking and sourcing are used to describe the way a particular component in the circuit relates to power flow. These terms actually stem from the days of transistor logic.
    A transistor can be thought of as a simple switch for this discussion (Below Figure).

    DC (+) is DC Positive Terminal, DCC is DC common
    This type of transistor requires a small resistance on its collector (the upper side) for current limiting.
    In the Case 1 example,
    the resistor is in place, with the load shown in series with the transistor’s emitter. When the transistor conducts, current flows through the resistor, the transistor, and then through the load.
    This circuit was not used very much because the current divides across the internal circuitry, leaving less power available to drive the load and driving temperatures up in the I/O module.
    Case 2
    This provides a more typical sourcing circuit, where the PLC output, by turning off, switches the full-load current to drive the load. When the output turns on, the transistor conducts, causing most of the current to be shunted through it, starving the load, and thereby de-energizing it.
    The downside of this configuration is that a small leakage current will continue to be present across the load, as a certain amount of current will continue to be directed across the load, though not enough, typically, to cause the load to stay energized. When troubleshooting, however, a small voltage will be detected across a de-energized load.
    In the Case 3 example,
    the load is the collector resistor. When the transistor conducts, the load energizes. From the standpoint of the board electronics, this is a better configuration because most of the heat is dissipated by the load.
    The downside of this configuration is that “switching the neutral” is counter-intuitive and can be unsafe, as full voltage is present at both the positive and negative terminals of the load when it is de-energized.
    For these reasons, Case 2 has evolved to become the most common output configuration. This sinking /sourcing concept can be extended to any circuit.
    b. Circuit Protection (Fusing)
    Most I/O modules are internally fused. However, that does not mean all that much to the user. While the internal fuse does limit damage to the module itself, in most cases the module still must be sent to the factory to be repaired. So the end result is the same to the user—a broken module.
    As a result, it is good practice to add external fuses to each I/O point, with a rating just below the fuse rating on the module circuit board. While this limits the size of the load that can be driven directly by the module, the internal fuse and module are protected.
    Caution: If internally fused discrete outputs are embedded in interlock chains, or if they are in circuits that depend on normally closed contacts to initiate safety actions, then another type of module that is unfused should be used.
    Or interposing relays could be deployed. It is possible to have the I/O point function normally (e.g., close its contacts, and report to the program that it has closed them) but still not pass power due to a blown internal fuse.
    c. Digital Input (DI) Circuits
    Digital input (DI) modules continually scan their input points for the presence or absence of voltage. If voltage is present, a 1 is written to a memory location. If voltage is absent, a 0 is written there.
    The required voltage type and magnitude are two of the factors that distinguish one DI module from another.
    Most DI points have high impedance, thus minimizing the amount of current absorbed, and so have a relatively minor effect on the power distribution system.
    Each digital input point can be thought of as a lamp, one that is either on or off. DI modules can be electrically isolated point to point, or they can be grouped by internally bussing the I/O common.
    Most modules today are grouped, as grouping allows for higher density. As we have seen, point densities of up to 32 points per module are common in the grouped configuration.
    The below Figure shows two different DI modules. The first module internally busses the DC(+) side of the circuit. The I/O point then passes power to the field device.
    This type of module is called a sourcing module. This configuration is unusual. Switching the common side in the field is typically not done.

    If the module internally busses the DC common side of the circuit, then the module is considered a sinking module.
    The I/O point completes the path to DC common. This configuration is used in the vast majority of cases because it allows each I/O point to be individually fused near the power supply before power is distributed to the field device.
    In either case, the current flows in the same direction through the field-mounted switch.
    d. Digital Output (DO) Circuits
    Relay contacts are considered output devices because they force other devices to react when they change state. PLC digital outputs can be thought of as relay contacts.
    In many cases, that is just what they are. In others, the switching element may be a solid-state device of some sort. Even in that case, the relay analogy works as long as the designer remembers to consider leakage current.
    DO modules switch voltage on and off to cause an external device to change state. These modules are either “isolated” or “non-isolated.” If a module is non-isolated, then it is either sinking or sourcing.
    1. Isolated DO Circuits
    An isolated DO circuit is one in which the power source can be isolated between I/O points. The source is not internally bussed. The cost is two terminals per point, so it is expensive.

    There are three sources of wetted power, with points 1, 2, 4, 5, and 6 being isolated from point 3 and points 7 and 8.
    In this example, AC is being fed to Point 3, while DC signals are on the remaining points. Doing this demonstrates the possibilities. In practice, it is a good idea to separate AC and DC signals if at all possible.
    2. Non-isolated DO Circuits
    As with the DI PLC module, point density is an important feature of DO modules. As can be seen in the isolated module in Figure, isolation comes with a price.
    A 16-terminal module has a point density of only eight since two terminals are needed per point. By internally bussing a common, the point density can be improved dramatically.
    However, the result is a non-isolated module that places limits on the designer. Power sources must be managed. In most cases this is not a problem since extending PLC I/O power to the field device is feasible.
    However, if a field device must source its own signal, then an interposing relay must be added to the circuit to provide isolation.

    The above Figure shows two different digital output modules. The first internally busses the DC(+) side of the circuit. The I/O point then provides a path to power, making it a sourcing module.
    If the module busses the DC common side of the circuit, as shown in Above Figure, Example 1, then the module is considered a sinking module. The I/O point completes the path to common.
    This type of module is rarely used today due to the common-side switching. Example 2 is far more common, as it puts the switching action ahead of the load in terms of current flow.

    leikang
    Write the PLC program to control multiple pumps using programmable logic controllers. We have two input pumps used to fill a tank. Make sure pumps operate in an equal amount of time over their lifetime.
    Multiple Pumps Control using PLC

    Program Logic:
    Develop ladder logic program according to the logic given below,
    The start/stop push button is provided for control of the two input pump motors P1 and P2. The Start/Stop pushbutton station is operated to control pump P1. When the tank is full drain pump motor P3 is started automatically and runs until the low-level sensor is actuated. After 3 fillings of the tank by pump P1 control automatically shifts to pump P2. The operation of the start/stop pushbutton now controls pump P2. After 3 fillings of the tank by pump P2, the sequence is repeated. PLC Program:


    Program Description:
    Rung 0000:
    Start/Stop PB latched with memory B3:0/0.
    Rung 0001:
    B3:0/0 enabled to turn on B3:0/1 which is to turn ON PUMP P1 (O:0/0) when low-level sensor(I:0/3) turn ON and High-level sensor (I:0/2) is in off condition.B3:0/1 is latched with low-level sensor because pump p1 should not go off once water started rising.
    Rung 0002:
    Memory contacts used to turn on PUMP P1 (O: 0/0) with counter (C5:0).
    Since we are going to shift pump operation from P1 to P2, two counters are used to shift between Pl and P2.
    Counter C5:1 is used to turn on PUMP P2(O:0/2).
    Rung 0003 & 0004:
    B3:0/0 enabled to turn on B3:0/2 which is to turn on PUMP P3(O:0/1) when high-level sensor(I:0/2) turn ON and low-level sensor (I:0/3) is in off condition.B3:0/2 is latched with high-level sensor because pump p3 should not go off once water started reducing.
    Rung 0005:
    When Pump 3 (O: 0/1) is running, the low-level sensor turns on will make Pump p3 off and pump P1(O:0/0) ON.
    Rung 0006:
    Both Counter reset is done once the second counter (C5:1) done bit turns ON.
    Conclusion:
    We can use this example to understand the programming logic in AB PLC.

Apply for friendship links:WhatsApp or E-mail: admin@plchmis.com
×
×
  • Create New...