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

The text of a manual · part 39 of 68

Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 5 Instruction Set, pages 354 to 363

Pages 354 to 363 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 354

Section 5-26

Special Instructions

LR > IR > HR > AR > TC > DM > SR In handling messages from the same area, those with the lowest address values have higher priority. In handling indirectly addressed messages (i.e. DM), those with the lowest DM address values have higher priority. Clearing Messages

To clear a message, execute FAL(006) 00 or clear it via a Programming Console using the procedure in 4-6-5 Clearing Error Messages. If the message data changes while the message is being displayed, the display will also change.

Flags

ER:

Example

The following example shows the display that would be produced for the instruction and data given when 00000 was ON. If 00001 goes ON, a message will be cleared.

The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded.

00000

Address

Instruction

00000 00001

LD MSG(046)

00002 00003

LD FAL(006)

Operands

MSG(046) DM 0010 00001 FAL(006) 00

DM contents DM 0010

4

1

4

2

ASCII equivalent A B

DM 0011

4

3

4

4

C

D

DM 0012

4

5

4

6

E

F

DM 0013

4

7

4

8

G

H

DM 0014

4

9

4

A

I

J

DM 0015

4

B

4

C

K

L

DM 0016

4

D

4

E

M

N

DM 0017

4

F

5

0

O

P

00000 DM 0010 00001 00

MSG ABCDEFGHIJKLMNOP

5-26-5 LONG MESSAGE – LMSG(047) Operand Data Areas S: First source word (ASCII)

Ladder Symbols

IR, SR, AR, DM, EM, HR, TC, LR LMSG(047)

@LMSG(047)

S

S

---

---

---

---

---: Not used.

Limitations

342

Set to 000 ---: Not used. Set to 000

S through S+15 must be in the same data area and must be in ASCII. The message will be truncated if a null character (0D) is contained between S and S+15. LMSG(047) is an expansion instruction. A Programming Device can be used to reassign function code 047 to another expansion instruction.

Page 355

Section 5-26

Special Instructions Description

LMSG(047) is used to output a 32-character message to a Programming Console. The message to be output must be in ASCII beginning in word S and ending in S+15, unless a shorter message is desired. A shorter message can be produced by placing a null character (0D) into the string; no characters from the null character on will be output. To output to the Programming Console, it must be set in TERMINAL mode. Although LMSG(047) will be executed as normal, the message will not appear correctly on the Programming Console unless TERMINAL mode is set. Refer to 5-26-6 TERMINAL MODE – TERM(048) for details on switching to TERMINAL mode. When pin 6 of the CPU Unit’s DIP switch is OFF, the Programming Console can be switched to TERMINAL mode by pressing the CHG Key or by executing TERM(048) in the program. When pin 6 of the CPU Unit’s DIP switch is ON, the Programming Console can be switched to Expansion TERMINAL mode by turning ON bit AR 0709.

Flags

ER:

S and S+15 are not in the same data area. The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded.

Example

Although the display is longer and there is a choice of output devices, the coding for LMSG(047) is the same as that for MSG(046). Refer to Example under the previous section for an example using MSG(046).

5-26-6 TERMINAL MODE – TERM(048) Ladder Symbols TERM(048)

@TERM(048)

000

000

000

000

000

000

Limitations

TERM(048) is an expansion instruction. A Programming Device can be used to reassign function code 048 to another expansion instruction.

Description

When the execution condition is OFF, TERM(048) is not executed. When the execution condition is ON, TERM(048) switches the Programming Console to TERMINAL mode. (Instructions MSG(046), LMSG(047), and the keyboard mapping function are executed in TERMINAL mode.) The Programming Console will return to CONSOLE mode when the CHG key is pressed again. There is no instruction that returns the Programming Console to CONSOLE mode from the program. The Programming Console can also be switched to TERMINAL mode by pressing the CHG key on the Programming Console before inputting the password or when the mode is being displayed provided that pin 6 of the CPU Unit’s DIP switch is OFF. The Programming Console will return to CONSOLE mode when the CHG key is pressed again. When pin 6 of the CPU Unit’s DIP switch is ON, the Programming Console can be switched to Expansion TERMINAL mode by turning ON bit AR 0709.

343

Page 356

Section 5-26

Special Instructions Example

