发表于:2006-07-06 15:16:00
5楼
我理解你的意思了~OB86里的那些内部变量是不是可以~
The operating system of the CPU calls OB86 whenever the failure of an expansion rack (not with CPU 318), a DP master system, or a station is detected in the distributed I/Os (both when entering and outgoing event).
If OB86 has not been programmed, the CPU changes to the STOP mode when this type of error is detected.
You can disable or delay and re-enable OB86 using SFCs 39 to 42.
Local Data for the Rack Failure OB
The following table describes the temporary (TEMP) variables for the rack failure OB. The variable names are the default names of OB86.
Variable Type Description
OB86_EV_CLASS BYTE Event class and identifiers:B#16#38: outgoing eventB#16#39: incoming event
OB86_FLT_ID BYTE Error code:(possible values B#16#C1, B#16#C2, B#16#C3, B#16#C4, B#16#C5, B#16#C6, B#16#C7, B#16#C8)
OB86_PRIORITY BYTE Priority class; can be assigned via STEP 7 (hardware configuration)
OB86_OB_NUMBR BYTE OB number (86)
OB86_RESERVED_1 BYTE Reserved
OB86_RESERVED_2 BYTE Reserved
OB86_MDL_ADDR WORD Depends on the error code
OB86_RACKS_FLTD Array [0 ..31]of BOOL Depends on the error code
OB86_DATE_TIME DATE_AND_TIME DATE_AND_TIME of day when the OB was called
If you want to program OB86 dependent on the possible error codes, we recommend that you organize the local variables as follows:
Variable Type
OB86_EV_CLASS BYTE
OB86_FLT_ID BYTE
OB86_PRIORITY BYTE
OB86_OB_NUMBR BYTE
OB86_RESERVED_1 BYTE
OB86_RESERVED_2 BYTE
OB86_MDL_ADDR WORD
OB86_Z23 DWORD
OB86_DATE_TIME DATE_AND_TIME
The variables whose contents are dependent on the error code have the following meaning:
Error code Meaning
B#16#39C1: OB86_MDL_ADDR: OB86_Z23: Expansion rack failureLogical base address of the IMContains one bit for each possible expansion rack:Bit 0: always 0Bit 1: 1st expansion rack:Bit 21: 21st expansion rackBit 22 to 29: always 0Bit 30: Failure of at least one expansion rack in the
SIMATIC S5 areaBit 31: always 0
B#16#38C1: Expansion rack operational again
Meaning: when the event occurs, the expansion racks that caused OB86 to be called are reported as having failed (the bits assigned to them are set). Expansion racks that had already failed earlier are no longer indicated. When the failure is eliminated, the expansion racks that are active again are reported in the error code (the bits assigned to them are set).
Error code Meaning
B#16#C2:
OB86_MDL_ADDR: OB86_Z23: Expansion rack returned with discrepancy between expected and actual configuration.Logical base address of the IMContains one bit for every possible expansion rack, see error code B#16#C1. Meaning of a bit when set (for the expansion rack concerned):- Modules with an incorrect type ID exist- Configured modules missing- At least one module is defective.
B#16#C3:
OB86_MDL_ADDR: OB86_Z23: Distributed I/Os: Failure of the master system. (Only incoming event causes the start of OB86 with error code B#16#C3. Leaving the state starts OB86 with the error code B#16#C4 and event class B#16#38.
The return of every DP slave station starts OB86.)Logical base address of the DP master.DP master system IDBit 0 to 7: reservedBit 8 to 15: DP master system IDBit 16 to 31: reserved
B#16#C4:B#16#C5:
OB86_MDL_ADDR: OB86_Z23: Failure of a DP station.DP station disturbed
Logical base address of the DP master.Address of DP slave affected: Bits 0 to 7: number of DP stationBits 8 to 15: DP master system IDBits 16 to 30: logical base address of an S7 slave or diagnostic address of a standard DP slaveBit 31: I/O identifier
B#16#C6: OB86_MDL_ADDR: OB86_Z23: Expansion rack operational again but error in module parameter assignmentLogical base address of IMContains a bit for every possible expansion rack:Bit 0: always 0Bit 1: 1st expansion rack:Bit 21: 21st expansion rackBit 22 to 30: reservedBit 31: always 0Meaning when bit set (in expansion rack concerned):Modules with incorrect type identifiers existModules with missing or incorrect parameters exist
B#16#C7: OB86_MDL_ADDR: OB86_Z23: Return of a DP station, but error in module parameter assignmentLogical base address of the DP masterAddress of the DP slave affected:Bits 0 to 7: No. of the DP stationBits 8 to 15: DP master system IDBits 16 to 30: Logical base address of the DP slaveBit 31: I/O identifier
B#16#C8:
OB86_MDL_ADDR: OB86_Z23: Return of a DP station, however discrepancy in configured and actual configurationLogical base address of the DP masterAddress of the DP slave affected:Bits 0 to 7: No. of the DP stationBits 8 to 15: DP master system IDBits 16 to 30: Logical base address of the DP slaveBit 31: I/O identifier