GE GFK-0804B User Manual

GE Fanuc Automation
Programmable Control Products
GE Fanuc Micro PLC Programmer’s Guide
GFK-0804B April 1994
Warnings, Cautions, and Notes as Used in this Publication
Warning notices are used in this publication to emphasize that hazardous voltages, currents, temperatures, or other conditions that could cause personal injury exist in this equipment or may be associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a Warning notice is used.
Caution notices are used where equipment might be damaged if care is not taken.
Warning
Caution
Note
Notes merely call attention to information that is especially significant to understanding and operating the equipment.
This document is based on information available at the time of its publication. While efforts have been made to be accurate, the information contained herein does not purport to cover all details or variations in hardware or software, nor to provide for every possible contingency in connection with installation, operation, or maintenance. Features may be described herein which are not present in all hardware and software systems. GE Fanuc Automation assumes no obligation of notice to holders of this document with respect to changes subsequently made.
GE Fanuc Automation makes no representation or warranty, expressed, implied, or statutory with respect to, and assumes no responsibility for the accuracy, completeness, sufficiency, or usefulness of the information contained herein. No warranties of merchantability or fitness for purpose shall apply.
The following are trademarks of GE Fanuc Automation North America, Inc.
Alar m Master CIMST AR Helpmate PROMA CRO Series Six CIMPLICITY Field Control GEnet Logicmaster Series One Series 90 CIMPLICITY 90–ADS Genius Modelmaster Series Three VuMaster CIMPLICITY PowerTRA C Genius PowerTRA C ProLoop Series Five Workmaster
Copyright 1994 GE F anuc A utomation North America, Inc.
All Rights Reserved
This book is the reference guide to programming the GE Fanuc Micro PLC.
Content of this Manual
Chapter 1. Programming for the Micro PLC: describes programming basics, the Micro PLC instruction set, programming devices and formats, memory types and addresses, constants and register values in a program, and special coils.
Chapter 2. Programming with the Programming Software: explains how to create and edit programs using the programming software.
Chapter 3. Programming with a Hand-held Programmer: explains how to create and edit programs using a Hand-held Programmer.
Chapter 4. The Micro PLC Instruction Set: explains in detail the instructions that can be incorporated into an application program for the Micro PLC.
Appendix A. Using Directories: gives advice on organizing the Micro PLC directory structure on your hard disk.
Pr eface
Appendix B. Micro PLC Protocol: the information in this appendix is for advanced users only. It explains programming to set up communications between the Micro PLC and a host system.
Appendix C. RTU Protocol: describes the Remote Terminal Unit (RTU) serial communications protocol, which can be used to provide communications between the Micro PLC or other remote device and a host computer.
Appendix D. Communications Using Windows DDE: describes an available software product that can be used to connect DDE-compliant Microsoftt Windows programs with data in a Micro PLC.
Appendix E. Data Acquisition, Logging, and Display Program: describes the Data Acquisition, Logging, and Display Program software, which is provided on the Micro PLC software diskettes.
Appendix F . Programming Applications: describes simple programming for: a flip-flop, a powerup one-shot, cascading counters, and an industrial “starting circuit”.
Related Publications
GE Fanuc Micro PLC User’s Guide (GFK-0803): contains product specifications,
installation instructions, and general information needed to set up and use a Micro PLC.
GE Fanuc Micro PLC Self- T each Manual (GFK–0811): a quick-start guide to
understanding and using the Micro PLC.
GFK-0804
iii
Preface
Technical Assistance
If you should have a problem installing or programming your GE Fanuc Micro PLC, and the information you need is not in this book or the Micro PLC User’s Guide, you can call GE Fanuc Field Service at 1-800-828-5747.
We Welcome Your Comments and Suggestions
At GE F anuc automation, we strive to produce quality technical documentation. A fter you have used this manual, please take a few moments to complete and return the Reader’s Comment Card located on the next page.
Jeanne L. Grimsby
Senior Technical Writer
iv
Micro PLC Programmer ’s Guide – April 1994
GFK–0804B
Chapter 1 Programming for the Micro PLC 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Basics 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC Programs 1-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Micro PLC Instruction Set 1-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Devices and Formats 1-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Memory Types and A ddresses 1-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Constants and Register Values in a Program 1-6 . . . . . . . . . . . . . . . . . . . . . . . .
Special Coils 1-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming for an Analog Expander Unit 1-8 . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 2 Programming with the Programming Software 2-1 . . . . . . . . . . . . . . . .
Using the Programming Functions 2-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Program Rung 2-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running the Programming Software 2-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Basics 2-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Horizontal and Vertical Lines in a Rung 2-7 . . . . . . . . . . . . . . . . . . . . . . . . . . .
Element Labels and Rung Labels 2-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing a Completed Rung 2-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting Rungs 2-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving Rungs 2-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Copying Rungs 2-14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Searching for a Rung or Program Element 2-15 . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
Chapter 3 Programming with a Hand-held Programmer 3-1 . . . . . . . . . . . . . . . . . .
Program Listing 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Program Transfer 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Entering Program Logic 3-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inserting a Rung Element 3-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting a Rung Element, Rung or Program In Memory 3-5 . . . . . . . . . . . . .
Searching 3-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Examples Using the HHP 3-8 . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 4 The Micro PLC Instruction Set 4-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Instruction Set Summary 4-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contacts 4-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Normally-Open Contact 4-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Normally-Closed Contact 4-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
P ositive T ransition Contact 4-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Negative Transition Contact 4-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GFK-0804B Micro PLC Programmer’s Guide - April 1994
v
Coils 4-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Output Coil 4-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set/Reset Coil Pair 4-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Master Control Relay/End Coil Pair 4-14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Skip/End Coil Pair 4-15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Timers 4-16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
On Timer 4-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Off Timer 4-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counters 4-20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Up Counter 4-22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Down Counter 4-23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Math Functions 4-24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A ddition (ADD) 4-24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Subtraction (SUB) 4-26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiplication (MUL) 4-28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Division (DIV) 4-30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
Move Functions 4-32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Move 4-32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Block Move 4-34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Indirect Move 4-36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compare Functions 4-38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logic Operations 4-40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
W ord AND 4-41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inclusive OR (IOR) 4-42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exclusive OR (XOR) 4-43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shift Register Right 4-44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shift Register Left 4-45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NOT 4-46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GFK-0804B Micro PLC Programmer’s Guide - April 1994
vi
Appendix A Using Directories A-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix B Micro PLC Protocol B-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communications Files B-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communications Memory Types and Addresses B-3 . . . . . . . . . . . . . . . . . . . .
Communications Parameters B-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communications Protocol B-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Format B-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communications Functions B-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix C R TU Protocol C-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction C-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Types C-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transmission Sequence C-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Fields C-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Format C-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Termination C-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Timeout Usage C-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cyclic Redundancy Check (CRC) C-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTU Message Length C-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Descriptions C-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (01): Read Output Table C-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (02): Read Input Table C-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (03): Read Registers C-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (04): Read Analog Inputs C-12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (05): Force Single Output C-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (06): Preset Single Register C-14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (07): Read Exception Status C-15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (16): Preset Multiple Registers C-16 . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message (17): Report Device Type C-17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communication Errors C-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Invalid Query Message C-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Serial Link Timeout C-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Invalid T ransactions C-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
Appendix D Communications Using Windows DDE D-1 . . . . . . . . . . . . . . . . . . . . . . .
Features of the Micro PLC DDE Driver Software D-2 . . . . . . . . . . . . . . . . . . . . . .
Simple Demonstration using Microsoft Word D-3 . . . . . . . . . . . . . . . . . . . . . . . . .
Demonstration using Microsoft Excel D-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing PLC Data in Windows D-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing PLC Data in another DDE-compliant Application D-5 . . . . . . . . . . . . . .
Writing Values to the PLC from another Application D-5 . . . . . . . . . . . . . . . . . . .
Ordering Information D-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GFK-0804B Micro PLC Programmer’s Guide - April 1994
vii
Appendix E Data Acquisition, Logging, and Display Program E-1 . . . . . . . . . . . . . .
Features E-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Display Software with Micro PLC Net E-1 . . . . . . . . . . . . . . . . . . . . . .
Overview E-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Equipment Required E-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Startup E-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing the Screen Colors E-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Summary E-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manual Mode E-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating or Editing Autopolling Screens E-13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Messages E-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Auto-Polling During System Operation E-21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Logging E-23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error Messages During Operation E-25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
Appendix F Programming Applications F-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application #1: FLIP / FLOP (Toggle Operation) F-2 . . . . . . . . . . . . . . . . . . . .
Application #2: Power Up One Shot (Start–up Protection) F-3 . . . . . . . . . . .
Application #3: Cascading Counters F-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application #4: Industrial “Starting Circuit” F-5 . . . . . . . . . . . . . . . . . . . . . . .
GFK-0804B Micro PLC Programmer’s Guide - April 1994
viii
restart lowapp ARestart oddapp: ARestarts for autonumbers that do not restart in each chapter . figure bi level 1, reset table_big level 1, reset chap_big level 1, reset1 Lowapp Alwbox restart evenap:A1app_big level 1, resetA figure_ap level 1, reset table_ap level 1, reset figure level 1, reset table level 1, reset these restarts oddbox reset: 1evenbox reset: 1must be in the header frame of chapter 1. a:ebx, l 1 resetA a:obx:l 1, resetA a:bigbx level 1 resetA a:ftr level 1 resetA c:ebx, l 1 reset1 c:obx:l 1, reset1 c:bigbx level 1 reset1 c:ftr level 1 reset1 Reminders for autonumbers that need to be restarted manually (first instance will always be 4) let_in level 1: A. B. C. letter level 1:A.B.C. num level 1: 1. 2. 3. num_in level 1: 1. 2.
3. rom_in level 1: I. II. III. roman level 1: I. II. III. steps level 1: 1. 2. 3.