In the following example, TERM(048) is used to switch the Programming Console to TERMINAL mode when 00000 is ON. Be sure that pin 6 of the CPU Unit’s DIP switch is OFF.

00000

Address

Instruction

00000 00001

LD TERM(048)

Operands

TERM(048) 000 000

00000 000 000 000

000

5-26-7 WATCHDOG TIMER REFRESH – WDT(094) Ladder Symbols WDT(094) T

Definer Data Areas T: Watchdog timer value

@WDT(094) T

# (00 to 63)

Description

When the execution condition is OFF, WDT(094) is not executed. When the execution condition is ON, WDT(094) extends the setting of the cycle monitor time (watchdog timer) set in DM 6618 of the PC Setup. The default setting is 120 ms. Timer extension = 100 ms × T Where: T = 0000 to 0063 (4-digit BCD)

Precautions

The cycle monitor time (watchdog timer setting) can be set to a maximum of 99 s with the PC Setup. The WDT(094) instruction can be used to extend the cycle monitor time to a maximum value of 6400 ms, but only the portion of the cycle used for instruction execution is extended. WDT(094) can be executed more than once in a cycle, but the cycle time can’t be extended by more than 6400 ms total. Any extension over 6400 ms will be ignored. Another WDT(094) instruction won’t be executed if the cycle time has already been extended by 6400 ms. Timers might not function properly when the cycle time exceeds 100 ms. When using WDT(094), the same timer should be repeated in the program at intervals that are less than 100 ms apart. TIMH(015) should be used only in a scheduled interrupt routine executed at intervals of 10 ms or less.

Flags

There are no flags affected by this instruction.

5-26-8 I/O REFRESH – IORF(097) Ladder Symbol

Operand Data Areas St: Starting word

IORF(097) St

IR 000 to IR 049, IR 100 to IR 199, SR 400 to SR 450

E

E: End word IR 000 to IR 049, IR 100 to IR 199, SR 400 to SR 450

Limitations

344

IORF(097) can be used to refresh I/O words allocated to I/O Units, Special I/O Units, and Interrupt Input Units mounted to the CPU Unit or Expansion I/O Racks.

Page 357

Section 5-26

Special Instructions

It cannot be used for other I/O words, such as I/O Units on Slave Racks or Group-2 High-density I/O Units. St must be less than or equal to E. Description

To refresh I/O words allocated to CPU Unit or Expansion I/O Racks (IR 000 to IR 029 or IR 300 to IR 309), simply specify the first (St) and last (E) I/O words to be refreshed. When the execution condition for IORF(097) is ON, all words between St and E will be refreshed. This will be in addition to the normal I/O refresh performed during the CPU Unit’s cycle. To refresh I/O words allocated to Special I/O Units 0 through 9 (IR 100 to IR 199), designate IR 040 to IR 049. These IR words are just used to identify the corresponding Special I/O Unit; execution of IORF(097) will have no effect on the content of IR 040 to IR 049. For example, set St to IR 043 and E to IR 045 to refresh the I/O words allocated to Special I/O Units 3, 4, and 5. The I/O words allocated to those Units (IR 130 to IR 159) will be refreshed when IORF(097) is executed.This will be in addition to the normal I/O refresh performed during the CPU Unit’s cycle. To specify a particular 10-word Special I/O Unit Area (IR 100 to IR 190 or IR 400 to IR 450), input the first word of the 10-word area. (The last digit of the IR word must be 0.) Refer to 5-26-9 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(061) for details on refreshing words allocated to Group-2 High-density I/O Units.

Flags

ER:

St and/or E aren’t within the proper setting ranges. (000 to 029, 040 to 040, 100 to 190, 300 to 309, or 400 to 450). St and E aren’t within the same setting range. St is greater than E.

5-26-9 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(061) Operand Data Areas

Ladder Symbols MPRF(061)

@MPRF(061)

St

St

E

E

000

000

St: Starting unit number #0000 to #000F E: End unit number #0000 to #000F 000: Set to 000. ---

Limitations

MPRF(061) can be used to refresh I/O words allocated to Group-2 High-density I/O Units only. It cannot be used for other I/O words. St and E must be between #0000 and #000F. St must be less than or equal to E. MPRF(061) is an expansion instruction. A Programming Device can be used to reassign function code 061 to another expansion instruction.

Description

