FB_XpsuDiag - General Information

Overview

Type:

Function block

Available as of:

V1.0.4.0

Inherits from:

-

Implements:

-

Functional Description

The function block FB_XpsuDiag decodes the bit sequence provided at the input i_xDiagSignal. This bit sequence is provided by an XPSU safety module via its non-safety-related output Z1. The bit sequence encodes diagnostics information on the safety module (see Output q_dwStatus for a list of codes).

The function block needs to be activated by setting the value at its input i_xEnable to TRUE. If the value at the input i_xEnable is set to FALSE, the bit sequence is not analyzed and the outputs of the function block are set to their default values.

The XPSU safety module used is specified via the input i_etModuleType.

The bit duration is set via the input i_timBitDuration.

The cycle time of the task in which the function block is called has to be specified at the input i_timTaskCycle. See chapter General Considerations for details.

The function block must be used in a cyclic task, and it has to be executed in each cycle of this task. If the function block is not called in a cycle of the task, an error is detected (error code 16#1000)

The diagnostics data decoded from the bit sequence is provided at the output q_stDiagCode (structure ST_DiagCodes) of the function block. Depending on the analysis result, the corresponding structure element in the structure ST_DiagCodes is set to TRUE.

The output q_dwStatus provides the 6-bit code part (without the 4-bit start part) of the last bit sequence as a double word.

If the value at the input i_xDiagSignal is static TRUE, the output q_xComWireInShort is set to TRUE. This indicates a possible cross circuit in the wiring between the output Z1 of the XPSU safety module and the connected input of the controller. If the value at the input i_xDiagSignal is static FALSE, the value of the output q_xComWireOpen is set to TRUE.

The outputs q_xBusy and q_xValid provide information on the status of the function block. The outputs q_xError and q_wErrorId provide information on detected errors.

Interface

Input

Data type

Description

i_xEnable

BOOL

TRUE activates the function block. When it is activated, the bit sequence at input i_xDiagSignal is evaluated.

i_xDiagSignal

BOOL

Input for connecting the bit sequence provided by the XPSU safety module.

Connect this input to the variable which is assigned to the signal from the non-safety-related output Z1 of the XPSU safety module.

i_timTaskCycle

TIME

Cycle time of the cyclic task in which the function block is executed.

NOTE: The cycle time must be less than or equal to the signal duration of one bit (set via i_timBitDuration) divided by four. Example: If the bit duration is set to 200 ms, the cycle time must be less than or equal to 50 ms. See chapter General Considerations for details.

i_etModuleType

ET_ModuleType

Sets the type of XPSU safety module from which the bit sequence is received. If the input is not connected, or if the value is invalid, the error code 16x1007 is provided at the output q_wErrorId.

Default value: 0

i_timBitDuration

TIME

Sets the duration of a bit in milliseconds. The duration of the full sequence of ten bits is ten times this value.

Value range: 50 ... 200

Default value: 200

Output

Data type

Description

q_xBusy

BOOL

If the value at this output is TRUE, the function block is being executed.

q_xError

BOOL

If the value at this output is TRUE, the function block has detected an error. Refer to q_wErrorId for details.

q_wErrorId

WORD

Provides information on detected errors. Error codes are listed in the section Error Codes.

q_xValid

BOOL

If the value at this output is TRUE, the values of the output variables are valid.

q_stDiagCode

ST_DiagCodes

Diagnostics information decoded from the input bit sequence. The corresponding bit value in the structure ST_DiagCodes is set to TRUE.

q_dwStatus

DWORD

Provides the 6-bit code part (without the 4-bit start part) of the last detected bit sequence converted to a double word data type.

Refer to Output q_dwStatus for details.

q_xComWireInShort

BOOL

If the value at the input i_xDiagSignal is static TRUE, the value at this output is set to TRUE. This indicates a possible cross circuit in the wiring between the output Z1 of the XPSU safety module and the connected input of the controller.

Verify correct wiring between the output Z1 of the XPSU safety module and the controller as well as correct operation of the output Z1 and the input of the controller.

q_xComWireOpen

BOOL

If the value at the input i_xDiagSignal is static FALSE, the value at this output is set to TRUE. This indicates that either the output Z1 of the XPSU safety module is not correctly connected to the controller input or that the XPSU safety module is not energized.

Verify correct wiring between the output Z1 of the XPSU safety module and the controller as well as correct operation of the output Z1 and the input of the controller.

Output q_dwStatus

The bit sequence consists of 10 bits. The first 4 bits (0010) represent the start sequence, followed by a 6-bit code sequence.

The following table lists the 6-bit code part of the diagnostics codes available at the output q_dwStatus.

Code part of bit sequence

Decimal value at q_dwStatus

Description

Class. (1)

101111

47

Device in operating state Run, safety-related outputs activated.

S

101110

46

Start input activated. Waiting for falling edge for monitored start.

S

101010

42

Waiting for rising edge for automatic/manual or monitored start.

S

101011

43

Waiting for start-up test.

S

101001

41

Input S63 is expected to change its state.

S

101000

40

Input S62 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S62 and S63 are expected to change their state.

S

111000

56

Input S53 is expected to change its state.

S

111001

57

Input S52 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S52 and S53 are expected to change their state.

S

111011

59

Input S43 is expected to change its state.

S

111010

58

Input S42 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S42 and S43 are expected to change their state.

S

111110

62

Input S33 is expected to change its state.

S

111111

63

Input S32 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S32 and S33 are expected to change their state.

XPSUVN: Voltage U32 does not meet the requirements for detected standstill while U12 already does.

S

111101

61

Input S23 is expected to change its state.

S

111100

60

Input S22 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S22 and S23 are expected to change their state.

S

110100

52

Input S13 is expected to change its state.

S

110101

53

Input S12 is expected to change its state. In the case of a configuration with antivalent inputs, the inputs S12 and S13 are expected to change their state.

XPSUVN: Voltage U12 does not meet the requirements for detected standstill while U32 already does.

S

110111

55

Safety-related inputs deactivated, safety-related outputs deactivated.

XPSUVN: Voltage at safety-related input is above the adjusted voltage threshold, device is in defined safe state.

S

110110

54

Instantaneous safety-related outputs are deactivated, delayed safety-related outputs are still activated.

S

100111

39

Synchronization alert. Both synchronized safety-related inputs have been activated, but not within the synchronization time.

E

110011

51

Synchronization alert. One of the synchronized safety-related inputs is still deactivated, but the synchronization time has already elapsed.

E

100000

32

Antivalence alert at input S2x.

XPSUVN: Wiring in circuit for voltage U32 interrupted (between L3 and L2, wire break).

E

100110

38

Antivalence alert at input S1x.

XPSUVN: Wiring in circuit for voltage U12 interrupted (between L1 and L2, wire break).

E

100011

35

Cross-circuit detected at input used for Cancel Delay function.

E

110000

48

Cross-circuit detected at start input.

E

011100

28

Cross-circuit detected at input S63.

E

011101

29

Cross-circuit detected at input S62.

E

011111

31

Cross-circuit detected at input S53.

E

011110

30

Cross-circuit detected at input S52.

E

011010

26

Cross-circuit detected at input S43.

E

011011

27

Cross-circuit detected at input S42.

E

101100

44

Cross-circuit detected at input S33.

E

011000

24

Cross-circuit detected at input S32.

E

001110

14

Cross-circuit detected at input S23.

E

001111

15

Cross-circuit detected at input S22.

E

001101

13

Cross-circuit detected at input S13.

E

001100

12

Cross-circuit detected at input S12.

E

000111

7

Configuration error detected.

E

000110

6

General error detected in expansion module.

E

000011

3

General error detected.

E

101101

45

Supply voltage is out of tolerance. If the supply voltage drops below the lower limit value, the output Z1 is no longer supplied.

E

(1) Classification of the message: E = Error, S = Status

The meaning of the bit sequences are specific to the XPSU safety module used in your application. Refer to the XPSU safety modules user guides for details. For example, 100110 can indicate an antivalence error (xErrorS1x) for an XPSUDN safety module or a wire break condition (xOpenWireL1L2) for an XPSUVN safety module.

Error Codes

If the function block detects an error, the output q_xError is set to TRUE and an error code is provided at the output q_wErrorId.

Error code

Description

16#1000

Function block is not called cyclically.

Remedy: Call the function block in a cyclic task and verify that the function block call cannot be skipped (for example, by a preceding conditional jump).

16#1001

Invalid task cycle time at the input i_timTaskCycle.

Remedy: Set the cycle time to a value less than or equal to the duration of one bit (set via i_timBitDuration) divided by four. Refer to chapter General Considerations for details.

16#1002

Synchronization with the bit sequence provided by the XPSU safety module not successful.

Remedy: Verify that a valid signal from the output Z1 of the XPSU safety module) is properly connected to the input of the function block and that the XPSU safety module is operational. Verify that the function block is properly configured for the XPSU safety module used.

16#1004

The maximum number of invalid bit sequences has been exceeded.

Remedy: Verify that a valid signal from the output Z1 of the XPSU safety module) is properly connected to the input of the function block and that the XPSU safety module is operational.

16#1005

Internal function block error detected.

Remedy: Disable and re-enable the function block.

16#1006

Incorrect bit duration.

Remedy: Set the bit duration at the input i_timBitDuration to a value between 50 and 200 ms.

16#1007

Invalid XPSU safety module.

Remedy: Set the value for the XPSU safety module at the input i_etModuleType to a value corresponding to the XPSU safety module to be connected in the enumeration ET_ModuleType.