• No results found

ED4260 Manual

N/A
N/A
Protected

Academic year: 2021

Share "ED4260 Manual"

Copied!
288
0
0

Loading.... (view fulltext now)

Full text

(1)

Considerations for quality assurance

Assurance contents

We guarantee 1 year after service from the date of purchasing this product. If this product has any troubles or errors within such a period, you can receive free service from ED customer support center.

Expenses covered by customers

The necessary services shall be offered at a minimum cost of customers in the following cases.

1) If the warranty period expires.

※ However, it shall be valid for 5 years after the warranty period expires.

2) If the product has any troubles due to customers' negligence or Act of God. ※ They shall be handled at a charge of customers even during the warranty period.

Not guaranteed

Any deliberate disassembly of this product for improving the performance cannot be covered by the manufacturer's warranty responsibility.

Service guide

Please, contact our customer support center for service application and consultation. Customer support center: +82-31-730-7525 FAX : +82-31-730-7313

※ For the safe and correct use of this product, please make sure to read the user's manual carefully before using it and follow the guidelines on how to handle and use this product.

Notice for equipment changes

This product is subject to change without prior notice to improve its appearance, specifications and performance.

(2)
(3)

1. Keep the Manuals

This manual provides basic information on ED-4260 System, the PLC experiment training device, along with directions for use. Before proceeding, it should be mentioned that the main unit of PLC under discussion is "GLOFA-GM4"manufactured by LS Industrial Systems(http://eng.lsis.biz). Therefore, one should refer to the manual provided with the product for basic instructions on usage. This manual focuses on how to use the peripherals and option module for PLC training, and it should also be noted that all manuals provided with ED-4260 should be kept with care. Manuals of other optional equipments should be kept too.

2. Manual

* Programmable Logic Controller (ED-4260 Experimental Manual)

※ Manuals for each option module is provided with the equipment. (This training book provides directions for using option modules)

3. Be Acquainted

(1) The caution and the rest of the content of each manual must be read prior to using the equipment.

(2) Read the information on functions of each module and the instructions for using the equipment before use.

(3) Know in advance the functions and the usage of the power supply and the I/O ports in the ED-4260 frame, as well as the basic module (3 types).

The basic modules are as follows : * PLC Input Controller (IM-4260-2) * PLC Output Simulator (OM-4260-3) * Count & Position Simulator (PM-4260-4)

(4)

(5) The maximum allowed amount current for the output contact of the PLC output module is 2A. For more that 1A load at AC 250V, a another auxiliary relay is required.

(6) Care should be taken not to store or use the device under conditions below: * Humidity

* Heat * Vibration * Dust

(5)

The Basics of PLC (Programmable Logic Controller)

1

Chapter 1 Introduction to PLC 3

1-1. Control Elements 3

1-2. Definition of PLC 3

1-3. History of PLC 4

1-4. Standards and Characteristics of PLC 5

1-5. Selection and Application of PLC 8

Chapter 2 The Structure of PLC 10

2-1. Hardware Structure 10

2-2. Input and Output Structure of PLC 12

2-3. Software Structure 15

Chapter 3 PLC Program (GMWIN) Setup 21

3-1. PC Requirements 21

3-2. Installing GMWIN 22

Chapter 4 Programming Tool (GMWIN) 25

4-1. Launching GMWIN 25 4-2. User Interface 30 4-3. Project Structure 31 4-4. LD Edit 33 4-5. Upload 34 4-6. Menu 36 4-7. Toolbar 43

4-8. Files Created by GMWIN 47

4-9. Opening Files 48

(6)

Chapter 6 Execution 61

6-1. Scan Time 61

6-2. I/O Refresh 62

6-3. I/O Image Area 62

6-4. Operation Mode 62

6-5. Changing the Operation Mode 64

6-6. Restart Mode 66

Chapter 7 Programming Basics 69

7-1. Using the Toolbar 69

7-2. Sequence Operators 106

7-3. List of Functions 107

7-4. List of Function Blocks 118

Chapter 8 Basic Sequence Circuits 120

8-1. AND Circuit 120

8-2. OR Circuit 121

8-3. NOT Circuit 122

8-4. Self Holding Circuit 123

8-5. Interlock Circuit 124

8-6. On-Delay Circuit 126

8-7. Off-Delay Circuit 127

8-8. One Shot Circuit 128

Appendix Glossary 129

ED-4260 PLC Trainer

133

Chapter 1 Introduction of ED-4260 PLC Trainer 135

1-1. Introduction of ED-4260 135

1-2. Basic Components of ED-4260 PLC Trainer System 136

(7)

2-3. Position Control Module 152

Chapter 3 Option Modules 156

3-1. A/D Converter(AD-4260-5) 156

3-2. D/A Converter(DA-4260-6) 160

3-3. Temperature Sensor Module(SU-4260-9) 164

3-4. Photo Control SCR Circuit(PC-4260-10) 168 3-5. Power & Terminal Transfer Unit(PT-4260-7) 172 3-6. Potentiometer & Meter Unit(PM-4260-8) 175

PLC Training Using the ED-4260 Trainer

177

Exercise 1 PLC I/O(ED-4260 TRAINER) Practice 179 Exercise 2 Program Practice using Subroutine Commands 191 Exercise 3 Motor's Start/Stop Circuit Practice 197 Exercise 4 Motor's Forward/Reverse Control Program Practice 203 Exercise 5 Program Practice using SET & RESET 209 Exercise 6 Positive/Negative Transition Sensing Pulse Coil Program 215 Exercise 7 3-Phase Induction Motor's Y-△ Start Circuit Program 220 Exercise 8 Program Practice using Counter(UP) 227 Exercise 9 Program Practice using Branch JUMP Command 234 Exercise 10 Program Practice using Return Command 239 Exercise 11 Program Practice using Transmission(MOVE) Command 243 Exercise 12 Motor's Upper/Lower Limit Linear Movement Circuit

Practice 249

Exercise 13 Stepping Motor Circuit Practice using Timer 254 Exercise 14 Applied PracticeⅠ (Quiz Program Practice) 259 Exercise 15 Applied PracticeⅡ (Electronic Timer Program Practice) 262 Exercise 16 Applied PracticeⅢ (Lamp Shift Lighting Program Practice) 265 Exercise 17 Applied PracticeⅣ (Timer External Control Program

PracticeⅠ) 268

Exercise 18 Applied PracticeⅤ (Timer External Control Program

Practice Ⅱ) 272

(8)
(9)

CH1. Introduction to PLC / 3

CH2. The Structure of PLC / 10

CH3. PLC Program (GMWIN) Setup / 21 CH4. Programming Tool (GMWIN) / 25 CH5. Data Representation / 52

CH6. Execution / 61

CH7. Programming Basics / 69 CH8. Basic Sequence Circuits / 120 Appendix Glossary / 129

(10)
(11)

Chap. 1 Introduction to PLC

1-1. Control Elements

① Input device: Composed of sensor, which converts physical signal into electric signal, and a converter, which transfers the signal to the controller.

② Output device: Converts the control signal generated by the device to operational signals to stimulate the actuator.

③ Control device: Sends output signals by executing the appropriate control method and control algorithm depending on the input condition. It is categorized into programmable controller, which has the control algorithm stored in memory as software to enabling easy modification, and hardware system, where once the control algorithm is set, it cannot be modified.

Input element Control element Output element

Measurement Processing (Control Device)

(Algorithm)

Operation

(Transducer) (Controller) (Actuator)

[Figure 1-1] Elements of control system

1-2. Definition of PLC

PLC(Programmable Logic Controller) replaces functions such as relay, timer, counter used in old controller with semi-conductor component such as IC and transistor, adding computation abilities to the basic controlling function to make programmed control possible. National Electrical Manufacturers Association (NEMA) defines PLC as "a digi-tal oriented electronic device which uses programmable memory to perform special func-tions such as logic, sequencing, timing, counting, and computation through digital or an-alog input/output module, and which controls variety of machines and processors."

(12)

1-3. History of PLC

The development of the industrial society led each manufacturing process to become larger in scale, and more advanced and complex, requiring many different forms of con-trol systems. A lot of time and money is needed to organically interconnect and modify these control systems. Up to now, control systems for automation were connected to re-lated electronic components, such as relay, controller, timer, counter, etc, depending on the circuit layout, which led to problems such as difficulty in the wiring process and need large amount of space for sequence control, also has a limitation of processing speed of operation.

Recognizing these problems, in 1968, General Motors, the American automobile manu-facturer, suggested 10 conditions for PLC, as shown in [Table 1-1], which became the starting point of PLC development. [Table 1-2] is a brief history of PLC.

[Table 1-1] 10 conditions suggested by GM

(1) Should be easy to implement and modify program and sequence system. (2) Maintenance and repair must be easy and must be plug-in type.

(3) Should be more reliable than relay controller.

(4) Output should be able to be connected to higher level computer. (5) Should be smaller in size than relay controller.

(6) Should be more cost-effective than relay controller. (7) Input should be supplied with AC115[V].

(8) Should be output AC115[V], 2[A].

(9) Should be expandable without making much modification of the entire system.

(10) Should be equipped with programmable memory, which is expandable to at least 4k words.

(13)

[Table 1-2] History of PLC

Year Progress

1968 The birth of the concept of PLC

1970 Introduction of logic control, 1k memory capacity and 128 I/O point handler

1974 Timer, counter, arithmetic operations, 12k memory capacity, and 1024 I/O point handling

1976 Introduction of remote I/O system (first standard created by the US) 1977 Introduction of microprocessor PLC

1980

Introduction of high performance I/O module, high performance communication device. high functional software; started to use microcomputer as programming tool

1983 Introduction of inexpensive small-size PLC

1985 Standardization, distributed and hierarchical control made possible by networking with computer

1991 Fuzzy logic implemented by fuzzy module and fuzzy-only package

1-4. Standards and Characteristics of PLC

1) IEC Standard Language