When the execution condition is OFF, MPRF(061) is not executed. When the execution condition is ON, the I/O words allocated to Group-2 High-density I/O Units with I/O numbers St through E will be refreshed. This will be in addition to the normal I/O refresh performed during the CPU Unit’s cycle. It is not possible to specify the I/O words by address, only by the I/O number of the Unit to which they are allocated.

Execution Time

The execution time for MPRF(061) is computed as follows:

345

Page 358

Section 5-26

Special Instructions TMPRF =

Instruction execution time + ∑(Group-2 High-density I/O Unit I/O refresh times) Refer to 6-1 Cycle Time for a table showing I/O refresh times for Group-2 High-density I/O Units. Flags

ER:

St or E is not BCD between #0000 and #000F. St is greater than E.

5-26-10 BIT COUNTER – BCNT(067) Operand Data Areas

Ladder Symbols

N: Number of words (BCD) BCNT(067)

@BCNT(067)

N

N

SB

SB

D

D

IR, SR, AR, DM, EM, HR, TC, LR, # SB: Source beginning word IR, SR, AR, DM, EM, HR, TC, LR D: Destination word IR, SR, AR, DM, EM, HR, TC, LR

Limitations

N must be BCD between 0000 and 6656. BCNT(067) is an expansion instruction. A Programming Device can be used to reassign function code 067 to another expansion instruction.

Description

When the execution condition is OFF, BCNT(067) is not executed. When the execution condition is ON, BCNT(067) counts the total number of bits that are ON in all words between SB and SB+(N–1) and places the BCD result in D.

Flags

ER:

N is not BCD, or N is 0; SB and SB+(N–1) are not in the same area. The resulting count value exceeds 9999. The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded. ON when the count (N) exceeds the data area boundary.

EQ:

ON when the result is 0.

5-26-11 FRAME CHECKSUM – FCS(180) Operand Data Areas

Ladder Symbols FCS(180)

@FCS(180)

C

C

R1

R1

D

D

C: Control data IR, SR, AR, DM, EM, HR, LR, # R1: First word in range IR, SR, AR, DM, EM, HR, TC, LR D: First destination word IR, SR, AR, DM, EM, HR, LR

Limitations

FCS(180) is an expansion instruction. A Programming Device can be used to reassign function code 180 to another expansion instruction.

Description

FCS(180) can be used to check for errors when transferring data through communications ports.

346

Page 359

Section 5-26

Special Instructions

When the execution condition is OFF, FCS(180) is not executed. When the execution condition is ON, FCS(180) calculates the frame checksum of the specified range by exclusively ORing either the contents of words R1 to R1+N–1 or the bytes in words R1 to R1+N–1. The frame checksum value (hexadecimal) is then converted to ASCII and output to the destination words (D and D+1). The function of bits in C are shown in the following diagram and explained in more detail below. C:

15 14 13 12 11

00 Number of items in range (N, BCD) 001 to 999 words or bytes First byte (when bit 13 is ON) 1 (ON): Rightmost 0 (OFF): Leftmost Calculation units 1 (ON): Bytes 0 (OFF): Words

Not used. Set to zero.

Number of Items in Range

The number of items within the range (N) is contained in the 3 rightmost digits of C, which must be BCD between 001 and 999.

Calculation Units

The frame checksum of words will be calculated if bit 13 is OFF and the frame checksum of bytes will be calculated if bit 13 is ON. If bytes are specified, the range can begin with the leftmost or rightmost byte of R1. The leftmost byte of R1 will not be included if bit 12 is ON.

R1 R1+1 R1+2 R1+3

MSB LSB 1 2 3 4 5 6 7 8

When bit 12 is OFF the bytes will be ORed in this order: 1, 2, 3, 4, .... When bit 12 is ON the bytes will be ORed in this order: 2, 3, 4, 5, .... Conversion to ASCII

The byte frame checksum calculation yields a 2-digit hexadecimal value which is converted to its 4-digit ASCII equivalent. The word frame checksum calculation yields a 4-digit hexadecimal value which is converted to its 8-digit ASCII equivalent, as shown below. Byte frame checksum value

Word frame checksum value

4A

F10B

D 3 4 4 1

Flags

ER:

D+1 4 6 3 1

D 3 0 4 2

The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded. The number of items is not 001 to 999 BCD. The calculation range exceeds the data area.

347

Page 360

Section 5-26

Special Instructions Example

