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

The text of a manual · part 19 of 60

C200HX/C200HG/C200HE Programmable Controllers Operation Manual, pages 174 to 183

Pages 174 to 183 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 174

Section 5-10

INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) Instruction

Treatment

OUT and OUT NOT

Designated bit turned OFF.

SET and RSET

Bit status maintained.

TIM and TIMH(15)

Reset.

TTIM(87)

PV maintained.

CNT, CNTR(12)

PV maintained.

KEEP(11)

Bit status maintained.

DIFU(13) and DIFD(14)

Not executed (see the following DIFU(13) and DIFD(14) in Interlocks). Not executed.

All others

IL(02) and ILC(03) do not necessarily have to be used in pairs. IL(02) can be used several times in a row, with each IL(02) creating an interlocked section through the next ILC(03). ILC(03) cannot be used unless there is at least one IL(02) between it and any previous ILC(03). DIFU(13) and DIFD(14) in Interlocks

Changes in the execution condition for a DIFU(13) or DIFD(14) are not recorded if the DIFU(13) or DIFD(14) is in an interlocked section and the execution condition for the IL(02) is OFF. When DIFU(13) or DIFD(14) is execution in an interlocked section immediately after the execution condition for the IL(02) has gone ON, the execution condition for the DIFU(13) or DIFD(14) will be compared to the execution condition that existed before the interlock became effective (i.e., before the interlock condition for IL(02) went OFF). The ladder diagram and bit status changes for this are shown below. The interlock is in effect while 00000 is OFF. Notice that 01000 is not turned ON at the point labeled A even though 00001 has turned OFF and then back ON.

00000 IL(02) 00001 DIFU(13) 01000 ILC(03)

A

Address

Instruction

00000 00001 00002 00003 00004

LD IL(02) LD DIFU(13) ILC(03)

Operands 00000 00001 01000

ON

00000

OFF ON

00001

OFF ON

01000

OFF

Precautions

There must be an ILC(03) following any one or more IL(02). Although as many IL(02) instructions as are necessary can be used with one ILC(03), ILC(03) instructions cannot be used consecutively without at least one IL(02) in between, i.e., nesting is not possible. Whenever a ILC(03) is executed, all interlocks between the active ILC(03) and the preceding ILC(03) are cleared. When more than one IL(02) is used with a single ILC(03), an error message will appear when the program check is performed, but execution will proceed normally.

Flags

156

There are no flags affected by these instructions.

Page 175

Section 5-11

JUMP and JUMP END – JMP(04) and JME(05) Example

The following diagram shows IL(02) being used twice with one ILC(03). 00000 IL(02) 00001 TIM TIM511 511 #0015

001.5 s

Address

Instruction

00000 00001 00002 00003

LD IL(02) LD TIM

00004 00005 00006 00007 00008 00009

LD IL(02) LD AND NOT LD CNT

00010 00011 00012

LD OUT ILC(03)

00000

00002

# IL(02)

00003 00100

Operands

00004

CP R

CNT 001 IR 010

00005 00502

ILC(03)

00001 511 0015 00002 00003 00004 00100 001 010 00005 00502

When the execution condition for the first IL(02) is OFF, TIM 511 will be reset to 1.5 s, CNT 001 will not be changed, and 00502 will be turned OFF. When the execution condition for the first IL(02) is ON and the execution condition for the second IL(02) is OFF, TIM 511 will be executed according to the status of 00001, CNT 001 will not be changed, and 00502 will be turned OFF. When the execution conditions for both the IL(02) are ON, the program will execute as written.

5-11 JUMP and JUMP END – JMP(04) and JME(05) Ladder Symbols JMP(04) N

Definer Values N: Jump number # (00 to 99)

JME(05) N

N: Jump number # (00 to 99)

Limitations

Jump numbers 01 through 99 may be used only once in JMP(04) and once in JME(05), i.e., each can be used to define one jump only. Jump number 00 can be used as many times as desired.

Description

JMP(04) is always used in conjunction with JME(05) to create jumps, i.e., to skip from one point in a ladder diagram to another point. JMP(04) defines the point from which the jump will be made; JME(05) defines the destination of the jump. When the execution condition for JMP(04) in ON, no jump is made and the program is executed consecutively as written. When the execution condition for JMP(04) is OFF, a jump is made to the JME(05) with the same jump number and the instruction following JME(05) is executed next. If the jump number for JMP(04) is between 01 and 99, jumps, when made, will go immediately to JME(05) with the same jump number without executing any instructions in between. The status of timers, counters, bits used in OUT, bits used in OUT NOT, and all other status bits controlled by the instructions between JMP(04) and JMP(05) will not be changed. Each of these jump numbers can be used to define only one jump. Because all of instructions between JMP(04) and JME(05) are skipped, jump numbers 01 through 99 can be used to reduce cycle time.