Until now, engineers who wished to work with PLC faced difficulties because the language and communication networks were different for many PLC makers. In order to fix this problem and bring more convenience to the user, IEC (International Electrotechnical Commission) drew up an international standard specification (IEC 1131) which, as shown in [Table 1-3], is composed of 5 parts.

[Table 1-3] IEC 1131

Part Description

Part 1 Basic features of PLC and definition of terms

Part 2 Required functions and testing conditions of the facility Part 3 Programming language

Part 4 Notice to users

(14)

Some important features introduced by IEC are as follows: ① Support for many data types

② Components such as function, function block, program, etc, which made both top -down and bottom-up design and structured implementation possible

③ User programs can be made into libraries to be used in other environment

④ Support for multiple languages, from which user can choose the most optimal language for use.

⑤ The standard PLC language suggested by IEC consists of two graphic languages, two text-based languages, and SFC.

(1) Graphic Language

① LD (Ladder Diagram) : Originates from ladder in the U.S. Input and output are combined to form a program, which is a type of relay logic representation.

② FBD (Function Block Diagram) : Program represented by connecting the block functions.

(2) Text-Based Language

① IL (Instruction List) : Used in Europe. Command type language similar to assembly language.

② ST (Structured Text) : A high-level language developed to be used for real-time ap plications and is based on Pascal and C.

③ SFC (Sequential Function Chart) : Sequentially describes the flow and conditions of manufacturing process, where time, event, etc are defined as control sequence blocks.

(15)

2) Characteristics of PLC

[Table 1-4] lists the characteristics of PLC and other control devices, showing the strength and weakness of each.

[Table 1-4] Comparison of Controllers

Category Relay Controller Digital Logic Computer PLC

Price Very

inexpensive Inexpensive Expensive Inexpensive

Size Large Very small Moderate Very small

Speed Slow Very fast Very fast Fast

Noise Good Fair Excellent Fair

Control

Much time for design and

integration

Much time for designing Very much time for programming Simple Complex

Functions None Supported Supported Supported

Usage

Modification Very difficult Difficult Very simple Very simple

Maintenance Very difficult Difficult Very simple Very simple

◈ Characteristics of PLC - Wide variety of functions

- High functionality of program (easy to design control circuit) - Easy to control

- Easy to maintain - Reliable

(16)

1-5. Selection and Application of PLC

1) Selecting PLC

In order to select PLC, it is necessary to have a thorough understanding of the sub-ject of control, especially about the features, price, scalability, maintenance, whether the model will continue to exist in the market, and the user.

(1) Figuring the "Input Points"

Combine the number of signal inputs, such as push button switch, limit switch, etc, with the number of sensors, such as proximity sensor, photo sensor, reed switch, to de-rive the input points and select a reasonable capacity. In addition, select input module with the appropriate specifications (AC or DC and voltage), taking into consideration the voltage requirements of the sensors, etc.

(2) Figuring the "Output Points"

Sum up the number of power indicators, operation indicators, overload indicators, bells, etc. to derive the output points. Combine modules in point units of 8, 16, 32, etc, to derive the module count. In addition, since there are relay contact type, TR output type, SSR output type, etc, the voltage specification must be taken into account.

※ Relay contact output type, which is not restricted by the output voltage, is generally used.

(3) CPU and Support for Special Modules

Generally, support for analog I/O and special cards (HSC, POP, PID, etc), in addition to digital I/O, should be taken into consideration, along with the characteristics of the CPU.

(17)

2) Application of PLC

The applied area of PLC is expanding as facilities are challenged to be automated more efficient. Specifically, the demand for PLC due to factory automation and FMS has added to the old role of PLC of replacing the relay controller, the role in small manu-facturing machines to large scale system facilities, as the current trend is for large scale and high functionality. [Table 1-5] shows applications of PLC, organized by the subject of control.

[Table 1-5] Application of PLC

Field Subject of Control

Food Conveyer master control, automated production line control Steel Production Cargo control, raw material transport control, rolling machine

control Fiber &

Chemical Cargo control, conveyer control, dyeing machine control Automobile