Chapter 1 Programming for the Micro PLC

1
This chapter is an introduction to programming the Micro PLC.
H
Programming Basics
H
PLC Programs
h
P ower Flow in a Program
H
The Micro PLC Instruction Set
H
Programming Devices and F ormats
h
Programming with the Programming Software
h
Programming on a Hand-held Programmer
H
Memory T ypes and A ddresses
h
Memory Map
h
Non-retentive and Retentive Registers
h
Reserved Registers
h
Constants and Register Values in a Program
H
Special Coils
h
0.1 Sec Clock (C1018)
h
Start-up Scan Coil (C1019)
h
Hold Output Coil (C1021)
H
Programming for an Analog Expander Unit
h
Analog Scaling
h
Analog References
h
Programming Examples
GFK-0804B
1-1
1

Programming Basics

The most important ingredients in creating a successful PLC program are a thorough understanding of the application itself, and a good measure of common sense.
The first step in creating a PLC application program is planning.
h
The desired sequence of program actions is determined.
h
All of the required inputs and outputs are identified and listed.
h
Each input and output is associated with a PLC memory location. For example:
Device Designation Memory Location
Star t switch Limit switch on conveyor line Syrup tank #1, level detector Syrup tank #2, level detector Conveyor line optical sensor
Conveyor line motor star ter Operator warning light Signal to bottle capper
h
The program (like the short example program on the facing page) is created with a
Input 1 Input 2 Input 3 Input 4 Input 5
Output 1 Output 2 Output 3
Discrete Input Table 1 ”2
”3 ”4 ”5
Discrete Output Table1
”2 ”3
programming device and transferred to the PLC.
h
Before the system begins full operation, the program is tested and any corrections that are needed are made.
h
The final version of the program is transferred to the PLC, and the application is ready to go.
1-2 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

