0% found this document useful (0 votes)
225 views21 pages

Chapter 3. Program Example: 3.1 How To Make Project and Open Program

This document provides instructions for creating and running a program example in GMWIN software. It includes steps for: 1. Creating a new project and program instance in GMWIN. 2. Programming ladder logic contacts, coils, functions, and variables. 3. Compiling and writing the program to the PLC. 4. Running and monitoring the program by changing the PLC mode and forcing variable values. 5. Creating a user-defined function block for a spinning machine control program.

Uploaded by

jhon hernan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views21 pages

Chapter 3. Program Example: 3.1 How To Make Project and Open Program

This document provides instructions for creating and running a program example in GMWIN software. It includes steps for: 1. Creating a new project and program instance in GMWIN. 2. Programming ladder logic contacts, coils, functions, and variables. 3. Compiling and writing the program to the PLC. 4. Running and monitoring the program by changing the PLC mode and forcing variable values. 5. Creating a user-defined function block for a spinning machine control program.

Uploaded by

jhon hernan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 3.

Program example

Chapter 3. Program example


3.1 How to make Project and open Program
It is available to learn how to use GMWIN generally through program example. The overall flow chart is as follows:

How to make Project Project file name Car engine line


PLC type GM3
Writer Hong Gil-dong
Project comments Welding processing of car engine line

Instance name Welding


How to make Program Program file name Robot
Program type Ladder Diagram
Conducting condition Scan program
Program comments Welding robot & line control

How to do Programming

How to Compile/Make Makes execution file through compile/make

How to write Program Writes the program to PLC.

How to operate Program Changes the PLC mode with “run”.

How to monitor Program Checks the action status by program monitoring.

<Working flow chart of program>

3-1
Chapter 3. Program example

3.1.1 How to execute GMWIN

‹ Press the start menu of windows.


‹ Select program-GMWIN and press the mouse.

‹ The initial screen of GMWIN appears as below :

Point

If used GMWIN previously, the final working project and program will be open.

3-2
Chapter 3. Program example

3.1.2 How to make Project

‹ Select [Project]-[new project, ] to start the wizard.

‹ Input as the followings in the input column of the generated new project.

3-3
Chapter 3. Program example

3.1.3 How to make Program


‹ Click [Next] to move to the program definition page.

‹ Input instance name


‹ Input program name robot.src and then click [Next]to move to new program page.

‹ Select the type of language for program(LD) from new program dialogue box.
‹ After input the comments for program to the comments column, press [Enter] key or click [Finish] and the screen
below appears.

3-4
Chapter 3. Program example

3.2 How to do Programming


3.2.1 How to insert contact / output coil
‹ Select from tool box and click the mouse on the ‘0’ row position of LD window.

‹ If variable window appears, input the variable name and click [OK].

‹ Select the type of variable from variable add/modify window and click [OK].

3-5
Chapter 3. Program example

‹ Select from toolbox and click the mouse on the side position of contact.

‹ Input the name of variable (motor1) and then click [OK].

‹ After selecting the variable type of, click [OK] and the coil will be inputted.

‹ Select from toolbox and click the mouse on the row 1 position of LD window.

3-6
Chapter 3. Program example

‹ After input the variable name (limit switch 1), click [OK].

‹ After selecting the variable type of, click [OK].

3-7
Chapter 3. Program example

3.2.2 How to make Function


‹ Select from tool window by using a mouse.
‹ Click the mouse on the row 1, column 2 position of LD window.

‹ Select the numeric operation function ADD from function list dialogue box and input the number of input ‘2’ and
then click [OK] to generate the function.

3-8
Chapter 3. Program example

3.2.3 How to input Variable


‹ Select from toolbox.
‹ Double click the mouse on the IN1 position (row 2, column 1) of function ADD.
‹ Input the variable name(ABC) to the variable input column of variable dialogue box.

‹ Click [OK] and the variable add/edit dialogue box appears.

‹ Click [OK]. It shows that variable “ABC” is inputted in the IN1 of function ADD.

3-9
Chapter 3. Program example

‹ Double click the mouse on the IN2 position (row 3, column 1) of function ADD.

‹ If input the constant “1” to the variable input column of variable dialogue box and click [OK], the constant 1 is
inputted in IN2 of function ADD.

3-10
Chapter 3. Program example

‹ Double click the mouse on the OUT position (row 3, column 3) of function ADD.

‹ Input the variable name(ABC_ADD) to the variable input column of variable dialogue box and click [OK].

‹ If select the variable type from variable add/edit window and click [OK], the variable ABC_ADD is inputted in OUT
of function ADD.

3-11
Chapter 3. Program example

3.3 How to compile/write Program


