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

The text of a manual · part 28 of 39

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

Pages 239 to 248 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 239

12

Parameter Block Contents Parameter block contents for the different data formats are shown on the following pages. For both data formats: •

Hours are stored in 24-hour format.

•

Day of the week is a numeric value: Value

Day of the Week

1

Sunday

2

Monday

3

Tuesday

4

Wednesday

5

Thursday

6

Friday

7

Saturday

To Change/Read Date and Time Using BCD Format: In BCD format, each of the time and date items occupies a single byte. This format requires six words. The last byte of the sixth word is not used. When setting the date and time, this byte is ignored; when reading date and time, the function returns a null character (00).

High Byte 1 = change

Low Byte or

0 = read

1

GFK-0467M

Example output parameter block: Read Date and Time in BCD format (Sun., July 3, 1988, at 2:45:30 p.m.) address

0 address + 1

1 month year address + 2

07

88 hours day of month address + 3

14

03 seconds minutes address + 4

30

45

(null)

day of week address + 5

00

01

Chapter 12 Control Functions

12-51

Page 240

12

To Change/Read Date and Time Using Packed ASCII with Embedded Colons Format In Packed ASCII format, each digit of the time and date items is an ASCII formatted byte. In addition, spaces and colons are embedded into the data to permit it to be transferred unchanged to a printing or display device. This format requires 12 words.

High Byte 1 = change

Low Byte or

0 = read

3 year

12-52

Example output parameter block: Read Date and Time in Packed ASCII Format (Mon, Oct. 2, 1989 at 23:13:00)

year address

0 address + 1

3 address + 2

39

38 month

(space)

address + 3

31

20

(space)

month address + 4

20

30 day of month day of month address + 5

32

30 hours

(space)

address + 6

32

20

:

hours address + 7

3A

33 minutes minutes address + 8

33

31 seconds

:

address + 9

30

3A

(space)

seconds address + 10

20

30 day of week day of week address + 11

32

30

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

GFK-0467M

Page 241

12

SVCREQ #8: Reset Watchdog Timer Use SVCREQ function #8 to reset the watchdog timer during the sweep.

Note Of the CPUs discussed in this manual, Service Request 8 is supported only by 90-30 CPUs, beginning with Release 8.0. When the watchdog timer expires, the PLC shuts down without warning. This function allows the timer to keep going during a time-consuming task (for example, while waiting for a response from a communications line).

Caution Be sure that restarting the watchdog timer does not adversely affect the controlled process. This function has no associated parameter block; however, the programming software requires that an entry be made for PARM. Enter any appropriate reference here; it will not be used.

Example In the following example, when %Q0127 turns ON, the watchdog timer is reset. | _____ | %Q0127 | | | - - | | - - - - - - - - - - - - - | SVC_| - | | REQ | | | | | CONST, |FNC | | 0008 | | | | | | %AI001 - |PARM | | |_____| |

GFK-0467M

Chapter 12 Control Functions

12-53

Page 242

12

SVCREQ #9: Read Sweep Time from Beginning of Sweep Use SVCREQ function #9 to read the time in milliseconds since the start of the sweep. The data is in 16-bit Word format.

Note Of the CPUs discussed in this manual, Service Request 9 is supported only by 90-30 CPUs, beginning with Release 8.0. The parameter block is an output parameter block only; it has a length of one word. time since start of sweep address

Example In the following example, the elapsed time from the start of the sweep is always read into location %R5200. If it is greater than the value in %R5201, internal coil %M0200 is turned on. | _____ _____ |%Q0102 | | | | | - - | | - - - | SVC_| - - - - - - - - - - | GT_ | - | | REQ | | WORD| | | | | | %M0200 | CONST, |FNC | %R5200 - |I1 Q| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - | 0009 | | | | | | | | | | %R5200 - |PARM | %R5201 - |I2 | | |_____| |_____| |

12-54

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