PLC Programs

A typical PLC application program is created in a format called ladder logic.
1
46101
Input 1
1
Input 2
2
Input 3
Input 4 Input 5
3
Output 1
Output 2
Output 3
Each symbol in the ladder logic represents a type of input, output, or other program action. There are many types of symbols. The three symbols shown above are:
Inputs Output
normally–open
normally–open
contact
contact
normally–closed
contact
coil
46102
In the ladder logic, each line or group of lines that ends in an action being performed, such as an output being sent, is called a rung. In the example above, there are three rungs.

Power Flow in a Program

The PLC executes the logic in the ladder from top to bottom, one rung at a time. Within each rung, the execution flows from left to right. This movement of program execution through the ladder can also be thought of as power flow. In the example:
Rung 1: Input 1 represents a switch. It is shown in the ladder logic program as a
“normally–open” contact. When the switch is turned on, the input 1 con­tact closes and power flows across rung 1 to the coil labelled Output 1.
Rung 2: Rung 2 begins at the left side with two lines of logic that lead to the same
output on the right. In this type of rung, which can have several lines beginning on the left, the output is ON if any of the input lines can be completed. In this rung, if either Input 2 or Input 3 is closed, Output 2 is turned ON.
Rung 3: Rung 3 illustrates the use of multiple inputs in the same line of logic. All
of these inputs must be completed for the output to be ON. In this exam­ple, Input 4 must be closed (active), and Input 5 must be closed (inactive) for Output 3 to be set to ON.
1-3GFK-0804B Chapter 1 Programming for the Micro PLC
1

