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

The text of a manual · part 23 of 39

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

Pages 189 to 198 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 189

Chapter

Control Functions

12 This chapter describes the control functions, which can be used to limit program execution and alter the way the CPU executes the application program. Refer to Chapter 2, section 1, “PLC Sweep Summary,” for information on the CPU sweep. Function

Description

Page

CALL

Causes program execution to go to a specified subroutine block.

12-2

DOIO

For one sweep, immediately services a specified range of inputs or outputs. (All inputs or outputs on a module are serviced if any reference locations on that module are included in the DO I/O function. Partial I/O module updates are not performed.) Optionally, a copy of the scanned I/O can be placed in internal memory, rather than the real input points.

12-3

SER

Sequential Event Recorder - collects a series of samples. A function control block contains usersupplied configuration of function block execution, sample configuration and operation parameters.

12-8

END

Provides a temporary end of logic. The program executes from the first rung to either the last rung or the END instruction, whichever is encountered first. This instruction is useful for debugging purposes, but it is not permitted in SFC programming (refer to the Note on page 12-8).

12-23

MCR and MCRN

Programs a Master Control Relay. An MCR causes all rungs between the MCR and its subsequent ENDMCR to be executed without power flow. Logicmaster 90-30/20/Micro software supports two forms of the MCR function, a nested form (MCRN) and a non-nested form (MCR).

12-24

ENDMCR and ENDMCRN

Indicates that the subsequent logic is to be executed with normal power flow. Logicmaster 9030/20/Micro software supports two forms of the ENDMCR function, a nested form (ENDMCRN) and a non-nested form (ENDMCR).

12-30

JUMP and JUMPN

Causes program execution to jump to a specified location (indicated by a LABEL, see below) in the logic. Logicmaster 90-30/20/Micro software supports two forms of the JUMP function, a non-nested form (JUMP) and a nested form (JUMPN).

12-31

LABEL and LABELN

Specifies the target location of a JUMP instruction. Logicmaster 90-30/20/Micro software supports two forms of the LABEL function, a non-nested form (LABEL) and a nested form (LABELN).

12-33

COMMENT

Places a comment (rung explanation) in the program. After programming the instruction, the text can be typed in by “zooming” into the instruction (use F10 key to zoom).

12-34

SVCREQ

Requests a special PLC service. (See list of service requests on page 12-35.)

12-35

Provides two PID (proportional/integral/derivative) closed-loop control algorithms: • Standard ISA PID algorithm (PIDISA). • Independent term algorithm (PIDIND).

12-70

PID

GFK-0467M

12-1

Page 190

12

CALL Use the CALL function to cause program execution to go to a specified subroutine block., - - - - - - - - - - - - - - - | | -| CALL ??????? || | | (SUBROUTINE) | | |, - - - - - - - - - - - - - - - When the CALL function receives power flow, it causes the scan to go immediately to the designated subroutine block and execute it. After the subroutine block execution is complete, control returns to the rung in the logic immediately following the CALL instruction.

Example In the following example, the CALL instruction is programmed to call the subroutine named ROTATE when contact %I0006 is on. (Note that before you can enter a subroutine name in a CALL instruction, the subroutine name must already exist in the Block Declarations table.) By positioning the cursor within the CALL instruction, you can press F10 to zoom into the subroutine to view the subroutine logic. Once a subroutine is called, program execution will branch to the subroutine, which will execute to completion, then pass program execution over to the rung following the calling rung. In the example below, the subroutine is called from the second rung, so when the subroutine finishes executing, the program scan will resume with the third rung.

| |%I0004 %T0001 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | |, - - - - - - - - - - - - - - - | | | |%I0006 | CALL ROTATE || - - | | - - - - - - - | (SUBROUTINE) | | | | | | | |, - - - - - - - - - - - - - - - | |%I0003 %I0010 %Q0010 | - - | | - - + - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | |%I0001 | | - - | | - - + |

Note Micro PLCs do not accommodate subroutines; therefore, the CALL function is inappropriate for use with a Micro PLC.

12-2

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

GFK-0467M

Page 191

12