GFK-0467M

Page 243

12

SVCREQ #10: Read Folder Name Use SVCREQ function #10 to read the name of the currently-executing folder.

Note Of the CPUs discussed in this manual, Service Request 10 is supported only by 90-30 CPUs, beginning with Release 8.0. The output parameter block has a length of four words. It returns eight ASCII characters; the last is a null character (00h). If the program name has fewer than seven characters, null characters are appended to the end. Low Byte

High Byte character 1 character 2 address character 3 character 4 address + 1 character 5 character 6 address + 2 character 7

00 address + 3

Example In the following example, when enabling contact %I0301 transitions ON, register location %R0099 is loaded with the value 10, which is the function code for the Read Folder Name function. In the following rung, when %I0102 is ON, the Service Request reads the folder name and stores it in the four-word block of memory starting at %R0100 (specified at PARM). | %I0001 %I0301 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↑) - | | _____ __________ | %I0301 | | | - - | | - - - |MOVE_| - | | WORD| | | | | CONST, |IN Q| - %R0099 | 0010 | LEN | | | 0001| | |_____| | | |%I0102 | | | - - | | - - - | SVC_| - | | REQ | | | | | %R0099 - |FNC | | | | | | | | %R0100 - |PARM | | |_____| |

GFK-0467M

Chapter 12 Control Functions

12-55

Page 244

12

SVCREQ #11: Read PLC ID Use SVCREQ function #11 to read the name of the Series 90 PLC executing the program.

Note Of the CPUs discussed in this manual, Service Request 11 is supported only by 90-30 CPUs, beginning with Release 8.0. The output parameter block has a length of four words. It returns eight ASCII characters; the last is a null character (00h). If the PLC ID has fewer than seven characters, null characters are appended to the end. Low Byte

High Byte character 1 character 2 address character 3 character 4 address + 1 character 5 character 6 address + 2 character 7

00 address + 3

Example In the following example, when enabling contact %I0001 transitions OFF, register location %R0099 is loaded with the value 11, which is the function code for the Read PLC ID function. . In the following rung, when %Q0102 is ON, the Service Request reads the PLC ID and stores it in the four-word block of memory starting at %R0100 (specified at PARM). | %I0001 %M0301 | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↓) - | | _____ __________ | %M0301 | | | - - | | - - - |MOVE_| | | WORD| | | | | CONST, |IN Q| - %R0099 | 0011 | LEN | | | 0001| | |_____| | | _____ |%Q0102 | | | - - | | - - - | SVC_| - | | REQ | | | | | %R0099 - |FNC | | | | | | | | %R0100 - |PARM | | |_____| |

12-56

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

GFK-0467M

Page 245

12

SVCREQ #12: Read PLC Run State Use SVCREQ function #12 to read the current RUN state of the PLC CPU.

Note Of the CPUs discussed in this manual, Service Request 12 is supported only by 90-30 CPUs, beginning with Release 8.0. The parameter block is an output parameter block only; it has a length of one word. There are only two valid results obtainable from the execution of this Service Request:

1 = run/disabled address

2 = run/enabled

Example In the following example, when %I0102 turns ON, the Service Request reads the PLC run state and places the result in memory address %R402. If the PLC is in Run/Disabled mode, %R402 will contain a value of 1. If the PLC is in Run/Enabled mode, %R402 will contain a value of 2. | _____ |%I0102 | | | - - | | - - - | SVC_| - | | REQ | | | | | CONST, |FNC | | 0012 | | | | | | %R402 - |PARM | | |_____| |

GFK-0467M

Chapter 12 Control Functions

_____ __________

12-57

Page 246

12

SVCREQ #13: Shut Down (Stop) PLC Use SVCREQ function #13 in order to stop the PLC at the end of the next sweep. All outputs will go to their designated default states at the beginning of the next PLC sweep. An informational fault is placed in the PLC fault table, noting that a “SHUT DOWN PLC” function block was executed. The I/O scan will continue as configured. This function has no parameter block.