157

Page 176

Section 5-14

Timer and Counter Instructions

If the jump number for JMP(04) is 00, the CPU Unit will look for the next JME(05) with a jump number of 00. To do so, it must search through the program, causing a longer cycle time (when the execution condition is OFF) than for other jumps. The status of timers, counters, bits used in OUT, bits used in OUT NOT, and all other status controlled by the instructions between JMP(04) 00 and JMP(05) 00 will not be changed. jump number 00 can be used as many times as desired. A jump from JMP(04) 00 will always go to the next JME(05) 00 in the program. It is thus possible to use JMP(04) 00 consecutively and match them all with the same JME(05) 00. It makes no sense, however, to use JME(05) 00 consecutively, because all jumps made to them will end at the first JME(05) 00. DIFU(13) and DIFD(14) in Jumps

Although DIFU(13) and DIFD(14) are designed to turn ON the designated bit for one cycle, they will not necessarily do so when written between JMP(04) and JME (05). Once either DIFU(13) or DIFD(14) has turned ON a bit, it will remain ON until the next time DIFU(13) or DIFD(14) is executed again. In normal programming, this means the next cycle. In a jump, this means the next time the jump from JMP(04) to JME(05) is not made, i.e., if a bit is turned ON by DIFU(13) or DIFD(14) and then a jump is made in the next cycle so that DIFU(13) or DIFD(14) are skipped, the designated bit will remain ON until the next time the execution condition for the JMP(04) controlling the jump is ON.

Precautions

When JMP(04) and JME(05) are not used in pairs, an error message will appear when the program check is performed. Although this message also appears if JMP(04) 00 and JME(05) 00 are not used in pairs, the program will execute properly as written.

Flags

There are no flags affected by these instructions.

Examples

Examples of jump programs are provided in 4-7-8 Jumps.

5-12 END – END(01) Ladder Symbol

END(01)

Description

END(01) is required as the last instruction in any program. If there are subroutines, END(01) is placed after the last subroutine. No instruction written after END(01) will be executed. END(01) can be placed anywhere in the program to execute all instructions up to that point, as is sometimes done to debug a program, but it must be removed to execute the remainder of the program. If there is no END(01) in the program, no instructions will be executed and the error message “NO END INST” will appear.

Flags

END(01) turns OFF the ER, CY, GR, EQ, and LE Flags.

5-13 NO OPERATION – NOP(00) Description

NOP(00) is not generally required in programming and there is no ladder symbol for it. When NOP(00) is found in a program, nothing is executed and the program execution moves to the next instruction. When memory is cleared prior to programming, NOP(00) is written at all addresses. NOP(00) can be input through the 00 function code.

Flags

There are no flags affected by NOP(00).

5-14 Timer and Counter Instructions TIM and TIMH are decrementing ON-delay timer instructions which require a TC number and a set value (SV). CNT is a decrementing counter instruction and CNTR is a reversible counter instruction. Both require a TC number and a SV. Both are also connected to multiple instruction lines which serve as an input signal(s) and are reset.

158

Page 177

Section 5-14

Timer and Counter Instructions

Any one TC number cannot be defined twice, i.e., once it has been used as the definer in any of the timer or counter instructions, it cannot be used again. Once defined, TC numbers can be used as many times as required as operands in instructions other than timer and counter instructions. TC numbers run from 000 through 511. No prefix is required when using a TC number as a definer in a timer or counter instruction. Once defined as a timer, a TC number can be prefixed with TIM for use as an operand in certain instructions. The TIM prefix is used regardless of the timer instruction that was used to define the timer. Once defined as a counter, a TC number can be prefixed with CNT for use as an operand in certain instructions. The CNT is also used regardless of the counter instruction that was used to define the counter. TC numbers can be designated as operands that require either bit or word data. When designated as an operand that requires bit data, the TC number accesses a bit that functions as a ‘Completion Flag’ that indicates when the time/count has expired, i.e., the bit, which is normally OFF, will turn ON when the designated SV has expired. When designated as an operand that requires word data, the TC number accesses a memory location that holds the present value (PV) of the timer or counter. The PV of a timer or counter can thus be used as an operand in CMP(20), or any other instruction for which the TC area is allowed. This is done by designating the TC number used to define that timer or counter to access the memory location that holds the PV. Note that “TIM 000” is used to designate the TIMER instruction defined with TC number 000, to designate the Completion Flag for this timer, and to designate the PV of this timer. The meaning of the term in context should be clear, i.e., the first is always an instruction, the second is always a bit operand, and the third is always a word operand. The same is true of all other TC numbers prefixed with TIM or CNT. An SV can be input as a constant or as a word address in a data area. If an IR area word assigned to an Input Unit is designated as the word address, the Input Unit can be wired so that the SV can be set externally through thumbwheel switches or similar devices. Timers and counters wired in this way can only be set externally during RUN or MONITOR mode. All SVs, including those set externally, must be in BCD.