DOIO The DO I/O (DOIO) function is used to update specified inputs or outputs for one scan while the program is running. The DOIO function can also be used to update selected I/O during the program in addition to the normal I/O scan. Under normal circumstances, the input tables are updated during the input scan portion of the PLC sweep and will not be updated again until the next sweep. The output tables are updated during the logic solution portion of the PLC sweep, but the output modules are not updated until the logic solution portion is finished. With the DO I/O function, updates of the input tables and output modules can be forced during the logic solution portion of the scan. This capability allows you to read input changes and write to outputs more quickly than is possible with the normal PLC scan. Refer to Chapter 2 for more information about the PLC sweep. If input references are specified, the function allows the most recent values of inputs to be obtained (written to the input tables) for program logic. If output references are specified, DO I/O updates output modules based on the most current values stored in I/O memory. I/O is serviced in increments of entire I/O modules; the PLC adjusts the references, if necessary, while the function executes. Use with Input Modules The DOIO function has four input parameters and one output parameter. When the function receives power flow and input references are specified, the input points at the starting reference (ST) and ending at END are scanned. If a reference is specified for ALT, a copy of the new input values is placed in memory, beginning at that reference, and the applicable input table is not updated. ALT must be the same size as the reference type scanned. If a discrete reference is used for ST and END, then ALT must also be discrete. If no reference is specified for ALT, the applicable input table is updated. Use with Output Modules When the DOIO function receives power flow and output references are specified, the output points at the starting reference (ST) and ending at END are written to the output modules. If outputs should be written to the output modules from internal memory, other than %Q or %AQ, the beginning reference can be specified for ALT. The range of outputs written to the output modules is specified by the starting reference (ST) and the ending reference (END). Execution of the function continues until either all inputs in the selected range have reported, or all outputs have been serviced on the I/O modules. Program execution then returns to the next function following the DO I/O. Use with Option Modules If the range of references includes an option module (HSC, APM, etc.), then all of the input data (%I and %AI) or all of the output data (%Q and %AQ) for that module will be scanned. The ALT parameter is ignored while scanning option modules. Also, if it is desired to use the DOIO with an Enhanced GCM module (IC693CMM302), the requirement in the following note must be met.

Note The DOIO function can only be used with an Enhanced GCM module (IC693CMM302) in systems with Release 9.0 and later CPUs.

GFK-0467M

Chapter 12 Control Functions

12-3

Page 192

12 The function passes power to the right whenever power is received, unless: •

Not all references of the type specified are present within the selected range.

•

The CPU is not able to properly handle the temporary list of I/O created by the function.

•

The range specified includes I/O modules that are associated with a “Loss of I/O” fault. _____ | | (enable), |DO_IO| - (ok) | | | | | | (starting address), |ST | | | | | (ending address) -|END | | | | |, |ALT | |_____|

Parameters Parameter

Description enable

When the enable input is on, a limited input or output scan is performed.

ST

ST is the starting address of a group of input or output points or words to be serviced.

END

END is the ending address of the group of input or output points or words to be serviced.

ALT

For the input scan, ALT specifies the address to store scanned input point/word values. For the output scan, ALT specifies the address to get output point/word values from to send to the I/O modules. For Model 331 and later CPUs, the ALT parameter can have an effect on speed of DOIO function block execution (see Note below and the section on the enhanced DO I/O function for 331 and later CPUs later in this chapter). If the ALT function is not used, this input should be left blank; if a constant value of 0 is programmed for ALT, the CPU may experience Watchdog Timeout Errors.

ok

The ok output is energized when the input or output scan completes normally.

Note An Enhanced DOIO function is available for Model 331 and later CPUs. In the Enhanced DOIO, the ALT parameter can be used to enter the slot number of a single discrete input or output module in the main rack. This Enhanced DOIO function will execute in 80 microseconds instead of the 236 microseconds required when the DOIO is programmed without the ALT parameter. No error checking is performed to prevent overlapping reference addresses or module type mismatches. See the “Enhanced DO I/O Function” section later in this chapter for details.

Valid Memory Types Parameter flow enable ST END

•

ALT ok •

12-4

%I

%Q

• •

• •

•

•

%M

•

%T

%S

•

%G

•

%R

•

%AI

%AQ

• •

• •

•

•

• const none

• •

Valid reference or place where power can flow through the function.

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

GFK-0467M

Page 193

12

Input Example 1 In the following example, when enabling input %M0001 turns ON, references %I0001 (specified at ST) through %I0064 (specified at END) are scanned and %Q0001 is turned on. A copy of the scanned inputs is placed in internal memory from reference %M0001 (specified at ALT) through %M0064. Because an alternate location was specified at ALT, the %I input table is not updated by the DO_IO. This form of the function can be used to compare the current values of input points with their previous values (i.e. their values at the beginning of the logic solution scan). | | _____ |%M0001 | | %Q0001 | - - | | - - - |DO_IO| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( )| | | | | | |%I0001 -|ST | | | | | | | |%I0064 -|END | | | | | | | |%M0001, |ALT | | |_____| |

Input Example 2 In the following example, when enabling input %M0001 is ON, references %I0001 (specified at ST) through %I0064 (specified at END) are scanned and %Q0001 is turned on. Since no alternate memory location is specified at ALT, the scanned input values are used by the DO_IO to update the input table from reference %I0001 to %I0064. This form of the function allows input points to be scanned and updated one or more times during the logic solution portion of the CPU sweep. Note that when the ALT input is not used, it should be left blank as shown. Do not place a zero on the ALT input because that will cause Watchdog Timer faults.

