Loading documents preview...
CE123 PLC Trainer
User Guide
© TecQuipment Ltd 2013 Do not reproduce or transmit this document in any form or by any means, electronic or mechanical, including photocopy, recording or any information storage and retrieval system without the express permission of TecQuipment Limited. TecQuipment has taken care to make the contents of this manual accurate and up to date. However, if you find any errors, please let us know so we can rectify the problem. TecQuipment supplies a Packing Contents List (PCL) with the equipment. Carefully check the contents of the package(s) against the list. If any items are missing or damaged, contact TecQuipment or the local agent.
PW/DB/bs/1013
Contents Section 1
2
Page The CE123 PLC Trainer
1
1.1 1.2 1.3 1.4
1 3 6 7
Fundamentals of Programmable Logic Controllers 2.1 2.2 2.3
3
4
5
6
Introduction Description Input Channel Specification Output Channel Specification
Introduction Logic Instruction Sets and Ladder Logic The CE123 Programmable Logic Controller Features
9 9 9 12
Ladder Logic Programming
15
3.1 3.2 3.3 3.4
15 17 17 19
Aspects of Logical Programming Sequential Procedures Combinational Logic Sequence Control
Connection and Test of the CE123
21
4.1 4.2 4.3 4.4 4.5 4.6
21 21 21 22 23 24
Basic Connections to the CE123 PLC Trainer CE123 Mains Supply Connecting a PC to the CE123 Installation of the CE123 PLC Programming Software CE123 Operation Checks The CE123 PLC Trainer Programming Software
Experiments
27
5.1 5.2 5.3 5.4 5.5 5.6 5.7
27 27 29 33 35 37
Introduction Setup Experiment 1: Familiarisation and Simple Programming Exercise Experiment 2: Logic Operations in Ladder Logic Experiment 3: Timers, Counters and Monitoring Experiment 4: Editing and Adding Comments to a PLC Programme Experiment 5: More Ladder Special Instructions Master Coils SET, and RESET
Results
41
45
APPENDIX A: Useful Textbooks
47
APPENDIX B: Decimal/Octal Conversion Table
49
SECTION 1.0 The CE123 PLC Trainer 1.1
Introduction
The CE123 Programmable Logic Controller (PLC) Trainer is one of a range of TecQuipment bench mounting modular units designed to practically investigate the basic and advanced principles of control engineering. The fundamentals of Programmable Logic Controllers (PLCs) and their operation are outlined in Section 2 of this manual which details the basic layout and panel features of the CE123. Section 3 discusses programming PLCs and their usage whereas Section 4 deals with the practicalities of connecting devices to the PLC and the mechanics of programming the controller. Section 5 gives a progressively more complex experiment set designed to teach the basics of PLCs and their programming plus the more advanced features of the CE123. The controller and associated documentation are devised to give the student an overall grounding in PLCs and leave them keen to investigate the usage of PLCs further. The CE123 PLC Trainer can be programmed from a personal computer (with the correct software) and connected to the CE111 PLC Process. TecQuipment fit a special connector cable to link the CE111 to the CE123. Note: The CE111 and CE123 are use with each other. TecQuipment cannot support the equipment if you use it with other non-TecQuipment manufactured hardware. All input and output channels to and from the CE123 are low power logic level ports for use with the CE111 only and the relevant sections in this manual need to be read before any connections are made. The experiments provided with each of the apparatus in the CE range start with investigations into the characteristics of the transducer and drive circuits. As a circuit becomes more complex, with these circuits being interconnected, the student has less difficulty in understanding the combined, overall, performance. In the same way, it is recommended that the student spends some time investigating the functional abilities of the CE123 so that the use of Programmable Logic Controllers and their abilities can be understood. This will enable the students to envisage other control applications and strategies as well as to appreciate the complex, combined, system more readily. Note: Throughout this manual, there are references to the CE123 programming software, supplied with the apparatus. Refer to the Software Manual for full details on the software, as in most modern software, the manuals for the software are usually found on the same disc that contains the software. The Programmable Controller’s Programming Manual (supplied) gives details of the controller.
Page 1
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 2
CE123 Programmable Logic Controller
1.2
TecQuipment Ltd
Description
Figure 1 The CE123 Programmable Logic Controller The CE123 Programmable logic Controller, shown in Figure 1, is a bench mounting modular instrument comprising of an industrial PLC, an input section, an output section, a serial port connector, a run switch, a fuse holder and power supply switch. The run switch is at the back of the instrument. The front panel layout of the CE123, shown in Figure 2, has been designed to provide a logical and, hence, easy to use item of laboratory equipment coordinated with the rest of the CE range. Each of the individual sections and elements are represented and accessed on the front panel in appropriately labelled functional blocks. The legends clearly detail the purposes of the circuits. The symbols used conform to international standards and also correspond to those used in this manual.
Page 3
CE123 Programmable Logic Controller
TecQuipment Ltd
Input Section
Industrial PLC Section
Output Section
{
{
{
{ { Serial Port Section
Power Switch Section
Figure 2 Front Panel Layout On the CE123 front panel are 2 mm sockets that give access to the input and output signals. All sockets are internally protected against short-circuit and overload. The front panel of the CE123 is functionally divided into 5 distinct operational areas as indicated in Figure 2. These are explained in detail in the following sections. Input Section
The input section has eight channels, labelled X0 to X7, each consisting of a socket and switches to set either the logic level input to the PLC, or connect the socket directly to the PLC input.
Socket Status Indicator
Logic '0' Override
X0
Input Socket
Socket Enable
Logic '1' Override
Figure 3 Input Channel X0 Figure 3 shows the elements of input channel X0 which is similar to the other input channels. The panel on the left relates to the socket and its connectivity to the PLC input whereas the panel on the right relates to overriding the input socket and setting the logic level of the relevant PLC input channel, in this case X000. All of the switches in the Input section have an integral LED to indicate connectivity of the input and the logic override states.
Page 4
CE123 Programmable Logic Controller
TecQuipment Ltd
The left-hand panel of each input channel has a socket labelled with its programming address (X0 - X7), a LED to indicate the logic status of the socket and a push-switch to connect the socket directly to the PLC. The right hand panel has two switches which disconnect the input socket from the PLC and set the relevant PLC input channel status to either LOW or HIGH. This is denoted by 0 or 1 on the legend at the top of the respective section. All of the switches on the input section have a prioritising action - if any are activated then any other on that particular input channel is deactivated. The Input section utilises negative logic, a 0 Volt connection to the socket generates a logic HIGH or 1. I/O Industrial PLC Section
An industrial quality PLC with I/O LED status indicators is represented on the CE123 front panel (see Figure 2). Figure 4 shows schematically the primary components of this section of the CE123. The LED's indicate the logic status of the input and output channels down the left and the right-hand sides of the panel. The controller is a modern industrial unit that is programmed by an IBM PC (or 100% compatible) using the supplied software. The PLC, in keeping with many industrial controllers, is multi-functional, and its capabilities are described fully in subsequent sections of this manual.
X0
Y0
PLC
X7
Y5
Figure 4 The PLC Section Output Section
The CE123 Output Section consists of six channels, labelled Y0 to Y5, and is similar in operation to the Input Section. Figure 5 shows the layout of one output channel, Y0, all other channels being the same. The LED situated next to the socket indicates its logic status and the adjacent switch when pressed sets the sockets connectivity to the relevant PLC output channel. The two switches in the left hand panel override the PLC output and set the logic status of the output socket to either High, logic 1, or LOW, logic 0, (as indicated by the legends at the top of the panel). The output circuitry corresponds to negative logic whereas a logic High or 1 results in an output voltage of approximately 0.7 Volts.
Logic '0' Override
Socket Status Indicator
Y0 Logic '1' Override
Socket Enable
Figure 5 Output Section Y0
Page 5
Output Socket
CE123 Programmable Logic Controller
TecQuipment Ltd
Serial Port Section
The serial port provides the connection to the host PC to program the PLC from the software supplied. The lead supplied with the CE123 is for connection between the CE123 front panel serial socket (see Figure 6) and the serial port of your personal computer (PC). Connect the lead before switching on the PC and the CE123.
IMPORTANT
Only use the special serial lead supplied with the CE123, it contains some built-in electronic components. Do not use any other lead.
Figure 6 The 25-Way Serial Port Female Connector Power Switch Section
The main power switch and mains fuse holder are located in the Power Switch Section. On power up of the CE123 the program last transferred to the RAM of the PLC is currently active. Battery backup information and details of memory retention time without power-up can be found in the Controller Hardware Manual (supplied with the CE123). Programme Run Switch
The program in the PLC will not run unless the run switch is on. To stop a PLC program running, switch the run switch off. The run switch is on the back of the CE123.
1.3
Input Channel Specification
(a) Switch
+5V
Switch NO/NC
Input socket To PLC
(b) Relay
+5V
Input socket Relay NO/NC +Vc (or 0V)
Figure 7 Input Switches and Relays
Page 6
To PLC
CE123 Programmable Logic Controller
TecQuipment Ltd
There are 8 input channels accessed on the front panel via 2 mm sockets, (refer to Figure 2), designed to be held HIGH or pulled LOW to ground or accept logic inputs. The CE123 input circuits are implemented as common emitter inputs, the supplied input driving the transistor base. Conventionally the inputs are controlled by switches or relays (as shown in Figure 7).
1.4
Output Channel Specification
There are 6 output channels accessed on the front panel (see Figure 2 and Figure 5) designed to drive relays or logic circuitry. The output circuitry of the CE123 is common collector configuration. Conventional connectivity of an output channel to a relay is shown in Figure 8.
+V
To Device
Output socket +Vc Relay NO/NC From PLC
Figure 8 Connection of an Output Channel to a Relay
Page 7
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 8
SECTION 2.0 Fundamentals of Programmable Logic Controllers 2.1
Introduction
Programmable Logic Control was mainly devised to enable hard wired relay and timer logic networks to be replaced by a readily changeable controller capable of carrying out the same functions as the existing networks. This was brought about by the fact that hard wired relay control networks were often complex and alteration of the logic program was difficult, time consuming and costly. The advent of the microprocessor enabled logic networks to be developed in software which controlled outputs lines in response to the state of input lines. The use of a microprocessor in such a manner resulted in easily programmable and changeable logic networks and has evolved into the modern day programmable logic controller. The essential structure of a programmable logic controller consists of an input network, an output network and a microprocessor or CPU. The on-board processor monitors the inputs and sets the outputs according to some program stored in it's memory, which is either dynamic or some form of ROM. The inputs monitor process conditions and are usually connected to devices such as switches (limit, push etc.) or auxiliary contact networks. The activation of the switch by some means, a limit switch for instance, changes the logic level on the input channel to which it is connected. The processor monitors the status of the input channels and sets the output channels according to logic rules defined in the control program. The processors have the ability to make logical decisions, implement time delays and indeed all the functions previously encountered in hard wired relay logic networks. Typical output devices are indicators, relay coils, and solenoids and therefore the I/O ports of the CE123 are digital, as indeed are most industrial PLC's, and not power sinks or sources. Hence a logic HIGH or LOW on an input line controls the relevant output(s), setting them HIGH or LOW, according to the programmed logic. Some PLC's are modular in nature and can have units added capable of carrying out complex functions and delivering power to other units. Essentially these complex facilities are dedicated units which interface to the same logic status I/O ports of a standard PLC. It is indeed a fact that a standard PLC can be used to control a highly complex process with a little ingenuity and dedicated circuitry. Industrial controllers often consist of a basic unit (I/O, memory and processor) which has been programmed to replace a hard wired panel. The programming having been carried out by a clip-on module, a central computer system or some form of PC. Applications can demand that the program is essentially hardware and thus a ROM or a variant such as an EPROM will be used. The modern PLC therefore results in a highly flexible control system as opposed to a system controlled by a relatively unchangeable (without ease and minimum interruption of the process) hard wired logic network which is electrically complex to maintain.
2.2
Logic Instruction Sets and Ladder Logic
Ease of use and understanding are essential for any PLC programming language and therefore a high level language has evolved with instructions inherently close to the functions required by a control engineer. Ladder logic programming has become the most common PLC programming language and is introduced in this section along with a brief introduction to logic instruction sets. A simple introduction to ladder logic is given by the following example. Figure 9 shows schematically an electrically powered pump activated by a switch dependent upon the condition of a float switch and overload relay. The pump will run if the switch is activated, there is enough fluid in the tank and the overload switch is set and will keep running if all of these conditions continue to be met. This system can be represented as components connected in series between two power rails as shown in Figure 10. By replacing the standard component symbols with other simpler symbols the system can then be further reduced and represented as a ladder diagram. Figure 11 shows the ladder diagram for this system along with the standard symbol key for the elements in this circuit.
Page 9
CE123 Programmable Logic Controller
TecQuipment Ltd
Overload Relay Pump
On/Off Switch
+V
Float Switch
Figure 9 Pump Schematic
+V
On/Off Switch
Float Switch
Pump
Overload Relay
-V
Figure 10 Pump Circuit in Series Layout
X0
X1
X3
Y0
Relay Logic Symbols:
Input, Normally open contact pair (eg. the On/Off switch) Input, Normally closed contact pair (eg. the float switch & Overload relay) Output device (e.g. the pump motor)
Figure 11 Ladder Diagram of Pump Circuit Ladder diagrams can be used to represent logic control systems and can become more complex as the complexity of system represented increases. Figure 12 shows three examples of ladder diagrams which should hopefully indicate to the reader the inherent simplicity of logic ladder diagram representation. Figure 12(a) represents a system that comprises of a motor, Y0, which will only operate if switch X2 (normally open) has been closed and switch X1 (normally closed) has not been triggered. Figure 12(b) represents a system comprising of an output device, Y0, which will operate if either of two normally open switches, X1 or X2, are closed.
Page 10
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 12(c) shows a more complex diagram explained thus: output Y2 will be turned on if the contact pair X1 are closed. Output Y1 is controlled by the state of switches X0 and X2 only being activated if X0 is closed and X2 is not opened. Finally outputs Y0 and Y3 will be turned on, set HIGH, if either switch contact pairs X3 or X4 are closed. The lines of a ladder diagram are known as rungs such that in the previous examples, Figure 12, diagrams (a) and (b) have two rungs whereas (c) has four. The input and output channels and various simulated devices are addressed and numbered, according to industrial convention in octal. Thus for the CE123 the inputs are addressed as X0008 through X0078 and the outputs Y0008 through Y00581. The inputs can either be physical or simulated and due to their nature are referred to as contacts of two types, either normally open or normally closed. The outputs are conventionally connected to relay coils and therefore can be categorised as coils, whether physical or simulated, and if activated they are considered to be turned on.
X2
(a)
X1
Y0
X7
(b)
Y0
X6
Y2
X1
X0
Y1
X2
(c)
Y0
X3
X4
Y3
Figure 12 Ladder Diagram Examples There are however, programming tricks to alter the functionality of the basic relay types. At this stage to introduce the features and functions of the CE123 it is understood that a ladder diagram is executed a rung at a time, and although this is not strictly true, it will aid the understanding of the concepts of programmable logic controllers and their functionality. 1.
(The subscript indicates the number base (ie 8 for Octal) and is omitted if there is no ambiguity with the denary number).
Page 11
CE123 Programmable Logic Controller
TecQuipment Ltd
To program a PLC, in real terms, a low level language similar to assembler is used, however, instruction sets tend to be small and thus relatively quick and simple to learn. PLC's can be programmed either with a sequence of op-codes derived from a ladder diagram and the relevant logic instruction set or via a graphical user interface. The software package supplied with the CE123 allows the controller to be programmed via a graphics language thereby removing the necessity to use low level code. The software thereby allows the PC to be utilised as a graphical user interface enabling the user to enter and run programs using standard logic symbols. This makes the CE123 an ideal teaching aid as it reduces the complexity of PLC programming. However, the student should be made aware of the fact the software interprets the ladder diagram and implements low level code in the controller, and to help understand this, the software supplied with the CE123 also shows the low level code (in STL/SFC form). The logic instruction set is particular to the manufacturer of the PLC and hence is not standardised. There is, however, a close similarity between different products. (Typical instruction sets are listed in the book by Warnock - see the references section of this manual).
2.3
The CE123 Programmable Logic Controller Features
The particular features of any PLC are essentially based around the same configuration as previously outlined in this manual. However, PLC's are extremely varied in their capabilities, the basic functionality criterion being the number of I/O ports, the processor speed, and the size of the users RAM. Full categorisation is achieved by examining a particular PLC's advanced features such as its processor, cycle time, function, language facilities and expansion capability amongst others. The main internal functional features of the CE123 are discussed in the following sub-sections and the ladder diagram symbols are given in Table 1. Our aim here is to give an overview. For a full description of all the CE123’s features, read the Mitsubishi software manual and programming manual supplied with the CE123.
Instruction
Symbol
Contact (normally open)
Contact (normally closed)
OR contact (normally open)
OR contact (normally closed)
(
Coil
Special coil (allows instruction to be executed)
Table 1 Ladder Diagram Symbols
Page 12
)
CE123 Programmable Logic Controller
TecQuipment Ltd
Inputs, Outputs, Timers and Internal Flags in PLCs
The symbols shown in Table 1 represent devices in the PLC. These devices are actuated by or act upon variables associated with the PLC hardware. These variables are shown in Table 2. All the variables are logical, and take values either OFF (logical 0) or ON (logical 1).
X
This is used to represent the physical inputs to the PLC. There are 8 physical inputs to the CE123 addressed as X0 to X7.
Y
This represents the physical outputs of the PLC. There are 6 physical outputs to the CE123 addressed as Y0 to Y5.
T
This represents a timing device in the PLC. There are 64 timers in the CE123 addressed as T0 to T63. The CE123 timers are set in units of 0.1. second, but can be reprogrammed.
C
This represents a counting device in the PLC. There are 32 counters in the CE123 addressed as C0 to C31.
M and S
These are used to represent internal operational flags in the PLC. There are 512 M flags and 128 S flags in the CE123.
Table 2 Variables Used in the Hardware Contacts
Contacts shown in Table 1 are the input devices in a ladder diagram. They are opened and closed by either externally applied signals (X), internal timers (T), counters (C), or internal flags (M and S). As shown in the table, contacts are available in several forms. The first two rows of Table 1 show the basic forms (normally open and normally closed). The OR Contacts are simple ways (as will be seen later in the programming) for connecting a contact across (in parallel with) another device. Coils
Coils shown in Table 1 are the output devices in a ladder diagram. They are used to operate external outputs, timers, counters and internal flags. The special coil shown in Table 1 allows special operations to be performed which extend the capability of the PLC far beyond that which can be obtained with just the simple coils and contacts. The following instructions are given through the special coil feature. Master Control (MC) and Master Reset (MCR)
A master control block is a set of ladder programmes which is executed when an input device is activated. The end of a master control block is marked by the master reset instruction. Master blocks are used when a specific set of actions must be executed when a particular input is activated. Master blocks can be put inside other master blocks. This is called nesting of the blocks. Set (SET) and Reset (RST) Devices
These instructions are used to permanently set or reset an output device when a designated input is set. The output device holds the given value even if the input device state is changed. Reset (RST) Timer or Counter
This instruction resets a designated counter or timer. Any output device set by the timer will also be reset. Pulse Rising Edge (PLS) and Pulse Falling Edge (PLF)
This instruction sets a designated output device for one cycle when either a rising (PLS) or falling edge (PLF) is detected from an input device.
Page 13
CE123 Programmable Logic Controller
TecQuipment Ltd
End (END)
The end instruction forces the PLC programme to end its current scan at the ladder rung that contains the end statement. When the end statement is met the programme begins again from the first instruction. This is useful for programme debugging. Other Instructions
The CE123 PLC is capable of a wide range of special instructions. The ones given above are the most commonly used. A full list of available instructions is given in the Contoller Programming Manual.
Page 14
SECTION 3.0 Ladder Logic Programming This section of the manual details programming a PLC using ladder logic. The emphasis is with regard to the CE123. The CE123 is programmed via a PC using a graphical user interface enabling the user to 'lay-down' standard ladder logic symbols, as shown in Section 2 of this manual, to generate a program. Understanding of the steps necessary for the CE123 to execute a program is important to enable the student to confidently use the PLC. The essence of the programming sequence is outlined here using screen shots from the CE123 programming software. When the program is then 'run' the program counter is set to the start address of the program and the first instruction is read from the memory location referenced by the program counter. The instruction is interpreted, converted to an opcode, and executed. The program counter is then incremented either to the next instruction address or elsewhere if the previous code dictates. The program counter holding the location of the next instruction is referenced and execution of the program continues. The program is executed in such a manner until the program is halted, or the execution of the program is complete. The CE123 PLC operates in a similar manner described as follows. The student develops a ladder logic program to carry out the intended task and enters it as a graphical representation utilising the software provided in to the PC's memory. Once the program is stored in the PC memory it is downloaded by the user to the PLC and is interpreted into logic instruction set codes and stored in the PLC memory. If the PLC is then RUN, the program is executed and the program counter incremented to the address of the next op-code. The execution of the program will continue until an END code is encountered, the RUN switch is turned off, or the PLC is turned off. A successful 'run' of a program constitutes one scan. Once the END code is encountered the program counter is reset to 0000 and program is scanned again, this process continuing until the program run switch is off.
3.1
Aspects of Logical Programming
The CE123 is capable of undertaking many complex logical tasks. The basic functions of the PLC can be utilised in many combinations to produce other functions. This section and its sub-sections are intended to highlight the flexibility of PLC's programmed using ladder logic and encourage the reader to investigate further the power of Programmable Logic Controllers. Boolean Operators
It is possible to simulate Boolean algebraic operators utilising a combination of the in-built solid state relay symbols as logic gates. If two normally open relays are placed in series as shown in Figure 13(a) then a signal will only be passed through them if both relays are switched simulating the Boolean operator AND. Likewise two switches in parallel is the same as the Boolean OR, see Figure 13(b). Negation of the standard functions can be implemented using normally closed as opposed to normally open contacts, see Figure 13(c) NAND and Figure 13(d) NOR. Exclusive-OR (EX-OR) is achieved using the network outlined in Figure 13(e).
Page 15
CE123 Programmable Logic Controller
TecQuipment Ltd
X1
X2
(a)
Y0
AND
Y0
OR
Y0
NAND
Y0
NOR
Y0
EX-OR
X1 (b) X2
X1
X2
(c)
X1 (d) X2
X1
X2
(e) X1
X2
Figure 13 Boolean Logic Ladder Diagrams Associated Contacts
Figure 13(e) shows an example of associated contacts whereby both inputs X1 and X2 have two contacts in the circuit. All real and simulated functions can have as many associated contacts as necessary. It is also possible for outputs to have associated contacts, Figure 14 is an example of a circuit with associated input and output contacts.
X0
X1 Y0
Y0 Y1
Y2 X0
Figure 14 Circuit with Associated Input and Output Contacts
Page 16
CE123 Programmable Logic Controller
TecQuipment Ltd
Latches
The implementation of latch circuits, akin to solenoid/relay hold coils, can be achieved using associated contacts generating a self-maintaining circuit. Figure 15 shows such a circuit, if input contacts X001 are closed so as to power output coil Y001 then, regardless of the state of input contacts X001, output Y001 will remain active until input contacts X002, normally closed, are opened. This set up generates a latched output coil with the ability to be reset.
X1
X2 Y1
Y1 Figure 15 Latch Coil
3.2
Sequential Procedures
All industrial processes can be broken down into logical blocks or sequences. The outputs of sequential procedures may be dependent on previous events and thus memory facilities may be needed. The sequential blocks may then be analysed separately and program segments developed and finally combined to generate the complete program. As an example of breaking down a system into sequential stages consider a simple assembly of two components. The two different components are mixed together and are checked by some criteria and a different sequence of actions taken dependent upon the result of that check. First the different components loaded in bulk on the same conveyor are sorted by some sensory means and gates operated to route the two types to two different locations for assembly. Secondary quality checks are carried out once the components are sorted and again separate sequences activated based on the secondary checks (i.e. pass :- let through, fail :- knock off track into recycling bin). Once the components have arrived at the assembly area, a knowledge of the number of components queued up (or not) is required to prevent overflow and/or damage of the components. Therefore it is necessary to keep a check of the numbers of each component into the assembly zone as well as those that have gone through. Passage through the assembly zone however does not dictate successful assembly so a record of components out, assembled or not, is also necessary. It can be seen that the whole process described above can be broken down as a number of sequence blocks. The activation of some sequential blocks will be based on simple checks where as others are more complex and are dependent upon the past history of the whole process. To develop a logic controller program for the whole process it will need to be broken down into the sequential blocks and a ladder logic program developed from the knowledge gained.
3.3
Combinational Logic
Combinational logic is used where an output is dependent upon a combination of contacts at the same instance in time. As discussed earlier, it is possible to use combinations of output coils and input contacts to implement the standard Boolean operators. A extension to this is to use combinations of the standard functions to simulate expressions and effect combinational logic control. As a simple example imagine a system consisting of three input switches numbered X000, X001 and X002 whose states dictate and control the output Y001.
Page 17
CE123 Programmable Logic Controller
TecQuipment Ltd
Float Switch
Safety Switch
On/Off Switch
X000
X001
Normally Closed
Pump Y001
+V
X002
Figure 16 Pump Circuit
X000 X001
Y001
X002 Figure 17 Logic Diagram
X000
X001
X002 Y001
Figure 18 Ladder Diagram For example, with reference to Figure 16, switch X000 is a normally open safety device, X001 is a normally open activation switch, X002 is a normally closed level switch and Y001 is an output device such as a pump. The logical rule expressed verbally to control the output is as follows; Y000 is on if X000 and X001 are operated and X002 is not operated. Expressing this in Boolean terms gives Y001 = X000.X001.X002 Figure 17 shows the logical elements using standard symbol for this expression and Figure 18 the related ladder diagram. The previous example is a simple one but shows the breakdown of a system into a Boolean logical expression and the generation of a ladder diagram. A more complex system can be built up by analysing it in Boolean algebraic terms and reducing the resultant equations. The system can then be controlled by a combination of the standard gates/operators described earlier.
Page 18
CE123 Programmable Logic Controller
3.4
TecQuipment Ltd
Sequence Control
Sequential control is ideally suited to PLC's in conjunction with combinational logic and the in-built redirection functions such as the master control relay, shift register and step-sequence. The control of a process by sequence is ideally suited to processes that can be described verbally and broken down into easily defined sub-sections. This description can then be represented as a flow chart, algorithm or other suitable means. Identification of the sequential blocks and conditions should then be fairly easy. Once broken down into smaller blocks segments of the main program can be developed from Boolean expressions representing each state of the process. Once the process expressions have been developed conversion to a ladder diagram is then straightforward. Implementation of sequential control is relatively easy on the CE123, either using the ladder logic programming tool or the STL programming language. This manual concentrates on the ladder logic approach since it is generally accepted as the industry standard.
Page 19
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 20
SECTION 4.0 Connection and Test of the CE123 This section of the manual deals with the uses and implementation of the CE123 PLC Trainer with regard to connection requirements, developing ladder logic programs using the software supplied, and operating the CE123.
4.1
Basic Connections to the CE123 PLC Trainer
The mains power is supplied to the socket on the rear panel of the CE123, shown in Figure 19. The back panel 7-way cannon type connector provides low voltage power connections for the CE111.
T1.6A
Mains Voltage Inlet
Fuses
Outlet for Connection to the CE111
Figure 19 Rear View of CE123
4.2
CE123 Mains Supply
The internal power supply for the CE123 is a wide voltage range (universal) unit that operates from any voltage from 85 VAC to 264 VAC. It is fused at 1.6 A for 230 VAC operation and 3.15 A for 115 VAC operation.The main fuse is on the front panel next to the power switch. The two 1.6 A fuses on the rear of the CE123 are the DC supply fuses for the CE111.
WARNING
4.3
Connect this apparatus to the electrical supply with the cables supplied. Brown Wire = Live Blue Wire = Neutral Green/Yellow Wire = Earth This apparatus must be connected to earth.
Connecting a PC to the CE123
A special lead is supplied to connect the CE123 to a computer. This lead includes some built in electronic components that convert the RS232 data of the computer to the format needed by the controller. The software supplied requires a suitable PC to run. Before you connect the CE123 to a computer, turn both units off and connect the serial lead. Then switch on the CE123 and the computer.
Page 21
TecQuipment Ltd
To COM Port
CE123 Programmable Logic Controller
Figure 20 Connection Diagram for the CE123 and PC
4.4
Installation of the CE123 PLC Programming Software
The installation of the software is dependent upon the licensing agreement between the end user and TecQuipment. Software Registration
The program is supplied on a compact disk (CD) under the conditions specified in the software package. Installation of the Software
To install the software onto the hard disk of a PC, read the instructions supplied on the CD, which will automatically run when inserted into the CD drive. You will install the GX-Developer-FX software. When the installation is complete, restart your computer. A new program titled ‘MELSOFT application’ will be added to your program list.
Page 22
CE123 Programmable Logic Controller
4.5
TecQuipment Ltd
CE123 Operation Checks
The state of the CE123 when first powered up will be dependent upon the contents of the internal RAM. The previous programming will be retained due to the RAM being backed up by an internal battery. Use the experiments listed in Section 5 to check the functionality. To Check the INPUT Panel Operation
When the CE123 is first switched on it should be in EXTERNAL mode, with only the LEFTMOST column of the input panel amber switch LEDs lit, and the LEFTMOST LEDs on the centre panel (14 I/O INDUSTRIAL PLC) should be off. If this condition does not exist remove all connections to the input panel sockets. Check that when an input panel logic '1' switch is pressed the amber switch LED is lit and the corresponding red LED on the leftmost side of the PLC panel is also lit. Check that when the associated logic '0' switch is depressed the amber switch LED lights and the PLC panel LED is extinguished. Repeat for all 8 input channels. Checking for isolation between inputs can be carried out by setting all inputs to a logic '1' and then switching each of the separate inputs momentarily to logic '0'. Setting any input to logic '0' or '1' should not have any effect on any other inputs logic state. To Check the OUTPUT Panel Operation
With the CE123 in EXTERNAL mode only the RIGHTMOST column of the output panel amber switch LED's should be lit and the all RIGHTMOST LED's on the centre panel (14 I/O INDUSTRIAL PLC) should be extinguished. If this condition does not exist remove all connections from the front panel sockets and reset the CE123 (power down, leave for 30 seconds and power up again). Check that when an output panel logic '1' switch is pressed the amber switch LED is lit and the corresponding red LED on the rightmost side of the output panel adjacent to the output socket is also lit. Check that when the associated logic '0' switch is depressed the amber switch LED lights and the output panel socket LED is extinguished. Repeat for all 6 output channels. Checking for isolation between inputs can be carried out by setting all outputs to a logic '1' and then switching each of the separate outputs momentarily to logic '0'. Setting any output to logic '0' or '1' should not have any effect on any other outputs logic state, the corresponding LEDs showing the channel status.
Page 23
CE123 Programmable Logic Controller
4.6
TecQuipment Ltd
The CE123 PLC Trainer Programming Software
The menu driven software package supplied with the CE123 allows the student to: •
create and edit ladder diagrams
•
download and upload ladder diagrams to and from the PLC
•
load and save ladder diagrams to and from disk
•
add comments to aid ladder diagram clarity
•
monitor ladder diagrams in the PLC
•
print ladder diagrams and comments
The software allows PLC programs to be constructed in one of three forms – (1) ladder diagrams, (2) a PLC assembly language (instruction) and (3) STL/SFC form. The ladder diagram approach is the most widely accepted way of programming PLCs and so this manual will concentrate upon ladder diagram methods. The Mitsubishi PLC assembly language (code) and STC/SFC language are described in the FX Series Programming Manual. The use of the programming software is fully described in the Software Manual. The description given here is an overview of how to use the software to create ladder logic programmes. The FX programmable logic controller works within MS Windows environment. To launch the software select Start Programs - MELSOFT application - GX Developer-FX. The programme operates as described in the following sections. Main Screen
Figure 21 The Start Up (Main) Screen This is the screen shown on start up. The Project menu drop down list allows the user to either open an existing project or start a new project. The icon short cuts can also be used for this purpose. If a new project is selected then the PLC series and type setting window opens. Select PLC series FXCPU and PLC type FX1S. Select Ladder as the program type, and click the OK pushbutton. A blank ladder diagram will now appear on the screen together with toolbars of ladder symbols, this toolbar can be dragged to any place on the screen as shown in Figure 22. Compare the ladder symbols with the set of ladder logic components shown in Figure 12.
Page 24
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 22 A New Empty Ladder Diagram Showing the Ladder Symbol Toolbar (dragged to middle of screen). Building a Ladder Logic Diagram
A ladder logic diagram is built on the new empty diagram by (a) positioning the device position cursor at the desired location on the current ladder line, (b) selecting the desired device from the ladder symbol toolbar and, where appropriate, (c) labelling the new device in the enter symbol dialog box (shown in Figure 23).
Figure 23 Enter Symbol Dialog Box. When a symbol is selected, then an ‘Enter symbol’ dialog box must be completed (see Figure 23). Recall from section 2 that special coils are output devices that allow assembly code instructions to be executed within the ladder logic line. For example, Figure 24 shows a one-line ladder logic programme constructed by: (a) entering an external input contact X0, (b) moving the cursor to the right of the ladder line and (c) entering a special coil with an instruction which sets the internal coil M2. Notice that the cursor is positioned ready to enter a further line of the ladder logic. (Note that the set of instructions that can be used with special coils is given in the FX series programming manual)
Page 25
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 24 One Line Ladder Logic When a project has been completed it can be saved using the ‘Save as’ option from the Project drop down menu. The Save as dialog box allows the user to select the folder in which to save the project and requires a name to be given to the project. If you are just starting to use the software you will want to create a special folder for your project. Loading the Programme into the CE123 PLC Controller
To use the ladder logic programme with the CE123, it must first be converted into the equivalent assembly code programme. This is done by selecting the ‘Convert’ option from the menu. Now the converted programme can be transferred to the CE123. This is done by selecting the ‘Write to PLC’ option from the ‘Online’ menu. For the write option to work the CE123 must switched on, connected to the PC running the FX software, and the programme run switch must be switched off. If any of these conditions are not correct, then the software will declare a communications error and abandon the transfer. Once the programme has been successfully downloaded, then the programme can be started by switching the programme run switch on. To stop the programme, switch the programme run switch off.
Page 26
SECTION 5.0 Experiments 5.1
Introduction
The experiments included in this section are intended to provide a practical introduction to the features of Programmable Logic Controllers in general and to give the user a familiarity with the construction of Ladder Logic diagrams. To this end, the experiments are a series of self-contained exercises which together enable the user to build an overall understanding of programmable logic. These experiments may be used alone or they may be used as preparation for further practical work with the CE111 Programmable Logic Trainer. The experiments described refer to the use of the CE123 PLC Trainer Software. The CE123 uses a Mitsubishi FX Series Programmable Controller – refer to the Mitsubishi Software Manual if necessary.
5.2
Setup
For all experiments, set up the apparatus and start the software as follows: Place the CE123 PLC Trainer and a suitable PC onto a solid level bench. Allow room for a printer if required. Make sure that the PC and CE123 are turned off. Use the serial connector provided to connect the PC to the CE123 (as shown in Figure 20). Turn on the CE123 and the PC. Wait of the PC to finish loading its operating system. Click on the START icon and select MELSEC Application - GX Developer - FX from the Programs menu. When the software has initialised the Main Screen will appear as shown in Figure 25. Continue with the experiment procedure.
Figure 25 Main Screen
Page 27
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 28
CE123 Programmable Logic Controller
5.3
TecQuipment Ltd
Experiment 1: Familiarisation and Simple Programming Exercise
Object
To gain an understanding of the practical issues in programming and operating the CE123 and using the programming software. The programming task is simple – the aim is to get used to the CE123. Refer to Section 4 of this manual for reference when doing this experiment. Apparatus
CE123 PLC Trainer Personal Computer(PC) loaded with the CE123 PLC Programming Software. A printer may be needed to record results. Procedure Part 1. Set Up
See “Setup” on page 27. Part 2. Programming Task
The task is to programme the CE123 to carry out a simple task to set the output channels. Y0 to Y5, so that they follow the input channels X0 toX5. 1)
From the Project menu select New Project, then set the PLC series to FXCPU and the PLC type to FX1S. Select as the program type. This opens a new blank ladder diagram.
LADDER
2)
Create the ladder diagram shown in Figure 31. The following steps show how to enter the first row as a guide. a) Click on the coil button on the ladder symbol toolbar (or press F5). This will open an Enter symbol dialog box, enter X0 in the text window (as shown in Figure 26) and click OK. This will give an input coil labelled X0 at the left of the first rung of the ladder diagram, (Figure 27). b) Click on the horizontal line button (or press F9) to enter horizontal line segments until the cursor is positioned at the far right of the first ladder rung (Figure 28). c) Click on the output coil button (or press F7). Type Y0 into the ‘Enter symbol’ dialog box (Figure 29). Click on OK and the first line of the ladder diagram will appear as shown in Figure 30.
3)
Use the techniques given in step 2 to enter the complete ladder diagram as shown in Figure 31. Note that you have to choose the ‘open branch’ symbol (shift and F5) for the X7 input coil, underneath the X5 coil.
4)
For safety and future use, use the Save as option from the Project menu to save your project. Give it a name that you will remember and save it in a suitable folder.
5)
Convert the ladder diagram by selecting Convert.
6)
Switch the CE123 on, and set the Programme run switch (mounted on the back of the CE123 to off or stop. Now select ‘Write to PLC’ from the ‘Online’ menu. The programme will now transfer to the CE123 Programmable Logic Controller.
Figure 26 Enter Symbol Box
Page 29
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 27 Screenshot Showing the Input Coil X0 to the Left of the Rung
Figure 28 Screenshot Showing a Horizontal Line in Place
Figure 29 Enter Output Coil Y0
Page 30
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 30 Screenshot Showing the First Rung Completed
Figure 31 The Complete Ladder Diagram for a Simple Program Part 3. To Run and Test the Programme
To run the programme, switch on the Programme Run switch at the back of the CE123. The program should switch on output Y0 on when X0 is switched on, and so for Y1/X1to Y4/X4. Use the input switches on the CE123 panel to test this. The last line of the programme is arranged to demonstrate how AND and OR logic is done in ladder logic. Output Y5 will only switch on when X5 AND X6 are on OR when X7 AND X6 are switched on. Check this using input switches on the front panel of the CE123.
Page 31
CE123 Programmable Logic Controller
TecQuipment Ltd
Part 4. To Monitor the Programme
With the CE123 programme running select Monitor from the Online menu. The corresponding coils and contacts will be highlighted in the ladder diagram when the action is taken in the programme. For example, switching on X0 will switch on the output Y0. On the ladder diagram the contact X0 and coil Y0 will be highlighted. Part 5. Printing
Check that a printer is available and your PC can connected to it. Select ‘Print’ from the ‘Project’ menu. The ladder diagram will be printed out in the format specified under print options. Conclusions.
You should understand how the ladder diagram logic relates to the programme that is executed in the CE123. You should know that the ladder diagram is converted into a special set of logic instructions that are then converted in a machine code that can be loaded into the CE123 PLC. To see the logic instructions corresponding to the ladder diagram, select Instruction List from the View menu. Try to see the how the ladder logic relates to the instruction list (you may want to refer to the programming manual (section2) to help here).
Page 32
CE123 Programmable Logic Controller
5.4
TecQuipment Ltd
Experiment 2: Logic Operations in Ladder Logic
Objects
•
To implement OR and NOR statements in ladder logic.
•
To implement AND and NAND statements in ladder logic.
•
To implement an exclusive OR statement in ladder logic.
Apparatus
CE123 PLC Trainer Personal Computer(PC) loaded with the CE123 PLC Programming Software. A printer may be needed to record results. Procedure Part 1. Set Up
See “Setup” on page 27. Part 2. Programming Task: OR and inverse OR (NOR) statements.
The task is to programme the CE123 to switch the output Y0 to be set if X0 or X1 or inverse X2 are set. Enter the ladder diagram shown in Figure 32. Convert the programme, and write it to the CE123 as explained in experiment 1. Run the programme and check the logical OR and inverse OR (NOR) are obeyed.
Figure 32 Programming OR and inverse OR (NOR) Statements Part 3. Programming task: AND and inverse AND
Implement the logic diagram shown in Figure 33. In this the output Y0 is set if X0 AND X1 AND inverse X2 are set. Load the programme into the CE123 and check that the programme operates according to this logic.
Page 33
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 33 Implementing AND and inverse AND in a Ladder Diagram. Part 4. Programming Task: XOR
Enter the ladder diagram shown in Figure 34. In this the two inputs X0 and X1 implement an exclusive OR on the output Y0. Load the programme into the CE123 and check that the programme operates according to this logic.
Figure 34 An exclusive OR Ladder Diagram Implementation Conclusions.
Comment on the way in which logic is implemented with contacts and inverse contacts. Suggest a simple practical application where an XOR ladder programme could be used to prevent two events (sensed by two separate input contacts) from causing a third event (actuated by the output Y0) from happening.
Page 34
CE123 Programmable Logic Controller
5.5
TecQuipment Ltd
Experiment 3: Timers, Counters and Monitoring
Object
The object of this experiment is: •
To implement a timed sequence.
•
To implement a counter
•
To examine the operation of timers and counters
•
To use Monitor/Test features
Apparatus
CE123 PLC Trainer Personal Computer(PC) loaded with the CE123 PLC Programming Software. A printer may be needed to record results. Procedure Part 1. Set Up
See “Setup” on page 27. Part 2. Programming Task: Implementation of Timers and Repetitive Cycles.
The task is to programme the CE123 to switch the outputs in a timed sequence, monitor the outputs and examine the method of cycle repeating. Enter the ladder diagram shown in Figure 35.
Figure 35 Timer Sequence
Page 35
CE123 Programmable Logic Controller
TecQuipment Ltd
Convert the programme, and write it to the CE123 as explained in experiment 1. Run the programme, the output Y0 should come on immediately and then the outputs Y1 to Y5 should switch in turn at times fixed by the timer settings in the ladder diagram. Check this happens. The cycle repeats because of the use of timer T5 to actuate Y0 and the actuation of T5 from the last rung of the ladder. Check by replacing the timer T5 on the first rung of the ladder with input coil X0. When loaded into the CE123 the timing sequence will execute once when X0 is set. Part 3. Monitoring the Programme
Replace the X0 coil in the first rung with T5 and with the CE123 programme running select Monitor - Monitor Mode from the Online menu of the software. The corresponding coils and contacts will be highlighted in the ladder diagram when the action is taken in the programme. In particular the timer status will be shown on the ladder diagram so that status of the timers in the programme can be checked. Part 4. Programming Task: The Use of Counters
The task is to program the CE123 to switch Y0 AND Y1 on if X0 is turned on five times OR X1 is turned on twice. Input X2 is programmed to reset both counters if it is off or open Enter the ladder diagram shown in Figure 36 and save it in your own folder for future use.
Figure 36 The Use of Counters This ladder diagram introduces a use of special coils. The second and fourth rungs show special coils that implement the Reset instruction (RST), this resets the devices when the rung is activated. In this case counters C0 and C1 are reset when X2 is set to off or open. Convert and load the programme into the CE123 and check that it functions correctly. Part 5: Monitoring and Entry Device Monitoring
Select ‘Monitor’ from the ‘Online’ menu to see the state of the counters monitored on the ladder diagram. Select Online Monitor - Device batch to see a record of the counters (C) and timers (T). Conclusions.
Comment on the way in which timers work and explain how the repetitive cycle operates. (Note that there are a number of ways of making a programme cycle repeat). Comment on how counters work and suggest ways in which counters and timers could be used in an engineering system. (e.g. timing how long a chemical is in a heater tank in a chemical process or liquid processing plant, counting how many objects pass by a point on a production line).
Page 36
CE123 Programmable Logic Controller
5.6
TecQuipment Ltd
Experiment 4: Editing and Adding Comments to a PLC Programme
Object
The object of this experiment is to use the editing and documenting features of the programming software to make a programme clearer to read and use. Apparatus
CE123 PLC Trainer Personal Computer (PC) loaded with the CE123 PLC Programming Software. A printer may be needed to record results. Procedure Part 1. Setup
See “Setup” on page 27. Part 2. Programming Task: Implementation of a Simple Repetitive Timed Sequence.
The task is to programme the CE123 to switch the outputs in a timed sequence, and use the editing features of the programming software to label devices and add comments. Enter the ladder diagram shown in Figure 37.
Figure 37 Timer Sequence Convert the programme, and write it to the CE123 as explained in experiment 1. Run the programme, when input X0 is set or on, then the outputs Y0 and Y1 should switch on in turn at times fixed by the timer settings in the ladder diagram. The cycle repeats because of the use of timer T2 to actuate reset time T2. Part 3. Adding Comments, Line Statement and Notes
Each device can be given a ‘device comment’ (or ‘common’ comment) to remind the programmer what it does on the actual piece of machinery or system that the PLC is connected to. For example, Input X0 may represent a switch or sensor, so it makes the program easy to understand if the device is labelled with the word ‘switch’ or ‘sensor’. The comment appears underneath the device. The program will automatically label all occurrences of the device with the same comment.
Page 37
CE123 Programmable Logic Controller
TecQuipment Ltd
Each line of the programme can be given a ‘statement’ to help remind the programmer what the line or section does. The statement appears above the line. Coil and application instructions can be given a ‘note’ to help remind the programmer what it does. The note appears above the coil or instruction. Depending on the controller, some or all types of comments, statement and notes cannot be transferred from the software to the controller, so if you lose your original program, you may be able read it back from the PLC but you will lose some or all of the comments, statements and notes. Refer to the software manual for details. Before you add any comments, statements and notes, make sure the software is in ‘write mode’. To select write mode, click on write mode from the ‘edit’ menu. Also, you must select statement, comment or note (whichever you need to add) in the ‘view’ menu. To add a comment: Select Documentation - Comment from the Edit menu. Now position the cursor over the input contact X0 and double click. Enter a suitable name that you wish to be used instead of X000, (e.g. input 0) and click on OK. Repeat this for the timer T2 (label it timer 2) and the output coil operating on timer T0 (label it T0). This will give the ladder diagram labels as in Figure 38.
Comments
Figure 38 Comments on a Ladder Diagram Part 4: Programming Task: Inserting additional ladder elements
The task is to extend the ladder programme shown in Figure 37 by inserting ladder blocks and labelling the new blocks. Position the cursor over the last rung of the ladder diagram (the one with END in it) and select Insert Line from the Edit menu. A new blank line will appear in grey. Enter new rungs as shown in Figure 39. Save the ladder diagram in your own folder for future use.
Page 38
CE123 Programmable Logic Controller
TecQuipment Ltd
Note
Figure 39 Addition of More Rungs To add statements above the additional rungs click on Edit - Documentation - Statement/Note Block Edit. A new dialogue box will appear as in Figure 40. In this new box, click on the line statement block of the step you wish to label and add your text - you are limited to 64 characters. For example, to label step 17 click in the line statement next to step 17 and add your text (as in Figure 40). Repeat for step 25 and the new section of the ladder should look like Figure 41.
Page 39
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 40 Statement/Note Block Edit
Line Statements
Figure 41 Statements Added to Rungs (Steps 17 and 25) Convert and load the programme into the CE123 and check that it functions as expected. Conclusions.
Comment on the way in which commenting devices and sections of programme can help document a ladder logic programme. Experiment with other options in the Print, View and Edit menus to find other documentation features of the CE123 programming software.
Page 40
CE123 Programmable Logic Controller
5.7
TecQuipment Ltd
Experiment 5: More Ladder Special Instructions Master Coils SET, and RESET
Object
The object of this experiment is to illustrate the use of special instructions and special coils to do more complex things in ladder logic programmes. Apparatus
CE123 PLC Trainer Personal Computer(PC) loaded with the CE123 PLC Programming Software. A printer may be needed to record results. Procedure Part 1. Setup
See “Setup” on page 27. Part 2. Programming Task: Master coil and master coil reset
The task is to programme the CE123 to carry out two repetitive tasks. One of which can be activated or deactivated by a master coil. Master coils are used to pick out specific parts of a ladder logic programme that has to be performed only when special conditions are met. Enter the ladder logic programme shown in Figure 43. The programme requires a special coil with a master coil instruction to be entered on line 0 and a special coil instruction with a master coil reset to be entered (line 21 in Figure 43). For example, the special coil on rung one is entered by positioning the cursor to the right of the rung, selecting the special coil symbol and filling in the input instruction box as shown in Figure 42.
Figure 42 Enter Symbol box for the special coil Master Coil
Page 41
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 43 Ladder Programme including a Master Coil and Master Coil Reset Part 3 Running and Testing the Programme
Load the diagram into the CE123 and check its function. Start with all inputs set off. Set X3 should start repeat cycle of outputs Y2 and Y3. Set X0 will enable the master coil loop, which in turn will only start its cycle when the input X1 is set. Use the monitor to check this. Part 4. Modifying the Programme using SET
Edit the ladder diagram to add a new line at the beginning and change device names as shown in the first two lines of Figure 44.
Page 42
CE123 Programmable Logic Controller
TecQuipment Ltd
Figure 44 Modified Ladder Diagram using a SET instruction In this form the master loop will run if X1 is set and X0 is set once. After this the input X0 can be set off and the master loop will continue to run because the internal variable M1 has been set permanently on by the SET command. Check this by running the revised programme in the CE123 and add a new rung immediately before the END rung with a RESET to M1 operated by input X7. Check that this resets the Master coil loop when set once. Conclusions.
You should understand how the ladder diagram logic is modified by the master coil instruction by allowing conditional execution of specific parts of a ladder logic sequence. Also the use of reset and set should be understood in enabling inputs to start or stop a part of a logic programme and then take any value.
Page 43
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 44
SECTION 6.0 Results As an aid to the course instructor and the laboratory assistant, the ladder diagrams (project files) used in the experiments are supplied on a disk that is shipped with the CE123. Keep this disk in a secure place. To use the ladder diagrams, insert the disk into your PC. Copy the project files to a suitable folder on your hard drive. Start the CE123 PLC Trainer software. Use the software to access the project files. The relevant ladder diagram (project file) names are given in Table 3.
Experiment
File Names
1
Simple Program
2
AND and inverse AND Exclusive OR OR and inverse OR
3
Timer Sequence Use of Counters
4
Added statements to steps Adding extra rungs Labelled Ladder Diagram
5
Master Coil and Master Coil Reset Modified Ladder with SET Instruction
Table 3 Experiment Files
Page 45
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 46
APPENDIX A:
Useful Textbooks
Programming Manual II
by Mitsubishi
Programmable Controllers: Operation and Application
by Ian G Warnock Published by Prentice Hall, 1988 ISBN 0137300379
Page 47
CE123 Programmable Logic Controller
TecQuipment Ltd
Page 48
APPENDIX B:
Decimal/Octal Conversion Table
Dec.
Octal
Dec.
Octal
Dec.
Octal
Dec.
Octal
Dec.
Octal
0
0
34
42
68
104
102
146
136
210
1
1
35
43
69
105
103
147
137
211
2
2
36
44
70
106
104
150
138
212
3
3
37
45
71
107
105
151
139
213
4
4
38
46
72
110
106
152
140
214
5
5
39
47
73
111
107
153
141
215
6
6
40
50
74
112
108
154
142
216
7
7
41
51
75
113
109
155
143
217
8
10
42
52
76
114
110
156
144
220
9
11
43
53
77
115
111
157
145
221
10
12
44
54
78
116
112
160
146
222
11
13
45
55
79
117
113
161
147
223
12
14
46
56
80
120
114
162
148
224
13
15
47
57
81
121
115
163
149
225
14
16
48
60
82
122
116
164
150
226
15
17
49
61
83
123
117
165
151
227
16
20
50
62
84
124
118
166
152
230
17
21
51
63
85
125
119
167
153
231
18
22
52
64
86
126
120
170
154
232
19
23
53
65
87
127
121
171
155
233
20
24
54
66
88
130
122
172
156
234
21
25
55
67
89
131
123
173
157
235
22
26
56
70
90
132
124
174
158
236
23
27
57
71
91
133
125
175
159
237
24
30
58
72
92
134
126
176
160
240
25
31
59
73
93
135
127
177
161
241
26
32
60
74
94
136
128
200
162
242
27
33
61
75
95
137
129
201
163
243
28
34
62
76
96
140
130
202
164
244
29
35
63
77
97
141
131
203
165
245
30
36
64
100
98
142
132
204
166
246
31
37
65
101
99
143
133
205
167
247
32
40
66
102
100
144
134
206
168
250
33
41
67
103
101
145
135
207
169
251
Page 49
CE123 Programmable Logic Controller
TecQuipment Ltd
Dec.
Octal
Dec.
Octal
Dec.
Octal
Dec.
Octal
170
252
197
305
224
340
251
373
171
253
198
306
225
341
252
374
172
254
199
307
226
342
253
375
173
255
200
310
227
343
254
376
174
256
201
311
228
344
255
377
175
257
202
312
229
345
176
260
203
313
230
346
177
261
204
314
231
347
178
262
205
315
232
350
179
263
206
316
233
351
180
264
207
317
234
352
181
265
208
320
235
353
182
266
209
321
236
354
183
267
210
322
237
355
184
270
211
323
238
356
185
271
212
324
239
357
186
272
213
325
240
360
187
273
214
326
241
361
188
274
215
327
242
362
189
275
216
330
243
363
190
276
217
331
244
364
191
277
218
332
245
365
192
300
219
333
246
366
193
301
220
334
247
367
194
302
221
335
248
370
195
303
222
336
249
371
196
304
223
337
250
372
Page 50