Apply security to recipes
- Last UpdatedApr 14, 2025
- 2 minute read
Access to recipes can be controlled by defining an Item Name in the recipe template file that sets the minimum security access level required to load, save, or delete a recipe.
In the following file sample, the SecurityLevel Item Name is defined as an analog tag. The Review unit contains the SecurityLevel analog tag for this item. Each recipe defines a value that is loaded into the SecurityLevel tag when the recipe is loaded into the Review unit.

You can create a window containing an access denied message that is shown whenever your security access level is invalid for a selected recipe. To do so, the selected recipe must be loaded into a unit that contains only an analog tag to which the selected recipe's security level value is loaded for verification.
For example:
RecipeSelectRecipe("c:\recipe\machine.csv",MyRecipe, "131");
The Select a Recipe dialog box appears. After you select a Recipe Name, it is returned to the RecipeName tag and the script continues running.
RecipeLoad( "c:\Recipe\Machine.csv", "Review", MyRecipe );
IF SecurityLevel <= $AccessLevel THEN
Status =RecipeLoad( "c:\Recipe\Machine.csv", "PLC1", MyRecipe );
ELSE
Show "Access Denied";
ENDIF;
When this script runs, if your access level is equal to or greater than 7000, the selected recipe's values are loaded into PLC1 unit's tags. If not, the Access Denied window appears and the recipe is not loaded into PLC1.