The text of a manual · part 12 of 60
C200HX/C200HG/C200HE Programmable Controllers Operation Manual, pages 104 to 113
Pages 104 to 113 of 586
The original document is the PDF (3.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Omron C200HE-CPU42-E
Page 104
Section 4-4
Basic Ladder Diagrams
The following diagram requires an OR LOAD followed by an AND LOAD to code the top of the three blocks, and then two more OR LOADs to complete the mnemonic code. 00000
00001
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012
LD LD LD AND NOT OR LD AND LD LD NOT AND OR LD LD NOT AND OR LD OUT
Operands
LR 0000 00002
00004
00005
00006
00007
00003
LR
00000 00001 00002 00003 –– –– 00004 00005 –– 00006 00007 –– 0000
Although the program will execute as written, this diagram could be drawn as shown below to eliminate the need for the first OR LOAD and the AND LOAD, simplifying the program and saving memory space. 00002
00003
00000 LR 0000
00001
00004
00005
00006
00007
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010
LD AND NOT OR AND LD NOT AND OR LD LD NOT AND OR LD OUT
Operands
LR
00002 00003 00001 00000 00004 00005 –– 00006 00007 –– 0000
The following diagram requires five blocks, which here are coded in order before using OR LOAD and AND LOAD to combine them starting from the last two blocks and working backward. The OR LOAD at program address 00008 combines blocks blocks d and e, the following AND LOAD combines the resulting execution condition with that of block c, etc. 00000
00001
00002 LR 0000
Block b Block a Block c 00003
00004
Block d 00005
00006
00007 Blocks d and e Block c with result of above
Block e
Block b with result of above Block a with result of above
86
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012
LD LD AND LD AND LD LD AND OR LD AND LD OR LD AND LD OUT
Operands
LR
00000 00001 00002 00003 00004 00005 00006 00007 –– –– –– –– 0000
Page 105
Section 4-4
Basic Ladder Diagrams
Again, this diagram can be redrawn as follows to simplify program structure and coding and to save memory space.
00006
00007
00003
00004
00000
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009
LD AND OR AND AND LD AND OR LD AND OUT
LR 0000 00005
00001
00002
Operands 00006 00007 00005 00003 00004 00001 00002 –– 00000 0000
LR
The next and final example may at first appear very complicated but can be coded using only two logic block instructions. The diagram appears as follows: Block a 00000
00001
01000
01001
00002
00003
00004
00005 00500
00006
00500 Block b
Block c
The first logic block instruction is used to combine the execution conditions resulting from blocks a and b, and the second one is to combine the execution condition of block c with the execution condition resulting from the normally closed condition assigned IR 00003. The rest of the diagram can be coded with OR, AND, and AND NOT instructions. The logical flow for this and the resulting code are shown below. Block a
Block b
00000
00001
01000
01001
LD AND
00000 00001
LD AND
01000 01001
OR LD Block c 00500
00004
00005
00004 00005
OR
00500
LD AND
00002
00003
00006
AND 00002 AND NOT 00003
LD
AND LD
00006
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012
LD AND LD AND OR LD OR AND AND NOT LD AND OR AND LD OUT
Operands 00000 00001 01000 01001 –– 00500 00002 00003 00004 00005 00006 –– 00500
00500
87
Page 106
Section 4-5
The Programming Console
4-4-7 Coding Multiple Right-hand Instructions If there is more than one right-hand instruction executed with the same execution condition, they are coded consecutively following the last condition on the instruction line. In the following example, the last instruction line contains one more condition that corresponds to an AND with IR 00004. 00000
00003
HR 0001
00001 00500 00002
00004 00506
HR 0000
4-5
Address
Instruction
00000 00001 00002 00003 00004 00005 00006 00007 00008
LD OR OR OR AND OUT OUT AND OUT
Operands
HR HR
00000 00001 00002 0000 00003 0001 00500 00004 00506
The Programming Console This and the next section describe the Programming Console and the operations necessary to prepare for program input. 4-7 Inputting, Modifying, and Checking the Program describes actual procedures for inputting the program into memory. Although the Programming Console can be used to write ladder programs, it is primarily used to support SSS operations and is very useful for on-site editing and maintenance. The main Programming Console functions are listed below. 1, 2, 3...
1. Displaying operating messages and the results of diagnostic checks. 2. Writing and reading ladder programs, inserting and deleting instructions, searching for data or instructions, and monitoring I/O bit status. 3. Monitoring I/O status, force-setting/resetting bits. 4. The Programming Console can be connected to or disconnected from the PC with the power on. 5. The Programming Console can be used with C-series PCs. 6. Supports TERMINAL mode, which allows the display of a 32-character message, as well as operation of the keyboard mapping function. Refer to 5-25-6 TERMINAL MODE – TERM(––) for details.
Note The Programming Console does not support all of the SSS operations, only those required for on-site editing and maintenance.
4-5-1 The Keyboard The keyboard of the Programming Console is functionally divided by key color into the following four areas: White: Numeric Keys
The ten white keys are used to input numeric program data such as program addresses, data area addresses, and operand values. The numeric keys are also used in combination with the function key (FUN) to enter instructions with function codes. The numeral keys 0 to 5 are also pressed after the SHIFT key to input hexadecimal numerals A to F.
Red: CLR Key
The CLR key clears the display and cancels current Programming Console operations. It is also used when you key in the password at the beginning of programming operations. Any Programming Console operation can be cancelled by pressing the CLR key, although the CLR key may have to be pressed two or three times to cancel the operation and clear the display.
88
Page 107
The Programming Console
Section 4-5
Yellow: Operation Keys
The yellow keys are used for writing and correcting programs. Detailed explanations of their functions are given later in this section.
Gray: Instruction and Data Area Keys
Except for the SHIFT key on the upper right, the gray keys are used to input instructions and designate data area prefixes when inputting or changing a program. The SHIFT key is similar to the shift key of a typewriter, and is used to alter the function of the next key pressed. (It is not necessary to hold the SHIFT key down; just press it once and then press the key to be used with it.)
89
Page 108
Section 4-5
The Programming Console
The gray keys other than the SHIFT key have either the mnemonic name of the instruction or the abbreviation of the data area written on them. The functions of these keys are described below.
Pressed before the function code when inputting an instruction via its function code. Pressed to enter SFT (the Shift Register instruction). Input either after a function code to designate the differentiated form of an instruction or after a ladder instruction to designate an inverse condition. Pressed to enter AND (the AND instruction) or used with NOT to enter AND NOT. Pressed to enter OR (the OR instruction) or used with NOT to enter OR NOT. Pressed to enter CNT (the Counter instruction) or to designate a TC number that has already been defined as a counter. Pressed to enter LD (the Load instruction) or used with NOT to enter LD NOT. Also pressed to indicate an input bit. Pressed to enter OUT (the Output instruction) or used with NOT to enter OUT NOT. Also pressed to indicate an output bit. Pressed to enter TIM (the Timer instruction) or to designate a TC number that has already been defined as a timer. Pressed before designating an address in the TR area. Pressed before designating an address in the LR area. Pressed before designating an address in the HR area. Pressed before designating an address in the AR area. Pressed before designating an address in the DM area. Pressed before designating an address in the EM area. Pressed before designating an indirect DM address. Pressed before designating a word address. Pressed before designating an operand as a constant. Pressed before designating a bit address. Pressed to select either the upper or lower function for keys that have two functions. Pressing this key once selects the upper function, and pressing it again selects the lower function. Selects expanded functions when used in combination with other keys. Pressed before the numeric keys 0 to 5 to input the hexadecimal numerals A to F.
90
Page 109
Section 4-6
Preparation for Operation
4-5-2 PC Modes The Programming Console is equipped with a switch to control the PC mode. To select one of the three operating modes - RUN, MONITOR, or PROGRAM - use the mode switch. The mode that you select will determine PC operation as well as the procedures that are possible from the Programming Console. RUN mode is the mode used for normal program execution. When the switch is set to RUN and the START input on the CPU Power Supply Unit is ON, the CPU Unit will begin executing the program according to the program written in its Program Memory. Although monitoring PC operation from the Programming Console is possible in RUN mode, no data in any of the memory areas can be input or changed. MONITOR mode allows you to visually monitor in-progress program execution while controlling I/O status, changing PV (present values) or SV (set values), etc. In MONITOR mode, I/O processing is handled in the same way as in RUN mode. MONITOR mode is generally used for trial system operation and final program adjustments. In PROGRAM mode, the PC does not execute the program. PROGRAM mode is for creating and changing programs, clearing memory areas, and registering and changing the I/O table. A special Debug operation is also available within PROGRAM mode that enables checking a program for correct execution before trial operation of the system. ! Caution
Do not leave the Programming Console connected to the PC by an extension cable when in RUN mode. Noise picked up by the extension cable can enter the PC, affecting the program and thus the controlled system.
4-5-3 The Display Message Switch Pin 3 of the CPU Unit’s DIP switch determines whether Japanese or English language messages will be displayed on the Programming Console. It is factory set to ON, which causes English language messages to be displayed.
4-6
Preparation for Operation This section describes the procedures required to begin Programming Console operation. These include password entry, clearing memory, error message clearing, and I/O table operations. I/O table operations are also necessary at other times, e.g., when changes are to be made in Units used in the PC configuration. ! Caution
Always confirm that the Programming Console is in PROGRAM mode when turning on the PC with a Programming Console connected unless another mode is desired for a specific purpose. If the Programming Console is in RUN mode when PC power is turned on, any program in Program Memory will be executed, possibly causing a PC-controlled system to begin operation. The following sequence of operations must be performed before beginning initial program input.
1, 2, 3...
1. Insert the mode key into the Programming Console. 2. Set the mode switch to PROGRAM mode. (The mode key cannot be removed while set to PROGRAM mode.) 3. Turn ON PC power. Note When I/O Units are installed, turn on those Units also. The Programming Console will not operate if these Units are not turned ON.
91
Page 110
Section 4-6
Preparation for Operation
4. Confirm that the CPU Unit’s POWER LED is lit and the following display appears on the Programming Console screen. (If the PC mode is not displayed, turn OFF and restart the power supply. If the ALM/ERR LED is lit or flashing or an error message is displayed, clear the error that has occurred.)
<PROGRAM> PASSWORD!
5. Enter the password. See 4-6-1 Entering the Password for details. 6. Clear memory. Skip this step if the program does not need to be cleared. See 4-6-3 Clearing Memory for details.
4-6-1 Entering the Password To gain access to the PC’s programming functions, you must first enter the password. The password prevents unauthorized access to the program. The PC prompts you for a password when PC power is turned ON or, if PC power is already ON, after the Programming Console has been connected to the PC. To gain access to the system when the “Password!” message appears, press CLR and then MONTR. Then press CLR to clear the display. If the Programming Console is connected to the PC when PC power is already ON, the first display below will indicate the mode the PC was in before the Programming Console was connected. Ensure that the PC is in PROGRAM mode before you enter the password. When the password is entered, the PC will shift to the mode set on the mode switch, causing PC operation to begin if the mode is set to RUN or MONITOR. The mode can be changed to RUN or MONITOR with the mode switch after entering the password.
<PROGRAM> PASSWORD! <PROGRAM>
BZ
Indicates the mode set by the mode selector switch.
4-6-2 Buzzer Immediately after the password is input or anytime immediately after the mode has been changed, SHIFT and then the 1 key can be pressed to turn ON and OFF the buzzer that sounds when Programming Console keys are pressed. If BZ is displayed in the upper right corner, the buzzer is operative. If BZ is not displayed, the buzzer is not operative. This buzzer also will also sound whenever an error occurs during PC operation. Buzzer operation for errors is not affected by the above setting.
92
Page 111
Section 4-6
Preparation for Operation
4-6-3 Clearing Memory Using the Memory Clear operation it is possible to clear all or part of the UM area (RAM or EEPROM), and the IR, HR, AR, DM, EM and TC areas. Unless otherwise specified, the clear operation will clear all of the above memory areas. The UM area will not be cleared if the write-protect switch (pin 1 of the CPU Unit’s DIP switch) is set to ON. Before beginning to programming for the first time or when installing a new program, all areas should normally be cleared. Before clearing memory, check to see if a program is already loaded that you need. If you need the program, clear only the memory areas that you do not need, and be sure to check the existing program with the program check key sequence before using it. The check sequence is provided later in this section. Further debugging methods are provided in Section 7 Program Monitoring and Execution. To clear all memory areas press CLR until all zeros are displayed, and then input the keystrokes given in the top line of the following key sequence. The branch lines shown in the sequence are used only when performing a partial memory clear, which is described below. Memory can be cleared in PROGRAM mode only. The following table shows which memory areas will be cleared for the 3 memory clearing operations (all clear, partial clear, memory clear). Memory Area
Note
All Clear
All clear
Partial clear
Memory clear
I/O words
Cleared
Cleared
Cleared
Work words
Cleared
---
Cleared
HR, AR, TC, DM, fixed DM
Cleared
Cleared
Cleared
Expansion DM
Cleared
---
Cleared
EM
Cleared
Cleared
Cleared
I/O comments
Cleared
---
---
Ladder program
Cleared
Cleared
Cleared
UM Allocation information
Cleared
---
---
1. The error history area (DM 6000 to DM 6030) will not be cleared when the DM area is cleared. 2. When the PC Setup area (DM 6600 to DM 6655 in fixed DM) is cleared, the settings will be returned to their factory-set defaults. 3. When the All Clear operation is executed, the ladder program area will be allocated entirely to the ladder program. (The expansion DM and I/O comment areas will be set to 0 KW.) Also , all EM banks will be cleared. The key sequence for all clear is shown below.
93
Page 112
Section 4-6
Preparation for Operation The following procedure is used to clear memory completely. MEMORY ERR I/O VER ERR
Continue pressing the CLR key once for each error message until “00000” appears on the display
00000 00000 00000MEMORY CLR? HR CNT DM EM~ 00000MEM ALLCLR?
All clear
00000MEM ALLCLR END Partial Clear
It is possible to retain the data in specified areas or part of the ladder program. To retain the data in the HR and AR, TC, DM, and/or EM areas, press the appropriate key after entering REC/RESET. HR is pressed to designate both the HR and AR areas. In other words, specifying that HR is to be retained will ensure that AR is retained also. If not specified for retention, both areas will be cleared. CNT is used for the entire TC area. Press Shift + DM to specify the EM area. The display will show those areas that will be cleared. It is possible to retain some EM banks and clear others. See the explanation under the heading “Clearing Selected EM Banks” on page 95. It is also possible to retain a portion of the ladder program from the beginning to a specified address. After designating the data areas to be retained, specify the first program address to be cleared. For example, to leave addresses 00000 to 00122 untouched, but to clear addresses from 00123 to the end of Program Memory, input 00123. The key sequence for a partial memory clear is shown below.
Program Memory cleared from designated address. Both AR and HR areas
TC area
DM area
EM area
94
Retained if pressed
Page 113
Section 4-6
Preparation for Operation
To leave the TC area uncleared and retain Program Memory addresses 00000 through 00122, input as follows:
00000 00000 00000 00000MEMORY CLR? HR CNT DM EM~ 00000MEMORY CLR? HR DM EM~ 00123MEMORY CLR? HR DM EM~ 00000MEMORY CLR END HR DM EM
Clearing Selected EM Banks When a partial memory clear operation is being performed, specific banks can be selected for clearing rather than selecting the entire EM area. In the following example, EM banks 0 and 2 are selected for clearing. The Programming Console will display the following screens:
00000 00000 00000 00000MEMORY CLR? HR CNT DM EM 00000 EM CLR 012
?
00000 EM CLR 0 2
?
00000 EM CLR END 0 2
95