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

The text of a manual · part 27 of 39

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

Pages 229 to 238 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 229

12

SVCREQ #2: Read Window Values Use SVCREQ function #2 to obtain the current window mode time values for the programmer communications window and the system communications window.

Note Of the CPUs discussed in this manual, Service Request 2 is supported only by 90-30 CPUs, beginning with Release 8.0. There are three modes for each window: Mode Name

Value

Description

Limited Mode

0

The execution time of the window is limited to its respective default value or to a value defined using SVCREQ function #3 for the programmer communications window or SVCREQ function #4 for the systems communications window. The window will terminate when it has no more tasks to complete.

Constant Mode

1

Each window will operate in a RUN TO COMPLETION mode, and the PLC will alternate between the two windows for a time equal to the sum of each window’s respective time value. If one window is placed in CONSTANT mode, the remaining two windows are automatically placed in CONSTANT mode. If the PLC is operating in CONSTANT WINDOW mode and a particular window’s execution time is not defined using the associated SVCREQ function, the default time for that window is used in the constant window time calculation.

Run to Completion Mode

2

Regardless of the window time associated with a particular window, whether default or defined using a service request function, the window will run until all tasks within that window are completed.

A window is disabled when the time value is zero. The parameter block has a length of three words:

Programmer Window System Communications Window Reserved*

High Byte

Low Byte

Mode

Value in ms

Mode

Value in ms address + 1

*See Note

*See Note address + 2 address

* Note. The address + 2 word is reserved for use by the system. All zeros will be returned here. All parameters are output parameters. It is not necessary to enter values in the parameter block to program this function. Output values for both window are given in milliseconds.

GFK-0467M

Chapter 12 Control Functions

12-41

Page 230

12

Example In the following example, when enabling output %Q0102 is set, the PLC operating system places the current time values of the three windows in the parameter block starting at location %R0100. Additional examples showing the Read Window Values function are included in the next three SYS REQ function descriptions. | _____ |%Q0102 | | | - - | | - - - | SVC_| | | REQ | | | | | CONST, |FNC | | 0002 | | | | | | %R0100 - |PARM | | |_____| |

12-42

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

GFK-0467M

Page 231

12

SVCREQ #3: Change Programmer Communications Window Mode and Timer Value Use SVCREQ function #3 to change the programmer communications window mode and timer value. The change will occur in the CPU sweep following the sweep in which the function is called.

Note Of the CPUs discussed in this manual, Service Request 3 is supported only by 90-30 CPUs, beginning with Release 8.0. The SVCREQ function #3 will pass power flow to the right unless a mode other than 0 (Limited), 1 (Constant), or 2 (Run-to-Completion) is selected. The parameter block has a length of one word. To disable the programmer window, enter SVCREQ function #3 with this parameter block: High Byte

Low Byte

0

0 address

To enable the programmer window, enter SVCREQ function #3 with this parameter block:

GFK-0467M

High Byte

Low Byte

Mode

Value from 1 to 255 ms

Chapter 12 Control Functions address

12-43

Page 232

12

Example In the following example, when %M0125 transitions on, the programmer communications window is enabled and assigned a value of 25 ms. The parameter block is in memory location %R5051. | %I0001 %M0125 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↑) - | | _____ _____ | %M0125 | | | | %T0002 | - - | | - - - |MOVE_| - - - - - - - - - - - - - - - - - - - | SVC_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | INT | | REQ | | | | | | | CONST, |IN Q| - %R5051 CONST, |FNC | |+00025 | LEN | 00003 | | | | 0001| | | | |_____| %R5051 - |PARM | | |_____|

To disable the programmer communications window, use Service Request 3 to assign a value of zero (0). In this example, when %M0126 transitions on, the programmer communications window is enabled and assigned a value of 0 ms. The parameter block is in memory location %R5051. | %I0002 %M0126 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↑) - | | _____ _____ | %M0126 | | | | %T0002 | - - | | - - - |MOVE_| - - - - - - - - - - - - - - - - - - - | SVC_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | | INT | | REQ | | | | | | | CONST, |IN Q| - %R5051 CONST, |FNC | |+00000 | LEN | 00003 | | | | 0001| | | | |_____| %R5051 - |PARM | | |_____|

12-44

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

GFK-0467M

Page 233

12

SVCREQ #4: Change System Comm Window Mode and Timer Value Use SVCREQ function #4 to change the system communications window mode and timer value. The change will occur in the CPU sweep following the sweep in which the function is called.

