Table of contents Table of contents 1 Foreword Notes on the documentation 1.1.1 Target group 1.1.2 Origin of the document 1.1.3 Currentness 1.1.4 Product features 1.1.5 Disclaimer 1.1.6 Trademarks 1.1.7 Patents 1.1.8 Copyright 1.1.9 Delivery conditions Safety instructions 1.2.1 Delivery state 1.2.2 Operator's obligation to exercise diligence 1.2.3...
Page 4
Table of contents The function block OPMODE 3.3.1 Functional description 3.3.2 Signal description 3.3.3 Configuration of the FB OPMODE in the TwinCAT System Manager 3.3.4 Restart behavior 3.3.5 Display in TwinCAT 3 The function block ESTOP 3.4.1 Functional description 3.4.2 Signal description 3.4.3 FB ESTOP configuration in the TwinCAT System Manager...
Table of contents 3.9.3 FB EDM configuration in the TwinCAT System Manager 3.9.4 Display in TwinCAT 3 3.10 The function block RS 3.10.1 Functional description 3.10.2 Signal description 3.10.3 FB RS configuration in the TwinCAT System Manager 3.10.4 Display in TwinCAT 3 3.11 The function block SR 3.11.1 Functional description 3.11.2 Signal description...
Page 6
Table of contents 3.17.3 FB SUB configuration in TwinCAT 3 3.18 The function block MUL 3.18.1 Functional description 3.18.2 Signal description 3.18.3 FB MUL configuration in TwinCAT 3 3.19 The function block DIV 3.19.1 Functional description 3.19.2 Signal description 3.19.3 FB DIV configuration in TwinCAT 3 3.20 The function block COMPARE 3.20.1 Functional description 3.20.2 Signal description...
Page 7
3.29.3 FB ViolationCnt configuration in TwinCAT 3 3.30 The function block XOR 3.30.1 Functional description 3.30.2 Signal description 3.30.3 Configuration of the FB XOR in TwinCAT 3 4 Appendix Beckhoff Support and Service Beckhoff headquarters Function blocks for TwinSAFE logic components...
1.1.4 Product features Only the product features specified in the current user documentation are valid. Further information given on the product pages of the Beckhoff homepage, in emails or in other publications is not authoritative. 1.1.5 Disclaimer The documentation has been prepared with care. The products described in this document are subject to cyclical revision.
1.1.9 Delivery conditions In addition, the general delivery conditions of the company Beckhoff Automation GmbH & Co. KG apply. 1.2 Safety instructions 1.2.1 Delivery state All the components are supplied in particular hardware and software configurations appropriate for the application.
Foreword 1.2.3 Explanation of notes The following notes are used in this document. They must be read carefully and strictly followed! DANGER Serious risk of injury! Failure to observe these safety instructions can result in immediate danger to life and health! WARNING Risk of injury! Failure to observe these safety instructions can result in danger to life and health!
Foreword 1.2.4 Documentation issue status Version Comment • 3.3.0 FB TON / FB TON2 - Extension of the time base • 3.2.0 Texts rendered more precisely • Restart behavior for ESTOP, OPMODE and MON described in detail • FB XOR added •...
System description 2 System description The TwinSAFE system consists of safe inputs (EL/KL1904), safe outputs (EL/KL2904) and logic modules (KL6904/EL6900/EL6910/EJ6910). The TwinSAFE logic terminal (KL6904/EL6900/EL6910/EJ6910) contains function blocks, which can be parameterized and connected to each other and form the safety- related logic.
System description 2.1.1 TwinSAFE group The function blocks are assigned to a TwinSAFE group. All outputs of the group adopt a safe state in the following situations: − communication error in an assigned TwinSAFE connection, − error in an assigned function block (e.g. a discrepancy timeout) −...
Page 15
System description Table 2-2: Outputs of the TwinSAFE group Name Permitted type Description FB ERR TwinSAFE-Out TRUE: FB-In At least one assigned function block has an error Standard-Out FALSE: Local-Out All assigned function blocks have no errors COM ERR TwinSAFE-Out TRUE: FB-In At least one TwinSAFE connection of TwinSAFE group has an error...
System description 2.1.2 TwinSAFE connection Each safe communication path between the TwinSAFE logic and TwinSAFE inputs, TwinSAFE outputs or other TwinSAFE logic terminals are referred to as TwinSAFE connection. A communication partner is thus always the TwinSAFE master, the other the TwinSAFE slave. The TwinSAFE logic is in a TwinSAFE connection to a TwinSAFE input or TwinSAFE output is always TwinSAFE master.
System description 2.2 System diagnosis The states of TwinSAFE groups, FBs and connections can be checked online in the System Manager / Solution. The diagnostic information can be copied into the cyclic process image. TwinSAFE groups have inputs and outputs that can be assigned offline and viewed online, as illustrated below.
Page 18
System description Table 2-4: State information KL6904/EL6900 Value State Description All function blocks and TwinSAFE connections assigned to the TwinSAFE group operate properly, and all TwinSAFE connections assigned to the TwinSAFE group are up and running STOP State after initialization SAFE All function blocks and TwinSAFE connections assigned to the TwinSAFE group operate properly, and at least one of the TwinSAFE connections...
Page 19
System description NOTE KL6904 With the KL6904 copying of the diagnostic information to the cyclic process image is only possible to a limited extent. The checkboxes 'Map State' and 'Map Diag' are not available. Figure 2-4: Emergency Stop 2.2.1.3 TwinSAFE connection diagnostics The TwinSAFE connections state is displayed on the TwinSAFE connection list summary under the "Connection List"...
Page 20
System description Figure 2-6: Variables tab (connection) Table 2-5: Diagnostic information for a connection Value Description xxxx 0001 Invalid command xxxx 0010 Unknown command xxxx 0011 Invalid connection ID xxxx 0100 Invalid CRC xxxx 0101 Watchdog time elapsed xxxx 0110 Invalid FSoE address xxxx 0111...
Page 21
System description Table 2-6: State information for a connection Value Description 100 (0x64) Reset state: The reset state is used to re-initialize the Safety over EtherCAT connection after the power-on or a Safety over EtherCAT communication error. 101 (0x65) Session state: During the transition to or in the session state a session ID is transferred from the Safety over EtherCAT master to the Safety over EtherCAT slave, which in turn responds with its own session ID.
System description 2.2.2 Diagram showing EL69x0 diagnostics under TwinCAT 3 The diagnostics is shown in Safety Project Online View for the hole safety project. In the event of an error the diagnostic texts are displayed in plain text. Errors are stored in the diag history of the EL/EJ6910, from where they can be read out.
System description 2.2.3 Info data connection Info data for TwinSAFE / FSoE connections can be enabled on the Connection tab of the alias device. Figure 2-9: Info data connection The info data is shown in the I/O tree structure below the TwinSAFE logic in the process image. From here, these signals can be linked with PLC variables.
System description 2.2.4 Function blocks info data Info data for function blocks can be enabled in the properties of the function block. Figure 2-11: Function block properties The info data is shown in the I/O tree structure below the TwinSAFE logic in the process image. From here, these signals can be linked with PLC variables.
System description 2.2.5 Groups info data Info data for TwinSAFE groups can be enabled via the properties of the TwinSAFE group. Right-click in an empty area of the worksheet and select Properties to access these parameters. Figure 2-13: Access to info data via Properties The info data is shown in the I/O tree structure below the TwinSAFE logic in the process image.
Page 26
System description Table 2-7: State information for an EL/EJ69x0 group Valu State Description Input RUN=1, no error in the group, and all connections have started up without error STOP Input RUN = 0 ERROR Group is in error, see Diagnostic information RESET After a group error has occurred, all errors have been rectified and the Err Ack signal is 1...
Function blocks 3 Function blocks The function blocks have a fixed functionality. The function blocks can be configured via parameters or properties. The inputs or outputs of a function block can be inputs or outputs of the local process image, but outputs of function blocks can also be linked with inputs of other function blocks.
Function blocks 3.1.2 Signal description Table 3-1: FB AND inputs Name Permitted type Data type Description AndIn1 TwinSAFE-In BOOL 1st input channel FB-Out Standard-In AndIn2 TwinSAFE-In BOOL 2nd input channel FB-Out AndIn3 TwinSAFE-In BOOL 3rd input channel FB-Out AndIn4 TwinSAFE-In BOOL 4th input channel FB-Out...
Page 29
Function blocks 3.1.2.1 Diagnostic and state information for the FB AND Table 3-5: Diagnostic information (16-bit value) Description 0-15 always 0 Table 3-6: State information (8-bit value) Value Description undefined The RUN state is assumed once all active inputs AndIn1-AndIn8 are set to 1 (ACTIVE_ANDIN=TRUE).
Function blocks 3.1.3 FB AND configuration in the TwinCAT System Manager Figure 3-2: FB AND configuration Use the Settings buttons to the right of two AndIn inputs to configure their behavior. The inputs are always single-channel. A discrepancy monitoring cannot be used for the FB AND. The 'AndIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings button.
Function blocks 3.1.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-3 FB AND in TwinCAT 3 Figure 3-4 FB AND properties Function blocks for TwinSAFE logic components...
Function blocks 3.2 The function block OR 3.2.1 Functional description With the FB OR several input signals can be linked via OR to one output signal. The input signal of each can be set to represent a break contact or a make contact. A make contact means that the corresponding input signal is negated, before it affects the OR.
Function blocks 3.2.2 Signal description Table 3-7: FB OR inputs Name Permitted type Data type Description OrIn1 TwinSAFE-In BOOL 1st input channel FB-Out OrIn2 TwinSAFE-In BOOL 2nd input channel FB-Out OrIn3 TwinSAFE-In BOOL 3rd input channel FB-Out OrIn4 TwinSAFE-In BOOL 4th input channel FB-Out OrIn5...
Page 34
Function blocks 3.2.2.1 Diagnostic and state information for FB OR Table 3-11: Diagnostic information (16-bit value) Description 0-15 always 0 Table 3-12: State information (8-bit value) Value Description undefined The RUN state is assumed if one or more of the active inputs OrIn1-OrIn8 is set to 1 (ACTIVE_ORIN=TRUE).
Function blocks 3.2.3 FB OR configuration in the TwinCAT System Manager Figure 3-6: FB OR configuration Their characteristics are configured with the setting buttons on the right near the two OrIn inputs, whereby the inputs are always single-channel. A discrepancy monitoring cannot be used for the OR. The 'OrIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings button.
Function blocks 3.2.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-7 FB OR in TwinCAT 3 Figure 3-8 FB OR properties Function blocks for TwinSAFE logic components...
Function blocks 3.3 The function block OPMODE 3.3.1 Functional description Operation mode selectors can be realized with the FB OPMODE. The function block has 8 inputs and 8 outputs, which are looped through one-to-one. Up to 8 different operation modes can be selected. The FB OPMODE sets the corresponding output only if exactly one input is set ("1").
Function blocks 3.3.2 Signal description Table 3-13: FB OPMODE inputs Name Permitted type Data type Description Restart TwinSAFE-In BOOL The 0->1->0 signal sequence must be detected on FB-Out the restart input, before the safe state of the outputs Standard-In can be removed, when starting the FB or when all outputs are switched to the safe state.
Page 39
Function blocks Table 3-14: Outputs of the FB OPMODE Name Permitted type Data Description type Error TwinSAFE-Out BOOL TRUE: FB-In The discrepancy time monitoring or the input monitoring Standard-Out has found an error. The acknowledgement of the error Local-Out must be carried out via the ERR_ACK input of the related TwinSAFE group FALSE: No error was found.
Page 40
Function blocks Table 3-15: Input and output types Type Description TwinSAFE-In TwinSAFE input, e.g. at an EL1904/KL1904 Standard-In Standard PLC variable (output in the PLC %Q*) FB-Out TwinSAFE FB output TwinSAFE-Out TwinSAFE output, e.g. at an EL2904/KL2904 Standard-Out Standard PLC variable (input in the PLC %I*) FB-In TwinSAFE FB input Local-Out...
Page 41
Function blocks Table 3-18: State information (8-bit value) Value Description undefined The FB OPMODE module assumes the RUN state if exactly one OpInX input is TRUE. The outputs assume the following values: Error=0 OpOutX=OpInX (1<=X<=8) STOP The FB OPMODE module assumes the STOP state if the input FbRun is FALSE.
Function blocks 3.3.3 Configuration of the FB OPMODE in the TwinCAT System Manager Figure 3-10: FB OPMODE configuration The manual restart is activated using the "'Activated' " checkbox on the right near the 'Restart' button. The inputs are activated via the 'Activated' check boxes to the right of the 'OpIn (x)' button. The 'Restart' or 'OpIn(x)' buttons can only be selected, once the corresponding check box has been selected.
Function blocks 3.3.4 Restart behavior If exactly one OpIn input is TRUE and the Restart signal is TRUE, Start state (FB State 6) is assumed. The detection of a change of the Restart signal from TRUE to FALSE triggers a check whether exactly one OpIn input is still logical 1.
Page 44
Function blocks In the following diagram the Restart is set to TRUE before the operation mode change takes place. Changing the input OpIn1 from TRUE to FALSE results in a switch to state 3. Once operation mode OpIn2 is TRUE, the system changes to the Start state (FB state 6), since the Restart input is already TRUE.
Function blocks 3.3.5 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-11 FB OPMODE in TwinCAT 3 Figure 3-12 FB OPMODE properties Function blocks for TwinSAFE logic components...
Function blocks 3.4 The function block ESTOP 3.4.1 Functional description An emergency stop circuit with up to eight emergency stop inputs (EStopIn1-EStopIn8) can be realized with the FB ESTOP. Each of the eight inputs can be parameterized as break contact (0 requests the safe state) or make contact (1 request the safe state).
Function blocks In the FB error state, the outputs assume the safe state "0", only the Error output is "1". The characteristics for acknowledging a discrepancy error can be set via the checkbox Safe Inputs after Disc Error. If the checkbox is checked, both inputs of the input group that has caused the discrepancy error have to switch to safe state simultaneously before the error can be reset.
Page 48
Function blocks Table 3-20: FB ESTOP outputs Name Permitted Data type Description type Error TwinSAFE-Out BOOL TRUE: FB-In The discrepancy time monitoring of an input pair, or Standard-Out one of the feedback loops, has found an error. The Local-Out error reset must be carried out via the ERR_ACK input of the related TwinSAFE group.
Page 49
Function blocks 3.4.2.1 Diagnostic and state information for FB ESTOP Table 3-23: Diagnostic information (16-bit value) Description Discrepancy error input group 1 Discrepancy error input group 2 Discrepancy error input group 3 Discrepancy error input group 4 EDM monitoring error EDM1 EDM monitoring error EDM2 Discrepancy error input group 1 with activated option "Safe Inputs after Disc Error"...
Page 50
Function blocks Value Description RESET The FB ESTOP module assumes the RESET state if no further error is pending after an error has occurred and the ErrAck input of the corresponding group is set to TRUE. The outputs assume the following values: Error=0 EStopOut=0 EStopDelOut=0...
Function blocks 3.4.3 FB ESTOP configuration in the TwinCAT System Manager Figure 3-14: FB ESTOP configuration The characteristics of an input pair are configured with the setting buttons on the right near the two EStopIn inputs of this input pair. The 'EStopIn(x)' buttons can only be selected if the corresponding input has been activated via the Settings button.
Function blocks 3.4.4 Restart behavior If all active EStop-In inputs and all active EDM inputs are TRUE and the Restart signal changes from FALSE to TRUE, the Start state (FB state 6) is assumed. The detection of a change of the Restart signal from TRUE to FALSE triggers a check whether all active EStop-In inputs are still TRUE and whether the EDM signal is still TRUE.
Page 53
Function blocks The following diagram shows the behavior of the ESTOP function block, where the change of the Restart signal from FALSE to TRUE takes place before the change of the EStop inputs from FALSE to TRUE. The Start state (FB state 6) is only assumed if both signals are TRUE. The output is enabled when the Restart input changes from TRUE to FALSE.
Page 54
Function blocks If the EDM signal of the ESTOP function block is not evaluated, the time when the change from FALSE to TRUE may occur at the Restart input is not monitored. This may also be the case before the emergency stop event.
Function blocks 3.4.5 ESTOP extension NOTE Support The extensions described below are only available in the EL/EJ6910 or newer terminals. These options cannot be used under the EL6900 and KL6904. Figure 3-15 EDM Reset Time The FB ESTOP can also be used to monitor the change of the state of the feedback signal (EDMn) when the outputs are switched on.
Function blocks 3.4.6 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-16 FB ESTOP in TwinCAT 3 Figure 3-17 FB ESTOP properties The function Safe Inputs after Disc Error is activated by default for the ESTOP function block in the EL6910 and cannot be disabled.
Function blocks 3.5 The function block MON 3.5.1 Functional description A safety door circuit with up to four inputs (MonIn(x)) can be realized with the FB MON for example. Each of the four inputs can be parameterized as break contact (0 requests the safe state) or make contact (1 request the safe state).
Page 58
Function blocks If Restart is disabled, the FB MON remains in the safe state if the EDM inputs do not have the signal state "1". An EDM error can therefore only be detected, when the manual restart is active. NOTE EDM monitoring error FB MON only reports an EDM error if manual restart is active.
Function blocks 3.5.2 Signal description Table 3-25: FB MON inputs Name Permitted type Data type Description Restart TwinSAFE-In BOOL Manual restart active: When the FB is started or if an FB-Out input has requested the safe state, the signal sequence Standard-In 0->1->0 must be detected at the Restart input before the safe state of the outputs is exited.
Page 60
Function blocks Table 3-26: FB MON outputs Name Permitted type Data Description type Error TwinSAFE-Out BOOL TRUE: FB-In The discrepancy time monitoring of an input pair, or Standard-Out one of the feedback loops, has found an error. The Local-Out error reset must be carried out via the ERR_ACK input of the related TwinSAFE group.
Page 61
Function blocks Table 3-30: State information (8-bit value) Value Description undefined The FB MON module assumes the RUN state if no error is present and neither the active MonIn inputs nor the active Secure inputs request a safe state. The outputs assume the following values: Error=0 MonOut=1 MonDelOut=1...
Page 62
Function blocks Value Description ERRORDELAY The FB MON module assumes the ERRDELAY state if a discrepancy error occurs in the RUN state (DiscError=TRUE) and the delay time for the MonDelOut output has not yet expired. This state can only be assumed if the output delay time in the configuration data is not 0.
Function blocks 3.5.3 FB MON configuration in the TwinCAT System Manager Figure 3-19: FB MON configuration The manual restart is activated using the "Manual" checkbox on the right near the 'Restart' button. The 'Restart' button can only be selected, if the manual restart is activated. The characteristics of the input pair are configured with the setting buttons on the right near the two MonIn or Secure inputs of an input pair.
Function blocks 3.5.4 Restart behavior If all active MonIn inputs and the active EDM inputs are TRUE and the Restart signal changes from FALSE to TRUE, the Start state (FB state 6) is assumed. The detection of a change of the Restart signal from TRUE to FALSE triggers a check whether all MonIn inputs are still TRUE and whether the EDM signal is still TRUE.
Page 65
Function blocks The following diagram shows the behavior of the MON function block; the rising edge of the Restart occurs before the rising edge of the MonIn inputs. The Start state (FB state 6) is only assumed if both signals are TRUE. The output is enabled with the falling edge at the Restart input. At least one of the EDM inputs of the FB is active.
Function blocks 3.5.5 MON extension NOTE Support The extensions described below are only available in the EL6910 or newer terminals. These options cannot be used under the EL6900 and KL6904. Figure 3-20 EDM Reset Time The FB MON can also be used to monitor the change of the state of the feedback signal (EDMn) when the outputs are switched on.
Function blocks 3.5.6 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-21 FB MON in TwinCAT 3 Figure 3-22 FB MON properties The function Safe Inputs after Disc Error is activated by default for the MON function block in the EL6910 and cannot be disabled.
Function blocks 3.6 The function block DECOUPLE 3.6.1 Functional description The FB DECOUPLE is for uncoupling of signals from a TwinSAFE connection. The function block has 8 inputs and 8 outputs. The inputs are looped through to the outputs one-to-one. The associated output must be linked as soon as one of the function block inputs is used.
Function blocks 3.6.2 Signal description Table 3-31: FB DECOUPLE inputs Name Permitted type Data type Description DecIn1 TwinSAFE-In BOOL 1st input channel FB-Out DecIn2 TwinSAFE-In BOOL 2nd input channel FB-Out DecIn3 TwinSAFE-In BOOL 3rd input channel FB-Out DecIn4 TwinSAFE-In BOOL 4th input channel FB-Out DecIn5...
Page 70
Function blocks Table 3-32: FB DECOUPLE outputs Name Permitted type Data type Description DecOut1 TwinSAFE-Out BOOL 1st output channel FB-In Standard-Out Local-Out DecOut2 TwinSAFE-Out BOOL 2nd output channel FB-In Standard-Out Local-Out DecOut3 TwinSAFE-Out BOOL 3rd output channel FB-In Standard-Out Local-Out DecOut4 TwinSAFE-Out BOOL...
Page 71
Function blocks 3.6.2.1 Diagnostic and state information for FB DECOUPLE Table 3-35: Diagnostic information (16-bit value) Description always 0 Table 3-36: State information (8-bit value) Value Description undefined The FB DECOUPLE module assumes the RUN state if the input FbRun is TRUE.
Function blocks 3.6.3 FB DECOUPLE configuration in the TwinCAT System Manager Figure 3-24: FB DECOUPLE configuration The FB DECOUPLE input variables are linked using the 'DecIn(x)' buttons. The FB DECOUPLE output variables are linked using the 'DecOut(x)' buttons. The 'MapState' and 'MapDiag' checkboxes are used to specify which FB diagnostic functions are mapped to the cyclic process image.
Function blocks 3.6.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-25 FB DECOUPLE in TwinCAT 3 Figure 3-26 FB DECOUPLE properties Function blocks for TwinSAFE logic components...
Function blocks 3.7 The function block TWOHAND 3.7.1 Functional description The FB TWOHAND implements two-hand control. Both input groups must be actuated simultaneously to switch the output. Repeated setting of the output is only possible if both input groups were not actuated at the same time.
Function blocks 3.7.2 Signal description Table 3-37: FB TWOHAND inputs Name Permitted type Data type Description Twohand1 TwinSAFE-In BOOL 1st input channel. The parameterization determines, FB-Out whether the input is linked to a break contact (safe state will be requested by logical 0) or make contact (safe state will be requested by logical 1).
Page 76
Function blocks 3.7.2.1 Diagnostic and state information for FB TWOHAND Table 3-41: Diagnostic information (16-bit value) Description Discrepancy error input pair 1 Discrepancy error input pair 2 Discrepancy error between the two input pairs Two-hand error - one of the two input pairs is actuated and waiting for the second input pair.
Page 77
Function blocks Value Description RESET The FB TWOHAND module assumes the RESET state if no further error is pending after an error has occurred and the ErrAck input of the corresponding group is set to TRUE. The outputs assume the following values: Error=0 TwoHandOut=0 1BUTTON...
Function blocks 3.7.3 FB TWOHAND configuration in the TwinCAT System Manager Figure 3-28: FB TWOHAND configuration Discrepancy time monitoring between the two input pairs is activated via the Discrepancy checkbox. The discrepancy time can be set in the selection box next to the checkbox (max. 2500 ms). The characteristics of the input pair are configured with the setting buttons on the right near the two TwoHand(x) inputs of an input pair.
Function blocks 3.7.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-29 FB TWOHAND in TwinCAT 3 Figure 3-30 FB TWOHAND properties Function blocks for TwinSAFE logic components...
Function blocks 3.8 The function block MUTING 3.8.1 Functional description FB MUTING is used to realize specified suppression of the protective function, e.g. for transporting material into the protection zone. The function block output remains enabled despite the fact that the connected sensor (e.g.
Function blocks NOTE KL6904 The Muting function block is not available in the KL6904. 3.8.2 Signal description Table 3-43: FB MUTING inputs Name Permitted Data Description type type Enable TwinSAFE-In BOOL Muting can be activated via the Enable input. If the input is FB-Out logic 0 an interruption of the protective device results in Standard-In...
Page 82
Function blocks Table 3-44: FB MUTING outputs Name Permitted type Data type Description Error TwinSAFE-Out BOOL TRUE: FB-In The discrepancy time monitoring of a two-channel Standard-Out input group has detected an error, the muting sequence was violated or the maximum muting time was exceeded.
Page 83
Function blocks 3.8.2.1 Diagnostic and state information for FB MUTING Table 3-47: Diagnostic information (16-bit value) Description Discrepancy error in muting input group 1 Discrepancy error in the OSSD input group Discrepancy error in muting input group 2 EDM monitoring error EDM1 EDM monitoring error EDM2 Muting sequence was violated Maximum muting time was exceeded...
Page 84
Function blocks Value Description RESET The FB MUTING module assumes the RESET state if no further error is pending after an error has occurred and the ErrAck input of the corresponding group is set to TRUE. The outputs assume the following values: Error=0 MutingActive=0 MuteOut=0...
Function blocks 3.8.3 FB MUTING configuration in the TwinCAT System Manager Figure 3-32: FB MUTING configuration An input through which muting can be enabled must be connected via the 'Enable' button. The 'Muting(x)' buttons are used to connect the muting sensors to the function block. Use the Settings buttons to the right of two muting inputs to configure them.
Page 86
Function blocks The error state can be connected via the 'Error' button. NOTE Error state If the muting function was interrupted by an error, the user should ensure via the application that the material can be removed from the muting area. Only then is an error acknowledgement possible. Via the 'MutingActive' button a signal can be linked that can be used for a muting lamp, for example.
Page 87
Function blocks 3.8.3.1 Configuration example with 4 individual muting sensors Figure 3-33: Configuration example with FB MUTING The following screenshot shows the parameterization of FB Muting for this case. The 'Sequential Inputs' checkbox is checked. The 4 muting inputs are configured and wired as single-channel inputs. Figure 3-34: Muting example Function blocks for TwinSAFE logic components...
Page 88
Function blocks Figure 3-35: Muting FB sequence Function blocks for TwinSAFE logic components...
Page 89
Function blocks 3.8.3.2 Configuration example with two two-channel muting sensors Figure 3-36: Configuration example with two two-channel muting sensors The following screenshot shows the parameterization of FB MUTING for this case. The 'Sequential Inputs' checkbox is not checked. The 4 muting inputs are configured and wired as two-channel inputs with discrepancy time monitoring.
Page 90
Function blocks Figure 3-38: Muting FB sequence Function blocks for TwinSAFE logic components...
Function blocks 3.8.4 Extensions FB Muting EL/EJ6910 NOTE Support The extensions described below are only available in the EL6910 or newer terminals. These options cannot be used under the EL6900 and KL6904. Figure 3-39 FB Muting EL6910 In addition to existing the options, the following additional functions are now available: Option Backwards Mode: If the option is active, a muting sequence is supported in forward and backward direction.
Page 92
Function blocks 3.8.4.1 Diagnostic and state information for FB MUTING with functional expansion Table 3-49: Diagnostic information (16-bit value) Description Discrepancy error in muting input group 1 Discrepancy error in the OSSD input group Discrepancy error in muting input group 2 EDM monitoring error EDM1 EDM monitoring error EDM2 Muting sequence was violated...
Function blocks 3.8.5 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-40 FB MUTING in TwinCAT 3 Figure 3-41 FB MUTING properties Function blocks for TwinSAFE logic components...
Function blocks 3.9 The function block EDM 3.9.1 Functional description The FB EDM (External Device Monitor) is used for time monitoring of signals Mon1 and Mon2. Switch-on and switch-off monitoring can be configured. In default state both monitoring functions are inactive. At least one of the two monitoring functions must be enabled.
Function blocks 3.9.2 Signal description Table 3-51: FB EDM inputs Name Permitted type Data type Description Mon1 TwinSAFE-In BOOL 1st input. The input can be parameterized as a break FB-Out contact or a make contact. Standard-In Mon2 TwinSAFE-In BOOL 2nd input, which has to assume the value opposite to input FB-Out 1 within the set times.
Page 96
Function blocks Table 3-56: State information (8-bit value) Value Description undefined STOP The FB EDM module assumes the STOP state if the input FbRun is FALSE. The outputs assume the following values: Error=0 ERROR If the FB EDM module detects an error, the FB EDM module assumes the ERROR state and transmits the corresponding Diag message to the GROUP module.
Function blocks 3.9.3 FB EDM configuration in the TwinCAT System Manager Figure 3-43: FB EDM configuration The FB EDM input variables are linked using the 'Mon1' and 'Mon2' buttons. Use the Settings button to right or the two Mon inputs to configure them. Only single-channel evaluation is available.
Function blocks 3.9.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-44: FB EDM in TwinCAT 3 Figure 3-45: FB EDM properties The 'Switch-On Monitoring' and 'Switch-Off Monitoring' text boxes can be used to set the switch on- and switch-off delay time.
Function blocks 3.10 The function block RS 3.10.1 Functional description The FB RS realizes a reset / set functionality. Logic 1 at input Set and logic 0 at input Reset leads to logic 1 at the output. Logic 0 at input Set and logic 1 at input Reset leads to logic 0 at the output. If both inputs are set to logic 1, the Reset signal is dominant and leads to logic 0 at the output.
Function blocks 3.10.2 Signal description Table 3-57: FB RS inputs Name Permitted type Data type Description Reset TwinSAFE-In BOOL 1st input channel; the parameterization indicates whether a FB-Out break contact or a make contact is linked to this input. TwinSAFE-In BOOL 2nd input channel;...
Function blocks Value Description If the Reset input is 0 and the Set input is 1, the FB RS module assumes the RUN state. The outputs assume the following values: RsOut=1 3.10.3 FB RS configuration in the TwinCAT System Manager Figure 3-47: FB RS configuration Use the Settings button to the right of the Reset and Set inputs to activate the input signals and configure them as make contact (NO) or break contact (NC).
Function blocks 3.10.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-48: FB RS in TwinCAT 3 Figure 3-49: FB RS properties Function blocks for TwinSAFE logic components...
Function blocks 3.11 The function block SR 3.11.1 Functional description The FB SR realizes a set / reset functionality. Logic 1 at input Set and logic 0 at input Reset leads to logic 1 at the output. Logic 0 at input Set and logic 1 at input Reset leads to logic 0 at the output. If both inputs are set to logic 1, the Set signal is dominant and leads to logic 1 at the output.
Function blocks 3.11.2 Signal description Table 3-63: FB SR inputs Name Permitted Data type Description type TwinSAFE-In BOOL 1st input channel; the parameterization indicates FB-Out whether a break contact or a make contact is linked to this input. Reset TwinSAFE-In BOOL 2nd input channel;...
Function blocks Value Description SAFE If the Reset input is 1 and the Set input is 0, the FB SR module assumes the SAFE state. The outputs assume the following values: SrOut=0 If the Set input is 1, the FB SR module assumes the SET state. The outputs assume the following values: SrOut=1 3.11.3 FB SR configuration in the TwinCAT System Manager...
Function blocks 3.11.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-52: FB SR in TwinCAT 3 Figure 3-53: FB SR properties Function blocks for TwinSAFE logic components...
Function blocks 3.12 The function block TON 3.12.1 Functional description FB TON is used to realize a switch-on delay. Logic 1 at input TonIn is transferred to the output with a set delay time. The output is not activated if the input is set to 0 again before the delay time has elapsed. The error output is inactive since the function block sets no errors.
Function blocks 3.12.2 Signal description Table 3-69: FB TON inputs Name Permitted type Data type Description TonIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates whether a FB-Out break contact or a make contact is linked to this input. Table 3-70: FB TON outputs Name Permitted type Data type...
Function blocks Value Description SAFE If the TimerIn input is 0, the FB TON module assumes the SAFE state. If the TimerIn input changes to 1 in the SAFE state, the FB TON module starts the delay timer with the DelayTime and changes to the DELAYIN state.
Function blocks 3.12.4 TON extension NOTE Support The extensions described below are only available in the EL6910 or newer terminals. These options cannot be used under the EL6900 and KL6904. In the EL6910 the FB TON now also supports times between 1 ms and 600 seconds. The function block has two timebases: 1 ms and 10 ms.
Function blocks 3.13 The function block TON2 3.13.1 Functional description The FB TON2 behaves in the same way as the FB TON (see chapter 3.12) but is extended by a feature which stores the current timer time value on the TwinSafe logic, so that the logic program can continue running for the remaining time after start-up.
Page 112
Function blocks In the properties of the FB TON2 the parameter Starts with remaining time can be enabled in addition to the diagnostic data. In the following time diagram the TON delay time is set to 120 seconds. While TonIn is set, the station is switched off (EtherCAT state exits OP (8)) and switched on again after a certain time.
Function blocks 3.13.2 Signal description Table 3-75: Inputs of the FB TON2 Name Permitted type Data type Description TonIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates whether a FB-Out break contact or a make contact is linked to this input. Enable TwinSAFE-In BOOL...
Page 114
Function blocks Table 3-79: State information (8-bit value) Value Description undefined If the TimerIn input is 1 and the delay time has expired (DelayTimeExpired=TRUE), the FB TON module assumes the RUN state. The outputs assume the following values: TimerOut=1 STOP The FB TON module assumes the STOP state if the input FbRun is FALSE.
Function blocks 3.14 The function block TOF 3.14.1 Functional description FB TOF is used to realize a switch-off delay. Logic 1 at input TofIn is transferred to the output with a set delay time. The output remains activated if the input is set to 1 again before the switch-off delay time has elapsed.
Function blocks 3.14.2 Signal description Table 3-80: FB TOF inputs Name Permitted type Data type Description TofIn1 TwinSAFE-In BOOL 1st input channel; the parameterization indicates whether a FB-Out break contact or a make contact is linked to this input. Table 3-81: FB TOF outputs Name Permitted type Data type...
Function blocks Value Description SAFE If the TimerIn input is 0 and the DelayTime has expired (DelayTimeExpired=TRUE), the FB TOF module assumes the SAFE state. The outputs assume the following values: TimerOut=0 DELAY_OUT If the TimerIn input is 0 and the DelayTime has not yet expired (DelayTimeExpired=FALSE), the FB TOF module assumes the DELAYOUT state.
Function blocks 3.14.4 TOF extension NOTE Support The extensions described below are only available in the EL6910 or newer terminals. These options cannot be used under the EL6900 and KL6904. In the EL6910 the FB TOF now also supports times between 1 ms and 600 seconds. The function block has two timebases: 1 ms and 10 ms.
Function blocks 3.15 The function block CONNECTION SHUTDOWN 3.15.1 Functional description FB CONNECTION SHUTDOWN is used to deactivate a TwinSAFE connection. If the function block input becomes active, the connection is closed, a shutdown command is sent to the FSoE partner, and feedback is sent to the output.
Function blocks On the opposite side the function block is called without connected inputs. The output Deactivated is set when the connection is terminated due to a shutdown command from the communication partner. Figure 3-64: Function block CONNECTION SHUTDOWN on the opposite side 3.15.2 Signal description Table 3-86: FB CONNECTION SHUTDOWN inputs Name...
Page 121
Function blocks Table 3-87: FB CONNECTION SHUTDOWN outputs Name Permitted Data type Description type Error TwinSAFE-Out BOOL TRUE: FB-In The discrepancy time monitoring of a 2-channel input Standard-Out group has detected an error. The error reset must be carried out via the ERR_ACK input of the related TwinSAFE group.
Page 122
Function blocks Table 3-91: State information (8-bit value) Value Description undefined If the CONNECTION module has received a shutdown command on the assigned connection, it switches the connection to SHUTDOWN state and reports this state to the FB CS module, which then assumes the RUN state. If all activated DeactivateX inputs are TRUE, the module switches to the RUN state and instructs the CONNECTION module to send a shutdown command via the assigned connection and to set it to SHUTDOWN state.
Function blocks 3.15.3 FB ConnectionShutdown configuration in the TwinCAT System Manager Figure 3-65: FB CONNECTION SHUTDOWN configuration The Settings button to the right of the Deactivate(x) buttons can be used to activate the inputs and configured them as make (NO) or break (NC) contacts. In the default state the inputs are disabled. The 'Deactivate1' and 'Deactivate2' buttons are used to link the input variables of the FB Connection Shutdown.
Function blocks 3.15.4 Display in TwinCAT 3 Display of the function block and its properties in TwinCAT 3. Figure 3-66: FB Connection Shutdown in TwinCAT 3 Figure 3-67: FB Connection Shutdown properties NOTE Shutdown Before a connection can be disabled, it must have started up without error and be in DATA state. For modular machines, where a module is generally not available, for example, this concept should be realized via additional TwinSAFE groups.
Function blocks 3.16 The function block ADD 3.16.1 Functional description The FB ADD is used to add the two connected analog input values and transfer them to the AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Page 126
Function blocks Table 3-93: FB ADD outputs Name Permitted type Data type Description Error TwinSAFE-Out BOOL Error output (see diagnostic information) FB-In Standard-Out AnalogOut TwinSAFE-Out INT16 1st output channel with the addition result FB-In INT32 Standard-Out UINT16 UINT32 Table 3-94: Input and output types Type Description TwinSAFE-In...
Page 127
Function blocks Table 3-98: State information Value Description not used The FB ADD module cyclically adds the two analog inputs AnalogIn1 and AnalogIn2. If no overflow or underflow occurs during the addition, the FB ADD module is in the RUN state. The outputs assume the following values: Error=0 AnalogOut = result of the addition...
Page 128
Function blocks 3.16.3 FB ADD configuration in TwinCAT 3 Figure 3-69: FB ADD configuration Figure 3-70: FB ADD properties Figure 3-71: FB ADD port properties A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can be linked to input signals.
Function blocks 3.17 The function block SUB 3.17.1 Functional description The FB SUB is used to subtract the AnalogIn2 input from the AnalogIn1 input and transfer it to the AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Page 130
Function blocks Table 3-100: FB SUB outputs Name Permitted type Data type Description Error TwinSAFE-Out BOOL Error output (see diagnostic information) FB-In Standard-Out AnalogOut TwinSAFE-Out INT16 1st output channel with the subtraction result FB-In INT32 Standard-Out UINT16 UINT32 Table 3-101: FB SUB input and output types Type Description TwinSAFE-In...
Page 131
Function blocks Table 3-105: State information Value Description not used The FB SUB module cyclically subtracts the two analog inputs AnalogIn1 and AnalogIn2. If no overflow or underflow occurs during the subtraction, the FB SUB module is in the RUN state.
Page 132
Function blocks 3.17.3 FB SUB configuration in TwinCAT 3 Figure 3-73: FB SUB configuration Figure 3-74: FB SUB properties Figure 3-75: FB SUB port properties A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can be linked to input signals.
Function blocks 3.18 The function block MUL 3.18.1 Functional description The FB MUL is used to multiply the AnalogIn1 input with the AnalogIn2 input and transfer the result to the AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Page 134
Function blocks Table 3-107: FB MUL outputs Name Permitted type Data type Description Error TwinSAFE-Out BOOL Error output (see diagnostic information) FB-In Standard-Out AnalogOut TwinSAFE-Out INT16 1st output channel with the multiplication result FB-In INT32 Standard-Out UINT16 UINT32 Table 3-108: Input and output types Type Description TwinSAFE-In...
Page 135
Function blocks Table 3-112: State information Value Description not used In RUN state the FB MUL module enters the result of the multiplication in the AnalogOut output. The outputs assume the following values: Error=0 AnalogOut = multiplication result STOP The FB MUL module assumes the STOP state if the input FbRun is FALSE. The outputs assume the following values: Error=0 AnalogOut=0...
Function blocks 3.18.3 FB MUL configuration in TwinCAT 3 Figure 3-77: FB MUL configuration Figure 3-78: FB MUL properties Figure 3-79: FB MUL port properties A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can be linked to input signals.
Function blocks 3.19 The function block DIV 3.19.1 Functional description The FB DIV is used to divide the AnalogIn1 input by the AnalogIn2 input and transfer the result to the AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Function blocks 3.19.2 Signal description Table 3-113: FB DIV inputs Name Permitted type Data type Description AnalogIn1 TwinSAFE-In INT16 1st input channel for division FB-Out INT32 Standard-In UINT16 TwinSAFE SC UINT32 AnalogIn2 TwinSAFE-In INT16 2nd input channel for division FB-Out INT32 Standard-In UINT16...
Page 139
Function blocks 3.19.2.1 Diagnostic and state information for the FB DIV Table 3-117: Diagnostic information Value Description The AnalogOut output is correct The AnalogOut output has an underflow (is less than the smallest possible value) The AnalogOut output has an overflow (is greater than the largest possible value) Table 3-118: Diag Message Text ID...
Function blocks 3.19.3 FB DIV configuration in TwinCAT 3 Figure 3-81: FB DIV configuration Figure 3-82: FB xxx properties Figure 3-83: FB xxx port properties A mouse click next to the FB port, here AnalogIn1 and AnalogIn2, can be used to create variables that can be linked to input signals.
Function blocks 3.20 The function block COMPARE 3.20.1 Functional description The FB COMPARE checks the 2-5 analog inputs CompIn1 to CompIn5 for equality within a time and value tolerance window. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output CompOut must be selected to match the input types.
Function blocks 3.20.2 Signal description Table 3-120: FB COMPARE inputs Name Permitted type Data type Description CompIn1 TwinSAFE-In INT16 1st input channel for the comparison (1oo2, 2oo3, FB-Out INT32 3oo5) Standard-In UINT16 TwinSAFE SC UINT32 CompIn2 TwinSAFE-In INT16 2nd input channel for the comparison (1oo2, 2oo3, FB-Out INT32 3oo5)
Page 143
Function blocks 3.20.2.1 Diagnostic and state information for the FB COMPARE Table 3-124: Diagnostic information Value Description The CompOut output is correct The CompOut output has an underflow (is less than the smallest possible value) The CompOut output has an overflow (is greater than the largest possible value) Table 3-125: Diag Message Text ID...
Page 144
Function blocks Table 3-126: State information Value Meaning undefined The FB COMPARE module assumes the RUN state if a sufficient number of analog inputs deviate from each other by no more than the allowed deviation (ValuesEqual=TRUE). The outputs assume the following values: Error=0 IsValid=1 CompOut=CompInX (X= smallest input that does not deviate)
Function blocks 3.20.3 FB COMPARE configuration in TwinCAT 3 Figure 3-85: FB Compare configuration Figure 3-86: FB Compare properties Figure 3-87: FB Compare port properties A mouse click next the FB port, here CompIn1 to CompIn5, can be used to create variables that can be linked to input signals.
Function blocks 3.21 The function block LIMIT 3.21.1 Functional description The FB LIMIT is used to check the AnalogIn input for the values linked to MinValue and MaxValue or the values entered in the parameters Minimum Value and Maximum Value. The input data types INT16, INT32, UINT16 and UINT32 are permitted.
Function blocks 3.21.2 Signal description Table 3-127: FB LIMIT inputs Name Permitted type Data type Description AnalogIn TwinSAFE-In INT16 Input channel for limitation FB-Out INT32 Standard-In UINT16 TwinSAFE SC UINT32 MinValue TwinSAFE-In INT16 Minimum value FB-Out INT32 Standard-In UINT16 TwinSAFE SC UINT32 MaxValue TwinSAFE-In...
Page 148
Function blocks 3.21.2.1 Diagnostic and state information for the FB LIMIT Table 3-131: Diagnostic information Value Description No diagnostic information MinValue is greater than MaxValue Table 3-132: Diag Message Text ID Meaning Parameter 1 Parameter 2 Parameter 3 0x4090 MinValue is greater than FB number MinValue MaxValue...
Function blocks 3.21.3 FB LIMIT configuration in TwinCAT 3 Figure 3-89: FB Limit configuration Figure 3-90: FB Limit properties Figure 3-91: FB Limit port properties A mouse click next the FB port, here AnalogIn1, MinValue und MaxValue, can be used to create variables that can be linked to input signals.
Function blocks 3.22 The function block COUNTER 3.22.1 Functional description The FB Counter is used to realize an up/down counter. The inputs Reset, CountUp and CountDown are of data type BOOL. The outputs Error, CounterOut and CounterZero are also of data type BOOL. The output ActValue indicates the current internal counter value and can be of data type INT16, UINT16, INT32 or UINT32.
Function blocks 3.22.2 Signal description Table 3-134: FB Counter inputs Name Permitted type Data type Description Reset TwinSAFE-In BOOL Reset input for resetting the counter to Preset FB-Out Value Standard-In TwinSAFE SC CountUp TwinSAFE-In BOOL CountUp input for incrementing the internal FB-Out counter value by 1 Standard-In...
Page 152
Function blocks 3.22.2.1 Diagnostic and state information for the FB Counter Table 3-138: Diagnostic information Value Description No diagnostic information The ActValue output has an underflow (is less than the smallest possible value) The ActValue output has an overflow (is greater than the largest possible value) Table 3-139: Diag Message Text ID Meaning...
Function blocks 3.22.3 FB Counter configuration in TwinCAT 3 Figure 3-93: FB Counter configuration Figure 3-94: FB Counter properties Figure 3-95: FB Counter port properties A mouse click next to the FB port, here Reset, CountUp, CountDown, Error, CounterOut, CounterZero and ActValue, can be used to create variables that can be linked to input or output signals.
Function blocks 3.23 The function block SCALE 3.23.1 Functional description The FB SCALE is used to multiply the AnalogIn input with the scaling factor and then divided before the scaling offset is added. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Function blocks 3.23.2 Signal description Table 3-141: FB Scale inputs Name Permitted type Data type Description AnalogIn1 TwinSAFE-In INT16 Input for scaling. FB-Out INT32 Standard-In UINT16 TwinSAFE SC UINT32 Table 3-142: FB Scale outputs Name Permitted type Data type Description Error TwinSAFE-Out BOOL...
Page 156
Function blocks Table 3-146: Diag Message Text ID Meaning Parameter 1 Parameter 2 Parameter 3 0x40B0 The AnalogOut output has an underflow (is FB number AnalogIn less than the smallest possible value) 0x40B1 The AnalogOut output has an overflow (is FB number AnalogIn greater than the largest possible value)
Function blocks 3.23.3 FB Scale configuration in TwinCAT 3 Figure 3-97: FB Scale configuration Figure 3-98: FB Scale properties Figure 3-99: FB Scale port properties Function blocks for TwinSAFE logic components...
Page 158
Function blocks A mouse click next to the FB Port, here AnalogIn, Error, StuckAtError and AnalogOut, can be used to create variables that can be linked to input or output signals. Settings such as changing the data type or activation of the input can be made via the properties of the FB port. The MapState and MapDiag entries define which diagnostic functions of the FB are mapped to the cyclic process image.
Function blocks 3.24 The function block SPEED 3.24.1 Functional description The FB SPEED is used to store the AnalogIn input and calculate a speed from it, based on the specified time interval. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output must be selected to match the input types.
Function blocks 3.24.2 Signal description Table 3-148: FB Speed inputs Name Permitted type Data type Description Position TwinSAFE-In INT16 Input channel for speed calculation FB-Out INT32 Standard-In UINT16 TwinSAFE SC UINT32 Table 3-149: FB Speed outputs Name Permitted type Data type Description Error TwinSAFE-Out...
Page 161
Function blocks Table 3-154: State information Value Description In the RUN state the FB SPEED module enters the result of the speed calculation in the Speed output. The outputs assume the following values: Error=0 Speed = calculated speed STOP The FB SPEED module assumes the STOP state if the input FbRun is FALSE. The outputs assume the following values: Error=0 Speed=0...
Function blocks 3.24.3 FB Speed configuration in TwinCAT 3 Figure 3-101: FB Speed configuration Figure 3-102: FB Speed properties Figure 3-103: FB Speed port properties A mouse click next to the FB Port, here Position, Error and Speed, can be used to create variables that can be linked to input or output signals.
Function blocks 3.25 The function block LOADSENSING 3.25.1 Functional description The FB LoadSensing can be used to check the AnalogInX and AnalogInY inputs; specifically, whether the AnalogInY values are within a certain range at position AnalogInX. The input data types INT16, INT32, UINT16 and UINT32 are permitted.
Function blocks Figure 3-105 - Diagram showing verification of the characteristic curve 3.25.2 Signal description Table 3-155: FB LoadSensing inputs Name Permitted type Data type Description Inactive TwinSAFE-In BOOL Input for activating the FB FB-Out Standard-In TwinSAFE SC AnalogInX TwinSAFE-In INT16 Analog x-value FB-Out...
Page 165
Function blocks Table 3-156: FB LoadSensing outputs Name Permitted type Data type Description Valid TwinSAFE-Out BOOL This output is set if AnalogInY is within the switch- FB-In off level. Standard-Out Warning TwinSAFE-Out BOOL This output is set if AnalogInY is between the FB-In switch-off level and the warning level.
Page 166
Function blocks Table 3-161: State information Value Description If InActive is FALSE and AreaValid is TRUE, the FB LS module assumes the RUN state. The outputs assume the following values: Valid=1 Warning=0 STOP The FB LS module assumes the STOP state if the input FbRun is FALSE. The outputs assume the following values: Valid=0 Warning=0...
Function blocks 3.25.3 FB LOADSENSING configuration in TwinCAT 3 Figure 3-106: FB LOADSENSING configuration Figure 3-107: FB LOADSENSING table If values for Y1 and Y2 are specified in the table, values for the warning level WY1 and WY2 must also be specified.
Page 168
Function blocks Figure 3-108: FB LOADSENSING properties Figure 3-109: FB LOADSENSING port properties A mouse click next to the FB port, here Inactive, AnalogInX, AnalogInY, Valid and Warning, can be used to create variables that can be linked to input or output signals. Settings such as changing the data type or activation of the input can be made via the properties of the FB port.
Function blocks 3.26 The function block CAMMONITOR 3.26.1 Functional description The FB CamMonitor can be used to realize an electronic cam controller. In addition to excentric mode, pendulum stroke mode should also be supported. CAUTION FB CAMMONITOR The FB CAMMONITOR provides a safe evaluation function block, which can output the cam data (TDC, BDC, UpwardsMove) according to the set fixed values, depending on the current position.
Page 170
Function blocks DANGER Press position sensing! Position sensing must be realized corresponding to the required SIL or performance level. The user or machine manufacturer must verify that this condition is satisfied. The position value must be verified based on several analog values or made available to the function block by other safe means.
Function blocks 3.26.2 General properties of the FB CAMMONITOR Figure 3-111: FB CAMMONITOR properties Figure 3-112: FB CAMMONITOR port properties A mouse click next to the FB Port can be used to create variables that can be linked with input or output signals.
Page 172
Function blocks Sample position sensing In the following sample position sensing takes place via 2 separate encoder systems. Scaling and verification takes place within the TwinSAFE logic. It is important that the encoder systems use a different procedure for determining the position and are mechanically decoupled. The user should consider shaft breakage detection in the mechanical configuration.
Function blocks 3.26.3 Application excentric mode In excentric mode, only one direction of rotation is permitted. The FB checks that after a cycle the position stops after TDC (top dead center) plus maximum overrun (OverrunMax). The current overrun or position can be output after TDC (OverrunTDC).
Page 174
Function blocks 3.26.3.2 Inputs Name Data type Description Automatic safeBOOL 0: Normal operation 1: Automatic mode (no parameter verification) SettingMode safeBOOL Parameter transfer in setting-up mode. Internal parameters can be changed if the input is set to 1. Position analog Press position.
Page 175
Function blocks 3.26.3.3 Outputs Name Permitted type Description Error safeBOOL Error output BOOL safeBOOL Boolean output TDC is set if the current position is between TDCx_LowerLimit and TDCx_UpperLimit. BOOL safeBOOL Boolean output BDC is set if the current position is between BDC_LowerLimit and BDC_UpperLimit.
Page 176
Function blocks 3.26.3.5 Scope recording of the sequence Figure 3-116: ScopeView display of the signal sequence Color Signal description Current press position (here single-turn resolution 0 to 8192 increments) OverrunTDC signal (change in position once TDC_LowerLimit is reached) FB input CamReset (rising and falling edge before a motion may start) FB input PressStarted (is set to 1 when the press motion is started and set to 0 when the press is stopped.) FB output TDC.
Page 177
Function blocks 3.26.3.6 Cam Monitor function block excentric mode settings Figure 3-117: FB CamMonitor in excentric mode Description of the fixed values of the sample configuration. The user must adjust these values according to the hardware used. The MaxPosition of 8192 increments is output in the event of a complete stroke by the encoder system used.
Function blocks 3.26.4 Application: pendulum mode In pendulum mode both directions of rotation are permitted. Two upper reversal points are parameterized here. Since the curve based on which the press is to be moved can or must be adjusted for each product, the maximum range of the oscillating stroke is set as the limits for the upper reversal points.
Page 179
Function blocks 3.26.4.2 Inputs Name Permitted type Description Automatic safeBOOL 0: Normal operation 1: Automatic mode (no parameter verification) SettingMode safeBOOL Setting-up mode. Internal parameters can be changed if the input is set to 1. Position analog Press position. The position value must be verified reliably (UINT16/UINT32) from several analog values or made available to the function block by another other safe method, according to the...
Page 180
Function blocks 3.26.4.3 Outputs Name Permitted type Description Error safeBOOL Error output (see diagnostic information) BOOL safeBOOL Boolean output TDC is set if the current position is between TDCx_LowerLimit and TDCx_UpperLimit. BOOL safeBOOL Boolean output BDC is set if the current position is between BDC_LowerLimit and BDC_UpperLimit.
Page 181
Function blocks 3.26.4.5 Scope recording of the sequence Figure 3-119: ScopeView display of the signal sequence Color Signal description Current press position (here single-turn resolution 0 to 8192 increments). Oscillation between approx. 1300 and 6500 increments. FB input CamReset (rising and falling edge before a motion may start) FB input PressStarted (is set to 1 when the press motion is started and set to 0 when the press is stopped.) FB output TDC.
Function blocks 3.26.4.6 CamMonitor function block settings, pendulum mode Figure 3-120: FB CamMonitor in pendulum mode Description of the fixed values of the sample configuration. The user must adjust these values according to the hardware used. The MaxPosition of 8192 increments is output in the event of a complete stroke by the encoder system used.
Page 183
Function blocks 3.26.5.1 Inputs Name Data type Description Automatic safeBOOL 0: Normal operation 1: Automatic mode (no parameter verification) SettingMode safeBOOL Parameter transfer in setting-up mode. Internal parameters can be changed if the input is set to 1. Position analog Press position.
Page 184
Function blocks 3.26.5.2 Outputs Name Permitted type Description Error safeBOOL Error output BOOL safeBOOL Boolean output TDC is set if the current position is between TDCx_LowerLimit and TDCx_UpperLimit. BOOL safeBOOL Boolean output BDC is set if the current position is between BDC_LowerLimit and BDC_UpperLimit.
Page 185
Function blocks 3.26.5.4 Scope recording of the sequence Figure 3-121: ScopeView display of the signal sequence Color Signal description FB input CamReset (rising and falling edge before a motion may start) OverrunCAM (FB input) UpwardCAM (FB input) TDC (FB output; here position 64535 to 100) BDC (FB output;...
Page 186
Function blocks 3.26.5.5 CamMonitor function block hardware cam settings Figure 3-122: FB CamMonitor in excentric mode with hardware cams Description of the fixed values of the sample configuration. The user must adjust these values according to the hardware used. The MaxPosition of 65535 increments is output in the event of a complete stroke by the encoder system used.
Function blocks 3.26.6 Description of the process 3.26.6.1 Standstill detection The FB CAMMONITOR detects a standstill (Stopped =TRUE) if the change in position within the StopDetectionTime is less than or equal to the AllowedPositionJitter. 3.26.6.2 Press movement If the input PressStarted is TRUE, the function block monitors the press for movement. The FB CAMMONITOR detects a press movement if the change in position at the Position input within the MoveDetectionTime is greater than the MinPositionChange.
Function blocks 3.26.7 Diagnostics messages excentric mode 3.26.7.1 Parameter error Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3 In excentric mode the following parameter errors may occur and be reported accordingly. The TDCUpperLimit (%d) is lower FB instance TDC1Upper Allowed TDC1UpperLimit <=...
Page 189
Function blocks 3.26.7.2 Movement errors Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3 Movement errors reported in function block state ERROR Automatic = FALSE AND FB instance BackwardsMove = FALSE AND MoveContraClockWise The Position has been changed 0x400E =TRUE negative Automatic = FALSE AND...
Page 190
Function blocks 3.26.7.4 Error while UpwardsCAM input is active Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3 UpwardsCAM errors reported in function block state ERROR Automatic=FALSE AND The input UpwardsCAM was FB instance Position UpwardsCAM=TRUE AND TRUE in the area between OverrunMaxRightArea=TR OverrunMax and 0x400F...
Page 191
Function blocks 3.26.7.6 Error while PressStarted input is active Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3 Errors reported in function block state ERROR when input PressStarted is TRUE If PressStarted is TRUE FB instance and Stopped does not The input PressStarted is change to FALSE within TRUE and the position did not...
Function blocks 3.26.8 Diagnostic messages pendulum mode 3.26.8.1 Parameter error Text ID Meaning Message Parameter Parameter 2 Parameter 3 In pendulum mode the following parameter errors may occur and be reported accordingly. The TDC2UpperLimit (%d) is FB instance TDC2UpperLi AllowedPositi TDC2UpperLimit <= lower or equal than the onJitter...
Page 193
Function blocks 3.26.8.2 Movement errors Text ID Meaning Message Parameter 1 Parameter 2 Parameter 3 Movement errors reported in function block state ERROR In MOVE-UP- The Position has changed contra FB instance Position last position CLOCKWISE state clockwise while moving up MoveContraClockwise clockwise (actual Position=%d, 0x4022...
Function blocks 3.26.9 State information The FB CamMonitor can have the following states. They are made available to the user via the diagnostic information. Value Name Description The function block is in RUN state, the CamMonOK output is 1, 0x01 and the other outputs are set according to the current position.
Page 195
Function blocks Value Name Description The function block assumes the MOVE-UP-TDC2 state if 0x27 MOVE-UP-TDC2 TDC2Area or TDC2ExceededArea becomes TRUE in MOVE- (Pendulum mode) DOWN-CONTRA-CLOCKWISE or MOVE-UP-CONTRA- CLOCKWISE state. The function block assumes the MOVE-STOP-TDC2 state if 0x28 MOVE-STOP-TDC2 the press is stopped in MOVE-UP-TDC2 state. (Pendulum mode) 0x29 MOVE-START-TDC2...
Function blocks 3.27 The function block SLI 3.27.1 Functional description The FB SLI is used to save the Position input when a rising edge is encountered at input SLI (LatchPosition). As long as SLI is set to TRUE, the system checks whether the position is within the limits LatchPosition - Limit neg and LatchPosition + Limit pos.
Function blocks 3.27.2 Signal description Table 3-163: FB SLI inputs Name Permitted type Data type Description TwinSAFE-In BOOL Input for activating the function and saving the FB-Out current position. TwinSAFE SC Position TwinSAFE-In INT16 Position value. Is set with a rising edge at SLI FB-Out INT32 stored and compared with the saved position...
Page 198
Function blocks 3.27.2.1 Diagnostic and state information for the FB SLI Table 3-168: Diagnostic information Value Description no diagnostic information Underflow (PositionDiff < -NegLimit) Overflow (PositionDiff > PosLimit) Table 3-169: Diag Message Text ID Meaning Parameter 1 Parameter 2 Parameter 3 0x40C0 An underflow has occurred FB instance...
Function blocks 3.27.3 FB SLI configuration in TwinCAT 3 Figure 3-124: FB SLI configuration Figure 3-125: FB SLI properties Function blocks for TwinSAFE logic components...
Page 200
Function blocks Figure 3-126: FB SLI port properties A mouse click next to the FB Port can be used to create variables that can be linked with input or output signals. Settings such as changing the data type or activation of the input can be made via the properties of the FB port.
Function blocks 3.28 The function block Envelope 3.28.1 Functional description The FB Envelope is used to create an envelope from the amount of InValue plus the defined Offset and to check during each function block call cycle whether InValue violates this envelope. The input data types INT16, INT32, UINT16 and UINT32 are permitted for InValue.
Page 202
Function blocks Figure 3-128: Function block Envelope NOTE KL6904/EL6900 The function block Envelope is not available in the KL6904 and the EL6900. Function blocks for TwinSAFE logic components...
Function blocks 3.28.2 Signal description Table 3-171: FB Envelope inputs Name Permitted type Data type Description SafeFunction TwinSAFE-In BOOL Input for the safety function. FB-Out InValue TwinSAFE-In INT16 Position or analog value to be monitored for FB-Out INT32 deceleration or change in direction of 0 within Standard-In UINT16 an envelope curve.
Page 204
Function blocks 3.28.2.1 Diagnostic and state information for the FB Envelope Table 3-176: Diagnostic information Value Description no diagnostic information Underflow (InValue below the envelope curve) Overflow (InValue above the envelope curve) InValue Error MaxTimeExpired Table 3-177: Diag Message Text ID Meaning Parameter 1 Parameter 2...
Page 205
Function blocks Table 3-178: State information Value Description The FB ENV module assumes the RUN state if the input SafeFunction is TRUE. The outputs assume the following values: Error=0 SafeFunctionOut=1 STOP The FB ENV module assumes the STOP state if the input FbRun is FALSE. The outputs assume the following values: Error=0 SafeFunctionOut=0...
Function blocks 3.28.3 FB Envelope configuration in TwinCAT 3 Figure 3-129: FB Envelope configuration Figure 3-130: FB Envelope properties Function blocks for TwinSAFE logic components...
Page 207
Function blocks Figure 3-131: FB Envelope port properties A mouse click next to the FB Port can be used to create variables that can be linked with input or output signals. Settings such as changing the data type or activation of the input can be made via the properties of the FB port.
Function blocks 3.29 The function block ViolationCounter 3.29.1 Functional description The FB ViolationCnt can be used to realize a weighted error counter. The counter is enabled (TRUE) or disabled (FALSE) via the Enable input. If the counter is disabled, the InputOK output is set to FALSE, ActViolationCnt is set to 0.
Function blocks 3.29.2 Signal description Table 3-179: FB ViolationCnt inputs Name Permitted Data type Description type Enable TwinSAFE-In BOOL Input for activating the function. FB-Out Standard-In Input TwinSAFE-In BOOL This value is checked whenever the function block is FB-Out called. It ensures that the error counter is incremented Standard-In or decremented.
Page 210
Function blocks 3.29.2.1 Diagnostic and state information for the FB ViolationCnt Table 3-184: Diagnostic information Value Description no diagnostic information Table 3-185: Diag Message Text ID Meaning Parameter 1 Parameter 2 Parameter 3 Table 3-186: State information Value Description If the input Enable is TRUE and LimitOverrun is FALSE, the FB VIOCNT module assumes the RUN state and modifies the ActViolationCnt value.
Function blocks 3.29.3 FB ViolationCnt configuration in TwinCAT 3 Figure 3-133: FB ViolationCnt configuration Figure 3-134: FB ViolationCnt properties Figure 3-135: FB ViolationCnt port properties A mouse click next to the FB Port can be used to create variables that can be linked with input or output signals.
Function blocks 3.30 The function block XOR 3.30.1 Functional description The XOR function block provides the user with up to 8 XOR (exclusive or) functions (XOR1 to XOR8). Two inputs Xor1In(x) and 2 inputs Xor2In(x) are linked in exclusive or mode. The result is output at output XorOut(x).
Function blocks 3.30.2 Signal description Table 3-187: FB OR inputs Name Permitted Data type Description type Xor1In1 TwinSAFE-In BOOL Input1 of XOR1 FB-Out TwinSAFE SC Xor2In1 TwinSAFE-In BOOL Input2 of XOR1 FB-Out TwinSAFE SC Xor1In2 TwinSAFE-In BOOL Input1 of XOR2 FB-Out TwinSAFE SC Xor2In2...
Page 214
Function blocks Table 3-188: FB XOR outputs Name Permitted Data Description type type XorOut1 TwinSAFE-Out BOOL Output of XOR1 FB-In Standard-Out XorOut2 TwinSAFE-Out BOOL Output of XOR2 FB-In Standard-Out XorOut3 TwinSAFE-Out BOOL Output of XOR3 FB-In Standard-Out XorOut4 TwinSAFE-Out BOOL Output of XOR4 FB-In Standard-Out...
Function blocks Table 3-193: State information Value Description The FB XOR module assumes the RUN state if the input FbRun is TRUE. The outputs assume the following values, depending on the active input pairs (configuration: FB Input Active): XorOutY = (Xor1InY XOR Xor2InY) AND FB Input Active(Y) with Y = {1,2 .. 8} STOP The FB XOR module assumes the STOP state if the input FbRun is FALSE.
Page 216
Function blocks Figure 3-138: Properties of the FB XOR Figure 3-139: Port properties of the FB XOR Function blocks for TwinSAFE logic components...
Beckhoff products and system solutions. Beckhoff Support and Service is available to you wherever you are in the world, and can be reached by telephone, fax or e-mail. The contact addresses for your country can be found in the list of Beckhoff branches and partner firms.