Manufacturing Transfer line control, automated assembly control

Machine Industry Industrial robot control, manufacturing machine control, water pump control

Water & Sewage Services

Filtration plant control, sewage disposal plant control, water pump control

Logistics Automated warehouse control, cargo facility control, return line control

Factory

Equipment Compressor control, etc Pollution

(18)

Chapter 2 The Structure of PLC

2-1. Hardware Structure

PLC is composed of the CPU, which is composed of microprocessor and memory, and is analogous to the human brain, the input and output part which takes connection with external peripheral devices, the power supply, and peripheral device which writes the program to the PLC memory. [Figure 2-1] shows the PLC structure as a whole.

Input Device Loader Output Device

∶ ∶ ∶ ∶ 󰀶 ∶ ∶ ∶ ∶ 󰀶 I n p u t Memory O u t p u t

Limit Switch Magnetic Contactor

Proximity Sensor 󰀵

󰀶 Solenoid

Microprocessor

Photo Sensor ➜ ➜ Pilot Lamp

[Figure 2-1] The Overall Structure of PLC

1) CPU of PLC

Correspond to the role of the PLC brain, which fetches programs stored in memory one by one and decodes and executes each one. This process is repeated very rapidly and all data is processed in binary form.

(19)

2) The Memory of PLC CPU (1) Types of memory

There are two types of IC memory, namely ROM and RAM. ROM is read only memory, as it stands for, whose content cannot be modified, and, therefore, used to store fixed data. This type of memory is said to be involatile, for it retains its content even when the power is cut off. On the other hand, it is possible to read data from and write data to RAM at any time. RAM is used to temporarily store data, but any data it contains will be lost if the power is cut off, making it a volatile type of memory, al-though it is possible to save a part of the RAM by using a small amount of battery power, to utilize it as involatile section of memory.

(2) Memory content

The memory of PLC is divided into user program memory, data memory, and system memory. User program memory contains the program created by the user to suit the specification of the subject for control. Since user program must be able to be stored in the course of the development and need for modifications may arise later, user programs are stored in RAM. When the development of the program has been completed and the program becomes fixed, it can be stored in ROM for ROM operation. Data memory stores data such as contact status of input and output relay, auxiliary relay, and the set-ting & current value of the timer and counter, etc. which is subject to change dynam-ically, so it is stored in RAM.

System memory is used to store system program provided by the PLC manufacturer. Since this kind of system program is a critical factor to determine the functionality and performance of the PLC, it is written to ROM by the PLC manufacturer.

(20)

2-2. Input and Output Structure of PLC

The input and output part of PLC is connects directly to the peripherals(input/output elements) at site. Although the internal circuit of PLC uses DC +5(V) power (TTL lev-el), the input and output part operates on a different voltage(DC 24V, AC 220V etc.), therefore we must consider the interface between the inside and the outside of the PLC is a critical factor for ensuring system stability. Following is the requirements for the in-put and outin-put part:

① It must match with the external device in its electronic specifications. ② Noise from the external device must not reach or affect the CPU. (use photocoupler)

③ Connection to external device must be easy.

④ It must be possible to monitor the status of each contact of input and output (add LED)

[Table 2-2] shows the external device connected to the input and output part.

[Table 2-2] Input and Output Devices

I/O Category Installation Point External Device

Input

Contact Type Control Part and Operation Part

Push-Button Switch Selector Switch Toggle Switch

Level Switch(contact type) Limit Switch

Contactless

Type Mechanical Device

Reed Switch Photo Sensor Level Sensor Proximity Switch

Output

Indicator Control Part and Operation Part

Pilot Lamp Bell(Buzzer)

Actuator Mechanical Device

Electromagnetic Valve(solenoid) Electromagnetic Clutch

Electromagnetic Brake Electromagnetic Switch (magnetic contact)

(21)

1) Input Part

Transfers signal from external devices to the arithmetic logic unit of the CPU.

There are DC 24[V], AC 110/220[V] inputs, as well as other inputs module such as analog input (A/D) module, high speed counter module, etc. [Figure 2-3] represent an example of the input part circuit.

Device Device

[Figure 2-3] Input part circuit

2) Output Part

Transfers results of internal computation to external devices such as magnetic contactor or solenoid to drive them. Types of output includes relay output, transistor output, and SSR (Solid State Relay), and for other output modules, there are analog output (D/A) module and position control module(POP). [Figure 2-4] shows an example of transistor output module.

(22)

Load External Device Internal Device Indication LED Photo Coupler Diode +24V

[Figure 2-4] Transistor Output Module

[Table 2-3] PLC Types of Output Module

Supply Voltage

Switch Component

Type contact Less type contact

(Semiconductor)

Direct Current (DC) Relay Transistor

Alternating Current (AC) Relay SSR

As shown in [Table 2-3], relay output can be used for both DC and AC, but consid-ering the limit in the durability of mechanical components, it is recommended to use a contactless element as below SSR output in AC or the transistor output in DC.

※ Special modules

① Position control module

Process rapid contact output at the designated frequency range and voltage level. ② PID control module

Computes raw data received from analog input modules to reach the desired value, using optimal conditions, and outputs the result to analog output module.

③ Desired value control

Control the desired value by repeatedly increasing, decreasing and sustaining the current value within predetermined amount of time.

④ Etc.

(23)

2-3. Software Structure

1) Introduction to Programming

There is no fundamental difference between PLC control sequence and using relay, timer as done in the past. In order to understand and make the sequence program, the user must have knowledge in following 3 areas.

① Characteristics of the subject of control, that is electric condition of the goal of controlling, operation method, behavior, etc.

② Characteristics of the controlling device, such as relay and PLC, etc.

③ Must be aware of the rules PLC imposes for designing sequence, namely the rules concerning the symbols for diagram, device number, status, etc.

There is no difference between using a PLC and relay/timer, regarding the above two issues. Therefore, in order to understand PLC control sequence, it is important that one have knowledge about the characteristics of PLC and how to use it. For example, there are hardware specifications such as nominal voltage and the number of contacts, and software aspects such as logic operation, timer, and counter. This kind of information can generally be found in the specification section of the catalog. In short, selecting the correct feature out of the many features PLC provides is the key to good design.

2) Hard-wired and Soft-wired

Previous methods of relay control relied on laying out the flow of tasks on the circuit diagram and adding necessary controlling device, occasionally requiring lead wiring. This method is called hardwired logic.

In hardwired logic, the hardware and the software is coupled as one, so any need for change required modifying both the hardware and the software. Consequently, much ef-fort has been put to separating the hardware and the software, which lead to the in-troduction of the computer model. Computer cannot operate solely with hardware. It can do any work only if a set of instructions, i.e. a program, is loaded in its memory. The process of loading the program in the memory is called programming, which can be thought of as the equivalent of the wiring task. This method is called soft-wired logic, and PLC uses this method.

(24)

3) The difference between relay sequence and PLC program

