Detailed information | Signal sequence diagram
This diagram is based on a typical type 2 two-hand control application.
Temporary intermediate states are not illustrated in the signal sequence diagram. Only typical input signal combinations are illustrated. Other signal combinations are possible.
0 | The function block is not yet activated (Activate = FALSE). As a result, all outputs are FALSE or SAFEFALSE. |
1 | Function block activated by Activate = TRUE. At this point, the two buttons are not actuated (S_Button1 and S_Button2 = SAFEFALSE). Both inputs must be SAFEFALSE during activation of the function block, so the Error output remains FALSE. |
2 | If both buttons are actuated, inputs S_Button2 and S_Button1 change one after the other from SAFEFALSE to SAFETRUE. When S_Button1 switches to SAFETRUE, the condition for two-hand control is met and the S_TwoHandOut output becomes SAFETRUE. |
3 | The S_TwoHandOut output becomes SAFEFALSE, as S_Button1 switches to SAFEFALSE (button is released). |
4 | Although the button at S_Button1 is now actuated again, the S_TwoHandOut output remains SAFEFALSE, as a change in state has only occurred at input S_Button1, with input S_Button2 remaining SAFETRUE throughout. |
5 | The function block is deactivated: Activate switches to FALSE. While the function block is inactive, S_Button2 returns to SAFEFALSE (button 2 is released). This change in state has no effect on the function block outputs, as the function block is not activated. |
6 | Function block is activated again (Activate becomes TRUE again). The signal combination at the inputs (S_Button1 = SAFETRUE and S_Button2 = SAFEFALSE) at the time when the function block is activated again leads to an error message (Error = TRUE, S_TwoHandOut = SAFEFALSE). Both inputs must be SAFEFALSE when the function block is being activated. |
7 | The error message is "reset", as S_Button1 and S_Button2 are now in the SAFEFALSE state (neither button is actuated). |
8 | Both buttons are actuated again, the condition for two-hand control is met, and S_TwoHandOut switches to SAFETRUE again. |
Application example
This example shows the connection of a type 2 two-hand control device with the safety-related SF_TwoHandControlType2 function block.
Each of the two buttons has both an N/C and an N/O contact and is connected to safety-related input device PSDI 1 via a two-channel arrangement.
The two resulting signals monitored for antivalence are each assigned to global I/O variables and connected to the function block inputs S_Button1 and S_Button2 for evaluation.
Hinweis
The S_TwoHandOut enable output of the SF_TwoHandControlType2 function block is connected to an output terminal of the application via a global I/O variable or via other safety-related functions/function blocks. Connect the S_TwoHandOut enable output of the SF_TwoHandControlType2 function block to the S_OutControl input of the SF_EDM function block, for example, thus implementing a two-channel output connection. |
Weitere Infos
For more detailed information, refer to the description of the corresponding safety-related function block. |
Hinweis
The SF_TwoHandControlType2 function block must not be activated by means of a TRUE constant at its Activate input, but the activation must be done by the application of the higher-level standard controller. Possible measure for the activation of the SF_TwoHandControlType2 function block at its Activate input: At each device involved in the safety-related function, one input is fixed to "1". These inputs are AND combined and then used for activating the safety-related function. The safety-related function is not activated until all safety-related devices involved deliver valid process data. For that purpose, one safety-related input must be used per input module. With this measure, operation with partial configurations is possible. |
S1 | Button 1 |
S2 | Button 2 |
 | See second note above the illustration. |
Function block instantiation
The IEC 61131-3 standard defines function block instantiation. Instantiation means, a function block is defined once and can be used (instantiated) several times. This applies to all standard and safety-related FBs (local POUs as well as firmware and user library FBs).
Why instantiation? A function block has an internal memory where it stores its own processing data (local variables). As a consequence, the output values calculated by the FB depend on the internally stored values. The same input values applied to an FB instance do not necessarily deliver the same results in another FB instance. Therefore, it is necessary to store the internal data of the FB to a separated memory area each time the function block is processed, i.e., for each FB instance. To uniquely identify each FB instance and to clearly separate its memory area, instance names are used. The instance name of a function block has to be declared in the 'Variables' table of the POU where the FB is going to be used.
The following applies:
- Function blocks can be instantiated in other function blocks or in program POUs. Calling FBs in function POUs is not possible.
- Functions are called without instantiation because they do not have an internal memory.
Safety-related and standard (non-safety-related) code is strictly distinguished in PLCnext Engineer. If a Safety PLC is included in your project, the following applies:
- Safety-related FBs can only be instantiated in safety-related POUs but not in standard (non-safety-related) POUs.
- User-defined standard FBs can only be instantiated in standard POUs. They cannot be called in safety-related POUs.
- Particular standard firmware FBs can be instantiated in both safety-related and standard POUs.
Hinweis
When inserting a standard FB into a safety-related SNOLD network, the rules for implicit type conversion (safety-related to standard) apply. |
Example for the instantiation of a safety-related PLCopen function block
The safety-related PLCopen function block 'SF_EmergencyStop_V2_00' was inserted into the project via a library. It is then available in the 'Programming' category of the COMPONENTS area. There is a folder with the same name as the library that provides the FBs for insertion into the safety-related code. The FB is to be called twice in the code of the safety-related program 'S_Main' to evaluate the status of two safety-related emergency stop command devices. For each FB instance, an instance name is declared in the 'Variables' table of the calling program: EStop_M1 and EStop_M2. The FB instances have been inserted into the code worksheet, each instance with different variables connected to its input and output formal parameters.
Additional information is available in the following sections:
|