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.
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 |
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. |
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) |
---|---|---|---|
|
47 |
Device in operating state Run, safety-related outputs activated. |
S |
|
46 |
Start input activated. Waiting for falling edge for monitored start. |
S |
|
42 |
Waiting for rising edge for automatic/manual or monitored start. |
S |
|
43 |
Waiting for start-up test. |
S |
|
41 |
Input S63 is expected to change its state. |
S |
|
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 |
|
56 |
Input S53 is expected to change its state. |
S |
|
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 |
|
59 |
Input S43 is expected to change its state. |
S |
|
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 |
|
62 |
Input S33 is expected to change its state. |
S |
|
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 |
|
61 |
Input S23 is expected to change its state. |
S |
|
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 |
|
52 |
Input S13 is expected to change its state. |
S |
|
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 |
|
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 |
|
54 |
Instantaneous safety-related outputs are deactivated, delayed safety-related outputs are still activated. |
S |
|
39 |
Synchronization alert. Both synchronized safety-related inputs have been activated, but not within the synchronization time. |
E |
|
51 |
Synchronization alert. One of the synchronized safety-related inputs is still deactivated, but the synchronization time has already elapsed. |
E |
|
32 |
Antivalence alert at input S2x. XPSUVN: Wiring in circuit for voltage U32 interrupted (between L3 and L2, wire break). |
E |
|
38 |
Antivalence alert at input S1x. XPSUVN: Wiring in circuit for voltage U12 interrupted (between L1 and L2, wire break). |
E |
|
35 |
Cross-circuit detected at input used for Cancel Delay function. |
E |
|
48 |
Cross-circuit detected at start input. |
E |
|
28 |
Cross-circuit detected at input S63. |
E |
|
29 |
Cross-circuit detected at input S62. |
E |
|
31 |
Cross-circuit detected at input S53. |
E |
|
30 |
Cross-circuit detected at input S52. |
E |
|
26 |
Cross-circuit detected at input S43. |
E |
|
27 |
Cross-circuit detected at input S42. |
E |
|
44 |
Cross-circuit detected at input S33. |
E |
|
24 |
Cross-circuit detected at input S32. |
E |
|
14 |
Cross-circuit detected at input S23. |
E |
|
15 |
Cross-circuit detected at input S22. |
E |
|
13 |
Cross-circuit detected at input S13. |
E |
|
12 |
Cross-circuit detected at input S12. |
E |
|
7 |
Configuration error detected. |
E |
|
6 |
General error detected in expansion module. |
E |
|
3 |
General error detected. |
E |
|
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.
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 |
---|---|
|
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). |
|
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. |
|
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. |
|
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. |
|
Internal function block error detected. Remedy: Disable and re-enable the function block. |
|
Incorrect bit duration. Remedy: Set the bit duration at the input i_timBitDuration to a value between 50 and 200 ms. |
|
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. |