As PLC is a collection of electronic components such as LSI, it contains no contact such as relay sequence, or coil, and any operation requiring these components are han-dled in a software manner, activity of which is not visible. In addition, unlike relay se-quence which is activated if the contact closes due to the induction in the coil, PLC has the program stored in memory and scans the content sequentially, and operates accordingly. This way, the user can modify the program in any way, to fit the control logic.

(1) Serial Processing and Parallel Processing

The most fundamental difference between PLC control and relay sequence is serial processing and parallel processing, as shown in [Figure 2-5]. PLC takes the form of se-rial processing, where the program stored in the memory is sequentially computed, in re-lay sequence, many circuits operate simultaneously, which is called parallel processing. Therefore, PLC is doing only one thing at any moment.

(a) Serial Processing (a)

(b) Parallel Processing (b)

(25)

First of all, the operational difference between PLC and relay will be discussed, refer-ring to the sequence diagram in [Figure 2-6(a)].

In relay sequence, if power is supplied and contacts “A” and “B”, and “D” and “E” closes at the same time, output “C” and “F” is activated and whichever was quicker to react is activated first. In contrast, “C” will be activated prior to “F” according to the execution order in PLC.

To further looking at the difference between PLC and relay, refer to Figure 2-6(b), where supply of power closes the contact “J”, which activates “H” and blocks activation of “I” in Relay sequence. In PLC, however, closure of “G” causes “I” to become active and closure of “J” causes “H” to become active on the first execution. In the second execution, the output of “I” is cleared by “H,” which has been activated during the first execution.

(2) Restriction on the number of contacts used

Generally, relay has a limit in the number of contacts per relay. Consequently, one must be economical in the use of contacts when designing a relay sequence. In contrast, PLC does not impose any limit in the number of contact to use, because it stores the information of each contact (ON/OFF state) in the memory and refers to the data on ex-ecution of the program.

(3) Restriction on the location of contact and coil

PLC introduces restrictions, or rules, which does not exist in relay sequence, one of which is prohibiting of putting any contacts after the coil, this restriction means that the output coil must be aligned at the right side. In addition, PLC is configured to always carry its signal from left to right, prohibiting signal flow in any other direction, which is possible in relay sequence.

(26)

[Figure 2-7] Rules in PLC Sequence

(4) Cautions for configuring PLC

In case of relay circuits, the effect of malfunction of a part is restricted and other parts continue to work, but in PLC, failure of a part affects the whole system. In this light, it is not always wise to depend solely on PLC for controlling the whole system, and vital circuits, such as circuits for voltage control should be configured out of the PLC. Also, it may be dangerous if the output unit becomes ON at the moment PLC is powered up, so measures should be taken as shown below:

(27)

PLC Power Supply ON Input Unit OFF Output Unit Operation Ready THR PLC Stop Output MC Output Unit THR THR MC1 MC2 Interlock

1. The input unit, lamp output unit must be connected in front of the emergency stop circuit, in order to monitor the stop status of operation.

2. The output unit retains its ON/OFF state right before stopping. In this case, the lamp stays on if keeping relay which retains data during power failure is used. We can also make the lamp stays on with general rely using self-holding circuit.

3. Stop Output

4. Interlock Circuit: In case of opposing set of operations such as cw and ccw rotation and the mishandle can cause damage to both machinery and men need a interlock.

Emergency Stop

(28)

(5) Sequence of PLC Programming System Design Operation Flow I/O Allocation Ladder Design Programming

Modify Program & Reiwiring

Store Program

Operation Independent Module Test

I/O Device and PLC Wiring

Review Test Start Decide Memory capacity and

the # of input and output units .

Store in floppy disk, PROM,Type HDD.flash Memory

NG

(29)

Chapter 3. PLC Program (GMWIN) Setup

3-1. PC Requirements

The following is the hardware and software required to run GMWIN.

1) Computer and memory

PC with CPU Intel Pentium or later, and minimum of 128 Megabytes of memory.

2) Serial Port

In order to utilize the full functionality of GMWIN and connect with PLC, there needs to be at least two serial ports available.

3) Hard disk drive

Minimum of 20 Megabytes of space must be available in the hard disk to install all the GMWIN related files and to run GMWIN smoothly.

4) Floppy disk drive

If you choose to GMWIN from floppy disks or save data on floppy disks, a floppy disk drive is required. (CD drive recommended)

5) Mouse

A Microsoft Windows compatible mouse is required in order to use all the features of GMWIN.

6) Printer

A Microsoft Windows compatible printer is required in order to print in GMWIN.

7) Microsoft Windows

(30)

3-2. Installing GMWIN

1) Installation Procedures

① Insert the CD-ROM in the CD-ROM drive.

② Click[PLC] in PRODUCT INFO → GLOFA-GM → Software → GMWIN → GMWIN 4.1

(31)

④ A setup dialog box with a welcome message appears. Any other application is recommended to be closed during the installation process.

(32)

⑥ A dialog appears, showing the path of the folder where the program will be installed. To install at a different folder, click the button to choose an other folder. To stop the installation procedure, press the button at any stage of the installation. In this case, GMWIN will not be able to be launched since the installation was aborted. Click to move to next step.

⑦ Files will start to be copied from the CD-ROM to the hard disk.

⑧ The GMWIN is successfully installed.

(33)

Chapter 4. Programming Tool (GMWIN)

4-1. Launching GMWIN

1) From the Windows Start menu, choose Programs - [LGIS], [GMWIN 4], [GMWIN

4.0]. A window in [Figure 4-1] will appear.

(34)

2) GMWIM start window will appear as below. Click New Project in Project menu as in [Figure 4-2].

[Figure 4-2] GMWIN Project Window

3) Project

In the New Project window, project file name is the name specified by the user and if it is not specified, it takes the default project name automatically. PLC type should be set to the type of PLC which will be used. In addition, Writer and Comment are only auxiliary information of the project, so they can be omitted. Refer to [Figure 4-3].

(35)

[Figure 4-3] GMWIN New Project Window

4) Define Program

[Figure 4-4] shows the Define Program window. Although the user can specify a name for the program, but since cases may arise that the remembering the instance name to open the file for executing, therefore we recommend to use the default name. The task button of the select condition for run is used do define the condition under which the execution should take place, and Scan program, which executes regardless of the condition, should be selected in this case. It is convenient to give the same name for the program file as the project name, and for existing program, click the Find button and choose the desired file. (Files with different extension are generated during compila-tion and it is difficult to distinguish the files if the project name and the program name differ.)

(36)
(37)

5) Program

[Figure 4-5] shows the window for selecting the language used in the program, where the most convenient one of SFC, LD, and IL should be selected. In this chapter, LD (Ladder Diagram) will be used.

(38)

4-2. User Interface

The GMWIN user interface is composed of Program Window, Toolbar, Project win-dow, as shown in [Figure 4-6]. The Program Window and the Toolbar will be covered later. ---Menu --Toolbar LD Program Window Project Window

(39)

4-3. Project Structure

Project is the most basic element of program of GLOFA PLC, and normally there should be one Project per PLC system.