Example In the following example, when a “Loss of I/O Module” fault occurs, SVCREQ function #13 executes. Since no parameter block is needed, the PARM input is not used; however, the programming software requires that an entry be made for PARM. This example uses a JUMP to the end of the program to force a shutdown if the Shut Down PLC function executes successfully. This JUMP and LABEL are needed because the transition to STOP mode does not occur until the end of the sweep in which the function executes. Once the PLC receives this STOP command from the Service Request, it will execute one more sweep and then stop (see NOTE below).

| |LOS_MD %T0001 | | - - | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (↑) - | | _____ |%T0001 | | | - - | | - - - - - - - | SVC_| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> END_PRG | | | | | REQ | | | | | CONST, |FNC | | 0013 | | | | | | %R1001, |PARM | | |_____| | . . . | | END_PRG: | | | [ END OF PROGRAM LOGIC ] |

Note To ensure that the %S0002 LST_SCN contact will operate correctly, the PLC will execute one additional sweep after the sweep in which the SVCREQ function #13 was executed.

12-58

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

GFK-0467M

Page 247

12

SVCREQ #14: Clear Fault Tables Use SVCREQ function #14 in order to clear either the PLC fault table or the I/O fault table. The SVCREQ output is set ON unless some number other than 0 or 1 is entered as the requested operation (see below). For this function, the parameter block has a length of 1 word. It is an input parameter block only. 0 = clear PLC fault table.

address

1 = clear I/O fault table.

Example In the following example, when contacts %I0346 and %I0349 are both on, the PLC fault table is cleared. When contacts %I0347and %I0349 are both on, the I/O fault table is cleared. When contacts %I0348 and %I0349 are both on, both fault tables are cleared. The parameter block for the PLC fault table is located at %R0500, and for the I/O fault table the parameter block is located at %R0550. Both parameter blocks are set up elsewhere in the program (they both must be at logic 1 in order to clear their respective tables).

| _____ |%I0349 %I0346 | | | - - | | - - + - - | | - - + - - - - - - - | SVC_| - | | | | | | | | | REQ | | |%I0348 | | | | + - - | | - - +CONST, |FNC | | 0014 | | | | | | %R0500, |PARM | | |_____| | | _____ |%I0349 %I0347 | | | - - | | - - + - - | | - - + - - - - - - - | SVC_|| | | | | | | | | REQ | | |%I0348 | | | | + - - | | - - +CONST -|FNC | | 0014 | | | | | | %R0550 -|PARM | | |_____| |

GFK-0467M

Chapter 12 Control Functions

12-59

Page 248

12

SVCREQ #15: Read Last-Logged Fault Table Entry Use SVCREQ function #15 in order to read the last entry logged in either the PLC fault table or the I/O fault table. The SVCREQ output is set ON unless some number other than 0 or 1 is entered as the requested operation (see below), or the fault table is empty. (For additional information on fault table entries, refer to chapter 3, “Fault Explanations and Correction.”) For this function, the parameter block has a length of 22 words. The input parameter block has this format: 0 = Read PLC fault table.

address

1 = Read I/O fault table.

The format for the output parameter block depends on whether the function reads data from the PLC fault table or the I/O fault table. PLC Fault Table Output Format Low Byte

I/O Fault Table Output Format

High Byte

Low Byte

0 address + 1 address + 2 long/short reference address

PLC fault address address + 3 address + 4

I/O fault address address + 5 address + 6 fault group and action address + 7 address + 8 fault category fault description fault specific data time stamp

12-60

1 long/short spare fault group and action error code

High Byte address + 9 address + 10 address + 11 address + 12 address + 13 address + 14 address + 15 address + 16 address + 17 address + 18 address + 19 address + 20 address + 21 fault type fault specific data time stamp

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

GFK-0467M