When IR 00000 is ON in the following example, the frame checksum (0008) is calculated for the 8 words from DM 0000 to DM 0007 and the ASCII equivalent (30 30 30 38) is written to DM 0011 and DM 0010.

00000 @FCS(180) #0008 DM 0000

Address

Instruction

00000 00001

LD @FCS(180)

Operands 00000 #0008 DM 0000 DM 0010

DM 0010

DM 0000 DM 0001 DM 0002 DM 0003 DM 0004 DM 0005 DM 0006 DM 0007

0001 0002 0003 0004 0005 0006 0007 0008

FCS calculation 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0

0

0

8 ASCII code conversion

DM 0011 3 0 3 0

DM 0010 3 0 3 8

5-26-12 FAILURE POINT DETECTION – FPD(269) Ladder Symbols

Operand Data Areas C: Control data

FPD(269) # C T: Monitoring time (BCD) T D

IR, SR, AR, DM, EM, HR, TC. LR, # D: First register word IR, AR, DM, EM, HR, LR, SR

Limitations

D and D+8 must be in the same data area when bit 15 of C is ON. C must be input as a constant. FPD(269) is an expansion instruction. A Programming Device can be used to reassign function code 269 to another expansion instruction.

Description

FPD(269) can be used in the program as many times as desired, but each must use a different D. It is used to monitor the time between the execution of FPD(269) and the execution of a diagnostic output. If the time exceeds T, an FAL(006) non-fatal error will be generated with the FAL number specified in C. The program sections marked by dashed lines in the following diagram can be written according to the needs of the particular program application. The processing programming section triggered by CY is optional and can used any instruc-

348

Page 361

Section 5-26

Special Instructions tions but LD and LD NOT. The logic diagnostic instructions and execution condition can consist of any combination of NC or NO conditions desired. Execution condition

Branch FPD(269) C T D SR 25504 (CY Flag) Processing after error detection.

Logic diagnostic instructions

Diagnostic output

When the execution condition is OFF, FPD(269) is not executed. When the execution condition is ON, FPD(269) monitors the time until the logic diagnostics condition goes ON, turning ON the diagnostic output. If this time exceeds T, the following will occur: 1, 2, 3...

Control Data

1. An FAL(006) error is generated with the FAL number specified in the first two digits of C. If 00 is specified, however, an error will not be generated. 2. The logic diagnostic instructions are searched for the first OFF input condition and this condition’s bit address is output to the destination words beginning at D. 3. The CY Flag (SR 25504) is turned ON. An error processing program section can be executed using the CY Flag if desired. 4. If bit 15 of C is ON, a preset message with up to 8 ASCII characters will be displayed on the Programming Device along with the bit address mentioned in step 2. The function of the control data bits in C are shown in the following diagram. C: 15 14

08 07

Not used. Set to zero.

00 FAL number (2-digit BCD, 00 to 99)

Diagnostics output 0 (OFF): Bit address output (binary) 1 (ON): Bit address and message output (ASCII)

Logic Diagnostic Instructions If the time until the logic diagnostics condition goes ON exceeds T, the logic diagnostic instructions are searched for the OFF input condition. If more than one input condition is OFF, the input condition on the highest instruction line and nearest the left bus bar is selected. 00000

00002

00001

00003

Diagnostic output

When IR 00000 to IR 00003 are ON, the normally closed condition IR 00002 would be found as the cause of the diagnostic output not turning ON. Diagnostics Output

There are two ways to output the bit address of the OFF condition detected in the logic diagnostics condition. 1, 2, 3...

1. Bit address output (used when bit 15 of C is OFF).

349

Page 362

Section 5-26

Special Instructions

Bit 15 of D indicates whether or not bit address information is stored in D+1. If there is, bit 14 of D indicates whether the input condition is normally open or closed. D: 15 14 13

00

Not used. Input condition 0 (OFF): Normally open 1 (ON): Normally closed Bit address information 0 (OFF): Not recorded in D+1. 1 (ON): Recorded in D+1.

D+1 contains the bit address code of the input condition, as shown below. The word addresses, bit numbers, and TC numbers are in binary. Data area

D+1 bit status 15

14

13

12

11

10

09

IR, SR (see note c)

1

0

0

0

Word address

08

07

06

05

04

Bit number

03

02

01

1

0

1

0

Word address

Bit number

HR

1

0

0

1

1

Word address

Bit number

LR

1