The Micro PLC Instruction Set

Programs for a PLC are created from the elements provided in its Instruction Set. The Instruction Set for the GE Fanuc Micro PLC includes both basic relay-replacement contacts and many advanced program functions:
H
Contacts
h
Normally-open Contact
h
Normally-closed Contact
h
P ositive T ransition Contact
h
Negative Transition Contact
H
Outputs
h
Output coil
h
Set coil
h
Reset coil
h
Master Control Relay
h
Skip/Jump
H
Timers
h
On Timer
h
Off Timer
H
Counters
h
Up Counter
h
Down Counter
H
Math functions
h
Addition
h
Subtraction
h
Multiplication
h
Division
H
Move functions
h
Move
h
Block Move
h
Indirect Move
H
Comparison functions
h
Equal
h
Not Equal
h
Greater Than
h
Less Than
h
Greater Than or Equal to
h
Less Than or Equal to
H
Logical operation functions
h
AND
h
Inclusive OR
h
Exclusive OR
h
Shift Right
h
Shift Left
h
Not
1-4 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Programming Devices and Formats

Programs for the Micro PLC can be created using a computer that is equipped with the programming software, or using a Hand-held Programmer.

Programming with the Programming Software

Programs created with the programming software are in traditional ladder logic format:
1
I0001
I0002
C0001
I0003 C0001
O0030
Chapter 2 describes programming with the programming software.

Programming on a Hand-held Programmer

Equivalent programs are easily created on the Hand-held Programmer. For example:
Key Operations HHP Displays
ISTART
OOUT
ENTER1
ENTER3 0
STA I001 Empty location
OUT O030 Empty location
46011
ISTART
COR
F3AND
COUT
ENTER2
ENTER1
ENTERI 3
ENTER1
Chapter 3 describes programming with a Hand-held Programmer.
ST A I002 Empty location
OR C0001 Empty location
AND NOT I003 Empty location
OUT C0001 Empty location
1-5GFK-0804B Chapter 1 Programming for the Micro PLC
1

Memory Types and Addresses

Memor y Map

