Omron CX-PROGRAMMER V9 - REV 12-2009 Operation Manual page 113

Table of Contents

Advertisement

OMRON
Note:
Note:
Creating a Ladder Program
A PLC can be programmed using either the Ladder or Mnemonic programming languages. The Ladder program
is created in the Diagram View of the Diagram Window.
Use the following procedure to create a ladder program.
1, 2, 3...
above example, the symbol 'RedLight' is defined as type 'BOOL'. Entering the address '10'
is interpreted by CX-Programmer as '0.10'. If it had been intended as bit zero at address 50, it
would have been necessary to enter it as '5000' or (more easily) '50.00'.
Symbols of NUMBER type have been used to indicate the timer numbers used in the PLC.
Whilst it is possible to type numbers directly into the program 'TIM' instruction operands, it is
more readable to define symbols that can have a name and comment. CX-Programmer allows
numbers to be defined as symbols, as well as addresses.
It is possible to create symbols whilst creating the PLC programs – when entering ladder
contact/coil and instruction information. It is not necessary to use the symbol table to create
symbols.
1. Ensure the Ladder program is displayed in the Diagram Workspace.
2. Give the rung a comment by using the Properties box (move the cursor to the rung
margin and access the properties box from the context menu.
Note: A rung comment placeholder can be inserted into the compiled code (if the Include
Comment Instructions property of the PLC is set), and the comment itself can then be
saved to a file or file-card. All comments are saved in the project file.
3. Place a New Closed Contact at the start of the rung – select the New Closed Contact
button from the toolbar and click in the top left cell. The New Closed Contact dialog is
displayed.
4. Enter or select 'AmberOnlyTimerDone' from the combo and select the OK pushbutton.
When a comment dialog is displayed, select the OK pushbutton again.
Note that the rung margin now shows a red mark down its side. This is to indicate that the
rung is incomplete – the marker bar shows whenever the rung has an error.
5. Place an Instruction by selecting the New PLC Instruction button from the toolbar and
clicking next to the Contact. The New Instruction dialog is displayed.
6. Enter the instruction 'TIM' and the two operands, 'RedLightTimer' and 'TimeInterval', in
the edit box with a space between each word.
Note: The value of the symbol 'RedLightTimer' is used for the operand – the number '1'.
In CX-Programmer, it is necessary to use a NUMBER for the first operand of a TIM/CNT
instruction. It is not allowed to use a timer/counter address (i.e. T001 is not allowed).
7. Select the OK pushbutton to accept the settings in the New Instruction dialog. When a
comment dialog is displayed, select the OK pushbutton again.
Note that the rung margin no longer shows a red mark down its side. There is no error
within the rung.
8. Give the instruction a comment by using the Properties box (place the cursor over the
instruction title and bring up the properties). Enter the text 'Red light on only' and press
return.
9. Place a New Contact at the start of the next rung. (Either like before, or by moving the
cursor to the start of the rung and using the Insert/Contact/Normally Open menu
command, or by pressing the shortcut key displayed for that menu command – usually
'C'). The New Contact dialog is displayed.
10. Enter or select 'RedTimerDone' from the combo and select the OK pushbutton. When a
comment dialog is displayed, select the OK pushbutton again.
11. Place an instruction next to the Contact and display the New Instruction dialog. (Either
like before, or by using the Insert/Instruction menu command, or by pressing the shortcut
key for that command – usually 'I'). Enter the instruction 'TIM' and the two operands,
'AmberLightTimer' and 'TimeInterval', in the Instruction edit box.
12. Select the OK pushbutton to accept the settings in the New Instruction dialog. When a
comment dialog is displayed, select the OK pushbutton again.
PART 1: CX-Programmer
CHAPTER 2 – Quick Start Guide
CX-Programmer _Page 33

Advertisement

Table of Contents
loading

Table of Contents