5-14-1 TIMER – TIM Definer Values N: TC number

Ladder Symbol

# (000 through 511) TIM N SV

Operand Data Areas SV: Set value (word, BCD) IR, AR, DM, HR, LR, #

Limitations

SV is between 000.0 and 999.9. The decimal point is not entered. Each TC number can be used as the definer in only one TIMER or COUNTER instruction. TC 000 through TC 015 should not be used in TIM if they are required for TIMH(15). Refer to 5-14-2 HIGH-SPEED TIMER – TIMH(15) for details.

Description

A timer is activated when its execution condition goes ON and is reset (to SV) when the execution condition goes OFF. Once activated, TIM measures in units of 0.1 second from the SV.

159

Page 178

Section 5-14

Timer and Counter Instructions

If the execution condition remains ON long enough for TIM to time down to zero, the Completion Flag for the TC number used will turn ON and will remain ON until TIM is reset (i.e., until its execution condition is goes OFF). The following figure illustrates the relationship between the execution condition for TIM and the Completion Flag assigned to it. ON

Execution condition

OFF ON

Completion Flag

OFF

SV

Precautions

SV

Interlocks and Power Interruptions Timers in interlocked program sections are reset when the execution condition for IL(02) is OFF. Power interruptions also reset timers. If a timer that is not reset under these conditions is desired, SR area clock pulse bits can be counted to produce timers using CNT. Refer to 5-14-4 COUNTER – CNT for details. Program execution will continue even if a non-BCD SV is used, but timing will not be accurate. Jumps Never program TIM between JMP(04) 00 and JME(05) 00 with an SV of #0000. The Completion Flag will turn ON even when the execution condition for JMP(04) 00 is ON (i.e., even when the program section with TIM is jumped). TIM can be programmed successfully between JMP(04) and JME(05) as long as a jump number between 01 and 99 is used. Step Instructions Never program TIM between STEP(08) and SNXT(09) with an SV of #0000. The Completion Flag will turn ON even when the step containing TIM is reset. The SV of the timers can be set in the range #0000 to #9999 (BCD). If the SV for a timer is set to #0000 or #0001, it will operate in the following way. If the SV is set to #0000, when the timer input goes from OFF to ON, the Completion Flag will turn ON. If the SV is set to #0001, because the timer accuracy is 0 to –0.1 s, the actual time will be a value between 0 and 0.1 s, and the Completion Flag may turn ON as soon as the timer input goes from OFF to ON. With other values also, allow for a timer accuracy of 0 to –0.1 s when setting the SV.

Flags

ER:

SV is not in BCD. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.)

Examples

All of the following examples use OUT in diagrams that would generally be used to control output bits in the IR area. There is no reason, however, why these diagrams cannot be modified to control execution of other instructions.

Example 1: Basic Application

The following example shows two timers, one set with a constant and one set via input word 005. Here, 00200 will be turned ON after 00000 goes ON and stays ON for at least 15 seconds. When 00000 goes OFF, the timer will be reset and 00200 will be turned OFF. When 00001 goes ON, TIM 001 is started from the SV provided through IR word 005. Bit 00201 is also turned ON when 00001 goes

160

Page 179

Section 5-14

Timer and Counter Instructions

ON. When the SV in 005 has expired, 00201 is turned OFF. This bit will also be turned OFF when TIM 001 is reset, regardless of whether or not SV has expired.

00000 TIM 000 #0150

015.0 s

Address

Instruction

00000 00001

LD TIM

00002 00003 00004 00005

LD OUT LD TIM

00006 00007

AND NOT OUT

TIM 000 00200 00001 TIM 001 IR 005

IR 005

TIM 001 00201

Example 2: Extended Timers

Operands

# TIM

TIM

00000 000 0150 000 00200 00001 001 005 001 00200

There are two ways to achieve timers that operate for longer than 999.9 seconds. One method is to program consecutive timers, with the Completion Flag of each timer used to activate the next timer. A simple example with two 900.0-second (15-minute) timers combined to functionally form a 30-minute timer.

00000

Address

Instruction

900.0 s

00000 00001

LD TIM

900.0 s

00002 00003

LD TIM

00004 00005

LD OUT