Type Total Non
Retentive
I O R
IR
OR
C C C C
256 1 – 256 none no yes no no
256 1 – 256 none yes yes no no
512 1 – 384 385 – 512* no yes yes yes
256 1 – 256 no not applicable not applicable yes no
256 1 – 256 no not applicable not applicable yes no
1017 1 – 768 769 – 1017 yes yes no no
1 1018 0.1 sec clock for use as input in application program (read only).
1 1019 Startup scan coil for use as input in application program. (read only)
1 1021 Hold output coil for use in application program (read only).

Non-retentive and Retentive Registers

Data assigned to retentive memory is saved if power is removed from the Micro PLC.
Retentive
Use for Timer
or Counter
Coil?
General Purpose
Internal Coil?
Use as General Purpose
Register?
Use as Indirect Register
Reference?
Non-retentive registers are cleared to zero when power is removed, and when the Micro PLC is switched from Stop mode to Run mode.

* Reserved Registers

Retentive Registers 501 through 512 should not be used in your application program; they are reserved.

Constants and Register Values in a Program

Many program functions for the Micro PLC use either constants, or variables in registers. Constant values are limited to 32757 maximum. Single-register variables are limited to 65535 maximum.
1-6 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Special Coils

The Micro PLC provides three special-purpose coils:
H H H
0.1 Sec Clock (C1018)
Coil C1018 is a pulse generator. The pulse width is shown below. This coil is a read-only coil. It can only be used as a program input, not as an output.
1
0.1 sec clock start–up scan coil hold output coil
46103
Pulse signal
50msec
0.1 sec
This coil should be used as a one-shot contact that feeds a regular coil.

Star t-up Scan Coil (C1019)

When the controller starts operating, this coil goes ON for one scan. It is a read-only coil. It can only be used as a program input, not an output.
Run/power on
Stop/power off
1 Scan
46104

Hold Output Coil (C1021)

This coil can be used to control the state of the program outputs when the PLC is put in stop mode. As a group, all of the outputs can either hold their last state, or be set to OFF.
If all outputs should hold their last state, set coil C1021 to ON (1). If all outputs should be set to OFF, set coil C1021 to OFF (0). Note: This function takes precedence over the Clear Data function of the programming
software (key F7 in the Online menu).
1-7GFK-0804B Chapter 1 Programming for the Micro PLC
1

Programming for an Analog Expander Unit

Analog Scaling

The Analog Expander Unit provides two 8-bit analog inputs and one 8-bit analog output. Scaling for an analog input or output is:
Minimum: 0 volts = 0mA = 0 bits Maximum: 9.969 volts = 19.922mA = 255 bits
Some examples of equivalent values are:
V olts
9.969
7.5
2.5
5
0
0
12864 192
255 Bits
46190

Analog References

In a program, input 1 uses reference IR1. Input 2 uses reference IR2. The analog output uses reference OR1.
Maximum Values
The program references (IR1, IR2, and OR) used to store analog data are 16 bits each. However, the module utilizes only the lower 8 bits. Therefore, it is important not to inadvertently program a value greater than 255, which would cause incorrect results.
For example, suppose you programmed an output value of 258. This is shown below in bits. Because the module uses only the lower 8 bits, it would interpret the value incorrectly.
00000001 00000010
Higher 8 bits not used
1-8 Micro PLC Programmer’s Guide – April 1994
Only these 8 bits are used
GFK-0804B

Programming Examples

