Using Recipes in Runtime SECTION 10 Recipes
163
If there is no validation code to execute, the recipe is downloaded anyway.
The download process consists of setting each ingredient to its specified
target value.
The download may fail at this stage if there are problems communicating with
a PLC. A communications failure results in the error message "Downloading
recipe failed". A delay in response from the PLC of more than one minute
results in the error message "Recipe transfer timed out".
When the recipe download is complete, all the ingredients are saved and the
CX-Supervisor runtime environment continues to run in the normal manner. An
event is logged stating that the recipe was successfully downloaded.
10-10-3 Uploading a Recipe
There are two ways of uploading a recipe definition in runtime. The first
method is to use a CX-Supervisor script function attached to a graphical object
on a page, such as a push button. The function call is:
UpLoadRecipe("<NameOfRecipe>")
The other way to upload a recipe, is to display the Recipe Viewer as described
in the previous chapter. Highlight the desired recipe from the recipe list and
click the button. The Modify/Save Upload Recipe dialog box opens:
The Modify Target button allows the target value for an ingredient to be
modified by means of the Modify Ingredient dialog box. An ingredient must
already be selected from the list of ingredients for this recipe. Any change to
the target value is saved in the recipe definition. Any number of ingredients
may be modified in this way when the recipe is uploaded.
Selecting the OK button will upload the recipe. If for some reason the recipe
definition can't be found, the following error message appears: "The recipe
failed its validation checks. Upload aborted".
Each recipe upload must be completed before another can be started. If a
recipe upload is already in progress when another is started, the following
error message appears: "A recipe Upload or Download is currently in
progress".
The upload may fail at this stage if there are problems communicating with a
PLC. A communications failure results in the error message "Uploading recipe
failed". A delay in response from the PLC of more than one minute results in
the error message "Recipe transfer timed out".