| | _____ |%M0001 | | %Q0001 | - - | | - - - |DO_IO| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( )| | | | | | |%I0001 -|ST | | | | | | | |%I0064 -|END | | | | | | | |, |ALT | | |_____| |

GFK-0467M

Chapter 12 Control Functions

12-5

Page 194

12

Output Example 1 In the following example, when enabling input %M0001 is ON, the values of analog output channels %AQ001 (specified at ST) through %AQ004 (specified at END) are written to references %R0001 (specified at ALT) through %R0004 respectively, and %Q0001 is turned on. Because the %R0001 alternate location was specified at ALT, the values at %AQ001 through %AQ004 are not written to the analog output modules by the DO_IO.

| | _____ |%M0001 | | %Q0001 | - - | | - - - |DO_IO| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( )| | | | | | |%AQ001 -|ST | | | | | | | |%AQ004 -|END | | | | | | | |%R0001, |ALT | | |_____| |

Output Example 2 In the following example, when the enabling input %M0001 is ON, the values at references %AQ001 through %AQ004 are written to analog output channels %AQ001 through %AQ004 on the applicable analog output modules, and %Q0001 is turned on. The DO_IO updates the analog output modules because no alternate memory location is specified at ALT. Note that when the ALT input is not used, it should be left blank as shown. Do not place a zero on the ALT input because that will cause Watchdog Timer faults.

| | _____ |%M0001 | | %Q0001 | - - | | - - - |DO_IO| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( )| | | | | | |%AQ001 -|ST | | | | | | | |%AQ004 -|END | | | | | | | |, |ALT | | |_____| |

12-6

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

GFK-0467M

Page 195

12

Enhanced DO I/O Function for 331 and Later CPUs Caution Programs containing an Enhanced DO I/O should not be loaded by a version of Logicmaster 90-30/20 software earlier than 4.01. An enhanced version of the DO I/O (DOIO) function is available for Release 4.20 or later, of Models 331 and later CPUs. This enhanced version of the DOIO function can only be used on a single discrete input or discrete output 8-point, 16-point, or 32-point module. The ALT parameter identifies the slot in the main rack of the target module. For example, a constant value of 2 at ALT indicates that the module in slot 2 is targeted. The ST and END parameters set the range of memory to be acted upon.

Note The only checking associated with the enhanced DOIO function block is a basic check of the target module’s condition. The enhanced DOIO function only applies to modules located in a modular CPU rack. Therefore, the ALT parameter must be between 2 and 5 for a 5-slot rack or 2 and 10 for a 10-slot rack. The start (ST) and end (END) references must be either %I or %Q. These references specify the first and last reference the module is configured for. For example, if a 16-point input module is configured at %I0001 through %I0016 in slot 7 of a 10-slot main (CPU) rack, the ST parameter must be %I0001, the END parameter must be %I0016, and the ALT parameter must be 10, as shown below: | | _____ |%M0001 | | %Q0001 | - - | | - - - |DO_IO| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( )| | | | | | |%I0001 -|ST | | | | | | | |%I0016 -|END | | | | | | | | 7, |ALT | | |_____| |

The following table compares the execution times of a normal DOIO function block for an 8-point, 16-point, or 32-point discrete input/output module with those of an enhanced DOIO function block. Normal DOIO Execution Time

Enhanced DOIO Execution Time

8-Pt Discrete Input Module 8-Pt Discrete Output Module

224 microseconds 208 microseconds

67 microseconds 48 microseconds

16-Pt Discrete Input Module 16-Pt Discrete Output Module

224 microseconds 211 microseconds

68 microseconds 47 microseconds

32-Pt Discrete Input Module 32-Pt Discrete Output Module

247 microseconds 226 microseconds

91 microseconds 50 microseconds

Module

GFK-0467M

Chapter 12 Control Functions

12-7

Page 196

12

SER (Sequential Event Recorder) Requires CPUs 35x or 36x with Firmware 9.00 or later, or CPU37x •

The SER (Sequential Event Recorder) function block collects a series of discrete samples (it only works with discrete data). An SER function block collects up to 32 contiguous or noncontiguous bits per sample when the Enable input receives power flow.

•

Each SER can capture up to 1024 samples, with up to 32 bits per sample.

•

If the SER function block is embedded in a periodic subroutine, sampling rate is based on the periodic subroutine execution rate.

•

Only the trigger sample is time stamped. The trigger sample can be time-stamped in BCD (maximum resolution is 1second) or POSIX format (maximum resolution is 10ms). The time stamp is only placed once at the trigger point. The SER does not support more than one time stamp per recording.

•

The SER can be configured for pre-, mid-, or post-trigger modes. (See page 12-14.)

