Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 16 of 68

Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 4 Writing and Inputting the Program, pages 128 to 136

Pages 128 to 136 of 613, from Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual

The original document is the PDF (3.8 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.

Filed in the catalog under the Omron C200H-SP001 and Omron C200HW-PA204

Page 128

Section

Inputting, Modifying, and Checking the Program Error Messages

The following error messages may appear when inputting a program. Correct the error as indicated and continue with the input operation. The asterisks in the displays shown below will be replaced with numeric data, normally an address, in the actual display.

Message ****REPL ROM ****PROG OVER ****ADDR OVER ****SETDATA ERR ****I/O NO. ERR

4-7

Cause and correction An attempt was made to write to write-protected RAM or EEPROM. Ensure that the write-protect switch is set to OFF. The instruction at the last address in memory is not NOP(000). Erase all unnecessary instructions at the end of the program. An address was set that is larger than the highest memory address in the UM area. Input a smaller address Data has been input in the wrong format or beyond defined limits, e.g., a hexadecimal value has been input for BCD. Re-enter the data. This error will generate a FALS 00 error. A data area address has been designated that exceeds the limit of the data area, e.g., an address is too large. Confirm the requirements for the instruction and re-enter the address.

4-7-3 Checking the Program Once a program has been entered, the syntax should be checked to verify that no programming rules have been violated. This check should also be performed if the program has been changed in any way that might create a syntax error. To check the program, input the key sequence shown below. The numbers indicate the desired check level (see below). When the check level is entered, the program check will start. If an error is discovered, the check will stop and a display indicating the error will appear. Press SRCH to continue the check. If an error is not found, the program will be checked through to the first END(001), with a display indicating when each 64 instructions have been checked (e.g., display #1 of the example after the following table). CLR can be pressed to cancel the check after it has been started, and a display like display #2, in the example, will appear. When the check has reached the first END, a display like display #3 will appear. A syntax check can be performed on a program only in PROGRAM mode. Key Sequence To check up to END(001) To abort

(0, 1, 2, Check levels)

Check Levels and Error Messages

Three levels of program checking are available. The desired level must be designated to indicate the type of errors that are to be detected. The following table provides the error types, displays, and explanations of all syntax errors. Check level 0 checks for type A, B, and C errors; check level 1, for type A and B errors; and check level 2, for type A errors only. The address where the error was generated will also be displayed.

115

Page 129

Inputting, Modifying, and Checking the Program

Section

4-7

Many of the following errors are for instructions that have not yet been described yet. Refer to 4-8 Controlling Bit Status or to Section 5 Instruction Set for details on these. Type Type A

Message ????? NO END INSTR CIRCUIT ERR

LOCN ERR DUPL SBN UNDEFD JME UNDEFD OPERAND ERR STEP ERR

Type B

IL-ILC ERR

JMP-JME ERR

SBN-RET ERR

Type C

JMP UNDEFD SBS UNDEFD COIL DUPL

116

Meaning and appropriate response The program has been lost. Re-enter the program. There is no END(001) in the program. Write END(001) at the final address in the program. The number of logic blocks and logic block instructions does not agree, i.e., either LD or LD NOT has been used to start a logic block whose execution condition has not been used by another instruction, or a logic block instruction has been used that does not have the required number of logic blocks. Check your program. An instruction is in the wrong place in the program. Check instruction requirements and correct the program. The same jump number or subroutine number has been used twice. Correct the program so that the same number is only used once for each. (Jump number 00 may be used as often as required.) SBS(091) has been programmed for a subroutine number that does not exist. Correct the subroutine number or program the required subroutine. A JME(004) is missing for a JMP(005). Correct the jump number or insert the proper JME(004). A constant entered for the instruction is not within defined values. Change the constant so that it lies within the proper range. STEP(008) with a section number and STEP(008) without a section number have been used correctly. Check STEP(008) programming requirements and correct the program. IL(002) and ILC(003) are not used in pairs. Correct the program so that each IL(002) has a unique ILC(003). Although this error message will appear if more than one IL(002) is used with the same ILC(003), the program will executed as written. Make sure your program is written as desired before proceeding. JMP(004) 00 and JME(005) 00 are not used in pairs. Although this error message will appear if more than one JMP(004) 00 is used with the same JME(005) 00, the program will be executed as written. Make sure your program is written as desired before proceeding. If the displayed address is that of SBN(092), two different subroutines have been defined with the same subroutine number. Change one of the subroutine numbers or delete one of the subroutines. If the displayed address is that of RET(093), RET(093) has not been used properly. Check requirements for RET(093) and correct the program. JME(005) has been used with no JMP(004) with the same jump number. Add a JMP(004) with the same number or delete the JME(005) that is not being used. A subroutine exists that is not called by SBS(091). Program a subroutine call in the proper place, or delete the subroutine if it is not required. The same bit is being controlled (i.e., turned ON and/or OFF) by more than one instruction (e.g., OUT, OUT NOT, DIFU(013), DIFD(014), KEEP(011), SFT(010)). Although this is allowed for certain instructions, check instruction requirements to confirm that the program is correct or rewrite the program so that each bit is controlled by only one instruction.

Page 130

Section

Inputting, Modifying, and Checking the Program Example

4-7

The following example shows some of the displays that can appear as a result of a program check.

00000 00000PROG CHK CHKLVL (0-2)? 00064PROG CHK

Display #1

Halts program check

00699CHK ABORTD

Display #2

Check continues until END(001)

02000PROG CHK END(001)(02.7KW)

Display #3

When errors are found

00178CIRCUIT ERR OUT 00200 00200IL-ILC ILC (003)

ERR

02000NO END INST END

4-7-4 Displaying the Cycle Time Once the program has been cleared of syntax errors, the cycle time should be checked. This is possible only in RUN or MONITOR mode while the program is being executed. See Section 6 Program Execution Timing for details on the cycle time. To display the current average cycle time, press CLR then MONTR. The time displayed by this operation is a typical cycle time. The differences in displayed values depend on the execution conditions that exist when MONTR is pressed. Example 00000 00000SCAN TIME 054.1MS 00000SCAN TIME 053.9MS

117

Page 131

Inputting, Modifying, and Checking the Program

Section

4-7

4-7-5 Program Searches The program can be searched for occurrences of any designated instruction or data area address used in an instruction. Searches can be performed from any currently displayed address or from a cleared display. To designate a bit address, press SHIFT, press CONT/#, then input the address, including any data area designation required, and press SRCH. To designate an instruction, input the instruction just as when inputting the program and press SRCH. Once an occurrence of an instruction or bit address has been found, any additional occurrences of the same instruction or bit can be found by pressing SRCH again. SRCH’G will be displayed while a search is in progress. When the first word of a multiword instruction is displayed for a search operation, the other words of the instruction can be displayed by pressing the down key before continuing the search. If Program Memory is read in RUN or MONITOR mode, the ON/OFF status of any bit displayed will also be shown. Key Sequence

118

Page 132

Section

Inputting, Modifying, and Checking the Program Example: Instruction Search

4-7

00000 00000 LD

00000

00200SRCH LD

00000

00202SRCH LD

00000

02000SRCH END(001)(02.7KW)

00000 00100 00100 TIM

001

00203SRCH TIM

001

00203 TIM DATA #0123 Example: Bit Search

00000 00000CNT CONT

00005

00200CONT SRCH LD 00005 00203CONT SRCH AND 00005 02000 END (001)(02.7K)

4-7-6 Inserting and Deleting Instructions In PROGRAM mode, any instruction that is currently displayed can be deleted or another instruction can be inserted before it. These operations are possible only in PROGRAM mode with the write-protect switch (pin 1 of the CPU Unit’s DIP switch) set to OFF (OFF=“WRITE”). To insert an instruction, display the instruction before which you want the new instruction to be placed, input the instruction word in the same way as when inputting a program initially, and then press INS and the down key. If other words are required for the instruction, input these in the same way as when inputting the program initially.

119

Page 133

Section

Inputting, Modifying, and Checking the Program

4-7

To delete an instruction, display the instruction word of the instruction to be deleted and then press DEL and the up key. All the words for the designated instruction will be deleted.

! Caution

Be careful not to inadvertently delete instructions; there is no way to recover them without re-inputting them completely.

Key Sequences

When an instruction is inserted or deleted, all addresses in Program Memory following the operation are adjusted automatically so that there are no blank addresses or no unaddressed instructions. Example

The following mnemonic code shows the changes that are achieved in a program through the key sequences and displays shown below.

Original Program

00101

00103

00104 00201

00201

Instruction

00000 00001 00002 00003 00004 00005 00006 00007 00008

LD AND LD AND NOT OR LD AND AND NOT OUT END(001)

Operands 00100 00101 00201 00102 –– 00103 00104 00201 ––

Before Deletion:

Before Insertion: 00100

Address

00102

00100

END(001)

00103

00105

00104 00201

00201

00105

00101

00102

Delete

END(001)

The following key inputs and displays show the procedure for achieving the program changes shown above.

120

Page 134

Section

Inputting, Modifying, and Checking the Program

4-7

Inserting an Instruction 00000 00000 OUT

00000

Find the address prior to the insertion point

00000 OUT

00201

Program After Insertion

00207SRCH OUT

00201

00206READ AND NOT

00104

00206 AND

00000

00206 AND

00105

Address

Instruction

00000 00001 00002 00003 00004 00005 00006 00007 00008 00009

LD AND LD AND NOT OR LD AND AND AND NOT OUT END(001)

Operands 00100 00101 00201 00102 –– 00103 00105 00104 00201 ––

00206INSERT? AND 00105 00207INSERT END AND NOT 00104 00206READ AND

Insert the instruction

00105

Deleting an Instruction 00000 00000 OUT

00000

00000 OUT

00201

00208SRCH OUT

00201

00207READ AND NOT

00104

00207 DELETE? AND NOT 00104 00207DELETE END OUT 00201 00206READ AND

Find the instruction that requires deletion. Program After Deletion Address

Instruction

00000 00001 00002 00003 00004 00005 00006 00007 00008

LD AND NOT LD AND NOT OR LD AND AND OUT END(001)

Operands 00100 00101 00201 00102 –– 00103 00105 00201 ––

Confirm that this is the instruction to be deleted.

00105

121

Page 135

Section

Inputting, Modifying, and Checking the Program

4-7

4-7-7 Branching Instruction Lines When an instruction line branches into two or more lines, it is sometimes necessary to use either interlocks or TR bits to maintain the execution condition that existed at a branching point. This is because instruction lines are executed across to a right-hand instruction before returning to the branching point to execute instructions on a branch line. If a condition exists on any of the instruction lines after the branching point, the execution condition could change during this time making proper execution impossible. The following diagrams illustrate this. In both diagrams, instruction 1 is executed before returning to the branching point and moving on to the branch line leading to instruction 2. 00000

Branching point

Address

Instruction

Instruction 2

00000 00001 00002 00003

LD Instruction 1 AND Instruction 2

Instruction 1

Address

Instruction

00000 00001 00002 00003 00004

LD AND Instruction 1 AND Instruction 2

Instruction 1 00002

Diagram A: Correct Operation 00000

Branching point

Operands 00000 00002

00001

00002 Instruction 2

Diagram B: Incorrect Operation

Operands 00000 00001 00002

If, as shown in diagram A, the execution condition that existed at the branching point cannot be changed before returning to the branch line (instructions at the far right do not change the execution condition), then the branch line will be executed correctly and no special programming measure is required. If, as shown in diagram B, a condition exists between the branching point and the last instruction on the top instruction line, the execution condition at the branching point and the execution condition after completing the top instruction line will sometimes be different, making it impossible to ensure correct execution of the branch line. There are two means of programming branching programs to preserve the execution condition. One is to use TR bits; the other, to use interlocks (IL(002)/IL(003)). TR Bits

122

The TR area provides eight bits, TR 0 through TR 7, that can be used to temporarily preserve execution conditions. If a TR bit is placed at a branching point, the current execution condition will be stored at the designated TR bit. When returning to the branching point, the TR bit restores the execution status that was saved when the branching point was first reached in program execution.

Page 136

Section

Inputting, Modifying, and Checking the Program

4-7

The previous diagram B can be written as shown below to ensure correct execution. In mnemonic code, the execution condition is stored at the branching point using the TR bit as the operand of the OUTPUT instruction. This execution condition is then restored after executing the right-hand instruction by using the same TR bit as the operand of a LOAD instruction

TR 0 00001

00000

Instruction 1 00002 Instruction 2

Diagram B: Corrected Using a TR bit

Address

Instruction

00000 00001 00002 00003 00004 00005 00006

LD OUT AND Instruction 1 LD AND Instruction 2

Operands 00000 TR 0 00001 TR 0 00002

In terms of actual instructions the above diagram would be as follows: The status of IR 00000 is loaded (a LOAD instruction) to establish the initial execution condition. This execution condition is then output using an OUTPUT instruction to TR 0 to store the execution condition at the branching point. The execution condition is then ANDed with the status of IR 00001 and instruction 1 is executed accordingly. The execution condition that was stored at the branching point is then re-loaded (a LOAD instruction with TR 0 as the operand), this is ANDed with the status of IR 00002, and instruction 2 is executed accordingly. The following example shows an application using two TR bits.

TR 0 00000

TR 1 00001

00002 Instruction 1 00003 Instruction 2

00004 Instruction 3 00005 Instruction 4

Address

Instruction

00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014

LD OUT AND OUT AND Instruction 1 LD AND Instruction 2 LD AND Instruction 3 LD AND NOT Instruction 4

Operands 00000 TR 0 00001 TR 1 00002 TR 1 00003 TR 0 00004 TR 0 00005

In this example, TR 0 and TR 1 are used to store the execution conditions at the branching points. After executing instruction 1, the execution condition stored in TR 1 is loaded for an AND with the status IR 00003. The execution condition stored in TR 0 is loaded twice, the first time for an AND with the status of IR 00004 and the second time for an AND with the inverse of the status of IR 00005. TR bits can be used as many times as required as long as the same TR bit is not used more than once in the same instruction block. Here, a new instruction block is begun each time execution returns to the bus bar. If, in a single instruction block, it is necessary to have more than eight branching points that require the execution condition be saved, interlocks (which are described next) must be used.

123