3.3.1 How to Compile/Make

‹ Select menu [Compile]-[Compile, ].

‹ Execute menu [Compile]-[Make, ] to make Execution file.

‹ If you fail to make execution file due to the occurrence of error, modify the program according to the error message
and then run MAKE again.

3-12
Chapter 3. Program example

3.3.2 How to write Program


‹ Check the connection status of GMWIN and PLC before program transfer.
‹ Check whether or not the key mode of PLC is Remote Stop. Not available to write Program on the other key
position
‹ Select menu [Online]-[Connect].
‹ If there is something wrong on PLC, the error/warning information window appears. In this case, delete the cause
of error occurrence first. (refer to CPU manual.)
‹ If connected without error, select [Online]-[Write] to designate the item to write and then click [OK].

‹ At this time, execution file and upload program is transferred to PLC.

3-13
Chapter 3. Program example

3.4 How to run and monitor Program


3.4.1 How to operate Program
‹ After completing the transfer, select menu [Online]-[PLC Mode]-[Run]. At this time, PLC becomes Remote run
mode and starts to operate Program.(if selecting the PLC mode key as “run”, it becomes Local run and also starts
to operate Program.)

3.4.2 How to monitor Program

‹ If selecting menu [Online]-[Monitor On, ], the user can monitor the action status of program through GMWIN.

3.4.3 How to do force variable data


‹ Double click the mouse on the position of switch1 contact and the force variable data dialogue box appears.

3-14
Chapter 3. Program example

‹ Input ‘1’ in the value and click [OK].

‹ If switch 1 is “ON”, it is available to monitor that motor 1 becomes “ON”.


‹ Execute the force input variable for limit switch 1 as the same method to the above.
‹ It is available to monitor that the value of variable ABC_ADD increases 1 by 1 according to the input of variable
ABC from LD program window.

3-15
Chapter 3. Program example

3.5 How to make the User Defined Function/Function Block


It is available to make the user defined function/function block through “how to follow”. The overall flowchart is
as follows :

How to make Program Program file name Spinning machine control


Language LD
Program type Function block
Function block name Spinning machine
Function block for spinning
Program comments
machine control.

How to make I/O Variable Input variable Start to work (BOOL)


Input variable Emergency stop (BOOL)
Input variable Goal value (INT)
Output variable Motor run (BOOL)
Output variable Current value (INT)

How to do Programming

How to register F/B Registers the user F/B to the Project through compile.

How to call F/B Calls the user F/B from the Program.

[Working flowchart of “how to follow]

3-16
Chapter 3. Program example

3.5.1 How to make the User defined function/function block

‹ Select menu [Program]-[new Program, ] in the status of open program.

‹ Input the program file name as above and select the language and program type.
- To make the user defined function, it is required to select the program type Fun and input the language and
function block name.
As the output variable is fixed as ‘OUT’ in the function, it is required to select output data type.
- To make the user defined function block, it is required to select the program type FB and input the language and
function name.

Point
In the user defined function, it is NOT available to select the language SFC.

‹ Click [OK] to declare the In/Out variable.

3-17
Chapter 3. Program example

‹ Add input variable, In/Out variable, output variable. At this time, it is not available to add output variable in the
function.

‹ After completing to add In/Out variable, click [Close] and start to write Program.
‹ Write a program of the user defined function/function block as below.
(Refer to 3.2 how to do Programming)

3-18
Chapter 3. Program example

3.5.2 How to register the user defined function/function block

‹ If the program preparation of the user defined function/function block is completed, select [Compile]-[Compile,
] and start the wizard of the user defined function/function block.

‹ Click [OK] and start F/FB Wizard.

3-19
Chapter 3. Program example

‹ In case of generating new library file, input the library name and click [Next] and start F/FB Wazard.

‹ After selecting ‘whether or not to register’, click [Next].

‹ Click [Finish] and the function block ‘USER1’ is added to the library of project window.
If you want to add the previously prepared library, refer to 4.5.3 Library road.

Point

How to call the source file of the user defined function/function block
◆ To call the source file of the user defined function/function block, double click the
relevant name ( “SPINNING” from the above project window).

3-20
Chapter 3. Program example

3.5.3 How to call the user defined function / function block from the Program

‹ Select the function block( ) from tool window by using a mouse.


‹ Click the left button of mouse on the position to insert.
(For further information, refer to 3.2.2 how to make Function.)

‹ After selecting SPINNING from function block, click [OK].

‹ Input the variable and complete the program.

‹ If program is completed, start to compile and write.


(For the subsequent processing, refer to 3.3 how to compile/write Program, 3.4 how to run and monitor Program.)

3-21

You might also like