This diagram is based on a typical type III 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 | Button 2 (on S_Button2) is actuated, which starts the monitoring time. Button 1 is also pressed within the required period of 500 ms. 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 and S_Button2 switch to SAFEFALSE within a short time of each other (buttons are released). |
4 | The button on S_Button1 is now actuated again. The monitoring time begins. |
5 | Monitoring time runs without button 2 having been pressed. Therefore, the S_TwoHandOut output remains in the defined safe state SAFEFALSE and an error is displayed at the Error output as a result of the TRUE status. |
6 | Button 1 is released again, which means that the SAFEFALSE state is now present at both inputs. This causes the error message at Error to be reset: Error becomes FALSE. |
7 | The function block is deactivated: Activate switches to FALSE. Button 2 is pressed while the function block is inactive. This change in state does not start the monitoring time, however, as the function block has not been activated. |
8 | Function block is activated again (Activate becomes TRUE again). The signal combination at the inputs (S_Button1 = SAFEFALSE and S_Button2 = SAFETRUE) 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. |
9 | The error message is "reset", as S_Button1 and S_Button2 are now in the SAFEFALSE state (neither button is actuated). |
10 | Both buttons are actuated again (within a period of 500 ms), the condition for two-hand control is fulfilled, and S_TwoHandOut switches to SAFETRUE again. |
This example shows the connection of a type III two-hand control device with the safety-related SF_TwoHandControlTypeIII 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
Note
The S_TwoHandOut enable output of the SF_TwoHandControlTypeIII function block is connected to an output terminal of the application, either directly or via other safety-related functions/function blocks. Connect the S_TwoHandOut enable output of the SF_TwoHandControlTypeIII function block to the S_OutControl input of the EDM function block, for example, thus implementing a two-channel output connection. |
Further Info
For more detailed information, please refer to the description of the corresponding safety-related function block. |
S1 | Button 1 |
S2 | Button 2 |
 | See note above the illustration. |
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 FBs (user-defined POUs as well as library FBs, such as IEC standard FBs, firmware FBs, 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 the 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.
Note
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 user-defined function block
The user-defined function block 'TLC' ("Two Level Controller") is added to the 'Functions & Function Blocks' category (COMPONENTS area). It shall be called twice in the program POU 'Container' to control the filling level and the temperature of a boiler.
For both FB instances, an instance name declaration is added to the 'Variables' table of the calling program POU 'Container': TLCTemperature and TLCLevel. Thus the 'TLC' function block can be called twice in the code worksheet of the calling POU by means of these instance names.
Both FB instances have been inserted into the 'Container' code worksheet, each instance with different variables connected to its input and output formal parameters ('Level...' and 'Temperature...').