Two simple programming examples are shown below .
Example #1:
For an analog input, the program might read the input value and turn on a discrete output when the analog input reaches a specific value. In this example, the program compares the value of the first analog input (IR1) with a value stored in register R4. If the analog input is greater than that value, then a discrete output (O18) is turned on.
O18
[IR1 > R4]
The output that is turned on might represent an actual output device such as a switch, or a logical output that is used elsewhere in the program.
Example #2:
1
The logic below might be used for an analog output.
[R3 ! OR1]
In this example, each program scan, the Move function copies the content of register R3 to reference OR1, which is the reference used by the analog output.
1-9GFK-0804B Chapter 1 Programming for the Micro PLC
Chapter 2 Programming with the Programming
2
Softwar e
This chapter explains how to create and edit a program using the Micro PLC programming software.
H
Using the Programming Functions
H
Creating a Program Rung
H
Running the Programming Software
H
Editing Basics
H
Horizontal and Vertical Lines in a Rung
H
Element Labels and Rung Labels
H
Editing a Completed Rung
H
Deleting Rungs
section level 1 1 figure bi level 1 table_big level 1
H
Moving Rungs
H
Copying Rungs
H
Searching for a Rung or Program Element
See the Micro PLC User’s Guide if you need information about:
H
Software installation
H
Software functions
H
Changing to another directory
H
Loading a program file
H
Saving a Program File
H
Clearing a program from RAM memory
H
Printing an application program
H
Exiting the programming software
H
Setup parameters
H
Files and file-handling
H
Monitoring a program online in the PLC
GFK-0804B
2-1
2

Using the Programming Functions

When you select Offline (F3) from the Main menu, the application program currently in the computer’s RAM memory appears.
If there is no program currently in RAM memory, the screen looks lik e this:
The window shows the current rung, total number of rungs in the program, and program size in words. If you want to quit the Programming window, use the ESC key.

Programming Operations

In the Offline window, use the function keys to select a programming operation.
Rung Create (F1) to create a new program rung Rung Delete (F2) to delete a program rung Search (F3) to search for a type of function or operand Edit (F4) to edit the rung at the top of the screen. After pressing
F4, – moves the cursor within the rung. PgUp, PgDn moves from rung to rung.
Rung Move (F5) to move a program rung Rung Copy (F6) to duplicate a program rung
" Search (F7) # Search (F8)
Label Display (F9) to toggle between absolute and symbolic display Check (F10) to check program syntax.
to search previous rungs (search backward) to search next program rungs (search forward)
2-2 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Programming Functions

2
46105
OFFLINE
RUNG
CREATE
RUNG
DELETE
SEARCH
RUNG MOVE SEARCH
EDIT RUNG COPY SEARCH CHECK
"
#
"
RUNG
"
#
MATH / MOVETIMER/COUNTER
REF
R LABEL
LOGIC
LABEL
DISPLAY
REF
VER T LINE
"
RST SKIP
E LABEL
COMP
HORI LINE
CLEAR
ACCEPT
ON TIMER
OFF TIMER
UP COUNTER
SET MCR END
( * ) MUL
( – ) SUB
.EQ.
DOWN
COUNTER
.NE.
MOVE
( / ) DIV B–MOVE
.GT .
.GE.
.LE.
I–MOVE( + ) ADD
SHIFT REG
LEFT
SHIFT REG
RIGHT
AND XOR
IOR.LT .
NOT
2-3GFK-0804B Chapter 2 Programming with the Programming Software
2

Creating a Program Rung

Select Rung Create (F1) to create a new program rung. If there are already rungs in the program, the new rung will appear at the top of the page.
You can now enter a program element in the highlighted location. Use the ESC key if you want to return to a previous menu.
In the Edit window, use the function keys to select a program element.
–| |– (F1) Normally-open contact. See page 4-4. –| " |– (Shift, F1) Positive transition contact. See page 4-4. –| / |– (F2) Normally-closed contact. See page 4-4. –| #|– (Shift, F2) Negative transition contact. See page 4-4. –( )– (F3) Output. See page 4-11. Timer/Counter (F4) Timer or Counter. See pages 4-16 and 4-19. Math/Move (F5) Math or Move function. See pages 4-22 and 4-30. Comp (F6) Compare function. See page 4-36. E. Lbl (Shift, F6) Element label. See page 2-8. Logic (F7) Logic function. See page 4-38. R. Lbl (Shift, F7) Rung label. See page 2-8. ________ (F8) Draw horizontal (serial) line. See page 2-7.
(F9) Draw or erase vertical (parallel) line. See page 2-7.
Accept (F10) Exit editing a rung. See page 2-6. Clear (Shift, F10) Delete (clear) the rung being edited. Be careful.
Note: the Delete key on your keyboard will remove the
element at the current position in either Rung Edit or Rung Create mode.
2-4 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Running the Programming Softwar e