TIM 001 #9000 TIM 001 TIM 002 #9000 TIM 002 00200

Operands

# TIM # TIM

00000 001 9000 001 002 9000 002 00200

In this example, 00200 will be turned ON 30 minutes after 00000 goes ON. TIM can also be combined with CNT or CNT can be used to count SR area clock pulse bits to produce longer timers. An example is provided in 5-14-4 COUNTER – CNT. Example 3: ON/OFF Delays

TIM can be combined with KEEP(11) to delay turning a bit ON and OFF in reference to a desired execution condition. KEEP(11) is described in 5-9-4 KEEP – KEEP(11). To create delays, the Completion Flags for two TIM are used to determine the execution conditions for setting and reset the bit designated for KEEP(11). The bit whose manipulation is to be delayed is used in KEEP(11). Turning ON and OFF the bit designated for KEEP(11) is thus delayed by the SV for the two TIM. The two SV could naturally be the same if desired. In the following example, 00500 would be turned ON 5.0 seconds after 00000 goes ON and then turned OFF 3.0 seconds after 00000 goes OFF. It is necessary to use both 00500 and 00000 to determine the execution condition for TIM

161

Page 180

Section 5-14

Timer and Counter Instructions

002; 00000 in an inverse condition is necessary to reset TIM 002 when 00000 goes ON and 00500 is necessary to activate TIM 002 (when 00000 is OFF).

00000

Address

Instruction

005.0 s

00000 00001

LD TIM

003.0 s

00002 00003 00004

LD AND NOT TIM

00005 00006 00007

LD LD KEEP(11)

TIM 001 #0050 00500 00000

#

TIM 002 #0030 TIM 001 S KEEP(11) 00500

TIM 002

Operands

R

# TIM TIM 00500

00000 001 0050 00500 00000 002 0030 001 002

00000

00500 5.0 s

Example 4: One-Shot Bits

01000

3.0 s

The length of time that a bit is kept ON or OFF can be controlled by combining TIM with OUT or OUT NO. The following diagram demonstrates how this is possible. In this example, 00204 would remain ON for 1.5 seconds after 00000 goes ON regardless of the time 00000 stays ON. This is achieved by using 01000 as a self-maintaining bit activated by 00000 and turning ON 00204 through it. When TIM 001 comes ON (i.e., when the SV of TIM 001 has expired), 00204 will be turned OFF through TIM 001 (i.e., TIM 001 will turn ON which, as an inverse condition, creates an OFF execution condition for OUT 00204).

TIM 001 01000

00000

01000 TIM 001 #0015

001.5 s

Address

Instruction

00000 00001 00002 00003 00004 00005

LD AND NOT OR OUT LD TIM

00006 00007 00008

LD AND NOT OUT

Operands TIM

# 01000 TIM 001 00204

00000

00204 1.5 s

162

1.5 s

TIM

01000 001 00000 01000 01000 001 0015 01000 001 00204

Page 181

Section 5-14

Timer and Counter Instructions The following one-shot timer may be used to save memory.

00000 TIM 001 #0015

00100

001.5 s

TIM 001

Address

Instruction

00000 00001 00002

LD OR TIM

00003 00004

AND NOT OUT

00100

Example 5: Flicker Bits

Operands 00000 00100 001 0015 001 00100

# TIM

Bits can be programmed to turn ON and OFF at regular intervals while a designated execution condition is ON by using TIM twice. One TIM functions to turn ON and OFF a specified bit, i.e., the Completion Flag of this TIM turns the specified bit ON and OFF. The other TIM functions to control the operation of the first TIM, i.e., when the first TIM’s Completion Flag goes ON, the second TIM is started and when the second TIM’s Completion Flag goes ON, the first TIM is started.

00000 TIM 002 TIM 001 #0010

1.0 s

TIM 001 TIM 002 #0015

TIM 001

Address

Instruction

00000 00001 00002

LD AND TIM

00003 00004

LD TIM

00005 00006

LD OUT

1.5 s

00205

Operands 00000 002 001 0010 001 002 0015 001 00205

TIM # TIM # TIM

00000

00205 1.0 s

1.5 s

1.0 s

1.5 s

A simpler but less flexible method of creating a flicker bit is to AND one of the SR area clock pulse bits with the execution condition that is to be ON when the flicker bit is operating. Although this method does not use TIM, it is included here for comparison. This method is more limited because the ON and OFF times must be the same and they depend on the clock pulse bits available in the SR area. In the following example the 1-second clock pulse is used (25502) so that 00206 would be turned ON and OFF every second, i.e., it would be ON for 0.5 seconds and OFF for 0.5 seconds. Precise timing and the initial status of 00206 would depend on the status of the clock pulse when 00000 goes ON.