Project can be divided into configuration part, parameter part, and inserted library files, where the configuration part is used to define software element such as global var-iable, access varvar-iable, resource content, and the parameter part has hardware related defi-nitions such as basic parameters, I/O parameters, and link parameters. In addition, li-braries can be added or removed in the inserted library files. Project structure is shown in [Figure 4-7], and functions are described in [Table 4-8].

(40)

[Table 4-8] Project Hierarchy

Hierarchy item Description

Project defines the overall PLC system.

Configuration configures several definitions for the PLC program.

Configuration Global Variable variable list used over the configuration.

Access Variable variable list that different configurations can access.

Resource corresponds to the CPU module.

Resource Global Variable variable list used over one resource.

Task Definitions defines the running conditions of the program. Define Program describes each program and its running condition. Direct Variables Comments comments list used for the Direct Variables.

Parameter defines the hardware contents of the PLC system.

Basic Parameters defines basic hardware parameters.

I/O Parameters describes the contents of the input/output modules. High Speed Link Parameters describes the contents of the high speed link parameters. Inserted Library Files list of current library files being inserted.

(41)

4-4. LD Edit

LD program displays PLC program with graphic symbols used in relay logic diagrams. As shown in the figure below, 'rung comment' contains the description of the corre-sponding rung. Rung refers to the vertically linked line formed by consecutive rows, as Row 1 to Row 4 in the example figure below, which form a rung, and row 5, is also forms a another rung.

Label Row No.

Function Block

Rung Comment Function

Subroutine Program Horizontal Link Vertical Link Subroutine Call Jump Label Coil Contact Rung Label Row No. Function Block

Rung Comment Function

Subroutine Program Horizontal Link Vertical Link Subroutine Call Jump Label Coil Contact Rung

In the above figure, the {END} in Row 7 serves to mark the end of the main program. The rung named Abnomal process is a form of a subprogram(subroutine pro-gram), and the subroutine is called in Row 5.

Selecting any element form the toolbar will change the mouse cursor to the same shape as the chosen element. Move the mouse pointer to the desired point and click to create a element for LD program.

(42)

4-5. Upload

Upload the program to the GMWIN from the PLC after storing the compressed proj-ect file and source file in the RAM or flash memory of the PLC.

1) Making the upload file

Select in the option to make upload file when making and proceeding with make in the menu will cause to generate the upload file.

Upload file contains the project, the program, and the functions and function blocks used in the program.

◆ Choose Project - Options in the menu to bring up the Option dialog box.

◆ Select Upload Program from the dialog box and click OK. It is not necessary to select the variable table (an option used to monitor variables using a separate device later).

(43)

2) Writing to PLC

Choose the upload program when writing to PLC. ◆ Choose Online - Write from the menu.

◆ In the write dialog, choose the parameter, the program and upload program.

Do the following depending on the program size.

Program size Program storage location

executable program size + upload program

size < program RAM size It is stored in the RAM on the CPU

Program RAM size > executable program size + upload program size

If flash memory is installed, it is stored in the flash memory after asking the user for confirmation.

(44)

3) Reading from PLC (Upload)

◆ Choose Project - 'Load from PLC' in the menu.

Open the project after creating the project, the program file, and the user libraries by loading the upload file from PLC.

If a project with the same name already exists in GMWIN, overwrite it, or save it at another directory or save as another name as specified by the user.

4-6. Menu

1) Project

Command Description

New Project Creates a project.

Open Opens a existing project.

Upload Project From PLC Uploads a project and program in the PLC.

Save Saves the project. (program is not saved)

Save As Saves the project as a different name.

Close Closes the project.

Import Proiect Bundle Opens project bundle file.

Export Proiect Bundle Bundles all files connected to the project as one file.

Add Item Adds new items to the project.

(Define program, Resource Task, Library)

M Area Edit Edits M area or saves it.

Preview Show the contents which will be printed.

Print Project Prints the contents of each corresponding point. Print Program Prints the contents of the activated window.

Printer Setup Sets the print options.

Option Sets the options for the GMWIN.

(45)

2) Program

Command Description

New Program (↑N) Creates a program.

Open (↑O) Opens a existing program.

Save (↑S) Saves the program.

Save As Saves the program as a different name.

Close Closes the program.

Properties Changes the program’s properties.

Local Variables Edits local variables.

In/Out variables For functions and function blocks, edits input/output Variables.

3) Edit

Command Description

Undo (Ctrl+Z) Cancels the last action at the program edit window, and returns back to the previous screen.

Redo (↑Y) Restores the edit-canceled action again.

Cut (↑X) Deletes the selected item, and copies it to the

clipboard.

Copy (↑C) Copies the selected item to the clipboard.

Paste (↑V) Copies the clipboard contents to the edit window.

Delete (Del) Deletes the selected item.

Find (↑F) Finds out the desired string.

Replace (↑H) Finds out the desired string, and replaces it to new one.

Replace Direct Variables Replace the whole desired direct variables. Find Next (↑F3) Repeats the previous Find or Replace operation.

Go To Moves the cursor to the desired location.

Screen Size Controls the view size.

Delete Line Deletes a line.

Insert Line Inserts a line.

Insert Cell Inserts a cell.

(46)

4)View

Command Description

Tool Bar The user defines the toolbox.

Status Bar Shows or hides the status line.

Full Screen Enlarges the scope to indicate the program windows to the overall screen.

Project Shows or hides the project window.

Result Shows or hides the result window.

Variable Monitor Shows or hides the variable monitor window.

I/O Monitor Shows or hides I/O monitor window.

Link Parameter Shows or hides link parameter window.

Zoom Enlarges or reduces the screen.

Show Memory/ Comments Shows or hides the variable comments.

Properties Shows the registration information of the currently

selected items.

Monitor Array Selects array no. Of the variable declared as array.

5) Compile

Command Description

Compile Compiles the program.

Compile All Compiles all the programs in the project, and create a PLC execution file.

Memory Reference Allows users to see the used global and direct variables.

Show Used I/O Shows I/O use global variable or direct variable. Check Double Coils Shows the used doubles coil.

Previous Message Moves to the previous message position.

(47)

6) Online

Command Description

Connect + Write + Run + Monitor On [Ctrl+R]

Connects to the PLC specified through the GMWIN and options, writes the program a user creates to the PLC and changes to the monitoring mode.

Connect Connects to the PLC specified through the GMWIN

and options.

Read Reads the PLC’s data.

Write Writes the GMWIN’s program to the PLC.

monitor On/Off Start/finishes program monitoring.

PLC Monitor

Run Converts PLC mode.

Converts CPU to communicate in GM1. Stop Sleep Debug Master Convert Reset

Data Clear Clears PLC data as "0".

Reset Resets PLC.

Overall

Reset Resets all data of CPU.

Flash memory

Read Type

Reads flash memory type information installed in CPU or writes data to flash memory.

Set Mode is only available in GM4-cpu. If the mode is set executing code is written in flash memory.

Write Program

Set Mode

PLC Info

System Shows PLC information.

Error/ Warning History I/O Module Fault Base Units

