While it is possible to upload or download a recipe from the Recipe Builder, you may want to create or modify operator displays that upload or download recipes.
When an operator uploads or downloads a recipe from an operator display, the Recipe Package uploads or downloads each recipe item. No dialog or message boxes appear to inform you about the status of the recipe during the upload or download. Any errors that occur are not saved unless you enable the audit trail or use the Error File command line parameter.
When uploading a recipe, the Recipe Package automatically saves the recipe. If the Recipe Upload system task cannot read a process value from the database, it clears the existing formula for that recipe item.
If the recipe being downloaded has recipe items with verification enabled, these recipe items are verified as part of the download process. Refer to the sections Displaying Download Results, Verifying a Recipe, and Changing the Verification Time-out Interval for more information about recipe verification.
In addition, if security has been enabled, iFIX compares the security areas of the target blocks to the security areas assigned to the Recipe user account. If the security system finds a match, it downloads the recipe value. Otherwise, the value is not written to the database.
Similarly, iFIX compares the security area of the operator display against the security areas assigned to the currently logged in user. If a match is found, iFIX opens the display. Neither the security rights to recipe application features nor the security area of the recipe is examined.
To upload or download a recipe from an operator display, create a picture with the necessary objects. For each object you want to use for uploading or downloading include a script with the Shell function. This function, when executed, starts the recipe system task you specify.
For example, you may want to add push button objects to upload and download recipes. The following sample script shows how you can download a recipe:
Private Sub Button1_Click()
Dim download As String
Dim return_value As Double
download = System.ProjectPath + "\RCPDOWN" + " /cRCPFILE /e"
return_value = Shell (download, 0)
End Sub
To create an upload script, define a variable called upload in place of the download variable and substitute the reference to RCPDOWN with RCPUP as follows:
upload = System.ProjectPath + "\RCPUP" + "/cRCPFILE /e"
Including Command Line Parameters
As these examples show, you can include command line parameters in the script. To help troubleshoot the upload and download process, you should include the Error File parameter so that any errors are saved in an error file called recipe.RCE. This file resides in either the Master Recipe path or the Control Recipe path, depending on the type of recipe that was uploaded or downloaded. You can display the contents of this file using a text editor.
If you have enabled the audit trail for the recipe, you may also want to include the Batch ID and Download Remarks parameters. To learn more about the command line parameters for the Recipe Upload and Recipe Download programs, refer to the appendix Command Line Parameters. For more information about the Shell function, refer to the Microsoft Visual Basic Reference Help system.