•

SER operation is configured by a function control block that you can create using a series of Block Move (BLKMV) commands. (See page 12-10.)

•

An input module may be optionally specified that will be scanned each time the SER executes. This helps ensure that the data captured from the specified module is as up-to-date as possible.

Note PLC-to-PLC synchronization is not supported. The SER function block has one output and three inputs: enable, reset (R), and trigger (T). | _____ |%T0003 | | %M0003 | - - | | - - - | SER_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | | | | | |%T0001 | | | - - | | - - - |R | | | | |%T0002 | | | - - | | - - - |T | | |_____| | | %R0100

As shown below, 8, 16, 24, or 32 channels may be configured, with each channel representing a discrete point. Also, up to 1024 samples may be specified. Channels (up to 32 bits) 32 1

1 xxxxxxxx xxxxxxxx

2 3

1024

12-8 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx

. . . xxxxxxxx xxxxxxxx

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

GFK-0467M

Page 197

12 Parameters Parameter

Description enable

Whenever the function is enabled and the reset input is off, the SER function block collects one sample from all configured channels. When the reset input receives power flow, the SER function is reset regardless of the state of the enable input. Sample Buffer, Trigger Sample Offset, Trigger Time, and Current Sample Offset are all cleared to zero. The function block remains in the reset state until power flow is removed from the reset input. The OK output is turned off while in the reset state. When the power flow is removed from the reset input, sampling resumes. If the Trigger Input mode is selected and the function block is enabled, when the trigger input goes on, the SER to transition to the triggered state. The Trigger Time, Trigger Sample Offset, and a data sample are recorded. The trigger sample will be recorded regardless of the number of samples taken. Once triggered, the event recorder continues sampling until the Number of Samples After Trigger is satisfied, at which time it stops collecting samples until power flow is seen on the reset input. If Trigger Mode is set to Full Buffer, the trigger signal is ignored. For information on configuring Trigger Mode, see “Function Control Block” on page 12-10. The 78-word function control block array begins at this reference. The function control block defines function block execution, sample configuration, and operation parameters. For details, see “Function Control Bloc” on page 12-10 The ok output is energized when the trigger conditions are satisfied (specified by the Trigger Mode parameter), and all sampling is complete. The output continues to receive power flow regardless of the state of the enable input until the reset receives power flow.

R

T

Starting Reference ok

Valid Memory Types Parameter flow enable

•

%I

%Q

%M

%T

%S

Control Block

•

GFK-0467M

%G

%R

%AI

%AQ const none

•

R

•

T

• ok

•

•

Valid reference or place where power can flow through the function.

Chapter 12 Control Functions

12-9

Page 198

12

Function Control Block The function control block is a 78-word array that defines information about the data capture and trigger mechanism for the SER function. In a particular program, only one Sequential Event Recorder function block can be associated with each function command block and data block. Perform the following steps to configure parameters for the SER function block: 1.

Set up the stored values for the array as defined in the table below. You can use block moves to initialize the registers, or initialize the data in the register table and store the table before activating the SER function.

2.

Add the SER function block to your ladder logic.

Note If you require x channels where x is not equal to 8, 16, 24, but is less than 32, you must select a number of channels which is greater than x and a multiple of 8, and fill in a null channel description for the unused channels. A null channel description has a segment selector of 0xFFh, a length parameter equal to the number of unused channels, and a 0 offset.

Word

12-10

Parameter

Description

0 (starting reference)

Status

Read only variable that indicates the current state of the SER function block. Additional information is provided in Status Extra Data, (Word 1). Note: If an error is detected in the Control Block, the status will be set to 6, the OK output will be cleared, and no action will occur. Settings for Status include: 0 = Reset 1 = Inactive 2 = Active 3 = Triggered 4 = Complete 5 = Overrun Error 6 = Parameter error

1

Status Extra Data

A read-only variable that provides additional state information about the SER function. See “Status Extra Data States” on page 12-12 for settings for this parameter.

2

Trigger Mode

Defines conditions for the SER function block to transition to the triggered state. Valid settings are: 0 = Trigger Input mode 1 = Full Buffer mode In Trigger Input mode, if the function block is enabled, a time stamp is generated when the Trigger signal is activated. Sampling continues until the Number of Samples After Trigger value has been satisfied. When this occurs, the OK output is activated. In Full Buffer mode, the Trigger signal is ignored. When the function block is enabled, sampling continues until the sample buffer is filled. When this happens the OK output is activated. The Number of Samples parameter sets buffer size.

3

Trigger Time Format

Determines how the Trigger Time will be displayed. For BCD display, set this parameter to 0. For POSIX display, set this parameter to 1. (For details, see page 12-17.)

4 - 7

Reserved

Words 4 through 7 are reserved and should be set to zero.

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

GFK-0467M