(48)

Command Description

I/O Modules

I/O Info Shows/Writes PlC I/O Configuration Status.

Matches PlC I/O Configuration With Project & PLC I/O

Synchronization

I/O Forcing

Input Sets Forced I/O Value/Execution Allowance. Output

Network

Enable

Link Shows Link Module Type, Installed Slot, Station No. Link

Status Shows Network Information.

Mnet

Parameter Inputs Mnet Parameter.

Comm unication Info Shows Sending/Receiving Information Online

Edit

Start

Starts To Edit Function.

Writes The Edit Contents while running. Cancels The Edit Function.

Write Cancel

FSM Sets The Emergency Data Of F-Net Slave Module.

I/O Skip Sets I/O To Skip.

Fault Mask Sets Failure Mask.

Initialize Speacial

(49)

7) Debug

Command Description

Begin/End Debug Changes to the debug mode, (Begin debugging the program / Stops debugging the program.)

Go(Ctrl+F9) Run to the break point.

Step Over(Ctrl+F8) Run step by step.

Step In Debugs functions and function blocks.

Step Out While debugging functions and function blocks, escape the present block.

Pause Pauses the Run.

Run to Cursor(Ctrl+F2) Runs to the cursor location. Insert / Remove Breakpoint

(Ctrl+F5) Inserts or removes the breakpoint.

Breakpoint List/Condition Shows the list of the breakpoints you have set, and enables you to set the break condition.

Task Enable Enables you to change the task while debugging.

8) Tools

Command Description

Library Manager Edits library. Start Simulation Starts simulator.

(50)

9) Windows

Command Description

New Window Opens New Window Against Current Window.

Cascade Cascades The Several Windows Of The GMWIN.

Tile Horizontally Tiles The Several Windows Of The GMWIN Horizontally. Tile Vertically Tiles The Several Windows Of The GMWIN Vertically. Arrange Icons Arranges Icons In The GMWIN.

Close All Closes All The Windows In The GMWIN.

10) Help

Command Description

GMWIN Help Opens GMWIN helpdesk.

LGIS Homepage Connects to LG industrial systems homepage by

internet.

(51)

Icon Command Description

New Project - create a new project.

- select Menu - Project - New Project Open Project - opens a existing project.

- select Menu - Project - Open Save Project - saves the created project file.

- select Menu - Project - Save New Program

- is used to open one or more programs included in a project.

- select Menu - Program – New Program

Open Program

- opens a program selected from the menu. - select Menu - Program - Open

[Note]

- At the editing/debugging mode, two or more instances for one program are not available.

For the monitor mode, you can open two or more instances for each program to monitor different positions of a long program.

Save Program

- saves the created program file. - select Menu - Program - Save

Local Variables

- It allows you to edit local variables corresponding to the enabled program window.

- select Program – Local Variables

- Add/delete/edit each variable, and click the Close button.

Undo(Ctrl+Z)

- cancels the last editing action during writing the program.

- select Menu –Edit - Undo

Cut(Ctrl+X) - specifies the item to be cut as a block. - select Menu – Edit-Cut

Copy(Ctrl+C) - specifies the item to be copied as a block. - select Menu – Edit- Copy

4-7. Toolbar

The following is the GMWIN toolbar.

GMWIN provides frequently used features as toolbar. Choosing the desired tool with the mouse will execute the feature, as described in the chart below.

(52)

Icon Command Description

Paste (Ctrl+V)

- position the cursor to a location to be pasted, after performing the Cut or Copy.

- select Menu – Edit - paste

Delete - specifies a item to be deleted with the block-specifying icon, and deletes the item using the Delete icon.

Search

- searches an instruction or operand in the enabled program. - select Menu – Edit - Find

- enter a desired string to the string input column in the Find dialog box.

- select one of the following options, and press the OK button.

1) Both Text and contact/coil : selects the type of the desired string.

2) Range : selects the range of the search.

- From Cursor : searches it from the present location of the cursor.

- Entire Scope : searches it over the program. 3) Direction : selects the direction of the search. - Forward : searches it downward.

- Backward : searches it upward.

4) Word : selects the match percent of the desired word. - Match whole word : searches 100% percent matching word.

- Match partial word : searches any percent matching word.

Replace

- Invoke the Replace dialog box, by selecting Menu – Edit - Replace

- Enter text to be replaced to the New text textbox.

- Select a LD program component to replace at the Contact/Coil to find box.

- Enter the desired text to the new name textbox.

- Select a LD program component to replaced at the New Contact/Coil box.

- For other options, select those equal to the options for Find, and press the OK button.

Find Next (Ctrl+F3)

- When you have already done with the Find/Replace operation before, it repeats the Find/Replace operation with the conditions equal to Find/Replace.

- select Menu - Edit- Find Next

Compile

- only complies the program in the enabled program window, and produces an object file.

- select Menu – Compile

[Note] If you only compile a program, its execution file is not created.

(53)

Icon Command Description Make

Create execution file

- compiles only the programs needed to be compiled in the project programs, and creates an execution file.

- select Menu – Compile - Make Connect +

Write+ Run + Monitor On

- This is a macro command to execute the written program with one menu operation.

- With this command, you can connect, write a program,

change the mode change(Run), and start monitoring with one operation.

Connect - establishes the connection between GMWIN and PLC. - select Menu - Online - Connect

Run - RUN mode : Mode to execute a program properly. - select Menu - Online – Change Mode - Run

Stop

- STOP mode : Mode to stop the program, without operating it.

- select Menu - Online – Change Mode - Stop

Pause - PAUSE mode : Mode to pause to operate the program. - select Menu - Online – Change Mode - Pause

Begin Debug

- DEBUG mode : Mode to find out errors on the program or to trace the operating process.

- select Menu - Online – Change Mode -Begin Debug

Go runs to the break point.

Over Step runs the program step by step. Step In debugs functions and function blocks.

StepOut While debugging functions and function blocks, escape the present block.

Pause pauses the Run.

Run to

Cursor runs to the cursor location. Insert/

Remove Breakpoint

(54)

Icon Command Description

Disconnect - releases the connection between GMWIN and PLC. - select Menu - Online - Disconnect

Write

- writes parameters and programs of the GMWIN to the PLC.

- invoke the Write dialog box, by selecting Menu – Online – Write. (after establishing the connection)

- If the PLC state is on Run mode, the following screen appears.

- Basic Parameters : reads only basic parameters from the PLC.

- I/O Parameter : reads only I/O parameters from the PLC. - High speed Link Parameters : reads only high speed link parameters from the PLC.

- Duplication Parameters : reads only duplication parameters from the PLC. (enabled only when selecting the Duplication)

- Program : reads only programs from the PLC.

- Parameters and Programs : reads both parameters and programs from the PLC.

- Upload : reads upload programs from the PLC.

Monitor On/Off

- GMWIN allows users to monitor the status of the PLC on operation.

- Online - Monitor – Monitor On ▪ Program Monitoring

