GE Fanuc PLC
Training Document
This Training Document is intended for Training purposes only, and must not be used for any other purpose. The Training Document does not replace any instructions or procedures (e.g. OM, MM, TeM, IM, SPC) intended for specific equipment, and must not be used as such. Note! For safe and proper procedures, refer to the equipment specific documentation.
PLC Basics
Hardware
Configuration
Name:
................................................................................................................
Memory Organisation
................................................................................................................
Instructions
Exercises
10
1
Course Introduction
TM-00001
Your instructor will tell you if there are any changes in the schedule.
Breakfast
Breakfast is free of charge and served in the restaurant, where a special area has been reserved for Technical Training Centre course participants. Breakfast consists of coffee or tea and bread rolls. If you want anything in additional, for instance from the serving counters of the restaurant or cafeteria, you have to pay for it yourself. Your instructor will help you with the procedure. Lunch is served in the restaurant. You can choose among several dishes; menus are posted at the restaurant entrance and in the coffee room. If you are a customer course participant, your instructor will give you a cash card. For participants other than customers, cash cards are for sale in the cafeteria. Your instructor will help you with the procedure. You are invited to use the coffee room and the vending machine during all breaks in classes. The entire Tetra Pak plant, outdoors as well as indoors, is a no smoking area. Smoking is allowed though in the smoking-room adjoining the machine hall. If you need to call long-distance within Sweden or abroad, please use the phone in the telephone room. There are also telephones in the coffee room and in the spare parts store, adjoining the machine hall. These phones are for local or internal calls only. When using the phones, please be brief, as there may be others who wish to make calls. Furthermore, there is a pay-phone outside the assembly-hall. There are three computers for the use of course participants. Two computers in the machine hall, on which ORBIS (the Tetra Pak Intranet) is available, and one in the coffee room, on which Internet and the World Wide Web is available.
Lunch
Computers
TM-00010
ID card
On your first day you will recieve an ID card. This card must be returned at the Tetra Pak Main reception at the end of the course. Anyone not handing the card back will be charged SEK 400. At the start of the course, your instructor will go through the Safety Regulations (TM-00001). These regulations must be strictly observed. In case you are uncertain about anything in the regulations, you must clarify it with your instructor. You are requested to write down your comments on the course on the Course Evaluation form. At the end of the course your instructor will collect all the forms. It is necessary to wear safety shoes in the Technical Training Centre, while working at the machines. If you didnt bring your own, safety shoes are for sale in the Tetra Shop. Your instructor will take you there. For your use during the course, you may borrow a set of coveralls. Each participant is given a locker in the changing-room. The instructor will hand you the locker key. You may then select a set of coveralls from the coveralls cabinet in the changing-room. Your instructor will help you if needed. You may exchange your coveralls for clean ones every Monday morning. Ask your instructor if you need to change at any other time. Used and soiled coveralls are to be placed in the laundry basket in the changing-room. At the end of the course you have to empty and lock your locker and return the key to the instructor. If you wish to retain your locker for a subsequent training course, tell your instructor.
Safety regulations
Course evaluation
Working clothes
You are responsible for your own valuables. To change currency or cash travellers cheques, please go to the cashiers office, which is open 09.00 - 16.00. In the coffee room, there is a list of the various hotels, with addresses, phone numbers, etc. If you want to change hotel during the course period, please contact the course co-ordinator at Technical Training Centre. Certain hotels provide free of charge transport to and from Tetra Pak. Ask the hotel receptionist about this. If you wish to use this service, you must tell the receptionist the day before. Go to the Resespecialisterna travel agency for reservations, reservation changes, or confirmation of reservations. The travel agency is located at the plant and open 07.30 - 17.30 (fridays - 17.00). Course participants from certain countries require visas in case they wish to visit another scandinavian country, for example Denmark. The Resespecialisterna travel agency deals with all visa applications and related matters. A Letter of Guarantee, which is required to apply for a visa, can be obtained from the course co-ordinator at Technical Training Centre. For medical care, unless it is an emergency situation, go to Citykliniken, located in the centre of Lund. Information concerning this clinic is posted on the notice board in the coffee room. In the coffee room you will find information about the city of Lund and the surrounding region as well as on available facilities and activities.
Transport
Travel arrangements
Visa
Medical care
Leisure time
TM-00010
Sport Centre
Bookings for the Tetra Pak Sport Centre are free of charge and can be made at the Main Guard, located next to the Main Reception. If you visit the Sport Centre, you must enter and leave via the Main Guard. Gifts, souvenirs, articles of clothing, etc. are on sale in the Tetra Shop, which is open 09.00 - 15.00.
Tetra Pak
Part of the plant at Ruben Rausings gata Lund
1 Main Reception 2 Main Guard 3 Technical Training Centre 4 Restaurant 5 Cashiers office 6 Resespecialisterna Travel agency 7 Sport Centre
Tetra Shop
315 305
3
N
313 101
4 8
306 310
5
106
6
107
309
311
7
111
TM-00010
Hhviwrpvr
After completed course, be able to: perform changes related to the PLC system, according to Tetra Pak Rebuilding Descriptions identify faults and replace modules in the PLC system
Srvrqrxyrqtr
be able to describe the PLC system function and working cycle, corresponding to PLC Basics (MT-83045-1) computer skills equivalent to ECDL - Basic concepts of IT and Windows 95/98 be able to use Tetra Pak Machine Documentation
9rhvyrqiwrpvr
QG87hvpHU'"#$
Describe the PLC system function and working cycle. list the main components of a PLC system describe the function of the main components of a PLC system describe the working cycle of a PLC system use the correct terminology with documentation support, be able to convert between decimal, binary, hexadecimal, and BCD number systems describe the function of a simple ladder diagram describe the function of timers and counters Identify the PLC system modules, locate and replace defective modules. identify system modules - used by Tetra Pak - on the machine, in the EM and the SPC identify input and output addresses in the EM and on the machine identify defect Power supply, CPU, and I/O modules - used by Tetra Pak with support of LEDs, voltmeter and PC replace modules Configure a PLC system according to Tetra Pak Rebuilding Descriptions. describe why system configuration is necessary be able to change CPU type and settings be able to change, add, move, and delete a module be able to set and change CPU ID be able to change settings for analog modules Be able to use program folders, program blocks, and the addressing system when trouble shooting. describe the addressing system list all reference types
Chqhr
8svthv
Hrthvhv
TM-00274
distinguish between bit and word references describe the difference between the BIT, WORD, and INT data types describe the function of subroutines identify a periodic subroutine fast scan function describe the content of a program folder in the PLC and in the PC
Qthvtshr GH(
Be able to update a machine program, according to Tetra Pak Rebuilding Descriptions. be able to start up the LM90 and navigate to programming mode be able to create, delete, rename, copy, backup and restore program folders be able to program/change program logic, according to Tetra Pak Rebuilding Descriptions be able to use the Search function to find program lines, addresses and instructions be able to perform program transfers be able to perform overrides Be able to update a machine program, according to Tetra Pak Rebuilding Descriptions. be able to start up the VersaPro and navigate to programming mode be able to create, delete, rename, copy, backup and restore program folders be able to program/change program logic, according to Tetra Pak Rebuilding Descriptions be able to use the Search function to find program lines, addresses and instructions be able to perform program transfers be able to perform overrides With documentation support (EM, WB-118-01, and GFK-467), interpret program logic in a trouble shooting situation. with documentation support, describe Relay, Timer/Counter, Relational, and Move functions with documentation support, identify Math, Bit operational, Data move, and Control functions Be able to perform a rebuilding according to a Tetra Pak Rebuilding Description. with documentation support (WB-118-01 and GFK-467), be able to perform given programming tasks With documentation support (EM, WB-118-01, and GFK-467), be able to reset the PLC system to Run mode. be able to empty fault tables be able to perform a CPU reset be able to perform Output overload reset Be able to find valid reference documentation. be able to find reference documents on the Tetra Pak and GE Fanuc web sites be able to determine which documents are valid be able to find information on CD-00012
Qthvtshr WrhQ
Qthvpv
@rpvr
Uiyruvt
Srsrrprqprhv
TM-00274
2
PLC Basics
Textbook
PLC Basics
MT-83045-1
This textbook has been compiled by the Technical Training Centre in Lund. Some of the pictures in the book are also available as OH pictures. For further information on training material, please contact the Technical Training Centre.
Issue 1/0109 2001, Technical Training Centre No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means: electronic, electrostatic, magnetic tape, mechanical photocopying, recording or otherwise, without permission in writing from Technical Training Centre.
PLC Basics
Training Document
This Training Document is intended for Training purposes only, and must not be used for any other purpose. The Training Document does not replace any instructions or procedures (e.g. OM, MM, TeM, IM, SPC) intended for specific equipment, and must not be used as such. Note! For safe and proper procedures, refer to the equipment specific documentation.
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 PLCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Basic requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Programming a PLC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Discrete Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Analog Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Fast Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Review Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
PLC Basics
Introduction
Welcome to this course in QG87hvp, designed to prepare you for specialized courses on PLCs. Upon completion of QG87hvp you should be able to describe the PLC system function and working cycle. list the main components of a PLC system describe the function of the main components of a PLC system describe the working cycle of a PLC system use the correct terminology with documentation support, be able to convert between decimal, binary, hexadecimal, and BCD number systems describe the function of a simple ladder diagram describe the function of timers and counters
PLCs
Programmable Logic Controllers (PLCs), also referred to as Programmable controllers, are in the computer family. They are used in commercial and industrial applications. A PLC monitors inputs, makes decisions based on its program, and controls outputs to automate a process or machine. This course is meant to supply you with basic information on the functions and configurations of PLCs.
Drive motors
Lights
Pumps
Photo sensors
Push-buttons
7hvpQG8rhv
PLCs consist of vqyr or points, a 8rhyQprvtVv (CPU), and qyr or points. An input accepts a variety of digital or analog signals from various field devices (sensors) and converts them into a logic signal that can be used by the CPU. The CPU makes decisions and executes control instructions based on program instructions in memory. Output modules convert control instructions from the CPU into a digital or analog signal that can be used to control various field devices (actuators). A thvtqrvpr is used to input the desired instructions. These instructions determine what the PLC will do for a specific input. An rhvrshpr device allows process information to be displayed and new control parameters to be entered.
Input Module
Output Module
Programming Device
Operator Interface
Push buttons (sensors), in this simple example, connected to PLC inputs, can be used to start and stop a motor connected to a PLC through a contactor (actuator).
PLC
Input
Output
Motor
Push buttons
Contactor
Prior to PLCs, many of these control tasks were solved with contactor or relay controls. This is often referred to as hard-wired control. Circuit diagrams had to be designed, electrical components specified and installed, and wiring lists created. Electricians would then wire the components necessary to perform a specific task. If an error was made the wires had to be reconnected correctly. A change in function or system expansion required extensive component changes and rewiring.
Chqvrqpy
Circuit Diagram
K L1 L2 L3 M 3~ Q
Stop
Start
The same, as well as more complex task, can be done with a PLC. Wiring between devices and relay contacts is done in the PLC program. Hard-wiring, though still required to connect field devices, is less intensive. Modifying the application and correcting errors are easier to handle. It is easier to create and change a program in the PLC than it is to wire and rewire a circuit.
QG8
Smaller physical size than hard-wire solutions Easier and faster to make changes PLCs have integrated diagnostics and override functions Diagnostics are centrally available Applications can be immediately documented Applications can be duplicated faster and less expensively
6qhhtr
Number Systems
Since a PLC is a computer, it stores information in the form of On or Off conditions (1 or 0), referred to as binary digits (bits). Sometimes binary digits are used individually and sometimes they are used to represent numerical values. Various number systems are used by PLCs. All number systems have the same three characteristics: digits, base, weight. The decimal system, which is commonly used in everyday life, has the following characteristics:
9rpvhyr
7vhr
The binary system is used by programmable controllers. The binary system has the following characteristics:
In the binary system 1s and 0s are arranged into columns. Each column is weighted. The first column has a binary weight of 20. This is equivalent to a decimal 1. This is referred to as the Least Significant Bit (LSB). The binary weight is doubled with each succeeding column. The next column, for example, has a weight of 21, which is equivalent to a decimal 2. The decimal value is doubled in each successive column. The number in the far left hand column is referred to as the Most Significant Bit (MSB). In this example, the most significant bit has the binary weight of 27. This is the equivalent to a decimal 128.
27 128
26 64
25 32
24 16
23 8
22 4
21 2
20 1
The following steps can be used to interpret a decimal number from a binary value. 1. Search from right to left (least significant to most significant bit) for 1s 2. Write down the decimal representation of each column containing a 1 3. Add the column values In the following example, the fourth and fifth column from the right contain a 1. The decimal value of the fourth column from the right is 8, and the value of the fifth column from the right is 16. The decimal equivalent of this binary number is 24. The sum of all the weighted columns that contain a 1 is the decimal number that the PLC has stored.
8rvtivh qrpvhy
128
64
32
16
0
8 + 16 24
In the following example the fourth and the sixth columns from the right contain a 1. The decimal value of the fourth column from the right is 8, and the value of the sixth column from the right is 32. The decimal equivalent of this binary number is 40.
128
64
32
16
0
8 + 32 40
7virhqq
Each binary piece of data is a ELW. Eight bits make up one E\WH. Two bytes, or 16 bits, make up one ZRUG.
Bit 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1
Byte
Word
Gtvpytvp
Programmable controllers can only understand a signal that is On or Off (present or not present). The binary system is a system in which there are only two numbers, 1 and 0. Binary 1 indicates that a signal is present, or a switch is On. Binary 0 indicates that a signal is not present, or a switch is Off.
PLC Input 1
Off Logic 0
24 VDC
PLC Input 1
On Logic 1
24 VDC
Hexadecimal is another system used in PLCs. The hexadecimal system has the following characteristics:
+H[DGHFLPDO
The ten digits of the decimal system are used for the first ten digits of the hexadecimal system. The first six letters of the alphabet are used for the remaining six digits.
A = 10 B = 11 C = 12
D = 13 E = 14 F = 15
The hexadecimal system is used in PLCs because it allows the status of large number of binary bits to be represented in a small space such as on a computer screen or programming device display. Each hexadecimal digit represents the exact status of four binary bits. To convert a decimal number to a hexadecimal number the decimal number is divided by the base of 16. To convert decimal 28, for example, to hexadecimal:
2810 1610
Decimal 28 divided by 16 is 1 with a remainder of 12. Twelve is equivalent to C in hexadecimal. The hexadecimal equivalent of decimal 28 is 1C. The decimal value of a hexadecimal number is obtained by multiplying the individual hexadecimal digits by the base 16 weight and then adding the results. In the following example the hexadecimal number 2B is converted to its decimal equivalent of 43.
161 160
160 = 1
B
11 x 1 = 11 2 x 16 = 32 43
161 = 16 B = 11
10
Tvtrqvrtr
The simplest method to represent negative numbers is to use one bit of the PLC word as the sign of a number while the remainder of the word gives its magnitude. It is general convention to use the most significant bit as the sign bit, and a logic 1 will indicate a negative, whereas a logic 0 a positive number.
16
15
14
13
12
11
10
Thus a 16-bit PLC word allows numbers in the range 32.767 to be expressed. This simple method is referred to as Sign Plus Magnitude Notification. However, the number zero has two valid representations in this format:
16
15
14
13
12
11
10
+0
-0
This is usually undesired, and therefore a more commonly used representation for negative numbers is the!8yrr format. This format is used with the GE Fanuc 90-30 PLC for signed integers. In the twos complement format, using a 16 bit word, the number -X is represented as 216 -X. This means that, as with sign plus magnitude numbers, the most significant bit becomes the sign bit and if is set, the corresponding number is negative. Thus a 16 bit PLC word allows numbers in the range of -32.768 to +32.767 and zero is represented uniquely:
16
15
14
13
12
11
10
-32.768
+32.767
11
To obtain the negative number of a positive number in the 2s complement system two steps are necessary. First, the number is bit by bit complemented, i.e. each bit equal to 0 of the original number is changed to a one, and each one of the original number is changed to a zero. This process is called taking the 1s complement of a number. Second, the complemented number is incremented by one. This process can also be used in the reverse way to obtain a positive number from an original negative one. In the following example the number +37 is 2s complemented to -37.
16
15
14
13
12
11
10
+37
1s complemented
+1
incrementing by 1
-37
12
789pqr
BCD code (Binary Coded Decimal) is a way is a way to express decimal numbers in binary format. When a BCD code is used, each decimal figure (0-9) is coded separately.
0 1 2 3 4 5 6 7 8 9
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Thus, four bits are required to express 0-9 in BCD. Consequently, 16 bits suffice to write numbers from 0 to 9999. In the example below the number 4729 is written in BCD format.
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
1 4
1 7
0 2
0 9
13
The following chart shows a few numeric values in decimal, binary, and hexadecimal representation.
8rvsir
Decimal
Binary
Hexadecimal
BCD
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 1 0000 1 0001 1 0010 1 0011 1 0100
0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14
0 1 10 11 100 101 110 111 1000 1001 0001 0000 0001 0001 0001 0010 0001 0011 0001 0100 0001 0101 0001 0110 0001 0111 0001 1000 0001 1001 0010 0000
7E 7F 80
14
Srvr
15
Terminology
The language of PLCs consists of a commonly used set of terms; many of which are unique to PLCs. In order to understand the ideas and concepts of PLCs, the understanding of these terms is necessary. A sensor is a device that convert a physical condition into an electric signal for use by the PLC. Sensors? are connected to the input of the PLC. A push button is one example of a sensor? that is connected to the PLC input. An electrical signal is sent from the push button to the PLC indicating the condition (open/ closed) of the push button contacts.
Tr
PLC Input 1
Actuators convert an electrical signal from the PLC into a physical condition. Actuators are connected to the PLC output. A contactor is one example of an actuator that is connected to the PLC output. Depending on the output the PLC signal the contactor will either start or stop the motor.
6ph
PLC Output 1
16
9vprrv
A discrete input, also referred to as a digital input, is an input that is either in an On or Off condition. Push buttons, toggle switches, limit switches, proximity switches, and contact closures are examples of discrete sensors which are connected to the PLCs discrete or digital inputs. In the ON condition a discrete input may be referred to as a logic 1 or a logic high. In the OFF condition a discrete input may be referred to as a logic 0 or a logic low.
PLC Inputs Normally Open Push button Normally Closed Push button Normally Open Switch Normally Closed Switch
A Normally Open (NO) push button is used in the following example. One side of the push button is connected to the first PLC input. The other side of the push button is connected to an internal 24 VDC power supply. Many PLCs require a separate power supply to power the inputs. In the open state, no voltage is present at the PLC input. This is the OFF condition. When the push button is depressed, 24 VDC is applied to the PLC input. This is the ON condition.
PLC Input
Off Logic 0
24 VDC
PLC Input
On Logic 1
24 VDC
17
An analog input is an input signal that has a continuous signal. Typical analog inputs may vary from 0 to 20 milliampere (mA), 4 to 20 mA, 0 to 10 volts, or -10 to +10 volts. In the following example, a level transmitter monitors the level of liquid in a tank. Depending on the level transmitter, the signal to the PLC can either increase or decrease as the level increases or decreases.
6hytv
A discrete output is an output that either in an ON or OFF condition. Solenoids, contactor coils, and lamps are examples of actuator? devices connected to discrete outputs. Discrete outputs may also be referred to as digital outputs. In the following example, a lamp can be turned on or off by the PLC output it is connected to.
9vprr
18
6hyt
An analog output is an output signal that has a continuous signal. The output may be as simple as a 0 - 10 VDC level that drives an analog meter. Examples of analog meter outputs are speed, weight, and temperature. The output signal may also be used on more complex applications such as a current-to-pneumatic transducer that controls an air-operated flow-control valve.
8QV
The Central Processing Unit (CPU) is a microprocessor system that contains the system memory and is the PLC decision making unit. The CPU monitors the inputs and makes decisions based on instructions held in the program memory. The CPU performs relay, counting, timing, data comparison, and sequential operations.
%I0001
%I0002
%I0003
%Q0001
%Q0001
%Q0001
%Q0002
19
A program consists of one or more instructions that accomplish a task. Programming a PLC is simply constructing a set of instructions. There are several ways to look at a program such as ladder logic or instruction lists.
Qthvt
Ladder logic (LD) is one programming language used with PLCs. Ladder logic uses components that resemble elements used in line diagram format to describe hard-wired control.
Ghqqrytvp
The left vertical line of a ladder logic diagram represents the power line. The output coil or instruction represents the neutral or return path of the circuit. The right vertical line, which represents the return path on a hard-wired control line diagram, is normally omitted. Ladder logic diagrams are read from leftto-right, top-to-bottom.
Ghqqrytvpqvhth
Power line
%I0001
%I0002
%Q0001 Rung 1
%I0004
%Q0002 Rung 2
%I0005
In the example program shown example %I0001, %I0002, and %Q0001 represent the first instruction combination. If inputs %I0001 and %I0002 are energized, output coil %Q0001 energizes. The inputs could be switches, push buttons, or contact closures. %I0004, %I0005, and %Q0002 represent the second instruction combination. If either %I0004 or %I0005 are energized, output %Q0002 energizes.
20
Dpvyv
An instruction list provides another view of a set of instructions. The operation, what is to be done, is shown on the left. The operand, the item to be operated on by the operation, is shown on the right. A comparison between the statement list shown below, and the ladder logic shown on the previous page, reveals a similar structure. The set of instructions in this statement list perform the same task as the ladder diagram.
Tshr
Software is any information in a form that a computer or PLC can use. Software includes the instructions or programs that direct hardware.
9HUVD3UR
QthvtTs hr
Chqhr
Hardware is the actual equipment. The PLC, the programming device, and the connecting cable are examples of hardware.
21
The PLC program is executed as a part of a repetitive process referred to as a scan. A PLC scan starts with the CPU reading the status of the inputs. The application program is executed using the status of the inputs. Once the program execution is completed the outputs are updated. The scan cycle ends by the CPU performing internal diagnostics and communication with external units, then starts over.
QG8ph
Read inputs
Diagnostics, Communication
Execute program
Write outputs
The scan cycle time depends on the size of the program, the number of I/Os, and the amount of communication required. This also means that there is a certain response time of a PLC, i.e. a delay between the activation of an input and a corresponding output.
22
Hrvr
Kilo, abbreviated k, normally refers to 1000 units. When talking about computer or PLC memory, however, 1 k means 1024. This is because of the binary number system (210 = 1024). This can be 1024 bits, 1024 bytes, or 1024 words, depending on the memory type.
1024 Bits
1024 Bytes
1024 Words
S6H
Random Access Memory (RAM) is memory where data can be directly accessed at any address. Data can be written to and read from RAM. RAM is used as a temporary storage area. RAM is volatile, meaning that the data stored in RAM will be lost if power is lost. A battery backup is required to avoid losing data in the event of a power loss. Read Only Memory (ROM) is a type of memory that data can be read from but not written to. This type of memory is used to protect data or programs from accidental erasure. ROM memory is nonvolatile. This means a user program will not lose data during a loss of electrical power. ROM is normally used to store the program that define the capabilities of the PLC. Erasable Programmable Read Only Memory (EPROM) provides some level of security against unauthorized or unwanted changes in a program. EPROMs are designed so that data stored in them can be read, but not easily altered. Changing EPROM data requires a special effort. EPROM can only be erased with an ultraviolet light. EEPROM (Electrically Erasable Programmable Read Only Memory) can only be erased electrically. Flash memory is a type of semi-conductor memory. A flash memory is nonvolatile and is often used as computer memory. However, the memory type is expensive and the current needed for writing is relatively high. Therefore, flash memory is primarily used to store data that is seldom or never altered. Firm ware is user or application specific software burned into EPROM, or stored in flash memory, and delivered as part of the hardware. Firm ware gives the PLC its basic functionality. It could be compared with the Operating System for a PC.
SPH
@QSPH
Ayhur Avhr
23
The memory of the PLC is divided into three areas: Program memory, Reference table, and Configuration areas. The Program memory area stores the ladder logic or instruction list program instructions. This area of the memory controls the way the Reference tables and I/O points are used. The ladder logic or instruction list instructions are written using a programming device such as a PC, then loaded into the program memory of the PLC. The Reference table is used as a working area and includes memory locations for I/Os, temporary storage of intermediate results and constants. The reference tables includes memory locations for devices as timers, counters, and analog inputs and outputs. The Configuration area contains information on how the PLC is configured, such as what types of I/O modules are used and what addresses the I/Os are given. Note that no documentation such as written comments are stored in the PLC. Documentation is normally created and stored with the programming software.
Qvtvtrur
%I0001
%I0002
%I0003
%Q0001
%Q0001
%Q0001
%Q0002
%I0001
%I0002
%I0003
%Q0001
%Q000 1
%Q0001
%Q0002
9HUVD3UR
QthvtTs hr
24
Basic requirements
In order to create or change a program, the following items are needed: PLC Programming device Programming software Connector cable
9HUVD3UR
QthvtTs hr
QG8 Qthvtqrvpr
Throughout this course the GE Fanuc 90-30 PLC will be use because it is most commonly used within Tetra Pak. The program is created in a programming device and then transferred to the PLC. The program for the GE Fanuc 90-30 can be created using a PC, such as a notebook or desk top computer, with a GE Fanuc programming software installed. The program may also be created using a dedicated GE Fanuc programming device, such as the hand-held programmer.
Tshr
A software program is required in order to tell the PLC what instructions it must follow. Programming software is typically PLC specific. A software package for one PLC, or one family of PLCs, such as the GE Fanuc 90-30 family, would not be useful on other PLCs. Two different software programs may be used when programming the GE Fanuc 90-30 PLC: the LM90 (LogicMaster90) or the VersaPro. These softwares are installed on personal computers in a similar manner to any other computer software.
8rpphiyr
Connector cables are required to transfer the data from the programming device to the PLC. Communication can only take place when the two devices speak the same language or protocol. Communication between a GE Fanuc programming device and the GE Fanuc PLC is referred to as SNP (Series Ninety Protocol). An appropriate cable is required.
25
1. A switch or a push button is a ____________________ input. 2. A lamp or a solenoid is an example of ____________________ output. 3. The ____________________ makes decisions and executes control instructions base on the input signals. 4. _______________ _______________ is a PLC programming language that uses components resembling elements used in line diagrams. 5. A ____________________ consists of one or more instructions that accomplish a task. 6. The PLC memory is divided in three areas: __________________ , __________________ , and __________________ . 7. When talking about computer or PLC memory, 1 K refers to ____________________ bits, bytes, or words. 8. Software that is placed in hardware is called ____________________ . 9. Which of the following is not required when creating or changing a PLC program? a. b. c. d. e. PLC Programming device Programming software Connector cable Printer
Srvr!
10. A special cable, referred to as a ____________________ cable, is required when a personal computer is used as a programming device.
26
Programming a PLC
Two different software programs may be used when programming the GE Fanuc 90-30 PLC: the LM90 (LogicMaster90) or the VersaPro. These softwares contain a number of instructions that must be arranged in a logical order to obtain the desired PLC operation. The instructions are divided into groups based on functions: Relay functions, Timer/Counter functions, Math functions, Relational functions, etc.
/RJLF0DVWHU
QthvtTs hr
9HUVD3UR
QthvtTs hr
Qthvtqr
The programming software can be run in three different programming or communication modes: Off-line, Monitor, and On-line. Off-line programming allows the user to edit the ladder diagram and perform a number of maintenance tasks. The PLC does not have to be connected to the programming device in this mode. Monitor requires the PLC to be connected to the programming device. This mode allows the user to get information from the PLC, but no program changes can be done. This mode is only available with the LM90. On-line programming requires the PLC to be connected to the programming device. In this mode program changes are downloaded to the PLC. In addition, status of the input/output elements can be monitored. The CPU can be started and stopped.
OFF-LINE
MONITOR
ON-LINE
27
In order to understand the instructions a PLC is to carry out, an understanding of the language is necessary. The language of PLC ladder logic consists of a commonly used set of symbols that represent control components and instructions.
Tiy
One of the most confusing aspects of PLC programming for first-time users is the relationship between the device that control the status bit and the programming function that uses the status bit. Two of the most common programming functions are the normally open (NO) contact and the normally closed (NC) contact. Symbolically, power flows through these contacts when they are closed. The normally open contact (NO) is true (closed) when the input or output bit controlling the contact is 1. The normally closed contact (NC) is true (closed) when the input or output controlling the contact is 0.
8hp
Coils represent relays that are energized when power flows to them. When a coil is energized, it causes a corresponding output to turn on by changing the state of the status bit controlling the output to 1. That same output status bit may be used to control normally open and normally closed contacts elsewhere in the program.
8vy
28
Apviypx
Function blocks represent various instruction or functions that are executed when power flows to the function block. Typical function block functions are timers, counters, and math operations.
@rvtryrr
Control elements are entered in the ladder diagram by positioning the cursor and selecting the element from a menu or list. In the following example the cursor has been placed in the position to the right of %I0004
%I0001
%I0002
%Q0001
%I0004
Cursor
29
Each rung on a ladder represents a logic operation. The following programming example demonstrates an AND operation. Two contact closures and one output coil are placed on rung 1. They where assigned addresses %I0001, %I0002, and %Q0001. In this example %I0001 (input 1) and %I0002 (input 2) must be true for %Q0001 (output 1) to be true.
66I9rhv
%I0001
%I0002
%Q0001 Rung 1
Another way to see how an AND function works is with a Boolean logic diagram. In Boolean logic an AND gate is represented by a number of inputs on the left side. In this case there are two inputs. The output is on the right side.
Input 1 Input 2
&
Output 1
It can be seen from the table that both inputs must be a logic 1 in order for the output to be logic 1.
Input 1
Input 2
Output 1
0 0 1 1
0 1 0 1
0 0 0 1
30
6PSrhv
In this example an OR operation is used in rung 1. It can be seen that if either input %I0003 (input 3) or input %I0004 (input 4), or both are true, then output %Q0002 (output 2) will be true.
%I0003
%Q0002 Rung 1
%I0004
Another way to see how an OR function works is with a Boolean logic diagram. The symbol differs slightly from an AND function. The OR function is represented by a number of inputs on the left side. In this case there are two inputs. The output is represented on the right side.
Input 3 Input 4
>1
Output 2
It can be seen from the table that any input can be a logic 1 in order for the output to be a logic 1.
Input 3
Input 4
Output 2
0 0 1 1
0 1 0 1
0 1 1 1
31
After a program has been loaded and is running in the PLC, the actual status of ladder elements can be monitored using the programming software. The standard method of showing a ladder element status is by indicating the circuit condition it produces when the device is in the deenergized or non-operated state. In the following illustration input 1 (%I0001) is programmed as a normally open (NO) contact. In this condition, power will not flow through the contact to the output (%Q0001).
Thspv
CPU
%Q0001 Output
Lamp
When viewing the ladder diagram in the program display mode, control elements that are active, or true (logic 1), are highlighted. In the example shown the toggle switch connected to input 1 has been closed. Power can now flow through the control element associated with input 1 (%I0001) and activate the output (%Q0001). The lamp will illuminate.
CPU
%Q0001 Output
Lamp
32
Prvqvtspvt
Overriding or forcing is another useful tool in the commissioning of an application. It can be used to temporarily override the input or output status of the application in order to test and debug the program. The override function can also be used to override discrete output points. The override function can be used to skip portions of a program by enabling a jump instruction with a forced memory bit. Under normal circumstances the toggle switch, shown in the illustration below, would have to be closed to enable input 1 (%I0001) and turn on the output light. Overriding enables input 1 even though the toggle switch is open. With input 1 forced high the output light will illuminate. When a function is forced the control bit identifier is highlighted. The element is also highlighted because it is on.
CPU
%Q0001 Output
Lamp
CPU
%Q0001 Output
Lamp
33
The following table shows the appearance of ladder elements in the Off, Forced, and On condition. However, the appearance may vary depending on what programming software is used.
34
Discrete Inputs/Outputs
To understand discrete control of a programmable controller the same simple lamp circuit illustrated with forcing will be used. This is only for instructional purposes as a circuit this simple would not require a programmable controller. In this example the lamp is off when the switch is open and on when the switch is closed.
Toggle Switch
PLC
Lamp
:LULQJ
To accomplish this task, a switch is wired to the input of the PLC and an indicator light is wired to the output terminal.
35
The following drawing illustrates the sequence of events. A switch is wired to the input module of the PLC. A lamp is wired to the output module. The program is in the CPU. The CPU scans the input module. When it finds the switch open %I0001 receives a binary 0. This instructs %Q0001 to send a binary 0 to the output module. The lamp is off. When it finds the switch closed %I0001 receives a binary 1. This instructs %Q0001 to send a binary 1 to the output module, turning on the lamp.
CPU
%Q0001 Output
Lamp
CPU
%Q0001 Output
Lamp
When the switch is open the CPU receives a logic 0 from input %I0001. The CPU sends a logic 0 to output %Q0001 and the light is off.
Qthvpv
%I0001
%Q0001 Rung 1
When the switch is closed the CPU receives a logic 1 from input %I0001. The CPU sends a logic 1 to output %Q0001, thus activating %Q0001. The light turns on.
%I0001
%Q0001 Rung 1
36
Hhrrhyr
The following example involves a motor start and stop circuit. The line diagram illustrates how a normally open and a normally closed pushbutton may be used in a control circuit. In this example the contactor K is wired in series with a normally open momentary pushbutton (Start), a normally closed momentary pushbutton (Stop), and the normally closed contact of an overload relay (Q).
K L1 L2 L3
M 3~
Stop
Start
Momentarily depressing the Start pushbutton completes the path of current flow and energizes the contactor (K).
K L1 L2 L3
M 3~
Stop
Start
37
This closes the associated auxiliary contacts of contactor K. When the Start button is released, a holding circuit exists to the K contactor through its auxiliary contact. The motor will run until the normally closed Stop button is depressed, or the overload relay opens the Q contacts, breaking the path of current flow to the contactor and opening the associated auxiliary contacts.
K L1 L2 L3
M 3~
Stop
Start
PLC
Input
Output
Motor
Push buttons
Contactor
Overload relay
38
Qthvpv
A normally open Start pushbutton is wired to the first input (%I0001), a normally closed Stop pushbutton is wired to the second input (%I0002), and normally closed overload relay contacts, Q, are wired to the third input (%I0003). The first input (%I0001), the second input (%I0002), and the third input (%I0003) form an AND circuit and are used to control normally open programming function contacts on Rung 1. %I0002 status bit is logic 1 because the normally closed Stop pushbutton is closed. %I0003 status bit is also logic 1 because the normally closed overload relay contacts, Q, are closed. Output %Q0001 is also programmed on Rung 1. In addition, a normally open contact associated with %Q0001 is programmed on Rung 1 to form an OR circuit. A contactor controlling a motor is connected to the output %Q0001.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0001
Q I0003
Input
CPU
Output
When the Start pushbutton is depressed the CPU receives a logic 1 from input %I0001. This causes the %I0001 contact to close. All three inputs are now logic 1. The CPU sends a logic 1 to output %Q0001. The contactor is energized and the motor starts.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0001
Q I0003
Input
CPU
Output
39
When the Start pushbutton is pressed, output %Q0001 is now true and on the next scan, when normally open contact %Q0001 is solved, the contact will close and output %Q0001 will stay on even if the Start pushbutton has been released.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0001
Q I0003
Input
CPU
Output
The motor will continue to run until the Stop pushbutton is depressed. Input %I0002 will now be a logic 0 (false). The CPU will send a binary 0 to output %Q0001. The motor will turn off.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0001
Q I0003
Input
CPU
Output
40
When the Stop pushbutton is released %I0002 logic function will again be true and the program ready for the next time the Start pushbutton is pressed.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0001
Q I0003
Input
CPU
Output
@hqvturhyvphv
The application can be easily expanded to include indicator lights for RUN and STOP conditions. In this example a RUN indicator light is connected to output %Q0002 and a STOP indicator light is connected to %Q0003.
PLC
Input
Output
Motor
41
It can be seen from the ladder logic that a normally open contact %Q0001 is connected on Rung 2 to output %Q0002, and a normally closed %Q0001 contact is connected to output %Q0003 on Rung 3. In a stopped condition output %Q0001 is off. The normally open %Q0001 contacts on Rung 2 are open and the RUN indicator, connected to output %Q0002 light is off. The normally closed %Q0001 contacts on Rung 3 are closed and the STOP indicator light, connected to output %Q0003, is on.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0002 Q0001
"Run"
Q I0003 %Q0001 %Q0002 Rung 2 Input %Q0001 %Q0003 Rung 3 Output Q0003
"Stop"
CPU
42
When the PLC starts the motor output %Q0001 is now logic high (on). The normally open %Q0001 contacts on Rung 2 now switch to a logic 1 (closed) and output %Q0002 turns the RUN indicator on. The normally closed %Q0001 contacts on Rung 3 switch to a logic 0 (open) and the STOP indicator light, connected to output %Q0003, is now off.
Start I0001 %I0001 %I0002 %I0003 %Q0001 Rung 1 Stop I0002 %Q0001 Q0002 Q0001
"Run"
Q I0003 %Q0001 %Q0002 Rung 2 Input %Q0001 %Q0003 Rung 3 Output Q0003
CPU
43
The application can be further expanded by adding a limit switch with normally open contacts to input %I0004. A limit switch could be used to stop the motor or prevent the motor from being started. An access door to the motor, or its associated equipment, is one example of use of a limit switch. If the access door is open, the normally open contacts of MB, connected to input %I0004, are open and the motor will not start.
6qqvthyvvvpu
Start I0001 %I0001 %I0002 %I0003 %I0004 %Q0001 Rung 1 Stop I0002 %Q0001 Q0002 Q0001
"Run"
Q I0003 %Q0001 %Q0002 Rung 2 MB I0004 %Q0001 %Q0003 Rung 3 Input Output Q0003
"Stop"
CPU
44
When the access door is closed, the normally open contacts on the limit switch (MB) are closed. Input %I0004 is now on (logic 1), and the motor will start when Start pushbutton is pressed.
Start I0001 %I0001 %I0002 %I0003 %I0004 %Q0001 Rung 1 Stop I0002 %Q0001 Q0002 Q0001
"Run"
Q I0003 %Q0001 %Q0002 Rung 2 MB I0004 %Q0001 %Q0003 Rung 3 Input Output Q0003
"Stop"
CPU
The PLC program can be expanded to accommodate many commercial and industrial applications. Additional Start/Stop push-button and indicator lights can be added for remote operation, or control of a second contactor and motor. Over travel limit switches can be added along with proximity switches for sensing object position. The applications are only limited by the number of I/ Os and the amount of memory available on the PLC.
45
Srvr"
A. ____________________
B. ____________________
C. ____________________
2. In a statement list each new logic operation begins with a _____________ instruction. 3. Complete the following tables:
%I0001
%I0002
%Q0001
0 1 0 1
&
%Q0001
0 1 1
%I0004
%I0005
%Q0002
0 1 0 1
>1
%Q0002
0 1 1
46
4. In the following instruction %Q0001 will be true (logic 1) when________ or ___________ is true, and when ___________ is true.
%I0001
%I0003
%Q0001 Rung 1
%I0002
47
A field device that measures a varying value is typically connected via a converter or transducer, converting from one entity to another, e.g. pressure to current or resistance to voltage. In the following example a level sensor is connected to a level signal converter. The signal converter takes the varying resistance value of the level sensor and converts it to a variable voltage, 0-10 VDC. The 0-10 VDC signal is connected to an analog input, converting the voltage to a digital value. This enables the PLC to utilize the continuous value from the level sensor.
6hytv
Analog input
Analog outputs are used in applications requiring control capability of field devices which respond to continuous voltage or current levels. Analog outputs may be used as a variable reference for e.g. control valves, chart recorders, electric motor drives, analog meters, and pressure transducers. Like analog inputs, analog outputs are generally connected to a controlling device through a converter or transducer. The converter takes the voltage signal and, depending on the requirements, amplifies, reduces, or changes it into another signal which controls the device. In the following example a 0-10 VDC signal controls the speed of an electric drive motor via a frequency converter. The frequency converter changes the 010 VDC signal to a varying frequency, in this way varying the speed of the motor.
6hyt
Motor
48
6yvphvrhyr
An example of using analog inputs and outputs can be seen in the following illustration. A PLC is used to control the level of product in a tank. A product valve is controlling the flow of product to the tank and a level probe is sensing the level in the tank. The level probe is sensing the level of product and sends a corresponding value to a signal converter. The converter changes the level value into a 0-10 VDC signal, connected to an analog input. The current level is thus made available for the CPU, where the PLC program can determine necessary changes of the flow through the product valve. An analog output is feeding a 4-20 mA signal to an I/P transducer. The transducer is changing the signal into a corresponding air pressure, controlling the product valve and thus the product flow.
Product tank
Level probe
Product valve
I/P transducer
Signal converter
4-20 mA
Analog output
CPU
Analog input
0-10 VDC
49
Timers
Timers are devices that count increments of time. Traffic lights are one example where timers are used. Timers are used to control the length of time between signal changes. Timers are represented by function blocks in ladder logic. When a timer receives an enable, the timer starts to time. The timer compares its current time with the preset time. The output of the timer is a logic 0 as long as the current time is less than the preset time. When the current time is greater than the preset time the timer output is a logic 1. The GE Fanuc PLC uses three types of timers: On-Delay (TMR), Retentive On-Delay (ONDTR), and Off-Delay (OFDT).
TMR 0.10s
ONDTR 0.10s
OFDT 0.10s
PV
PV
PV
On-Delay
Retentive On-Delay
Off-Delay
50
Tr("
GE Fanuc System 90-30 timers are provided with resolutions of 0.001 second, 0.01 second, and 0.1 second. The maximum time delay of these timers are base on the maximum value of 32767. This converts to the maximum delay of 32.767 seconds, 327.67 seconds, and 3276.7 seconds, respectively. However, by adding program elements, logic can be programmed for much greater time intervals. A timer in the GE Fanuc System 90-30 uses registers in the PLC memory. A register is an entire word (16 bits) in the Reference table of the memory. Each register has an address, e.g. %R0001, in a similar way as a bit may have %I or %Q addresses. Note that each timer will use three consecutive registers to operate. If a timer is given an address, e.g. %R0001, it will also occupy %R0002 and %R0003. If another timer is to be used, it must be given its own unique address, e.g. %R0004.
P9ryhUHS
When the on-delay timer (TMR) receives an enable (logic 1), a predetermined amount of time (preset value - PV) passes before the timer output (Q) turns on.
(enable)
(Q)
(preset value)
PV (address)
51
In the following simple timer example, a switch is connected to input %I0001, and a light is connected to output %Q0001.
When the switch is closed input %I0001 becomes a logic 1, which enables timer %R0001. The timer has a time base of 0.1 seconds. The preset value has been set to 150. This is equivalent to 15 seconds (0.1 x 150). The light will turn on 15 seconds after the input switch is closed. If the switch were opened before 15 seconds had passed, then reclosed, the timer would again begin timing at 0.
%Q0001
150
PV %R0001
52
SrrvrP9ryh PI9US
A retentive on-delay timer (ONDTR) functions in a similar manner to the ondelay timer (TMR). There is one difference. The retentive on-delay timer times as long as the enabling input is on, but it does not reset when the input goes off. The timer must reset with a reset (R) instruction.
(enable)
(Q)
(reset)
(preset value)
PV address
The same example used with the on-delay timer will be used with the retentive on-delay timer. When the switch is closed at input %I0001 the timer %R0001 (retentive timer) begins timing. If, for example, after 10 seconds input %I0001 is opened the timer stops. When input %I0001 is closed the timer will begin timing at 10 seconds. The output will turn on 5 seconds after input %I0001 has been closed the second time. A reset (R) instruction can be added. Here a pushbutton is connected to input %I0002. If after 10 seconds input %I0001 were opened, %R0002 can be reset by momentarily closing input %I0002. %R0002 will be reset to 0 and begin timing from 0 when %I0001 is closed again.
%Q0001
150
PV %R0001
53
The off-delay timer is used to delay an output off for a fixed period of time after the input turns off. When the enabling bit turns on the timer output bit (Q) turns on immediately and the value is set to 0. When the input turns off, the timer counts until the preset time has elapsed before the timer output bit (Q) turns off.
Pss9ryhPA9U
(enable)
(Q)
(preset value)
PV (address)
In the following example a tank will be filled with two chemicals, mixed, and then drained. When the Start button is pressed at input %I0001, the program starts Pump 1 controlled by output %Q0001. Pump 1 runs for 5 seconds, filling the tank with the first chemical, then shuts off. The program then starts Pump 2, controlled by output %Q0002, Pump 2 runs for 3 seconds filling the tank with the second chemical. After 3 seconds the Pump 2 shuts off. The program starts the mixer motor, connected to output %Q0003 and mixes the two chemicals for 60 seconds. The program then opens the Drain valve controlled by output %Q0004, and starts Pump 3 controlled by output %Q0005. Pump 3 shuts off after 8 seconds and the process stops. A manual Stop switch is also provided at input %I0002.
Uvrrhyr
Pump 1 %Q0001
Pump 2 %Q0002
Process control
Start %I0001
Stop %I0002
Pump 3 %Q0005
54
Srvr#
1. Analog signals are converted into a ____________________ format by the PLC. 2. Three types of timers are available in the GE Fanuc 90-30: On-Delay, __________________ On-Delay, and __________________ Delay. 3. The maximum time available on a 0.1 second time base timer is _____________ seconds. 4. A count of 25 on a 0.01 second time base timer represents a time of _____________ seconds.
55
Counters
Counters used in PLCs serve the same function as mechanical counters. Counters compare an accumulated value to a preset value to control circuit functions. Control applications that commonly use counters include the following: Count to a preset value and cause an event to occur Cause an event to occur until the count reaches a preset value A packaging line machine, for example, may use a counter to count packages into groups for wrapping or packaging. Counters are represented as function blocks in ladder logic. Counters increment/decrement one count each time the input transitions from off (logic 0) to on (logic 1). The counters are reset when a reset instruction is executed. GE Fanuc system 90-30 uses two types of counters: up counter (UPCTR) and down counter (DNCTR). The counters may be used within the range of -32768 to +32767.
UPCTR
DNCTR
PV
PV
Up counter
Down counter
56
Tr("
A counter in the GE Fanuc System 90-30 uses registers in the PLC memory. A register is an entire word (16 bits) in the Reference table of the memory. Each register has an address, e.g. %R0001, in a similar way as a bit may have %I or %Q addresses. Note that each counter will use three consecutive registers to operate. If a counter is given an address, e.g. %R0001, it will also occupy %R0002 and %R0003. If another counter (or timer) is to be used, it must be given its own unique address, e.g. %R0004.
Vpr
The up counter counts up from a current value to a preset value (PV). The enable is the count input. Each time the enable transitions from a logic 0 to a logic 1 the counter increments by a count of 1. Input R is the reset. A preset count is stored in PV input. If the current count is equal to or greater than the preset value stored in PV, the output bit (Q) turns on.
(enable)
UPCTR
(Q)
(reset)
(preset value)
PV address
9pr
The down counter counts down from the preset value (PV) each time the enable transitions from a logic 0 to a logic 1. When the current value is less than or equal to 0 the counter output bit (Q) turns on. The counter resets and loads the current value with the preset value (PV) when the reset input (R) is enabled.
(enable)
DNCTR
(Q)
(reset)
(preset value)
PV address
57
Fast Scan
As discussed earlier, PLCs have a scan time. The scan time depends on the size of the program, the number of I/Os, and the amount of communication required. Events may occur in an application that require a response from the PLC before the scan cycle is complete. For these applications a fast scan function can be used.
The fast scan function of the PLC may be solved with a periodic subroutine. A periodic subroutine interrupts the program execution of the PLC scan on regular time intervals and executes a subroutine. The subroutine may be a separate block of logic that holds instructions to update selected inputs and outputs. Thus, the PLC can response to events faster than the regular PLC scan.
Qrvqvpivr
Read inputs
Execute program Read fast inputs Execute subroutine program Write fast outputs Diagnostics, Communication Execute program Read fast inputs Execute subroutine program Write fast outputs Execute program
UvrDrhy
Write outputs
58
Srvr$
1. Two types of counters used in system 90-30 are ___________________ and ___________________ . 2. Counters can count to a maximum of ___________________ . 3. Events that require an action from the PLC before the scan cycle is complete may be controlled with a ___________________ .
59
Review Answers
1. A: input module B: CPU C: output module D: programming device E: operator interface 2. 2 3. 16 4. Binary:1010 Hexadecimal: A BCD: 0001 0000
Srvr
1. 2. 3. 4. 5. 6. 7. 8.
discrete or digital discrete or digital CPU Ladder logic rung programme memory, reference table, configuration area 1024 firm ware
Srvr!
Srvr"
0 0 1 1
0 1 0 1
0 0 0 1
%I0004
%I0005
%Q0002
0 0 1 1
0 1 0 1
0 1 1 1
60
Srvr#
1. 2. 3. 4.
Srvr$
61
62
3
Hardware
Hardware - Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Baseplates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 Digital input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Digital output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 Analog input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 Analog output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Analog combination module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 Thermocouple input module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 PCM - Programmable co-processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 GCM - Genius communication module . . . . . . . . . . . . . . . . . . . . . . . . . .49 Review questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
TM-00275
Hardware
Introduction
Upon completion of this section you should be able to identify the PLC system modules, locate and replace defective modules. identify system modules - used by Tetra Pak - on the machine, in the EM and the SPC identify input and output addresses in the EM and on the machine identify defect Power supply, CPU, and I/O modules - used by Tetra Pak with support of LEDs, voltmeter and PC replace modules
This section contains selected information on GE Fanuc Series 90-30 hardware. For further information, please refer to the GE Fanuc reference manuals, such as: GFK-0898, Series 90-30 PLC I/O Module Specification GFK-0356, Series 90-30 PLC Installation and hardware manual MAN0095-12, High Resolution Thermocouple
Further information
TM-00275
Overview
The GE Fanuc PLC System 90-30 is a modular PLC system. By including the necessary types and number of components, the PLC may be adapted for individual applications. The PLC system is built up with racks. A rack typically consist of a Baseplate holding modules such as Power supply, CPU, and I/O modules. Other modules, for special purposes, may also be housed in a baseplate.
CPU module
I/O modules
Baseplate
A PLC system may consist of one or several racks, depending on application requirements. There may be a maximum of eight racks in a system.
Add/remove modules
Modules may easily be added to, or removed from, a baseplate. However, the power must be off while doing this. Note that attempts to force a module into a baseplate slot may result in damage to the module and/or the baseplate. Modules will mount in the correct slot type easily and with a minimum of force.
TM-00275
To install a module in the baseplate: 1. Grasp the module with the terminal board toward you and the rear hook facing away from you. 2. Align the module with the desired base slot and connector. Tilt the module upward so that the top rear hook on the module engages the slot on the baseplate. 3. Swing the module downward until the connectors mate and the locking lever on the bottom of the module snaps into place, engaging the baseplate notch.
Installing modules
Rear hook
To remove the module: 1. Locate the release lever on the bottom of the module. Firmly press it up toward the module. 2. While holding the module firmly at the top, continue fully depressing the release lever and swing the module upward. 3. Disengage the rear hook at the top of the module by raising the module up and moving it away from the baseplate.
Removing modules
Rear hook
Release lever
TM-00275
Removing terminals
The terminal assembly of all Series 90-30 modules can be removed from the module. To remove the terminal assembly: 1. Open the hinged cover on the front of the module. 2. There is a jacking lever above the wiring terminals, on the left. Push this lever upward to release the terminal block.
Jacking lever
3. Grasp the narrow pull-tab located at the right of the retaining tab. Pull the tab toward you until the contacts have been separated from the module housing and the hook has disengaged.
Pull-tab
TM-00275
To install the terminal assembly: 1. If the pull-tab at the terminal assembly is extended, push it back. Close the terminal door. 2. Place the hook at the bottom of the terminal assembly into the corresponding slot at the bottom of the module. 3. Pivot the terminal assembly upward and firmly press it into position. 4. Open the door and check to be sure that the latch is securely holding the terminal assembly in place.
Installing terminals
Pull-tab
Terminal door
Hook
TM-00275
Baseplates
A baseplate is composed of the three main parts: a circuit board mounted to a metal back-plate with a plastic cover. The circuit board, called a backplane, contains sockets for plug-in modules. The metal back-plate has four holes for mounting the baseplate, and retainer slots for mounting the modules. The plastic cover provides protection for the circuit board and hold printed labels such as the baseplate description, serial number, and slot number labels.
PROGRAMMABLE CONTROLLER
BASE 5SLOT
E X P A N S I O N
CAUTION USER PROGRAM AND REGISTER VALUES MAY BE LOST IF POWER SUPPLY IS REMOVED FOR LONGER THAN 1 HOUR
NON-CPU SLOTS
P U
POWER SUPPLY
CPU/1
I/O-2
I/O-3
I/O-4
I/O-5
Baseplate types
There are three basic types of baseplates: CPU baseplate. The baseplate housing the CPU of the PLC system. These baseplates come in two variants: the Embedded, where the CPU is built-in into the baseplate, and the Modular, where a CPU module is to be pluggedin into a slot. This baseplate will always be called Rack 0 (zero) in a PLC system. Expansion baseplate. The baseplates added to the CPU baseplate in a multi baseplate PLC system. These baseplates do not contain or house a CPU, and cannot operate on its own. Remote baseplate. A special expansion baseplate that can operate on a far distance from the CPU baseplate. Series 90-30 baseplates come in two sizes: 5-slot baseplate 10-slot baseplate Note that the power supply slot is not numbered. So a 5-slot baseplate has slots for a power supply module and five other modules, and a 10-slot, for ten other modules.
Baseplate sizes
TM-00275
Each baseplate in a Series 90-30 system is identified with a unique number called a Rack number. Rack numbers for Expansion and Remote baseplates are selected by setting a DIP switch, located on each baseplate directly above the connector for Slot 1.
Rack numbering
G E F an u c
SERIES 9030 PROGRAMMABLE CONTROLLER BASE 10SLOT EXPANSION
X X 3 X = CLOSED
Rack number 0 must always be present and is assigned, by default, to the CPU rack. Note that Rack numbers must not be duplicated within a system. The following table shows the DIP switch positions for rack number selection.
Rack Number DIP Switch 1 2 3 1 open closed closed 2 closed open closed 3 open open closed 4 closed closed open 5 open closed open 6 closed open open 7 open open open
TM-00275
Connecting baseplates
The baseplates are connected via I/O expansion cables. The first cable connects from the CPU baseplate (Rack 0) to the first expansion baseplate (Rack 1). The second cable plugs in on top of the first cable and into the next expansion baseplate (Rack 2), and so on. The last baseplate in the system, Rack 4 in the example below, must have an I/O bus terminator plug installed.
Rack 0
C P U
Rack 1
Rack 2
Rack 3
Rack 4
TM-00275
Power supply
The power supply module is providing power to the PLC system. One power supply module per rack is required in a 90-30 system. The module must be installed in the left most slot in all baseplates. The standard power supply is a 30 watt supply that can operate from an input voltage source in the range of 85 to 264 VAC, or 100 to 300 VDC. The power supply provides three outputs: +5 VDC, for internal use in the PLC. +24 VDC relay output, for power to output relay modules. +24 VDC isolated output, used internally by some modules and can also be used to provide external power for input modules.
PWR
GE Fanuc
SERIES 9030
STANDARD POWER SUPPLY
OK RUN BATT
B A T T E R Y
Serial port
Backup battery
Four LEDs are located on the upper right front of the power supply. The purpose of these LEDs is: PWR The top green LED, labelled PWR, provides an indication of the operating state of the power supply. The LED is on when the power supply has a correct source of power and is operating properly, and off when a power supply fault occurs or power is not applied.
10
TM-00275
OK The second green LED, labelled OK, is steady on if the PLC is operating properly, and off if a problem is detected by the PLC. The LED is flashing during the self test at start-up of the PLC. RUN The third LED, labelled RUN, is steady on when the PLC is in the RUN mode. BATT The bottom red LED, labelled BATT, will be on if the memory backup battery voltage is too low to maintain the memory under loss of power condition; otherwise it remains off.
Serial port
The connector, accessed by opening the door on the right front of the power supply, is a RS-485 compatible serial port. The port provides a connection to the programming device. A special cable with an adapter is required. This port must be used to connect to CPUs that are built-in into the baseplate. CPU modules may provide programming device access through a serial port on the CPU module. Note The power supply serial port connector is only functional in a power supply that is installed in a CPU baseplate (Rack 0). It will not be functional on an expansion baseplate.
Backup battery
The backup battery, used to maintain the RAM memory of the CPU, is accessed by removing the cover plate at the bottom of the front of the power supply. The battery is mounted on a plastic clip on the inside of the cover. The 3V lithium battery connects to the CPU via cables to the battery connector on the power supply module.
BATTERY CONNECTOR
Note If a low battery warning occurs, that is if the BATT LED is on, the battery must be replaced before removing power from the rack, or the memory may be lost. Only the battery in the CPU rack need to be replaced. Besides the backup battery, the RAM memory of the CPU is further protected by a super capacitor installed inside the CPU module. This can store enough charge to maintain the memory for one hour if the battery is disconnected.
TM-00275
11
12
TM-00275
CPU
The CPU, Central Processing Unit, is the controlling part of the PLC. It contains the program which controls a machine. The CPU consists of two main parts: Processor: Each CPU contains a microprocessor which executes the commands issued in the program, and handles all communication with other units, such as I/O modules and programming device. Memory: The memory of the CPU consists of EPROM, EEPROM or Flash memory for the system software (firmware), and battery protected RAM for the users application program. There are several CPU models available for the Series 90-30 PLC which differ in speed, I/O capacity, size of user memory, and features. The CPU model is chosen to suit the individual application. There are two basic types of CPUs, the Embedded and the Modular.
Embedded CPU
The embedded CPU fulfil the need of low cost but lack the capacity, expansibility, and versatility of the modular systems. In the embedded types, the CPU is built into the baseplate. The CPU and the memory chips are soldered to the backplane board of the baseplate.
PROGRAM PROM 1
CAUTION USER PROGRAM AND REGISTER VALUES MAY BE LOST IF POWER SUPPLY IS REMOVED FOR LONGER THAN 1 HOUR
P U
POWER SUPPLY
I/O-1
I/O-2
I/O-3
I/O-4
I/O-5
The embedded CPUs are available in both 5-slot and 10-slot baseplates. Note that the embedded CPUs do not support the use of any expansion baseplates. For applications that require higher number of modules, a modular CPU system will have to be used.
TM-00275
13
In the modular CPU types, the CPU is contained inside a plug-in module. Only one CPU is allowed per system and it must be mounted in a CPU baseplate. There are several different modular CPU models available. The models differs in capacity, features, and physical appearance. Examples of a modular CPUs are shown below.
Modular CPU
CPU341
CPU 351
SNP P1 P2
LED indicators
ON/RUN OFF/ STOP
Key switch
PORT 1 RS-232
Communication ports
PORT 2 RS-485
Some CPU models hold various indicators, switches and communication ports. The LED indicators typically indicate the status of communication port activity on the CPU. The LEDs will flash when data is transferred through the port and remain off when the port is inactive. The Key switch is, by default, a memory protection switch for the CPU firmware. The key must be set to OFF to enable changes or updates of the firmware. In addition, the switch can be configured as a RUN/STOP switch for the PLC scanning and/or as a memory protect ON/OFF switch for the user program RAM. The Communication ports may be used for communication with external units. Note that some ports may be used for communication with the programming device.
14
TM-00275
CPU models
There are several CPU models available for the Series 90-30 PLC which differ in speed, I/O capacity, size of user program memory, and features. The following table describes some capacities and operating features of the CPU models.
CPU Model CPU311 CPU313 CPU323 CPU331 CPU340 CPU341 CPU350 CPU351 CPU352 CPU360 CPU363 CPU364
CPU Type Embed 5-slot Embed 5-slot Embed 10-slot Modular Modular Modular Modular Modular Modular Modular Modular Modular
Speed (MHz) 10 10 10 10 20 20 25 25 25 25 25 25
Processor 80188 80188 80188 80188 80C188XL 80C188XL 80386EX 80386EX 80386EX 80386EX 80386EX 80386EX
Input points 160 160 160 512 512 2048 2048 2048 2048 2048 2048 2048
Output points
Note that there are several other differences between the CPU models. Some of the features that differs are: Override (force) of I/Os is only available with the Modular CPUs. The embedded CPUs do not support this feature. Fast scan (periodic subroutine) is only available with CPU341 through CPU364. Floating point math is only available with CPU350 through CPU364.
TM-00275
15
The CPU 313 is a 5-slot baseplate with embedded CPU. It is commonly used for controlling Distribution Equipment within Tetra Pak.
CPU 313
CPU 313
16
TM-00275
CPU 341
The CPU 341 is a modular CPU and enables use of up to five racks within the PLC system. It is commonly used in PLCs for controlling Distribution Equipment and older Filling Machines within Tetra Pak.
CPU 341
TM-00275
17
The CPU 351 is a modular CPU and enables use of up to eight racks within a system. It is commonly used in PLCs for controlling Filling Machines, but also Distribution Equipment, within Tetra Pak.
CPU 351
LED indicators
Key switch
Port 1 Port 2
The LED indicators indicate the status of serial port activity on the CPU. The LEDs will flash when data is transferred through the port and remain off when the port is inactive. The SNP LED refers to the port that uses the serial connector on the PLCs power supply. The P1 and P2 LEDs refers to Port 1 and Port 2 on the CPU module. The Key switch is, by default, a memory protection switch for the CPU firmware. The key must be set to Off to enable changes or updates of the firmware. In addition, the switch can be configured as a Run/Stop switch for the PLC scanning and/or as a memory protect On/Off switch for the user program RAM. The Port 1 serial port is RS-232 compatible and may be used communication with external units. The Port 2 serial port is RS-485 compatible and may be used communication with external units. Note that this port can be used for communication with the programming device.
18
TM-00275
Contact plates for completely clearing the user program RAM memory is accessible from the rear of the CPU module. The contact plates, MEM CLR pad, are soldered onto the circuit board and located just above the baseplate slot connector. By shorting the plates the RAM memory is completely cleared.
Slot connector
Rear view
Note The MEM CLR pad does not exist on older revisions of this CPU model.
TM-00275
19
The CPU 364 consists of a CPU and an Ethernet Interface combined in one module.
CPU 364
LED indicators
Key switch
AAUI port
10Base T port
Front view
The LED indicators indicate the status of port activity on the CPU. The PS PORT LED refers to the CPU serial port. This LED will flash while data is being transferred through the SNP serial port connector on the PLC power supply, and will stay off when the port is inactive. The EOK, LAN, and STAT LEDs relate to the Ethernet interface. These can be ON, OFF, FLASHING slow, or FLASHING fast in several different combinations. The Key switch is, by default, a memory protection switch for the CPU firmware. The key must be set to Off to enable changes or updates of the firmware. In addition, the switch can be configured as a Run/Stop switch for the PLC scanning and/or as a memory protect On/Off switch for the user program RAM. The Ethernet restart push button performs four functions: LED test, Restart, Restart and enter Software Load state, and Restart and enter Maintenance state. These are detailed in GFK-1541.
20
TM-00275
The Port 1 is a RS-232 compatible serial port and may be used for communication with external units, such as terminals. The AAUI Port may be used to connect to an external Ethernet compatible transceiver. The 10Base T port provides a direct connection to a 10Base T (twisted pair) Ethernet network without the need for an external transceiver.
TM-00275
21
This 24 volt DC Positive/Negative Logic Input module provides 16 input points in one group with a common power input terminal. This input module is designed to have either positive logic or negative logic characteristics. Current into an input point results in a logic 1 in the CPU.
LED indicators
Input terminals
Wiring information
LED indicators which provide the ON/OFF status of each point are located at the top of the module. This LED block has two horizontal rows with eight green LEDs in each row; the top row labelled A1 through 8 (points 1 through 8) and the bottom row labelled B1 through 8 (points 9 through 16). The Input terminals are located behind the hinged door. Wiring information is printed on the inside of the door.
22
TM-00275
The input voltage range is specified to 0 to 30 VDC, where the on-state voltage is 11,5 to 30 VDC and the off-state is 0 to 5 VDC. The response time is typically 7ms. This input module is also available in a Fast version, where the response time is 1 ms.
TM-00275
23
24
TM-00275
TM-00275
25
This 24 volt DC Positive/Negative Logic Input module provides 32 input points in four isolated groups with eight points in each group. The inputs are positive or negative logic inputs and will operate at levels up to 30V. Current into an input point results in a logic 1 in the CPU.
LED indicators
24-pin connectors
Front view
LED indicators provide the ON/OFF status of each point. The inputs are arranged in four isolated groups of eight (A1 - A8, B1 - B8, C1 - C8, and D1 D8); each group has its own common. Connections to the input circuits are made via two 24-pin connectors mounted on the front of the module. The connector mounted on the right of the module (front view) interfaces with groups A and B. The connector on the left side of the module interfaces with groups C and D. The on-state voltage is 15 VDC minimum and the off-state is 6 VDC maximum. The response time is specified to 2 ms maximum.
26
TM-00275
The Input Simulator module has 16 two-position switches on the front of the module. Each switch can be programmed as a discrete input device. This module allows simulation of either 8 point or 16 point input modules.
LED indicators
Front view
Rear view
A mode switch, located in the rear of the module, allows configuration of the module for either 8 or 16 points. When the mode switch is in up-position it is set for 8 points and only the first 8 inputs can be used. With the switch in down-position all 16 inputs can be used. An input switch in the ON position (right hand position) results in a logic 1 in the CPU. The status of the inputs are shown on the corresponding LED indicators.
TM-00275
27
The 12/24 VDC Positive Logic 1 Amp Electronic Short Circuit Protection (ESCP) Output module provides 16 output points in two groups of eight with a common power output terminal for each group. This output module is designed to have positive logic.
LED indicators
Input terminals
Wiring information
The Output terminals are located behind the hinged door. Wiring information is printed on the inside of the door. LED indicators that provide the ON/OFF status of each point are located at the top of the module. This LED block has two horizontal rows with eight green LEDs in each row with the top row labelled A1 - A8 (points 1 through 8) and the bottom row labelled B1 - B8 (points 9 through 16).
28
TM-00275
A red LED (labelled F) on the right, centered between the two rows of green LEDs, functions as a tripped electronic short circuit protection indicator; it turns ON when any short circuit protection trip occurs. If a short circuit occurs, the output points in the group turn off and the red LED turns on. The LEDs indicating output point status will not turn off. This protection does not protect individual outputs from exceeding their ratings, but will protect the board in case of a short circuited load. To reset electronic short circuit protection remove the 12/24 VDC user supply to the module. The module has two electronic short circuit protection circuits; each protects eight outputs - the first circuit protects A1 - A8, the second circuit protects B1 - B8. The module current is 1 A maximum per output and 4 A maximum per group of eight outputs. The On and Off response time of the outputs are 2 ms maximum.
TM-00275
29
30
TM-00275
TM-00275
31
The 16-Channel Analog Current Input module provides up to 16 single-ended input channels, each capable of converting an analog input signal to a digital value for use as required by the application. This module provides three input ranges: 4 to 20 mA 0 to 20 mA 4 to 20 mA Enhanced The default range is 4 to 20 mA, scaled so that the range corresponds to the count 0 to 32000. The other ranges are selected by changing the configuration using a programming device. The 0 to 20 mA range corresponds to the count 0 to 32000. The 4 to 20 mA Enhanced corresponds to the count -8000 at 0 mA, 0 at 4 mA, and +32000 at 20 mA. Thus, the Enhanced range provides for open wire fault detection.
LED indicators
Input terminals
Wiring information
32
TM-00275
The Input terminals are located behind the hinged door. Wiring information is printed on the inside of the door. LED indicators, located at the top of the module, provide module and user supply status. The top LED, OK (Module OK) provides module status information on power-up as follows: ON: status is OK, module configured OFF: no backplane power or software not running Continuous rapid flashing: configuration data not received from CPU Slow flashes, then OFF: failed power-up diagnostics or encountered code execution error The bottom LED, USOK (User Supply OK), indicates that the user provided 24V supply is within specifications, thereby enabling the analog side of the module to work properly.
Combination 1 2 3 4 5 6
Status
Description Module OK and configured User power is present Module OK but not configured No user power Module OK but not configured User power is present Module OK and configured No user power Module is defective or no +5V present User power may or may not be present Module not OK User power is present
= ON = FLASHING = OFF
TM-00275
33
34
TM-00275
TM-00275
35
The 8-Channel Analog Current/Voltage Output module provides up to eight single-ended output channels with current loop outputs or voltage outputs. Each analog output channel is capable of providing two current output ranges or two voltage output ranges. Each channel can be individually configured for the output range required for the application. All ranges can be configured using the programming device. The default range is 0 to +10 volts. Configurable current and voltage output ranges are: 0 to +10 volts (unipolar) 10 to +10 volts (bipolar) 0 to 20 mA 4 to 20 mA Each channel is capable of converting 15 to 16 bits (depending on the range selected) of binary (digital) data to an analog output for use as required by the application.
LED indicators
Input terminals
Wiring information
36
TM-00275
The Output terminals are located behind the hinged door. Wiring information is printed on the inside of the door. LED indicators, located at the top of the module, provide module and user supply status. The top LED, OK, provides module status information and the bottom LED, USOK, indicates whether the user supply is present and is above a minimum designated level. The LEDs have six possible status combinations, which are described below.
Combination 1 2 3 4 5 6
Status
Description Module OK and configured User power is present Module OK but not configured No user power Module OK but not configured User power is present Module OK and configured No user power Module is defective or no +5V present User power may or may not be present Module not OK User power is present
= ON = FLASHING = OFF
TM-00275
37
38
TM-00275
TM-00275
39
The Analog combo module provides up to 4 differential input current or voltage channels and 2 single-ended output channels with either current loop outputs or voltage outputs. Each channel can be individually configured for the current or voltage range, as applicable, required for the application. All module configuration is done through software, except for a jumper required for selecting the current input mode. All ranges can be configured using a programming device.
LED indicators
Input terminals
Wiring information
The I/O terminals are located behind the hinged door. Wiring information is printed on the inside of the door. LED indicators, located at the top of the module, provide module and user supply status.
40
TM-00275
The top LED, OK, provides module status information and the bottom LED, USOK, indicates whether the user supply is present and is above a minimum designated level. The LEDs have six possible status combinations, which are described below.
Combination 1 2 3 4 5 6
Status
Description Module OK and configured User power is present Module OK but not configured No user power Module OK but not configured User power is present Module OK and configured No user power Module is defective or no +5V present User power may or may not be present Module not OK User power is present
= ON = FLASHING = OFF
TM-00275
41
42
TM-00275
TM-00275
43
The High Resolution Thermocouple Input Module performs all analog and digital processing of the thermocouple signal in the module. This high-resolution module has a resolution of 0.1C, and temperature values may be reported to the PLC I/O table in 0.5C, 0.5F, 0.1C, or 0.1F increments. The module features eight thermocouple channels whose temperature values are reported to PLC registers. There are 16 alarm bits, one open circuit alarm and one set point alarm for each channel. Alarm set-points are set for each channel through 8 PLC registers (%AQ).
10-pin connector
Input terminals
Wiring information
The Input terminals are located behind the hinged door. Wiring information is printed on the inside of the door. The 10-pin connector, located at the top of the module, provide connection for calibration. For calibration of the module, a special calibration kit (cables and software) is required. The calibration kit can be ordered using the Tetra Pak part number 90031-312. See the Maintenance Manual for how to use the kit.
44
TM-00275
Configuration of the thermocouple input module is done using a programming device. Information on what PLC addresses to use, type of thermocouple and other parameters, will have to be specified.
TM-00275
45
46
TM-00275
PCM 301
The PCM 301 module, is a microcomputer designed to perform co-processor functions in a PLC system. The PCM is closely coupled to the Series 90-30 PLC and may be configured to function as an independent communication port. The PCM communicates with the PLC CPU over the backplane and can access user and system data. No application support is required in the PLC CPU. Each PCM occupies a single slot in a PLC rack. The PCM is programmed with a special software package.
LED indicators
Restart/Reset button
Backup battery
Communication port
A Backup battery is installed inside the module front cover. This lithium battery maintains user memory when power is removed. Before the battery reaches the end of its useful life, a low battery fault is reported in the PLC fault table. When replacing a lithium battery, be sure to connect the new battery into the unused PCM battery connector before removing and discarding the old battery.
TM-00275
47
The Restart/Reset button can be used to reset and restart the programmable co-processor. The Communication port is a serial connector which supports both RS-232 and RS-485 operation. The single serial connector supports two ports. Port 1 has a fixed interface and uses RS-232 operation only. The port 2 supports either RS-232 or RS-485 operation. Three LED indicators are located at the top of the module. The OK LED indicates the current status of the PCM. It has three states:
State Off
Description When the LED is off, the PCM is not functioning. This is the result of a hardware malfunction. Corrective action is required in order to get the PCM functioning again. When the LED is on steadily, the PCM is functioning properly. Normally, this LED should always be on, indicating that the diagnostic tests were successfully completed and the configuration data for the module is good. The LED flashes during power-up diagnostics.
On
Flashing
The PCM has a hardware watchdog timer that is periodically reset by the PCM software. If the watchdog timer expires, the PCM stops functioning and the OK LED turns off. The USER1 and USER2 are User-Defined LEDs. By default, these LEDs blink to indicate activity on the serial port. USER1 blinks when port 1 sends or receives. USER2 blinks when port 2 sends or receives. The use of either or both user LEDs may be redefined.
48
TM-00275
GCM+ module
The Series 90 30 Enhanced Genius Communications Module, GCM+, is an intelligent module that provides automatic global data communications between a PLC and up to 31 other devices on a Genius bus. The GCM+ module can be located in any standard Series 90-30 CPU rack, expansion rack, or remote rack. Its configuration is done using the programming device and system programming software.
LED indicators
Connection terminals
Wiring information
Bus connections are made to the Connection terminals located inside the module door. Wiring information is printed on the inside of the door.
TM-00275
49
LEDs indicators on the front of the GCM+ module indicate its operating status, and the status of communications between the module and the PLC. The OK LED indicates that the GCM+ has passed its power up test and is operating. The COM LED indicates that the GCM+ is configured and is transmitting or receiving global data. If either OK or COM is off or blinking, look for the following causes:
Combination 1 2 3 4 5
Status
Description Normal operation Intermittent bus operation Genius Bus Address conflict Module not configured, or no communications No power or fatal power up error
= ON = FLASHING = OFF
50
TM-00275
TM-00275
51
Review questions
1. The Backup battery is to be replaced in a PLC system including three expansion racks. In which of the racks should the battery be replaced? 2. The F LED on a digital output module lights up. What is the reason and how should it be reset? 3. Is it possible to communicate with the CPU through the serial port on a power supply module located in an expansion rack? 4. Must the CPU module be grounded? 5. The input voltage to a digital input module is 7 volts. Will the input assume logic 0 or a logic 1? 6. One of the two LED indicators on an analog module is flashing. Will the module work properly? 7. A group of DIP-switches are located on expansion baseplates. What is the function of the switches? 8. 24 volts is measured on the input terminal of an analog voltage input module. Is it a proper input signal? 9. Which functions can the key switch on a CPU module have? 10.When do we need Thermocouple input modules? 11.What is the principle of a Genius communication module? 12.The PLC is turned from RUN to STOP. What will happen to digital and analog output modules?
52
TM-00275
4
Configuration
Configuration Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Further Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Programming Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Changing Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Change of CPU Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Change of PLC ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Configuring Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Moving a Module to Another Slot. . . . . . . . . . . . . . . . . . . . . 11 Replacing the Module with Another of the Same Type . . . 11 Replacing the Module with One of a Different Type . . . . . 11 Deleting the Configuration of a Module . . . . . . . . . . . . . . . . 11 Configuration Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
TM-00276
TM-00276
Configuration
Introduction
Upon completion of this section you should be able to configure a PLC system as follows, according to Tetra Pak Rebuilding Descriptions. Describe why system configuration is necessary. Be able to change CPU type and settings. Be able to change, add, move, and delete a module. Be able to set and change CPU ID (identity). Be able to change settings for analog modules.
This section contains selected information on GE Fanuc Series 90-30 configuration. For further information, please refer to the GE Fanuc reference manuals, such as: GFK-0466, LM 90 Programming Software Users Manual GFK-1670, VersaPro Programming Software Users Guide
Further Information
TM-00276
Overview
With hardware configuration you link the physical hardware of your system to the reference addresses used in the PLC program. The hardware configuration data must be stored into the CPU. Typical steps in configuring your PLC rack system include: Configuring the rack type and power supply. Selecting the CPU for the rack system. Configuring modules and customizing parameters for your application. Configuring Genius Buses, if applicable. Configuring Ethernet Global Data (EGD) exchanges and Name Resolution information, if applicable. Formatting the Configuration Data, which is automatically performed as part of Save, so that it can be stored to the PLC. Only the configured hardware will operate in the PLC rack system. However, hardware modules may be mounted in the rack, but will not operate if not included in the configuration.
Power Supply
%Q17---%Q32
%I01------%I16
%I71------%I32
%I33------%I48
%Q01---%Q16
%Q33---%Q48 %Q33---%Q48
Read inputs
Execute program
CPU
Power Supply
%I10------%I16
%I71------%I32
%I33------%I48
%Q01---%Q16
%Q17---%Q32
Note It is necessary to have a correct hardware configuration before running a PLC program, to ensure a proper operation of the PLC system. An incorrectly configured system may result in malfunction. For example, an output address in the PLC program may not reach its output module.
TM-00276
Digital Output
CPU
Digital Input
Digital Input
Digital Output
Digital Input
Digital Input
Hardware configuration is performed using a separate part of the programming software that is LogicMaster 90 or VersaPro. Their graphic user interfaces differ, but the procedures are similar. Examples of user interfaces for configuration with the different programming softwares are shown below.
Programming Software
LogicMaster 90
VersaPro
TM-00276
The selection of CPU for your system will also determine the number of available racks. Some CPU models are embedded and do not allow any expansion racks. Other CPU models are modular and allow up to four or seven expansion racks. The CPU rack is referred to as Main or Rack 0. The expansion racks are referred to as Rack 1, Rack 2, etc. When configuring your system, make sure that the intended rack is selected. Note also that there must be a power supply module installed and configured in each rack of your system.
Configuration Parameters
Several parameters may be configured for each part of the hardware. The parameters for the individual parts of hardware modules, are accessed by zooming (LogicMaster 90) or double clicking (VersaPro) on the module. Examples of parameters to configure are shown below.
Analog Output
Analog Combo
Power Supply
Digital Output
Digital Input
Digital Input
Thermocouple
Digital Output
Analog Input
CCM Intelligent boards: Mode Interface Data Rate Flow Control Parity Time out etc.
CPU: CPU Type SNP Number (CPU-ID) Power-up Mode Sweep Mode Time and Date
CPU
Analog I/O: Module Type Reference Address Stop Mode Channel Data
Note that this example does not cover all module types and all configurable parameters. Always refer to your Rebuilding description or Reference manual for complete information!
TM-00276
Changing Configuration
If hardware changes are made to the PLC system, the hardware configuration must be updated accordingly.
Right-click the mouse and you get the context sensitive menu.
TM-00276
1. Model 331 or higher CPUs must be located in slot 1 of rack 0. Move the cursor to this slot by pressing the cursor movement keys.
TM-00276
Change of PLC ID
The SNP ID or CPU ID is an identifier that distinguishes the device from other devices in a network. This identifier number need to be set only if your PLC system is part of a network, such as PLMS-Line-supervision.
TM-00276
Configuring Modules
To configure, for example, a 90-30 I/O module: 1. Move the cursor to the slot where the module will be located and press Module 30 I/O (F1).
Press ALT-H to display help information for further explanations. 2. The next screen lists the catalogue numbers and available modules of the type you selected. For example, when F1 is pressed, the following screen is displayed.
Press Rack (Shift-F1) or the Escape key to return to the rack display.
TM-00276
10
To move the configuration of a module to another slot: 1. With the cursor at the configuration to be moved, press Delete (Shift-F4). Enter Y (Yes) after prompt DELETE displayed module from slot? (Y/N). The configuration of the slot will be deleted. 2. Move the cursor to the new location; it may be in another rack. 3. Press Undelete (Shift-F5). The deleted configuration will appear in the new location. The reference address will not be affected.
To change the configuration of a slot by replacing the module with another of the same type: 1. Place the cursor at the slot to be changed. 2. Press Zoom (F10) to display the modules detail screen. 3. Use one of the function keys to select a new module type for the slot. With the list of available modules displayed, move the cursor to the correct module and press the Enter key. Then, enter Y (Yes) after the prompt REPLACE displayed module? (Y/N). 4. Complete the configuration; then press Rack (Shift-F1) or the Escape key to return to the rack display.
To change the configuration of a slot by replacing the module with one of a different type: 1. Place the cursor at the slot to be changed. 2. Press the function key that represents the type of module you want to place in the slot. 3. After confirming the deletion of the existing module, the module selection screen is displayed. 4. Complete the configuration; then, press Rack (Shift-F1) or the Escape key to return to the rack display.
To delete the configuration of a module: 1. Place the cursor on the module and press Delete (Shift-F4). Enter Y (Yes) after prompt DELETE displayed module from slot? (Y/N). The configuration of the slot will be deleted. 2. To return the configuration to the slot, press Undelete (Shift-F5).
11
TM-00276
Configuration Examples
The following pictures are overviews of the TBA/21 050V physical hardware and the chosen reference addresses.
TM-00276
12
13
TM-00276
TM-00276
14
Review Questions
1. Why is hardware configuration necessary? 2. Why is CPU ID / SNP ID necessary? 3. Where is the hardware configuration data stored? 4. What will happen if you use outputs in the PLC program which are not configured in the hardware configuration? 5. What is the meaning of the parameter Stop Mode for analog output modules?
15
TM-00276
TM-00276
16
5
Memory Organisation
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Register References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Discrete References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Transitions and Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Retentiveness of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Program Structure Principles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
TM-00277
TM-00277
Memory Organisation
Introduction
Series 90 programs and configuration data are stored in folders. A folder is an MS-DOS subdirectory which contains all information about one PLC program. To store more than one PLC program, you need to have one folder for each program. Folders must be created using the LogicMaster 90 or the VersaPro software. An existing MS-DOS directory cannot be used as a folder.
CPU Configuration I/O Configuration Program Logic Reference Tables Rung Comments Backup Teach Files
Program Folders
PROGRAM FOLDER
A drawer is a directory path which contains one or more folders. Folders are always created from LogicMaster 90 or VersaPro. When using LogicMaster 90, the drawer must be created in MS-DOS/ Windows. The drawer name is then:
C:\LM90\
Drawer
that is C:\the subdirectory\. The default drawer may be changed from the Select screen by pressing ALTC to clear the Program Folder field and then entering the MS-DOS directory path (ending in \) of the subdirectory containing the folders you want. For example:
C:\LM90 Progr1 Backup C:\LM90 Progr2 Backup C:\LM90 Temp Backup
TM-00277
program and monitor its operation when you do not have the original folder on your machine. Note Annotation files (nicknames, reference descriptions, and comment text) remain in the folder and are not stored to the PLC. Therefore, when loading a program from the PLC to the TEMP folder, the annotation will be missing. Those files are still in the original folder where the program was developed. If another program was developed in the TEMP folder prior to the download operation, the annotation in the recently loaded program will actually belong to the previous program.
Note Do not use MS-DOS or Windows to copy individual files from one folder to another or to delete files. Doing so may produce unexpected results. MS-DOS or Windows may only be safely used to copy an entire program folder to another program folder of the same name. If MS-DOS functions have been used to place program files into a program folder with a different name, you will not be able to select the program folder. To use a program folder function, press Folder (F8) from the main menu.
To create a new program folder or use one that already exists, press Select (F1) from the Program Folder Functions menu.
TM-00277
The Auto (F3) soft key is only active when the select screen is displayed. When F3 is pressed in OFFLINE mode or if the programmer is not communicating with the PLC, a message is displayed indicating that the auto-select function is not available in that mode. When F3 is pressed in MONITOR or ONLINE mode, the programming software checks to see if a folder exists under the current directory whose name matches the name of the program in the PLC. If the folder does exist, it is automatically selected. The software then attempts to verify the program or configuration in the folder with that in the PLC, and updates the equality field on the status line based on the result. After the select screen is exited, the main menu is displayed. In the programming software, if a matching folder does not exist, the following message is displayed: Folder matching PLC name not found; load program to TEMP folder? (Y/N). If N (No) is entered, no folder is selected and the select screen remains displayed on the screen. If Y (Yes) is entered, the TEMP folder is selected or created if one does not exist. Program logic and configuration are loaded from the PLC into the TEMP folder. If the TEMP folder already contains logic and/or configuration files, those files are backed up prior to the load. The status lines are updated to show that the folder program is equal to the version in the PLC. In the configuration software, the message displayed when a matching folder does not exist is load configuration to TEMP folder?. If an error is encountered verifying or loading data from the PLC, an error message is displayed and the select screen continues to be displayed. The automatic folder selection feature allows Logicmaster 90-30/20/Micro software to automatically select the correct program folder and attempt to verify equality with the PLC program. During power-up initialization, when the initializing screen is displayed, Logicmaster 90-30/20/Micro software attempts to establish point-to-point communications with an attached PLC. If this attempt is not successful, the initial folder selection screen is displayed. The programmer mode will default to OFFLINE mode on computers without a programmer mode key switch.
Auto-Select Function
TM-00277
If a connection exists, computers without a key switch default to MONITOR mode. Logicmaster 90-30/20/Micro software will then check to see if a folder whose name matches the PLC program name exists. If the folder does exist, that folder is automatically selected and an equality check is performed. The main menu screen is displayed after the equality check is completed. If a matching folder does not exist, the initial folder selection screen is displayed. You can select a folder or press Auto (F3) to load to the TEMP folder, or select a new drawer and press Auto (F3) to try again to select the matching folder and then to check to see if they are both the same.
To create a backup copy of the currently selected program folder, press Backup (F4) from the Program Folder Functions menu.
The backup folder is located in a subdirectory under the program folder. If no backup folder exists for the current program folder, one is created automatically. The Backup Destination field allows you to specify where you want to put the backup archive. The default destination is the backup directory of the current folder. To change the destination, move the cursor to this field and enter the new destination. Note When backing up to a floppy diskette, you must back up to a subdirectory. For example, A:\ cannot be used as the backup destination. If LESSON is the folder name, A:\LESSON should be used. If only A:\ is specified, you cannot restore from the floppy diskette. Note Once started, the backup operation cannot be aborted. To return to the Program Folder Functions menu, press the Escape key.
To replace the contents of the current program folder with the backup copy, press Restore (F5) from the Program Folder Functions menu. To restore a program folder, a backup copy must exist. If the program folder is locked (locked status is shown in the lower right corner of your screen), you must change the status to unlocked before a restore can occur. Please refer to the information on unlocking program folders provided later in this chapter.
TM-00277
The Restoration Source field allows you to specify where you want to retrieve the backup archive from. The default source is the backup directory of the current folder. To change the source, move the cursor to this field and enter the new source. Note The backup archive must be restored to a folder with the same name as the folder from which the backup originally was made. If not, the message No backup found to restore is displayed. Note Once started, the restore operation cannot be aborted. If the programmer is in ONLINE or MONITOR mode, an auto-verification is performed to determine whether the restored program or configuration is equal to the PLC. To return to the Program Folder Functions menu, press the Escape key. Locking a program folder protects its files from being accidentally changed. To change the locked status of the current program folder, press Lock (F8) from the Program Folder Functions menu. Use the Tab key to change the access description. Then press the Enter key. The new access description will appear in the lower right corner of the screen. Note Program folders on write-protected floppy diskettes are automatically locked. Remove the write-protect tab and unlock the folder using this function.
TM-00277
References
The data used in an application program is stored as either register or discrete references.
TM-00277
%G
%Q
%AI
Access of References
%I
%M
Execute program
%R
TM-00277
Write outputs
Read inputs
%AQ
Technical Training Centre 1/0211
%T
%G
Read inputs
I/O fault CPU fault House keeping Diagnostic, Communication Fault tables Execute program
%S Read only
%SA
%SB
%SC
Write outputs
TM-00277
10
Register References
Type %R %AI Description
references, which will store program data such as the results of calculations. The prefix %AI represents an analog input register. This prefix is followed by the register address of the reference (for example, %AI0015). An analog input register holds the value of one analog input or other value.
%AQ
The prefix %AQ represents an analog output register. This prefix is followed by the register address of the reference (for example, %AQ0056). An analog output register holds the value of one analog output or other value.
Note All register references are retained across a power cycle to the CPU.
Discrete References
Type %I Description The %I prefix represents input references. This prefix is followed by the references address in the input table (for example, %I00121). %I references are located in the input status table, which stores the state of all inputs received from input modules during the last input scan. A reference address is
assigned to discrete input modules using the configuration software or the Hand-Held Programmer. Until a reference address is assigned, no data will be received from the module. %I data can be
retentive or non-retentive. %Q The %Q prefix represents physical output references. The coil check function of Logicmaster 90-30/20/Micro software checks for multiple uses of %Q references with relay coils or outputs on functions. Beginning with Release 3 of the software, you can select the level of coil checking desired (SINGLE, WARN MULTIPLE, or MULTIPLE). Refer to the Programming Software Users Manual, GFK-0466, for more information about this feature. The %Q prefix is followed by the references address in the output table (for example, %Q00016). %Q references are located in the output status table, which stores the state of the output references as last set by the application program. This output status tables values are sent to output modules during the output scan.
A reference address is assigned to discrete output modules using the configuration software or the Hand-Held Programmer. Until a reference address is assigned, no data is sent to the module. A particular %Q reference may be either retentive or non-retentive. a
%M The %M prefix represents internal references. The coil check function checks for multiple uses of %M references with relay coils or outputs on functions. Beginning with Release 3 of the software, you can select the level of coil checking desired (SINGLE, WARN MULTIPLE, or MULTIPLE). Refer to GFK-0466 for more information about this feature. A particular %M
11
TM-00277
a. Retentiveness is based on the type of coil. For more information, refer to Retentiveness of Data on page 12.
The %I, %Q, %M, and %G user references have associated transition and override bits. %T, %S, %SA, %SB, and %SC references have transition bits, but not override bits. The CPU uses transition bits for counters and transitional coils. Note that counters do not use the same kind of transition bits as coils. Transition bits for counters are stored within the locating reference. In the Model 331 and higher CPUs, override bits can be set. When override bits are set, the associated references cannot be changed from the program or the input device; they can only be changed on command from the programmer. CPU Models 323, 321, 313, and 311, and the Micro CPUs do not support overriding discrete references.
Retentiveness of Data
Data is said to be retentive if it is saved by the PLC when the PLC is stopped. The Series 90 PLC preserves program logic, fault tables and diagnostics, overrides and output forces, word data (%R, %AI, %AQ), bit data (%I, %SC, %G, fault bits and reserved bits), %Q and %M data (unless used with non-retentive coils), and word data stored in %Q and %M. %T data is not saved. Although, as stated above, %SC bit data is retentive, the defaults for %S, %SA, and %SB are non-retentive. %Q and %M references are non-retentive (that is, cleared at power-up when the PLC switches from STOP to RUN) whenever they are used with non-retentive coils. Non-retentive coils include coils ( ), negated coils (/), SET coils (S), and RESET coils (R). When %Q or %M references are used with retentive coils, or are used as function block outputs, the contents are retained through power loss and RUN-TOSTOP-TO-RUN transitions. Retentive coils include retentive coils (M), negated retentive coils (/ M), retentive SET coils (SM), and retentive RESET coils (RM). The last time a %Q or %M reference is programmed on a coil instruction determines whether the %Q or %M reference is retentive or non-retentive based
TM-00277
12
on the coil type. For example, if %Q0001 was last programmed as the reference of a retentive coil, the %Q0001 data will be retentive. However, if %Q0001 was last programmed on a non-retentive coil, the %Q0001 data will be non-retentive. Note for VersaPro! If a reference is retentive or non-retentive, the declaration is done in the Variable Declaration Table.
Data Types
Type INT Name Description Signed integers use 16-bit memory data locations, and are represented in 2s complement notation. The valid range of an INT data type is 32,768 to +32,767. Data Format
Signed Integer
Register 1 S(16 bit positions) 161 Twos complement value Register 2Register 1 S 3217161 Twos complement value
DINT
Double Double precision signed integers are stored Preci- in 32-bit data memory locations (actually sion Sig- two consecutive 16-bit memory locations) and represented in 2s complement notaned tion. (Bit 32 is the sign bit.) The valid range Integer of a DINT data type is 2,147,483,648 to +2,147,483,647.
A Bit data type is the smallest unit of memory. It has two states, 1 or 0. Byte A Byte data type has an 8-bit value. The valid range is 0 to 255 (0 to FF in hexadecimal). Word A Word data type uses 16 consecutive bits of data memory; but, instead of the bits in the data location representing a number, the bits are independent of each other. Each bit represents its own binary state (1 or 0), and the bits are not looked at together to represent an integer number. The valid range of word values is 0 to FFFF. Double A Double Word data type has the same chaWord racteristics as a single word data type, except that it uses 32 consecutive bits in data memory instead of 16 bits. Bit
BIT BYTE
WORD
DWORD
BCD-4 Four-Digit Four-digit BCD numbers use 16-bit Binary data memory locations. Each BCD digit Coded uses four bits and can represent numDecimal
REAL
This BCD coding of the 16 bits has a legal value range of 0 to 9999. Floating Real numbers use 32 consecutive bits (actuPoint ally two consecutive 16-bit memory locations). The range of numbers that can be stored in this format is from 1.401298E-45 to 3.402823E+38.
13
TM-00277
1.
Read input
_Main
blk_10
Write output
2.
Read input
_Main
blk_10
blk_10 CAL
Write output
TM-00277
14
3.
Read input
blk_10 CAL
blk_20 CAL
Write output
15
TM-00277
4.
0 ms Read input
Fast scan
_Main
X ms
_Main
Y ms
_Main
Write output
TM-00277
16
Review Questions
1. What is a drawer? 2. What is a folder? 3. What is the content of a folder? 4. Are you allowed to copy individual files from one folder to another? 5. List all LogicMaster 90/VersPro reference types. 6. A block has the name 1T0004. What function does this block have? 7. Which parts of the program are not stored into the PLC? 8. Explain: BIT BYTE WORD INT DWORD DINT 9. A PLC system suddenly changes from run to stop mode. Where can you get information about the reason for the stop? 10.What are the resulting %Q1 values in the program step examples below? Enter the %Q1 values in the table.
Read input
Write output
17
TM-00277
TM-00277
18
6
Programming Software - LM90
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Program Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Program Folder Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Selecting/Creating Program Folders . . . . . . . . . . . . . . . . . . . 4 Auto-Select Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Deleting Program Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Backing Up Program Folders . . . . . . . . . . . . . . . . . . . . . . . . . 6 Restoring Program Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Locking/Unlocking Program Folders . . . . . . . . . . . . . . . . . . . 8 Copying to Another Folder on the Hard Disk . . . . . . . . . . . . 9 Copying to a Diskette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Program Logic and Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Program Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Structure of a Ladder Logic Rung . . . . . . . . . . . . . . . . . . . . Ladder Logic Language Rules . . . . . . . . . . . . . . . . . . . . . . . Inserting Logic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exiting Rung Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rung Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting an Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Open Space Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Move Logic Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Move Logic Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete Column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete Row. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cutting Selected Rungs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pasting Previously Cut Rungs . . . . . . . . . . . . . . . . . . . . . . . . 13 13 14 16 18 20 22 23 23 24 25 26 27 28 29 30 31 32 33
TM-00278
Forcing and Overriding Discrete References . . . . . . . . . . . . 36 Changing Register Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Rung Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Inserting a Rung Comment . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Adding Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 User-Defined Footers in Listings . . . . . . . . . . . . . . . . . . . . . . 39 Subroutine Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Adding Subroutine Block Declarations. . . . . . . . . . . . . . . . . 42 Editing Subroutine Block Declarations. . . . . . . . . . . . . . . . . 42 Deleting Subroutine Block Declarations . . . . . . . . . . . . . . . . 42 Searching for Subroutine Block Declarations . . . . . . . . . . . 43 Using Goto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Zooming into Subroutine Block Logic . . . . . . . . . . . . . . . . . 43 Periodic Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Reference Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Displaying a Reference Table. . . . . . . . . . . . . . . . . . . . . . . . . 45 Changing Reference Table Values. . . . . . . . . . . . . . . . . . . . . 46 Changing the Reference Display Mode (ALT-N) . . . . . . . . . 47 Forcing a Discrete Reference . . . . . . . . . . . . . . . . . . . . . . . . . 47 Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Using Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Removing Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Mixed Reference Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Editing the Title. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Defining a Mixed Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Deleting a Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
TM-00278
Program Folders
Program Folder Functions
To use a program folder function, press Folder (F8) from the main menu and you get the following menu.
TM-00278
To create a new program folder or use one that already exists, press Select (F1) from the Program Folder Functions menu.
To select a folder in the current drawer, move the cursor to the desired folder name or type the name of the program folder in the Program Folder field, and press the Enter key. (This is also the name of the program.) The name can have up to seven characters. If a second floppy disk is inserted after a folder has already been selected or created on the first floppy disk, the list of folders is not updated. In order to have the folder list updated, you must reselect the drawer (for example, enter A:\). To select a folder in a different drawer, first select the drawer by entering the drawer MS-DOS path, ending with a \, and pressing the Enter key. For example, enter C:\LM90\FOLDERS\. When the Enter key is pressed, the names of the folders in the newly selected drawer are displayed. Position the cursor on the name of the program folder you wish to select or type the name of the program folder, and press the Enter key. If the program folder already exists, select whether or not to create a backup copy. If the program folder does not already exist, the software will prompt you for confirmation to create a new program folder. This prevents you from accidentally creating a program folder due to a typing mistake. To cancel any changes made to this screen, press ALT-A (abort). To return to the Program Folder Functions menu, use the Escape key.
TM-00278
Auto-Select Function
The Auto (F3) soft key is only active when the select screen is displayed. When F3 is pressed in OFFLINE mode or if the programmer is not communicating with the PLC, a message is displayed indicating that the auto-select function is not available in that mode. When F3 is pressed in MONITOR or ONLINE mode, the programming software checks to see if a folder exists under the current directory whose name matches the name of the program in the PLC. If the folder does exist, it is automatically selected. The software then attempts to verify the program or configuration in the folder with that in the PLC, and updates the equality field on the status line based on the result. After the select screen is exited, the main menu is displayed. In the programming software, if a matching folder does not exist, the following message is displayed: Folder matching PLC name not found; load program to TEMP folder? (Y/N). If N (No) is entered, no folder is selected and the select screen remains displayed on the screen. If Y (Yes) is entered, the TEMP folder is selected or created if one does not exist. Program logic and configuration are loaded from the PLC into the TEMP folder. If the TEMP folder already contains logic and/or configuration files, those files are backed up prior to the load. The status lines are updated to show that the folder program is equal to the version in the PLC. In the configuration software, the message displayed when a matching folder does not exist is load configuration to TEMP folder?. If an error is encountered verifying or loading data from the PLC, an error message is displayed and the select screen continues to be displayed.
Use this function to remove a program folder that is no longer needed. If the program folder has a backup, that copy is also deleted automatically. If you have created any directories using MS-DOS beneath the program folder to be deleted, you must remove them before using the delete function. You may not be able to delete a program folder residing on a virtual drive. If a program folder is locked (lock status is shown in the lower right corner of your screen), you cannot delete it. Please refer to Locking/Unlocking Program Folders on page 8. Press Delete (F2) from the Program Folder Functions menu.
TM-00278
To create a backup copy of the currently selected program folder, press Backup (F4) from the Program Folder Functions menu.
The backup folder is located in a subdirectory under the program folder. If no backup folder exists for the current program folder, one is created automatically. The Backup Destination field allows you to specify where you want to put the backup archive. The default destination is the backup directory of the current folder. To change the destination, move the cursor to this field and enter the new destination. Note When backing up to a floppy diskette, you must back up to a subdirectory. For example, A:\ cannot be used as the backup destination. If LESSON is the folder name, A:\LESSON should be used. If only A:\ is specified, you cannot restore from the floppy diskette. Use the cursor keys to move from one option field to another. To back up the entire contents of the current folder, enter Y (Yes) in the Entire Folder field. To back up only selected options, enter Y (Yes) in the corresponding fields:
Field Description The ladder logic program. The current configuration. The reference tables for the program.
Note Once started, the backup operation cannot be aborted. To return to the Program Folder Functions menu, press the Escape key.
TM-00278
To replace the contents of the current program folder with the backup copy, press Restore (F5) from the Program Folder Functions menu. To restore a program folder, a backup copy must exist. If the program folder is locked (locked status is shown in the lower right corner of your screen), you must change the status to unlocked before a restore can occur. Please refer to the information on unlocking program folders provided later in this chapter.
The Restoration Source field allows you to specify where you want to retrieve the backup archive from. The default source is the backup directory of the current folder. To change the source, move the cursor to this field and enter the new source. Note The backup archive must be restored to a folder with the same name as the folder from which the backup originally was made. If not, the message No backup found to restore is displayed.
TM-00278
Locking a program folder protects its files from being accidentally changed. To change the locked status of the current program folder, press Lock (F8) from the Program Folder Functions menu.
Use the Tab key to change the access description. Then press the Enter key. The new access description will appear in the lower right corner of the screen. Note Program folders on write-protected floppy diskettes are automatically locked. Remove the write-protect tab and unlock the folder using this function.
TM-00278
Use the copy function to copy from another program folder into the current folder. The source program folder is copied into the Current program folder. If there are any files in the current folder, they are destroyed by the copy process. Note The Copy feature functions somewhat differently than you might expect. Notice that you are copying another program folder into the current folder. That is, if you have been using a folder called LESSON, then LESSON is the name of your current folder (as displayed in the Status line toward the bottom of your screen). If you copy the folder called ACCTRL, then the folder called LESSON becomes an exact copy of ACCTRL. Note The copy function is only available in the programming software; it is not available in the configuration software. To make a copy of a program folder, press Copy (F10) from the Program Folder Functions menu.
TM-00278
Copying to a Diskette
C:\LM90 LESSON
a:\copy1_
To copy to a diskette you will need to follow these steps: 1. Place a diskette in your disk drive (usually an A or B drive). There should be plenty of room on the diskette. 2. Press F8 from the main menu to select the Folder functions. 3. Press select (F1) Select/Create a Program Folder (see Program Folder Functions on page 3 for screen sample if needed). 4. In the Program Folder blank, type in the name you wish to use for the copy you are about to make. Make sure you specify the disk drive letter, for example, a:\ as shown below:
5. Press Enter to select this new folder on your A or B drive. The following prompt will appear at the top of your screen: Program folder does not exist; create new folder? (Y/N) 6. Type Y to confirm that you want to create a new folder on your diskette. Note Notice that you are only creating an empty folder. In the next steps you will copy the contents of your source folder into that empty folder.
10
TM-00278
7. After Logicmaster has finished creating a new folder, press the Copy softkey (F10).
8. Type in the entire path and folder name, for example, c:\lm90\lesson as shown above. Be sure to include the DOS drive and directory which is usually c:\lm90. 9. Press Enter to start the Copy function. When the Copy is complete, the words Selected folder items have been copied to current folder will appear towards the top of your screen. 10.Press the Escape key to exit the Copy function which takes you to the Program Folder Functions. Press the Escape key again to return to the Program Folder Functions menu. Press the Escape key again if you wish to exit the Programming software. (An alternate way of exiting the software is to press Ctrl-Break once. A prompt will appear asking you if you wish to exit. Type Y (for Yes) to return to the Logicmaster main menu where you can press either F10 or the Escape key to exit. When exiting through Ctrl-Break, you do not need to press the Escape key multiple times.) You can now remove your diskette which has a copy of the source folder on it.
TM-00278
11
Status Information
The bottom three lines display information about the status of the programmer, the PLC, the program, and the keyboard. The information displayed will change depending on the programmer mode. For example:
Description Displays information about the attached PLC and the programmer. Identifies the current program. Shows the status of the keyboard; whether Caps Lock, Scroll Lock or Num Lock is active, and whether the keyboard is in REPLACE or INSERT mode. For some programming functions, the third status line displays additional information, described in later sections of this manual. Items appear in the status information area only when needed. Description
The Series Ninety Protocol (SNP) identifier assigned to the PLC. The current status of the CPU: RUN/OUT EN: PLC running the logic program, outputs enabled. STOP/IOSCAN: PLC stopped, not executing the logic program, scanning I/O. STOP/NO IO: PLC stopped, not executing the logic program, no I/O scan. STOP/FAULT: PLC stopped due to a fault; check fault tables. Scan Time The CPU sweep time in milliseconds. This is followed by the type of the scan, which may be: SCAN: Each scan executed as fast as possible. FIXED: Constant sweep timer enabled, scan fixed to set time limit. OVER: Constant sweep timer enabled, scan exceeds the set time limit. Mode The current mode of the programmer connected to the CPU: OFFLINE: No communications with PLC, or no PLC attached. ONLINE: Actively communicating with the PLC. MONITOR: Same as ONLINE, but programmer cannot modify the contents of the PLC. Access Level The password access level of the PLC: LEVEL 4: Change password, write logic/configuration. LEVEL 3: Write logic/configuration, PLC stopped. LEVEL 2: Write data, clear fault tables. LEVEL 1: Read PLC only. Equality This field compares the program in the PLC with the version in the folder: LOGIC EQUAL: Both program versions are the same. LOGIC NOTEQ: Program versions may be different. BLOCK EDIT: The PLC program is the same as that in the current program folder, the current block is being edited online and may be different in the programmer. The block can be stored to the PLC by pressing ALT-S.
12
TM-00278
Description To access the variable declaration table, move the cursor to this marker and press Zoom (F10). Nicknames and reference descriptions can then be entered in the table. Block A program can include more than one block of logic. Additional blocks, Declarations known as subroutine blocks, can be called from other blocks. When that is done, blocks must be declared before they are called. The main block has a block declaration table. This table lists all blocks which are part of the complete program. Blocks do not have block declaration tables. However, blocks can be called from the main block or from any block in the program. Start/End of All logic is placed between these two markers. To enter logic, place the Program Logic cursor on the [ END OF PROGRAM LOGIC ] marker and press Insert (F1).
TM-00278
13
Program logic consists of various elements such as relays, timers, mathematical functions, and other functions, placed together to form rungs of logic.
%Q0001
The programmer allows great flexibility in entering program elements; however, it will not allow you to enter a rung with incorrect format or syntax. Each rung may contain up to eight parallel lines; each line may have up to ten elements connected in series. Examples of an element include a normally open contact, a normally closed contact, or a coil. Horizontal and vertical links are used to carry power around an element, or to place elements in parallel or series with one another.
10
vertikal link
horizontal link
14
TM-00278
Examples The following example shows two separate rungs, which must be entered and accepted separately.
In the next example, two rung lines are connected by a vertical link, forming only one rung.
The last element of a group of rung elements in series must be a coil, a jump, or a function. Nothing may be to the right of a coil or a jump. The tenth position of a rung line is reserved for coils and jumps. A call instruction may occupy columns 9 and 10. A rung may contain up to eight coils. A rung line is not required to have elements in each column.
TM-00278
15
These guidelines should be followed when creating or editing ladder logic: 1. If a rung has a transitional coil, it must be the only coil in the rung. 2. There can be only one JUMP or MCR per rung. It must be the last instruction in the rung, and there cannot be a coil in the same rung. 3. A rung must contain at least one contact before any coil, jump, MCR, function, or vertical link. Contacts must be entered and cannot be left blank. Function blocks cannot be tied directly into the power rail. 4. Short circuits are not allowed. Note The ALW_ON contact, shown below, may be used to satisfy rules 3 and 4 above.
ALW_ON
5. A rung must be composed of properly nested sub-expressions. There can be no branches either into or out of another branch. The following examples contain improperly nested rungs. A. In this example, the rung line containing the %I0005 contact branches into the middle of the sub-expression (%I0002 OR (%I0003 AND %I0004)).
%I0001
%Q0001
%I0005
B. In this example, the rung line containing the %I0005 contact branches out of the middle of the sub-expression (%I0002 OR (%I0003 AND %I0004)).
%I0001
%I0006
%Q0001
16
TM-00278
6. There can be no branch around (above or below) a function in a rung. The following rung is not allowed.
%I0001
%I0002
%Q0001
FUNC
7. There can be no sub-paths starting from a vertical in a rung containing a function, except for sub-paths leading directly to coils. A. The following rung is allowed because the first sub-path comes directly off the power rail and the second leads directly to coils.
%I0001 %I0001
%Q0001 %Q0002
B. The next rung is not allowed. It has a sub-path starting from a vertical and leading into the function. It also has a sub-path that does not lead directly to coils; it goes through contacts first.
%I0001
%I0004 %I0005
%Q0001 %Q0002
8. There can be no contacts following a function in a rung. Note that the rung in the last example above fails this rule, too. 9. In general, execution order of rung elements is left-to-right. Within a group of parallel branches, the first (lowest rung line) parallel branch is executed first. The first of multiple sub-paths is executed first.
TM-00278
17
1. With the cursor on the [ END OF PROGRAM LOGIC ] marker, press Insert (F1). Rungs are always inserted before the rung the cursor is on.
2. To enter a relay element at the cursor location, press the desired function key. For example, to enter a normally open contact, press F1 with the relay functions displayed for the softkeys at the top of the screen. Or, you may enter the normally open contact by typing the mnemonic &NOCON on the command line and pressing the Enter key.
3. A reference may now be entered on the command line. For each reference, include both a user reference and location. There are two ways to do this: A. By entering the reference type and then the address (for example, %I1), or B. By entering them in reverse order (for example, 1I). The software automatically places the entry in the correct order and format when you press the Enter key. Entering the number before the reference type eliminates having to enter the % character.
18
TM-00278
Then, press the Enter key. The cursor automatically advances to the next position, ready for entry of the next element. Some program functions require references that begin on a word or byte boundary. The Logicmaster 90-30/20/Micro software will automatically adjust the entries to be properly aligned. You may also combine the previous step and this step into one operation by typing the mnemonic &NOCON I1 on the command line and pressing the Enter key.
Note The previous two operations can be combined into one by entering the reference address before pressing the contact function key. 4. This process can be continued until a rung is completed and is ready to be accepted. A rung can be accepted by pressing the Enter key with the command line empty, or the Plus (+) key on the numeric keypad. If there is an error in the rung, the rung is not accepted and the cursor is placed on the incorrect element for correction.
TM-00278
19
Functions can be entered as easily as relay elements. 1. First, use the relay function keys to enter the enabling logic. In the first example screen shown below, a normally open contact with reference address %I1 is entered at the enabling logic. 2. Select the type of function using the shift-function keys. For example, to select math functions, press Shift-F3.
Inserting Functions
3. Select the function desired using the function keys. For example, to select the ADD function, press Add (F1). Or, you may enter the ADD function by typing the mnemonic: &ADD on the command line and pressing the Enter key.
20
TM-00278
4. The Tab key can now be used to move the cursor to each parameter position around the function. 5. When the cursor is on the first input, simply type the value to be entered in this position on the command line (for example, %R0001 or 1R), and press the Tab key or Enter key to place this entry into its position. Pressing the Tab key will move the cursor to the next entry position. This process can be continued until the rung is completed and accepted.
For information on entering comments, refer to Inserting a Rung Comment on page 38. For information on zooming into entries, refer to the Fanuc Logicmaster 90, Series 90-30/20/Micro Programming Software, Users Manual (GFK-0466L) chapter 3, section 1, Ladder Logic Program Elements.
TM-00278
21
There are three ways to exit from a rung. 1. Press the Escape key to attempt to accept the current rung. If the rung passes the software validity test, the original function key selections (shown below) are restored and the new logic is added to the program. After accepting a rung, the cursor moves to the next rung, ready for the next rung to be entered. However, in INSERT mode a new rung is automatically opened below the newly created rung.
If the logic fails the check, an error message is displayed and the cursor is positioned on the location where the error occurred. Informational messages relating to the executability of the logic may also be displayed. 2. Press the Enter key with the command line empty (or the Plus (+) key on the numeric keypad). This causes the same response as pressing the Escape key. 3. Press ALT-A to exit the insert or edit function without modifying the existing ladder diagram logic. Confirmation is required. Pressing ALT-A the first time will restore the rung to its original state. In INSERT mode, this would be an empty rung. Pressing ALT-A a second time exits the insert function. Each rung is not saved to disk as it is accepted. To update the disk, press the Escape key to exit the program editor and return to the Programming Software main menu, or press ALT-U.
22
TM-00278
Editing Rungs
Rung Edit
After a logic program has been entered, there is always a need to make modifications, either to correct logic errors or to add new capabilities. Logicmaster 90-30/20/Micro software has an array of features to make this process easy. The same function keys used to initially enter a rung are available to insert new rungs. In addition, there are function keys to edit or modify existing rungs.
Function Function Key Description Add one or more rungs to the program. Selecting the insert function opens a new space above the rung where the cursor is positioned and displays the Edit Rung keys, which are used to select program elements. This allows you to create a new rung. Edit the rung at the cursor location. The edit function activates the current rung, enabling you to modify that rung. When F2 is pressed, the Edit Rung keys are displayed at the top of the screen. These keys are used to select program elements. Initiate word-for-word instruction changes using the rung edit softkeys instead of mnemonics. Locate a program element. Access coil checking and other editor options. Go to the specified rung. To use this feature, type the rung number you want to go to, then press F8. Access additional rung edit softkeys. Go to a more detailed level. To return to the original level, press the Escape key.
F1
Insert
F2
Edit
F3 F4 F7 F8 F9 F10
Description Select or deselect a rung or group of rungs. Rungs or declarations may also be deselected by pressing F1 again, by pressing ALT-A, or by pressing the Escape key. After deselecting the rungs or declarations, the message Select mode cancelled is displayed on the message line and the cursor remains on the last rung or declaration that had been selected. Delete the selected section of rungs or declarations from a program and ut them in the cut buffer. After a cut operation, the cursor will appear on the rung or declaration immediately after the selected region. Insert previously cut rungs or declarations from the cut buffer. Cut rungs and declarations may be pasted any number of times, until they are replaced by new information in the cut buffer, or until the program editor is exited. Include Insert previously written rungs or declarations back into the original program, or into any other program. Written rungs and declarations may be included any number of times. Copy the selected section of rungs or declarations from a program into a special file. After a write, the cursor remains on the last rung or declaration selected. Delete the rung at the cursor location or a range of selected rungs.
F1
Select
F2
Cut
F3
Paste
F4
Search
F5
Write
F6
Delete
TM-00278
23
Description Enter the rung number on the command line, and then press F8 to go to a specific rung in the ladder diagram logic. You can also specify a subroutine number and rung number in the subroutine to go to a specific rung in that subroutine. Return to the first level of rung edit softkeys. Zoom into the item the cursor is on.
F8
Goto
F9 F10
More Zoom
To delete an operand or instruction from a rung while in INSERT or EDIT mode, press ALT-D or Open Space (Shift-F10) and then press Delete Instruction (F10). Enter another instruction in the space left by the deleted instruction, or enter a horizontal link. An instruction may also be deleted by replacing it with another instruction. To remove the horizontal links and coil that follow the ADD_DINT instruction, place the cursor on each logic segment and press ALT-D. The Tilde (~) key or Horizontal Link (F9) softkey can also be used to clear the link.
Deleting an Element
24
TM-00278
Open space functions are used, while editing a rung, to open element spaces in the rung. To display the open space function keys shown below, press F10.
Description
F1
F3
Move Right Move the element at the cursor position, and all the elements to the right of the cursor position, one position to the right in all lines. Shunts are automatically inserted into the new column in the rung. Move Down Create room for an additional line of logic above the line the cursor is on.
F5
F7
F9
F10
See Move Logic Down on page 27. Delete Delete an entire column of instructions (includ- See Delete Column ing verticals) and operands within a rung. All Column on elements to the right of the deleted column will page 28. automatically move left. Delete Row Delete an entire row of instructions (including See Delete verticals) and operands within a rung. Row on page 29. Delete Remove nicknames from the variable declara- N/A Nickname tions table. Enter the nickname to be deleted on the command line before pressing F9. Delete Delete an operand or instruction from a rung. See Delete Instruction (You may also ress ALT-D to delete an operand Instruction or instruction.) on page 30.
TM-00278
25
The Move Right (MOV RT) function moves the element at the cursor position, and all the elements to the right of the cursor position, one position to the right in all lines. Shunts are automatically inserted into the new column in the rung. In the following example, the column next to the power rail is moved right one column by positioning the cursor in column 1 and pressing Move Right (F1). Before:
After:
26
TM-00278
The Move Down (MOV DN) function is used to create room for an additional line of logic above the line the cursor is on. All elements in the region to be moved must be located entirely in the same row as the cursor, or in the rows below. In the following example, the rung of logic beginning with %I0002 is moved down one row by positioning the cursor in row 2 and pressing Move Down (F3). Before:
After:
TM-00278
27
The Delete Column (DEL CN) function is used to delete an entire column of instructions (including verticals) and operands within a rung. It can be used to delete a column that contains functions as well as contacts or coils, as long as the function template itself is totally contained within the column. When the column to be deleted is within a rung that contains no coil or jump instructions, all columns to the right of the deleted column are moved left one column. In the following example, the column which contains %I0007 is deleted by positioning the cursor in column 3 and pressing Delete Column (F5). Before:
Delete Column
After:
28
TM-00278
Delete Row
The Delete Row (DEL RW) function is used to delete an entire row of instructions (including verticals) and operands within a rung. It can only be used to delete a row whose instructions, together with their operands, are totally contained within the row. For example, the DEL RW function can be used to delete a row with a function such as MCR, but it cannot delete a row containing an ADD_INT function because the ADD_INT function spans several rows. After the deletion, all rows beneath the deleted row move up one row. When a row is moved up to the first row position, its verticals are automatically deleted. In the following example, the row which contains %I0001 is deleted by positioning the cursor on that row and pressing Delete Row (F7). Before:
After:
TM-00278
29
The Delete Instruction (DELINS) function is used to delete an operand or instruction from a rung. Another instruction or a horizontal link may then be entered in the space left by the deleted instruction. The ALT-D key sequence may also be used to delete instructions; however, the cursor will automatically move to the right after the deletion. In the following example, the ADD instruction is deleted by positioning the cursor on the ADD function block and pressing Delete Instruction (F10). Before:
Delete Instruction
After:
30
TM-00278
Selecting Rungs
The cutting and file writing of rungs requires that a section of rungs first be selected. To select the rungs: 1. Press More (F9) to display the cut/paste function keys. 2. Move the cursor to the rung at the beginning or end of the section to be selected. Then, press Select (F1). The message Select mode initiated ... displayed on the message line indicates that the select function has been activated. Once this function is active, the only functions available are cursor, page, cut, write, help, and goto. 3. The current rung is automatically selected. By pressing the Up/Down cursor keys, Prev, Next, Page Up/Down, Home, or End keys, you can add subsequent or previous rungs into the selected region. Selected rungs are shown in reverse video on the display.
4. The Select (F1) softkey acts as a toggle between the select and deselect functions. To deselect the selected rungs, press the Select (F1) key or ALT-A. A. Press Cut (F2) to cut the selected rungs. B. Press Write (F5) to write the selected rungs to a file. C. Press Delete (F6) or ALT-D to delete the selected rungs. 5. To deselect the selected rungs, press Select (F1). The F1 key acts as a toggle between the select and deselect functions. Note The select function can also be used to select variable declarations and interrupt declarations.
TM-00278
31
The cut function enables you to remove a section of previously selected rungs from the current program. Any nicknames, reference descriptions, or comment annotation used within the selected rungs are also copied with the cut rungs for later use in a paste operation. However, nicknames and reference descriptions remain in the variable declaration table. This function can be used to reorder logic within the program; it is also useful for deleting a section of rungs. To cut a section of rungs from the current programs logic: 1. Select one or more rungs, as previously described. 2. Press Cut (F2) to cut the selected rungs from the program. The select function is automatically exited as part of the cut operation. The cursor will be on the rung after the cut section of rungs.
If the cut buffer becomes full, repeat the operation, selecting a smaller amount of logic. 3. All rungs below the selected section will scroll up to fill the gap of the just-cut section. Note Cut rungs are saved only as long as you remain in the program editor.
32
TM-00278
The paste function enables you to insert a copy of a section of previously cut rungs before the current rung. Any unique reference address nickname assignments and any identifier name will be added to the current programs variable declaration table. Once the cut operation is complete and the logic has been placed in the buffer, press Paste (F3) to initiate the paste function. The position of the cursor remains the same. All entries below the inserted section will scroll down to make room for the just-pasted rungs.
Conflicts may occur between declarations in the section of rungs to be pasted (buffer) and declarations in the existing (target) program. A nickname in the buffer that is identical to one in the target program is simply passed over and ignored during the paste operation. When a declaration in the buffer has the same reference address but a different nickname than a declaration in the target program, the declaration from the buffer is not added to the existing programs declaration table. A name conflict occurs when a declaration in the buffer has the same name as a declaration in the target program, but a different meaning. For a nickname, the different meaning would be a different reference address. Name conflicts are resolved by automatically generating a unique system name for the conflicting declaration in the buffer, and then adding it to the target program. The presence of system names (any name beginning with the $ character, for example, $LA00001) in the pasted logic indicates that name collisions have occurred during the paste operation. Implicit declarations, such as JUMPs, LABELs, and MCR names, are handled in the same way. Note If coil checking is set to SINGLE, rung(s) may not be pasted should a coil-use conflict occur. %T references should be used on coils to allow rungs to be pasted, or use the WARN MULTIPLE coil check option. (Refer to the information on coil checking later in this section.) %T references may later be replaced with %Q or %M references.
TM-00278
33
Modifications
The following steps describe how to change relay ladder diagram elements and update the PLC while online and the PLC is running. 1. Place the cursor on the element to be changed. 2. Enter the new instruction mnemonic on the command line. The new instruction must be in the same instruction group as the existing instruction.
Modifying Instructions
3. Press the Enter key, and then type Y (Yes) in response to the confirmation prompt.
The same steps are used to replace functions for other functions in the same instruction group. For example, the NE_INT function can be replaced with the LE_INT function. With the cursor on the NE_INT function, enter the new instruction mnemonic &LE_INT on the command line and press the Enter key.
34
TM-00278
Using the Modify Softkey The Modify (F3) softkey enables you to substitute instructions from the rung editor environment by using the rung editor instruction softkeys. Position the cursor on the rung where the substitution is to be made and press Modify (F3). Then, use the function softkeys to enter the new instruction. You can also use the Modify (F3) softkey to change a reference address or constant parameter and to create/modify nicknames. To restore the original values prior to the substitution, press ALT-A. When the change is completed, press the Escape key.
A reference address or other parameter can be changed while online and the PLC is running. 1. Place the cursor on the reference to be changed. In this example, the cursor is positioned on the TMR functions PV parameter, which currently contains a value of 20. Enter a new value of 40 on the command line, and press the Enter key.
2. Press Y (Yes) in response to the confirmation prompt to update the PLC with the new operand value.
TM-00278
35
A value that is overridden can be protected from change by the program logic; however, an overridden value can be forced or toggled. 1. Discrete points can be forced or toggled by positioning the cursor on a contact or coil with the reference address to be modified, and pressing F12 or the keypad () key. 2. For input points that are being scanned or output points that the logic program changes, you must first override the point by pressing F11 or the keypad (*) key before forcing the reference. 3. Once a point has been overridden, the first character of the reference address or nickname will flash. 4. To remove an override, position the cursor on the use of the reference address, and press F11 or the keypad (*) key again. To force the discrete reference %T0001 in the following example, position the cursor on an element which uses that reference. Then, press F12 to update the PLC.
Note Only 331 and higher CPUs are capable of forcing and overriding discrete references.
36
TM-00278
The following steps describe how to change the value of a register at the current cursor position. 1. Place the cursor on the register to be changed. (For this example, place the cursor on %R0003.) 2. Enter the new value on the command line. (For this example, enter 30 on the command line.)
3. Press the Enter key. The register value for this example will change from 0 to 30, as shown in the screen below.
TM-00278
37
Rung Comments
To insert rung comments, move the cursor to the rung you wish to insert a comment before. 1. Press Insert (F1) and then Control (Shift-F9) to select the control functions. 2. Press F8 to select the COMMENT function, or use the mnemonic by typing: &COMMENT on the command line and pressing the Enter key. The screen should appear as shown below:
3. Press the Escape key to accept the rung and exit INSERT mode.
Text can be entered into the COMMENT instruction by positioning the cursor on the COMMENT instruction and pressing Zoom (F10).
Adding Text
38
TM-00278
You can define up to four (4) lines of text to be printed at the bottom of each listing page generated by the Logicmaster 90-30 Programmer printing utility. Specify these lines of text using comment directives similar to the existing title, subtitle and border directives (\T, \S, and \B respectively). To use create a footer for a program file, follow these steps: 1. Follow the steps described on the previous pages to create a COMMENT. 2. On a separate line at the beginning of the comment text, key in \F1 (for Footer 1); then key in the text you wish to appear in the footer. (You can enter up to four footers in this manner, using F1, F2, F3, and F4 as the footer line directives for footers 1 through 4 respectively. You can enter them in any order, but each must be on a separate line and must be at the beginning of the comment text in which they are entered. Regardless of the order entered, they will always print with Footer 1 before Footer 2, Footer 2 before Footer 3, etc.) A sample of this is shown below:
3. When you are finished with your footers, press the Escape key to return to your program and accept that rung. Note Footer 4 supercedes the standard LM90 listing page footer line. If \F4 is not specified, the standard Logicmaster 90 footer is printed. If the \F4 directive is specified without text, the LM90 footer line will not be printed. The following text shows the footer that resulted from the comment/footer settings shown on the previous page:
The following restrictions should be observed: Any blank footer lines will be printed in the listing as blanks. If text for a specified footer line has been previously defined and that footer line directive is specified again, but without text, that footer line will no longer be printed.
TM-00278
39
Once specified, footer lines will be printed on each page of the listing until they are changed with user-defined footer line directives in subsequent comment text. For an 80-column listing, you can enter text up to 80 characters in length. For a 132-column listing, you can enter up to 132 characters. Footer line text less than the page width is centered to the page. To start user-defined footers on the pages prior to the logic, the comment containing the user-defined footers must be the first instruction in the main block of the program.
40
TM-00278
Subroutine Blocks
Subroutine blocks in Logicmaster 90-30/20/Micro software provide structured programming for the Series 90-30 PLC. Subroutine blocks are not available for the Series 90-20 PLC nor for Micro PLCs. For 90-30 PLCs, up to 64 subroutine block declarations are allowed. Subroutines are declared through the block declaration editor. To create or modify subroutine declarations, place the cursor on the [ BLOCK DECLARATIONS ] marker. Then, press Zoom (F10) to display the block declarations screen.
Subroutine block declarations consist of: A label identifying the block as being used with a subroutine instruction. The number corresponding to the Hand Held Programmers subroutine number. A graphic box containing a subroutine name of up to 7 alphanumeric characters. The language the subroutine was programmed in. Initially, this field is blank. It will remain empty until you have entered some logic for the subroutine. Once you have zoomed into the block to enter logic, the letters LD (ladder diagram language) are displayed after LANG: beside the block name. A 32-character descriptive explanation. An indicator that it has errors. This indicator is only displayed if the block is not executable. (See screen capture at top of the next page for an example of the error message.)
TM-00278
41
The following screen shows an example of two subroutine block declarations, one without errors and one with errors.
To add a subroutine block declaration, place the cursor at the desired location, enter the block name on the command line, and press Insert (F1). A 32character explanation can also be inserted at this time. If you press F1 with the command line blank, a box containing seven question marks (???????) will be displayed for the subroutine block. When the subroutine block declaration is inserted in the software, the next available Hand Held Programmer number (from 1 to 64) is assigned to it.
To change a subroutine block declaration, place the cursor at the declaration to be changed and press Edit (F2). Type over the entry as needed. After changing the entry, press the Enter key (or Plus (+) key on the numeric keypad) to move to the next table entry and continue editing; or press the Escape key to exit editing. Use the Tab, Back Tab, Previous, or Next key, or the cursor keys to move the cursor. Use the Page Up and Page Down keys to scroll the display up and down. When you leave the subroutine block declarations, any changes made are automatically stored to the current program folder. You can also update the program folder while working on the screen by pressing ALT-U.
A subroutine block declaration can be deleted if there are no CALL instructions to that subroutine block in the program logic. Deleting a subroutine block also deletes its associated logic. To delete a subroutine block and declaration, place the cursor at the declaration to be deleted and press Delete (F3).
42
TM-00278
In order to search for a subroutine block declaration, you must have the Block Declaration screen displayed on your programmer. Then, press Search (F4). Enter the name of the subroutine block in the Search for field, set the Scope to LOCAL, and press the Enter key. You can search for a subroutine CALL instruction from either the logic or the Block Declaration screen by pressing Search (F4). Then, enter the name of the subroutine block in the Search for field, or enter &CALL to search for all subroutine CALL instructions, and press the Enter key.
Using Goto
The Goto (F8) function key may be used to move the cursor. To move to a particular subroutine block declaration, enter the number of that declaration on the command line, and press Goto (F8). For example, to move the cursor to the first subroutine block declaration, enter 1 on the command line, and press Goto (F8). You may also go to a subroutine block by simply entering the block name on the command line and pressing Goto (F8).
To display the subroutine block logic, place the cursor on the block name and press Zoom (F10). You can edit the logic on this screen.
Periodic Subroutines
Model 340 and higher CPUs support the use of a periodic subroutine. A periodic subroutine is a single subroutine with a unique name in the form 1Tiiii, which will execute periodically during RUN mode. If a subroutine with this name is present in the PLC when it transitions from STOP to RUN mode, this subroutine will be executed at periodic intervals while the PLC is in RUN mode. If a RUN MODE STORE is performed, a periodic subroutine will be stopped while the PLC is in PAUSE mode. (For more information on RUN MODE STORE and PAUSE mode, refer to the Fanuc Logicmaster 90, Series 9030/20/Micro Programming Software, Users Manual (GFK-0466L) chapter 8, Program Utilities.) Note Only Model 340 and higher Series 90-30 PLCs support use of a periodic subroutine. More specifically, Model 341 CPUs, Version 4.20 or later, all Model 340 CPUs, and all 350 and higher CPUs support periodic subroutines. You can specify a periodic subroutine by giving the block a name in the form: 1T0001, where the four digits after the T indicate the number of time intervals between executions of the block. If the leading zeros of the interval are not specified, the Logicmaster 90-30/20/Micro software will fill them in so that the total number of characters is six. If the time interval specified is too small for execution of the subroutine and the rest of the normal PLC sweep, the PLC watchdog timer may be activated. The time per interval is .001 seconds. The maximum time allowed between executions is 10 milliseconds. When you enter a subroutine name with the correct format for a periodic subroutine, the timebase, interval value, and INTR will be displayed beside the subroutines name and number, instead of SUBR.
TM-00278
43
Executing a Periodic Subroutine Each execution of the periodic subroutine will occur interval seconds after the previous start, as shown below:
Note The latency for the periodic subroutine (i.e., the maximum interval between the time the periodic subroutine should have executed and the time it actually executes) can be around .35 milliseconds if there is no PCM, CMM, or ADC module in the main rack. If there is a PCM, CMM or ADC module in the main rackeven if it is not configured or usedthe latency can be almost 2.25 milliseconds. For that reason, use of the periodic subroutine with PCM-based products is not recommended. Restrictions on Use of the Periodic Subroutine Only one periodic subroutine per program is allowed. Periodic subroutines cannot be called by the main program or by another subroutine. If you call another subroutine from the periodic subroutine, the subroutine being called must not be called from anywhere else in the program. If you attempt to load a program with a periodic subroutine into a version of Logicmaster 90-30 software prior to Release 4.01, you will not be able to display or edit the program. Likewise, you cannot store a periodic subroutine to a PLC prior to Version 4.20. If a DOIO function block whose I/O reference range includes an intelligent module is executed within a periodic subroutine, communication with the module may be lost. Timer (TMR, ONDTR, and OFDTR) function blocks will not execute properly within a periodic subroutine. A DOIO function block within a periodic subroutine whose reference range includes references assigned to a Smart I/O Module (HSC, APM, Genius, etc.) will cause the CPU to lose communication with the module. The FST_SCN and LST_SCN contacts (%S1 and %S2) will have an indeterminate value during execution of the periodic subroutine. A periodic subroutine cannot call or be called by other subroutines. The PID function block depends in its implementation on the sweep time of the main program. Consequently, it will not function properly when called from a periodic subroutine.
44
TM-00278
Reference Tables
Reference tables can be displayed directly from the main menu in any programming mode, or from any main menu function screen. While a table is displayed, you can change the format of any references in the table for a particular application. This is a sample reference table used for discrete inputs (%I):
Note In OFFLINE mode, reference values from the current program folder are displayed. In ONLINE or MONITOR mode, references from the PLC are displayed. Offline values from a reference table (values from the folder) can also be printed using the print function. These values will have the formats you set up on the display. To print values displayed online, the values must first be loaded from the PLC and then printed.
To display a reference table: 1. Enter one of the reference types listed in the following table:
User Reference %I %Q %M %T %G %S, %SA, %SB, %SC %AI %AQ %R Reference Table Discrete input. Discrete output. Discrete internal. Discrete temporary. Discrete Genius global data. Discrete system. Analog input. Analog output. Register.
A. To view the lowest-numbered table of a particular type, enter just the reference type. For example, for the lowest-numbered analog input table, enter %AI. B. To view a table containing a specific reference, enter the reference or its nickname. For example, %AI123 or 123AI.
TM-00278
45
2. Then, press Tables (Shift-F2). 3. Once in the reference tables function, you may go to a different reference table by entering the reference on the command line and pressing the Enter key.
You can force (change) both discrete and register reference values with the reference tables function. Note If the programmer mode is OFFLINE, changes will only be made to the current program folder. Changes made to the program folder may later be stored to the PLC by using the store utility function, described in chapter 8, Program Utilities. If the programmer mode is ONLINE, any changes will only be made to reference values in the PLC. Reference values in the PLC may then be loaded to the program folder by using the load utility function, also described in chapter 8. No changes to the PLC can be made while the programmer is in MONITOR mode.
Warning! Improper use of online program changes can damage equipment or cause personal injury. Online program changes should always be made with extreme care. Online changes can have serious and unforeseen results on a control system, and on the process to which it applies, if they are improperly used. It is recommended that these functions not be used with people near the equipment. If possible, they should be done with direct visual control over the system and the process. Proper external power disconnects should be made to prevent undesired equipment operation. In order to make online changes, the status line at the bottom of the screen must show that the programmer is online to the CPU.
46
TM-00278
The ALT-N key sequence enables you to display table data either right to left (lowest reference address on the right) or left to right (lowest reference address on the left). The display mode can be changed in any table (fixed or mixed) and in any program mode (OFFLINE, ONLINE, or MONITOR). The Home End, Page Up and Page Down, Previous, Next, and cursor keys function the same, regardless of the view mode selected. Data displayed in ASCII format differs slightly, in that the quotes are removed and the format is treated more as a byte (1 character) instead of a word (2 characters). Note The print function cannot distinguish between these two display modes and prints all tables right to left. The default display mode is the last mode selected with ALT-N. If the display mode has never been changed, the default set in the programmer setup is used (see the Fanuc Logicmaster 90, Series 90-30/20/Micro Programming Software, Users Manual (GFK-0466L) chapter 6, Programmer Setup).
In discrete reference tables, a reference can be forced on or off. If the reference being forced is currently overridden (described below), it retains its new status until forced again. If the reference is not overridden, it retains its new status until changed by some other function, such as rung solution or I/O servicing. This usually occurs within one sweep. You can enter the desired state (0 or 1) on the command line, or toggle the reference state as described below. The following method is easier. To toggle a reference: 1. With the table displayed on the screen, place the cursor on the reference to be forced. 2. Press the keypad minus (-) key or F12 key to change that reference to its opposite state. All logic elements in the program that use the reference will reflect the new status.
TM-00278
47
Discrete references in Models 331 or higher CPU can be overridden from the reference tables display. (This feature is not available in Models 323, 321, 311, 313, 211, and Micro CPUs.) Note If you attempt to use overrides with a CPU below Model 331, you will see an error message on your screen stating that overrides are not allowed. Discrete references that have been overridden are indicated by flashing digits on the reference table screen. An override removes control of the reference from its normal source. Overridden inputs ignore information from the devices wired to the I/O structure, such as limit switches or pushbuttons. Similarly, overridden outputs ignore programmed logic and internal power flow. Overrides are retained even when power is removed from the system. Non-relay functions such as timers, counters, math functions, and data move functions still work when a coil is overridden. Warning! If overrides are applied to a reference associated with a transitional coil, the coil may pulse on for one sweep when the override is removed. The override is a very powerful tool for program checking and maintenance. You can test a program in a PLC that is not connected to I/O hardware by using overrides to simulate inputs. You can also check a program when I/O is connected, by using overrides to prevent coil operation. After the I/O is wired up, it can be tested by activating each coil with an override to verify I/O communications, module operation, power to a device, wiring to a device, indicator lights, fuses, and other hardware. After the control system is thoroughly checked and placed in operation, the override is useful in a monitored system. If a sensor or input module should fail while the process is in operation, that input can be overridden. Thus, the process can be continued until it can be shut down safely. References should not be overridden when the programmer is removed from the process, or when making copies of a program. Use the reference tables function to verify all inputs and coils before removing them from the programmer, or copying the program. Overrides should be used on an operating system only with extreme care. Warning! Improper use of the override can damage equipment or cause personal injury. 1. Place the cursor on the reference to be overridden. Caution! The reference will be overridden throughout the program, not just at the cursor location. 2. Press the keypad Asterisk (*) key or F11. This toggles the state of the reference between overridden and not overridden. When overridden is selected as the state of reference, the value displayed in the table will flash.
Overrides
Using Overrides
48
TM-00278
Removing Overrides
All discrete reference bits on a reference table screen, or starting character in a tag name on a displayed rung, will flash if they have been overridden. To remove an override from one reference, toggle it by placing the cursor on the reference and pressing the keypad Asterisk (*) key or F11. To remove all overrides shown on the current screen, including the last three lines which may be hidden beneath the status lines (Press ALT-E to remove the status lines.): 1. Press Change All (F10). 2. Press the keypad Asterisk (*) key or F11. The screen prompts: Remove overrides from displayed references ? (Y/N). 3. Enter Y (Yes) to remove the overrides.
A mixed table represents a collection of data from one or more of the fixed tables. Therefore, the identical information displayed in a mixed table could also be displayed on the related fixed tables. A total of 99 user-defined mixed reference table displays can be supported. A number from 1 to 99 is associated with each table. Note The mixed table function is used only for viewing PLC information; therefore, mixed reference tables are not valid when the programmer mode is OFFLINE. When OFFLINE, no cursor movement or other mixed table functions are allowed, except for changing tables, exiting reference tables, or changing modes. To select a mixed table, enter a number from 1 through 99 on the command line and press Mixed (F9). This is an example of a mixed reference table display:
Where:
TM-00278
49
Field
Description
User-Defined Table Title A description of the mixed table. A maximum number of 63 characters is allowed. When the cursor is on the 63rd character, it remains fixed, overwriting the last character. Mixed Table Number A number from 1 to 99, which indicates the mixed table currently displayed. Cursor Item Line Information about the address the cursor is on; namely, the current reference, reference nickname, and current value binary representation. Table Data 16 display lines. Some may be program block headers or blank lines.
If the mixed table entered is not defined, a blank mixed table (no data, no title, only the mixed table number) is displayed, as shown below.
To edit the table title, position the cursor on the title of the display by moving the cursor to the topmost data display line and pressing the Up cursor key. While editing the title, the Update or Abort key can be used to save or restore a title. A message is displayed when the function is complete. Note Since mixed reference tables are defined on a line-by-line basis, the abort function will restore the lines, formats, and title displayed upon entry. Unless an update to disk was done, any lines defined or title edited are lost. The Mixed (F9) key is used to change from one mixed table to another. The Tables (Shift-F2) key sequence can also be used to get to any table. The Change All (F10) key is not supported for global format changes, as in fixed table displays. To return to the display area, press the Enter key or the Down cursor key. The cursor will return to the original position in the topmost data display line.
50
TM-00278
A mixed reference table display is created or changed by pressing the Change Line (F10) key. 1. First, position the cursor on the display line where a certain data value should be displayed. The line may already be defined, or it may be a blank line. 2. Enter the reference address or nickname of the desired data value on the command line. In the following example, a line is defined in mixed reference table 1. With the cursor positioned on the top line of the display, enter %I1 onto the command line.
3. Press Change Line (F10) to display the desired information. The cursor will be positioned on the requested data value. Any information currently displayed is replaced with the new requested information. In this example, when F10 is pressed, the data value positioned at reference %I0012 is entered into the topmost display line.
The default display format for data extracted from a discrete table is binary; for register tables, it is signed integer.
TM-00278
51
The timer/counter format can be used for a %R line in a mixed table if enough exists for the format. If the two lines below the %R line are defined or are beyond the table size, an error message is displayed. If the command line is blank when the Change Line (F10) key is pressed, the line is cleared and the cursor is automatically moved to the next line. If the current line is already blank, moving the cursor to the next line will produce the same result as pressing F10 with the command line blank.
Deleting a Line
52
TM-00278
7
Programming Software - VersaPro
Lesson 4: Importing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Import a Logicmaster folder. . . . . . . . . . . . . . . . . . . . . . . . . . 9 Import a Control software folder.. . . . . . . . . . . . . . . . . . . . . 10 Use Excel to create variables. . . . . . . . . . . . . . . . . . . . . . . . . 11 Lesson 5: Using Hardware Configuration . . . . . . . . . . . . . . . . . . . Become familiar with the Standalone Hardware Configuration tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Change the hardware configuration type. . . . . . . . . . . . . . . Create a basic configuration.. . . . . . . . . . . . . . . . . . . . . . . . . Familiarize yourself with the Parameter Editor.. . . . . . . . . Convert the Hardware Configuration. . . . . . . . . . . . . . . . . . Lesson 6: Creating a Ladder Logic Program . . . . . . . . . . . . . . . . Place, name, and assign addresses to Boolean elements in the ladder diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Place a function block in the ladder diagram. . . . . . . . . . . . Insert a row and drag & drop. . . . . . . . . . . . . . . . . . . . . . . . Insert a comment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compile the program and navigate to errors . . . . . . . . . . . 12 12 13 13 14 15 16 16 17 17 18 19
Lesson 7: Creating New Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Create an Instruction List block. . . . . . . . . . . . . . . . . . . . . . 19 Place a call to your new block in the _MAIN program. . . . 19 Lesson 8: Instruction List Editor . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Create Instruction List Logic . . . . . . . . . . . . . . . . . . . . . . . . 20
TM-00279
Lesson 9: Connect to a PLC, Store a Folder, and Monitor. . . . . . 21 Communications Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Connect, Store and Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Monitor the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Lesson 10: View Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Create a Variable View Table . . . . . . . . . . . . . . . . . . . . . . . . 23 Create a Reference View Table . . . . . . . . . . . . . . . . . . . . . . . 24 Lesson 11: Reports and Printouts . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Create a custom footer for your reports and printouts. . . . 24 Print a report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TM-00279
October 2000
GFK-1992C
October 2000
Goals
After completing this tutorial, you should be familiar with all the features of VersaPro software, including hardware configuration, the user interface, variable declaration, variable view, and reference view tables, the IL and LD editors, and the many different tools and options that allow you to customize your workspace. Terminology Used in This Tutorial Lesson 1: Installation Lesson 2: Starting VersaPro and Creating a Folder Lesson 3: Customizing the Workspace Lesson 4: Importing Files Lesson 5: Using Hardware Configuration Lesson 6: Creating a Ladder Logic Program Lesson 7: Creating New Blocks Lesson 8: Instruction List Editor Lesson 9: Connect to a PLC, Store a Folder, and Monitor Lesson 10: View Tables Lesson 11: Reports and Printouts Conclusion 2 3 3 5 9 12 16 19 20 21 23 24 25
Menu selections
2
GFK-1992
October 2000
Lesson 1: Installation
VersaPro will run on Windows 95, Windows 98, Windows 2000, and Windows NT (with Service Pack 3 or greater). Installation is a straightforward operation: Insert the CD into your CD drive, then find and double click on the setup.exe file.
If you are using Windows 95 and you do not have Dcom 95 installed on your computer, you will be prompted to install it. After Dcom is installed, you must restart your computer before you continue with the installation.
3. Enter Lab_1 for the Folder Name and a description in the Folder Description field if desired. If you want to put the new folder in a directory different from that specified in the Location field, click the browse button next to the Location field.
3
GFK-1992
October 2000
4. Click the Next button. The following screen will appear. Note that the default selection is Empty Folder.
4
GFK-1992
October 2000
Folder Browser
Ladder Editor
VersaPro Workspace
5
GFK-1992
October 2000
2. Click and drag the toolbars to positions to match the Workspace shown on page 5. Note: The Folder Browser, Variable Declaration Table, expanded Function Toolbar, and Local Logic Variable Table (used in Motion programs) can be docked (fixed) or undocked (floating). These windows are docked by default. To select or deselect docking, click the secondary mouse button in the window and choose Allow Docking from the context-sensitive menu. Windows should be undocked only temporarily for moving and then redocked.
3. Display the compact Function Toolbar by selecting View, Function Toolbars, Compact.
Function Toolbar, Compact 4. If they do not already appear, display the Folder Browser and Variable Declaration Table by clicking their buttons in the View toolbar. 5. Undock the Folder Browser and click and drag it to the position shown in the VersaPro Workspace figure on page 5. Repeat this procedure with the Variable Declaration Table and the Function Toolbar.
6
GFK-1992
October 2000
2. Select the Ladder tab and check Variable Name in the Show/hide field box. Next, click the Full button. This causes the Variable Names to be displayed in full mode (up to 2 lines, up to 32 characters). 3. Check Reference Address. (Brief is the only mode available.) 4. Check Description in the Show/hide field box, and click the Full button again. The Variable Descriptions will now be displayed in full mode (up to 4 lines, up to 64 characters). 5. Adjust the Grid Cell Width slide bar until you are comfortable with the Grid Cell Width. Notice that the cell width in the LD editor changes as the slide bar is adjusted. 6. For the purposes of this lab, make sure the Coil/Jump Justification Column checkbox is not selected. If this box is not checked, coils are inserted in the next empty column. If this box is checked, coils are placed in the column specified (right justified). Valid values are integers 10 to 20. (For 90-70 PLCs, Coil/Jump Justification Column should be selected and the value should be 10.) 7. Leave the Show 8x10 Rung Indicator selected. This causes a border to be displayed on the outside edge of row 8 and column 10. (For 90-70 PLCs, this option is always selected.) 8. Click OK. Review the Ladder Editor window to see the effects of the changes you made.
7
GFK-1992
October 2000
3. Use the Font list box to select a different font. 4. Click OK. Note: For additional information on setting VersaPro options, refer to the User's Manual or to online Help.
8
GFK-1992
October 2000
6. Click Finish. The New Folder Wizard closes, and VersaPro attempts to complete the import process. Details of the import process are logged in the Information Window. 7. Spend a few minutes reviewing this folder. Note that all nicknames are imported and that all comments retain their original format. See how different instructions look in the VersaPro ladder diagram editor. You can use the function toolbar to create new logic.
9
GFK-1992
October 2000
1. Create an SNF File. a. b. If you do not already have an .snf file containing variable information, open a folder in Control software and use the Export feature from the Variable Declaration Table to create an .snf file. Close Control before you proceed.
2. Create a new folder in VersaPro. a. b. c. Select File, New Folder. You will be prompted to close your existing open folder. (Only one folder can be open at a time.) The New Folder Wizard will appear. Create a new folder with a new name. If you want to put the new folder in a directory different from that specified in the Location field, click the browse button next to the Location field to select the folder path. Click the Next button. Choose Import Control on the next screen. In the From field, use the browser button to locate a Control folder. Select the Include SNF checkbox, then click the Browse button and, in the Browse dialog box that appears, locate the SNF file that is associated with the Control file to be imported. (This field is optional.) Click OK to begin the Import process. Spend a few minutes reviewing this folder. Note that all nicknames are imported. Also, note that Comment contents are not imported. See how different instructions look in the VersaPro ladder diagram editor. You can use the function toolbar to create new logic.
d. e. f.
g. h.
3. Import a Shared Name File. a. b. c. In the folder you just created, select any cell in the Variable Declaration Table. Select Tools, Import Variables. Locate the Shared Name File (filename extension .snf) on your computer. A browser window will open. Click Open to import the file. If the file being imported contains variables that conflict (same name and scope) with those in the VersaPro folder, the Variable Resolution dialog box will appear. If this happens, you can simply click OK to accept the default settings, or press F1 to get more information about the Variable Resolution settings. The results of the Import process will be logged in the Information Window. Verify that the variables you imported appear in the Variable Declaration Table.
d.
10
GFK-1992
October 2000
3. In the VDT, create a variable that can be easily indexed in Excel using the auto-increment feature something with a number at the end like Tank_1. 4. Select the entire variable row, and use either Copy/Paste or Drag and Drop to move this to Excel. 5. Replicate about 100 or so of these variables in Excel. Remember, only the variable name and reference address values should increment. If you have questions about how to do this, refer to the Excel documentation. 6. Select all the variables you created in Excel, and copy them. 7. Go to the first blank line in the VDT and paste the variables into the table. 8. The first thing you should note is that you are prompted to correct a discrepancy between the first variable in the Excel file and the variable you created in VersaPro. VersaPro will prompt you to correct errors as you go allowing you to complete the import even if there are conflicts. Correct this by renaming the variable, and complete the import.
11
GFK-1992
October 2000
Rack View
Status Bar
Log View
Reference View
3. The Log View, Power Consumption, and Reference View windows are dockable (they can be set to a fixed location in the Workspace). Move the windows to a position you are comfortable with. Note: Docking is selected by default. To turn docking on or off, select Allow Docking from the contextsensitive menu. , and Power Consumption View windows off and on
4. Toggle the Reference View , Log View by clicking the buttons on the toolbar.
12
GFK-1992
October 2000
1. Right click on the Power Supply Module and choose Replace Module. 2. Choose a Power Supply from the Module Catalog and click OK. Review the information in the Parameters Dialog Box and click OK. 3. Right click on the Power Supply Module and choose Replace CPU. 4. Choose a CPU from the Module catalog and click OK. A Parameter Editor window, similar to the one below, will appear.
VersaMax is the only PLC type that uses Carrier/Base modules. If you are configuring a different type, skip steps 6 through 8.
6. Right click again on the Power Supply Module and choose Add Carrier/Base from the context-sensitive menu. 7. Choose a base from the I/O Carriers or the Communications Carriers tab and click OK.
13
GFK-1992
October 2000
8. Right click on the Carrier you just added, and choose Add Module. Select a module and click OK. (The appropriate Module Catalog for the Carrier will be displayed.) Close the Parameter Editor window. Your rack system configuration should be similar to the following figure.
2. Experiment with the following Parameter Editor features: Tooltips: When you pass the cursor over an editable cell, valid choices will be displayed in a tool tip. Inline Editing: To place a value directly into a cell, click the cell and start typing. Data Entry Tool: To open the Data Entry Tool, double click or right click on the selected cell, or press F2. The Data Entry Tool provides editing controls appropriate to the type of data being entered in the selected cell. For Reference Address and Range values, its built-in limit values and available reference value ranges prevent you from using the spin buttons or slider bar to enter values outside the allowable limits. However, you can override these limits by typing in any desired value. Error Color: Erroneous or unavailable values are highlighted in the Error Color (default color is red). To change the Error Color, select the HWC Tools menu, Options. Choose Text Error from the Colors list. Mode Setter Parameters: These parameters affect other parameters and are listed in italics. The value entered for a Mode Setter can alter the format and content of the Parameter Editor window. For example, fields may be added or removed from individual tabs, and/or entire tabs can be removed or replaced. Changing a Mode Setter can also erase parameter information that you might already have entered. It is strongly recommended that you select Mode Setter values before entering data for the other parameters in the dialog. To see examples of Mode Setters, look at Sweep Mode on the CPU Scan tab and Port Mode on either of the Port tabs. For an explanation of parameter relationships for these parameters, select the parameter and choose What's This from the context-sensitive menu. Module Help: For a summary of each parameter on the tab being displayed, choose Help, Module Help. 14
GFK-1992
October 2000
Spreadsheet Mode: Spreadsheet mode allows all parameter groups to be displayed and edited in a single, scrollable view. (Default is tabbed mode.) To change the edit mode, select View, Parameter Edit. You can also select Tools, Options, and then select the Parameter Edit Options tab. The following figure shows the editor window for the VersaMax CPU002 in spreadsheet mode.
3. Close the Parameter Editor window. 4. Note that the rack system Status Bar indicates "Not Saved." To save your configuration, click the Save button on the toolbar, or select File, Save.
15
GFK-1992
October 2000
Place, name, and assign addresses to Boolean elements in the ladder diagram.
1. Make sure that the VDT is visible. If not, select View, Variable Declaration Table, or press Alt + 3. 2. If the MAIN.blk Ladder Diagram editor window is not open, double click the _MAIN-LD block in the folder browser. 3. In the VersaPro _MAIN.blk window, click the Normally Open Contact button on the Ladder Toolbar.
4. Move your cursor into the ladder diagram. Note that the mouse pointer has a Normally Open Contact symbol as a subscript. Click in the first row and leftmost column in the ladder diagram. A Normally Open Contact is placed in the grid where the pointer sits, and a gray box surrounds the contact. 5. Without moving the cursor, type Input_1, 1i and press Enter. The editor recognizes that you are typing a variable name and address, shows the name in the ladder diagram, and places the name and address in the VDT. (1i indicates the address %I00001.) 6. Note that the Normally Open Contact button sticks. Once it is selected, you will place a contact in every time you click in the diagram. Cancel the Normally Open Contact selection by pressing the Escape key. 7. Click the cursor to the right of the Input_1 contact and type nocon (for Normally Open Contact). Since there is no element in the current space, a progressive search is performed to find the element you want as you type. Press Enter. Note: You can drag and drop a variable from the VDT to an element in the logic editor if the function does not have a variable assigned to the parameter. Steps 8 and 9 use this alternate means of assigning a variable name to an element. 8. In the VDT, type the Name, Type, Len, and Address as shown in the figure below. (You can type in the bottom, empty row or choose Insert Row from the context-sensitive menu.)
9. Select the name Input_2 and drag it to the contact that you created in step 7.
11. Place the coil in the diagram a few spaces away and to the right of the second contact. 12. Type Output_1, 1q and press Enter. A variable named Output_1 with a reference address of %Q00001 will be created in the VDT. Press Escape. 13. Use point-to-point wiring to connect the contacts and the coil. Do this by placing the pointer on the right side of the second contact, then right click, hold, and drag to draw a connection from the contact to the right side of the coil. (The cursor changes to a hand with a pencil.)
16
GFK-1992
October 2000
First Rung
2. Choose MOVE_WORD from the listbox, click the Function Drop Mode button , and move the cursor into the ladder diagram. A small function block icon will appear next to the mouse pointer. 3. Place the MOVE_WORD instruction in the diagram underneath the rung you created earlier by clicking in this location. Notice that this automatically becomes Rung 2 in the margin. Press the Escape key. 4. Wire the power flow input of the function to the power rail using the point-to-point wiring method. 5. Click in the grid block next to the IN input on the MOVE_WORD function. A gray box will appear next to the input. 6. Type 16#A01 and press Enter. You have just entered a hexadecimal constant as input to the function. The same convention is followed for octal and binary numbers (8#, 2#). You do not need to type a 0 in as a placeholder. 7. After hitting Enter, the gray box moved over to the space next to the Q output. Type REG_1,1R and press the Enter key. The name and address are added to the VDT. 8. Next, double click on the function block. The Function Properties Dialog Box appears. Enter the desired length (and for other functions, the address) and click OK.
October 2000
2. Highlight the function block by clicking on the space to the left of the block and dragging down and to the right. Make sure the entire block and connected values are highlighted, including the constant 16#A01 and the output Reg_1. Release the mouse button. 3. Place the pointer back in the highlighted area and click and drag. When the function block is in the desired position, release the mouse button. The entire block has been cut and pasted into the new location. 4. Note that similar results can be achieved by highlighting an area and then right clicking and choosing Cut and then moving the cursor to the new location, right clicking, and selecting Paste. Or, you can use Ctrl + C and Ctrl + V to cut and paste the highlighted elements. 5. Save your work: Select File, Save All or press Ctrl + Shift + A.
Insert a comment.
1. Click in an area below Rung 2. 2. From the Insert menu, select Comment. A comment line will appear in the area where the cursor was. This is automatically named Rung 3. 3. Double click on the comment line. A scroll box will appear. 4. Type in your comment, hitting enter when you want to create a new line. When you want to exit, press Ctrl + Enter to leave the comment window. Your LD program should be similar to the one shown below. Note: To change the comment display format, select Tools, Options and choose the Brief or Full option on the General tab.
18
GFK-1992
October 2000
3. Press Enter and select the new block from the list box that appears.
19
GFK-1992
October 2000
2. Type move_word. (The list box will perform a progressive search.) Select the MOVE_WORD( instruction and press Enter. The parameters for this instruction will automatically appear, and the cursor will move to the cell in the Operand column for the first parameter. 3. For the IN parameter, in the Operand column, type REG_1 (or select REG_1, G from the drop down list) and press Enter. Since the variable REG_1 has already been defined, %R00001 will appear in the Ref. Address Column. 4. For the Length parameter, type 3 and press Enter. 5. For the Q= parameter, type REG_2 and press Enter. Since this is a new variable, the Ref Address cell for it will remain empty. Note that Reg1 appears in the VDT. 6. In the VDT, type 200R in the Address cell for Reg1 and press Enter. In the IL Editor, %R00100 will appear in the Ref Address column for Reg1. Your IL program should resemble the following figure.
7. Save your work: Select File, Save All or press Ctrl + Shift + A.
20
GFK-1992
October 2000
Communications Setup
Note: If you have already created a Device configuration for your PLC using the Communications Configuration Utility (CCU), you can skip this step. (A Device configuration in the CCU consists of a name that you provide for the configuration, the PLC model, and the default port that VersaPro will use to communicate to the PLC.)
1. Select Tools, Communications Setup. (If a password has been defined for the CCU, the Password dialog box will appear. Enter the password and click OK to continue.) The main screen of the CCU will appear. 2. On the Devices tab in the CCU, click the New button. 3. In the Add New Device dialog box, provide a Name for the PLC device that you will be connecting to. As a minimum, you need to select a Default Port under Selected Device Parameter Settings. 4. When you have finished setting up communications for your PLC, click OK to close the CCU and save changes.
Mode
Sweep Time
Equality Status
VersaPro Status Bar 5. If there are faults noted in the status bar, open the Fault Table by selecting Tools, Fault Table. Clear the table by pressing F9 and then close the table. 6. Put the PLC in STOP mode: Click the Stop PLC button or select PLC, Stop.
21
GFK-1992
October 2000
8. Make sure Store Logic to PLC is selected and click OK. 9. Review the results in the Information Window. If the store completes successfully, everything is fine. If you had errors compiling your program, review the log, double-click on the errors, correct the errors and repeat the store operation. (Double clicking the error takes you to the error in the Logic Editor window.) 10. Once Store is complete, put the PLC in run mode by clicking the Run PLC button. Note: To hide the Log view, choose Hide from the context-sensitive menu.
2. Toggle a value by selecting on a Ladder Element and then clicking the Toggle a Reference button the PLC toolbar. The toggled element will be highlighted in red.
22
GFK-1992
October 2000
4. You can place variables by copying and pasting them from the VDT or the Ladder diagram. You can also drag them from the VDT. Place INPUT_1 and another instance of REG_1 into the Variable View table using one of these techniques. 5. To display a value in a different numerical format, select the value, then choose Display Format from the View menu or the context-sensitive menu. In the figure below, the second instance of REG_1 is displayed in hexadecimal.
23
GFK-1992
October 2000
3. As in the VVT, you can change the display format of a selected value. To display a value in a different numerical format, select the value, then choose Display Format from the View menu or the context-sensitive menu.
24
GFK-1992
October 2000
The > and ^ format switches affect all the text that follows them until the end of the string or until the next ^, >, or %n.
Print a report.
1. Select File, Print Report. 2. In the Print Report dialog box, select the options that you want to print. (For more information, click the Help button.) 3. When you are ready to print, click OK.
Conclusion
You are now familiar with the basic functionality in VersaPro. Some features have not been discussed, but everything needed to successfully start programming and running PLCs with VersaPro 2.0 has been introduced in this tutorial. We encourage you to further explore the capabilities of VersaPro 2.0 using the online Help and the VersaPro Programming Software User's Guide, GFK-1670. Remember that GE Fanuc Automation is constantly striving to improve the productivity of our customers, and we would like to hear any feedback you have. If you have suggestions for improvement on this product, please contact your GE Fanuc representative.
25
GFK-1992
8
Instructions
Instructions for GE Fanuc Series 90-30 Ladder Logic Functions in VersaPro 2.0 Contents
Boolean (Relay) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Contacts: NOCON, NCCON, CONTCON. . . . . . . . . . . . . . . 2 Coils: COIL, NCCOIL, POSCOIL, NEGCOIL, SETCOIL, RESETCOIL, CONTCOIL . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timer Function: TMR_HUNDS, TMR_TENTHS, TMR_THOUS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Off-Delay Timer Function: OFDT_HUNDS, OFDT_TENTHS, OFDT_THOUS . . . . . . . . . . . . . . . . . . . . . On-Delay Stopwatch Timer Function: ONDTR_HUNDS, ONDTR_TENTHS, ONDTR_THOUS . . . . . . . . . . . . . . . . . . 3 3 3 4
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Up Counter Function: UPCTR . . . . . . . . . . . . . . . . . . . . . . . . 5 Down Counter Function: DNCTR . . . . . . . . . . . . . . . . . . . . . 5 Relational . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Equal Function: EQ_DINT, EQ_INT, EQ_REAL . . . . . . . . Greater Than Function: GT_DINT, GT_INT, GT_REAL . Greater Than or Equal To Function: GE_DINT, GE_INT, GE_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Less Than Function: LT_DINT, LT_INT, LT_REAL . . . . . Less Than or Equal To Function: LE_DINT, LE_INT, LE_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Not Equal Function: NE_DINT, NE_INT, NE_REAL . . . . . Range Function: RANGE_DINT, RANGE_INT, RANGE_WORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 6 6 6 6 6 6
TM-00280
Bit Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Logical AND Function: AND_WORD . . . . . . . . . . . . . . . . . . 7 Logical OR Function: OR_WORD . . . . . . . . . . . . . . . . . . . . . 7 Logical Exclusive OR Function: XOR_WORD . . . . . . . . . . . 7 Logical Invert (NOT) Function: NOT_WORD . . . . . . . . . . . 7 Bit Clear Function: BIT_CLR_WORD . . . . . . . . . . . . . . . . . 8 Bit Set Function: BIT_SET_WORD . . . . . . . . . . . . . . . . . . . . 8 Bit Test Function: BIT_TEST_WORD. . . . . . . . . . . . . . . . . . 8 Bit Position Function: BIT_POS_WORD. . . . . . . . . . . . . . . . 8 Bit Sequencer Function: BIT_SEQ . . . . . . . . . . . . . . . . . . . . . 9 Shift Right Function: SHIFTR_WORD . . . . . . . . . . . . . . . . . 9 Shift Left Function: SHIFTL_WORD . . . . . . . . . . . . . . . . . . 9 Rotate Right Function: ROR_WORD. . . . . . . . . . . . . . . . . . 10 Rotate Left Function: ROL_WORD . . . . . . . . . . . . . . . . . . . 10 Masked Compare Function: MASK_COMP_DWORD, MASK_COMP_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Comment Function: COMMENT . . . . . . . . . . . . . . . . . . . . . 12 Call Function: CALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 End Function: END. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Jump Function: JUMP, JUMPN . . . . . . . . . . . . . . . . . . . . . . 13 Label Function: LABEL, LABELN . . . . . . . . . . . . . . . . . . . 13 Master Control Relay Function: MCR, MCRN. . . . . . . . . . 14 End Master Control Relay Function: ENDMCR, ENDMCRN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Nesting of Control functions. . . . . . . . . . . . . . . . . . . . . . . . . . 15 LD Service Request Function: SVC_REQ . . . . . . . . . . . . . . 16 ISA Algorithm: PID_ISA . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Independent Algorithm: PID_IND . . . . . . . . . . . . . . . . . . . . 24 Tuning PID Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 SER Function: SER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 BCD to INT Function: BCD4_TO_INT . . . . . . . . . . . . . . . . 29 INT to BCD Function: INT_TO_BCD4 . . . . . . . . . . . . . . . . 29 INT to REAL Function: INT_TO_REAL. . . . . . . . . . . . . . . 29 REAL to INT Function: REAL_TO_INT. . . . . . . . . . . . . . . 29 DINT to REAL Function: DINT_TO_REAL. . . . . . . . . . . . 30 REAL to DINT Function: REAL_TO_DINT. . . . . . . . . . . . 30 WORD to REAL Function: WORD_TO_REAL . . . . . . . . . 30 REAL to WORD Function: REAL_TO_WORD . . . . . . . . . 30 TRUNC Function: TRUNC_INT, TRUNC_DINT . . . . . . . 30
TM-00280
Data Move. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Move Function: MOVE_BOOL, MOVE_INT, MOVE_REAL, MOVE_WORD . . . . . . . . . . . . . . . . . . . . . . 31 Block Move Function: BLKMOV_INT, BLKMOV_REAL31 Block Clear Function: BLK_CLR_WORD . . . . . . . . . . . . . 31 Shift Register Function: SHFR_BIT, SHFR_WORD. . . . . 32 Communication Request Function: COMM_REQ . . . . . . . 32 Data Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Array Move Function: ARRAY_MOVE_BOOL, ARRAY_MOVE_BYTE, ARRAY_MOVE_DINT, ARRAY_MOVE_INT, ARRAY_MOVE_WORD . . . . . . . Search Equal Function: SEARCH_EQ_BYTE, EARCH_EQ_DINT, SEARCH_EQ_INT, SEARCH_EQ_WORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Search Not Equal Function: SEARCH_NE_BYTE, SEARCH_NE_DINT, SEARCH_NE_INT, SEARCH_NE_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Search Greater Than or Equal To Function: SEARCH_GE_BYTE, SEARCH_GE_DINT, EARCH_GE_INT, SEARCH_GE_WORD . . . . . . . . . . . . . Search Greater Than Function: SEARCH_GT_BYTE, SEARCH_GT_DINT, SEARCH_GT_INT, SEARCH_GT_WORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Search Less Than or Equal To Function: SEARCH_LE_BYTE, SEARCH_LE_DINT, SEARCH_LE_INT, SEARCH_LE_WORD . . . . . . . . . . . . Search Less Than Function: SEARCH_LT_BYTE, SEARCH_LT_DINT, SEARCH_LT_INT, SEARCH_LT_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Addition Function: ADD_DINT, ADD_INT, ADD_REAL Subtraction Function: SUB_DINT, SUB_INT, SUB_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multiplication Function: MUL_DINT, MUL_INT, MUL_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Division Function: DIV_DINT, DIV_INT, DIV_REAL . . . Modulo Division Function: MOD_DINT, MOD_INT . . . . 33
33
33
34
34
35
35
36 37 37 37 38 38 39
TM-00280
Numerical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Square Root Function: SQRT_DINT, SQRT_INT, SQRT_REAL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Cosine Function: COS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Inverse Cosine Function: ACOS . . . . . . . . . . . . . . . . . . . . . . 40 Sine Function: SIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Inverse Sine Function: ASIN . . . . . . . . . . . . . . . . . . . . . . . . . 40 Tangent Function: TAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Inverse Tangent Function: ATAN . . . . . . . . . . . . . . . . . . . . . 41 Convert to Radians Function: DEG_2_RAD . . . . . . . . . . . . 41 Convert to Degrees Function: RAD_2_DEG . . . . . . . . . . . . 41 Base 10 Logarithm Function: LOG. . . . . . . . . . . . . . . . . . . . 42 Natural Logarithm Function: LN . . . . . . . . . . . . . . . . . . . . . 42 Power of e Function: EXP . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Power of X Function: EXPT . . . . . . . . . . . . . . . . . . . . . . . . . 42 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
TM-00280
TM-00280
TM-00280
Boolean (Relay)
Contacts: NOCON, NCCON, CONTCON
Use contacts to monitor references and control logic based on the state of a reference. Contacts pass power depending on the state of the reference. A reference is ON if the state is 1; it is OFF if the state is 0.
Type Normally-open Contact (NOCON) Normally-closed Contact (NCCON) Continuation Contact (CONTCON)
+
Contact
Data Types: The only valid data type for all contacts is BIT.
When there is power flow, sets next continuation contact ON. When there is no power flow, sets next continuation contact OFF.
Data Types: The only valid data type for all coils is BIT.
Boolean (Relay)
Timer
Timer Function: TMR_HUNDS, TMR_TENTHS, TMR_THOUS
The standard timer increments while there is power flow and resets to 0 when power flow stops. Time may be counted in tenths of seconds or hundredths of seconds, or thousandths of seconds, depending on the time-base. The range for this timer is 0 to +32,767 time units.
Parameter ("????") Description Address. This field contains the starting address of the 3 words used by the counter. The variable has the following format: Word 1 = CV (Current Value) Word 2 = PV Word 3 = Control word PV PV contains the value for the timer preset. This may be a variable or a constant. Data Type: WORD
If multiple occurrences of the same timer (with the same instance address) are enabled during a CPU sweep, the current values of the times will be the same. When the timer is used in a block that is not called every sweep, the timer accumulates time between calls to the block unless the timer is reset.
OFDT_THOUS
If multiple occurrences of the same timer (with the same instance address) are enabled during a CPU sweep, the current values of the timers will be the same. The current value never exceeds PV. The state of this timer is retentive on power failure; no automatic initialization of timer occurs at power-up. Once the maximum value is reached, the value is retained and Q remains energized regardless of the state of the enable input. When the off-delay timer is used in a block that is not called every sweep, the timer accumulates time between calls to the block unless it is reset. This timer does not pass power flow if PV is 0 or a negative number.
Timer
If multiple occurrences of the same timer (with the same instance address) are enabled during a CPU sweep, the current values of the times will be the same. The state of this timer is retentive on power failure; no automatic initialization of timer occurs at power-up. On 350 and higher PLCs, if the Enable to the Stopwatch Timer (ONDTR) is low, PV = 0 and reset R receives power-flow, then the output will be low. When the stopwatch timer is used in a block that is not called every sweep, the timer accumulates time between calls to the block unless it is reset.
Timer
Counter
Up Counter Function: UPCTR
Use to count up to a predefined number base on a discrete event. The range is 0 to +32,767.
Parameter ("????") Description Address. This address specifies the starting address of the 3 words used by the counter. Word 1 = CV, Word 2 = PV, Word 3 = Control Word PV R PV contains the value for the counter preset. This may be a variable or a constant. Data Type: WORD When reset (R) has power flow, the current value is set to 0.
The 3 words for CTU must not be used by another function, or an improper operation will result. The current value can increment past PV. As long as R has power flow, the current value is set to 0.
The 3 words for instance must not be used by another function, or an improper operation will result. As long as R has power flow, the current value is set to PV.
Counter
Relational
Equal Function: EQ_DINT, EQ_INT, EQ_REAL
Use this function to test if 2 numbers are equal. Q is set if the numbers are equal.
IN1 and IN2 must be the same data type. To compare values of different data types, first convert one value to one of the valid data types.
Relational
Bit operations
Logical AND Function: AND_WORD
The AND function is useful for building masks or screens, where only certain bits are passed through (those that are opposite a 1 in the mask), and all other bits are set to 0. The function can also be used to clear the selected area of word memory by ANDing the bits with another bit string known to contain all 0s. The IN1 and IN2 bit strings specified may overlap.
Bit Operations
Bit Operations
R DIR N ST
Bit Operations
The number of places specified for rotation must be more than zero and less than the number of bits in the string. Otherwise, no movement occurs and no power flow is generated. The ROR/ROL function passes power flow to the right, unless the number of bits specified to be rotated is greater than or equal to the total length of the string or is less than or equal to zero. The result is placed in output string Q. If you want the input string to be rotated, the output parameter Q must use the same memory location as the input parameter IN. The entire rotated string is written on each scan that power is received.
Bit Operations
10
Each scan that power is received, the function begins comparing the bits in the first string with the corresponding bits in the second. Comparison continues until a miscompare is found, or until the end of the string is reached. The BIT input is used to store the bit number where the next comparison should start. Ordinarily, this is the same as the number where the last miscompare occurred. Because the bit number of the last miscompare is stored in output BN, the same reference can be used for both BIT and BN. If you want to start the next comparison at some other location in the string, you can enter different references for BIT and BN. If the value of BIT is a location that is beyond the end of the string, BIT is reset to 1 before starting the next comparison. The function passes power flow whenever power is received. The other outputs of the function depend on the state of the corresponding mask bit.
Bit Operations
11
Controls
Comment Function: COMMENT
Use whenever you need to explain a portion of the control folder. (Adding comments to your folder makes it easier to maintain.) After accepting the comment rung, you can zoom into the comment and add up to 2048 characters of text.
Controls
12
When the JUMP is active, all coils within its scope are frozen. This includes coils associated with timers, counters, latches, and relays. The JUMP instruction is always placed in columns 9 and 10 of the current rung line; there can be nothing after the JUMP instruction in the rung. Power flow jumps directly from the instruction to the rung with the named LABEL. To avoid creating an endless loop with forward and backward JUMP instructions, a backward JUMP must contain a way to make it conditional.
There can be only one LABEL with a particular label name in a folder. Folders without a matched JUMP/LABEL pair can be created and stored to the PLC, but cannot be executed. The LABEL instruction has no input parameters and no output parameters; there can be nothing either before or after a LABEL in a rung.
Controls
13
All rungs between an active Master Control Relay (MCR) and its corresponding End Master Control Relay (ENDMCR) are executed with negative logic. Block calls within the scope of an active MCR will not execute. However, any timers in the block will continue to accumulate time. There can be only one MCR instruction for each ENDMCR instruction. An MCR/ENDMCR pair can be nested within other MCR/ENDMCR pairs.
The ENDMCR function also has a name, which identifies the ENDMCR and associates it with the corresponding MCR(s). The ENDMCR function has no outputs; there can be nothing before or after an ENDMCR instruction in a rung.
Controls
14
Note: Non-nested functions can be used only on low-end 90-30 PLCs (with CPUs below 350).
Controls
15
PARM
The Service Request function performs the tasks listed below based on the settings you enter.
If new word count is 0, checksum calculations are disabled. Otherwise, the number of words used in checksum calculation is set to the new word count, rounded up to a multiple of 8. Service Request Execution When the read word count service request executes, the CPU returns the current checksum count in Word 2. To read the current word count
Controls
16
The start of data begins at Word 3. For read requests, the data from the CPU will start at this location. For write requests, the user must initialize the data that will be sent to the CPU. The sections that follow show parameter block contents for supported data formats. For all formats, hours are stored in a 24-hour format and the day of week is a numeric value (Sunday-Saturday = 1-7) BCD Format In BCD format, each field occupies a single byte. This format requires six words. The last byte of the sixth word is not used. When setting the date and time, this byte is ignored; when reading date and time, the function returns a null character (00). The table below shows the block format for BCD and values for the following example: Read Date and Time in BCD Format (Mon, July 3, 1988 at 2:45:30 p.m.)
Packed ASCII with Embedded Colons In Packed ASCII format, each digit of the time and date items is an ASCII formatted byte. In addition, spaces and colons are embedded into the data to permit it to be transferred unchanged to a printing or display device. The table below shows the block format for Packed ASCII and values for the following example: Read Date and Time in Packed ASCII Format.
Controls
17
Service Request Execution For read requests, the CPU returns data starting at Word 3. The SVCREQ function passes power flow to the right, unless the one of the following is true: Word 1 is some number other than 0 or 1. Word 2 is some value other than 0-3. The data provided for a write is not in the expected format.
Service Request Execution After the function executes, either the PLC fault table or the I/O fault table is cleared.
Controls
18
Service Request Execution The format for the output parameter block depends on whether the function reads data from the PLC fault table, the I/O fault table.
In the least significant byte of Word 2, the Long/Short indicator defines the quantity of fault specific data present in the fault entry. As mentioned previously, the format for the output parameter block depends on whether the function reads data from the PLC fault table, the I/O fault table.
Controls
19
The first two words are the elapsed time in seconds. The last word is the number of 100 microsecond ticks in the current second.
Note:
SVCREQ 18 does not detect overrides in %G or %M memory types. Use %S0011 (OVR_PRE) to detect overrides in %I, %Q, %G, and/or %M memory types.
Controls
20
Service Request Execution When a RUN MODE STORE is active, the folder checksums may not be valid until the store is complete. To determine when checksums are valid, three flags (one each for Program Block Checksum, Master Program Checksum, and Master Configuration Checksum) are provided at the beginning of the output parameter block.
Use Service Request function 26 or 30 to interrogate the actual modules present and compare them with the rack/slot configuration, generating addition, loss, and mismatch alarms, as if a store configuration had been performed. This SVCREQ will generate faults in both the PLC and I/O fault tables, depending on the fault.
Note: The time for this SVCREQ to execute depends on how many faults exist. Therefore, execution time of this SVCREQ will be greater for situations where more modules are at fault.
Parameter Block Setup This function always outputs power flow. Also, this function has no parameter block; however, Control requires that you provide some unused parameter for PARM. Enter any unused parameter here; it will not be used.
Controls
21
The first two words are the power-down elapsed time in seconds. The last word is the remaining power-down elapsed time in 100 microsecond ticks (which is always 0). Whenever the PLC can not properly calculate the power down elapsed time, the time will be set to 0. This will happen when the PLC is powered up with CLR M/T pressed on the HHP. This will also happen if the watchdog timer times out before power-down.
Controls
22
Controls
23
Controls
24
Controls
25
Override: Enables remote control of the PID block. If Override is OFF (default), use the other control bits to track the status of the PID input contacts. If Override is ON, the PID function will be controlled by remote devices by modifying internal SP, PV and CV words. When the override bit is ON, the function block executes based on the current values of manual, up, and down, that is, the next three fields. When the override is OFF, the manual, up, and down values are set to the values as defined by the function block's discrete inputs. Manual: If ON, block is in manual mode. If OFF, block is in automatic mode. Up: If ON and Manual is ON, CV is incremented every solution. Down: If ON and Manual is ON, CV is decremented every solution. Tuning Proportional (Proportional Gain): Sets the proportional gain (0.01 seconds timebase). Derivation (Derivation Gain): Sets the derivation gain (0.01 seconds timebase). Integral (Integral Rate): Sets the integral rate with a timebase of .001 repeats per second. SP, PV and CV Percentage Bar Graphs Calculated based on the SP (Set Point Value) and PV (Preset Value) values. The maximum and minimum scale values are set by the user. CV graph is calculated based on the value of CV (Current Value) and the lower and upper clamp parameters. SP/PV Range Optional integer values in PV Counts that define the highest and lowest display value for the SP and PV bar graphs. SP Value Represents the process Set Point input. In PID control, the loop adjusts the output CV so that PV matches SP.
Controls
26
Sample Period Shortest time, in 10 millisecond increments, between solutions of the PID loop. If 0, the loop is solved every time the block is called.
Note: The PLC sweep time should be less than 10% of the sample period to ensure a regular solution time. If not, the sample period should be set to 0.00, specifying execution every sweep.
Bias A value (in CV Counts) added to the PID Output before the rate and amplitude clamps. It can be used to set non-zero CV values if using only Kp Proportional gains, or for feed forward control of this PID loop output from another control loop. The usual setting for the Bias field is +16000 to let the functionregulate error around the output midpoint. Dead Band Upper and Lower Integer values defining the upper and lower dead band limits. If no dead band is required, set these two values to 0. Read the following notes if setting dead band limits: 1. If the PID Error (SP - PV) or (PV - SP) between the dead band limits, the PID calculations are solved with an Error of 0. 2. If setting the dead band limits, Dead Band Upper must greater than 0 and Dead Band Lower must be less than 0 or the PID block will not function. 3. You should leave the dead band limits set to 0 until the PID loop gains are setup or tuned. It may then be desirable to add Dead Band to avoid small CV output changes due to small variations in error, perhaps to reduce mechanical wear. Upper Clamp and Lower Clamp Integers (in CV Counts) that define the high and low values for CV. The clamps are used to define limits based on physical limits for a CV output. The Upper Clamp must have a more positive value than the Lower Clamp, or the PID loop will not work. The PID block has anti-reset windup to modify the integrator value when a CV clamp is reached The upper clamp is usually set to +32,000 to allow the CV output to take on the full range of values. Error Term Selects how the error will be calculated. Min Slew Time Defines the minimum number of seconds for the CV output to move from 0 to full travel of 100% or 32000 CV Counts. It is an inverse rate limit on how fast the CV output can be changed. If positive, CV cannot change more than 32000 CV Counts times Delta Time (seconds) divided by Minimum Slew Time. For example, if the Sample Period was 2.5 seconds and the Minimum Slew Time is 500 seconds, CV cannot change more than 32000*2.5/500 or 160 CV Counts per PID solution. As with the CV Clamps, there is an anti-windup feature that adjusts the integrator value if the CV rate limit is exceeded. If Minimum Slew Time is 0, there is no CV rate limit.
Note: Make sure you set Minimum Slew Time to 0 while you are tuning or adjusting PID loop gains.
Derivative Action Selects how the derivative action is applied. Output Polarity Selects the output polarity of the CV. Update Folder Button Saves values which have been edited in the dialog box to the stored value field of the PID variable. Clicking this button will cause the PLC status to become Not Saved. In order for this button to function, the variable assigned to the Address parameter must have a length of 40 words. If you are online and equal, you will have to rebuild your equipment folder, then Verify equality or Check All to regain equality with the attached PLC. Update PLC Button If you are online and equal with the PLC CPU, click this button to update edited values in the PLC.
Controls
27
The SER function must be reset (receive power flow to the Reset input) before sampling is started. If it is not, it will execute with the current values in the data block. This results in the current sample offset being incorrect, and invalid data in the data block. The SER function can be used in a periodic subroutine. However, caution should be used when doing so. Depending on the mix of the samples being collected, the SER could take more than 1msec to execute, and therefore it is not practical to use the SER function within a 1msec periodic subroutine.
Controls
28
Conversion
BCD to INT Function: BCD4_TO_INT
Use this function to convert BCD values to integer values. When the function receives power flow, it performs the conversion and stores the results in Q. The function passes power flow unless the result is outside the of range of 0 to 9999.
Parameter IN Q Description IN references the reference to be converted. Data Type: Word Q contains the INT value. Data Type: WORD
Conversion
29
Conversion
30
Data Move
Move Function: MOVE_BOOL, MOVE_INT, MOVE_REAL, MOVE_WORD
Use whenever you need to copy data to a new location, or when you need to initialize memory. When this function receives power flow, the data is copied to the location specified in Q.
Parameter ("??") Description Length. The length of data to be moved is defined in the Length field of the variable assigned to IN. The length specifies the number of bits, words or double words to be copied, depending on the selection for the Type field. Length must be between 1 and 32767 for all types except BIT. If IN is a constant and Q is type BIT, the length must be between 1 and 16. If IN is type BIT, the length must be between 1 and 256 bits. IN contains a constant or location of data to be copied. Data Types: BIT, WORD, WORD Length 2 Q contains the target location for the data. Data Types: BIT, WORD, WORD Length 2
IN Q
Data Move
31
ST Q
FT
Data Move
32
Data Table
Array Move Function: ARRAY_MOVE_BOOL, ARRAY_MOVE_BYTE,
ARRAY_MOVE_DINT, ARRAY_MOVE_INT, ARRAY_MOVE_WORD
Use the Array Move (Array Move) function to copy a specified number of data elements from a source array to a destination array. The Array Move function has five input parameters and two output parameters. When the function receives power flow, the number of data elements in the count indicator (N) is extracted from the input array starting with the indexed location (SR + SNX1). The data elements are written to the output array starting with the indexed location (DS +DNX 1). The variable length specifies the number of elements that make up each array.
Parameter ("??") SR Description Length. The length specifies the number of elements (starting at SR and DS) that make up each array. SR contains the starting address of the source array. For an Array Move with the data type BIT, any reference may be used; it does not need to be byte aligned. Data Types: WORD, WORD Length 2, BIT, and BYTE SNX contains the index of the source array. Data Type: WORD DNX contains the index of the destination array. Data Type: WORD N provides a count indicator. Data Type: WORD DS contains the starting address of the destination array. For an Array Move with the data type BIT, any reference may be used; it does not need to be byte aligned. Data Types: WORD, WORD Length 2, BIT, and BYTE
SNX DNX N DS
Data Table
33
Data Table
34
Data Table
35
Data Table
36
Math
Addition Function: ADD_DINT, ADD_INT, ADD_REAL
Use whenever you need to add 2 numbers. When this function receives power flow, the addition is performed and the result is stored in Q.
Parameter IN1 IN2 Q Description IN1 contains a constant or reference as shown in IN1+IN2. Data Types: WORD, WORD Length 2 IN2 contains a constant or reference. IN2 is on the right side of the equation, as in IN1+IN2. Data Types: WORD, WORD Length 2 Q contains the result of the operation. Data Types: WORD, WORD Length 2
IN1, IN2, and Q must be variables of the same data type. If using WORD Length 2, make sure IN1, IN2, and Q are each two words long. If the function results in overflow, Q is set in one of the following ways: For WORD Length 2 operands, Q is set to its largest possible value. For signed numbers, the sign is set to show the direction of the overflow.
IN1, IN2, and Q must be the same data type. If using WORD Length 2, make sure IN1, IN2, and Q are each two words long. If the function results in overflow, Q is set in one of the following ways: For WORD or WORD Length 2 operands, Q is set to its largest possible value. For signed numbers, the sign is set to show the direction of the overflow.
Math
37
IN1, IN2 and Q must be variables of the same type. If using WORD Length 2 make sure IN1, IN2, and Q are each two words long. If the function results in overflow, Q is set in one of the following ways: For WORD or WORD Length 2 operands, Q is set to its largest possible value. For signed numbers, the sign is set to show the direction of the overflow.
Divide rounds down. It does not round to the closest integer. For example, 24/5=4. When using WORD Length 2, make sure IN1, IN2, and Q are each two words long. If the function results in overflow, Q is set in one of the following ways: For signed numbers, the sign is set to show the direction of the overflow. If signed or double precision integers are used, the sign of Q depends on the signs of IN1 and IN2.
If the operation does not result in overflow, Q is set unless one of these invalid REAL operations occur: IN1 and/or IN2 is NaN (Not a Number). 0 divided by 0 1 divided by
Math
38
IN2
IN1, IN2, and Q must be the same data type. If using WORD Length 2 make sure IN1, IN2, and Q are each two words long.
Math
39
Numerical
Square Root Function: SQRT_DINT, SQRT_INT, SQRT_REAL
Use whenever you need to find the square root of a number. When the function receives power flow, Q is set to the integer portion of the square root of IN.
Parameter IN Description IN is the constant or reference of the square root operation. If IN is less than 0, the function will not pass power flow. Data Types: WORD, WORD Length 2 Q contains the square root of IN. Data Types: WORD, WORD Length 2
Numerical
40
Q contains the ATAN (IN). The result will be in the range - Q 2 2 Data Type: WORD Length 2
Numerical
41
IN2 Q
Numerical
42
Index
A
ACOS (Numerical) ADD_DINT (Math) ADD_INT (Math) ADD_REAL (Math) AND_WORD (Bit operations) ARRAY_MOVE_BOOL (Data table) ARRAY_MOVE_BYTE (Data table) ARRAY_MOVE_DINT (Data table) ARRAY_MOVE_INT (Data table) ARRAY_MOVE_WORD (Data table) ASIN (Numerical) ATAN (Numerical) 40 37 37 37 7 33 33 33 33 33 40 41 29 8 8 9 8 8 31 31 31 12 2 32 12 2 2 40 41 30 38 38 38 5 12 14 14 6 6 6 42 42 6 6 6 6 GT_INT (Relational) GT_REAL (Relational) 6 6 29 29 13 13 13 13 6 6 6 42 42 6 6 6 11 11 14 14 39 39 31 31 31 31 38 38 38 2 2 6 6 6 2 2 7 3 3 3 4 4 4 7 26
I
INT_TO_BCD4 (Conversion) INT_TO_REAL (Conversion)
J
JUMP (Control) JUMPN (Control)
L
LABEL (Control) LABELN (Control) LE_DINT (Relational) LE_INT (Relational) LE_REAL (Relational) LN (Numerical) LOG (Numerical) LT_DINT (Relational) LT_INT (Relational) LT_REAL (Relational)
B
BCD4_TO_INT (Conversion) BIT_CLR_WORD (Bit operations) BIT_POS_WORD (Bit operations) BIT_SEQ (Bit operations) BIT_SET_WORD (Bit operations) BIT_TEST_WORD (Bit operations) BLK_CLR_WORD (Data move) BLKMOV_INT (Data move) BLKMOV_REAL (Data move)
M
MASK_COMP_DWORD (Bit operations) MASK_COMP_WORD (Bit operations) MCR (Control) MCRN (Control) MOD_DINT (Math) MOD_INT (Math) MOVE_BOOL (Data move) MOVE_INT (Data move) MOVE_REAL (Data move) MOVE_WORD (Data move) MUL_DINT (Math) MUL_INT (Math) MUL_REAL (Math)
C
CALL (Control) COIL (Boolean) COMM_REQ (Data move) COMMENT (Control) CONTCOIL (Boolean) CONTCON (Boolean) COS (Numerical)
D
DEG_2_RAD (Numerical) DINT_TO_REAL (Conversion) DIV_DINT (Math) DIV_INT (Math) DIV_REAL (Math) DNCTR (Counter)
N
NCCOIL (Boolean) NCCON (Boolean) NE_DINT (Relational) NE_INT (Relational) NE_REAL (Relational) NEGCOIL (Boolean) NOCON (Boolean) NOT_WORD (Bit operations)
E
END (Control) ENDMCR (Control) ENDMCRN (Control) EQ_DINT (Relational) EQ_INT (Relational) EQ_REAL (Relational) EXP (Numerical) EXPT (Numerical)
O
OFDT_HUNDS (Timer) OFDT_TENTHS (Timer) OFDT_THOUS (Timer) ONDTR_HUNDS (Timer) ONDTR_TENTHS (Timer) ONDTR_THOUS (Timer) OR_WORD (Bit operations)
G
GE_DINT (Relational) GE_INT (Relational) GE_REAL (Relational) GT_DINT (Relational)
P
PID Tuning
43
24 23 2 41 6 6 6 30 29 30 2 10 10 33 33 33 33 34 34 34 34 35 35 35 35 35 35 35 35 36 36 36 36 34 34 34 34
R
RAD_2_DEG (Numerical) RANGE_DINT (Relational) RANGE_INT (Relational) RANGE_WORD (Relational) REAL_TO_DINT (Conversion) REAL_TO_INT (Conversion) REAL_TO_WORD (Conversion) RESETCOIL (Boolean) ROL_WORD (Bit operations) ROR_WORD (Bit operations)
S
SEARCH_EQ_BYTE (Data table) SEARCH_EQ_DINT (Data table) SEARCH_EQ_INT (Data table) SEARCH_EQ_WORD (Data table) SEARCH_GE_BYTE (Data table) SEARCH_GE_DINT (Data table) SEARCH_GE_INT (Data table) SEARCH_GE_WORD (Data table) SEARCH_GT_BYTE (Data table) SEARCH_GT_DINT (Data table) SEARCH_GT_INT (Data table) SEARCH_GT_WORD (Data table) SEARCH_LE_BYTE (Data table) SEARCH_LE_DINT (Data table) SEARCH_LE_INT (Data table) SEARCH_LE_WORD (Data table) SEARCH_LT_BYTE (Data table) SEARCH_LT_DINT (Data table) SEARCH_LT_INT (Data table) SEARCH_LT_WORD (Data table) SEARCH_NE_BYTE (Data table) SEARCH_NE_DINT (Data table) SEARCH_NE_INT (Data table) SEARCH_NE_WORD (Data table)
SER (Control) SETCOIL (Boolean) SHFR_BIT (Data move) SHFR_WORD (Data move) SHIFTL_WORD (Bit operations) SHIFTR_WORD (Bit operations) SIN (Numerical) SQRT_DINT (Numerical) SQRT_INT (Numerical) SQRT_REAL (Numerical) SUB_DINT (Math) SUB_INT (Math) SUB_REAL (Math) SVC_REQ (Control) SVCREQ 6 SVCREQ 7 SVCREQ 13 SVCREQ 14 SVCREQ 15 SVCREQ 16 SVCREQ 18 SVCREQ 23 SVCREQ 26/30 SVCREQ 29 TAN (Numerical) TMR_HUNDS (Timer) TMR_TENTHS (Timer) TMR_THOUS (Timer) TRUNC_DINT (Conversion) TRUNC_INT (Conversion)
28 2 32 32 9 9 40 40 40 40 37 37 37 16 16 17 18 18 19 20 20 21 21 22 41 3 3 3 30 30 5 30 7
U
UPCTR (Counter)
W
WORD_TO_REAL (Conversion)
X
XOR_WORD (Bit operations)
44
9
Exercises
Example Configure your simulator and store it in the PLC. Notice that you get CONFIG EQUAL.
TM-00281
%I0002
%I0004
%Q0001
%Q0008 RUNG 6
%I0003
%I0007
When the programming is finished, note that LOGIC NOT EQ is shown on the status line on the bottom of the screen. a. Go to Utility: Load/Store/etc. and store the program in the PLC. Before storing the program you must make sure that you are ONLINE and the PLC is in STOP/ NO IO. (Use ALT+M to change programmer mode and ALT+R to change run/stop state.) After store, check the status line again, it should now say LOGIC EQUAL. b. Go back to Program Display/Edit, start the PLC program and test the functions in the program. 2. Change to Reference tables and check that the status in these also changes according to the state of the inputs. To change to a different address type, enter % and the letter for the desired type (e.g. %Q), then press ENTER.
TM-00281
3. Return to Program Display/Edit and insert the following rungs at the end of the program (stay ONLINE while programming):
%I0003 %I0004 %Q0009 RUNG 7 %Q0009
%I0003
%I0004
%Q0010
M
RUNG 8
%Q0010
%I0005
%Q0011
S
RUNG 9
%I0006
%Q0011
R
RUNG 10
%I0005
%Q0012
SM
RUNG 11
%I0006
%Q0012
RM
RUNG 12
After insert is ready, the PLC must be updated because the changes have been made only in the folder in the computer. a. Go to Utility: Load/Store/etc. and transfer the program to the PLC. b. Go back to Program Display/Edit and try the functions. Activate outputs %Q0009 %Q0012. Turn the power to the PLC off and back on again, check what has happened with the outputs.
TM-00281
RUNG 13
%I0005
%M0002
RUNG 14
%M0001
%Q0013
SM
RUNG 15
%M0002
%Q0013
RM
RUNG 16
%I0001 %I0002 %I0003 %I0004 %I0005 %I0006 %I0007 %I0008 %I0009 <+> RUNG 17 %I0010 %I0011 <+> %Q0014 RUNG 18
Note that on the status line, you can see if the information in the folder is the same as in the PLC. If changes have been made only in one block of the program BLOCK EDIT is shown on the status line. In this case it is possible to use ALT+S to store this block in the PLC, without having to go to utilities and store the program. The PLC must be stopped before ALT+S is used. a. After the PLC have been updated, try the function of the instructions on the new rungs. Note the function of () and ().
TM-00281
%I0004
ONDTR 0.10s
%Q0005 RUNG 20
When finished, update the PLC and try the function of the timers.
TM-00281
%I0008
DNCTR
%Q0016 RUNG 22
%I0009
CONST +00005
PV %R0010
Check the counter functions as well after the PLC has been updated.
TM-00281
%I00001
%Q00001
%I00002
%Q00003
%I00002
%Q00003 %Q00007
%Q00007
%I00002
%I00004
%I00001
%Q00008
%I00002 %I00003
%I00004
%I00001 %I00007
%Q00008
%I00003
%I00007
When the programming is finished, note that LOGIC NOT EQ is shown on the status line on the bottom of the screen. a. Store the program in the PLC. Before storing the program you must make sure that you are ONLINE and the PLC is in STOP/ NO IO. After store, check the status line again. It should now say LOGIC EQUAL. b. Start the PLC program and test the functions in the program.
TM-00281
2. Create a Reference table and check that the status in this also changes according to the state of the inputs. (File, New, View Table, Reference View Table)
%I00001 %Q00001 %M00001 %R00001 %R00100
10
TM-00281
3. Return to Program Logic and insert the following rungs at the end of the program (stay ONLINE while programming):
%I00003 %I00004 %Q00009 %Q00009 NONRETENTIVE
%I00003 %Q00009
%I00004
%Q00009 NONRETENTIVE
%I00003
%I00004
%I00003 %Q00010
%I00004
%Q00010 RETENTIVE
%I00005
%Q00011
S
%I00005
%I00006
%I00006
%I00005
%I00005
%I00006
%I00006
%Q00012 RETENTIVE
After insert is ready, the PLC must be updated because the changes have been made only in the folder in the computer. a. Transfer the program to the PLC. b. Try the functions. Activate outputs %Q00009 %Q00012. Turn the power to the PLC off and back on again, check what has happened with the outputs. Note that Non-Retentive coils are displayed bold. If you have changed the default display settings (font) you might not be able to see that.
TM-00281
11
%M00001
%M00001 %M00002
%M00002 %Q00013
S
%Q00013 %Q00013
R
%Q00013
%Q00014 %Q00014
%I00010%I00011
a. After the PLC has been updated, try the function of the instructions on the new rungs. Note the function of () and ().
12
TM-00281
%Q00005 %Q00005
%Q00006 %Q00006
When finished, update the PLC and try the function of the timers.
TM-00281
13
DNCTR %R00010
%Q00016 %Q00016
%R00010
PV
Check the counter functions as well after the PLC has been updated.
14
TM-00281
Change rung 4
%I00002 %I00002 %I00003 %I00003 %I00004 %I00004 %M00003 %M00003 %Q00001 %Q00001 %I00007 %I00007 %Q00008 %Q00008
TM-00281
15
PV
DNCTR %R00010
%Q00016 %Q00016
%R000
PV
NEW
%I00008 %I00008 %I00009 R %I00009 5 %R000 PV DNCTR %R00010 %Q00016 %Q00016
UPCTR %R00007
%Q00015 %Q00015
%R000
PV
16
TM-00281
8. Search if %R13 is used in the program (your result should look like the following):
---------- Find in Blocks ---------Searching for Address '%R00013' in all blocks, including implicit references: _MAIN, rung number 19, in instruction 'OFDT_TENTHS', for operand 'Address'. Total matches: 1
TM-00281
17
18
TM-00281
TM-00281
19
20
TM-00281
TM-00281
21
Search / Edit
Load the program M21_186 to your computer. Search the following (note the block and rung). %Q0008 B6105 %R0606 (explicit / implicit) call Blk_502 You will receive the floppy disk from your instructor.
22
TM-00281
CONST +00000
IN LEN 00001
%R0001
%I0002
BLKMV INT
CONST +00001 CONST +00002 CONST +00003 CONST +00004 CONST +00005 CONST +00006 CONST +00007
IN1
%R0001
IN2
IN3
IN4
IN5
IN6
IN7
%I0003
MOVE_BIT
%I0001
IN LEN 00003
%Q0001
TM-00281
23
CONST +00200
IN LEN 00001
%R0008
%I0008
MOVE_INT
CONST +00400
IN LEN 00001
%R0008
%I0009
TMR 0.10s
%Q0008
%R0008
PV
%R0010
24
TM-00281
Counters
The number of parts inside the Storage should be presented in register %R0100. Note that the number should not be below 0.
STORAGE
%I0001
%I0002
IN
OUT
TM-00281
25
Timers basic
Program the following two examples: Example 1 Five seconds after %I0001 is switched off, %Q0001 should go to 0.
%I0001
%Q0001
5 sec.
Example 2 A timer should count from 010 sec, and then start over again automatically.
Time (sec.) %R0001 (timer)
10
26
TM-00281
Timers advanced
The output %Q0001 should go ON and OFF as shown in the time axis below. When it reaches the end it should start over again automatically.
%Q0001 1 sec. 0.5 sec.
2 sec. Start
3 sec. End
TM-00281
27
Range basic
Create a timer that goes from 0 to 255, and then starts over again automatically. The output %Q0001 should be ON between 90 and 120.
255 0
255
90 128 120
28
TM-00281
Range advanced
Use the same timer as in the basic exercise. This time output %Q0002 should be ON from 245 to 15.
245 0 15
128
TM-00281
29
Relational
In the programming exercise Counter we made a simulation of a storage. In this exercise we like to use a Level monitor with LEDs to get a quick look of the status in the storage. The value in the storage is between 0 and 160. Example When the value in register %R0001 is less than or equal to 50, the following outputs should be ON: %Q16, %Q15, %Q14, %Q13 and %Q12.
160 150 140 130 120 110 100 90 80 70 60 50 40 30 20 10 %Q1 %Q2 %Q3 %Q4 %Q5 %Q6 %Q7 %Q8 %Q9 %Q10 %Q11 %Q12 %Q13 %Q14 %Q15 %Q16
30
TM-00281
%I0003
%Q0001
RM
TM-00281
31
32
TM-00281
The status of the level relays in the picture below are; LOW (1), HIGH (0).
Low High
TM-00281
33
The status of the level relays in the picture below are; LOW (1), HIGH (0).
Low High
34
TM-00281
TM-00281
35
36
TM-00281