• 沒有找到結果。

The following table lists all the asynchronous errors to which you can react with an OB call in the user program.

Asynchronous Errors OB

Time error (for example, cycle time exceeded) OB80 Power supply error (for example, battery fault) OB81 Diagnostic interrupt (for example, defective fuse on a signal module) OB82

Remove/insert module interrupt OB83

CPU hardware fault (for example, memory card removed) OB84

Program error OB85

Rack failure OB86

Communication error OB87

长沙工控帮教育科技有限公司整理

12.2 Disabling the Processing of New Interrupts and Asynchronous Errors with SFC 39 "DIS_IRT"

Description

With SFC 39 "DIS_IRT" (disable interrupt), you disable the processing of new interrupts and asynchronous errors. This means that if an interrupt occurs, the operating system of the CPU reacts as follows:

• It neither calls an interrupt OB or asynchronous error OB,

Nor triggers the normal reaction if an interrupt OB or asynchronous error OB is not programmed.

If you disable interrupts and asynchronous errors, this remains in effect for all priority classes. The effects of "DIS_IRT" can only be canceled again by calling SFC 40 "EN_IRT" (see Section 0) or by a warm or a cold restart.

Whether the operating system writes interrupts and asynchronous errors to the diagnostic buffer when they occur depends on the input parameter setting you select for MODE.

Note

Remember that when you program the use of SFC 39 "DIS_IRT," all interrupts that occur are lost!

Parameter Declaration Data Type Memory Area Description

MODE INPUT BYTE I, Q, M, D, L,

constant

Specifies which interrupts and asynchronous errors are disabled.

OB_NR INPUT INT I, Q, M, D, L,

constant

OB number

RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs while the function is active, the return value contains an error code.

长沙工控帮教育科技有限公司整理

MODE

MODE Meaning

00 All newly occurring interrupts and asynchronous errors are disabled. (Synchronous errors are not disabled.) Assign the OB_NR parameter the value 0. Entries continue to be made in the diagnostic buffer.

01 All newly occurring events belonging to a specified interrupt class are disabled. Identify the interrupt class by specifying the smallest possible OB no. for this class, even if this OB does not exist on your CPU.

Examples:

• If you want to disable all watchdog interrupts, specify 30 in OB_NR (even if OB30 is not the first watchdog OB for your CPU).

• If you want to disable all hardware interrupts, specify 40 in OB_NR.

Entries into the diagnostic buffer are continued.

01 All newly occurring events belonging to a specified interrupt class are disabled. Identify the interrupt class by specifying it as follows:

• Time-of-day interrupts: 10

• Time-delay interrupts: 20

• Cyclic interrupts: 30

• Hardware interrupts: 40

• Interrupts for DPV1: 50

• Multicomputing interrupts: 60

• Redundancy error interrupts: 70

• Asynchronous error interrupts: 80

Entries into the diagnostic buffer are continued.

02 All new occurrences of a specified interrupt are disabled. You specify the interrupt using the OB number. Entries continue to be made in the diagnostic buffer.

80 All newly occurring interrupts and asynchronous errors are disabled and are no longer entered in the diagnostic buffer. The operating system enters event W#16#5380 in the diagnostic buffer.

81 All newly occurring belonging to a specified interrupt class are disabled and are no longer entered in the diagnostic buffer. The operating system enters event W#16#5380 in the diagnostic buffer.

82 All newly occurring belonging to a specified interrupt are disabled and are no longer entered in the diagnostic buffer. The operating system enters event W#16#5380 in the diagnostic buffer.

Error Information

Error Code (W#16#...) Explanation

0000 No error occurred.

8090 The input parameter OB_NR contains an illegal value.

8091 The input parameter MODE contains an illegal value.

长沙工控帮教育科技有限公司整理

12.3 Enabling the Processing of New Interrupts and Asynchronous Errors with SFC 40 "EN_IRT"

Description

With SFC 40 "EN_IRT" (enable interrupt), you enable the processing of new interrupts and asynchronous errors that you previously disabled with SFC 39

"DIS_IRT." This means that if an interrupt event occurs, the operating system of the CPU reacts in one of the following ways:

• It calls an interrupt OB or asynchronous error OB.

• It triggers the standard reaction if the interrupt OB or asynchronous error OB is not programmed.

Parameter Declaration Data Type Memory Area Description

MODE INPUT BYTE I, Q, M, D, L,

constant

Specifies which interrupts and asynchronous errors will be enabled.

OB_NR INPUT INT I, Q, M, D, L,

constant

OB number

RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs while the function is active the return value contains an error code.

MODE

MODE (B#16#...)

Meaning

0 All newly occurring interrupts and asynchronous errors are enabled.

1 All newly occurring events belonging to a specified interrupt class are enabled. Identify the interrupt class by specifying it as follows:

• Time-of-day interrupts: 10

• Time-delay interrupts: 20

• Cyclic interrupts: 30

• Hardware interrupts: 40

• Interrupts for DPV1: 50

• Multicomputing interrupts: 60

• Redundancy error interrupts: 70

• Asynchronous error interrupts: 80

2 All newly occurring events of a specified interrupt are enabled. You specify the interrupt using the OB number.

Error Information

长沙工控帮教育科技有限公司整理

12.4 Delaying the Processing of Higher Priority Interrupts and Asynchronous Errors with SFC 41 "DIS_AIRT"

Description

With SFC 41 "DIS_AIRT" (disable alarm interrupts), you delay the processing of interrupt OBs and asynchronous error OBs which have a higher priority than that of the current OB. You can call SFC 41 more than once in an OB. The SFC 41 calls are counted by the operating system. Each of these calls remains in effect until it is canceled again specifically by an SFC 42 "EN_AIRT" call or until the current OB has been completely processed.

Once they are enabled again, the interrupts and asynchronous errors that occurred while SFC 41 was in effect are processed as soon as they are enabled again with SFC 42 "EN_AIRT" or as soon as the current OB has been executed.

Parameter Declaration Data Type Memory Area Description

RET_VAL OUTPUT INT I, Q, M, D, L Number of delays (= number of SFC 41 calls)

相關文件