▪ I/O Monitoring ▪ Variable Monitoring ▪ Time Chart Monitoring ▪ Link Parameter Monitoring

(55)

4-8. Files created by GMWIN

The following types of files are created when the user generates PLC executable file by creating a project and editing a program.

① * . PRJ : The project file created by the user ② * . BN0 : PLC executable file

③ * . MON: File containing the information for monitoring ④ * . CR0 : Generated when PLC executable file is created. ⑤ * . SRC : Program file created by the user

⑥ * . ASV : Periodical auto-save file of the program

⑦ * . OP? : Generated on program compilation (Program block) ⑧ * . OB? : Generated on program compilation (Function block) ⑨ * . OF? : Generated on program compilation (Function)

(56)

4-9. Opening Files

The user must open an existing project in order to create a program.

1) Opening a project

◈ Select Project - Open from menu.

2) Opening a program

① Select Program - Open from menu.

② Choose the drive and directory in order to find the location of the file in the list box.

③ Enter the file name directly or choose from the list box. Choose the types of files to show from the File Type. ◈ Project File : *.PRJ Program File: *.SRC ④ Click the Open button.

(57)
(58)

4-10. Saving Files

1) Saving a new file

◈ Saving a file that has never been saved.

2) Saving a project

◈ Select Project - Save from menu.

3) Saving a program.

(1) Select Program - Save from the menu.

(2) Choose from the list box the drive and directory location to save the file. (3) Enter the desired file name in the file name field.

Enter PRJ for proiect files and SRC for program files as the extension. (4) Click the Save button.

4) Saving while working

(1) Saving project

◈ Choose Project - Save from menu. (2) Saving program

◈ Choose Program - Save from menu.

5) Saving by different name

Changing the project name or the program name. (1) Saving Project

◈ Choose Project - Save As from menu. (2) Saving Program

① Choose Program - Save As from menu.

② Choose from the list box the drive and directory location at which to save the program.

③ Enter the file name in the file name field.

Enter PRJ for project files and SRC for program files as the extension. ④ Click the Save button.

(59)

6) Closing File

(1) Method 1: Double-click the adjustment menu at the top-left corner of the win dow to close.

(2) Method 2 ① Closing Project

◈ Choose Project - Close from menu. ② Closing Program

(60)

Chapter 5. Data Format

5-1. Variable Representation

Data used in a program has values, which can be divided into ones that change dur-ing the course of the execution and ones that stay constant. In order to use variables in program block, function, function block, etc, the representation method of the variable must first be determined. Variables are categorized into direct variables and named variables.

① Direct variables: Do not need to be declared(conventional Method) ② Named variables: Declaration necessary

In the first method of direct variables, the user does not need to name the variable, but a memory location identifier predefined by the maker is used, where as in the sec-ond method of named variables, the user assigns the name to be used as the identifier

1) Direct Variables

There are %I, %Q input and output variables and %M internal memory variables for direct variables.

Direct variables always starts with the percent character(%), followed by location pre-fix and size prepre-fix and one or more unsigned integer, delimited by periods.

(1) Examples of direct variable

Input variable assignment: %I0.0.0, %I0.0.1, %I0.0.2 etc. Output variable assignment: %Q0.2.0, %Q0.2.1, %Q0.2.2 etc. Internal memory variable assignment: %M0, %M1, %M2 etc.

(61)

(2) Location prefix

No. Prefix Meaning

1 I Input Location

2 Q Output Location

3 M Internal Memory Location

(3) Size Prefix

No. Prefix Meaning

1 X 1 bit (the X is omittable)

2 B 1 byte (8 bits)

3 W 1 word (16 bits)

4 D 1 double word (32 bits)

5 L 1 long word (64 bits)

※ Input and output representation of direct variables

% [Location Prefix] [Size Prefix] [Base Number]. [Slot Number]. [Contact Point Number]

(62)

Input % I X 0. 0. 0

Output % Q X 0. 3. 0

Represents the contact point number of the I/O module Takes value between 0 and 63.

Represents the slot number of the slot on which the I/O module is installed. Takes value between 0 and 7.

Base number : Takes value between 0 and 3. Size prefix: X represents 1 bit.

Location prefix: I(input), Q(output), M(internal memory) Reserved word for direct variable

EX) %IX0.0.3 : Direct variable, input, 1 bit, base 0, slot 0, contact point 3 %QX0.2.7 : Direct variable, output, 1 bit, base 0, slot 2, contact point 7

(4) Internal memory

NO. Internal Memory Meaning

1 %MX0 Represents the contact point at location 0 in bit.

2 %MB1 Represents memory location 1 in byte.

3 %MD48 Represents the memory location 48 in double words.

4 %MW20.3 Represents the third bit at the memory location 20 in words.

(63)

%MB201 %MB200 %MB200 7 6 5 4 3 2 1 0 b b b b b b b b b b b b b b b b 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 (5) Internal Memory M 2) Named Variable

The user needs to declares the name and the type of the named variable when using. ① The name of the variable can be up to 16 characters in length(English), in case of KOREAN & characters are available.

② KOREAN Alphanumeric characters and underscore(_) can be used together. ③ There is no distinction between capital and lower case letters and all characters are considered to be capital letters. The name may not contain spaces.

(1) Examples of named variables

Type Usage Example

Alphanumeric Characters and Underscore

AGV_DRIVE_COMP, MOTOR2_ON, BCD_VALUE, VAL2, AUTO_EJECT_SOL WORD (16Bit) Address %MW0 %MW99 %MW100 %MW101 Byte(8bit) Address Bit Address %MX1603 %MB200.3 %MW100.3

(64)

(2) Types of Named Variable

No. Variable Type Meaning

1 VAR General type for reading and writing

2 VAR_RETAIN Variable which retains its value even in the case of power failure

3 VAR_CONSTANT Variable for reading only

4 VAR_EXTERNAL Variable to assign external variable (VAR_GLOBAL)

(3) Data Type of Named Variables (Represents the property of the data)

① Data types are categorized into numerical type (ANY_NUM) and bit state (ANY_BIT).

② The most common numerical type is the integer (INT) which can be used for counting and arithmetic operations.

③ Examples of integer includes the current value of a counter and A/D (analog input) conversion value.

④ Bit state includes BOOL(Boolean: 1 bit), BYTE(8 bits), WORD(16 bits), which represents ON/OFF state and is used for logical operations.

⑤ Examples of bit state includes the ON/OFF state of input switch, the illumination state of output lamp.

⑥ Since BCD is 4-bit binary code representation of decimal number, it is essentially bit state (ANY_BIT).

⑦ Arithmetic operations cannot be done on bit state type as it is, but it is possible, using type conversion function.

(65)

(4) Basic Data Types

Category TypeData Meaning (bits)Size Range

Numerical (ANY_ NUM)

SINT Short Integer 8 -128 ~ 127

INT Integer 16 -32768 ~ 32767

DINT Double Integer 32 -2147483648 ~ 2147483647

LINT Long Integer 64 -9.2237×1018 ~ 9.2237×1018 USINT Unsigned Short Integer 8 0 ~ 255

