The text of a manual · part 26 of 39
Series 90-30/20/Micro PLC CPU Instruction Set Reference Manual: Chapter 12 - Control Functions, pages 219 to 228
Pages 219 to 228 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 219
12
JUMP Use the JUMP instruction to cause a portion of the program logic to be bypassed. Program execution will continue at the LABEL specified. When the JUMP is active, all coils within its scope are left at their previous states. This includes coils associated with timers, counters, latches, and relays. Logicmaster 90-30/20/Micro software supports two forms of the JUMP instruction, a non-nested and a nested form. The non-nested form has been available since Release 1 firmware for the CPU311-CPU341 CPUs, and has the form, - - - - - >>LABEL01, where LABEL01 is the name of the corresponding non-nested LABEL instruction. For non-nested JUMPs, there can be only a single JUMP instruction for each LABEL instruction. The JUMP can be either a forward or a backward JUMP. The range for non-nested JUMPs and LABELs cannot overlap the range of any other JUMP/LABEL pair or any MCR/ENDMCR pair of instructions. Non-nested JUMPs and their corresponding LABELs cannot be within the scope of any other JUMP/LABEL pair or any MCR/ENDMCR pair. In addition, an MCR/ENDMCR pair or another JUMP/LABEL pair cannot be within the scope of a non-nested JUMP/LABEL pair.
Note The non-nested form of the JUMP instruction is the only JUMP instruction that can be used in a Release 1 Series 90-30 PLC. The nested JUMP function can be used (and is suggested for use) for all new applications. Also, please note that the 35x/36x/37x series CPUs support only nested jumps. The nested form of the JUMP instruction has the form, - - N - - >>LABEL01, where LABEL01 is the name of the JUMP and its corresponding nested LABEL instruction. The nested JUMP is available in Release 2 and later releases of Logicmaster 90-30/20/Micro software and PLC firmware. A nested JUMP instruction can be placed anywhere within a program, as long as it does not occur in the range of any non-nested MCR or non-nested JUMP. There can be multiple nested JUMP instructions corresponding to a single nested LABEL. Nested JUMPs can be either forward or backward JUMPs. Both forms of the JUMP instruction are always placed in columns 9 and 10 of the current rung line; there can be nothing after the JUMP instruction in the rung. Power flow jumps directly from the instruction to the rung with the named label.
GFK-0467M
Chapter 12 Control Functions
12-31
Page 220
12 Non-nested JUMP:, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> ???????
Nested JUMP:, - - - - - - - - - - - - - - - - - - - - - - - - - N - - - - - >> ???????
Caution To avoid creating an endless loop with backward JUMP instructions, a backward JUMP must contain a way to make it conditional.
Examples In the following example, whenever contact %I0001 turns on, the JUMP named TEST1 is enabled, and power flow is jumped ahead to the TEST1 LABEL. 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. Note the use of the double power rail in the section of logic located between the JUMP and its LABEL.
%I0001 N %M0004
TEST1 %M0210
ADD INT
%R0001 +13069
I1
CONST +00100
I2
Q
%R0010 +00878
TEST1 :
12-32
Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002
GFK-0467M
Page 221
12
LABEL The LABEL instruction functions as the target destination of a JUMP. Use the LABEL instruction to resume normal program execution after a JUMP instruction. There can be only one LABEL with a particular label name in a program. Programs without a matched JUMP/LABEL pair can be created and stored to the PLC, but cannot be executed. Logicmaster 90-30/20/Micro software supports two forms of the LABEL function, a non-nested and a nested form. For example, the non-nested form, LABEL01 :, must be used with the nonnested JUMP function,, - - - - - >>LABEL01; the nested form, LABEL01 : (nested), must be used with the nested JUMP function,, - - N - - >>LABEL01. The LABEL instruction has no inputs and no outputs. Also, there can be nothing either before or after a LABEL in a rung. Non-nested LABEL:
???????:
Nested LABEL:
???????: ???????: (nested) (nested)
Example In the following example, when JUMP TEST1 is enabled, the scan skips ahead to the TEST1 : (nested) LABEL, which means that the rung in-between the JUMP and LABEL is not scanned.
%I0001 N %M0004
TEST1 %M0210
ADD INT
%R0001 +13069
I1
CONST +00100
I2
Q
%R0010 +00878
TEST1 : (nested)
GFK-0467M
Chapter 12 Control Functions
12-33
Page 222
12
COMMENT Comments are useful for adding explanations, notes, revision level information, etc. to your ladder program. Use of comments is highly recommended because they provide valuable information to those who may have to troubleshoot or update the system in the future. Also, since human memories are imperfect, comments are valuable references for even the creator of the ladder program.
Note To conserve PLC memory, annotations (comments, nicknames, and descriptions) are not written to the PLC. Therefore, to view these annotations, you must have a copy of the original program folder (which includes the annotations) on your computer. Then, when you connect your computer to the PLC, the links to the annotations will automatically be made by your programming software.
Creating a Standard Comment A comment can have up to 2048 characters of text. In Logicmaster, it is represented in the ladder logic like this: (*
COMMENT
*)
Creating a Comment 1. Create a new rung. A COMMENT rung cannot have any other logic besides the COMMENT instruction. 2. Insert the COMMENT, which is found in the Control group of instructions. 3. Accept the rung by pressing the Escape key. 4. Move the cursor over the (* COMMENT *) instruction just created and press the Zoom key (F10) to enter the comment editor screen. 5. Type in your comment text. Note that the lines do not automatically wrap in the comment editor. You must press the Enter key at the end of a line to begin typing on the next line. 6. When finished, press Escape key to exit the comment editor and save the comment. Once created, COMMENT text can be read or edited by moving the cursor to (* COMMENT *) and selecting Zoom (F10). Rung Comments can also be printed from Logicmaster’s Print menu.
Creating a Long Comment for use in Logicmaster Printouts In Logicmaster longer text can be included in printouts using an annotation text file: 1.
Create the comment (see previous section for comment creation details): A. Enter comment text to the point where the text from the other file should begin. B. On a new line, enter \I (or \i), the drive letter followed by a colon, a backslash, the subdirectory or folder, a backslash, and the file name, as shown in this example: \I d:\text\commnt1
(Drive designation is not necessary if the file is on the same drive as the program folder.) C. Press Escape to exit the comment editor and save the comment text.
12-34
2.
Open a text processor and create a text file.
3.
Save the text file in a .txt format, giving it the file name entered in the comment, and saving it on the drive and in the path specified in the comment.
Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002
GFK-0467M
Page 223
12
SVCREQ The Service Request instruction is a general purpose instruction that can perform a wide variety of special instructions (services) that are not available as individual function blocks. Use the Service Request (SVCREQ) function to request one of the following special PLC services: Table 12-4. Service Request Functions Function
GFK-0467M
Description
1
Change/Read Constant Sweep Timer.
2
Read Window Values.
3
Change Programmer Communications Window Mode and Timer Value.
4
Change System Comm. Window Mode and Timer Value.
6
Change/Read Checksum Task State and Number of Words to Checksum.
7
Change/Read Time-of-Day Clock.
8
Reset Watchdog Timer.
9
Read Sweep Time from Beginning of Sweep.
10
Read Folder Name.
11
Read PLC ID.
12
Read PLC Run State.
13
Shut Down the PLC.
14
Clear Fault Tables.
15
Read Last-Logged Fault Table Entry.
16
Read Elapsed Time Clock.
18
Read I/O Override Status.
23
Read Master Checksum.
24
Reset Smart Module
26/30
Interrogate I/O.
29
Read Elapsed Power Down Time.
45
Skip Next Output and Input Scan. (Suspend I/O.)
46
Access Fast Backplane Status.
48
Reboot After Fatal Fault Auto Reset
49
Auto Reset Statistics
Chapter 12 Control Functions
12-35
Page 224
12
SVC REQ Overview The SVCREQ function has three input parameters and one output parameter. When the SVCREQ receives power flow, the PLC is requested to perform the function FNC indicated. Parameters for the function begin at the reference given for PARM. The SVCREQ function passes power flow unless an incorrect function number, incorrect parameters, or out-of-range references are specified. Additional causes for failure are described on the pages that follow. The reference given for PARM can represent any type of word memory (%R, %AI, or %AQ). This reference is the first of a group that make up the “parameter block” for the function. Successive 16-bit locations store additional parameters. The total number of references required will depend on the type of SVCREQ function being used. Parameter blocks can be used both as inputs for the function and as the location where data is output after the function executes. Therefore, data returned by the function is accessed at the same location specified for PARM. _____ | | (enable), | SVC_| - (ok) | | | REQ | | | (service number), |FNC | | | | | (beginning reference)-|PARM | | | |_____|
Parameters Parameter
Description enable
When enable is on, the service request is performed.
FNC
Each type of Service Request has a unique function number, which must be programmed at the FNC input. FNC may contain either a constant or a reference address that contains the function number of the requested service.
PARM
PARM contains the beginning reference for the parameter block for the requested service.
ok
The ok output is energized when the function is performed without error.
Valid Memory Types Parameter flow
%I
%Q
%M
%T enable
•
FNC
•
•
•
PARM
•
•
• ok •
12-36
%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 225
12 Example In the following example, when enable contact %I0001 is ON, SVCREQ function number 7, specified at input FNC, is performed. The function’s parameter block starts at %R0001 (specified at PARM). Output coil %Q0001 is set ON if the operation succeeds.
| _____ |%I0001 | | %Q0001 | - - | | - - - | SVC_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | | | | REQ | | | | | CONST, |FNC | | 00007 | | | | | | | | |%R0001, |PARM | | |_____| |
GFK-0467M
Chapter 12 Control Functions
12-37
Page 226
12
SVCREQ #1: Change/Read Constant Sweep Timer Beginning with 90-30 CPU Release 8.0, use SVCREQ function #1 to: •
Disable CONSTANT SWEEP mode.
•
Enable CONSTANT SWEEP mode and use the old timer value.
•
Enable CONSTANT SWEEP mode and use a new timer value.
•
Set a new timer value only.
•
Read CONSTANT SWEEP mode state and timer value.
Note Of the CPUs discussed in this manual, Service Request 1 is supported only by 9030 CPUs, beginning with Release 8.0. The parameter block has a length of two words. To disable CONSTANT SWEEP mode, enter SVCREQ function #1 with this parameter block: 0 address ignored address + 1
To enable CONSTANT SWEEP mode, enter SVCREQ function #1 with this parameter block: 1 address
0 or timer value address + 1
Note If the timer should use a new value, enter it in the second word. If the timer value should not be changed, enter 0 in the second word. If the timer value does not already exist, entering 0 will cause the function to set the OK output to OFF. To change the timer value without changing the selection for sweep mode state, enter SVCREQ function #1 with this parameter block: 2 new timer value address address + 1
To read the current timer state and value without changing either, enter SVCREQ function #1 with this parameter block: 3 ignored
12-38 address address + 1
Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002
GFK-0467M
Page 227
12 Note After using SVCREQ function #1 with the parameter block on the previous page, Release 8 and higher CPUs will provide the return values 0 for Normal Sweep, 1 for Constant Sweep. Do not confuse this with the input values shown below. Successful execution will occur, unless: 1. A number other than 0, 1, 2, or 3 is entered as the requested operation: 0
Disable CONSTANT SWEEP mode.
1
Enable CONSTANT SWEEP mode.
2
Set a new timer value only.
3
Read CONSTANT SWEEP mode and timer value. (See Note above).
2.
The time value is greater than 2550 ms (2.55 seconds).
3.
Constant sweep time is enabled with no timer value programmed, or with an old value of 0 for the timer.
After the function executes, the function returns the timer state and value in the same parameter block references: 0 = Disabled address
1 = enabled current timer value address + 1
If word address + 1 contains the hexadecimal value FFFF, no timer value has ever been programmed.
GFK-0467M
Chapter 12 Control Functions
12-39
Page 228
12
Example This example shows logic in a program block. When enabling contact OV_SWP is set, the constant sweep timer is read, the timer is increased by two milliseconds, and the new timer value is sent back to the PLC. The parameter block is in local memory at location %R3050. Because the MOVE and ADD functions require three horizontal contact positions, the example logic uses discrete internal coil %M0001 as a temporary location to hold the successful result of the first rung line. On any sweep in which OV_SWP is not set, %M0001 is turned off. | _____ _____ _____ |OV_SWP | | | | | | %M0001 | - - | | - - - |MOVE_| - - - - - - - - - - - - - - - - - | SVC_| - - - - - - - - - - | ADD_| - - - - - - - - - - - - - - - - - - ( ) - | | WORD| | REQ | | INT | | | | | | | | | CONST, |IN Q| - %R3050 CONST, |FNC | %R3051 - |I1 Q| - %R3051 | 0003 | LEN | 0001 | | | | | | 0001| | | | | | |_____| %R3050 - |PARM | CONST, |I2 | | |_____| 0002 |_____| | _____ _____ | M0001 | | | | | - - | | - - - |MOVE_| - - - - - - - - - - - - - - - - - |SVC_ | - | |WORD | | REQ | | | | | | | CONST, |IN Q| - %R3050 CONST, |FNC | | 0001 | LEN | 0001 | | | | 0001| | | | |_____| %R3050 - |PARM | | |_____|
12-40
Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – May 2002
GFK-0467M