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

The text of a manual · part 25 of 39

Series 90-30/20/Micro PLC CPU Instruction Set Reference Manual: Chapter 12 - Control Functions, pages 209 to 218

Pages 209 to 218 of 337, from Series 90-30/20/Micro PLC CPU Instruction Set Reference Manual

The original document is the PDF (4.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 GE Fanuc IC692CPU211D / IC692MDR541C, Fanuc IC692CPU211D / IC692MDR541C, GE IC692CPU211D / IC692MDR541C and GE Fanuc IC693CPU311X

Page 209

12

Example Sample Contents Table 12-2 summarizes the values contained in a single sample based upon the channel descriptions in the sample control block. This is based on the example screen capture shown on the following page. Note in this example that bits 1 – 16 are contained in %R00207 and bits 17 – 24 are part of %R00208. Table 12-2. Sample Contents for SER Example Channel Number

Channel Contents

Value

1

%I0001

1

2-4

Zeros

000

5

Input Module Point 13

1

6

Input Module Point 14

1

7

Input Module Point 15

1

8

%Q0009

0

9

%Q0010

0

10 - 17

Input Module Points 1 - 8

100100010

18 - 24

Zeros

0000000

Data Block for Control Block Example Table 12-3 lists the format of the data block resulting from the example control block given on page 12-19. Note that it begins at register 201 as described by the segment offset parameters (Words 12 and 13) in the control block. Table 12-3. Data Block for SER Control Block Example Offset

Register

0

%R0201

1

Parameter Description

Value (dec)

Value (hex)

Current sample offset #

59

003B

202

Trigger sample offset #

0

0000

2-5

203 – 206

Trigger time (BCD)

0 0 0 0

0000 0000 0000 0000

6 - 768

207 – 975

Sample Buffer sample data sample data

Current sample offset is 59, meaning that the 59th sample is the last sample placed in the sample buffer. With 3 bytes per sample, the current offset is actually at 59 * 3 = 177 bytes or the high byte of the 89th register. Since the trigger conditions have not been met, the trigger sample and trigger time are 0 and the output is not set. The sample buffer contains 512 samples where 59 is the newest sample and 60 is the oldest sample.

GFK-0467M

Chapter 12 Control Functions

12-21

Page 210

12 Example Data Capture Examining the Captured Data The following screen snap was taken after a trigger. The Control Block starts at %R00100, and the Data Area starts at %R00201. The cursor is positioned on %R00207 as noted near the top and bottom of the screen. %R00207 is the first register in the data block that actually holds the measured input data. Note that its integer value (-21855) has little meaning in this context; however, by placing your cursor on %R00207, its value is displayed in binary near the top of the screen. Using this binary format, you can determine the states of the bits configured in the Channel Descriptions portion of the control block. Registers %R00203 through %R00205 give the time and date, in 24-hour format, as 16:06 (and 57 seconds) on May 15, 2001. %R00207 Represented in Binary

%R00207 First Actual Data Register

12-22

%R00205 %R00204 Seconds and Hour and Minutes Day (SSMM) (HHDD)

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

%R00203 %R00202 Month and Trigger Year Sample Offset (MMYY) Number

%R00201 Current Sample Offset Number

GFK-0467M

Page 211

12

END The END function provides a temporary end of logic. The program executes from the first rung to either the last rung or to the END function, whichever is encountered first. The END function unconditionally terminates program execution. There can be nothing after the end function in the rung. No logic beyond the END function is executed, and control is transferred to the beginning of the program for the next sweep. Note that in rungs past the END marker, inputs will appear to turn on and off, but outputs will not be updated. Although a normal condition, this will appear to be a problem if it isn’t apparent that an END marker precedes the affected rungs. The END function is useful for debugging purposes because it allows you to isolate a section of logic. It does this by preventing any logic that follows it from being executed. Logicmaster programming software provides, by default, an [ END OF PROGRAM LOGIC ] marker after the last rung of logic to indicate the end of program execution. This marker is used if no END function is programmed in the logic. [ END ]

Example In the following example, the rung containing contact %I0222 and coil %Q0017, and any rungs after it, will not be executed because of the presence of the END instruction. %M0101

%M0100

[ END ] %Q0017

%I0222

Note Placing an END function in SFC logic or in logic called by SFC logic produces an “END Function Executed from SFC Action” fault in Release 7 or later CPUs. (In pre-Release 7 CPUs, it did not work correctly, but no Fault was generated.) For information about this fault, refer to the “System Configuration Mismatch” part of Chapter 3, Section 2.

GFK-0467M

Chapter 12 Control Functions

12-23

Page 212

12

MCRN/MCR Overview of MCR and MCRN A Master Control Relay (MCR/MCRN) function must be used with a corresponding End Master Control Relay (ENDMCR/ENDMCRN) function. Both functions must have the same name. The MCR/MCRN must have an enable contact between it and the power rail. All rungs between an enabled MCR/MCRN and its corresponding ENDMCR/ENDMCRN function are executed without power flow to coils. The ENDMCR/ENDMCRN function associated with the MCR/MCRN causes normal program execution to resume. Unlike the JUMP instruction, an MCR/MCRN can only occur in the forward direction. An ENDMCR/MCRN instruction must appear later in a program than its corresponding MCR/MCRN instruction. The following controls are imposed on logic controlled by an enabled MCR/MCRN: •

Timers do not increment or decrement. Any TMR type timer is reset (accumulator is set to zero). For an ONDTR timer, the accumulator is “frozen” at the value that was current when the MCR/MCRN was enabled.

•

Power flow does not occur for any instruction. Normal outputs are off; negated outputs are on.

•

Instructions do not update their outputs. For example, an ADD instruction will not produce a current sum in its Q output register, a Move will not copy its current input value to its output, a Shift Register will not shift data, etc. The values in these output registers will be frozen at the values that were present when the MCR/MCRN was enabled.

Note When an MCR/MCRN is energized, the logic it controls is evaluated and contact status is displayed, but no outputs are energized. If you are not aware that an MCR/MCRN is controlling the logic being observed, this might appear to be a faulty condition. To indicate that a range of ladder logic is under MCR/MCRN control, Logicmaster displays a double power rail on the ladder logic screen. This double power rail appears regardless of whether or not the MCR/MCRN is enabled. Logicmaster 90-30/20/Micro software supports two forms of the Master Control Relay function, an older, non-nested (MCR) and a newer, nested form (MCRN).

12-24

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 213

12

CPU Compatibility CPU Type CPU311 – CPU341, Release 1

Supported Form Use only the non-nested form (MCR)

CPU311 – CPU341, Release 2 and later

Use only the nested form (MCRN)

35x, 36x, and 37x series CPUs

Use only the nested form (MCRN)

Possible MCRN Compatibility Problem When converting a CPU340 or CPU341 program to run in a 35x/36x/37x series CPU, it is possible to see a “Feature not Supported” error (“Nesting Levels Exceeded”) from Logicmaster 90. This would occur when the converted program is stored to a 35x/36x/37x CPU if more than eight levels of MCRN nesting is used in the original program. The MCRN instructions are actually function block instructions in the CPU340/341, which means they are executed in CPU firmware and not executed by the embedded Boolean Coprocessor (BCP). The nesting limit for the function block was set to 256. This limit is many more levels than you would generally use. When the 35x/36x/37x CPU series was designed, the MCRN instructions were moved to the BCP to improve CPU performance (function block instructions execute slower than BCP counterparts). At that time a tradeoff of nesting levels and performance was made and the BCP3 used in 35x/36x/37x CPUs implemented eight levels of nesting, which are normally more than users require. So, Logicmaster 90 enforces eight levels of nesting when the program conversion is performed, and if there are more than eight levels used, a “Nesting Levels Exceeded” message is issued. Therefore, if you have more than eight MCR nesting levels in a CPU340/341 program, it will require a modification to work in a 35x/36x/37x CPU. You might consider using Jump statements instead.

Nesting an MCRN An MCRN function can be placed anywhere within a program, as long as it is properly nested with respect to other MCRNs, and does not occur in the range of any non-nested MCR or non-nested JUMP. If an MCRN/ENDMCRN pair is nested within another MCRN/ENDMCRN pair, it must be contained completely within the other pair. Up to eight levels of nesting are allowed. For an example, see page 12-28. There can be multiple MCRN functions corresponding to a single ENDMCRN (except for the 35x/36x/37x series CPUs as noted below). Each MCRN as well as the ENDMCRN must have the same name. This is analogous to the nested JUMP, where you can have multiple JUMPs to the same LABEL. For a comparison of the JUMP function and the MCR function, refer to the “Differences Between MCRs and Jumps” section below.

Note Use only one MCRN for each ENDMCRN with 35x, 36x and 37x series CPUs.

GFK-0467M

Chapter 12 Control Functions

12-25

Page 214

12 MCR Operation There can be only one MCR instruction for each ENDMCR instruction. The range for non-nested MCRs and ENDMCRs cannot overlap or contain the range of any other MCR/ENDMCR pair or any JUMP/LABEL pair of instructions. Non-nested MCRs cannot be within the scope of any JUMP/LABEL pair.

Parameters Both forms of the MCR function have the same parameters. They both have an enable Boolean input EN and a name that identifies the MCR. This name is used again with an ENDMCR instruction. Neither the MCR nor the MCRN function has any outputs; there can be nothing after an MCR in a rung. ??????? [ MCR ] *[

12-26

??????? or

-[ *[ MCRN] MCRN]

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 215

12

Differences Between MCR/MCRN and JUMP With an MCR function, function blocks within the scope of the MCRN are evaluated without power flow, and coils are not energized. In the following example, when %M0150 is ON, the MCRN is enabled. When the MCRN is enabled, even if %I004 is ON, the ADD function block is evaluated without power flow (i.e., it does not add 100 to %R0001), and %M0210 does not receive power flow. Status of contacts such as %I0004 and values in registers used on inputs, such as %R0001, will update on the Logicmaster screen, but registers on outputs under control of the MCRN, such as %R0010, will be frozen at their current values when the MCRN is enabled.

%M0150

OPTION [ MCRN ]

%I0004

%M0210 ADD INT

%R0001 +13069

I1

CONST +00100

I2

Q

%R0010 +00878

OPTION [ ENDMCRN ]

With a JUMP function, any function blocks between the JUMP and the LABEL are not evaluated, and coils are not affected. In the following example, when %I0001 is ON, the JUMP named TEST1 is enabled. Since the logic between the JUMP and the LABEL is skipped, %M0210 is unaffected (i.e., if it was ON, it remains ON; if it was OFF, it remains OFF). Status of contacts such as %M0004 and values in registers used on inputs, such as %R0001, will update on the Logicmaster screen, but registers on outputs under control of the JUMP, such as %R0010, will be frozen at their current values when the JUMP is enabled.

%I0001 N %M0004

TEST1 %M0210

ADD INT

%R0001 +13069

I1

CONST +00100

I2

Q

%R0010 +00878

TEST1 :

GFK-0467M

Chapter 12 Control Functions

12-27

Page 216

12

Example 1 The following example shows an MCRN named “Second” nested inside the MCRN named “First.” Whenever %I0002 allows power flow into the MCRN function, program execution will continue without power flow to the coils until the associated ENDMCRN is reached. If %I0001 and %I0003 are ON, %Q0001 is turned OFF and %Q0003 remains ON. To aid in troubleshooting ladder programs, a double power rail identifies logic that is within the control range of an MCR.

| |%I0002 FIRST | - - | | - - - [ MCRN ] | || || ||%I0004 SECOND || - - | | - - - [ MCRN ] || || || ||%I0001 %Q0001 || - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - || || || ||%I0003 %Q0003 || - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (S) - || || || SECOND |+[ ENDMCRN ] || || || | FIRST +[ ENDMCRN ] |

12-28

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M

Page 217

12 Example 2 In the following example, the first rung is functioning normally. However, the MCRN named SKIP is controlling the rest of the rungs, which have a double power bar to indicate this. In the first rung controlled by the MCRN, the ONDTR timer’s accumulated value (%R0004) is frozen, and even though it reached its preset value, its output (%M0200) is not energized. In the following rung, the TMR has been reset by the MCRN. Its accumulated value (%R0007) is held at zero and its output (%M02025) is not energized. In the next rung, the ADD instruction’s output is frozen (its output at %R0010 is not the sum of its inputs) and its power flow coil (%M0210) is not energized. Note, however, that the status of contacts and values of input registers (such as %R0001 on the ADD instruction I1 input) are updated on-screen within the MCRN control area. %I0001

%M0100 ONDTR 0.10s

%M0001

R

CONST +12000

PV

%R0001 +13069 %M0150

SKIP [ MCRN ]

%I0002

%M0001

%M0200 ONDTR 0.10s R

CONST +12000

PV

%R0004 +12131 %I0003

%M0205 TMR 0.10s

%M0001 R

CONST +12000

PV

%R0007 +00000 %I0004

%M0210 ADD INT

%R0001 +13069

I1

CONST +00100

I2

Q

%R0010 +00878

SKIP [ ENDMCRN ]

GFK-0467M

Chapter 12 Control Functions

12-29

Page 218

12

ENDMCRN/ENDMCR Use the End Master Control Relay ENDMCR/ENDMCRN function to resume normal program execution after an MCR/MCRN function. When the MCR associated with the ENDMCR is active, the ENDMCR causes program execution to resume with normal power flow. When the MCR associated with the ENDMCR is not active, the ENDMCR has no effect. Logicmaster 90-30/20/Micro software supports two forms of the ENDMCR function, a non-nested and a nested form. The non-nested form, ENDMCR, must be used with the non-nested MCR function, MCR. The nested form, ENDMCR, must be used with the nested MCR function, MCRN. The ENDMCR function has a negated Boolean input EN. The instruction enable must be provided by the power rail; execution cannot be conditional. The ENDMCR function also has a name, which identifies the ENDMCR and associates it with the corresponding MCR(s). The ENDMCR function has no outputs; there can be nothing before or after an ENDMCR instruction in a rung.

??????? -[ ENDMCR

] or

??????? -[ ENDMCRN

]

Example In the following examples, an ENDMCR instruction is programmed to terminate the MCR named “CLEAR.” Example of a non-nested ENDMCR

| | CLEAR | |-[ ENDMCR |

]

Example of a nested ENDMCR:

| | CLEAR | |-[ ENDMCRN |

12-30

]

Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002

GFK-0467M