UINT Unsigned Integer 16 0 ~ 65535

UDINT Unsigned Double Integer 32 0 ~ 4294967295

ULINT Unsigned Long Integer 64 0 ~ 1.844×1019

REAL Real Numbers 32 -3.402823×10

38

~ -1.401298×10-45 401298×10-45 ~ 3.402823×1038

LREAL Long Real Numbers 64 -1.7976931×10

308

~ -4.9406564×10-324 4.9406564×10-324~1.7976931×10308

Time TIME Duration 32 T#0S ~ T#49D17H2M47S295MS

Date

DATE Date 16 D#1984-01-01 ~ D#2163-6-6

TIME_O

F_DAY Time Of Day 32

TOD#00:00:00 ~ TOD#23:59:59.999 DATE_A

ND _TIME

Date And Time Of

Day 64

DT#1984-01-01-00:00:00 ~ DT#2163-12-31-23:59:59.999 Character

String STRING Character String 30*8

-Bit State (ANY_ BIT)

BOOL Boolean 1 0,1

BYTE Bit String Of Length 8 8 16#0 ~ 16#FF

WORD Bit String Of Length 16 16 16#0 ~ 16FFFF

DWORD Bit String Of Length 32 32 16#0 ~ 16FFFFFFFF

(66)

(5) Data Type Hierarchy

Data types used in GLOFA PLC can be graphically represented as the tree below.

ANY

ANY_NUM ANY_BIT ANY STRING ANY_DATE TIME

LWORD(GM 1,2) DATE_AND_TIME

DWORD DATE

ANY_REAL ANY_INT WORD TIME_OF_DAY

(GM 1,2) LINT(GM1,2) BYTE

LREAL DINT BOOL

REAL INT SINT ULINT(GM1,2) UDINT UINT USINT

① ANY_REAL(LREAL, REAL) and LINT, ULINT, LWORD are applicable only to GM1 and GM2.

② From now on, it is implied that data type of ANY_NUM includes LREAL, REAL, LINT, DINT, INT, SINT, ULINT, UDINT, UINT, USINT, as shown in the hierarchy.

③ For example, if a type is said to be ANY_BIT in GM3, any of DWORD, WORD, BYTE, BOOL can be used.

(67)

(6) Initial Value

(If no value is specified, the variable is initialized to a value according to the follow-ing table.)

Data Type Initial Value

SINT, INT, DINT, LINT, USINT, UINT, UDINT,

ULINT 0

BOOL, BYTE, WORD, DWORD, LWORD 0

REAL, LREAL 0.0

TIME T#0s

DATE D#1984-01-01

TIME_OF_DAY TOD#00:00:00

DATE_AND_TIME DT#1984-01-01-00:00:00

STRING "(empty string)"

① Since the declaration of VAR_EXTERNAL only indirectly designates an externally declared variable, it cannot be given an initial value.

② Variables allocated using %I or %Q in declaration cannot be given initial values. Because those are Input and Output variables.

(7) Memory Allocation of Named Variables

Named variables can be allocated either automatically or manually.

(8) Automatic Allocation

Compiler automatically allocates the address for the variable in the memory.

For example, if a variable called “VALVE_1” is declared to be automatically allo-cated, the memory location of this variable is determined only after the compilation of the program is done, so there is no need to worry about the location of the variable. Once declared, a variable serves, regardless of input or output, to relay signals during the computation process, temporarily save signal state(internal data), assignment of the name (the instance of the function block) of contact for timer or counter, etc.

(68)

(9) User Definition

The user manually defines the location, using direct variables (%I, %Q, %M). The de-clared variable is used as input and output (%I, %Q) variables and communication varia-bles, which will be used as communication parameters.

※ As Data type is a very important issue, it will be covered in more detail with some examples. Much caution should be taken in using these data types for sequence control, arithmetic operation and logical comparison and conversion, etc.

(69)

Chapter 6. Process of operation

6-1. Scan time

PLC is first executed from the beginning of the program to the end in a sequential manner, starting at a state where the input has been refreshed, and then the output is refreshed. This process is repeated very rapidly, which is why it is called ‘repeated ex-ecution method’, and the time it takes for one exex-ecution is called ‘1 scan time.’

Operation Start

Input image area refresh

Contact status of input module

Scan program start ․

․ ․

Scan program end

Execute task program

Output image area refresh

Contact status of output module

END 1 Scan

(70)

6-2. I/O Refresh

I/O refresh is the process consists of acquiring the status of the contacts from the in-put module and saving it in the inin-put image area, and writing the outin-put image altered by the program execution to the output module after the program execution is completed.

6-3. I/O Image Area

GLOFA PLC executes program in a repeated fashion, so it does not change the I/O state in the course of the program execution, but performs I/O refresh on every scan. The state of each contact which change during the execution is stored in memory of the PLC, and this is called the I/O image area.

6-4. Operation Mode

1) RUN Mode

Runs the program in a normal manner.

(1) Mode Change Procedure

Data is initialized on the first scan.

(2) Execution Procedure

Performs input/output refresh and program execution.

2) PAUSE Mode

The execution of the program is paused. If the mode is changed back to RUN mode, the operation continues after the state is restored to the state immediately before stopping.

(71)

(1) Mode Change Procedure

The initialization of the data area and clearing of the I/O image area are skipped, and operation state is preserved as it was before the operation..

(2) Execution Procedure

I/O refresh is performed.

3) STOP Mode

The program execution is stopped. Only in remote STOP mode is program transfer by GMWIN possible.

(1) Mode Change Procedure

Clears the output image area and performs an output refresh.

(2) Execution Procedure

Performs I/O refresh to check for any problems in operation, installation, and commu-nication service, and operation status, and other internal procedures are carried out.

4) DEBUG Mode

Used to find bugs in the program or follow the line of execution. Switching to this mode is only possible at the STOP state. The execution status and data content can be verified in this mode.

(1) Mode Change Procedure

Data area is initialized as specified in the restart mode, which is set in as parameters at the beginning of the mode switch, output image area is cleared, and input refresh is performed.

(72)

(2) Execution Procedure

① Input refresh is performed.

② Debug operation is performed according to the setting.

③ When the debug has reached the end the program, output refresh is performed.

④ The installed module is checked for correct operation and whether it is installed correctly.

⑤ Communication and other services are performed.

6-5. Changing the Operation Mode

1) Different ways to change the mode

(1) Use mode key in the CPU module

(2) By connecting GMWIN to the communication port of the CPU module (3) By connecting GMWIN to other CPU module on the F-net

(4) Issue user command through FAM, computer link, etc. (5) Use ‘STOP Function’ during program execution

2) Changing the mode using the mode key

Mode key position Mode

RUN Local RUN

STOP Local STOP

STOP → PAU/REM Remote STOP

PAU/REM → RUN * Local RUN

RUN → PAU/REM Local PAUSE

PAU/REM → STOP Local STOP

PLC continues to operate without any delay, when switching from remote RUN mode to local run mode by the mode key.

References

Related documents