Note Of the CPUs discussed in this manual, Service Request 4 is supported only by 90-30 CPUs, beginning with Release 8.0. The SVCREQ function #4 will pass power flow to the right unless a mode other than 0 (Limited), 1 (Constant), or 2 (Run-to-Completion) is selected. The parameter block has a length of one word. To disable the system communications window, enter SVCREQ function #4 with this parameter block: High Byte

Low Byte

0

0 address

To enable the system communications window, enter SVCREQ function #4 with this parameter block:

GFK-0467M

High Byte

Low Byte

Mode

Value from 1 to 255 ms

Chapter 12 Control Functions address

12-45

Page 234

12

Example In the following example, when enabling output %M0125 transitions on, the mode and timer value of the system communications window is read. If the timer value is greater than or equal to 25 ms, the value is not changed. If it is less than 25 ms, the value is changed to 25 ms. In either case, when the rung completes execution the window is enabled. The parameter block for all three windows is at location %R5051. Since the mode and timer for the system communications window is the second value in the parameter block returned from the Read Window Values function (function #2), the location of the existing window time for the system communications window is in the low byte of %R5052. | %I0001 %M0125 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↑) - | | _____ _____ _____ | %M0125 | | | | | | | - - | | - - - | SVC_| - - - - - - - - - - | AND_| - - - - - - - - - - - - - - - - - - | AND_| | | REQ | | WORD| | WORD| | | | | | | | | CONST, |FNC | %R5052 - |I1 Q| - %R5060 %R5052 - |I1 Q| - %R50061 | 0002 | | | | | | | | | | | CONST, |I2 | | %R5051 - |PARM | CONST, |I2 | FF00 | | | |_____| 00FF |_____| |_____| | | | _____ _____ _____ | %M0125 | | | | | | | - - | | - - - | LT | + - - - - - - - - - - - - | OR | - - - - - - - - - - - - - - - - |SVC_ | - | |WORD | | |WORD | | REQ_| | | | | | | | | | %R5060 - |I1 Q| - - - - - - - + %R5061 - |I1 Q| - %R5052 CONST, |FNC | | | | | | 0004 | | | CONST, |I2 | CONST, |I2 | | | | 0025 | | 0025 | | %R5052 - |PARM | | |_____| |_____| |_____| |

12-46

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

GFK-0467M

Page 235

12

SVCREQ #6: Change/Read Number of Words to Checksum Use the SVCREQ function with function number 6 in order to: •

Read the current word count.

•

Set a new word count.

Successful execution will occur, unless some number other than 0 or 1 is entered as the requested operation (see below). For the Checksum Task functions, the parameter block has a length of 2 words. To Read the Current Word Count: Enter SVCREQ function 6 with this parameter block: 0 address ignored address + 1

After the function executes, the function returns the current checksum in the second word of the parameter block. No range is specified for the read function; the value returned is the number of words currently being checksummed. 0 address current word count address + 1

To Set a New Word Count: Enter SVCREQ function 6 with this parameter block: 1 address new word count (0 – 32)

address + 1

Entering 1 causes the PLC to adjust the number of words to be checksummed to the value given in the second word of the parameter block. For any Series 90-30 CPU, the second word value can be from 0 to 32. If the value is outside this range, an error will be generated. For the Series 90-20 CPU211, the value can be either 0 or 4.

Note This Service Request is not available on Micro PLCs.

GFK-0467M

Chapter 12 Control Functions

12-47

Page 236

12

Example In the following example, when enabling contact FST_SCN is set, the parameter blocks for the checksum task function are built. Later in the program when input %I0137 turns on, the number of words being checksummed is read from the PLC operating system. This number is increased by 16, with the results of the ADD_INT function being placed in the “hold new count for set” parameter. The second service request block requests the PLC to set the new word count. | _____ _____ | FST_SCN | | | | | - - - | | - - - | XOR_| - - - - - - - - - - - - - - - - - |MOVE_| | | | | | | | WORD| | INT | | | | | | | %R0150, |I1 Q| - %R0150 CONST, |IN Q| - %R0152 | | | +00001 | LEN | | | | |00001| | %R0150, |I2 | |_____| | |_____| | . . | _____ _____ _____ | %I0137 | | | | | | | - - - | | - - - - - - | SVC_| - - - - - - - - - | ADD_| - - - - - - - - - - - - - - - - - | SVC_| - | | | | | | | | | REQ | | INT | | REQ | | | | | | | | | CONST, |FNC | %R0151, |I1 Q| - %R0153 CONST, |FNC | | 00006 | | | | 00006 | | | | | | | | | | %R0150, |PARM | CONST, |I2 | %R0152, |PARM | | |_____| +00016 |_____| |_____| |

The example parameter blocks are located at address %R0150. They have the following content:

12-48

0 = read current count

%R0150

Hold current count

%R0151

1 = set current count

%R0152

Hold new count for set

%R0153

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

GFK-0467M

Page 237

12

SVCREQ #7: Change/Read Time-of-Day Clock Use the SVCREQ function with function number 7 to read and set the time-of-day clock in the PLC.

Note This function is available only in 331 or higher 90-30 CPUs and on the 28-point Series 90 Micro PLC CPUs (that is, IC693UDR005, IC693UAA007, and IC693UDR010) and the 23-point Series 90 Micro PLC CPUs (IC693UAL006). Successful execution will occur unless: 1.

Some number other than 0 or 1 is entered as the requested operation (see below).

2.

An invalid data format is specified.

3.

The data provided is not in the expected format.

4.

An invalid date is entered, such as 02/29/01, which incorrectly specifies a leap year day in the year 2001 (2001 is not a leap year).

For the date/time functions, the length of the parameter block depends on the data format. BCD format requires 6 words; packed ASCII requires 12 words. 0 = read time and date address

1 = set time and date 1 = BCD format address + 1

3 = packed ASCII format data address + 2 to end

In word 1, specify whether the function should read or change the values. 0 1

= = read change

In word 2, specify a data format: 1 3

= =

BCD packed ASCII with embedded spaces and colons

Words 3 to the end of the parameter block contain output data returned by a read function, or new data being supplied by a change function. In both cases, format of these data words is the same. When reading the date and time, words (address + 2) through (address + 8) of the parameter block are ignored on input.

GFK-0467M

Chapter 12 Control Functions

12-49

Page 238

12

Example In the following example, when called for by previous logic, a parameter block for the time-of-day clock is built to first request the current date and time, and then set the clock to 12 noon using the BCD format. The parameter block is located at global data location %R0300. Array NOON has been set up elsewhere in the program to contain the values 12, 0, and 0. (Array NOON must also contain the data at %R0300.) The BCD format requires six contiguous memory locations for the parameter block.

| | | _____ _____ |FST_SCN | | | | | - - | | - - - +MOVE_+ - - - - - - - - - - - - - - - - - +MOVE_+| | | | | | | INT | | INT | | | | | | | CONST -|IN Q+- NOON CONST -+IN Q+- MIN_SEC | | | | | | +04608 | LEN | +00000 | LEN | | |00001| |00001| | |_____| |_____| | | | | _____ _____ _____ |%I0016 | | | | | | %T0001 | - - | | - - - +MOVE + - - - - - - - - - - - - - - - - - +MOVE + - - - - - - - - - - - - - - - - - + SVC + - - - - - - - - - - - - - ( )| | | | | | | | | INT | | INT | | REQ | | | | | | | | | CONST -+IN Q+- %R0300 CONST -+IN Q+- %R0301 CONST -+FNC | | | | | | | | | +00000 | LEN | +00001 | LEN | +00007 | | | |00001| |00001| | | | |_____| |_____| %R0300 -+PARM | | |_____| | | | | _____ _____ |%T0001 %I0017 | | | | | - - | | - - - - | | - - - - + AND_+ - - - - - - - - - - - - - - - - - + ADD_+| | | | | | | WORD| | INT | | | | | | | %R0303 -+I1 Q+- %R0303 %R0303 -+I1 Q+- %R0303 | | | | | | CONST -+I2 | NOON -+I2 | | 00FF |_____| |_____| | | | | _____ _____ _____ |%T0001 %I0017 | | | | | | | - - | | - - - - - | | - - - +MOVE_+ - - - - - - - - - - - - - - - - - +MOVE_+ - - - - - - - - - - - - - - - - - + SVC_+– | | INT | | INT | | REQ | | | | | | | | | MIN_SEC-+IN Q+- %R0304 CONST -+IN Q+- %R0300 CONST -+FNC | | | LEN | +00001 | LEN | +00007 | | | |00002| |00001| | | | |_____| |_____| %R0300 -+PARM | | |_____| |

12-50

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

GFK-0467M