SF_RecipeDeleteDataSet
Help version 1.1 / Issue date: 2023.03
The following description is valid for the function block SF_RecipeDeleteDataSet, Version 1.0z (where z = 0 to 9).
Short Description
| The SF_RecipeDeleteDataSet FB can delete a specified data set in a recipe file by overwriting each value in the file section with the value 0.After completing the data set delete operation, the Done output is set to SAFETRUE. |
Block Icon
|  |
Inputs
| Activate
Short description | Value |
State-controlled input for activating the function block. Data type: BOOL Initial value: FALSE |
-
FALSE: Function block inactive.
-
TRUE: Function block activated.
|
Refer to the topic "Activate input" for details.
CommandDelete
Short description | Value |
Edge-triggered input that starts the function block operation.Data type: SAFEBOOL Initial value: SAFEFALSE |
-
SAFEFALSE: No data set delete operation is requested.
-
SAFETRUE: Request to delete the specified recipe data set.
|
Refer to the topic "CommandDelete input" for details.
IDRecipeFile
Short description | Value |
Input for specifying the ID of the recipe file in which a data set is to be deleted.Data type: SAFEINTInitial value: 0 Value range: 1 to 8 | Apply the numeric file ID to this input. |
Refer to the topic "IDRecipeFile input" for details.
IDRecipeDataSet
Short description | Value |
Input for specifying the ID of the data set (inside the recipe file) which is to be deleted.Data type: SAFEINTValid values: >= 1. The upper limit depends on PLC type. Initial value: 0 | Apply the numeric data set ID (within the file addressed by IDRecipeFile) to this input. |
Refer to the topic "IDRecipeDataSet input" for details.
|
Outputs
| Done
Short description | Value |
Output for signaling "function block processing completed".Data type: SAFEBOOL |
-
SAFEFALSE:
- Function block is not activated (Activate = FALSE), or
- the function block processing is still in progress, or
- the function block could not complete the processing due to an error.
Refer to...
- ... the detailed description of the Done output (link below this table).
- ... the value present at the DiagCode output for details.
-
SAFETRUE:
- Function block is activated (Activate = TRUE) and
- the function block has completed its operation successfully.
|
Refer to the topic "Done output" for details.
FileCRC
Short description | Value |
Output for the file checksum the function block has calculated over the file after deleting the data set.Data type: SAFEDWORD Initial value: 0 | Calculated checksum over the modified file. |
Refer to the topic "FileCRC output" for details.
DiagCode
Short description | Value |
Output for diagnostic message.Data type: WORD | Diagnostic message of the function block. The possible values are listed and described in the topic "Diagnostic codes". |
|
Detailed information | 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.
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 safety-related recipe function block
The SF_RecipeDeleteDataSet function block was inserted into the project via the RecipeFile 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'. For each FB instance, an instance name is declared in the 'Variables' table of the calling program: SF_RecipeDeleteDataSet1 and SF_RecipeDeleteDataSet2. 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:
|