The programming software can be run from diskette, or installed on a hard disk. For installation instructions and information about the files on the software diskette, refer to the Micro PLC User’s Guide (GFK -0803).

Running the Programming Software from a Hard Disk

1. Go to the directory where you placed the MICRO.EXE file. For example:
C:>CD MICRO (Press the Enter key)
2. To run the programming software, type:
C:\MICRO>MICRO (Press the Enter key)
2

Running the Programming Software Directly from a Diskette

1. Go to the DOS prompt if it is not already displayed:
A:>
2. Place the diskette containing the programming software into the appropriate disk ette drive (for e xample, drive A). To run the programming software, type:
A:>MICRO (Press the Enter key)
3. Place a formatted diskette into drive B. You can use this diskette for storing configuration files.
2-5GFK-0804B Chapter 2 Programming with the Programming Software
2

Editing Basics

After selecting Rung Create (F1):
H
H H H
H
use the function keys to create an element and enter a reference value. For example, “I2”. (Note that the element reference cannot be entered as “2I”).
use the cursor keys to move to another position in the rung being edited use your keyboard Delete key to delete a rung element. use your keyboard ESC key to quit a function or to return to the previous menu.
To create another r ung, press R ung Create (F1). The new rung appears.
Initial display:
Enter a function at the highlighted location. (Use the function keys)
Move the highlight box. (Use the cursor keys)
Enter the next function:
When you enter a coil, the highlight box automatically goes to the end of the rung:
After entering all the logic for the rung, use the Accept (F10) key to add it to the program. The disappearance of the highlight box shows that the software is not presently in Edit mode.
2-6 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Horizontal and Vertical Lines in a Rung

Horizontal and vertical lines are used to connect elements of a multi-line rung.
If a rung has more than one line of logic, move the highlight box down to the start of the next line. Enter the first element on that line.
To add a horizontal line to the logic, move the highlight box to the location for the line.
2
Use the (F8) key to add the horizontal line.
Use the Delete key on your keyboard to remove a horizontal line.
To add a vertical line to the logic, move the highlight box to the end location for the line.
Use the (F9) key to add the vertical line.
Y ou must use the (F9) key to remove a vertical line.
2-7GFK-0804B Chapter 2 Programming with the Programming Software
2

Element Labels and Rung Labels

Element labels and rung labels are text that can be added to a program and viewed in Offline mode by selecting the Label Display function. Element and rung labels will also appear in their entirety in a hard copy printout or a print to disk. The first 5 characters of an element label can also be viewed in Online mode. (Think about this when selecting the element label.) To create an element label or rung label, follow the instructions below, in Edit or Create Rung mode.
To create a label for an individual element, move the highlight box to that element. Press Enter to clear element edit. Then, press Shift, F6.
Enter the text for the element label. Pressing the Enter (return) key ends text entry. Enter spaces if you want the label to have more than one line.
After you press the Enter key , the element label disappears.
To create a label for a rung, press Shift, F7.
Enter the text for the rung label. Pressing the Enter (return) key ends text entry. Enter spaces if you want the label to have more than one line.
After you press the Enter key , the element label disappears.
2-8 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Editing a Completed Rung