00000 25502 00206

Address

Instruction

00000 00001 00002

LD AND OUT

Operands 00000 25502 00206

163

Page 182

Section 5-14

Timer and Counter Instructions

5-14-2 HIGH-SPEED TIMER – TIMH(15) Definer Values N: TC number

Ladder Symbol TIMH(15) N

# (000 through 511, although 000 through 015 preferred)

SV

Operand Data Areas SV: Set value (word, BCD) IR, AR, DM, HR, LR, #

Limitations

SV is between 00.00 and 99.99. (Although 00.00 and 00.01 may be set, 00.00 will disable the timer, i.e., turn ON the Completion Flag immediately, and 00.01 is not reliably cycled.) The decimal point is not entered. Each TC number can be used as the definer in only one TIMER or COUNTER instruction. If the cycle time is greater than 10 ms, use TC 000 through TC 015. The PVs and completion flags of timers 000 through 015 are refreshed every 10 ms, but the PVs of timers 016 through TC 511 are refreshed each time that TIMH(15) is executed in the program.

Description

TIMH(15) operates in the same way as TIM except that TIMH measures in units of 0.01 second. The cycle time affects TIMH(15) accuracy if TC 016 through TC 511 are used. If the cycle time is greater than 10 ms, use TC 000 through TC 015. Refer to 5-14-1 TIMER – TIM for operational details and examples. Except for the above, and all aspects of operation are the same.

Precautions

Timers in interlocked program sections are reset when the execution condition for IL(02) is OFF. Power interruptions also reset timers. If a timer that is not reset under these conditions is desired, SR area clock pulse bits can be counted to produce timers using CNT. Refer to 5-14-4 COUNTER – CNT for details. Program execution will continue even if a non-BCD SV is used, but timing will not be accurate. The SV of the timers can be set in the range #0000 to #9999 (BCD). If the SV for a timer is set to #0000 or #0001, it will operate in the following way. If the SV is set to #0000, when the timer input goes from OFF to ON, the Completion Flag will turn ON. There may be a time delay if TC 000 to TC 003 are used. If the SV is set to #0001, because the timer accuracy is 0 to –0.1 s, the actual time will be a value between 0 and 0.1 s, and the Completion Flag may turn ON as soon as the timer input goes from OFF to ON. With other values also, allow for a timer accuracy of 0 to –0.1 s when setting the SV.

Flags

ER:

SV is not in BCD. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.)

164

Page 183

Section 5-14

Timer and Counter Instructions

5-14-3 TOTALIZING TIMER – TTIM(87) Definer Values Ladder Symbol

N: TC number # (000 through 511)

TTIM(87) N SV RB

Operand Data Areas SV: Set value (word, BCD) IR, AR, DM, HR, LR RB: Reset bit IR, SR, AR, HR, LR

Limitations

SV is between 0000 and 9999 (000.0 and 999.9 s) and must be in BCD. The decimal point is not entered. Each TC number can be used as the definer in only one TIMER or COUNTER instruction.

Description

TTIM(87) is used to create a timer that increments the PV every 0.1 s to time between 0.1 and 999.9 s. TTIM(87) increments in units of 0.1 second from zero. TTIM(87) accuracy is +0.0/–0.1 second. A TTIM(87) timer will time as long as its execute condition is ON until it reaches the SV or until RB turns ON to reset the timer. TTIM(87) timers will time only as long as they are executed every cycle, i.e., they do not time, but maintain the current PV, in interlocked program sections or when they are jumped in the program.

Precautions

The PVs of totalizing timers in interlocked program sections are maintained when the execution condition for IL(02) is OFF. Unlike timers and high-speed timers, totalizing timers in jumped program sections do not continue timing, but maintain the PV. Power interruptions will reset timers. Totalizing timers will not restart after timing out unless the PV is changed to a value below the SV or the reset input is turned ON. A delay of one cycle is sometimes required for a Completion Flag to be turned ON after the timer times out. The SV of the timers can be set in the range #0000 to #9999 (BCD). If the SV for a timer is set to #0000 or #0001, it will operate in the following way. If the SV is set to #0000, when the timer input goes from OFF to ON, the Completion Flag will turn ON. If the SV is set to #0001, because the timer accuracy is 0 to –0.1 s, the actual time will be a value between 0 and 0.1 s, and the Completion Flag may turn ON as soon as the timer input goes from OFF to ON. With other values also, allow for a timer accuracy of 0 to –0.1 s when setting the SV.

Flags

ER (SR 25503): Content of word is not BCD when set for BCD. SV is not BCD.

165