0

0

1

0

0

Word address

Bit number

TC*

1

0

0

1

0

1

*

00

Timer or counter number

Note a) *For the TC area, bit 09 of D+1 indicates whether the number is a timer or counter. A 0 indicates a timer, and a 1 indicates a counter. b) The status of the leftmost bit of the bit number (bit 03) is reversed. c) Although the same word address designations are used for both ranges, bit 13 is turned OFF to indicate IR 00000 through SR 25515 and turned ON to indicate SR 25600 through IR 51115 Example: If D + 1 contains 1000 0110 0100 1000, IR 10000 would be indicated as follows: 1000 0110 0100 1000 IR

$64 = 100

Bit 00 (inverting status of bit 03)

2. Bit address and message output (used when bit 15 of C is ON). Bit 15 of D indicates whether or not there is bit address information stored in D+1 to D+3. If there is, bit 14 of D indicates whether the input condition is normally open or closed. Refer to the following table. Words D+5 to D+8 contain information in ASCII that are displayed on a Programming Device along with the bit address when FPD(269) is executed. Words D+5 to D+8 contain the message preset by the user as shown in the following table. Word

Bits 15 to 08

Bits 07 to 00

D+1

20 = space

First ASCII character of bit address

D+2

Second ASCII character of bit address

Third ASCII character of bit address

D+3

Fourth ASCII character of bit address

Fifth ASCII character of bit address

D+4

2D = “–”

“0”=normally open, “1”=normally closed

D+5

First ASCII character of message

Second ASCII character of message

D+6

Third ASCII character of message

Fourth ASCII character of message

D+7

Fifth ASCII character of message

Sixth ASCII character of message

D+8

Seventh ASCII character of message

Eighth ASCII character of message

Note If 8 characters are not needed in the message, input “0D” after the last character.

350

Page 363

Section 5-26

Special Instructions

Determining Monitoring Time The procedure below can be used to automatically set the monitoring time, T, under actual operating conditions when specifying a word operand for T. This operation cannot be used if a constant is set for T. 1, 2, 3...

Example

1. 2. 3. 4.

Switch the PC to MONITOR Mode operation. Connect a Programming Device, such as a Programming Console. Use the Programming Device to turn ON control bit AR 2508. Execute the program with AR 2508 turned ON. If the monitoring time currently in T is exceeded, 1.5 times the actual monitoring time will be stored in T. FAL(006) errors will not occur while AR 2508 is ON. 5. Turn OFF AR 2508 when an acceptable value has been stored in T. In the following example, the FPD(269) is set to display the bit address and message (“ABC”) when a monitoring time of 123.4 s is exceeded.

SR 25315 MOV(021)

Address

Instruction

00000 00001

LD MOV(021)

Operands

#4142 HR 15 SR 25315 MOV(021) #430D

00002 00003

HR 16

LD MOV(021)

LR 0000 FPD(269)

00004 00005

#8010 #1234

LD FPD(269)

HR 10 SR 25504 (CY Flag) INC(038) DM 0100 10000

00006 00007

AND INC(038)

00008 00009 00010 00011 00012 00013

LD OR LD NOT OR NOT AND LD OUT

10002 LR 0015

10001

10003

25315 #4142 HR 15 25315 #430D HR 16 LR 0000 #8010 #1234 HR 10 25504 DM 0100 10000 10001 10002 10003 LR 0015

FPD(269) is executed and begins monitoring when LR 0000 goes ON. If LR 0015 does not turn ON within 123.4 s and IR 10000 through IR 10003 are all ON, IR 10002 will be selected as the cause of the error, an FAL(006) error will be generated with an FAL number of 10, and the bit address and preset message (“10002–1ABC”) will be displayed on the Programming Device. HR 10 HR 11 HR 12 HR 13 HR 14 HR 15 HR 16 HR 17 HR 18

Flags

0000 0000 0000 0000 0000 4142 430D 0000 0000

HR 10 HR 11 HR 12 HR 13 HR 14 HR 15 HR 16 HR 17 HR 18

ER:

C000 2031 3030 3032 2D31 4142 430D 0000 0000

Indicates information, normally closed condition “1” “00” “02” “–1” “AB” “C”, and CR code The last two words are ignored. (Displayed as spaces.)

T is not BCD. C is not a constant or the rightmost two digits of C are not BCD 00 to 99.

351