After using the Accept (F10) key to save a rung, the rung can be changed by selecting Edit (F4) with the Offline function keys. The same basic programming features are
available in both Create mode and Edit mode. Refer to the previous descriptions of program functions and editing techniques.
While editing a rung, you can delete, add, or change rung elements within the rung as described below and on the following pages.
If you want to delete or move an entire rung, see page 2-13.

Selecting a Rung to Edit

To select a rung for display or editing, use the cursor keys to scroll the program up or down on the screen. Or you can use the Search function to locate a specific rung, element, or reference.
Bring the rung you want to edit to the top of the screen.
To edit the rung, use the Edit (F4) key. In Edit mode, you can add elements to the rung, or edit the elements that are already there. You can then use the cursor keys to move the cursor within a rung, and the PgUp, PgDn keys to move from rung to rung.
2

Editing a Rung Element

In Edit mode, the highlight box selects the rung element that can be edited.
Use the cursor keys to move to the highlighted box. Enter the reference and address, then press the Enter key or a cursor key to go to the
next rung element.

Deleting a Rung Element

Delete the highlighted element by pressing the Delete key on your keyboard. (If the small edit cursor is displayed in the highlight box, first press the Enter key to remove it).
This creates an empty space in the rung. If you do not want to add an element at that location, insert a horizontal line (F8).
2-9GFK-0804B Chapter 2 Programming with the Programming Software
2

Adding a Contact to a R ung

To add a contact to a rung, move the highlight box to the location for the new contact.
Add the contact using its function key. Enter a reference for the contact and press the Enter key, or use the cursor keys to move to a new position.

Adding a Program Function to a Rung

If you want to add something other than a contact (for example, an Equal function) to a rung, first create a space for it. Position the highlight box where the function should begin, then press your keyboard Delete key. If the element to be added requires 2 or 3 consecutive spaces, move the highlight box, then press the Delete key again.
Move the highlight cursor back to the leftmost empty space:
Add the function using its function key. Edit the function as necessary.
2-10 Micro PLC Programmer’s Guide – April 1994
GFK-0804B
2

Replacing a Rung Element with a Similar Element

To replace a rung element with a similar element (for example, to replace a normally-open contact with a normally-closed contact), select the element with the highlight box.
Press the function key that corresponds to the new element type. Edit it if necessary.

Replacing a Rung Element with a Horizontal Line

To replace a rung element with a horizontal line, select it with the highlight box:
Then , select the horizontal line (F8).
2-11GFK-0804B Chapter 2 Programming with the Programming Software
2

Replacing a Rung Element with a Dissimilar Element

To replace an element with an element of a different type (for example, to change a normally-open contact to an Equals function), select the element with the highlight box.
First, delete the element by pressing the Delete key on your keyboard. (If the small edit cursor is displayed in the highlight box, first press the Enter key to remove it).
This creates an empty space in the rung. If you do not want to add an element at that location, insert a horizontal line (F8).
If you want to add an element at that location, use the appropriate function key to enter it.
You may need to delete more than one existing element to insert a new element if the new element is wider than the element it is replacing.
2-12 Micro PLC Programmer’s Guide – April 1994
GFK-0804B

Deleting Rungs

To delete one or more rungs, use the Rung Delete (F2) key. The software prompts:
The first number that appears is the number of the rung that is now at the top of the screen. If you want to delete just that rung, press the Enter key.
If you want to delete a different rung, or a group of rungs, enter their rung numbers then press the Enter key.
If you want to quit the Delete function without deleting any rungs, press the ESC key.
2

Moving Rungs

You might want to move rungs to make a program more understandable, or to group rungs together that work with each other.
To move one or more rungs, use the Rung Move (F5) key. The software prompts:
The first number that appears is the number of the rung that is now at the top of the screen. Enter the numbers of the r ungs to be moved, and the number of the rung you want to
insert them in front of. Press the Enter key. If you want to quit the Move function without moving any rungs, press the ESC key.
2-13GFK-0804B Chapter 2 Programming with the Programming Software
Loading...
+ 130 hidden pages